Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to use return value of soap web service in soap client
    text
    copied!<p>I have an soap web service that has a method like</p> <pre><code>public WsResult doMyJob(String s, Information info); </code></pre> <p>when I generate a client out of the wsdl, in the client code my webservice's method becomes something like:</p> <pre><code>public Object doMyJob(String s, Object arg0); </code></pre> <p>The problem is that I want client to be able to implement/see my custom classes(WsResult and Information) without explicitly defining them in his code.</p> <p>Is that even possible and if so how?</p> <p>Thanks</p> <p>edit:</p> <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;wsdl:definitions name="SendSms" targetNamespace="http://webservice.aaa.bbb.com/" xmlns:ns1="http://webservice.aaa.bbb.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;wsdl:types&gt; &lt;xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://webservice.aaa.bbb.com/" xmlns="http://webservice.aaa.bbb.com/" xmlns:tns="http://impl.webservice.aaa.bbb.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;xsd:element name="registerScheduledSms" type="registerScheduledSms" /&gt; &lt;xsd:complexType name="registerScheduledSms"&gt; &lt;xsd:sequence&gt; &lt;xsd:element minOccurs="0" name="arg0" type="xsd:string" /&gt; &lt;xsd:element minOccurs="0" name="arg1" /&gt; **HERE THERE SHOULD BE xsd definition for my custom class** &lt;xsd:element minOccurs="0" name="arg2" /&gt; **and here** &lt;xsd:element minOccurs="0" name="arg3" type="xsd:dateTime" /&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;xsd:element name="registerScheduledSmsResponse" type="registerScheduledSmsResponse" /&gt; &lt;xsd:complexType name="registerScheduledSmsResponse"&gt; &lt;xsd:sequence&gt; &lt;xsd:element minOccurs="0" name="return" /&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;/xsd:schema&gt; &lt;/wsdl:types&gt; &lt;wsdl:message name="registerScheduledSmsResponse"&gt; &lt;wsdl:part element="ns1:registerScheduledSmsResponse" name="parameters"&gt; &lt;/wsdl:part&gt; &lt;/wsdl:message&gt; &lt;wsdl:message name="registerScheduledSms"&gt; &lt;wsdl:part element="ns1:registerScheduledSms" name="parameters"&gt; &lt;/wsdl:part&gt; &lt;/wsdl:message&gt; &lt;wsdl:portType name="SendSms"&gt; &lt;wsdl:operation name="registerScheduledSms"&gt; &lt;wsdl:input message="ns1:registerScheduledSms" name="registerScheduledSms"&gt; &lt;/wsdl:input&gt; &lt;wsdl:output message="ns1:registerScheduledSmsResponse" name="registerScheduledSmsResponse"&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:portType&gt; &lt;/wsdl:definitions&gt; </code></pre> <p>my service code</p> <pre><code>@WebService(endpointInterface = "com.bbb.aaa.webservice.SendSms") public class SendSmsImpl implements SendSms { private DbService dbService; @Override public WsResult registerScheduledSms(String applicationId, ServiceAccount serviceAccount, Sms sms, Date scheduledDate) { return dbService.addNewScheduledSms(applicationId, serviceAccount, sms, scheduledDate); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload