Forum: Ruby Ruby Client to Microsoft .Net Webservice

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4ea145fd4ce83c50fa54ce87ab239b8e?d=identicon&s=25 Allan (Guest)
on 2006-05-25 03:36
(Received via mailing list)
---------- Forwarded message ----------
From: Allan <allandu@gmail.com>
Date: May 25, 2006 9:31 AM
Subject: Ruby Client to Microsoft .Net Webservice
To: ruby-talkl@ruby-lang.org

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="http://www.w3.org/2001/XMLSchema"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/ "
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <n1:refreshInformation
xmlns:n1="http://www.msn.com/webservices/spaces/v1/
">
      <n1:Request>
        <n1:authCache>2</n1:authCache>
        <n1:Mark>2</n1:Mark>
        <n1:Re>
          <n1:auth>
            <n1:auth1>1</n1:auth1>
            <n1:auth2>1</n1:auth2>
          </n1:auth>
          <n1:auth>
            <n1:auth1>2</n1:auth1>
            <n1:auth2>2</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="http://www.w3.org/2001/XMLSchema"
    xmlns:env=" http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <n1:refreshInformation xmlns:n1="
http://www.msn.com/webservices/spaces/v1/">
      <n1:Request>
        <n1:authCache>2</n1:authCache>
        <n1:Mark>2</n1:Mark>
        <n1:Re>
          <n1:item>
            <n1:auth1>1</n1:auth1>
            <n1:auth2>1</n1:auth2>
          </n1:item>
          <n1:item>
            <n1:auth1>2</n1:auth1>
            <n1:auth2>2</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/contact... ",
                               "http://www.msn.com/webservices/spaces/v1/",

"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)
This topic is locked and can not be replied to.