Community

Trying a very simple WebService

reply from Breako Beats in Beginner's Corner - View the full discussion

If I may follow  up on this - it is beginners corner after all :-)

 

I am trying to write the simpliest possible standalone to invoke this service. I try:

 

@WebServiceClient(name="TravelAgentWSBeanService",
        targetNamespace="http://travelagent.titan.com",
        wsdlLocation="http://127.0.0.1:8080/TitanEJBProject/TravelAgentWSBean?wsdl")
public class JAXWSClient extends Service{
   
    public JAXWSClient() throws Exception{
        super(new URL("http://127.0.0.1:8080/TitanEJBProject/TravelAgentWSBean?wsdl"),
                new QName("http://travelagent.titan.com/", "TravelAgentWSBeanService"));
    }
   
    public static void main(String args[]) throws Exception {
        JAXWSClient jaxWSClient = new JAXWSClient();
        TravelAgentWSBean wsBean = jaxWSClient.getTravelAgentWSBeanPort();
        wsBean.makeReservation(0, 0, 0, 0d);
    }
   
    @WebEndpoint(name = "TravelAgentWSBeanPort")
    public TravelAgentWSBean getTravelAgentWSBeanPort() {
        return super.getPort(new QName("http://travelagent.titan.com/", "TravelAgentWSBeanPort"), TravelAgentWSBean.class);
    }

 

}

 

 

whenI run I get:

 

Exception in thread "main" java.lang.IllegalArgumentException: com.titan.travelagent.TravelAgentWSBean is not an interface
    at java.lang.reflect.Proxy.getProxyClass(Unknown Source)
    at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)

 

 

Do I have to use wsimport on the wsdl and generate some proxy classes?

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community