27

I have WSDL url like with below format and that seems is correct. After using wsimport in terminal for parse that I get an error:

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.

WSDL for Parse:

<?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>
StuartLC
  • 104,537
  • 17
  • 209
  • 285
DolDurma
  • 15,753
  • 51
  • 198
  • 377
  • 3
    it seems you are using JAX-WS version 2.* (You can check by typing in `wsimport -version` in your command line). Version 2 of JAX-WS does not support rpc/encoded anymore. If you are in control of the web service you should probably change from rpc/encoded to probably document/literal - [suggested reading](http://www.ibm.com/developerworks/library/ws-whichwsdl/) - also have a look at [this link here](http://stackoverflow.com/questions/10489191/wsimport-fails-when-trying-to-create-client-service-library) – Roman Vottner Aug 12 '14 at 10:18
  • 1
    @RomanVottner i can not find any document about that. can you help me simple change or how to change that? – DolDurma Aug 16 '14 at 06:31
  • 3
    [This blog](http://chase-seibert.github.io/blog/2008/12/09/rpcencoded-web-services-on-java-16.html), [this article](http://architects.dzone.com/articles/wsdltojava-error-rpcencoded) or [this SO post](http://stackoverflow.com/questions/412772/java-rpc-encoded-wsdls-are-not-supported-in-jaxws-2-0) indicate that `wsimport` does not support RPC/encoded anymore. Your failure does indicate that too. If you followed the link to the suggested IBM article it should be clear how you could change the behavior in the WSDL file - howevery, chaning the WSDL is not enough - the serverside needs to change too – Roman Vottner Aug 16 '14 at 13:39
  • 1
    @RomanVottner thanks sir. can you help me for this link? http://stackoverflow.com/questions/25346615/java-some-of-commands-to-rpc-encoded-web-services-could-not-found-axis-files i can not use commands after downloading Axis – DolDurma Aug 17 '14 at 05:49
  • did you tried http://stackoverflow.com/questions/412772/java-rpc-encoded-wsdls-are-not-supported-in-jaxws-2-0/24989737#24989737 ? – Eugene Lebedev Apr 13 '16 at 09:11
  • Possible duplicate of [java: Rpc/encoded wsdls are not supported in JAXWS 2.0](http://stackoverflow.com/questions/412772/java-rpc-encoded-wsdls-are-not-supported-in-jaxws-2-0) – Andremoniy Feb 10 '17 at 00:34
  • Similar problem (with solutions): [Best way to consume RPC/encoded webservice?](https://stackoverflow.com/questions/7284126/best-way-to-consume-rpc-encoded-webservice). – sleske Sep 16 '19 at 09:38

1 Answers1

2

To remove the ambiguity over whether this question has an answer or not, I'm posting the answer from the comments of @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.

Suggested readings:

  1. link 1
  2. link 2
  3. link 3
  4. link 4
  5. link 5
Chetan Joshi
  • 5,582
  • 4
  • 30
  • 43
Ray
  • 3,864
  • 7
  • 24
  • 36
  • Would this break backward compatibility ? I mean if we change "rpc/encoded" to "document/literal", do we need to rebuild the clients ? – Mansour Apr 18 '23 at 20:49