【问题标题】:No endpoint mapping found for [SaajSoapMessage未找到 [SaajSoapMessage 的端点映射
【发布时间】:2020-04-29 16:09:20
【问题描述】:

我是使用 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

【问题讨论】:

  • 请解释一下是什么问题?
  • 当我发送请求时,我收到这条消息:没有找到 [SaajSoapMessage {ws.veritran.net/vtAuthServer/types}validatePOTCRequest] 的端点映射

标签: java web-services soap endpoint spring-ws


【解决方案1】:
This is Request and response


Received request [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="urn:nppgw:debtorcreditoragent:payments:wsdl:v1/types" xmlns:urn="urn:iso:std:iso:20022:tech:xsd:head.001.001.01" `enter code here`xmlns:urn1="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.06">
    <soapenv:Header/>
    <soapenv:Body>
        <typ:NotifyClearingRequest>
            <urn:AppHdr>
                <urn:Fr>
                    <urn:FIId>
                        <urn:FinInstnId>
                            <urn:BICFI>HBSLAU4TXXX</urn:BICFI>
                        </urn:FinInstnId>
                    </urn:FIId>
                </urn:Fr>
                <urn:To>
                    <urn:FIId>
                        <urn:FinInstnId>
                            <urn:BICFI>ASLLAU2CXXX</urn:BICFI>
                        </urn:FinInstnId>
                    </urn:FIId>
                </urn:To>
                <urn:BizMsgIdr>HBSLAU4TXXX20161110818900000000000</urn:BizMsgIdr>
                <urn:MsgDefIdr>pacs.002.001.06</urn:MsgDefIdr>
                <urn:BizSvc>npp.clear.01-sct.01</urn:BizSvc>
                <urn:CreDt>2016-11-16T10:00:00.000Z</urn:CreDt>
                <urn:Prty>NORM</urn:Prty>
            </urn:AppHdr>
            <urn1:Document>
                <urn1:FIToFIPmtStsRpt>
                    <urn1:GrpHdr>
                        <urn1:MsgId>HBSLAU4TXXX20161110818900000000000</urn1:MsgId>
                        <urn1:CreDtTm>2016-11-16T10:00:00.000Z</urn1:CreDtTm>
                        <urn1:InstgAgt>
                            <urn1:FinInstnId>
                                <urn1:BICFI>INSTGAGTXXX</urn1:BICFI>
                            </urn1:FinInstnId>
                        </urn1:InstgAgt>
                        <urn1:InstdAgt>
                            <urn1:FinInstnId>
                                <urn1:BICFI>INSTDAGTXXX</urn1:BICFI>
                            </urn1:FinInstnId>
                        </urn1:InstdAgt>
                    </urn1:GrpHdr>
                    <urn1:OrgnlGrpInfAndSts>
                        <urn1:OrgnlMsgId>CTBAAUSNXXX20161116ZPJSLESBFYCPNXV</urn1:OrgnlMsgId>
                        <urn1:OrgnlMsgNmId>pacs.008.001.05</urn1:OrgnlMsgNmId>
                    </urn1:OrgnlGrpInfAndSts>
                    <urn1:TxInfAndSts>
                        <urn1:OrgnlEndToEndId>NOTPROVIDED</urn1:OrgnlEndToEndId>
                        <urn1:OrgnlTxId>CTBAAUSNXXXN201604140200N1234567890</urn1:OrgnlTxId>
                        <urn1:TxSts>ACCP</urn1:TxSts>
                        <urn1:AccptncDtTm>2016-04-14T09:30:51.635Z</urn1:AccptncDtTm>
                        <urn1:OrgnlTxRef>
                            <urn1:IntrBkSttlmAmt Ccy="AUD">1555.55</urn1:IntrBkSttlmAmt>
                        </urn1:OrgnlTxRef>
                    </urn1:TxInfAndSts>
                </urn1:FIToFIPmtStsRpt>
            </urn1:Document>
        </typ:NotifyClearingRequest>
    </soapenv:Body>
</soapenv:Envelope>]
2021-05-01 16:16:46.902  WARN 24876 --- [0.0-8080-exec-1] o.s.ws.server.EndpointNotFound           : No endpoint mapping found for [SaajSoapMessage {urn:nppgw:debtorcreditoragent:payments:wsdl:v1/types}NotifyClearingRequest]


---------------------------------
public class SoapConfig extends WsConfigurerAdapter {

    //private static final String NAME_SPACE="urn:nppgw:debtorcreditoragent:payments:wsdl:v1";
    private static final String XSD_PATH="/xsds/";

    @Bean
    public ServletRegistrationBean<MessageDispatcherServlet> messageDispatcherServlet(ApplicationContext applicationContext){
        MessageDispatcherServlet messageDispatcherServlet = new MessageDispatcherServlet();
        messageDispatcherServlet.setApplicationContext(applicationContext);
        messageDispatcherServlet.setTransformWsdlLocations(true);
        return new ServletRegistrationBean<>(messageDispatcherServlet, "/inboundPaymentsAndReturns/soap/*");
    }

//    @Bean(name = "debtorCreditorAgentPayments")
//    public Wsdl11Definition wsdl11Definition(){
//        SimpleWsdl11Definition simpleWsdl11Definition = new SimpleWsdl11Definition();
//        simpleWsdl11Definition.setWsdl(new ClassPathResource("/META-INF/wsdl/DebtorCreditorAgentPaymentsService_v1.wsdl"));
//
//        return simpleWsdl11Definition;
//    }

    @Bean(name = "debtorCreditorAgentPayments")
    public DefaultWsdl11Definition defaultWsdl11Definition() {
        DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
        wsdl11Definition.setServiceName("DebtorCreditorAgentPaymentsService");
//        Properties soapActions = new Properties();
//        soapActions.setProperty("notifySettlement", "urn:nppgw:debtorcreditoragent:payments:wsdl:v1/DebtorCreditorAgentPayments/notifySettlement");
//        wsdl11Definition.setSoapActions(soapActions);

        wsdl11Definition.setPortTypeName("DebtorCreditorAgentPaymentsPort");
        wsdl11Definition.setLocationUri("/inboundPaymentsAndReturns/soap/debtorCreditorAgentPayments");
        wsdl11Definition.setTargetNamespace("urn:nppgw:debtorcreditoragent:payments:wsdl:v1/types");
        //wsdl11Definition.setSchema(countriesSchema());
        wsdl11Definition.setSchemaCollection(getXsdCollection());

        return wsdl11Definition;
    }

    @Bean(name = "main")
    public XsdSchema main() {
        return new SimpleXsdSchema(new ClassPathResource(XSD_PATH+"main.xsd"));
    }

    @Bean(name = "head_001_001_01_20170424")
    public XsdSchema head_001_001_01_20170424() {
        return new SimpleXsdSchema(new ClassPathResource(XSD_PATH+"head_001_001_01_20170424.xsd"));
    }

    @Bean(name = "pacs_002_001_06")
    public XsdSchema pacs_002_001_06() {
        return new SimpleXsdSchema(new ClassPathResource(XSD_PATH+"pacs_002_001_06.xsd"));
    }

    @Bean(name = "CORE_pacs_004_001_05_20170424")
    public XsdSchema CORE_pacs_004_001_05_20170424() {
        return new SimpleXsdSchema(new ClassPathResource(XSD_PATH+"CORE_pacs_004_001_05_20170424.xsd"));
    }

    @Bean(name = "CORE_pacs_008_001_05_20170424")
    public XsdSchema CORE_pacs_008_001_05_20170424() {
        return new SimpleXsdSchema(new ClassPathResource(XSD_PATH+"CORE_pacs_008_001_05_20170424.xsd"));
    }

    @Bean(name = "CORE_pain_013_001_04_20170424")
    public XsdSchema CORE_pain_013_001_04_20170424() {
        return new SimpleXsdSchema(new ClassPathResource(XSD_PATH+"CORE_pain_013_001_04_20170424.xsd"));
    }

    @Bean(name = "CORE_pain_014_001_04_20170424")
    public XsdSchema CORE_pain_014_001_04_20170424() {
        return new SimpleXsdSchema(new ClassPathResource(XSD_PATH+"CORE_pain_014_001_04_20170424.xsd"));
    }
//

    @Bean
    public XsdSchemaCollection getXsdCollection() {

        return new XsdSchemaCollection() {

            @Override
            public XmlValidator createValidator() {
                // TODO Auto-generated method stub
                return null;
            }

            @Override
            public XsdSchema[] getXsdSchemas() {
                return new XsdSchema[]{
                    main()
                };
            }
        };

    }
------------------------------------------


@Endpoint
public class Enpoint {

    public Enpoint(){}

    private static final Logger logger = LoggerFactory.getLogger(Enpoint.class);

    private static final String TARGET_NAME_SPACE ="urn:nppgw:debtorcreditoragent:payments:wsdl:v1/types";

    @PayloadRoot(namespace = TARGET_NAME_SPACE,localPart = "ReturnInitiationRequest")
    @ResponsePayload
    public DebtorCreditorAgentPaymentsResponse returnInitiation(ReturnInitiationRequest returnInitiationRequest) throws AgencyPaymentException {
        return null;
    }

    @PayloadRoot(namespace = TARGET_NAME_SPACE,localPart = "NotifySettlementRequest")
    @ResponsePayload
    public DebtorCreditorAgentPaymentsResponse notifySettlement(NotifySettlementRequest notifySettlementRequest) throws AgencyPaymentException {
        logger.info("notifySettlement() start--------------->");
        return null;
    }

    @PayloadRoot(namespace = TARGET_NAME_SPACE,localPart = "ReturnPaymentRequest")
    @ResponsePayload
    public DebtorCreditorAgentPaymentsResponse returnPayment(ReturnPaymentRequest returnPaymentRequest) throws AgencyPaymentException {
        return null;
    }

    @PayloadRoot(namespace = TARGET_NAME_SPACE,localPart = "NotifyClearingRequest")
    @ResponsePayload
    public DebtorCreditorAgentPaymentsResponse notifyClearing(NotifyClearingRequest notifyClearingRequest) throws AgencyPaymentException {
        logger.info("notifyClearing() start--------------->");
        return null;
    }

    @PayloadRoot(namespace = TARGET_NAME_SPACE,localPart = "ProcessCreditTransferRequest")
    @ResponsePayload
    public DebtorCreditorAgentPaymentsResponse processCreditTransfer(ProcessCreditTransferRequest processCreditTransferRequest) throws AgencyPaymentException {
        return null;
    }

    @PayloadRoot(namespace = TARGET_NAME_SPACE,localPart = "RequestCreditorPaymentActivationRequest")
    @ResponsePayload
    public DebtorCreditorAgentPaymentsResponse requestCreditorPaymentActivation(RequestCreditorPaymentActivationRequest requestCreditorPaymentActivationRequest) throws AgencyPaymentException {
        throw new UnsupportedOperationException("RequestCreditorPaymentActivationRequest Operation not supported in Heritage NPP. Request: " + requestCreditorPaymentActivationRequest.toString());
    }

    @PayloadRoot(namespace = TARGET_NAME_SPACE,localPart = "ReportCreditorPaymentActivationRequest")
    @ResponsePayload
    public DebtorCreditorAgentPaymentsResponse reportCreditorPaymentActivation(ReportCreditorPaymentActivationRequest reportCreditorPaymentActivationRequest) throws AgencyPaymentException {
        throw new UnsupportedOperationException("ReportCreditorPaymentActivationRequest Operation not supported in Heritage NPP. Request: " + reportCreditorPaymentActivationRequest.toString());
    }

Please suggest what is issue here.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多