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

  • No adapter for endpoint

    need help! i get a no adapter found for this see below:
    org.springframework.ws.server.endpoint.interceptor .PayloadLoggingInterceptor - Request: <sch:userLoginRequest xmlns:sch="http://www.mypublisher.com/login/schema">
    <sch:userLogin>
    <sch:userLoginId>abc</sch:userLoginId>
    <schassword>abc</schassword>
    </sch:userLogin>
    </sch:userLoginRequest>
    2011-03-14 12:39:38,639 [http-8080-1] DEBUG org.springframework.ws.soap.server.SoapMessageDisp atcher - Testing endpoint adapter [org.springframework.ws.server.endpoint.adapter.Def aultMethodEndpointAdapter@465f3bad]
    2011-03-14 12:39:38,641 [http-8080-1] DEBUG org.springframework.ws.soap.server.SoapMessageDisp atcher - Testing endpoint adapter [org.springframework.ws.server.endpoint.adapter.Def aultMethodEndpointAdapter@60a93995]
    2011-03-14 12:39:38,641 [http-8080-1] DEBUG org.springframework.ws.soap.server.endpoint.Simple SoapExceptionResolver - Resolving exception from endpoint [public com.mypublisher.login.schema.UserLoginResponse com.mypublisher.common.login.LoginEndpoint.userLog in(com.mypublisher.login.schema.UserLoginRequest) throws java.lang.Exception]: java.lang.IllegalStateException: No adapter for endpoint [public com.mypublisher.login.schema.UserLoginResponse com.mypublisher.common.login.LoginEndpoint.userLog in(com.mypublisher.login.schema.UserLoginRequest) throws java.lang.Exception]: Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?
    2011-03-14 12:39:38,647 [http-8080-1] DEBUG org.springframework.ws.soap.server.SoapMessageDisp atcher - Endpoint invocation resulted in exception - responding with Fault
    java.lang.IllegalStateException: No adapter for endpoint [public com.mypublisher.login.schema.UserLoginResponse com.mypublisher.common.login.LoginEndpoint.userLog in(com.mypublisher.login.schema.UserLoginRequest) throws java.lang.Exception]: Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?

    here are my wirings:

    -servlet.xml

    <?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="http://www.springframework.org/schema/p"
    xmlns:mpws="http://www.springframework.org/schema/web-services"
    xmlns:oxm="http://www.springframework.org/schema/oxm"
    xsi:schemaLocation=
    "http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/web-services
    http://www.springframework.org/schem...rvices-2.0.xsd
    http://www.springframework.org/schema/oxm
    http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd">

    <description>
    This web application context contains Spring-WS beans. The beans defined in this context are automatically
    detected by Spring-WS, similar to the way Controllers are picked up in Spring Web MVC.
    </description>

    <!-- uses annotations to map XML requests to endpoint methods -->
    <mpws:annotation-driven />

    <mpws:dynamic-wsdl id="userLogin" portTypeName="UserLogin" locationUri="/services">
    <mpws:xsd location="/WEB-INF/xsd/login.xsd"/>
    </mpws:dynamic-wsdl>

    <bean id="loginEndpoint" class="com.mypublisher.common.login.LoginEndpoint" autowire="byName" />

    <bean id="loginService" class="com.mypublisher.common.login.LoginServiceIm pl"/>

    <!-- JAXB2 object to xml mappings. -->
    <oxm:jaxb2-marshaller id="jaxbmarshaller" contextPath="com.mypublisher.login.schema" />
    <oxm:jaxb2-marshaller id="jaxbunmarshaller" contextPath="com.mypublisher.login.schema" />

    <!-- Normally we use the GenericMarshallingMethodEndpointAdapter however if you read the Spring WS 2.0 API for this adapter:
    "Deprecated. as of Spring Web Services 2.0, in favor of DefaultMethodEndpointAdapter and MarshallingPayloadMethodProcessor."
    See http://static.springsource.org/sprin...ntAdapter.html

    So we have to implement using the recommended implementation. The advantage of these two classes is that
    we have a pluggable adapter. For more info, check the Spring WS 2.0 API and its source code.
    -->
    <bean id="marshallingPayloadMethodProcessor" class="org.springframework.ws.server.endpoint.adap ter.method.MarshallingPayloadMethodProcessor">
    <constructor-arg ref="jaxbmarshaller"/>
    <constructor-arg ref="jaxbunmarshaller"/>
    </bean>

    <bean id="defaultMethodEndpointAdapter" class="org.springframework.ws.server.endpoint.adap ter.DefaultMethodEndpointAdapter">
    <property name="methodArgumentResolvers">
    <list>
    <ref bean="marshallingPayloadMethodProcessor"/>
    </list>
    </property>
    <property name="methodReturnValueHandlers">
    <list>
    <ref bean="marshallingPayloadMethodProcessor"/>
    </list>
    </property>
    </bean>


    <mpws:interceptors>
    <bean class="org.springframework.ws.soap.server.endpoint .interceptor.PayloadValidatingInterceptor">
    <description>
    This interceptor validates both incoming and outgoing message contents according to the 'login.xsd' XML
    Schema file.
    </description>
    <property name="schema" value="/WEB-INF/xsd/login.xsd"/>
    <property name="validateRequest" value="true"/>
    <property name="validateResponse" value="true"/>
    </bean>
    <bean class="org.springframework.ws.server.endpoint.inte rceptor.PayloadLoggingInterceptor">
    <description>
    This interceptor logs the message payload.
    </description>
    </bean>
    </mpws:interceptors>


    </beans>


    XSD:

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:login="http://www.mypublisher.com/login/schema" elementFormDefault="qualified"
    targetNamespace="http://www.mypublisher.com/login/schema">

    <xs:element name="userLogin">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="userLoginId" type="xs:string" />
    <xs:element name="password" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>

    <xs:element name="userLoginRequest">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="login:userLogin"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>

    <xs:element name="userLoginResponse">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="isLoggedIn" type="xs:boolean"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>

    </xs:schema>

  • #2
    jaxb generated classes:


    //
    // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
    // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
    // Any modifications to this file will be lost upon recompilation of the source schema.
    // Generated on: 2011.03.11 at 05:21:37 PM EST
    //


    package com.mypublisher.login.schema;

    import javax.xml.bind.annotation.XmlAccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlRootElement;
    import javax.xml.bind.annotation.XmlType;


    /**
    * <p>Java class for anonymous complex type.
    *
    * <p>The following schema fragment specifies the expected content contained within this class.
    *
    * <pre>
    * &lt;complexType>
    * &lt;complexContent>
    * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    * &lt;sequence>
    * &lt;element name="userLoginId" type="{http://www.w3.org/2001/XMLSchema}string"/>
    * &lt;element name="password" type="{http://www.w3.org/2001/XMLSchema}string"/>
    * &lt;/sequence>
    * &lt;/restriction>
    * &lt;/complexContent>
    * &lt;/complexType>
    * </pre>
    *
    *
    */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
    "userLoginId",
    "password"
    })
    @XmlRootElement(name = "userLogin", namespace="http://www.mypublisher.com/login/schema")
    public class UserLogin {

    @XmlElement(required = true)
    protected String userLoginId;
    @XmlElement(required = true)
    protected String password;

    /**
    * Gets the value of the userLoginId property.
    *
    * @return
    * possible object is
    * {@link String }
    *
    */
    public String getUserLoginId() {
    return userLoginId;
    }

    /**
    * Sets the value of the userLoginId property.
    *
    * @param value
    * allowed object is
    * {@link String }
    *
    */
    public void setUserLoginId(String value) {
    this.userLoginId = value;
    }

    /**
    * Gets the value of the password property.
    *
    * @return
    * possible object is
    * {@link String }
    *
    */
    public String getPassword() {
    return password;
    }

    /**
    * Sets the value of the password property.
    *
    * @param value
    * allowed object is
    * {@link String }
    *
    */
    public void setPassword(String value) {
    this.password = value;
    }

    }


    //
    // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
    // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
    // Any modifications to this file will be lost upon recompilation of the source schema.
    // Generated on: 2011.03.11 at 05:21:37 PM EST
    //


    package com.mypublisher.login.schema;

    import javax.xml.bind.annotation.XmlAccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlRootElement;
    import javax.xml.bind.annotation.XmlType;


    /**
    * <p>Java class for anonymous complex type.
    *
    * <p>The following schema fragment specifies the expected content contained within this class.
    *
    * <pre>
    * &lt;complexType>
    * &lt;complexContent>
    * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    * &lt;sequence>
    * &lt;element ref="{http://www.mypublisher.com/login/schema}userLogin"/>
    * &lt;/sequence>
    * &lt;/restriction>
    * &lt;/complexContent>
    * &lt;/complexType>
    * </pre>
    *
    *
    */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
    "userLogin"
    })
    @XmlRootElement(name = "userLoginRequest", namespace="http://www.mypublisher.com/login/schema")
    public class UserLoginRequest {

    @XmlElement(required = true)
    protected UserLogin userLogin;

    /**
    * Gets the value of the userLogin property.
    *
    * @return
    * possible object is
    * {@link UserLogin }
    *
    */
    public UserLogin getUserLogin() {
    return userLogin;
    }

    /**
    * Sets the value of the userLogin property.
    *
    * @param value
    * allowed object is
    * {@link UserLogin }
    *
    */
    public void setUserLogin(UserLogin value) {
    this.userLogin = value;
    }

    }



    //
    // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
    // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
    // Any modifications to this file will be lost upon recompilation of the source schema.
    // Generated on: 2011.03.11 at 05:21:37 PM EST
    //


    package com.mypublisher.login.schema;

    import javax.xml.bind.annotation.XmlAccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlRootElement;
    import javax.xml.bind.annotation.XmlType;


    /**
    * <p>Java class for anonymous complex type.
    *
    * <p>The following schema fragment specifies the expected content contained within this class.
    *
    * <pre>
    * &lt;complexType>
    * &lt;complexContent>
    * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    * &lt;sequence>
    * &lt;element name="isLoggedIn" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
    * &lt;/sequence>
    * &lt;/restriction>
    * &lt;/complexContent>
    * &lt;/complexType>
    * </pre>
    *
    *
    */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
    "isLoggedIn"
    })
    @XmlRootElement(name = "userLoginResponse", namespace="http://www.mypublisher.com/login/schema")
    public class UserLoginResponse {

    protected boolean isLoggedIn;

    /**
    * Gets the value of the isLoggedIn property.
    *
    */
    public boolean isIsLoggedIn() {
    return isLoggedIn;
    }

    /**
    * Sets the value of the isLoggedIn property.
    *
    */
    public void setIsLoggedIn(boolean value) {
    this.isLoggedIn = value;
    }

    }




    the important one : endpoint

    package com.mypublisher.common.login;

    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.springframework.beans.factory.annotation.Autow ired;
    import org.springframework.ws.server.endpoint.annotation. Endpoint;
    import org.springframework.ws.server.endpoint.annotation. PayloadRoot;

    import com.mypublisher.login.schema.UserLoginRequest;
    import com.mypublisher.login.schema.UserLoginResponse;


    @Endpoint
    public class LoginEndpoint{

    private LoginService loginService;
    protected final Log logger = LogFactory.getLog(getClass());

    /**
    * Namespace of both request and response.
    */
    public static final String NAMESPACE_URI = "http://www.mypublisher.com/login/schema";

    /**
    * The local name of the expected request.
    */
    public static final String ECHO_REQUEST_LOCAL_NAME = "userLoginRequest";

    /**
    * The local name of the created response.
    */
    public static final String ECHO_RESPONSE_LOCAL_NAME = "userLoginResponse";

    LoginEndpoint(){

    }

    @Autowired
    public void setLoginService( LoginService loginService) {
    this.loginService = loginService;
    }

    @PayloadRoot (localPart=ECHO_REQUEST_LOCAL_NAME, namespace=NAMESPACE_URI)
    public UserLoginResponse userLogin(UserLoginRequest request) throws Exception {

    UserLoginRequest loginRequest = (UserLoginRequest) request;
    logger.info("Login Requested.");
    boolean isLoggedIn = loginService.userLogin(loginRequest.getUserLogin() );

    UserLoginResponse userLoginResponse = new UserLoginResponse();
    userLoginResponse.setIsLoggedIn(isLoggedIn);
    return userLoginResponse;


    }



    }


    Not sure where the problem is. Can anybody put insight into this?
    will really appreciate.

    thanks

    Comment


    • #3
      i'm also getting the same issue

      i'm also getting the same issue. Anyone any idea? Here i'm using the tutorial as it is. (Holiday example)

      Comment


      • #4
        Are you using Spring WS 2.0.x? I think you're following the tutorial I wrote at
        http://krams915.blogspot.com/2010/12...ing-3-mvc.html

        Try editing your endpoint format like this:
        @PayloadRoot(localPart = REQUEST_LOCAL_NAME, namespace = NAMESPACE_URI)
        @ResponsePayload
        public SubscriptionResponse processSubscription( @RequestPayload SubscriptionRequest subscriptionRequest) {
        ...
        }
        Somehow you're missing the @ResponsePayload and @RequestPayload

        Comment


        • #5
          Hello,

          A web service has a defined "service boundary" or contract--possible interactions with the web service are defined by a well-known/published interface. Web Service contracts are defined via WSDL documents .

          Regards,
          stainless steel stair rail

          Comment


          • #6
            good

            Great information about "No adapter for endpoint...". I like it.:


            Tavin

            Comment


            • #7
              thanks

              thanks for the information. now its working fine

              Comment


              • #8
                great solution

                I am very great to tell that it is working..


                Any
                Last edited by hane; Apr 6th, 2011, 06:39 AM. Reason: new

                Comment

                Working...
                X