Announcement Announcement Module
Collapse
No announcement yet.
Please Help! Exception:WebServiceTransportException: Not Found [404] Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Please Help! Exception:WebServiceTransportException: Not Found [404]

    I can't seem to fix this Exception.

    Here's the background.

    I have a simple Spring WS Web Service that works.

    I can use a tool like "POSTMAN" (plug-in to Chrome) and send this service XML requests. I then receive the correct XML Response back in POSTMAN.

    All good so far.

    YET....

    When I try to use Spring's WebServiceTemplate, I get a 404 error on the response.

    I set my defaultUri to the web service root (as I did with POSTMAN) and generated an XML Request. Note that I tested the XML Request generated in the WebServiceTemplate code and it returns a correct response in POSTMAN).

    However, calling the webServiceTemplate.sendSourceAndReceiveToResult(so urce, result) call below
    (Note: This Forum seems to be putting a space in the word "source" above that is not in the code)

    ClientLogMessageHandler[] handler = new ClientLogMessageHandler[1];
    handler[0] = new ClientLogMessageHandler();
    WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
    webServiceTemplate.setDefaultUri
    ("http://localhost:8080/myService/"); // exactly what was entered in POSTMAN in Chrome.

    System.out.println("------- webServiceTemplate ----------" + webServiceTemplate
    .getDefaultUri());

    String requestXML = createRequestXML();
    Source source = new StringSource(requestXML); // Request XML here exactly what works in POSTMAN.
    Result result = new StringResult();
    webServiceTemplate.sendSourceAndReceiveToResult(so urce,result);
    (Note: This Forum seems to be putting a space in the word "source" above that is not in the code)

    System.out.println("--------- result --------" + result.toString());

    ********************************
    Results in this confusing Error Stack:
    ********************************

    org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]
    at org.springframework.ws.client.core.WebServiceTempl ate.handleError(WebServiceTemplate.java:622)
    at org.springframework.ws.client.core.WebServiceTempl ate.doSendAndReceive(WebServiceTemplate.java:546)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:496)
    at org.springframework.ws.client.core.WebServiceTempl ate.doSendAndReceive(WebServiceTemplate.java:451)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:395)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:386)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:376)
    at myServiceClient.invokeService(myServiceClient.java :49)
    at myServiceClient.main(myServiceClient.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main (AppMain.java:120)


    ***********
    ***********

    The referenced "myServiceClient" lines in the error stack above is just where it's calling the web service. Not helpful.

    I'm baffled. There are many confused people who have left postings I've found on the Internet on this exact problem, but no solutions.

    I've tried using a different version of the Spring libs, but that didn't work.

    As many have posted, this problem seems nearly debug-proof. I've spent several days trying to figure out what Spring wants.

    Any suggestions would be most welcome.

    Thanks,
    Last edited by LondonM; May 28th, 2013, 03:28 PM.
Working...
X