[jboss-user] [Beginner's Corner] - Trying a very simple WebService

Breako Beats do-not-reply at jboss.com
Thu Jun 10 18:14:31 EDT 2010


Breako Beats [http://community.jboss.org/people/breako] replied to the discussion

"Trying a very simple WebService"

To view the discussion, visit: http://community.jboss.org/message/547454#547454

--------------------------------------------------------------
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 http://travelagent.titan.com",
        wsdlLocation=" http://127.0.0.1:8080/TitanEJBProject/TravelAgentWSBean?wsdl 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 http://127.0.0.1:8080/TitanEJBProject/TravelAgentWSBean?wsdl"),
                new QName(" http://travelagent.titan.com/ 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/ 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
[http://community.jboss.org/message/547454#547454]

Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100610/964f99db/attachment.html 


More information about the jboss-user mailing list