Announcement Announcement Module
Collapse
No announcement yet.
No point adapter exception More than on adapter for Xpath and JAxb marshalling Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No point adapter exception More than on adapter for Xpath and JAxb marshalling

    I am trying to add an operation to an existing webservice and let spring do everything for me Marshalling and Unmarshalling. So even before it comes to my endpoint it blows up with the error below. Schema has response : GetTextResponseType

    No adapter for endpoint [public mycom.schema.myservice.GetTextResponseType mycom.endpoint.myserviceEndpoint.getInstructionTex t(mycom.schema.myservice.GetTextRequestType) throws java.lang.Throwable]: Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint?


    Code:
    <Webservice-context>
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        ">
    
        <context:annotation-config />
        <aop:aspectj-autoproxy />
        
        <!-- Scan and Load Endpoints -->
        <context:component-scan base-package="mycom.endpoint" />
        
        <bean class="mycom.common.log.factory.LogFactoryPostProcessor" />
    
        <bean id="createAccountDozerMapper" class="net.sf.dozer.util.mapping.DozerBeanMapper">
            <property name="mappingFiles">
                <list>
                    <value>webapp-dozer-mappings.xml</value>
                </list>
            </property>
        </bean>
        
        <oxm:jaxb2-marshaller id="wsMarshaller" contextPath="mycom.schema.*" />
    
        <bean class="org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter">
            <description>Enables the MessageDispatchServlet to invoke methods requiring OXM marshalling.</description>
            <constructor-arg ref="wsMarshaller" />
        </bean>
        
        <!-- Schema -->
        <util:list id="schemaList">
                   <value>/WEB-INF/myservice.xsd</value>
        </util:list>
      
        <bean id="myservice"
            class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition"
            p:wsdl="/WEB-INF/myservice.wsdl" />
            
          
       <bean class="org.springframework.ws.server.endpoint.adapter.XPathParamAnnotationMethodEndpointAdapter">
            <property name="namespaces">
                <props>
                    <prop key="sch">http://jpmchase.com/paymentnet4
                    </prop>
                    <prop key="xs">http://www.w3.org/2001/XMLSchema
                    </prop>
                    <prop key="com">http://www.ibm.com/AC/commonbaseevent1_1
                    </prop>
                </props>
            </property>
        </bean>
    
       <!-- Endpoint Mappers -->
        <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping" />
        
        
        <!-- Exception Resolver -->
        <bean id="exceptionResolver"
            class="org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver">
            <property name="defaultFault" value="SERVER" />
            <property name="exceptionMappings">
                <value>
                    mycom.common.exceptions.PnetWebServiceException=SERVER,The application encountered an unexpected error. Please contact the System Administrator to report this.
               </value>
            </property>
        </bean>
            
        <bean id="messageSource"
            class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basenames">
                <list>
                    <value>resources</value>
                    <value>messages/errormessages</value>
                    <value>messages/sitetext</value>                
                </list>
            </property>
        </bean>
    </beans>
    Code:
    @PayloadRoot(localPart = REQUEST_LOCAL_NAME, namespace = NAMESPACE_URI)
        public Source getMFA(@XPathParam(GET_MFA_REQUEST_ORG_ID) String orgID,
                @XPathParam(GET_MFA_REQUEST_USER_LOGIN) String userLogin)
    Code:
    <ENDpoint>
    @Endpoint
    public class myserviceEndpoint {
    
        private static final Log LOGGER = LogFactory
                .getLog(myserviceEndpoint.class);
    
    @PayloadRoot(localPart = "GetMFARequest", namespace = NAMESPACE_URI)
        public Source getMFA(@XPathParam(GET_MFA_REQUEST_ORG_ID) String orgID,
                @XPathParam(GET_MFA_REQUEST_USER_LOGIN) String userLogin) {
    
            User user;
            Element response = null;
    
            try {
     |
     |
     |
    @PayloadRoot(localPart = "getInstructionTextRequest" ,namespace = NAMESPACE_URI)
        public GetInstructionTextResponseType getInstructionText(GetInstructionTextRequestType  getInstructionTextRequestType) throws Throwable{
            final Locale locale = Locale.getDefault();
            GetInstructionTextResponseType getInstructionTextResponseType = new GetInstructionTextResponseType();
            if(getInstructionTextRequestType != null ){        
            try{
    <WSDL>

    ]
    Last edited by idea4gud; May 9th, 2011, 02:16 PM. Reason: Proper Descritpion

  • #2
    Ran out of character limit : wsdl enclosed

    Code:
    <wsdl:definitions xmlns:sch="http://mynamespace.com/myapp" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://mynamespace.com/myapp" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://mynamespace.com/myapp">
        <wsdl:types>
            <xs:schema xmlns:schemas="http://jpmchase.com/paymentnet/schemas" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://mynamespace.com/myapp" elementFormDefault="qualified">
            <xs:element name="getInstructionTextRequest" type="tns:getInstructionTextRequestType"> </xs:element>
            <xs:element name="getInstructionTextResponse" type="tns:getInstructionTextResponseType"> </xs:element>
            <xs:element name="validateUserPasswordRequest" type="tns:validateUserPasswordRequestType"> </xs:element>
            <xs:element name="validateUserPasswordResponse" type="tns:validateUserPasswordResponseType"> </xs:element>
            <xs:element name="validationError" type="tns:validationErrorType"> </xs:element>
            <xs:element name="status" type="tns:returnStatusType"> </xs:element>
                <xs:complexType name="returnStatusType">
                    <xs:sequence>
                        <xs:element name="Code" type="xs:integer"/>
                        <xs:element name="Message" type="xs:string" nillable="true" />
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="validationErrorType">
                    <xs:sequence>
                        <xs:element name="code" type="xs:integer"/>
                        <xs:element name="message" type="xs:string" minOccurs="0"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="getInstructionTextRequestType">
                    <xs:sequence>
                        <xs:element name="orgId" type="xs:string"/>
                        <xs:element name="userLogin" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="getInstructionTextResponseType">
                    <xs:sequence>
                        <xs:element name="instructionText" type="xs:string"  minOccurs="0"/>
                        <xs:element name="status" type="tns:returnStatusType"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="validateUserPasswordRequestType">
                    <xs:sequence>
                        <xs:element name="orgId" type="xs:string"/>
                        <xs:element name="userLogin" type="xs:string"/>
                        <xs:element name="password" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="validateUserPasswordResponseType">
                    <xs:sequence>
                        <xs:element name="validationError" type="tns:validationErrorType" minOccurs="0"/>
                        <xs:element name="instructionText" type="xs:string"  minOccurs="0"/>
                        <xs:element name="status" type="tns:returnStatusType"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:element name="GetMFARequest">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="OrgId" type="xs:string"/>
                            <xs:element name="UserLogin" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="GetMFAResponse">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="AddresseeFirstName" type="xs:string" nillable="true" minOccurs="0"/>
                            <xs:element name="AddresseeLastName" type="xs:string" nillable="true" minOccurs="0"/>
                            <xs:element name="channels">
                                <xs:complexType>
                                    <xs:sequence >
                                        <xs:element name="channel" minOccurs="0" maxOccurs="unbounded">
                                            <xs:complexType>
                                                <xs:all>
                                                    <xs:element name="ChannelType">
                                                        <xs:simpleType>
                                                            <xs:restriction base="xs:string">
                                                                <xs:enumeration value="E"/>
                                                            </xs:restriction>
                                                        </xs:simpleType>
                                                    </xs:element>
                                                    <xs:element name="ChannelInfo" type="xs:string"/>
                                                </xs:all>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="ExpirationInterval" type="xs:integer"/>
                            <xs:element name="status" type="tns:returnStatusType"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:schema>
        </wsdl:types>
        <wsdl:message name="GetMFARequest">
            <wsdl:part name="GetMFARequest" element="tns:GetMFARequest"/>
        </wsdl:message>
        <wsdl:message name="GetMFAResponse">
            <wsdl:part name="GetMFAResponse" element="tns:GetMFAResponse"/>
        </wsdl:message>
        <wsdl:message name="getInstructionTextRequest">
            <wsdl:part name="body" element="tns:getInstructionTextRequest"/>
        </wsdl:message>
        <wsdl:message name="getInstructionTextResponse">
            <wsdl:part name="body" element="tns:getInstructionTextResponse"/>
        </wsdl:message>
        <wsdl:message name="validateUserPasswordRequest">
            <wsdl:part name="body" element="tns:validateUserPasswordRequest"/>
        </wsdl:message>
        <wsdl:message name="validateUserPasswordResponse">
            <wsdl:part name="body" element="tns:validateUserPasswordResponse"/>
        </wsdl:message>
        <wsdl:portType name="GetMFAPortType">
            <wsdl:operation name="GetMFAOperation">
                <wsdl:input name="GetMFARequest" message="sch:GetMFARequest"/>
                <wsdl:output name="GetMFAResponse" message="sch:GetMFAResponse"/>
            </wsdl:operation>
            <wsdl:operation name="getInstructionText">
                <wsdl:input name = "getInstructionTextRequest" message="tns:getInstructionTextRequest"/>
                <wsdl:output name = "getInstructionTextResponse" message="tns:getInstructionTextResponse"/>
            </wsdl:operation>
            <wsdl:operation name="validateUserPassword">
                <wsdl:input name = "validateUserPasswordRequest" message="tns:validateUserPasswordRequest"/>
                <wsdl:output name = "validateUserPasswordResponse" message="tns:validateUserPasswordResponse"/>
            </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="GetMFASoapHttpBinding" type="sch:GetMFAPortType">
            <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
            <wsdl:operation name="GetMFAOperation">
                <soap:operation soapAction=""/>
                <wsdl:input name="GetMFARequest">
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output name="GetMFAResponse">
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="getInstructionText">
                <soap:operation soapAction="" style="document"/>
                <wsdl:input name="getInstructionTextRequest">
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output name="getInstructionTextResponse">
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="validateUserPassword">
                <soap:operation soapAction="" style="document"/>
                <wsdl:input name="validateUserPasswordRequest">
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output name="validateUserPasswordResponse">
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="GetMFAService">
            <wsdl:port name="GetMFAPort" binding="sch:GetMFASoapHttpBinding">
                <soap:address location="http://localhost:7001/ws/myservice"/>
            </wsdl:port>
        </wsdl:service>
    </wsdl:definitions>
    Links to java objects
    http://pastebin.com/Uy7qSQTj
    Last edited by idea4gud; May 9th, 2011, 02:26 PM. Reason: Links to java objects

    Comment

    Working...
    X