user966931
user966931

Reputation: 31

How to parse SOAP XML in ruby?

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="https://extranet.mcs.be/DEV_QUALITY_API/modules/quality/services/soap/quality.php"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
 <ns1:getQuestionnairesListResponse>
  <return SOAP-ENC:arrayType="ns1:QuestionnaireListItem[34]"
   xsi:type="ns1:ArrayOfQuestionnaireListItem">
   <item xsi:type="ns1:QuestionnaireListItem">
    <ID xsi:type="xsd:string">0000000022</ID>
    <Code xsi:type="xsd:string">Interest PubTransp</Code>
    <Reference xsi:type="xsd:string">Check Employees Interest in Public
     Transport</Reference>
   </item>
   <item xsi:type="ns1:QuestionnaireListItem">
    <ID xsi:type="xsd:string">0000000008</ID>
    <Code xsi:type="xsd:string">CS SRE North 2003</Code>
    <Reference xsi:type="xsd:string">Customer Satisfaction SRE North 2003</Reference>
   </item>
   <item xsi:type="ns1:QuestionnaireListItem">
    <ID xsi:type="xsd:string">0000000006</ID>
    <Code xsi:type="xsd:string">CS SRE South 2003</Code>
    <Reference xsi:type="xsd:string">Customer Satisfaction SRE South 2003</Reference>
   </item>
.
.
.

I want to parse the above soap String (I actually want to get items from the above soap). How could I do this?

Upvotes: 2

Views: 2466

Answers (1)

Michael Kohl
Michael Kohl

Reputation: 66837

There's a gem called Savon that's specifically made for dealing with SOAP in Ruby.

There's good documentation on the web site, once you looked into that and have more specific questions I'm sure we can help you.

Upvotes: 3

Related Questions