Announcement Announcement Module
Collapse
No announcement yet.
No endpoint mapping found for [SaajSoapMessage {http://localhost:8080/springws}setEmp Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No endpoint mapping found for [SaajSoapMessage {http://localhost:8080/springws}setEmp

    Hi Guys,
    I am beginner to webservice and i am using pring ws

    I am using castor for xml mapping. When i run client which is generated through axis 2 i get exception
    No endpoint mapping found for [SaajSoapMessage {http://localhost:8080/springws}setEmployeeCountRequest]

    Below is my sprinws-servlet
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:p="http://www.springframework.org/schema/p" 
     xmlns:sws="http://www.springframework.org/schema/web-services" 
     xmlns:oxm="http://www.springframework.org/schema/oxm" 
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:mvc="http://www.springframework.org/schema/mvc"
     xsi:schemaLocation="http://www.springframework.org/schema/context
     http://www.springframework.org/schema/context/spring-context-3.0.xsd
     http://www.springframework.org/schema/mvc
     http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
     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/oxm http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd">
    
    <context:component-scan base-package="lnt"/>
         <sws:annotation-driven  />
          <sws:interceptors>
           <bean id="validatingInterceptor"  
           class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
           	<property name="schema" value="/WEB-INF/xsd/responseXsd.xsd"/>
           	<property name="validateRequest" value="true"/>
           	<property name="validateResponse" value="true"/>
      
           </bean>
     
          <bean id="loggingInterceptor" class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/>
      </sws:interceptors>
      
       <sws:dynamic-wsdl id="sayHello"                                                          
         portTypeName="EmployeeEndpoint"                                                        
         locationUri="http://localhost:8080/springws/setEmployeeCountRequest"                                                      
         targetNamespace="http://localhost:8080/springws" 
         serviceName="EmployeeEndpoint">
                                  
       <sws:xsd location="/WEB-INF/xsd/responseXsd.xsd"/>                                              
     </sws:dynamic-wsdl>
      <bean id="castorMarshaller" class="org.springframework.oxm.castor.CastorMarshaller">
        	<property name="mappingLocation" value="/WEB-INF/response-mapping.xml" />
      </bean>
      
         
          <bean id="marshallingPayloadMethodProcessor" class="org.springframework.ws.server.endpoint.adapter.method.MarshallingPayloadMethodProcessor">
      <constructor-arg ref="castorMarshaller"/>
      <constructor-arg ref="castorMarshaller"/>
     </bean>
      
     <bean id="defaultMethodEndpointAdapter" class="org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter">
      <property name="methodArgumentResolvers">
       <list>
        <ref bean="marshallingPayloadMethodProcessor"/>
       </list>
      </property>
      <property name="methodReturnValueHandlers">
       <list>
        <ref bean="marshallingPayloadMethodProcessor"/>
       </list>
      </property>
     </bean>
        </beans>
    my response.xsd
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
      elementFormDefault="qualified"
      attributeFormDefault="qualified"
            targetNamespace="http://localhost:8080/springws/"
            xmlns:tns="http://localhost:8080/springws/">
            
         <element name="employee" tns:maxOccurs="1" tns:minOccurs="1">
    		<complexType>
    			<sequence>
    				<element  ref="tns:employeeCount"/>
    			</sequence>
    		</complexType>
        </element>
        <element name="employeeCount" type="int"/>
     </schema>
    My response-mapping.xml file

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <mapping>
    <class name="lnt.domainObjects.Employee">
               <map-to xml="responseXsd" 
               ns-uri="http://localhost:8080/springws"/>
           
               <field name="employeeCount" type="string">
                  <bind-xml name="employeeCount" node="element"/>
               </field>
             </class>
    </mapping>
    my employeeEndpoint
    Code:
    package lnt.domainObjects;
    
    import java.io.File;
    
    import org.springframework.ws.server.endpoint.annotation.Endpoint;
    import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
    
    @Endpoint
    public class EmployeeEndpoint implements EmployeeInterface{
    	private int employeeCount=30;
    
    	public int getEmployeeCount() {
    		return employeeCount;
    	}
    
    	@PayloadRoot(localPart="setEmployeeCountRequest", namespace="http://localhost:8080/springws/")
    	public void setEmployeeCount(int employeeCount) {
    		System.out.println("<<<<<<<<< "+employeeCount);
    		File f = new File("D:/alok/new.txt");
    		this.employeeCount = employeeCount;
    	}
    
    }
    my wsdl
    Code:
    <?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://localhost:8080/springws" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://localhost:8080/springws" targetNamespace="http://localhost:8080/springws">
      <wsdl:types>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://localhost:8080/springws" xmlns:tns="http://localhost:8080/springws">
         <xs:element name="employee">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element ref="tns:setEmployeeCountRequest"/>
    			</xs:sequence>
    		</xs:complexType>
    
        </xs:element>
        <xs:element name="setEmployeeCountRequest">
        	<xs:simpleType>
        		<xs:restriction base="xs:int"/>
        	</xs:simpleType>
        </xs:element>
     </xs:schema>
      </wsdl:types>
      <wsdl:message name="setEmployeeCountRequest">
    
        <wsdl:part element="tns:setEmployeeCountRequest" name="setEmployeeCountRequest">
        </wsdl:part>
      </wsdl:message>
      <wsdl:portType name="EmployeeEndpoint">
        <wsdl:operation name="setEmployeeCount">
          <wsdl:input message="tns:setEmployeeCountRequest" name="setEmployeeCountRequest">
        </wsdl:input>
        </wsdl:operation>
      </wsdl:portType>
    
      <wsdl:binding name="EmployeeEndpointSoap11" type="tns:EmployeeEndpoint">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="setEmployeeCount">
          <soap:operation soapAction=""/>
          <wsdl:input name="setEmployeeCountRequest">
            <soap:body use="literal"/>
          </wsdl:input>
        </wsdl:operation>
      </wsdl:binding>
    
      <wsdl:service name="EmployeeEndpoint">
        <wsdl:port binding="tns:EmployeeEndpointSoap11" name="EmployeeEndpointSoap11">
          <soap:address location="http://localhost:8080/springws/setEmployeeCountRequest"/>
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>
    its urgent please tell me what am i doing wrong

    Thanks and Regards
    Patil Abhieet
    Last edited by abhi patil; Jan 5th, 2012, 08:58 AM.

  • #2
    Hi,

    Did you get a solution for the above problem.

    I'm also using Castor and it given me the same error when trying to call the webservice from a client.

    Please let me know!!

    Thanks!

    Comment


    • #3
      That error means that the message that is received cannot be mapped to an endpoint. You could check your logs to see if EmployeeEndpoint is recognized and mapped by Spring-WS.

      Comment

      Working...
      X