Issue with SOAP response XML format for Array Types with AWS

Piyush with Rails
Fri, 13 Mar 2009 07:22:32 -0000

Hi All,

There is an issue with AWS in SOAP response XML generated for Array
types.

If we are using array types in signature at returns place, then in
SOAP response XML for this method array elements are represented with
<item> tags.

How can we give another meaningful tag name or give attribute (that
uniquely identify the tag) to the tags instead of <item> tag in the
response XML ??

Take below thing in consideration.

API signature for seach_products.
--------------------------------------------------------

api_method :search_products,
   :expects => [:string],      // expects string input.
   :returns => [[Product]]      // returns array of strings.

Product Structure Class
--------------------------------------------------------
class Product< ActionWebService::Struct
    member :id, :integer
    member :name, :string
end

Response XML Output.
---------------------------------------------------------

<?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:SearchProductsResponse xmlns:n1="urn:ActionWebService"

env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <return n2:arrayType="n1:Product[2]"
          xmlns:n2="http://schemas.xmlsoap.org/soap/encoding/"
          xsi:type="n2:Array">
        <item>
          <id xsi:type="xsd:int">data 1-1</id>
          <name xsi:type="xsd:string">data 1-2</name>
        </item>
         <item>
          <id xsi:type="xsd:int">data 2-1</id>
          <name xsi:type="xsd:string">data 2-2</name>
        </item>
      </return>
    </n1:SearchProductsResponse >
  </env:Body>
</env:Envelope>

------------------------------------------------------------------

Looking at the format of the XML it seems that AWS is using RPC
encoding style for WSDL and SOAP request and responses.

So taking above situation in consideration if we need to get <product>
tag instead of <item> tags in the SOAP response XML then how can we do
that ??

Thanks,
Piyush.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---