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

    I'm trying to add web services to my project, but I'm having trouble with endpoint mapping. There are many messages about this error, but none of the solutions worked for my situation.
    As my own WS was not working, I replaced it with the sample WS from the reference documentation, trying to clear some mistake, but the error remains. I'd like some help to find out what I am doing wrong on this.

    Spring 3.1
    Spring WS 2.1

    Below is all the relevant code, XML and logging:

    web.xml
    Code:
    <servlet>
            <servlet-name>SpringWsServlet</servlet-name>
            <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>classpath:config/webservices.xml</param-value>
    		</init-param>
    		<init-param>
    			<param-name>transformWsdlLocations</param-name>
    			<param-value>true</param-value>
    		</init-param>
        </servlet>
    
        <servlet-mapping>
            <servlet-name>SpringWsServlet</servlet-name>
            <url-pattern>/holidayService/*</url-pattern>
        </servlet-mapping>
    
        <!-- Remaining servlet mappings (Spring MVC) below -->
    webservices.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.1.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.1.xsd">
    
    	<!-- context:component-scan is defined in other XML -->
    
    	<sws:annotation-driven />
    
    	<sws:dynamic-wsdl id="holiday" portTypeName="HumanResource"
    		locationUri="/holidayService/" targetNamespace="http://mycompany.com/hr/definitions">
    		<sws:xsd location="/WEB-INF/classes/hr.xsd" />
    	</sws:dynamic-wsdl>
    
    </beans>
    hr.xsd (straight from Spring WS reference docs)
    Code:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    	xmlns:hr="http://mycompany.com/hr/schemas" elementFormDefault="qualified"
    	targetNamespace="http://mycompany.com/hr/schemas">
    	<xs:element name="HolidayRequest">
    		<xs:complexType>
    			<xs:all>
    				<xs:element name="Holiday" type="hr:HolidayType" />
    				<xs:element name="Employee" type="hr:EmployeeType" />
    			</xs:all>
    		</xs:complexType>
    	</xs:element>
    	<xs:complexType name="HolidayType">
    		<xs:sequence>
    			<xs:element name="StartDate" type="xs:date" />
    			<xs:element name="EndDate" type="xs:date" />
    		</xs:sequence>
    	</xs:complexType>
    	<xs:complexType name="EmployeeType">
    		<xs:sequence>
    			<xs:element name="Number" type="xs:integer" />
    			<xs:element name="FirstName" type="xs:string" />
    			<xs:element name="LastName" type="xs:string" />
    		</xs:sequence>
    	</xs:complexType>
    </xs:schema>
    HolidayEndpoint.java (also from reference docs, but stripped to the bone)
    Code:
    package myproject.webservice;
    
    import org.jdom.Element;
    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";
    
    	@PayloadRoot(namespace = NAMESPACE_URI, localPart = "HolidayRequest")
    	public void handleHolidayRequest(@RequestPayload Element holidayRequest) {
    		System.out.println(holidayRequest);
    	}
    
    }
    Logs, requesting the WSDL
    Code:
    2012-06-22 15:28:03,727 DEBUG  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Initializing servlet 'SpringWsServlet'
    2012-06-22 15:28:03,814 INFO   [org.springframework.ws.transport.http.MessageDispatcherServlet] : FrameworkServlet 'SpringWsServlet': initialization started
    2012-06-22 15:28:03,820 DEBUG  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Servlet with name 'SpringWsServlet' will try to create custom WebApplicationContext context of class 'org.springframework.web.context.support.XmlWebApplicationContext', using parent context [Root WebApplicationContext: startup date [Fri Jun 22 15:27:05 BRT 2012]; root of context hierarchy]
    2012-06-22 15:28:04,220 INFO   [org.springframework.ws.soap.addressing.server.AnnotationActionEndpointMapping] : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
    2012-06-22 15:28:04,315 DEBUG  [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping] : Looking for endpoints in application context: WebApplicationContext for namespace 'SpringWsServlet-servlet': startup date [Fri Jun 22 15:28:03 BRT 2012]; parent: Root WebApplicationContext
    2012-06-22 15:28:04,385 DEBUG  [org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping] : Looking for endpoints in application context: WebApplicationContext for namespace 'SpringWsServlet-servlet': startup date [Fri Jun 22 15:28:03 BRT 2012]; parent: Root WebApplicationContext
    2012-06-22 15:28:04,982 DEBUG  [org.springframework.ws.wsdl.wsdl11.provider.InliningXsdSchemaTypesProvider] : Inlining SimpleXsdSchema{http://mycompany.com/hr/schemas}
    2012-06-22 15:28:04,993 DEBUG  [org.springframework.ws.wsdl.wsdl11.provider.DefaultMessagesProvider] : Looking for elements in schema with target namespace [http://mycompany.com/hr/schemas]
    2012-06-22 15:28:04,997 DEBUG  [org.springframework.ws.wsdl.wsdl11.provider.DefaultMessagesProvider] : Creating message [{http://mycompany.com/hr/definitions}HolidayRequest]
    2012-06-22 15:28:05,005 DEBUG  [org.springframework.ws.wsdl.wsdl11.provider.SuffixBasedPortTypesProvider] : Creating port type [{http://mycompany.com/hr/definitions}HumanResource]
    2012-06-22 15:28:05,044 DEBUG  [org.springframework.ws.wsdl.wsdl11.provider.SuffixBasedPortTypesProvider] : Adding operation [Holiday] to port type [{http://mycompany.com/hr/definitions}HumanResource]
    2012-06-22 15:28:05,049 DEBUG  [org.springframework.ws.wsdl.wsdl11.provider.Soap11Provider] : Creating binding [{http://mycompany.com/hr/definitions}HumanResourceSoap11]
    2012-06-22 15:28:05,073 DEBUG  [org.springframework.ws.wsdl.wsdl11.provider.Soap11Provider] : Creating service [{http://mycompany.com/hr/definitions}HumanResourceService]
    2012-06-22 15:28:05,077 DEBUG  [org.springframework.ws.wsdl.wsdl11.provider.Soap11Provider] : Adding port [HumanResourceSoap11] to service [{http://mycompany.com/hr/definitions}HumanResourceService]
    2012-06-22 15:28:05,108 INFO   [org.springframework.ws.soap.saaj.SaajSoapMessageFactory] : Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
    2012-06-22 15:28:05,118 DEBUG  [org.springframework.ws.soap.saaj.SaajSoapMessageFactory] : Using MessageFactory class [weblogic.xml.saaj.MessageFactoryImpl]
    2012-06-22 15:28:05,121 DEBUG  [org.springframework.ws.transport.http.MessageDispatcherServlet] : No WebServiceMessageFactory found in servlet 'SpringWsServlet': using default
    2012-06-22 15:28:05,135 DEBUG  [org.springframework.ws.transport.http.MessageDispatcherServlet] : No MessageDispatcher found in servlet 'SpringWsServlet': using default
    2012-06-22 15:28:05,137 DEBUG  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Published [[email protected]b] as holiday.wsdl
    2012-06-22 15:28:05,138 DEBUG  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Published [SimpleXsdSchema{http://mycompany.com/hr/schemas}] as org.springframework.xml.xsd.SimpleXsdSchema#0.xsd
    2012-06-22 15:28:05,138 DEBUG  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Published WebApplicationContext of servlet 'SpringWsServlet' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.SpringWsServlet]
    2012-06-22 15:28:05,139 INFO   [org.springframework.ws.transport.http.MessageDispatcherServlet] : FrameworkServlet 'SpringWsServlet': initialization completed in 1319 ms
    2012-06-22 15:28:05,139 DEBUG  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Servlet 'SpringWsServlet' configured successfully
    2012-06-22 15:28:05,192 TRACE  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Bound request context to thread: weblogic.servlet.internal.ServletRequestImpl@84d72d[
    GET /appcontext/holidayService/holiday.wsdl HTTP/1.1
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    Cookie: JSESSIONID=S9YqPk1DYhhNQPSbyBRkRQw0WmBR259SvzyKqpMn7GW1rJXF3YkB!-1497159531
    
    ]
    2012-06-22 15:28:05,252 DEBUG  [org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter] : Transforming [/holidayService/] to [http://192.168.1.1:7001/appcontext/holidayService/]
    2012-06-22 15:28:05,275 TRACE  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Cleared thread-bound request context: weblogic.servlet.internal.ServletRequestImpl@84d72d[
    GET /appcontext/holidayService/holiday.wsdl HTTP/1.1
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    Cookie: JSESSIONID=S9YqPk1DYhhNQPSbyBRkRQw0WmBR259SvzyKqpMn7GW1rJXF3YkB!-1497159531
    
    ]
    2012-06-22 15:28:05,276 DEBUG  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Successfully completed request
    (message too long, see next post)
    Last edited by mdrg; Jun 22nd, 2012, 04:49 PM.

  • #2
    Generated WSDL
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://mycompany.com/hr/schemas" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://mycompany.com/hr/definitions" targetNamespace="http://mycompany.com/hr/definitions">
      <wsdl:types>
        <xs:schema xmlns:hr="http://mycompany.com/hr/schemas" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://mycompany.com/hr/schemas">
    	<xs:element name="HolidayRequest">
    		<xs:complexType>
    			<xs:all>
    				<xs:element name="Holiday" type="hr:HolidayType"/>
    				<xs:element name="Employee" type="hr:EmployeeType"/>
    			</xs:all>
    		</xs:complexType>
    	</xs:element>
    	<xs:complexType name="HolidayType">
    		<xs:sequence>
    			<xs:element name="StartDate" type="xs:date"/>
    			<xs:element name="EndDate" type="xs:date"/>
    		</xs:sequence>
    	</xs:complexType>
    	<xs:complexType name="EmployeeType">
    		<xs:sequence>
    			<xs:element name="Number" type="xs:integer"/>
    			<xs:element name="FirstName" type="xs:string"/>
    			<xs:element name="LastName" type="xs:string"/>
    		</xs:sequence>
    	</xs:complexType>
    </xs:schema>
      </wsdl:types>
      <wsdl:message name="HolidayRequest">
        <wsdl:part element="sch:HolidayRequest" name="HolidayRequest">
        </wsdl:part>
      </wsdl:message>
      <wsdl:portType name="HumanResource">
        <wsdl:operation name="Holiday">
          <wsdl:input message="tns:HolidayRequest" name="HolidayRequest">
        </wsdl:input>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="HumanResourceSoap11" type="tns:HumanResource">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="Holiday">
          <soap:operation soapAction=""/>
          <wsdl:input name="HolidayRequest">
            <soap:body use="literal"/>
          </wsdl:input>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="HumanResourceService">
        <wsdl:port binding="tns:HumanResourceSoap11" name="HumanResourceSoap11">
          <soap:address location="http://192.168.1.1:7001/appcontext/holidayService/"/>
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>
    Webservice call using SoapUI
    Code:
    2012-06-22 15:29:00,271 TRACE  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Bound request context to thread: weblogic.servlet.internal.ServletRequestImpl@1c568b3[
    POST /appcontext/holidayService/ HTTP/1.1
    Accept-Encoding: gzip,deflate
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: ""
    Content-Length: 588
    Connection: Keep-Alive
    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
    
    ]
    2012-06-22 15:29:00,279 DEBUG  [org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter] : Accepting incoming [[email protected]2] at [http://192.168.1.1:7001/appcontext/holidayService/]
    2012-06-22 15:29:00,361 TRACE  [org.springframework.ws.soap.saaj.support.SaajUtils] : SOAPElement [weblogic.xml.saaj.SOAPEnvelopeImpl] implements SAAJ 1.3
    2012-06-22 15:29:00,449 TRACE  [org.springframework.ws.server.MessageTracing.received] : Received request [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://mycompany.com/hr/schemas">
       <soapenv:Header/>
       <soapenv:Body>
          <sch:HolidayRequest>
             <sch:Holiday>
                <sch:StartDate>2013-01-01</sch:StartDate>
                <sch:EndDate>2013-02-01</sch:EndDate>
             </sch:Holiday>
             <sch:Employee>
                <sch:Number>3254</sch:Number>
                <sch:FirstName>John</sch:FirstName>
                <sch:LastName>Doe</sch:LastName>
             </sch:Employee>
          </sch:HolidayRequest>
       </soapenv:Body>
    </soapenv:Envelope>]
    2012-06-22 15:29:00,454 TRACE  [org.springframework.ws.soap.saaj.support.SaajUtils] : SOAPElement [weblogic.xml.saaj.SOAPBodyImpl] implements SAAJ 1.3
    2012-06-22 15:29:00,459 DEBUG  [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping] : Looking up endpoint for [{http://mycompany.com/hr/schemas}HolidayRequest]
    2012-06-22 15:29:00,460 DEBUG  [org.springframework.ws.soap.server.SoapMessageDispatcher] : Endpoint mapping [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping@1c28c53] has no mapping for request
    2012-06-22 15:29:00,460 DEBUG  [org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping] : Looking up endpoint for []
    2012-06-22 15:29:00,460 DEBUG  [org.springframework.ws.soap.server.SoapMessageDispatcher] : Endpoint mapping [org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping@18abbcb] has no mapping for request
    2012-06-22 15:29:00,462 TRACE  [org.springframework.ws.soap.saaj.support.SaajUtils] : SOAPElement [weblogic.xml.saaj.SOAPHeaderImpl] implements SAAJ 1.3
    2012-06-22 15:29:00,467 DEBUG  [org.springframework.ws.soap.server.SoapMessageDispatcher] : Endpoint mapping [org.springframework.ws.soap.addressing.server.AnnotationActionEndpointMapping@793e32] has no mapping for request
    2012-06-22 15:29:00,467 WARN   [org.springframework.ws.server.EndpointNotFound] : No endpoint mapping found for [SaajSoapMessage {http://mycompany.com/hr/schemas}HolidayRequest]
    2012-06-22 15:29:00,470 TRACE  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Cleared thread-bound request context: weblogic.servlet.internal.ServletRequestImpl@1c568b3[
    POST /appcontext/holidayService/ HTTP/1.1
    Accept-Encoding: gzip,deflate
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: ""
    Content-Length: 588
    Connection: Keep-Alive
    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
    
    ]
    2012-06-22 15:29:00,470 DEBUG  [org.springframework.ws.transport.http.MessageDispatcherServlet] : Successfully completed request
    I believe the endpoint mapping was created (see WSDL request logs), yet it is not found when called.
    What I am missing here?

    Thanks!

    Comment


    • #3
      Problem found.
      As I use a dispatcher servlet specific for webservices, I cannot omit
      Code:
      <context:component-scan>
      inside webservices.xml, because the execution of component scan by the mvc dispatcher servlet will not register @Endpoint classes.

      Comment

      Working...
      X