# Ruby Client to Microsoft .Net Webservice

**URL:** <https://www.ruby-forum.com/t/ruby-client-to-microsoft-net-webservice/61570>\
**Category:** Ruby\
**Created:** [May 25, 2006, 3:36am UTC](https://www.ruby-forum.com/t/ruby-client-to-microsoft-net-webservice/61570 "2006-05-25T03:36:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@Allan](https://www.ruby-forum.com/u/Allan)\
**Post date:** [May 25, 2006, 3:36am UTC](https://www.ruby-forum.com/t/ruby-client-to-microsoft-net-webservice/61570/1 "2006-05-25T03:36:06Z")

</div>

---------- Forwarded message ----------  
From: Allan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Date: May 25, 2006 9:31 AM  
Subject: Ruby Client to Microsoft .Net Webservice  
To: removed\_email\_address@domain.invalid

Hi all,  
I am trying to write a client to communicate to Microsft .Net  
Webservice,  
and the request contains a array of struct,  
The request we want should like

\<?xml version="1.0" encoding="utf-8" ?\>

\<env:Envelope xmlns:xsd=“[XML Schema](http://www.w3.org/2001/XMLSchema)”  
xmlns:env="[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/) "  
xmlns:xsi=“[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)”\>  
env:Body  
\<n1:refreshInformation  
xmlns:n1="[MSN](http://www.msn.com/webservices/spaces/v1/)  
"\>  
n1:Request  
n1:authCache2\</n1:authCache\>  
n1:Mark2\</n1:Mark\>  
n1:Re  
n1:auth  
n1:auth11\</n1:auth1\>  
n1:auth21\</n1:auth2\>  
\</n1:auth\>  
n1:auth  
n1:auth12\</n1:auth1\>  
n1:auth22\</n1:auth2\>  
\</n1:auth\>  
\</n1:Re\>  
\</n1:Request\>  
\</n1:refreshInformation\>  
\</env:Body\>  
\</env:Envelope\>

However the request we got is

\<?xml version="1.0" encoding="utf-8" ?\>

\<env:Envelope xmlns:xsd=“[XML Schema](http://www.w3.org/2001/XMLSchema)”  
xmlns:env=" [http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)"  
xmlns:xsi=“[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)”\>  
env:Body  
\<n1:refreshInformation xmlns:n1="  
[MSN](http://www.msn.com/webservices/spaces/v1/)"\>  
n1:Request  
n1:authCache2\</n1:authCache\>  
n1:Mark2\</n1:Mark\>  
n1:Re  
n1:item  
n1:auth11\</n1:auth1\>  
n1:auth21\</n1:auth2\>  
\</n1:item\>  
n1:item  
n1:auth12\</n1:auth1\>  
n1:auth22\</n1:auth2\>  
\</n1:item\>  
\</n1:Re\>  
\</n1:Request\>  
\</n1:refreshInformation\>  
\</env:Body\>  
\</env:Envelope\>

Notice that each element of the array is automaticlly given the title  
‘item’, how can I change it to what I want or let it disapear.  
my code is like  
require ‘soap/rpc/driver’  
require ‘soap/wsdlDriver’  
require ‘cgi’  
require ‘soap’  
driver = SOAP::RPC::Driver.new("  
[http://services.spaces.msn.com/contactcard/contactcardservice.asmx](http://services.spaces.msn.com/contactcard/contactcardservice.asmx) ",  
“[MSN](http://www.msn.com/webservices/spaces/v1/)”,

"[MSN](http://www.msn.com/webservices/spaces/v1/GetXmlFeed)  
")

driver.wiredump\_dev = STDOUT  
Re = Struct.new (:auth1, :auth2)  
auth = Array.new  
auth1 = auth.new(1,1)  
auth2 = auth.new(2,2)  
Request = Struct.new (:authCache, :Mark, :Re)  
request = Request.new(2,2,Re.)  
driver.add\_method(‘refreshInformation’,‘Request’)  
driver.default\_encodingstyle =  
SOAP::EncodingStyle::ASPDotNetHandler::Namespace  
driver.refreshInformation (request)
