NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
.NET client consume NuSOAP - class names X method name


Joined: 09 Feb 2009
Posts: 1
Reply with quote
Hi all,
I am relatively new to web services. I didn't find any topics about consuming of NuSOAP service by .NET client, describing my problem.
My only way is to use NuSOAP, because of server limitations.
My job is to make web service with method called i.e. GetInfo with declaration like:

public Info GetInfo(InfoRequest request, AuthorizationRequest AuthorizationRequest, out eInfo[], out Error Error)

requests and response examples i got from submitter doesn't match classic rpc style messages, but:

request data are wrapped into element named InfoRequest with tempuri_org namespace, and this element contains element named even the same and second element named AuthorizationRequest. These last elements contains required complex data.

<soap:body>
<InfoRequest xmlns="http://tempuri_org/">
<InfoRequest>
<a>text a</a>
<b>text b</b>
<c>text c</c>
</InfoRequest>
<AuthorizationRequest>
<u>value u</u>
<p>value p</p>
</AuthorizationRequest>
</InfoRequest>
</soap:body>

and response should be in this format:

<soap:body>
<GetInfo xmlns="http://tempuri_org/">
<Info>
<i>info 1</i>
<m>next info</m>
</Info>
<eInfo>
<eInfo>
<ia>einfo part a</ia>
<ib>einfo part b</ib>
</eInfo>
<eInfo>
<ia>einfo part aaaa</ia>
<ib>einfo part bbbbb</ib>
</eInfo>
<eInfo>
<ia>einfo part axxxa</ia>
<ib>einfo part bxxxxa</ib>
</eInfo>
</eInfo>
<Error>
<eCode>0</Error>
<eMessage>OK</Error>
</Error>
</GetInfo>
</soap:body>

Where Info and eInfo are optional

Problem is, that they want to send request wrapped in element named by type of in parameters (InfoRequest) and expecting response wrapped in element named by method name (GetInfo).

Another thing confusing me is array eInfo containing elements named <eInfo> and not <item> (like I am used to with NuSOAP).

-----
I tried many experiments, but no success.

I wish to know how to make web service via NuSOAP using this request - response comunicating format.

The wsdl file from other company's implementations contains type definition which I am not able to achieve in my wsdl with NuSOAP:

<s:element name="InfoRequest">
<s:complexType>
<s:sequence>
<s:element name="InfoRequest" type="tns:InfoReuqest" />
<s:element name="AuthorizationRequest" type="tns:AuthorizationReuqest" />
</s:sequence>
</s:complexType>
</s:element>

<s:complexType name="InfoRequest">
<s:sequence>
<s:element name="a" type="s:string" />
<s:element name="b" type="s:string" />
<s:element name="c" type="s:string" />
<s:sequence>
</s:complexType>

<s:complexType name="AuthorizationRequest">
<s:sequence>
<s:element name="u" type="s:string" />
<s:element name="p" type="s:string" />
<s:sequence>
</s:complexType>

<s:element name="GetInfo">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" minOccurs="1" name="Info" type="tns:Info" />
<s:element minOccurs="0" minOccurs="unbounded" name="eInfo" type="tns:eInfo" />
<s:element minOccurs="1" minOccurs="1" name="Error" type="tns:Error" />
</s:sequence>
</s:complexType>
</s:element">

<s:complexType name="Info">
<s:sequence>
<s:element name="i" type="s:string" />
<s:element name="m" type="s:string" />
<s:sequence>
</s:complexType>

<s:complexType name="eInfo">
<s:sequence>
<s:element name="ia" type="s:string" />
<s:element name="ib" type="s:string" />
<s:sequence>
</s:complexType>

<s:complexType name="Error">
<s:sequence>
<s:element name="eCode" type="s:int" />
<s:element name="eMessage" type="s:string" />
<s:sequence>
</s:complexType>

and message definition:

<wsdl:message name "GetInfoSoapIn">
<wsdl:part name="parameters" element="tns:InfoRequest" />
</wsdl:message>

<wsdl:message name "GetInfoSoapOut">
<wsdl:part name="parameters" element="tns:GetInfo" />
</wsdl:message>

and portTypes:

<wsdl:operation name="GetInfo">
<wsdl:input message="tns:GetInfoSoapIn" />
<wsdl:output message="tns:GetInfoSoapOut" />
</wsdl:operation>

and bindings with document / literal.


How can I set up my server like this format with element->complexType->sequence->element definitions?
Is NuSOAP able to comunicate this way?
- getting wrapped parameters into element named differently from nethod name
- responsing data wrapped into element named by method name
- arrays containing other elements than <item>
- and optional out parameters (.NET understand them like prm3: public int method(int prm1, int prm2, out int prm3);

Thank You very much in advance for yours time.
View user's profileFind all posts by dodgeSend private message
.NET client consume NuSOAP - class names X method name
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic