я новенький, используя Spring SOAP W. Я следую многим учебникам и пытаюсь адаптировать свои потребности к этим примерам, но никогда не работал, у меня было следующее сообщение: Не найдено сопоставление конечной точки для [SaajSoapMessage {http://ws.veritran.net/vtAuthServer/types} validatePOTCRequest]
Это может быть код:
@Configuration
@EnableWs
public class ConfigWS {
@Bean
public ServletRegistrationBean<MessageDispatcherServlet> messageDispatcherServlet(ApplicationContext applicationContext){
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean<MessageDispatcherServlet>(servlet,"/tkAuthServer/*");
}
@Bean(name="types")
public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema schema) {
DefaultWsdl11Definition defaultWsdl11Definition = new DefaultWsdl11Definition();
defaultWsdl11Definition.setPortTypeName("ServiceWS");
defaultWsdl11Definition.setLocationUri("/tkAuthServer");
defaultWsdl11Definition.setTargetNamespace("http://ws.veritran.net/vtAuthServer/types");
defaultWsdl11Definition.setSchema(schema);
return defaultWsdl11Definition;
}
@Bean
public XsdSchema schema() {
return new SimpleXsdSchema(new ClassPathResource("IBKServiceW0102_v1.0.xsd"));
}
}
Это моя конечная точка:
@Endpoint
public class EndpointWS {
private static final String NAMESPACE="http://ws.veritran.net/vtAuthServer/types";
@Autowired
private ServiceWS service;
@PayloadRoot(namespace = NAMESPACE, localPart="ValidatePOTCRequest")
@ResponsePayload
public ValidatePOTCResponse getResponse(@RequestPayload ValidatePOTCRequest request) {
return service.response(request);
}
}
Это мой класс обслуживания:
@Service
public class ServiceWS {
public ValidatePOTCResponse response(ValidatePOTCRequest request) {
ValidatePOTCResponse validatePOTCResponse = new ValidatePOTCResponse();
validatePOTCResponse.setExternalUserId("BUSUSMDA");
validatePOTCResponse.setProductCatalog("NONE");
validatePOTCResponse.setProductIssuerCode("asd");
validatePOTCResponse.setProductType("TDC");
validatePOTCResponse.setCardNumber("14124");
validatePOTCResponse.setCardNumberLastDigits("123");
validatePOTCResponse.setCardExpirationDate("022017");
validatePOTCResponse.setProductClientName("ABELARDO TEMP");
validatePOTCResponse.setProductBrand("02");
return validatePOTCResponse;
}
}
Это мое определение WSDL
<?xml version="1.0" encoding="UTF-8"?>
<!----><!--This is the primitives description of vtAuthServer,--><!--a software product of Veritran S.A. All rights reserved.--><!----><definitions targetNamespace="http://ws.veritran.net/vtAuthServer" xmlns:tns="http://ws.veritran.net/vtAuthServer" xmlns:type="http://ws.veritran.net/vtAuthServer/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="http://ws.veritran.net/vtAuthServer/types" xmlns="http://www.w3.org/2001/XMLSchema">
<!--HEADER BEGIN-->
<element name="vtAuthServerRequestHeader">
<complexType>
<all>
<element minOccurs="1" maxOccurs="1" name="operation" type="xsd:string"/>
<element minOccurs="0" maxOccurs="1" name="callerId" type="xsd:string"/>
<element minOccurs="0" maxOccurs="1" name="callDetail" type="xsd:string"/>
<element minOccurs="0" maxOccurs="1" name="dateTime" type="xsd:dateTime"/>
<element minOccurs="1" maxOccurs="1" name="version" type="xsd:string"/>
<element minOccurs="0" maxOccurs="1" name="callData" type="xsd:string"/>
</all>
</complexType>
</element>
<element name="vtAuthServerResponseHeader">
<complexType>
<all>
<element minOccurs="1" maxOccurs="1" name="status" type="type:Status"/>
<element minOccurs="0" maxOccurs="1" name="dateTime" type="xsd:dateTime"/>
<element minOccurs="1" maxOccurs="1" name="responderId" type="xsd:string"/>
<element minOccurs="1" maxOccurs="1" name="version" type="xsd:string"/>
<element minOccurs="0" maxOccurs="1" name="callData" type="xsd:string"/>
</all>
</complexType>
</element>
<element name="vtGenericFault">
<complexType>
<all>
<element minOccurs="1" maxOccurs="1" name="faultcode" type="string"/>
<element minOccurs="1" maxOccurs="1" name="faultstring" type="string"/>
<element minOccurs="1" maxOccurs="1" name="detail" type="type:vtGenericFaultDetail"/>
</all>
</complexType>
</element>
<complexType name="vtGenericFaultDetail">
<all>
<element minOccurs="0" maxOccurs="1" name="description" type="string"/>
<element minOccurs="0" maxOccurs="1" name="stackTrace" type="string"/>
</all>
</complexType>
<complexType name="Status">
<all>
<element minOccurs="1" maxOccurs="1" name="code" type="xsd:string"/>
<element minOccurs="0" maxOccurs="1" name="desc" type="xsd:string"/>
<element minOccurs="0" maxOccurs="1" name="techInfo" type="xsd:string"/>
</all>
</complexType>
<!--VALIDATION-->
<xsd:import namespace="http://ws.veritran.net/vtAuthServer/types" schemaLocation="IBKServiceW0102_v1.0.xsd"/>
<!--POTC END-->
</schema>
</types>
<message name="vtAuthServerRequestHeader">
<part name="vtAuthServerRequestHeader" element="type:vtAuthServerRequestHeader"/>
</message>
<message name="vtAuthServerResponseHeader">
<part name="vtAuthServerResponseHeader" element="type:vtAuthServerResponseHeader"/>
</message>
<message name="vtGenericFault">
<part name="vtGenericFault" element="type:vtGenericFault"/>
</message>
<message name="validatePOTCRequest">
<part name="validatePOTCRequest" element="type:validatePOTCRequest"/>
</message>
<message name="validatePOTCResponse">
<part name="validatePOTCResponse" element="type:validatePOTCResponse"/>
</message>
<portType name="vtAuthServerSoap">
<operation name="validatePOTC">
<input message="tns:validatePOTCRequest" name="validatePOTCRequest"/>
<output message="tns:validatePOTCResponse" name="validatePOTCResponse"/>
<fault message="tns:vtGenericFault" name="validatePOTCFault"/>
</operation>
</portType>
<binding name="vtAuthServerSoapBindingHttp" type="tns:vtAuthServerSoap">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="validatePOTC">
<soap:operation soapAction="vtAuthServer#validatePOTC"/>
<input name="validatePOTCRequest">
<soap:header message="tns:vtAuthServerRequestHeader" part="vtAuthServerRequestHeader" use="literal"/>
<soap:body use="literal"/>
</input>
<output name="validatePOTCResponse">
<soap:header message="tns:vtAuthServerResponseHeader" part="vtAuthServerResponseHeader" use="literal"/>
<soap:body use="literal"/>
</output>
<fault name="validatePOTCFault">
<soap:fault name="validatePOTCFault" use="literal"/>
</fault>
</operation>
</binding>
<service name="vtAuthServer">
<port binding="tns:vtAuthServerSoapBindingHttp" name="vtAuthServerSoapHttpService">
<soap:address location="http://localhost:8080/tkAuthServer"/>
</port>
</service>
</definitions>
Наконец, мой файл схемы XSD
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://ws.veritran.net/vtAuthServer/types" xmlns:typ="http://ws.veritran.net/vtAuthServer/types"
xmlns:tns ="http://ws.veritran.net/vtAuthServer/types"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
>
<element name="validatePOTCRequest" type="typ:validatePOTCRequest"/>
<element name="validatePOTCResponse" type="typ:validatePOTCResponse"/>
<!--VALIDATION-->
<complexType name="validatePOTCRequest">
<all>
<element minOccurs="1" maxOccurs="1" name="potcGroup" type="string"/>
<element minOccurs="1" maxOccurs="1" name="potc" type="string"/>
<element minOccurs="0" maxOccurs="1" name="potcSuite" type="string"/>
<element minOccurs="0" maxOccurs="1" name="operationTrxDataSpecific" type="string"/>
</all>
</complexType>
<complexType name="validatePOTCResponse">
<all>
<element minOccurs="0" maxOccurs="1" name="externalUserId" type="string"/>
<element minOccurs="1" maxOccurs="1" name="productCatalog" type="string"/>
<element minOccurs="1" maxOccurs="1" name="productIssuerCode" type="string"/>
<element minOccurs="1" maxOccurs="1" name="productType" type="string"/>
<element minOccurs="0" maxOccurs="1" name="accountNumber" type="string"/>
<element minOccurs="0" maxOccurs="1" name="accountNumberLastDigits" type="string"/>
<element minOccurs="0" maxOccurs="1" name="cardNumber" type="string"/>
<element minOccurs="0" maxOccurs="1" name="cardNumberLastDigits" type="string"/>
<element minOccurs="0" maxOccurs="1" name="cardExpirationDate" type="string"/>
<element minOccurs="0" maxOccurs="1" name="productClientName" type="string"/>
<element minOccurs="0" maxOccurs="1" name="productAlias" type="string"/>
<element minOccurs="0" maxOccurs="1" name="productBrand" type="string"/>
<element minOccurs="0" maxOccurs="1" name="productName" type="string"/>
<element minOccurs="0" maxOccurs="1" name="productExplainText" type="string"/>
<element minOccurs="0" maxOccurs="1" name="productIssuerName" type="string"/>
<element minOccurs="0" maxOccurs="1" name="operationComment" type="string"/>
</all>
</complexType>
</schema>
Это мой запрос:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://ws.veritran.net/vtAuthServer/types">
<soapenv:Header>
<typ:vtAuthServerRequestHeader>
<!--You may enter the following 6 items in any order-->
<operation>?</operation>
<!--Optional:-->
<callerId>?</callerId>
<!--Optional:-->
<callDetail>?</callDetail>
<!--Optional:-->
<dateTime>?</dateTime>
<version>?</version>
<!--Optional:-->
<callData>?</callData>
</typ:vtAuthServerRequestHeader>
</soapenv:Header>
<soapenv:Body>
<typ:validatePOTCRequest>
<!--You may enter the following 4 items in any order-->
<typ:potcGroup>?</typ:potcGroup>
<typ:potc>?</typ:potc>
<!--Optional:-->
<typ:potcSuite>?</typ:potcSuite>
<!--Optional:-->
<typ:operationTrxDataSpecific>?</typ:operationTrxDataSpecific>
</typ:validatePOTCRequest>
</soapenv:Body>
</soapenv:Envelope>
и моя конечная точка: http://localhost: 8080 / tkAuthServer