14 Replies Latest reply on Feb 4, 2009 10:15 PM by bains

    Wise SoapClient

    bains

      Hi,

      I am trying to use wise SOAPClient to invoke a web service secured by BASIC authentication. Its configuration is similar to the webservice_consumer_wise sample. Before this, I tried to use the other SOAPClient (org.jboss.soa.esb.actions.soap.SOAPClient) but got authentication error. Using Wise SOAPClient, I was able to download the remote wsdl and generate code but failed to invoke the method with the following exception:

      Outbound message:
      10:05:04,578 INFO [STDOUT] <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:deletePMSVoidPeriod xmlns="http://vo.message
      centre.dha.gov.au/xsd" xmlns:ns2="http://service.messagecentre.dha.gov.au" xmlns:ns3="http://subtypes.vo.messagecentre.dha.gov.au/xsd"/></env:Body></env:Envelope>
      10:05:04,594 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
      java.io.IOException: Could not transmit message
      at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:255)
      at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:73)
      at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:339)
      at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
      at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:172)
      at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:152)
      at $Proxy113.deletePMSVoidPeriod(Unknown Source)
      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 it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:75)
      at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:108)
      at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:280)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
      at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker. Invalid HTTP server response [401] - An Authentication object was not found in the Securi
      tyContext. Response: An Authentication object was not found in the SecurityContext/401.
      at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:348)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:137)
      at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
      at org.jboss.remoting.Client.invoke(Client.java:1634)
      at org.jboss.remoting.Client.invoke(Client.java:548)
      at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:233)
      ... 18 more
      Caused by: org.jboss.ws.WSException: Invalid HTTP server response [401] - An Authentication object was not found in the SecurityContext
      at org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP.read(SOAPMessageUnMarshallerHTTP.java:77)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:518)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:307)
      ... 23 more
      10:05:04,594 INFO [STDOUT]
      Inbound message:
      10:05:04,594 INFO [STDOUT] <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><env:Fault xmlns:env='http://schemas.xmlsoap.org/
      soap/envelope/'>env:Server
      10:05:04,594 INFO [STDOUT]
      10:05:04,594 INFO [STDOUT] Could not transmit message
      10:05:04,594 INFO [STDOUT]
      10:05:04,594 INFO [STDOUT] </env:Fault>
      10:05:04,594 INFO [STDOUT] </env:Body></env:Envelope>
      10:05:04,594 INFO [STDOUT] error invoking:public abstract it.javalinux.wise.BaseVO it.javalinux.wise.PMSDatabasePortType.deletePMSVoidPeriod(it.javalinux.wise.PMSVoidPeriodVO)
      10:05:04,594 INFO [STDOUT] error invoking:[Ljava.lang.Object;@52f14d
      10:05:04,594 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Address jms://localhost:
      1099/queue/testESB_messagecentre_consumer_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties
      jbossesb:java.naming.provider.url : localhost:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:dest
      ination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceP
      roperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:Refere
      nceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 7b8ebecb-5997-43ec-bafc-d441941d4c26 RelatesTo: jms:correlationID#7b8ebecb-5997-43ec-bafc-d441941d4c26 ]
      org.jboss.soa.esb.actions.ActionProcessingException: Could not call methoddeletePMSVoidPeriod
      at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:282)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
      at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: it.javalinux.wise.core.exceptions.WiseException: Unknown exception received: null
      at it.javalinux.wise.core.exceptions.WiseException.rethrow(WiseException.java:44)
      at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:87)
      at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:108)
      at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:280)
      ... 5 more
      Caused by: java.lang.reflect.InvocationTargetException
      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 it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:75)
      ... 7 more
      Caused by: javax.xml.ws.WebServiceException: java.io.IOException: Could not transmit message
      at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:404)
      at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:314)
      at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:172)
      at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:152)
      at $Proxy113.deletePMSVoidPeriod(Unknown Source)
      ... 12 more
      Caused by: java.io.IOException: Could not transmit message
      at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:255)
      at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:73)
      at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:339)
      at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
      ... 15 more
      Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker. Invalid HTTP server response [401] - An Authentication object was not found in the Securi
      tyContext. Response: An Authentication object was not found in the SecurityContext/401.
      at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:348)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:137)
      at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
      at org.jboss.remoting.Client.invoke(Client.java:1634)
      at org.jboss.remoting.Client.invoke(Client.java:548)
      at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:233)
      ... 18 more
      Caused by: org.jboss.ws.WSException: Invalid HTTP server response [401] - An Authentication object was not found in the SecurityContext
      at org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP.read(SOAPMessageUnMarshallerHTTP.java:77)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:518)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:307)
      ... 23 more
      10:05:04,594 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: JMSEpr [ PortReference < <wsa:Address jms://localhost:1099/queue/testESB_messagecentre
      _consumer_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.u
      rl : localhost:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:Ref
      erenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent :
      true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : ur
      n:jboss/esb/epr/type/jms/> > ] MessageID: 7b8ebecb-5997-43ec-bafc-d441941d4c26 RelatesTo: jms:correlationID#7b8ebecb-5997-43ec-bafc-d441941d4c26


      The SOAPClient cofiguration in jboss-esb.xml is as follows:

      <action class="org.jboss.soa.esb.actions.soap.wise.SOAPClient" name="soapui-client-action">
       <property name="wsdl" value="http://10.17.2.41:9999/MessageCentre/services/PMSDatabase?wsdl">
       <http-client-property name="file" value="/META-INF/namadgi-https-9999.properties" />
       </property>
       <property name="SOAPAction" value="deletePMSVoidPeriod"/>
       <property name="password" value="xxxxxx"/>
       <property name="username" value="xxxxxx"/>
       <property name="EndPointName" value="PMSDatabaseSOAP11port_http"/>
       <property name="LoggingMessages" value="true"/>
       <property name="serviceName" value="PMSDatabase"/>
       </action>


      What else is required to add the authentication object to the Security Context? Any help would be greatly appreciated.
      Thanks Benu.

        • 1. Re: Wise SoapClient
          maeste

          Hmm it seems a bug.
          I'll work on this tonight: https://jira.jboss.org/jira/browse/JBESB-2265
          it will be fixed in 4.5. Perhaps I can provide you a patch for 4.4 if you need it immediately.

          • 2. Re: Wise SoapClient
            maeste

            Done.
            HAve a look to jira and come back to me if you have any further questions/problems

            • 3. Re: Wise SoapClient
              bains

              Hi Stefano,

              Thanks for providing the patch. After I applied the patch to my JBoss installation, I got a different exception as follows:

              Outbound message:
              11:18:13,093 INFO [STDOUT] <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:deletePMSVoidPeriod xmlns="http://vo.message
              centre.dha.gov.au/xsd" xmlns:ns2="http://service.messagecentre.dha.gov.au" xmlns:ns3="http://subtypes.vo.messagecentre.dha.gov.au/xsd"/></env:Body></env:Envelope>
              11:18:13,202 ERROR [SOAPMessageUnMarshallerHTTP] Cannot unmarshall SOAPMessage
              javax.xml.soap.SOAPException: Unsupported content type: text/html; charset=utf-8
              at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:258)
              at org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP.read(SOAPMessageUnMarshallerHTTP.java:84)
              at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:518)
              at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:307)
              at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:137)
              at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
              at org.jboss.remoting.Client.invoke(Client.java:1634)
              at org.jboss.remoting.Client.invoke(Client.java:548)
              at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:233)
              at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:73)
              at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:339)
              at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
              at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:172)
              at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:152)
              at $Proxy102.deletePMSVoidPeriod(Unknown Source)
              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 it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:81)
              at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:114)
              at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:323)
              at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
              at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
              at java.lang.Thread.run(Thread.java:619)
              11:18:13,218 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
              java.io.IOException: Could not transmit message
              at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:255)
              at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:73)
              at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:339)
              at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
              at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:172)
              at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:152)
              at $Proxy102.deletePMSVoidPeriod(Unknown Source)
              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 it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:81)
              at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:114)
              at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:323)
              at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
              at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
              at java.lang.Thread.run(Thread.java:619)
              Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker. javax.xml.soap.SOAPException: Unsupported content type: text/html; charset=utf-8. Respons
              e: Internal Server Error/500.
              at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:348)
              at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:137)
              at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
              at org.jboss.remoting.Client.invoke(Client.java:1634)
              at org.jboss.remoting.Client.invoke(Client.java:548)
              at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:233)
              ... 18 more
              Caused by: java.io.IOException: javax.xml.soap.SOAPException: Unsupported content type: text/html; charset=utf-8
              at org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP.read(SOAPMessageUnMarshallerHTTP.java:92)
              at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:518)
              at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:307)
              ... 23 more
              Caused by: javax.xml.soap.SOAPException: Unsupported content type: text/html; charset=utf-8
              at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:258)
              at org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP.read(SOAPMessageUnMarshallerHTTP.java:84)
              ... 25 more
              11:18:13,280 INFO [STDOUT]
              Inbound message:
              11:18:13,280 INFO [STDOUT] <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><env:Fault xmlns:env='http://schemas.xmlsoap.org/
              soap/envelope/'>env:Server
              11:18:13,280 INFO [STDOUT]
              11:18:13,280 INFO [STDOUT] Could not transmit message
              11:18:13,280 INFO [STDOUT]
              11:18:13,280 INFO [STDOUT] </env:Fault>
              11:18:13,280 INFO [STDOUT] </env:Body></env:Envelope>
              11:18:13,280 INFO [STDOUT] error invoking:public abstract au.gov.dha.messagecentre.vo.xsd.BaseVO au.gov.dha.messagecentre.service.PMSDatabasePortType.deletePMSVoidPeriod(au.gov.dh
              a.messagecentre.vo.xsd.PMSVoidPeriodVO)
              11:18:13,280 INFO [STDOUT] error invoking:[Ljava.lang.Object;@198e338
              11:18:13,296 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Address jms://127.0.0.1:
              1099/queue/testESB_messagecentre_consumer_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties
              jbossesb:java.naming.provider.url : 127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:dest
              ination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceP
              roperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:Refere
              nceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 3b13fad6-04c0-4b3e-bff9-311a28167595 RelatesTo: jms:correlationID#3b13fad6-04c0-4b3e-bff9-311a28167595 ]
              org.jboss.soa.esb.actions.ActionProcessingException: Could not call methoddeletePMSVoidPeriod
              at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:327)
              at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
              at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
              at java.lang.Thread.run(Thread.java:619)
              Caused by: it.javalinux.wise.core.exceptions.WiseException: Unknown exception received: null
              at it.javalinux.wise.core.exceptions.WiseException.rethrow(WiseException.java:44)
              at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:93)
              at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:114)
              at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:323)
              ... 5 more
              Caused by: java.lang.reflect.InvocationTargetException
              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 it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:81)
              ... 7 more
              Caused by: javax.xml.ws.WebServiceException: java.io.IOException: Could not transmit message
              at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:404)
              at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:314)
              at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:172)
              at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:152)
              at $Proxy102.deletePMSVoidPeriod(Unknown Source)
              ... 12 more
              Caused by: java.io.IOException: Could not transmit message
              at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:255)
              at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:73)
              at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:339)
              at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
              ... 15 more
              Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker. javax.xml.soap.SOAPException: Unsupported content type: text/html; charset=utf-8. Respons
              e: Internal Server Error/500.
              at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:348)
              at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:137)
              at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
              at org.jboss.remoting.Client.invoke(Client.java:1634)
              at org.jboss.remoting.Client.invoke(Client.java:548)
              at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:233)
              ... 18 more
              Caused by: java.io.IOException: javax.xml.soap.SOAPException: Unsupported content type: text/html; charset=utf-8
              at org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP.read(SOAPMessageUnMarshallerHTTP.java:92)
              at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:518)
              at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:307)
              ... 23 more
              Caused by: javax.xml.soap.SOAPException: Unsupported content type: text/html; charset=utf-8
              at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:258)
              at org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP.read(SOAPMessageUnMarshallerHTTP.java:84)
              ... 25 more
              11:18:13,296 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: JMSEpr [ PortReference < <wsa:Address jms://127.0.0.1:1099/queue/testESB_messagecentre
              _consumer_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.u
              rl : 127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:Ref
              erenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent :
              true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : ur
              n:jboss/esb/epr/type/jms/> > ] MessageID: 3b13fad6-04c0-4b3e-bff9-311a28167595 RelatesTo: jms:correlationID#3b13fad6-04c0-4b3e-bff9-311a28167595


              Is there any sample or quickstart that uses BASIC auth to invoke a web service?
              Also in the outbound message I could not see the parameter that I had set as a Map instance on the default body location. Do I need to set it to a named body location instead? I am not sure about this since the readme for webservice_consumer_wise quick start does not match with what had been done in jboss-esb.xml and MyRequestAction files.

              Thanks again for your help. Benu.

              • 4. Re: Wise SoapClient
                maeste

                 

                "bains" wrote:
                Hi Stefano,

                Thanks for providing the patch. After I applied the patch to my JBoss installation, I got a different exception as follows:

                You are welcome


                Inbound message:
                11:18:13,280 INFO [STDOUT] <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><env:Fault xmlns:env='http://schemas.xmlsoap.org/
                soap/envelope/'><faultcode>env:Server
                11:18:13,280 INFO [STDOUT] </faultcode>
                11:18:13,280 INFO [STDOUT] <faultstring>Could not transmit message
                11:18:13,280 INFO [STDOUT] </faultstring>
                11:18:13,280 INFO [STDOUT] </env:Fault>
                11:18:13,280 INFO [STDOUT] </env:Body></env:Envelope>

                The problem is here. You are receiving an unexpected error from the server.


                Is there any sample or quickstart that uses BASIC auth to invoke a web service?

                Not yet. We will provide one in 4.5


                Also in the outbound message I could not see the parameter that I had set as a Map instance on the default body location. Do I need to set it to a named body location instead? I am not sure about this since the readme for webservice_consumer_wise quick start does not match with what had been done in jboss-esb.xml and MyRequestAction files.

                Thanks again for your help. Benu.

                Default body location is fine. Don't forget the parameter names have to match with parameter names defined in your wsdl. If you could send me a basic sample of your needs I could take a look and give you some hints. You could attach it on Jira issue and/or send me by mail (address in Wise Team page).


                • 5. Re: Wise SoapClient
                  bains

                  Hi Stefano,

                  I have added my comment and attached files to the jira issue.

                  Thanks
                  Benu

                  • 6. Re: Wise SoapClient
                    maeste

                    Ok, I''ve taked a very rapid look. The poblem is that you need a smooks transformation that you are not providing. You have to map your single parameter to your complex input object. An example (very similar to yours)
                    take from one of my project using wise is this (very little modification to make it readable for you):

                    <?xml version="1.0"?>
                    <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
                    
                     <resource-config selector="global-parameters">
                     <param name="stream.filter.type">SAX</param>
                     </resource-config>
                    
                     <resource-config selector="your.local.Pojo">
                     <resource>org.milyn.javabean.BeanPopulator</resource>
                     <param name="beanId">BuyRequestParameter</param>
                     <param name="beanClass">it.javalinux.wise.BuyRequestParameter</param>
                     <param name="bindings">
                     <binding property="vatNumber" selector="localizationCode" />
                     </param>
                     </resource-config>
                    
                    </smooks-resource-list>
                    

                    if this hint isn't sufficient, feel free to get back to me.

                    • 7. Re: Wise SoapClient
                      bains

                      Hi Stefano,

                      Thanks for the hint. I gave it a try. It was a simple configuration but I took a long time understand it since I had never looked at Smooks before. I created a simple POJO to hold the data and set it to the request parameter hashmap for the webservice call. I added smooks config files to transform the request and response as follows:

                      pmsRequestSmooks.xml

                      <?xml version="1.0"?>
                      <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
                       <resource-config selector="global-parameters">
                       <param name="stream.filter.type">SAX</param>
                       </resource-config>
                      
                       <resource-config selector="au.gov.dha.pms.PMSData">
                       <resource>org.milyn.javabean.BeanPopulator</resource>
                       <param name="beanId">data</param>
                       <param name="beanClass">au.gov.dha.messagecentre.vo.xsd.PMSVoidPeriodVO</param>
                       <param name="bindings">
                       <binding property="vprn" selector="vprn" />
                       </param>
                       </resource-config>
                      </smooks-resource-list>


                      pmsResponseSmooks.xml
                      <?xml version="1.0"?>
                      <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
                       <resource-config selector="global-parameters">
                       <param name="stream.filter.type">SAX</param>
                       </resource-config>
                      
                       <resource-config selector="au.gov.dha.messagecentre.vo.xsd.PMSVoidPeriodVO">
                       <resource>org.milyn.javabean.BeanPopulator</resource>
                       <param name="beanId">data</param>
                       <param name="beanClass">au.gov.dha.pms.PMSData</param>
                       <param name="bindings">
                       <binding property="vprn" selector="vprn" />
                       </param>
                       </resource-config>
                      </smooks-resource-list>


                      When I run my test client, I get the following exception:
                      15:25:17,733 ERROR [STDERR] org.milyn.SmooksException: Failed to filter source.
                      15:25:17,733 ERROR [STDERR] at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:68)
                      15:25:17,733 ERROR [STDERR] at org.milyn.Smooks.filter(Smooks.java:288)
                      15:25:17,733 ERROR [STDERR] at org.milyn.container.plugin.PayloadProcessor.process(PayloadProcessor.java:112)
                      15:25:17,733 ERROR [STDERR] at it.javalinux.wise.core.mapper.SmooksMapper.applyMapping(SmooksMapper.java:99)
                      15:25:17,733 ERROR [STDERR] at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:121)
                      15:25:17,733 ERROR [STDERR] at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:323)
                      15:25:17,733 ERROR [STDERR] at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
                      15:25:17,733 ERROR [STDERR] at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
                      15:25:17,733 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
                      15:25:17,733 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
                      15:25:17,733 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
                      15:25:17,733 ERROR [STDERR] Caused by: org.milyn.SmooksException: Error in 'org.milyn.javabean.BeanInstancePopulator' while processing the visitAfter event.
                      15:25:17,733 ERROR [STDERR] at org.milyn.delivery.sax.SAXHandler.processVisitorException(SAXHandler.java:373)
                      15:25:17,733 ERROR [STDERR] at org.milyn.delivery.sax.SAXHandler.visitAfter(SAXHandler.java:260)
                      15:25:17,733 ERROR [STDERR] at org.milyn.delivery.sax.SAXHandler.endElement(SAXHandler.java:144)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.io.xml.SaxWriter.endNode(SaxWriter.java:605)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.io.WriterWrapper.endNode(WriterWrapper.java:26)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.io.path.PathTrackingWriter.endNode(PathTrackingWriter.java:34)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:113)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.visit(AbstractReflectionConverter.java:88)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:117)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:73)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:43)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:55)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:50)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:52)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:46)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:55)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:50)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:73)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.marshal(ReferenceByXPathMarshallingStrategy.java:34)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.XStream.marshal(XStream.java:765)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.XStream.marshal(XStream.java:754)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.io.xml.SaxWriter.parse(SaxWriter.java:535)
                      15:25:17,733 ERROR [STDERR] at com.thoughtworks.xstream.io.xml.SaxWriter.parse(SaxWriter.java:510)
                      15:25:17,733 ERROR [STDERR] at org.milyn.delivery.java.XStreamXMLReader.parse(XStreamXMLReader.java:104)
                      15:25:17,733 ERROR [STDERR] at org.milyn.delivery.sax.SAXParser.parse(SAXParser.java:49)
                      15:25:17,733 ERROR [STDERR] at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:65)
                      15:25:17,733 ERROR [STDERR] ... 10 more
                      15:25:17,733 ERROR [STDERR] Caused by: org.milyn.cdr.SmooksConfigurationException: Bean [data] configuration invalid. Bean setter method [setVprn(java.lang.String)] not found on t
                       ype [au.gov.dha.messagecentre.vo.xsd.PMSVoidPeriodVO]. You may need to set a 'decoder' on the binding config.
                      15:25:17,733 ERROR [STDERR] at org.milyn.javabean.BeanInstancePopulator.populateAndSetPropertyValue(BeanInstancePopulator.java:347)
                      15:25:17,733 ERROR [STDERR] at org.milyn.javabean.BeanInstancePopulator.populateAndSetPropertyValue(BeanInstancePopulator.java:317)
                      15:25:17,733 ERROR [STDERR] at org.milyn.javabean.BeanInstancePopulator.bindSaxDataValue(BeanInstancePopulator.java:260)
                      15:25:17,733 ERROR [STDERR] at org.milyn.javabean.BeanInstancePopulator.visitAfter(BeanInstancePopulator.java:204)
                      15:25:17,733 ERROR [STDERR] at org.milyn.delivery.sax.SAXHandler.visitAfter(SAXHandler.java:253)
                      15:25:17,733 ERROR [STDERR] ... 34 more
                      15:25:17,733 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Address jms://127.0.0.1:
                      1099/queue/testESB_messagecentre_consumer_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties
                       jbossesb:java.naming.provider.url : 127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:dest
                      ination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceP
                      roperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:Refere
                      nceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 4cf521f9-a8f5-4cd8-b559-cb455055b703 RelatesTo: jms:correlationID#4cf521f9-a8f5-4cd8-b559-cb455055b703 ]
                      org.jboss.soa.esb.actions.ActionProcessingException: Could not call methoddeletePMSVoidPeriod
                       at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:327)
                       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
                       at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
                       at java.lang.Thread.run(Thread.java:619)
                      Caused by: it.javalinux.wise.core.exceptions.WiseException: Transformation Failed
                       at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:129)
                       at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:323)
                       ... 5 more


                      The java type - PMSVoidPeriodVO generated from wsdl at runtime by Wise, has the following method in it:

                      public void setVprn(JAXBElement<String> value) {
                       this.vprn = ((JAXBElement<String> ) value);
                       }


                      How do I set the decoder to JAXBElement in smooks config file? I tried setting type="javax.xml.bind.JAXBElement", but that didn't work.

                      Besides the above I noticed a few differences in my application since I started using the soap.esb patch:

                      1. BASIC auth error went away for good. Thanks for that.
                      2. The SoapClient generates the JAXB bindings when I start the server, to which the esb archive has already been deployed. With older version of soap.esb, the java types were generated only after I ran my test client. Is this OK?
                      3. The package structure used to generate the java types for wsdl is different between the 2 versions. The original one used it.javalinux.wise.*, while the one you provided uses the same package structure as in the wsdl.
                      4. When I use ctrl-C to cmd to shutdown my server, it hangs at the end of it and I have to kill the process forcibly. When I reverted back to original soap.esb, the server shutdown was normal but the I get the BASIC auth error back. Any ideas why that happens?

                      Server shutdown log with new soap.esb
                      15:21:54,857 INFO [TomcatDeployer] undeploy, ctxPath=/, warUrl=.../deploy/jboss-web.deployer/ROOT.war/
                      15:21:54,857 INFO [TomcatDeployer] undeploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
                      15:21:54,857 INFO [TomcatDeployer] undeploy, ctxPath=/juddi, warUrl=.../tmp/deploy/tmp6049juddi-exp.war/
                      15:21:54,950 INFO [TomcatDeployer] undeploy, ctxPath=/jbossws, warUrl=.../deploy/jbossws.sar/jbossws-context.war/
                      15:21:54,950 INFO [TomcatDeployer] undeploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
                      15:21:55,654 INFO [HypersonicDatabase] Database standalone closed clean
                      


                      Server shutdown log with original soap.esb
                      15:21:54,857 INFO [TomcatDeployer] undeploy, ctxPath=/, warUrl=.../deploy/jboss-web.deployer/ROOT.war/
                      15:21:54,857 INFO [TomcatDeployer] undeploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
                      15:21:54,857 INFO [TomcatDeployer] undeploy, ctxPath=/juddi, warUrl=.../tmp/deploy/tmp6049juddi-exp.war/
                      15:21:54,950 INFO [TomcatDeployer] undeploy, ctxPath=/jbossws, warUrl=.../deploy/jbossws.sar/jbossws-context.war/
                      15:21:54,950 INFO [TomcatDeployer] undeploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
                      15:21:55,654 INFO [HypersonicDatabase] Database standalone closed clean
                      15:21:55,997 INFO [TransactionManagerService] Stopping recovery manager
                      15:21:56,169 INFO [Server] Shutdown complete
                      Shutdown complete
                      Halting VM
                      Terminate batch job (Y/N)?


                      • 8. Re: Wise SoapClient
                        maeste

                         

                        "bains" wrote:
                        Hi Stefano,


                        The java type - PMSVoidPeriodVO generated from wsdl at runtime by Wise, has the following method in it:

                        public void setVprn(JAXBElement<String> value) {
                         this.vprn = ((JAXBElement<String> ) value);
                         }


                        How do I set the decoder to JAXBElement in smooks config file? I tried setting type="javax.xml.bind.JAXBElement", but that didn't work.

                        Well the error above is saying you havent a set method with JAXBElement in your local pojo, not in generated one. If it is what you want to do you have to provide in smooks config file a decoder to convert JAXBElement into String. An alternative is to provide this method in your pojo.

                        1. BASIC auth error went away for good. Thanks for that.

                        great

                        2. The SoapClient generates the JAXB bindings when I start the server, to which the esb archive has already been deployed. With older version of soap.esb, the java types were generated only after I ran my test client. Is this OK?

                        It is supposed to be a feature, anticipating generation and compilation they don't charge first execution time.

                        3. The package structure used to generate the java types for wsdl is different between the 2 versions. The original one used it.javalinux.wise.*, while the one you provided uses the same package structure as in the wsdl.

                        It is supposed to be a feature: say this post http://www.jboss.com/index.html?module=bb&op=viewtopic&t=141695
                        To get back the old behaviour just set this property in wise-core.properties of your project
                        wise.targetPackage=it.javalinux.wise
                        

                        4. When I use ctrl-C to cmd to shutdown my server, it hangs at the end of it and I have to kill the process forcibly. When I reverted back to original soap.esb, the server shutdown was normal but the I get the BASIC auth error back. Any ideas why that happens?

                        Very strange. I'll investigate about.
                        Please consider that features and fix provided by this patch will be included in ESB 4.5 which moreover will use Wise 1.0 under the hood adding some other features (WS-*) and some improvement.



                        Sorry for the lengthy post, but I wanted to give you as much info as possible.

                        Thanks Benu.

                        No problem for the long post, it's useful for me too. Hoping I have helped with my ansers. Of course get back to me if you need something more.
                        BTW I'm often available on ESB' IRC channel if you need me (nick = maeste)

                        • 9. Re: Wise SoapClient
                          tfennelly

                          You could write a "JAXBElementDecoder" implementation and configure that in. This is a simple class to implement and there are lots of examples. It's just a simple decode method that would generate a JAXBElement instance from the selected data value in the message (i.e. vprn in this case). You'd then configure the Decoder class in the type attribute.

                          • 10. Re: Wise SoapClient
                            bains

                            Hello,

                            Finally I got my example working. Thanks to both of you.

                            I tried changing the data type to JAXBElement in my local POJO, but that didn't work. I had to write my own decoder - JAXBElementDecoder to do the mapping in smooks config file. So now the requestPmsSmooks.xml looks like this:

                            <?xml version="1.0"?>
                            <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
                             <resource-config selector="global-parameters">
                             <param name="stream.filter.type">SAX</param>
                             </resource-config>
                            
                             <resource-config selector="au.gov.dha.pms.PMSData">
                             <resource>org.milyn.javabean.BeanPopulator</resource>
                             <param name="beanId">data</param>
                             <param name="beanClass">au.gov.dha.messagecentre.vo.xsd.PMSVoidPeriodVO</param>
                             <param name="bindings">
                             <binding property="vprn" type="JAXBElementDecoder" selector="vprn" />
                             </param>
                             </resource-config>
                            
                             <resource-config selector="decoder:JAXBElementDecoder">
                             <resource>au.gov.dha.JAXBElementDecoder</resource>
                             </resource-config>
                            
                            </smooks-resource-list>


                            pmsResponseSmooks.xml:

                            <?xml version="1.0"?>
                            <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
                             <resource-config selector="global-parameters">
                             <param name="stream.filter.type">SAX</param>
                             </resource-config>
                            
                             <resource-config selector="au.gov.dha.messagecentre.vo.xsd.BaseVO">
                             <resource>org.milyn.javabean.BeanPopulator</resource>
                             <param name="beanId">data</param>
                             <param name="beanClass">au.gov.dha.pms.PMSData</param>
                             <param name="bindings">
                             <binding property="success" type="BooleanDecoder" selector="success" />
                             </param>
                             </resource-config>
                            
                             <resource-config selector="decoder:BooleanDecoder">
                             <resource>org.milyn.javabean.decoders.BooleanDecoder</resource>
                             </resource-config>
                            </smooks-resource-list>


                            So now I have only 2 queries left;
                            1. JBoss server hangs every time I try to do a shutdown and also the hot deployment of the esb archive does not work.
                            2. Can you please throw some pointers towards the fault recovery mechanism of JBoss ESB as per my requirements mentioned in the JIRA issue? Abstract below:

                            ......provides real time message monitoring with remediation capabilities ie: enables the admin to resend any of the failed messages from the management console. For example, if I have 3 web services to be invoked in an action pipeline and the last message fails to get delivered, I should be able to resend only the last message again without having to invoke the other 2 services. I have been reading the docs relating to DLQ and redeliver service but not sure if they can do all of the above......


                            Thanks a lot for your time. Benu.


                            • 11. Re: Wise SoapClient
                              maeste

                               

                              "bains" wrote:
                              Hello,

                              Finally I got my example working. Thanks to both of you.

                              Very good news!

                              I tried changing the data type to JAXBElement in my local POJO, but that didn't work. I had to write my own decoder - JAXBElementDecoder to do the mapping in smooks config file. So now the


                              To make post more useful for future readers (perhaps reaching it by search) would you share also the mapper class (it should be just few line of code, right?)


                              So now I have only 2 queries left;
                              1. JBoss server hangs every time I try to do a shutdown and also the hot deployment of the esb archive does not work.

                              It will be fixed in ESB 4.5 (few weeks to go).


                              2. Can you please throw some pointers towards the fault recovery mechanism of JBoss ESB as per my requirements mentioned in the JIRA issue? Abstract below:

                              I think there is more qualified people than me to answer this question reading this forum.



                              • 12. Re: Wise SoapClient
                                bains

                                Hi Stefano,

                                Here is the code for JAXBElementDecoder, though it would be nice to have it in Wise distribution itself. QName and the param name can be parameterized for this decoder.

                                @DecodeType(JAXBElement.class)
                                public class JAXBElementDecoder implements DataDecoder {
                                
                                 public Object decode(String data) throws DataDecodeException {
                                 return new JAXBElement<String>(new QName("http://vo.messagecentre.dha.gov.au/xsd", "vprn"), String.class, data);
                                 }
                                }


                                Also, will there be a new version of SOA platform including ESB 4.5?

                                Thanks
                                Benu

                                • 13. Re: Wise SoapClient
                                  maeste

                                  Oki, good idea,

                                  I'll include it (with parametrized QName params) in Wise 1.0.1, that will be the one shipped with JBossESB 4.5

                                  • 14. Re: Wise SoapClient
                                    bains

                                    Hi Stefano,

                                    I am back again at using wise soap client to invoke an external web service with a slightly different scenario. The only difference here being that the web service is outside the firewall and probably the proxy requires NTLM auth.

                                    The action in jboss-esb.xml:

                                    <action class="org.jboss.soa.esb.actions.soap.wise.SOAPClient" name="soapui-client-action">
                                     <property name="wsdl" value="http://xml.redcoal.com/soapserver.dll/wsdl/ISoapServer">
                                     <http-client-property name="file" value="/META-INF/redcoal-http-8080.properties" />
                                     </property>
                                     <property name="SOAPAction" value="SendTextSMS"/>
                                     <property name="EndPointName" value="ISoapServerPort"/>
                                     <property name="LoggingMessages" value="true"/>
                                     <property name="serviceName" value="ISOAPServerservice"/>
                                    </action>


                                    redcoal-http-8080.properties:
                                    # Configurators
                                    #configurators=HttpProtocol,AuthBASIC,AuthNTLM,....HTTPProxyAuth
                                    configurators=AuthNTLM
                                    
                                    # HTTPProxyAuth config...
                                    protocol-socket-factory=org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory
                                    http.proxyHost=proxy.xx.xx.xx
                                    http.proxyPort=8080
                                    http.proxyUsername=abc
                                    http.proxyPassword=abcpass
                                    
                                    # AuthNTLM config...
                                    ntauth-username=abc
                                    ntauth-password=abcpass
                                    ntauthscope-host=proxy.xx.xx.xx
                                    ntauthscope-port=8080
                                    ntauthscope-domain=ABC


                                    Does Wise soap client use the configurators in http-client-property file at all? With the above config, the deployment of esb archive fails with following exception:
                                    [ServiceController] Problem starting service jboss.esb:deployment=WorkOrders.esb
                                    org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException: Error configuring action processing pipeline
                                     at org.jboss.soa.esb.listeners.message.MessageAwareListener.doInitialise(MessageAwareListener.java:188)
                                     at org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle.initialise(AbstractManagedLifecycle.java:133)
                                     at org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController.initialiseInstances(ManagedLifecycleController.java:150)
                                    .
                                    .
                                    .
                                    .
                                    .
                                     at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                                     at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
                                     at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                                     at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                                     at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                                    Caused by: org.jboss.soa.esb.ConfigurationException: Unexpected exception during lifecycle initialisation
                                     at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.initialise(ActionProcessingPipeline.java:264)
                                     at org.jboss.soa.esb.listeners.message.MessageAwareListener.doInitialise(MessageAwareListener.java:184)
                                     ... 51 more
                                    Caused by: org.jboss.soa.esb.actions.ActionLifecycleException: Error durinfg wise client cache cleaning
                                     at org.jboss.soa.esb.actions.soap.wise.SOAPClient.initialise(SOAPClient.java:271)
                                     at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.initialise(ActionProcessingPipeline.java:259)
                                     ... 52 more
                                    Caused by: org.jboss.soa.esb.actions.ActionProcessingException: Error durinfg wise client creation
                                     at org.jboss.soa.esb.actions.soap.wise.SOAPClient.initialise(SOAPClient.java:228)
                                     ... 53 more
                                    Caused by: it.javalinux.wise.core.exceptions.WiseConnectionException: Wsdl download failed!
                                     at it.javalinux.wise.core.client.WSDynamicClientFactory.transferWSDL(WSDynamicClientFactory.java:228)
                                     at it.javalinux.wise.core.client.WSDynamicClientFactory.getUsableWSDL(WSDynamicClientFactory.java:166)
                                     at it.javalinux.wise.core.client.WSDynamicClientFactory.getClient(WSDynamicClientFactory.java:128)
                                     at org.jboss.soa.esb.actions.soap.wise.SOAPClient.initialise(SOAPClient.java:223)
                                     ... 53 more
                                    Caused by: java.net.ConnectException: Connection timed out: connect
                                     at java.net.PlainSocketImpl.socketConnect(Native Method)
                                     at java.net.PlainSocketImpl.doConnect(Unknown Source)
                                     at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
                                     at java.net.PlainSocketImpl.connect(Unknown Source)
                                     at java.net.Socket.connect(Unknown Source)
                                     at java.net.Socket.connect(Unknown Source)
                                     at sun.net.NetworkClient.doConnect(Unknown Source)
                                     at sun.net.www.http.HttpClient.openServer(Unknown Source)
                                     at sun.net.www.http.HttpClient.openServer(Unknown Source)
                                     at sun.net.www.http.HttpClient.<init>(Unknown Source)
                                     at sun.net.www.http.HttpClient.New(Unknown Source)
                                     at sun.net.www.http.HttpClient.New(Unknown Source)
                                     at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
                                     at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
                                     at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
                                     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
                                     at java.net.HttpURLConnection.getResponseCode(Unknown Source)
                                     at it.javalinux.wise.core.client.WSDynamicClientFactory.transferWSDL(WSDynamicClientFactory.java:198)
                                     ... 56 more


                                    When I use org.jboss.soa.esb.actions.soap.SOAPClient in action as follows, I get a different exceptions depending on the configurator.

                                    <action class="org.jboss.soa.esb.actions.soap.SOAPClient" name="soapui-client-action">
                                     <property name="wsdl" value="http://xml.redcoal.com/soapserver.dll/wsdl/ISoapServer">
                                     <http-client-property name="file" value="/META-INF/redcoal-http-8080.properties" />
                                     </property>
                                     <property name="SOAPAction" value="SendTextSMS"/>
                                     <property name="responseAsOgnlMap" value="true"/>
                                     </action>


                                    With AuthNTLM as configurator, I get the following exception:
                                    [HttpMethodDirector] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
                                    13:30:19,415 INFO [HttpMethodDirector] Retrying request
                                    13:30:40,331 INFO [HttpMethodDirector] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
                                    13:30:40,331 INFO [HttpMethodDirector] Retrying request
                                    13:31:01,343 INFO [HttpMethodDirector] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
                                    13:31:01,343 INFO [HttpMethodDirector] Retrying request
                                    13:31:48,758 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Address jms://localhost:1099/queue/work_orders_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: e831d663-6af2-4a4f-a813-953de6469d76 RelatesTo: jms:correlationID#e831d663-6af2-4a4f-a813-953de6469d76 ]
                                    org.jboss.soa.esb.actions.ActionProcessingException: Failed to invoke SOAP Endpoint: 'http://xml.redcoal.com/soapserver.dll/soap/ISoapServer ' - 'SendTextSMS'.
                                     at org.jboss.soa.esb.actions.soap.SOAPClient.invokeEndpoint(SOAPClient.java:468)
                                     at org.jboss.soa.esb.actions.soap.SOAPClient.process(SOAPClient.java:416)
                                     at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
                                     at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
                                     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
                                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
                                     at java.lang.Thread.run(Unknown Source)
                                    Caused by: java.net.ConnectException: Connection timed out: connect
                                     at java.net.PlainSocketImpl.socketConnect(Native Method)
                                     at java.net.PlainSocketImpl.doConnect(Unknown Source)
                                     at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
                                     at java.net.PlainSocketImpl.connect(Unknown Source)
                                     at java.net.Socket.connect(Unknown Source)
                                     at java.net.Socket.<init>(Unknown Source)
                                     at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(Unknown Source)
                                     at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(Unknown Source)
                                     at org.apache.commons.httpclient.HttpConnection.open(Unknown Source)
                                     at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(Unknown Source)
                                     at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown Source)
                                     at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown Source)
                                     at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
                                     at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
                                     at org.jboss.soa.esb.actions.soap.SOAPClient.invokeEndpoint(SOAPClient.java:460)
                                     ... 6 more
                                    13:31:51,070 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: JMSEpr [ PortReference < <wsa:Address jms://localhost:1099/queue/work_orders_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: e831d663-6af2-4a4f-a813-953de6469d76 RelatesTo: jms:correlationID#e831d663-6af2-4a4f-a813-953de6469d76


                                    With HTTPProxyAuth as configurator (my own custom configurator based on HttpProtocol with NTCredentials set on the HttpClient), I get the following fault message in response:
                                    [STDOUT] *********** Configuring custom configurator: HTTPProxyAuth **************
                                    13:19:00,250 INFO [STDOUT] Progress: 1 - Caching definition from url [http://xml.redcoal.com/soapserver.dll/wsdl/ISoapServer]
                                    13:19:00,328 INFO [SchemaUtils] Added default schema from file:/D:/java/jboss-4.2.3.GA/server/default/tmp/deploy/tmp14580soapui-1.7.1.jar!/xop.xsd with targetNamespace http://www.w3.org/2004/08/xop/include
                                    13:19:00,360 INFO [SchemaUtils] Added default schema from file:/D:/java/jboss-4.2.3.GA/server/default/tmp/deploy/tmp14580soapui-1.7.1.jar!/XMLSchema.xsd with targetNamespace http://www.w3.org/2001/XMLSchema
                                    13:19:00,375 INFO [SchemaUtils] Added default schema from file:/D:/java/jboss-4.2.3.GA/server/default/tmp/deploy/tmp14580soapui-1.7.1.jar!/xml.xsd with targetNamespace http://www.w3.org/XML/1998/namespace
                                    13:19:00,375 INFO [SchemaUtils] Added default schema from file:/D:/java/jboss-4.2.3.GA/server/default/tmp/deploy/tmp14580soapui-1.7.1.jar!/swaref.xsd with targetNamespace http://ws-i.org/profiles/basic/1.1/xsd
                                    13:19:00,375 INFO [SchemaUtils] Added default schema from file:/D:/java/jboss-4.2.3.GA/server/default/tmp/deploy/tmp14580soapui-1.7.1.jar!/xmime200505.xsd with targetNamespace http://www.w3.org/2005/05/xmlmime
                                    13:19:00,375 INFO [SchemaUtils] Added default schema from file:/D:/java/jboss-4.2.3.GA/server/default/tmp/deploy/tmp14580soapui-1.7.1.jar!/xmime200411.xsd with targetNamespace http://www.w3.org/2004/11/xmlmime
                                    13:19:00,375 INFO [SchemaUtils] Added default schema from D:/java/jboss-4.2.3.GA/server/default/data/soapui-schemas/XMLSchema1999.xsd with targetNamespace http://www.w3.org/1999/XMLSchema
                                    13:19:00,735 INFO [AuthChallengeProcessor] ntlm authentication scheme selected
                                    13:19:01,391 INFO [STDOUT] Progress: 1 - Loading definition from cache
                                    13:19:01,453 INFO [STDOUT] Retrieving document at 'http://xml.redcoal.com/soapserver.dll/wsdl/ISoapServer'.
                                    13:19:01,954 INFO [SchemaUtils] Loading schema types from [http://xml.redcoal.com/soapserver.dll/wsdl/ISoapServer]
                                    13:19:01,954 INFO [SchemaUtils] Getting schema http://xml.redcoal.com/soapserver.dll/wsdl/ISoapServer
                                    13:19:02,204 INFO [WsdlImporter] Finding importer for {http://tempuri.org/}ISOAPServerbinding
                                    13:19:02,204 INFO [WsdlImporter] Importing binding {http://tempuri.org/}ISOAPServerbinding
                                    13:19:02,344 INFO [Soap11HttpBindingImporter] importing endpoint http://xml.redcoal.com/soapserver.dll/soap/ISoapServer
                                    13:19:02,407 INFO [Soap11HttpBindingImporter] importing operation AddBase64MMSContent
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation AddMMSContent
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation CheckMessageStatus
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation CreateGroup
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation CreateMMS
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation DeleteSchedule
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation EnterSchedule
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation EnterScheduleExt
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation GetCreditsLeft
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation GetIncomingMessage
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation GetLicenseInformation
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation GetListEntries
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation GetListNames
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation GetMobileContentPreviewURL
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation GetPropertyPage
                                    13:19:02,438 INFO [Soap11HttpBindingImporter] importing operation RedWebServiceVersion
                                    13:19:02,454 INFO [Soap11HttpBindingImporter] importing operation RegisterAccount
                                    13:19:02,454 INFO [Soap11HttpBindingImporter] importing operation SendBinarySMS
                                    13:19:02,454 INFO [Soap11HttpBindingImporter] importing operation SendBinarySMSByContent
                                    13:19:02,454 INFO [Soap11HttpBindingImporter] importing operation SendMMS
                                    13:19:02,454 INFO [Soap11HttpBindingImporter] importing operation SendMobileContent
                                    13:19:02,454 INFO [Soap11HttpBindingImporter] importing operation SendSMS2
                                    13:19:02,454 INFO [Soap11HttpBindingImporter] importing operation SendTextSMS
                                    13:19:02,454 INFO [Soap11HttpBindingImporter] importing operation SendWAPSI
                                    13:19:02,672 INFO [AuthChallengeProcessor] ntlm authentication scheme selected
                                    13:19:02,797 WARN [SOAPClient] Received status code '500' on HTTP SOAP (POST) request to 'http://xml.redcoal.com/soapserver.dll/soap/ISoapServer'.
                                    13:19:02,813 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                                    13:19:02,813 INFO [STDOUT] Response Map is: {Fault.faultcode=SOAP-ENV:Server, Fault.faultstring=Unknown SOAPAction "SendTextSMS"}
                                    13:19:02,813 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


                                    Can you let me know which soap client to use for the above scenario and how to get it to work?

                                    Thanks Benu.