-
Mar 14th, 2011, 12:48 PM
#1
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>
<sch
assword>abc</sch
assword>
</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>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules