简体   繁体   English

SOAP 网络服务

[英]SOAP Webservices

I have a wsdl containing SAOP Header and SOAP Body.我有一个包含 SAOP Header 和 SOAP Body 的 wsdl。 I generated client with eclipse and APACHE CXF and sent request.我用 eclipse 和 APACHE CXF 生成了客户端并发送了请求。 But request is failing saying Header is missed or invalid.但是请求失败,说 Header 丢失或无效。

<?xml version="1.0" encoding="UTF-8"?>

<types>
    <xsd:schema>
        <xsd:import
            namespace="http://finservice.cl.com/Services/financier/Operational/Messages/Request"
            schemaLocation="financierRequest.xsd"/>
        <xsd:import
            namespace="http://finservice.cl.com/Services/financier/Operational/Messages/Response"
            schemaLocation="financierResponse6.xsd"/>
        <xsd:import namespace="http://finservice.cl.com/Services/Faults"
            schemaLocation="finserviceFaults.xsd"/>
        <xsd:import namespace="http://www.cl.com/Services/SOAPHeaders"
            schemaLocation="CLSoapHeaders.xsd"/>
        <xsd:import
            namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
            schemaLocation="oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
    </xsd:schema>
</types>


<message name="WS-Security-SOAPHeader">
    <part element="wssec:Security" name="Security"/>
</message>

<message name="CLSOAPHeader">
    <part element="hdr_ns:RequestContextHeader" name="requestHeader"/>
    <part element="hdr_ns:ProcessingNodesHeader" name="processingNodesHeader"/>
</message>


<message name="financierRequest">
    <part element="req_ns:financierRequestElement" name="financierRequestElement"/>
</message>


<message name="financierResponse">
    <part element="res_ns:financierResponseElement" name="financierResponseElement"/>
</message>


<message name="Fault_Exception">
    <part element="fault_ns:Fault" name="fault"/>
</message>


<portType name="finServicePortType">
    <operation name="getFinanciers">
        <input message="tns:financierRequest"/>
        <output message="tns:financierResponse"/>
        <fault message="tns:Fault_Exception" name="Fault_Exception"/>
    </operation>
</portType>


<binding name="finServiceBinding" type="tns:finServicePortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

    <operation name="getFinanciers">
        <soap:operation soapAction=""/>
        <input>
            <soap:body parts="financierRequestElement" use="literal"/>
            <soap:header message="tns:CLSOAPHeader" part="requestHeader" use="literal"/>
            <!-- soap:header message="tns:CLSOAPHeader" part="processingNodesHeader" use="optional"/-->
            <soap:header message="tns:WS-Security-SOAPHeader" part="Security" use="literal"/>
        </input>
        <output>
            <soap:body use="literal"/>
            <soap:header message="tns:CLSOAPHeader" part="processingNodesHeader" use="literal"/>
            <soap:header message="tns:WS-Security-SOAPHeader" part="Security" use="literal"/>
        </output>
        <fault name="Fault_Exception">
            <soap:fault name="Fault_Exception" use="literal"/>
        </fault>
    </operation>
</binding>

<service name="financierService_v4">
    <port binding="tns:finServiceBinding" name="finServicePort">
        <soap:address                     location="http://finservice.qtcorpCL.cl.com:20021/finservService"/>
    </port>
</service>

Can any one guide me how to write client for this wsdl?任何人都可以指导我如何为这个 wsdl 编写客户端吗? How to attach header for this.如何为此附加标题。

Did you test this wsdl in soapui?你在soapui中测试过这个wsdl吗? https://www.soapui.org/ https://www.soapui.org/

I would suggest to first see what is the request and response structure of this web than may be you can use same request structure in your eclipse client.我建议先看看这个网站的请求和响应结构是什么,而不是你可以在你的 eclipse 客户端中使用相同的请求结构。 Soapui is very easy to use. Soapui 非常易于使用。

要生成所有客户端工件,您需要使用wsimport ,然后阅读有关 SOAP 客户端的信息...简单的 JAX-WS 客户端

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM