java 不支持 SOAP 编码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25260939/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 07:42:11  来源:igfitidea点击:

SOAP Encoding is not supported

javasoapwsdl

提问by DolDurma

I have WSDLurl like with below format and that seems is correct. After using wsimportin terminal for parse that I get an error:

我有WSDL以下格式的网址,这似乎是正确的。使用后wsimport在终端解析,我得到一个错误:

Run from terminal:

从终端运行:

tux-world@alachiq:~/Desktop/Project/java > wsimport -keep -s wsdl/ example.com/wsdl/wsdl.php?wsdl
parsing WSDL...


[ERROR] "Use of SOAP Encoding is not supported. 
SOAP extension element on line 59 in example.com/wsdl/wsdl.php?wsdl has use="encoded" "

Failed to parse the WSDL.

WSDLfor Parse:

用于解析的WSDL

<?xml version="1.0" encoding="ISO-8859-1"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:tsmswsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:tsmswsdl">
<types>
<xsd:schema targetNamespace="urn:tsmswsdl"
>
 <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
 <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
 <xsd:complexType name="outGetMessages">
  <xsd:complexContent>
   <xsd:restriction base="SOAP-ENC:Array">
    <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>
   </xsd:restriction>
  </xsd:complexContent>
 </xsd:complexType>
</xsd:schema>
</types>
<message name="GetMessagesRequest">
  <part name="user" type="xsd:string" />
  <part name="pass" type="xsd:string" />
  <part name="idend" type="xsd:int" />
  <part name="count_request" type="xsd:int" /></message>
<message name="GetMessagesResponse">
  <part name="return" type="tns:outGetMessages" /></message>
<message name="login_checkRequest">
  <part name="user" type="xsd:string" />
  <part name="pass" type="xsd:string" /></message>
<message name="login_checkResponse">
  <part name="return" type="tns:outGetMessages" /></message>
<message name="send_smsRequest">
  <part name="user" type="xsd:string" />
  <part name="pass" type="xsd:string" />
  <part name="sms_number" type="xsd:string" />
  <part name="mobile" type="xsd:string" />
  <part name="msg" type="xsd:string" />
  <part name="send_date" type="xsd:string" /></message>
<message name="send_smsResponse">
  <part name="return" type="tns:outGetMessages" /></message>
<portType name="tsmswsdlPortType">
  <operation name="GetMessages">
    <documentation>Get specific user info</documentation>
    <input message="tns:GetMessagesRequest"/>
    <output message="tns:GetMessagesResponse"/>
  </operation>
  <operation name="login_check">
    <documentation>Get specific user info</documentation>
    <input message="tns:login_checkRequest"/>
    <output message="tns:login_checkResponse"/>
  </operation>
  <operation name="send_sms">
    <documentation>Get specific user info</documentation>
    <input message="tns:send_smsRequest"/>
    <output message="tns:send_smsResponse"/>
  </operation>
</portType>
<binding name="tsmswsdlBinding" type="tns:tsmswsdlPortType">
  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  <operation name="GetMessages">
    <soap:operation soapAction="urn:tsmswsdl#GetMessages" style="rpc"/>
    <input><soap:body use="encoded" namespace="urn:tsmswsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
    <output><soap:body use="encoded" namespace="urn:tsmswsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
  </operation>
  <operation name="login_check">
    <soap:operation soapAction="urn:tsmswsdl#login_check" style="rpc"/>
    <input><soap:body use="encoded" namespace="urn:tsmswsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
    <output><soap:body use="encoded" namespace="urn:tsmswsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
  </operation>
  <operation name="send_sms">
    <soap:operation soapAction="urn:tsmswsdl#send_sms" style="rpc"/>
    <input><soap:body use="encoded" namespace="urn:tsmswsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
    <output><soap:body use="encoded" namespace="urn:tsmswsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
  </operation>
</binding>
<service name="tsmswsdl">
  <port name="tsmswsdlPort" binding="tns:tsmswsdlBinding">
    <soap:address location="example.com/wsdl/wsdl.php"/>
  </port>
</service>
</definitions>

回答by Ray

To remove the ambiguity over whether this question has an answer or not, I'm posting the answer from the comments of @Roman Vottner:

为了消除这个问题是否有答案的歧义,我发布了@Roman Vottner 评论中的答案:

Version 2 of JAX-WS does not support rpc/encoded. If you are in control of the web service try changing rpc/encoded to document/literal.

JAX-WS 的第 2 版不支持 rpc/encoded。如果您控制 Web 服务,请尝试将 rpc/encoded 更改为 document/literal。

Suggested readings:

推荐读物:

  1. link 1
  2. link 2
  3. link 3
  4. link 4
  5. link 5
  1. 链接 1
  2. 链接 2
  3. 链接 3
  4. 链接 4
  5. 链接 5