[jboss-user] [JBossWS] - Re: JSR181 Web Service Client

chamillard do-not-reply at jboss.com
Tue Aug 8 11:52:53 EDT 2006


Thanks for the prompt response! Unfortunately, it's the previous line in the client code that's killing me:

 Hello port = service.getHelloPort();

Here's the HelloService.java file generated by wsimport:

package endpoint.jaws;
  | 
  | import java.net.MalformedURLException;
  | import java.net.URL;
  | import javax.xml.namespace.QName;
  | import javax.xml.ws.Service;
  | import javax.xml.ws.WebEndpoint;
  | import javax.xml.ws.WebServiceClient;
  | 
  | 
  | /**
  |  * This class was generated by the JAXWS SI.
  |  * JAX-WS RI 2.0_01-b15-fcs
  |  * Generated source version: 2.0
  |  * 
  |  */
  | @WebServiceClient(name = "HelloService", targetNamespace = "http://endpoint/jaws", wsdlLocation = "http://localhost:8080/hello/Hello?wsdl")
  | public class HelloService
  |     extends Service
  | {
  | 
  |     private final static URL HELLOSERVICE_WSDL_LOCATION;
  | 
  |     static {
  |         URL url = null;
  |         try {
  |             url = new URL("http://localhost:8080/hello/Hello?wsdl");
  |         } catch (MalformedURLException e) {
  |             e.printStackTrace();
  |         }
  |         HELLOSERVICE_WSDL_LOCATION = url;
  |     }
  | 
  |     public HelloService(URL wsdlLocation, QName serviceName) {
  |         super(wsdlLocation, serviceName);
  |     }
  | 
  |     public HelloService() {
  |         super(HELLOSERVICE_WSDL_LOCATION, new QName("http://endpoint/jaws", "HelloService"));
  |     }
  | 
  |     /**
  |      * 
  |      * @return
  |      *     returns Hello
  |      */
  |     @WebEndpoint(name = "HelloPort")
  |     public Hello getHelloPort() {
  |         return (Hello)super.getPort(new QName("http://endpoint/jaws", "HelloPort"), Hello.class);
  |     }
  | 
  | }
  | 

Additional debugging statements indicate that my service object is null when I try to call the getHelloPort method. I thought that the following in the client code would be creating the object for me (since this is straight from the Sun example):
    @WebServiceRef(wsdlLocation="http://localhost:8080/hello/Hello?wsdl")
  | static HelloService service;

Any idea why this wouldn't be happening?

Thanks,
Tim

(I did make sure I'm getting the user name OK as well).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963841#3963841

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963841



More information about the jboss-user mailing list