I'm trying to write a fairly simple Spring-WS service which accepts a String and returns a String, I've defined the endpoint Class and as far as I can tell everything looks fine. But when I hit the service using SOAP-UI I get the following error message:
No adapter for endpoint [public java.lang.String uk.co.company.product.identification.service.IdentificationServiceEndpoint.getIdentificationData(java.lang.String)]: Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?
I'm at my wits end because as far as I can tell everything is what it should be...
SPRING CONFIG
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://ift.tt/GArMu6"
xmlns:xsi="http://ift.tt/ra1lAU" xmlns:context="http://ift.tt/GArMu7"
xmlns:sws="http://ift.tt/KZYGcT"
xsi:schemaLocation="http://ift.tt/GArMu6
http://ift.tt/QEDs1e
http://ift.tt/KZYGcT
http://ift.tt/Kz3bLJ
http://ift.tt/GArMu7
http://ift.tt/QEDs1k">
<context:component-scan base-package="uk.co.company.product.identification" />
<sws:annotation-driven />
<!-- Our test service bean -->
<bean id="IdentificationRequest"
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/identificationOperations.xsd</value>
</list>
</property>
</bean>
</property>
<property name="portTypeName" value="IdentificationService" />
<property name="serviceName" value="IdentificationServices" />
<property name="locationUri" value="/endpoints/" />
</bean>
</beans>
XSD
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://ift.tt/1IhlnBk"
targetNamespace="http://ift.tt/1IhlnBk"
xmlns:xsd="http://ift.tt/tphNwY">
<xsd:element name="IdentificationRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="address" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="IdentificationResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="identificationData" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
ENDPOINT Class
package uk.co.company.product.identification.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
@Endpoint
public class IdentificationServiceEndpoint {
private static final String TARGET_NAMESPACE = "http://ift.tt/1IhlnBk";
@Autowired
private IdentificationService identificationService;
@PayloadRoot(localPart="IdentificationRequest", namespace=TARGET_NAMESPACE)
@ResponsePayload public String getidentificationData(@RequestPayload String address){
return identificationService.getidentificationData(address);
}
public void setIdentificationService(IdentificationService identificationService){
this.identificationService = identificationService;
}
}
Generated WSDL This is the WSDL that is generated when I browse to:
http://localhost:8080/IdentificationService/IdentificationRequest.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ift.tt/1IhlnBk" xmlns:tns="http://ift.tt/1IhlnBk" xmlns:soap="http://ift.tt/KIQHA2" xmlns:sch="http://ift.tt/1IhlnBk" xmlns:wsdl="http://ift.tt/LcBaVt">
<wsdl:types>
<xsd:schema targetNamespace="http://ift.tt/1IhlnBk" elementFormDefault="unqualified" attributeFormDefault="unqualified" xmlns:xsd="http://ift.tt/tphNwY" xmlns="http://ift.tt/1IhlnBk">
<xsd:element name="IdentificationRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="address" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="IdentificationResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="identificationData" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="IdentificationRequest">
<wsdl:part name="IdentificationRequest" element="tns:IdentificationRequest"> </wsdl:part>
</wsdl:message>
<wsdl:message name="IdentificationResponse">
<wsdl:part name="IdentificationResponse" element="tns:IdentificationResponse"> </wsdl:part>
</wsdl:message>
<wsdl:portType name="IdentificationService">
<wsdl:operation name="Identification">
<wsdl:input name="IdentificationRequest" message="tns:IdentificationRequest"> </wsdl:input>
<wsdl:output name="IdentificationResponse" message="tns:IdentificationResponse"> </wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="IdentificationServiceSoap11" type="tns:IdentificationService">
<soap:binding transport="http://ift.tt/LcBaVu" style="document"/>
<wsdl:operation name="Identification">
<soap:operation soapAction=""/>
<wsdl:input name="IdentificationRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="IdentificationResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="IdentificationServices">
<wsdl:port name="IdentificationServiceSoap11" binding="tns:IdentificationServiceSoap11">
<soap:address location="http://localhost:8080/IdentificationService/endpoints/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
SOAP Messages: These are the SOAP Message I send from SOAP-UI and what I recieve. The endpoint is:
http://localhost:8080/IdentificationService/endpoints/
Request:
<soapenv:Envelope xmlns:soapenv="http://ift.tt/sVJIaE" xmlns:ser="http://ift.tt/1IhlnBk">
<soapenv:Header/>
<soapenv:Body>
<ser:IdentificationRequest>
<address>test</address>
</ser:IdentificationRequest>
</soapenv:Body>
</soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://ift.tt/sVJIaE">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring xml:lang="en">No adapter for endpoint [public java.lang.String uk.co.company.product.identification.service.IdentificationServiceEndpoint.getIdentificationData(java.lang.String)]: Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Aucun commentaire:
Enregistrer un commentaire