Skip to content

Instantly share code, notes, and snippets.

@TvL2386
Last active June 21, 2016 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TvL2386/d3ad767c8bebb02de312a1af7396876d to your computer and use it in GitHub Desktop.
Save TvL2386/d3ad767c8bebb02de312a1af7396876d to your computer and use it in GitHub Desktop.
example_soap_body.xml
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:prequal>
<order_location href="#id1"/>
<product_group xsi:type="xsd:string">THE_PRODUCT</product_group>
</tns:prequal>
<tns:OrderLocation
id="id1" xsi:type="tns:OrderLocation">
<dutch_address href="#id2"/>
</tns:OrderLocation>
<tns:DutchAddress id="id2" xsi:type="tns:DutchAddress">
<zipcode xsi:type="xsd:string">1112XS</zipcode>
<house_number xsi:type="xsd:int">58</house_number>
<house_number_extension xsi:type="xsd:string"/>
</tns:DutchAddress>
</soap:Body>
message = {
'order_location' => '',
attributes!: {
'order_location' => { :href => '#id1' }
},
'product_group' => 'THE_PRODUCT'
}
# Send he order to PROVIDER
soap_client.call(:prequal, message: message)
# output:
# <?xml version="1.0" encoding="UTF-8"?>
# <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://testb2bxml.tele2-wholesale.nl/webservices_acc.php/order.tele2.ethernet.v2" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
# <env:Body>
# <tns:prequal>
# <order_location href="#id1"></order_location>
# <product_group>THE_PRODUCT</product_group>
# </tns:prequal>
# </env:Body>
# </env:Envelope>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment