Announcement Announcement Module
No announcement yet.
WebServiceTransportException: Not found [404] Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • WebServiceTransportException: Not found [404]

    I'm using Spring WS 1.5 and am having a problem with my first simple web service that simply sends a first and last name which in turn gets echoed back in a response. When I point the browser to http://localhost:7001/services/name.wsdl the wsdl renders without any problems. However, when I try to call the web service from a client program I get a WebServiceTransportException. I've read all the documentation and looked at the examples but I'm really having a tough go at this and could really use some help. Here is the WebServiceClient class

    public class WebServiceClient {

    private static final String MESSAGE =
    "<NameRequest xlmns=\"\"><FirstName>John</FirstName><LastName>Smith</LastName></NameRequest>";

    private final WebServiceTemplate webServiceTemplate = new WebServiceTemplate();

    // send to an explicit URI
    public void customSendAndReceive() {
    StreamSource source = new StreamSource(new StringReader(MESSAGE));
    StreamResult result = new StreamResult(System.out);
    webServiceTemplate.sendSourceAndReceiveToResult("h ttp://localhost:7001/services/nameService",
    source, result);

    public static void main(String [] args) {
    WebServiceClient client = new WebServiceClient();


    Here is the ws-servlet.xml:
    <bean id="name" class=" sdl11Definition">
    <property name="schema" ref="schema" />
    <property name="portTypeName" value="NameResource" />
    <property name="locationUri" value="http://localhost:7001/services/nameService" />

    <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema ">
    <property name="xsd" value="/WEB-INF/schemas/name.xsd"/>

    <bean id="nameEndpoint" class="" />

    <bean class=" ing.PayloadRootQNameEndpointMapping">
    <property name="mappings">
    <prop key="{}NameRequest">nameEndpoint</prop>
    <property name="interceptors">
    <bean class=" rceptor.PayloadLoggingInterceptor" />

    Here is my EndPoint class:
    public class NameEndpoint extends AbstractJDomPayloadEndpoint {

    private XPath nameExpression;

    public NameEndpoint() throws Exception {
    Namespace namespace = Namespace.getNamespace("hr", "");
    nameExpression = XPath.newInstance("concat(//hr:FirstName,' ',//hr:LastName)");

    protected Element invokeInternal(Element nameRequest) throws Exception {
    String name = nameExpression.valueOf(nameRequest);
    Element responseElement = new Element("NameResponse");
    return responseElement;


    and finally the xsd:
    <xs:schema xmlns:xs="" xmlns:hr="" elementFormDefault="qualified"
    <xs:element name="NameRequest">
    <xs:element name="FirstName" type="xs:string" />
    <xs:element name="LastName" type="xs:string" />

    <xs:element name="NameResponse" type="xs:string" />

    As far as I can tell my NameEnpoint invokeInternal method is never getting called.

    Please Help
    Last edited by [email protected]; Apr 24th, 2008, 06:21 PM.

  • #2
    Could you please post the exception's full stack trace please?


    • #3
      Here is the full stack trace:

      Exception in thread "main" xception: Not Found [404]
      at ate.handleError(
      at ate.doSendAndReceive(
      at ate.sendAndReceive(
      at ate.doSendAndReceive(
      at ate.sendSourceAndReceiveToResult(WebServiceTemplat
      at ate.sendSourceAndReceiveToResult(WebServiceTemplat
      at eceive(


      • #4
        You're getting a 404. Are you sure your web service template is pointing to the correct URI?


        • #5
          No I'm not sure I'm pointing to the correct uri. In the WebServiceClient I'm using:

          webServiceTemplate.sendSourceAndReceiveToResult("h ttp://localhost:7001/services/nameService", source, result);

          which is specified in "name" bean in ws-servlet.xml:
          <property name="locationUri" value="http://localhost:7001/services/nameService" />

          What URI should I be using?


          • #6
            I figured it out....I had to wrong URI. Forgot to put the app name in the uri :
            http://localhost:7001/{app name}/services/nameService

            Thanks for you help!


            • #7
              I have same problem

              Can anyone tells me how this problem is solved because I gonna be crazy