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

  • anothert EndpointNotFound - No endpoint mapping found for SaajSoapMessage

    Hi!
    I'm getting the following error. Tried to look up other posts with similar erros but didn't help. Below are my source codes:

    xsd schema:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://localhost:8080/ws/schemas"
        xmlns:tns="http://localhost:8080/ws/schemas"
        xmlns:login-ws="http://localhost:8080/ws/schemas"
        elementFormDefault="qualified">
        <xsd:complexType name="login-request">
            <xsd:sequence>
                <xsd:element name="username" type="xsd:string"/>
                <xsd:element name="password" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="login-response">
            <xsd:sequence>
                <xsd:element name="response" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:element name="LoginRequest" type="login-ws:login-request"/>
        <xsd:element name="LoginResponse" type="login-ws:login-response"/>
    </xsd:schema>
    BaseEndpoint.java:
    Code:
    @Endpoint
    public class BaseEndpoint {   
        @PayloadRoot(localPart = "LoginRequest", namespace = "http://localhost:8080/ws/schemas")
        public LoginResponse receiveLogin(LoginRequest loginRequest) {
            try {
                System.out.println(loginRequest.getUsername());
                System.out.println(loginRequest.getPassword());
    
                if(loginRequest.getUsername().equals("ilmari") && loginRequest.getPassword().equals("salasana")) {
                    loginResponse.setResponse("SUCCESS");
                } else {
                    loginResponse.setResponse("FAILURE");
                }
            } catch(Exception e) {
                System.out.println(e.toString());
            }
            System.out.println(loginResponse.getResponse());
            return loginResponse;
        }
    }
    web.xml
    Code:
      <servlet>
            <servlet-name>spring-ws</servlet-name>
            <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
        </servlet>
    
        <servlet-mapping>
            <servlet-name>spring-ws</servlet-name>
            <url-pattern>/ws/*</url-pattern>
        </servlet-mapping>
    and spring-ws-servlet.xml:
    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"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
        <bean id="baseEndpoint" class="com.valuatum.ws.BaseEndpoint" autowire="byName"/>
        <bean id="loggingInterceptor" class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/>
        <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping">
            <property name="interceptors">
                <list>
                    <ref local="loggingInterceptor"/>
                </list>
            </property>
        </bean>
        <bean id="loginWebService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
            <property name="schema" ref="loginSchema"/>
            <property name="portTypeName" value="LoginResource"/>
            <property name="locationUri" value="http://localhost:8080/ws/loginWebService"/>
            <property name="targetNamespace" value="http://localhost:8080/ws/schemas"/>
        </bean>
        <bean id="loginSchema" class="org.springframework.xml.xsd.SimpleXsdSchema">
            <property name="xsd" value="/WEB-INF/classes/loginService.xsd"/>
        </bean>
        <bean id="marshaller" class="org.springframework.oxm.castor.CastorMarshaller">
            <property name="mappingLocation" value="/WEB-INF/castor-mapping.xml"/>
        </bean>   
        <bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
            <constructor-arg ref="marshaller"/>
            <constructor-arg ref="marshaller"/>
        </bean>
    </beans>
    I'm basically following tutorial found here: http://springkbase.blogspot.com/2009...th-castor.html but when i try to send following message with soapui
    Code:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://localhost:8080/ws/schemas">
       <soapenv:Header/>
       <soapenv:Body>
          <sch:LoginRequest>
             <sch:username>?</sch:username>
             <sch:password>?</sch:password>
          </sch:LoginRequest>
       </soapenv:Body>
    </soapenv:Envelope>
    I get EndpointNotFound - No endpoint mapping found for [SaajSoapMessage {http://localhost:8080/ws/schemas}LoginRequest] error. I'm using jboss instead of maven. My first post here btw.

  • #2
    got it solved. had not put the endpoint java class into the jar package

    Comment

    Working...
    X