Forum Discussion

Jasper175's avatar
Jasper175
Frequent Contributor
14 years ago

XML Request through Groovy

Hello,

We have a task that falls outside the request methods that are contained in the wsdls. A developer created an xml file on a linux machine that contains this xml code that will set a customer to "Active":


<account_info>
<xsdVersion>2</xsdVersion>
<requestID>100003</requestID>
<accountNumber>100020516</accountNumber>
<userID>nov1_0850@vonage.com</userID>
<firstName>Nov</firstName>
<lastName>First</lastName>
<status>ACTIVE</status>
<fraudFlag>subscriber</fraudFlag>
<billingAddress>
<streetAddr1>23 Main St.</streetAddr1>
<city>Holmdel</city>
<state>NJ</state>
<postalCode>07733</postalCode>
<country>US</country>
</billingAddress>
</account_info>


Once we modify the code, we run this command:

curl -v -X PUT -d@setaccount_rlong.xml 'http://10.112.140.56:8080/slprovisioning/2/account/100020516'


QUESTION:
Any have any expertise in having the above process created in Groovy Script?

Thank you,
Rob

4 Replies

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Just curious, why do you need to use Groovy rather than just an HTTP Test Request and PUT the XML shown?
  • Jasper175's avatar
    Jasper175
    Frequent Contributor
    That's where you come in to correct me
    In fact one of my Developers said the same thing about http connection.

    Looking at the HTTP Step - what Method would I use? "POST"?
    I presume put my XML In the XML Tab
    The last is this "Media Type" section where it has "Application/xml" etc..

    Thank you!
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    The PUT method is in the drop down so you can try that, and yes, the XML goes the panel under Media Type.

    Good luck!
  • Jasper175's avatar
    Jasper175
    Frequent Contributor
    THANK YOU!!! THANK YOU!!! THANK YOU!!!

    End Result - I tried POST but it didn't accept it, then I tried PUT.
    I didn't get much of a response back, but it was processed!

    Thanks M-

    Rob