简体   繁体   English

wsimport使用SOAP 1.2 for SOAP 1.1 wsdl

[英]wsimport uses SOAP 1.2 for SOAP 1.1 wsdl

I've got this wsdl supplied for a SOAP 1.1, once I try to generate my java code using wsimport, it handles the wsdl as being 1.2. 我已经为SOAP 1.1提供了这个wsdl,一旦我尝试使用wsimport生成我的java代码,它将wsdl处理为1.2。 Which subsiquentially throws an error: com.sun.tools.ws.wsdl.framework.ParseException: invalid extension element: "soap:body" (in namespace " http://schemas.xmlsoap.org/wsdl/soap/ ") 哪个亚顺序抛出错误:com.sun.tools.ws.wsdl.framework.ParseException:无效的扩展元素:“soap:body”(在命名空间“ http://schemas.xmlsoap.org/wsdl/soap/ ”中)

If I change the soap name change from: xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/ to xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/ It generates my code, but I'm not sure what other consequences this has (I can't yet connect to the endpoint at this time). 如果我将soap名称更改为:xmlns:soap =“http://schemas.xmlsoap.org/wsdl/soap12/到xmlns:soap =”http://schemas.xmlsoap.org/wsdl/soap/它会生成我的代码,但我不确定它有什么其他后果(我目前还无法连接到端点)。 Plus I don't want to hack the wsdl. 另外我不想破解wsdl。

Is there any known error in wsimport that let's it incorrectly handle a 1.1 wsdl as being 1.2? 在wsimport中是否存在任何已知错误,让它错误地将1.1 wsdl处理为1.2? (well, known... I can't find anything about this after hours of searching) Is there a work around where for example I can force wsimport to use soap 1.1? (好吧,已知......经过几个小时的搜索,我找不到任何关于这个的信息)是否有一个工作可以解决wsimport使用肥皂1.1的问题? Any other solution without editting the wsdl? 没有编辑wsdl的任何其他解决方案?

wsdl code here: wsdl代码在这里:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:rpa="urn:ns:cdm:reisinformatie:data:vi:1" xmlns:tns="urn:ns:cdm:reisinformatie:message:actuelelandelijkeberichten:1" xmlns:ns="urn:ns:cdm:reisinformatie:message:actuelelandelijkeberichten:1" targetNamespace="urn:ns:cdm:reisinformatie:message:actuelelandelijkeberichten:1">
    <wsdl:types>
        <xsd:schema xmlns:rpa="urn:ns:cdm:reisinformatie:data:vi:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:ns:cdm:reisinformatie:message:actuelelandelijkeberichten:1" targetNamespace="urn:ns:cdm:reisinformatie:message:actuelelandelijkeberichten:1" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
            <xsd:import schemaLocation="ri-cdm-vi-lab.xsd" namespace="urn:ns:cdm:reisinformatie:data:vi:1"/>
            <xsd:element name="GeefActueleLandelijkeBerichtenRequestMessage" type="rpa:GeefActueleLandelijkeBerichtenRequestMessageType"/>
            <xsd:element name="GeefActueleLandelijkeBerichtenResponseMessage" type="rpa:GeefActueleLandelijkeBerichtenResponseMessageType"/>
            <xsd:element name="GeefActueleLandelijkeBerichtenFaultMessage" type="rpa:GeefActueleLandelijkeBerichtenFaultMessageType"/>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="GeefActueleLandelijkeBerichtenRequest">
        <wsdl:part name="parameter" element="tns:GeefActueleLandelijkeBerichtenRequestMessage"/>
    </wsdl:message>
    <wsdl:message name="GeefActueleLandelijkeBerichtenResponse">
        <wsdl:part name="parameter" element="tns:GeefActueleLandelijkeBerichtenResponseMessage"/>
    </wsdl:message>
    <wsdl:message name="GeefActueleLandelijkeBerichtenFault">
        <wsdl:part name="Fout" element="tns:GeefActueleLandelijkeBerichtenFaultMessage"/>
    </wsdl:message>
    <wsdl:portType name="ActueleLandelijkeBerichtenSoap">
        <wsdl:documentation>Actuele LandelijkeBerichten Soap Port</wsdl:documentation>
        <wsdl:operation name="GeefActueleLandelijkeBerichten">
            <wsdl:input message="tns:GeefActueleLandelijkeBerichtenRequest"/>
            <wsdl:output message="tns:GeefActueleLandelijkeBerichtenResponse"/>
            <wsdl:fault name="Fout" message="tns:GeefActueleLandelijkeBerichtenFault"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="ActueleLandelijkeBerichtenSoap" type="tns:ActueleLandelijkeBerichtenSoap">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:documentation>Actuele LandelijkeBerichten Soap Binding</wsdl:documentation>
        <wsdl:operation name="GeefActueleLandelijkeBerichten">
            <soap:operation soapAction="urn:GeefActueleLandelijkeBerichten"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
            <wsdl:fault name="Fout">
                <soap:body use="literal"/>
            </wsdl:fault>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="ActueleLandelijkeBerichten">
        <wsdl:documentation>Actuele LandelijkeBerichten Service</wsdl:documentation>
        <wsdl:port name="RPAActueleLandelijkeBerichtenSoap" binding="tns:ActueleLandelijkeBerichtenSoap">
            <soap:address location="NotDefined"/>
            <wsdl:documentation>Reisinformatie Pull Applicatie Actuele LandelijkeBerichten Soap Service</wsdl:documentation>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

note: two .xsd's not included 注意:两个.xsd不包括在内

Right, we've decided to generate the code with CXF (which works) and then add that to the delivery file. 是的,我们决定使用CXF(可以工作)生成代码,然后将其添加到交付文件中。

Also, another team at our company ran into same problem and couldn't find a solution for this as well. 此外,我们公司的另一个团队遇到了同样的问题,也无法找到解决方案。

So, the answer seems to be: use CXF. 所以,答案似乎是:使用CXF。

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

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