I am not 100% sure if this is a bug, but it appears to be. I have created a very simple web service using annotations. If I deploy it, and go to the wsdl, I notice that the location is incorrect:
Which appears to originate in the HttpTransport class:
Object[] results = client.invoke("echo", new Object[] {input});
//System.out.println((String) results[0]);
assertEquals((String) results[0], input);
I get the following stack trace:
Testcase: testEchoWithDynamicClient(org.lds.petstore.ws.Jsr181EchoServiceTest): Caused an ERROR
Couldn't send message.
org.codehaus.xfire.fault.XFireFault: Couldn't send message.
at org.codehaus.xfire.fault.XFireFault.createFault (XFireFault.java:89)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:30)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
at org.codehaus.xfire.client.Client.invoke (Client.java:359)
at org.codehaus.xfire.client.Client.invoke(Client.java:389)
at org.lds.petstore.ws.Jsr181EchoServiceTest.testEchoWithDynamicClient(Jsr181EchoServiceTest.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by:
org.codehaus.xfire.XFireException: Couldn't send message.
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:179)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java :66)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
... 18 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.<init>(Socket.java:365)
at
java.net.Socket.<init>(Socket.java:238)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket (DefaultProtocolSocketFactory.java:121)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send (CommonsHttpMessageSender.java:166)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:168)
... 20 more
Also, it appears that when I navigate to the wsdl of a service that has annotations, the createPort method of Soap11Binding is called, and the transport is an instanceof WSDL11Transport, resulting in a call to getServiceUrl (included above) while if I go to the wsdl of a non-annotated service (made a service through Spring configuration) then in the createPort method, the transport is not an instanceof WSDL11Transport, and so null is returned, which results in a different location in the wsdl.
However, if I test the same service as below, it succeeds:
String input = "garbage in - garbage out";
String result = service.echo(input);
assertEquals(result, input);
So, I am not sure if there is an issue with dynamic client, annotations, or the way I am doing things.
Thanks,
Matt W.
------------------------------------------------------------------------------
NOTICE: This email message is for the sole use of the
intended recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the
intended recipient, please contact the sender by reply email
and destroy all copies of the original message.
------------------------------------------------------------------------------