Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring-ws: no endpoint mapping found

I made a simple web service but when I'am trying to test it on soapui its giving this error:

WARN : [Oct-11 12:56:38,081] ws.server.EndpointNotFound - No endpoint mapping found for [SaajSoapMessage {http://www.servesy.com/api/v1/service}signupRequest]

I do not have any idea what should I do to make it correct, I saw many questions regarding this problem but did not find any solution.

My spring-ws configuration are follows: (apart from this configuration I also tried to make simple input output example and that also shows same warning)

web.xml

<web-app 
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/config/servesy-config.xml
        </param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>servesyservices</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>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value></param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>servesyservices</servlet-name>
        <url-pattern>*.wsdl</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>servesyservices</servlet-name>
        <url-pattern>/endpoints/*</url-pattern>
    </servlet-mapping>

</web-app>

servesy-config.xml

<beans 
    <context:component-scan base-package="com.servesy.webservices" />
    <sws:annotation-driven />


    <bean id="ServesyService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition" lazy-init="true">
        <property name="schemaCollection">
            <bean class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
                <property name="inline" value="true" />

                    <property name="xsds">
                        <list>
                            <value>schemas/ServesyServices.xsd</value>
                        </list>
                    </property>

            </bean>
        </property>
        <property name="portTypeName" value="ServesyService"/>
        <property name="serviceName" value="ServesyServices" />
        <property name="locationUri" value="/endpoints"/>
    </bean>
</beans>

Endpoint

@Endpoint
public class ServesyWebServiceEndpoint {

        private static final String TARGET_NAMESPACE ="http://www.servesy.com/api/v1/service";


        private ServesyWebService servesyservice_i;

        @Autowired
        public void setServesyWebService(ServesyWebService servesyservice_p)
        {
            this.servesyservice_i = servesyservice_p;
        }



        @PayloadRoot(localPart="SignupRequest", namespace=TARGET_NAMESPACE)
        public @ResponsePayload SignupResponse response(SignupRequest signupRequest) {

            SignupResponse signupResponse = new SignupResponse();
            Signup signup = servesyservice_i.signupResponse( signupRequest.getMobileNumber(), signupRequest.getPassword(), signupRequest.getCustomerName(), signupRequest.getEmailId(), signupRequest.getPromoCode(), signupRequest.getDevice());
            signupResponse.setSignup(signup);
            return signupResponse;
        }

        @PayloadRoot(localPart="LoginRequest", namespace=TARGET_NAMESPACE)
        public @ResponsePayload LoginResponse response(LoginRequest loginRequest) {

            LoginResponse loginResponse = new LoginResponse();
            String string = servesyservice_i.signinResponse( loginRequest.getEmailID(), loginRequest.getPassword(), loginRequest.getDevice());
            loginResponse.setSessionId(string);
            return loginResponse;
        }
    }

and my soupui gives this type of blank output: enter image description here

like image 419
maria Avatar asked Oct 11 '14 08:10

maria


1 Answers

The EndpointNotFoundException occurs when Spring-WS cannot find a suitable @Endpoint that can handle the incoming request.

In this case, the incoming message has namespace http://www.servesy.com/api/v1/service and local name signupRequest (as can be seen in the log). While your @PayloadRoot mapping does have the same namespace; it does not have the same local name, as it uses SignupRequest with a capital S. Chances are that if you change the uppercase S to a lower case s in the @PayloadRoot annotation, it will work.

like image 62
Arjen Poutsma Avatar answered Oct 20 '22 14:10

Arjen Poutsma