Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/370.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 外部WSDL名称空间_Java_Namespaces_Wsdl_Cxf Client - Fatal编程技术网

Java 外部WSDL名称空间

Java 外部WSDL名称空间,java,namespaces,wsdl,cxf-client,Java,Namespaces,Wsdl,Cxf Client,我使用ApacheCXF2.7.14从外部WSDL生成存根。这个请求有两个名称空间,它用一个不同的名称空间包装参数,这个名称空间最终会从我调用的外部系统失败。 有没有一种方法可以去掉这两个名称空间,只让请求使用一个(显式地)。我需要使用ns2或ns3,而不是两者。然而,我不知道如何做到这一点,因为它是隐式发生的。请帮忙 请求如下: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&

我使用ApacheCXF2.7.14从外部WSDL生成存根。这个请求有两个名称空间,它用一个不同的名称空间包装参数,这个名称空间最终会从我调用的外部系统失败。 有没有一种方法可以去掉这两个名称空间,只让请求使用一个(显式地)。我需要使用ns2或ns3,而不是两者。然而,我不知道如何做到这一点,因为它是隐式发生的。请帮忙

请求如下:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body>
             <ns3:GetMG xmlns:ns2="http://xxxx-xxx.com/" xmlns:ns3="http://www.xxxx-xxx.com/">
                <ns2:msg>hello</ns2:msg>
                <ns2:creator>Creator</ns2:creator>
                <ns2:appid>appid</ns2:appid>
             </ns3:GetMG>
       </soap:Body>
</soap:Envelope>
WSDL看起来像这样:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.xxxx-xxx.com/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    targetNamespace="http://www.xxxx-xxx.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.xxxx-xxx.com/">
            <s:element name="GetMG">
                <s:complexType>
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="msg" type="s:string" />
                        <s:element minOccurs="0" maxOccurs="1" name="creator"
                            type="s:string" />
                        <s:element minOccurs="0" maxOccurs="1" name="appid"
                            type="s:string" />
                    </s:sequence>
                </s:complexType>
            </s:element>
            <s:element name="GetMGResponse">
                <s:complexType>
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="GetMGResult"
                            type="tns:DeviceWSDL" />
                    </s:sequence>
                </s:complexType>
            </s:element>
            
    </wsdl:types>
    <wsdl:message name="GetMGSoapIn">
        <wsdl:part name="parameters" element="tns:GetMG" />
    </wsdl:message>
    <wsdl:message name="GetMGSoapOut">
        <wsdl:part name="parameters" element="tns:GetMGResponse" />
    </wsdl:message>
    
    <wsdl:portType name="MessageWSSoap">
        <wsdl:operation name="GetMG">
            <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">messgae messag .
            </wsdl:documentation>
            <wsdl:input message="tns:GetMGSoapIn" />
            <wsdl:output message="tns:GetMGSoapOut" />
        </wsdl:operation>
        
    </wsdl:portType>
    <wsdl:binding name="MessageWSSoap" type="tns:MessageWSSoap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="GetMG">
            <soap:operation soapAction="http://www.xxxx-xxx.com/GetMG"
                style="document" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="MessageWSSoap12" type="tns:MessageWSSoap">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="GetMG">
            <soap12:operation soapAction="http://www.xxxx-xxx.com/GetMG"
                style="document" />
            <wsdl:input>
                <soap12:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal" />
            </wsdl:output>
        </wsdl:operation>

    </wsdl:binding>
    <wsdl:service name="MessageWS">
        <wsdl:port name="MessageWSSoap" binding="tns:MessageWSSoap">
            <soap:address location="http://xxxxxxxx/xxxx/acsws.asmx" />
        </wsdl:port>
        <wsdl:port name="ACSWSSoap12" binding="tns:ACSWSSoap12">
            <soap12:address location="http://xxxxxxxx/xxxx/acsws.asmx" />
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

梅斯盖·梅斯格。
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.xxxx-xxx.com/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    targetNamespace="http://www.xxxx-xxx.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.xxxx-xxx.com/">
            <s:element name="GetMG">
                <s:complexType>
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="msg" type="s:string" />
                        <s:element minOccurs="0" maxOccurs="1" name="creator"
                            type="s:string" />
                        <s:element minOccurs="0" maxOccurs="1" name="appid"
                            type="s:string" />
                    </s:sequence>
                </s:complexType>
            </s:element>
            <s:element name="GetMGResponse">
                <s:complexType>
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="GetMGResult"
                            type="tns:DeviceWSDL" />
                    </s:sequence>
                </s:complexType>
            </s:element>
            
    </wsdl:types>
    <wsdl:message name="GetMGSoapIn">
        <wsdl:part name="parameters" element="tns:GetMG" />
    </wsdl:message>
    <wsdl:message name="GetMGSoapOut">
        <wsdl:part name="parameters" element="tns:GetMGResponse" />
    </wsdl:message>
    
    <wsdl:portType name="MessageWSSoap">
        <wsdl:operation name="GetMG">
            <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">messgae messag .
            </wsdl:documentation>
            <wsdl:input message="tns:GetMGSoapIn" />
            <wsdl:output message="tns:GetMGSoapOut" />
        </wsdl:operation>
        
    </wsdl:portType>
    <wsdl:binding name="MessageWSSoap" type="tns:MessageWSSoap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="GetMG">
            <soap:operation soapAction="http://www.xxxx-xxx.com/GetMG"
                style="document" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="MessageWSSoap12" type="tns:MessageWSSoap">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="GetMG">
            <soap12:operation soapAction="http://www.xxxx-xxx.com/GetMG"
                style="document" />
            <wsdl:input>
                <soap12:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal" />
            </wsdl:output>
        </wsdl:operation>

    </wsdl:binding>
    <wsdl:service name="MessageWS">
        <wsdl:port name="MessageWSSoap" binding="tns:MessageWSSoap">
            <soap:address location="http://xxxxxxxx/xxxx/acsws.asmx" />
        </wsdl:port>
        <wsdl:port name="ACSWSSoap12" binding="tns:ACSWSSoap12">
            <soap12:address location="http://xxxxxxxx/xxxx/acsws.asmx" />
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>