Help needed for creating Savon soap request for repeating attributes in request xml

66 views
Skip to first unread message

Mike82

unread,
Dec 25, 2015, 5:58:04 AM12/25/15
to Savon
Hi, I am new to Savon and to the Ruby programming language. I have worked in Java. I am trying to use Savon for creating Soap client for the following wsdl:


The Create request has the xml structure as follows:


  <soapenv:Header/>
  <soapenv:Body>
     <v1:create>
        <!--Optional:-->
        <v1:CreateAffectedElement>
           <Header>
              <Requester>?</Requester>
              <Submitter>
                 <Type>?</Type>
                 <Value>?</Value>
              </Submitter>
              <TimeStamp>
                 <Date>?</Date>
                 <Time>?</Time>
                 <TimeZone>?</TimeZone>
              </TimeStamp>
              <TransactionId>?</TransactionId>
           </Header>
           <Body>
              <AffectedElement>
                 <ActualStart>
                    <Date>?</Date>
                    <Time>?</Time>
                    <TimeZone>?</TimeZone>
                 </ActualStart>
                 <!--Optional:-->
                 <AeAttributeList>
                    <!--1 or more repetitions:-->
                    <Attribute>
                       <Label>?</Label>
                       <Type>?</Type>
                       <Value>?</Value>
                    </Attribute>
                 </AeAttributeList>
                 <!--Optional:-->
                 <AffectedServiceList>
                    <!--Zero or more repetitions:-->
                    <AffectedService>?</AffectedService>
                 </AffectedServiceList>
                 <!--Optional:-->
                 <AffectedSubs>
                    <!--Optional:-->
                    <Commercial>
                       <!--Optional:-->
                       <HSD>?</HSD>
                       <!--Optional:-->
                       <Video>?</Video>
                       <!--Optional:-->
                       <Telephony>?</Telephony>
                    </Commercial>
                    <!--Optional:-->
                    <Residential>
                       <!--Optional:-->
                       <HSD>?</HSD>
                       <!--Optional:-->
                       <Video>?</Video>
                       <!--Optional:-->
                       <Telephony>?</Telephony>
                    </Residential>
                 </AffectedSubs>
                 <!--Optional:-->
                 <AttributeList>
                    <!--1 or more repetitions:-->
                    <Attribute>
                       <Label>?</Label>
                       <Value>?</Value>
                    </Attribute>
                 </AttributeList>
                 <!--Optional:-->
                 <Assignment>
                    <QueueId>?</QueueId>
                    <SupportAreaId>?</SupportAreaId>
                 </Assignment>
                 <ContactInformation>
                    <Name>?</Name>
                    <Phone>?</Phone>
                    <Email>?</Email>
                 </ContactInformation>
                 <!--Optional:-->
                 <ElementId>?</ElementId>
                 <ElementName>?</ElementName>
                 <ElementType>?</ElementType>
                 <!--Optional:-->
                 <EstimatedTimeToResolve>
                    <Date>?</Date>
                    <Time>?</Time>
                    <TimeZone>?</TimeZone>
                 </EstimatedTimeToResolve>
                 <!--Optional:-->
                 <IndicatorCity>?</IndicatorCity>
                 <!--Optional:-->
                 <IndicatorState>?</IndicatorState>
                 <NextAction>?</NextAction>
                 <!--Optional:-->
                 <OutageSummary>?</OutageSummary>
                 <!--Optional:-->
                 <ParentId>?</ParentId>
                 <!--Optional:-->
                 <Priority>?</Priority>
                 <ProblemCode>?</ProblemCode>
                 <!--Optional:-->
                 <RelatedTicketList>
                    <!--Zero or more repetitions:-->
                    <RelatedTicketId>?</RelatedTicketId>
                 </RelatedTicketList>
                 <ServiceAffected>?</ServiceAffected>
                 <Source>?</Source>
                 <SourceReference>?</SourceReference>
                 <!--Optional:-->
                 <SourceTicket>?</SourceTicket>
                 <SystemIdList>
                    <!--1 or more repetitions:-->
                    <SystemId>?</SystemId>
                 </SystemIdList>
                 <!--Optional:-->
                 <WorklogList>
                    <!--1 or more repetitions:-->
                    <Worklog>
                       <Subject>?</Subject>
                       <!--Optional:-->
                       <Details>?</Details>
                    </Worklog>
                 </WorklogList>
              </AffectedElement>
           </Body>
        </v1:CreateAffectedElement>
     </v1:create>
  </soapenv:Body>
</soapenv:Envelope>


I am not sure how to create message for the repeating tags (<!--1 or more repetitions:-->) such as AeAttributeList, AffectedServiceList and others. The number of repetitions may vary from one request to another. So i need to create the request message dynamically. 

I am stuck. Any help would be much appreciated.
Reply all
Reply to author
Forward
0 new messages