Brice,
 
Thanks, I have tried just the plain @WebService, @WebMethod, but I have not tried the Web Service Explorer in Eclipse + WTP, so I will look into that.  Thank you for the help.
 
Matt W.

>>> "Brice Ruth" <[EMAIL PROTECTED]> 5/4/2006 12:01 PM >>>
I'm not sure I can help you with your problem, but I do have a couple tips.
  • your SOAPBinding is reiterating the default (Document/Literal, wrapped)
  • your WebMethod is also reiterating a default ("echo")
not sure about some of the other things, but you may want to start off with just declaring @WebService
...

@WebMethod

and see if that gets you somewhere. The defaults for these annotations should get you a working WSDL & service.

If you're concerned that the client stubs may not be generated right, try using the Web Service Explorer in Eclipse + WTP. That's what I've done in the past as a first-pass sanity check. The WSE is a great tool for that.

Brice

On 5/4/06, Matt Wheeler <[EMAIL PROTECTED]> wrote:
Java 5.  Also, here is my interface and implementation (in case they shed any light).
 
@WebService(name = "EchoService", targetNamespace = "http://www.lds.org/2006/05/03/EchoService ")
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL, parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
public interface Jsr181EchoService
{
 @WebMethod(operationName = "echo", action = "")
 @WebResult(name = "echoResult")
 public String echo(@WebParam(name = "echoParam") String input);
}
 
@WebService(endpointInterface = "org.lds.petstore.ws.Jsr181EchoService")
public class Jsr181EchoServiceImpl implements Jsr181EchoService
{
    public String echo(String input)
    {
        return input;
    }
}
 
and my Spring configuration:
 
 <bean id="xfire.annotationServiceFactory"
        class="org.codehaus.xfire.annotations.AnnotationServiceFactory">
    </bean>
 <bean name="Jsr181EchoService" class=" org.codehaus.xfire.spring.ServiceBean">
  <property name="serviceBean" ref="jsr181EchoServiceImpl" />
<!--   <property name="serviceClass" value="org.lds.petstore.ws.Jsr181EchoService " />-->
  <property name="serviceFactory" ref="xfire.annotationServiceFactory" />
 </bean>
 <bean id="jsr181EchoServiceImpl" class="org.lds.petstore.ws.Jsr181EchoServiceImpl "/>
 
Thanks,
 
Matt W.

>>> "Brice Ruth" <[EMAIL PROTECTED]> 5/4/2006 11:46 AM >>>
Are you using commons-annotations (JDK 1.4) or Java 5 annotations? I'm using the latter and I have not had any problems with the wsdl locations.

Cheers,
Brice

On 5/4/06, Matt Wheeler <[EMAIL PROTECTED] > wrote:
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:
 
<wsdl:port binding="tns:Jsr181EchoServiceImplHttpBinding" name="Jsr181EchoServiceImplHttpPort">
<wsdlsoap:address location=" http://localhost/services/Jsr181EchoServiceImpl"/>
</wsdl:port>
 
Which appears to originate in the HttpTransport class:
 public String getServiceURL( Service service )
 {
        return "http://localhost/services/ " + service.getSimpleName();
  }
 
I think the location should be http://localhost:8080/services/Jsr181EchoServiceImpl .   When I try and test the web service with the following code (dynamic client in the documentation):
 
String input = "garbage in - garbage out";
Client client = new Client(new URL(" http://localhost:8080/petstore/services/Jsr181EchoServiceImpl?WSDL"));

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:
 
Service serviceModel = new ObjectServiceFactory().create(Jsr181EchoService.class);
Jsr181EchoService service = (Jsr181EchoService) new XFireProxyFactory().create(serviceModel, " http://localhost:8080/petstore/services/Jsr181EchoServiceImpl");
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.

------------------------------------------------------------------------------




--
Brice Ruth
Software Engineer, Madison WI

------------------------------------------------------------------------------

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.

------------------------------------------------------------------------------




--
Brice Ruth
Software Engineer, Madison WI

------------------------------------------------------------------------------


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.

------------------------------------------------------------------------------

Reply via email to