Rewrite SOAP xml before sen it as request

I need to rewrite a SOAP XML file before make a request.
I can send the request and receive the response without any issue using a static file, but I need to change some values
I try using ElementTree to manipulate the file but I can’t find the tag and value.

The file have the next format:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <bbs:QueryDRRequestMsg>
         <RequestHeader>
                    ...
                </RequestHeader>
         <QueryDRRequest>
            <!--Optional:-->
             <bbs:SubAccessCode>
               <bbc:PrimaryIdentity>56795810005</bbc:PrimaryIdentity>
            </bbs:SubAccessCode>
            <bbs:TimePeriod>
               <bbs:StartTime>20150901010000</bbs:StartTime>
               <bbs:EndTime>20150930010000</bbs:EndTime>
            </bbs:TimePeriod>
            <bbs:TotalDRNum>2</bbs:TotalCDRNum>
            <bbs:BeginRowNum>0</bbs:BeginRowNum>
            <bbs:FetchRowNum>10</bbs:FetchRowNum>
         </QueryDRRequest>
      </bbs:QueryDRRequestMsg>
   </soapenv:Body>
</soapenv:Envelope>

I need to change the values for the tags

bbc:PrimaryIdentity

and

bbs:StartTime

The values will be taken from a html form and with that data rewrite the file before send the file as request.

Thanks in advance

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s