This discussion is archived
3 Replies Latest reply: Oct 23, 2012 9:13 AM by 965123 RSS

Newbie: can I use JAX WS here?

970180 Newbie
Currently Being Moderated
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

@WebMethod(operationName = "SearchRQ", action = "")
@WebResult(name = "SearchRS", targetNamespace = "", partName = "messagePart")
public SearchRS mySearchRQ(@WebParam(name = "SearchRQ", targetNamespace = "", 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="" xmlns:soap12="" xmlns:soap="" xmlns:import0="" xmlns:xsd="" name="SearchService" targetNamespace="" xmlns="">
<wsdl:documentation xmlns:wsdl="">This service provides search</wsdl:documentation>
  • 1. Re: Newbie: can I use JAX WS here?
    jtahlborn Expert
    Currently Being Moderated
    what is in the "address" attribute of the "location" element of the wsdl?
  • 2. Re: Newbie: can I use JAX WS here?
    970180 Newbie
    Currently Being Moderated
    <service name="SearchServicePort">
    <port name="SearchServicePort" binding="tns:SearchService">
    <soap:address location="" />

    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" Internal Error (from client)
  • 3. Re: Newbie: can I use JAX WS here?
    965123 Newbie
    Currently Being Moderated
    May be you should post here the code of and without edits (so that line numbers reported in exception trace can correctly be linked to lines in code).


  • Correct Answers - 10 points
  • Helpful Answers - 5 points