Wise SoapClient
bains Jan 7, 2009 6:47 PMHi,
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.