1 Reply Latest reply: Jun 15, 2010 5:38 AM by 746732 RSS

    how to pass a binary64 to a java callout?

    669050
      I have a class with a static method that is beeing used to be called by a java callout.
      the method signature is this one

      public static final void Log(byte[] requestParameter, String operacao, String request)

      On my Proxy Service I do an assign before doing the java callouy

      The Java callout is like that
      $body/mat:EnviaMateriaRequestProxy/dad:certificado is a bynary64
      xs:string('teste')
      xs:string('teste')

      After that I start to test my proxy service and get an error. My best guess is that the byte[] is not beeing corrected converted.
      Anyone can help me? Please. I am in a kind o despair.
      Any way to debug the class inside the jar used by callout?


      <con:errorCode>BEA-382515</con:errorCode>
      <con:reason>
      Callout to java method "public static final void br.com.imprensaoficial.audit.AuditLogger.Log(byte[],java.lang.String,java.lang.String) throws java.sql.SQLException,javax.naming.NamingException,java.lang.Exception" resulted in exception: argument type mismatch
      java.lang.IllegalArgumentException: argument type mismatch
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at stages.transform.runtime.JavaCalloutRuntimeStep$1.run(JavaCalloutRuntimeStep.java:158)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
      at weblogic.security.service.SecurityManager.runAs(Unknown Source)
      at weblogic.security.Security.runAs(Security.java:61)
      at stages.transform.runtime.JavaCalloutRuntimeStep.processMessage(JavaCalloutRuntimeStep.java:179)
      at com.bea.wli.sb.pipeline.debug.DebuggerRuntimeStep.processMessage(DebuggerRuntimeStep.java:74)
      at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
      at com.bea.wli.sb.pipeline.PipelineStage.processMessage(PipelineStage.java:84)
      at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:866)
      at com.bea.wli.sb.pipeline.Pipeline.processMessage(Pipeline.java:141)
      at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:866)
      at com.bea.wli.sb.pipeline.PipelineNode.doRequest(PipelineNode.java:55)
      at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
      at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:866)
      at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:191)
      at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:75)
      at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:508)
      at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:506)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
      at weblogic.security.service.SecurityManager.runAs(Unknown Source)
      at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
      at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:505)
      at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:263)
      at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:68)
      at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:125)
      at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:123)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
      at weblogic.security.service.SecurityManager.runAs(Unknown Source)
      at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
      at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:128)
      at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:441)
      at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:169)
      at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:136)
      at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(TestService_sqr59p_EOImpl.java:572)
      at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
      at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
      at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
      at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
      at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_1030_WLStub.invoke(Unknown Source)
      at com.bea.alsb.console.test.TestServiceClient.invoke(TestServiceClient.java:179)
      at com.bea.alsb.console.test.actions.DefaultRequestAction.invoke(DefaultRequestAction.java:117)
      at com.bea.alsb.console.test.actions.DefaultRequestAction.execute(DefaultRequestAction.java:70)
      at com.bea.alsb.console.test.actions.ServiceRequestAction.execute(ServiceRequestAction.java:80)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044)
      at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:91)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2116)
      at com.bea.alsb.console.common.base.SBConsoleRequestProcessor.processActionPerform(SBConsoleRequestProcessor.java:91)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853)
      at com.bea.alsb.console.common.base.SBConsoleRequestProcessor.process(SBConsoleRequestProcessor.java:191)
      at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631)
      at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158)
      at com.bea.console.internal.ConsoleActionServlet.process(ConsoleActionServlet.java:256)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
      at com.bea.console.internal.ConsoleActionServlet.doGet(ConsoleActionServlet.java:133)
      at com.bea.alsb.console.common.base.SBConsoleActionServlet.doGet(SBConsoleActionServlet.java:49)
      at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1199)
      at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1129)
      at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:687)
      at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:142)
      at com.bea.portlet.adapter.scopedcontent.StrutsStubImpl.processAction(StrutsStubImpl.java:76)
      at com.bea.portlet.adapter.NetuiActionHandler.raiseScopedAction(NetuiActionHandler.java:111)
      at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:181)
      at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:167)
      at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:225)
      at com.bea.netuix.nf.ControlLifecycle$2.visit(ControlLifecycle.java:180)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:324)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
      at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:130)
      at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:395)
      at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
      at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:352)
      at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:184)
      at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:159)
      at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:388)
      at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:258)
      at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:199)
      at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:251)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:130)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(Unknown Source)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      </con:reason>
        • 1. Re: how to pass a binary64 to a java callout?
          746732
          Hi Daniel,
          In my research I've found something you can use.
          1. Pass the certificate as a text: $body/mat:EnviaMateriaRequestProxy/dad:certificado/text()
          2. Change the method signature from byte[] to String
          3. Decode it and get the byte[]
                    BASE64Decoder b64dec = new BASE64Decoder();
                    byte[] data = b64dec.decodeBuffer(certificate);

          Hope it could help you.

          Regards.
          Rubén.