max1965
13 years agoContributor
post/get http request with groovy
Actualy in my soapui project I sent post and get HTTP requests using the HTTP Test Request step. Follow are some exmples of the requests:
GET
http://138.132.115.21:80/AuthInterface/ ... essionType
=APT&msgType=START HTTP/1.1
Accept-Encoding: gzip,deflate
Host: 138.132.115.21:80
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
POST http://138.132.115.21:80/CxInterface/multimediaAuth HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 388
Host: 138.132.115.21:80
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
input=<?xml version="1.0" encoding="UTF-8"?><multimediaAuthRequest xmlns="UdbCxInterface"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="CxInterface
multimediaAuthRequest.xsd"><PublicIdentity>0803300000</PublicIdentity><username>0803300000</us
ername><ServerName>84.175.19.217</ServerName><version>1.1</version><msgType>REGISTER</msgType>
</multimediaAuthRequest>
POST https://138.132.115.23:443/provEngine_pkg3/provisioning HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 2915
Host: 138.132.115.23:443
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<acceptRequest><request><![CDATA[<spml:batchRequest xmlns:spml='urn:oasis:names:tc:SPML:1:0' xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' requestID='20130228104143645' processing='urn:oasis:names:tc:SPML:1:0#sequential' onError='urn:oasis:names:tc:SPML:1:0#exit'>
<spml:addRequest requestID='20130228104143645-0001'>
<spml:identifier type='urn:oasis:names:tc:SPML:1:0#GUID'>
<spml:id>042823880498</spml:id>
</spml:identifier>
<spml:attributes>
<dsml:attr name='district'>
<dsml:value>0428</dsml:value>
</dsml:attr>
<dsml:attr name='svcType'>
<dsml:value>APT</dsml:value>
</dsml:attr>
<dsml:attr name='isMaster'>
<dsml:value>Y</dsml:value>
</dsml:attr>
<dsml:attr name='cli'>
<dsml:value>042823550249</dsml:value>
</dsml:attr>
<dsml:attr name='cliDistrict'>
<dsml:value>0428</dsml:value>
</dsml:attr>
<dsml:attr name='outboundProxy'>
<dsml:value>138.132.116.39</dsml:value>
</dsml:attr>
<dsml:attr name='presenceServer'>
<dsml:value>138.132.106.13</dsml:value>
</dsml:attr>
<dsml:attr name='applicationServer'>
<dsml:value>sip:10.19.20.8</dsml:value>
</dsml:attr>
<dsml:attr name='administrativeStatus'>
<dsml:value>SUSPENDED</dsml:value>
</dsml:attr>
<dsml:attr name='operationalStatus'>
<dsml:value>RUNNING</dsml:value>
</dsml:attr>
<dsml:attr name='geographicArea'>
<dsml:value>milan000</dsml:value>
</dsml:attr>
<dsml:attr name='exchangeId'>
<dsml:value>1234567890</dsml:value>
</dsml:attr>
<dsml:attr name='accessDevice'>
<dsml:value>AG</dsml:value>
</dsml:attr>
<dsml:attr name='userDevice'>
<dsml:value>WIFI</dsml:value>
</dsml:attr>
<dsml:attr name='sipKey'>
<dsml:value></dsml:value>
</dsml:attr>
</spml:attributes>
</spml:addRequest>
<spml:modifyRequest requestID='20130228104143645-0002'>
<spml:operationalAttributes>
<dsml:attr name='svcType'>
<dsml:value>APT</dsml:value>
</dsml:attr>
<dsml:attr name='isRoutingNumber'>
<dsml:value>N</dsml:value>
</dsml:attr>
<dsml:attr name='isMaster'>
<dsml:value>Y</dsml:value>
</dsml:attr>
</spml:operationalAttributes>
<spml:identifier type='urn:oasis:names:tc:SPML:1:0#GUID'>
<spml:id>042823880498</spml:id>
</spml:identifier>
<spml:modifications>
<dsml:modification name='STS_disablingClass' operation='add'>
<dsml:value>sts_subscription=access</dsml:value>
<dsml:value>disablingClass=C10</dsml:value>
</dsml:modification>
</spml:modifications>
</spml:modifyRequest>
</spml:batchRequest>]]></request></acceptRequest></s:Body>
</s:Envelope>
It is possible sent the same request using a groovy script ? Are available some examples on how write the groovy request ?
GET
http://138.132.115.21:80/AuthInterface/ ... essionType
=APT&msgType=START HTTP/1.1
Accept-Encoding: gzip,deflate
Host: 138.132.115.21:80
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
POST http://138.132.115.21:80/CxInterface/multimediaAuth HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 388
Host: 138.132.115.21:80
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
input=<?xml version="1.0" encoding="UTF-8"?><multimediaAuthRequest xmlns="UdbCxInterface"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="CxInterface
multimediaAuthRequest.xsd"><PublicIdentity>0803300000</PublicIdentity><username>0803300000</us
ername><ServerName>84.175.19.217</ServerName><version>1.1</version><msgType>REGISTER</msgType>
</multimediaAuthRequest>
POST https://138.132.115.23:443/provEngine_pkg3/provisioning HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 2915
Host: 138.132.115.23:443
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<acceptRequest><request><![CDATA[<spml:batchRequest xmlns:spml='urn:oasis:names:tc:SPML:1:0' xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' requestID='20130228104143645' processing='urn:oasis:names:tc:SPML:1:0#sequential' onError='urn:oasis:names:tc:SPML:1:0#exit'>
<spml:addRequest requestID='20130228104143645-0001'>
<spml:identifier type='urn:oasis:names:tc:SPML:1:0#GUID'>
<spml:id>042823880498</spml:id>
</spml:identifier>
<spml:attributes>
<dsml:attr name='district'>
<dsml:value>0428</dsml:value>
</dsml:attr>
<dsml:attr name='svcType'>
<dsml:value>APT</dsml:value>
</dsml:attr>
<dsml:attr name='isMaster'>
<dsml:value>Y</dsml:value>
</dsml:attr>
<dsml:attr name='cli'>
<dsml:value>042823550249</dsml:value>
</dsml:attr>
<dsml:attr name='cliDistrict'>
<dsml:value>0428</dsml:value>
</dsml:attr>
<dsml:attr name='outboundProxy'>
<dsml:value>138.132.116.39</dsml:value>
</dsml:attr>
<dsml:attr name='presenceServer'>
<dsml:value>138.132.106.13</dsml:value>
</dsml:attr>
<dsml:attr name='applicationServer'>
<dsml:value>sip:10.19.20.8</dsml:value>
</dsml:attr>
<dsml:attr name='administrativeStatus'>
<dsml:value>SUSPENDED</dsml:value>
</dsml:attr>
<dsml:attr name='operationalStatus'>
<dsml:value>RUNNING</dsml:value>
</dsml:attr>
<dsml:attr name='geographicArea'>
<dsml:value>milan000</dsml:value>
</dsml:attr>
<dsml:attr name='exchangeId'>
<dsml:value>1234567890</dsml:value>
</dsml:attr>
<dsml:attr name='accessDevice'>
<dsml:value>AG</dsml:value>
</dsml:attr>
<dsml:attr name='userDevice'>
<dsml:value>WIFI</dsml:value>
</dsml:attr>
<dsml:attr name='sipKey'>
<dsml:value></dsml:value>
</dsml:attr>
</spml:attributes>
</spml:addRequest>
<spml:modifyRequest requestID='20130228104143645-0002'>
<spml:operationalAttributes>
<dsml:attr name='svcType'>
<dsml:value>APT</dsml:value>
</dsml:attr>
<dsml:attr name='isRoutingNumber'>
<dsml:value>N</dsml:value>
</dsml:attr>
<dsml:attr name='isMaster'>
<dsml:value>Y</dsml:value>
</dsml:attr>
</spml:operationalAttributes>
<spml:identifier type='urn:oasis:names:tc:SPML:1:0#GUID'>
<spml:id>042823880498</spml:id>
</spml:identifier>
<spml:modifications>
<dsml:modification name='STS_disablingClass' operation='add'>
<dsml:value>sts_subscription=access</dsml:value>
<dsml:value>disablingClass=C10</dsml:value>
</dsml:modification>
</spml:modifications>
</spml:modifyRequest>
</spml:batchRequest>]]></request></acceptRequest></s:Body>
</s:Envelope>
It is possible sent the same request using a groovy script ? Are available some examples on how write the groovy request ?