Announcement Announcement Module
Collapse
No announcement yet.
No endpoint mapping found for SaajSoapMessage Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No endpoint mapping found for SaajSoapMessage

    Hello,
    iam training in the web service tutorial in Spring http://static.springsource.org/sprin.../tutorial.html

    I can load the WSDL on http://localhost:8080/holidayService/holiday.wsdl but i can't trigger the implementation of the webservice in the class which is annotated with the @Endpoint. In the JBoss console log there are always the message "WARN [org.springframework.ws.server.EndpointNotFound] (http-localhost-127.0.0.1-8080-4) No endpoint mapping found for [SaajSoapMessage {http://mycompany.com/hr/schemas}HolidayRequest]".

    I have "googled" a lot now and i searched a lot in this forum. But i cant fix the Problem. In can't see any mistakes.

    Everytime i fire up an request with soap ui the WARN Message will be displayed
    Code:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://mycompany.com/hr/schemas">
       <soapenv:Header/>
       <soapenv:Body>
          <sch:HolidayRequest>
             <!--You may enter the following 2 items in any order-->
             <sch:Holiday>
                <sch:StartDate>?</sch:StartDate>
                <sch:EndDate>?</sch:EndDate>
             </sch:Holiday>
             <sch:Employee>
                <sch:Number>?</sch:Number>
                <sch:FirstName>?</sch:FirstName>
                <sch:LastName>?</sch:LastName>
             </sch:Employee>
          </sch:HolidayRequest>
       </soapenv:Body>
    </soapenv:Envelope>

    My spring-ws-servlet.xml
    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:sws="http://www.springframework.org/schema/web-services"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
    
    	<bean id="holiday"
    		class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
    		<property name="schema" ref="schema" />
    		<property name="portTypeName" value="HolidayResource" />
    		<property name="locationUri" value="http://localhost:8080/holidayService/" />
    	</bean>
    
    	<bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
    		<property name="xsd" value="/WEB-INF/hr.xsd" />
    	</bean>
    
    	<sws:annotation-driven />
    
    	<context:component-scan base-package="com.holidayService" />
    </beans>
    My HolidayEndpoint class:

    Code:
    package com.holidayService;
    
    import java.text.SimpleDateFormat;
    import java.util.Date;
    
    import org.jdom.Element;
    import org.jdom.JDOMException;
    import org.jdom.Namespace;
    import org.jdom.xpath.XPath;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.ws.server.endpoint.annotation.Endpoint;
    import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
    import org.springframework.ws.server.endpoint.annotation.RequestPayload;
    
    @Endpoint
    public class HolidayEndpoint
    {
    
       private static final String NAMESPACE_URI = "http://mycompany.com/hr/schemas";
    
       private XPath startDateExpression;
    
       private XPath endDateExpression;
    
       private XPath nameExpression;
    
       private HumanResourceService humanResourceService;
    
       @Autowired
       public HolidayEndpoint(HumanResourceService humanResourceService)
             throws JDOMException
       {
          this.humanResourceService = humanResourceService;
    
          Namespace namespace = Namespace.getNamespace("hr", NAMESPACE_URI);
          System.out.println(namespace.getURI());
          startDateExpression = XPath.newInstance("//hr:StartDate");
          startDateExpression.addNamespace(namespace);
    
          endDateExpression = XPath.newInstance("//hr:EndDate");
          endDateExpression.addNamespace(namespace);
    
          nameExpression = XPath
                .newInstance("concat(//hr:FirstName,' ',//hr:LastName)");
          nameExpression.addNamespace(namespace);
       }
    
       public void setHumanResourceService(
             HumanResourceService humanResourceService)
       {
          this.humanResourceService = humanResourceService;
       }
    
       @PayloadRoot(namespace = NAMESPACE_URI, localPart = "HolidayRequest")
       public void handleHolidayRequest(@RequestPayload Element holidayRequest)
             throws Exception
       {
          SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
          Date startDate = dateFormat.parse(startDateExpression
                .valueOf(holidayRequest));
          Date endDate = dateFormat.parse(endDateExpression
                .valueOf(holidayRequest));
          String name = nameExpression.valueOf(holidayRequest);
    
          humanResourceService.bookHoliday(startDate, endDate, name);
       }
    
    }
    My web.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    	version="2.4">
    
    	<display-name>Archetype Created Web Application</display-name>
    
    	<servlet>
    		<servlet-name>spring-ws</servlet-name>
    		<servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>transformWsdlLocations</param-name>
    			<param-value>true</param-value>
    		</init-param>
    	</servlet>
    
    	<servlet-mapping>
    		<servlet-name>spring-ws</servlet-name>
    		<url-pattern>/*</url-pattern>
    	</servlet-mapping>
    
    </web-app>


    P.S If there are a thread which describes my problem and give me a solution for my problem then shame on me... but i have searched and the solutions for this problem that are written in the threads are not helping me with my problem

    thank you for any help of you...

  • #2
    Did you try adding the context:annotation-config along with context-scan settings?

    Code:
            <context:annotation-config />
    	<context:component-scan base-package="ca.something" />

    Comment


    • #3
      Originally posted by pdurcek View Post
      Did you try adding the context:annotation-config along with context-scan settings?

      Code:
              <context:annotation-config />
      	<context:component-scan base-package="ca.something" />
      Yes, i have added the context:annotation-config. But there is no difference. Everytime i get this response in SOAP UI

      Code:
      <html><head><title>JBoss Web/7.0.13.Final - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The requested resource () is not available.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.0.13.Final</h3></body></html>


      My spring-ws-servlet.xml:
      Code:
      <beans xmlns="http://www.springframework.org/schema/beans"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
      	xmlns:sws="http://www.springframework.org/schema/web-services"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
      
      	
      
      	<context:annotation-config />
      	<context:component-scan base-package="com.holidayService" />
      
      	<sws:annotation-driven />
      	
      	<bean id="holiday"
      		class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
      		<property name="schema" ref="schema" />
      		<property name="portTypeName" value="HolidayResource" />
      		<property name="locationUri" value="http://localhost:8080/holidayService/" />
      	</bean>
      
      	<bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
      		<property name="xsd" value="/WEB-INF/hr.xsd" />
      	</bean>
      
      </beans>

      Comment


      • #4
        What URL are you using in SOAP UI? Something like http://localhost:8080/spring_ws/HolidayResource ?

        Comment


        • #5
          Originally posted by pdurcek View Post
          What URL are you using in SOAP UI? Something like http://localhost:8080/spring_ws/HolidayResource ?
          The URL is http://localhost:8080/holidayService/

          Comment


          • #6
            I had a similar issue and ended up resolving it by double-checking my context root and adjusting the path in Soap UI.

            Comment


            • #7
              Originally posted by pdurcek View Post
              I had a similar issue and ended up resolving it by double-checking my context root and adjusting the path in Soap UI.

              Hm which url do you think it is?

              My wsdl is available at http://localhost:8080/holidayService/holiday.wsdl

              Comment

              Working...
              X