I am new to web services and I am trying to use JAX WS to access a Web Service. I do have the wsdl locally, and I have generated the corresponding java-classes using wsimport.
However, when I see the generated classes, the action of the WebMethod does not match the actual URL where the services are (the services are located at https://services.acme.com/some/other/path)
@WebMethod(operationName = "SearchRQ", action = "http://www.acme.com/schema/services/qo/search:SearchRQIn")
@WebResult(name = "SearchRS", targetNamespace = "http://www.foo.org/bar/2003", partName = "messagePart")
public SearchRS mySearchRQ(@WebParam(name = "SearchRQ", targetNamespace = "http://www.foo.org/bar/2003", partName = "messagePart") SearchRQ messagePart);
so when I try to access the services through the code below, I get a HTTP 404
SearchServicePort servicePort = new SearchServicePort();
SearchServiceInterface port = servicePort.getSearchServicePort();
SearchRQ rq = new SearchRQ();
SearchRS rs = port.mySearchRQ(rq);
I do realize that the action differs from where the services are located and that probably is the reason, but I do not understand why the wsdl points me to the wrong place. Is this a service that is not compatible with JAX WS? How can I tell?
the WSDL header looks like this
<definitions xmlns:tns="http://www.acme.com/schema/services/qo/search" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:import0="http://www.foo.org/bar/2003" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SearchService" targetNamespace="http://www.acme.com/schema/services/qo/search" xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">This service provides search</wsdl:documentation>
<port name="SearchServicePort" binding="tns:SearchService">
<soap:address location="https://www.acme.com/some/other/path" />
aha, the address part is almost correct. It contains a 'www' instead of 'services', but the remaining part is correct. When replacing the 'www' with the 'services' in the wsdl, I do not get any 404 anymore, instead I get the below. Seems like I am getting an answer, right?
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Internal Error (from client)