CURL XML Request [From C to PHP]


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

I need some help converting this into something that will work with PHP.

Code: #!/bin/sh

#URL="https://www.site.com/webservices/Affiliates/affiliates.cfc"
URL="https://www.site.com/webservices/partners/products.cfc"
XMLFILE=tmp_xml.xml

cat <<DONE | sed -e 's/&/&amp;/g'
-e 's/</&lt;/g'
-e 's/>/&gt;/g'
> ${XMLFILE}.encoded
<?xml version="1.0" encoding="UTF-8"?>
<services user="USER" password="PASS">
<company>
<request>
<type>Products</type>
</request>
</company>
</services>
DONE


#curl -v -d @- "${URL}" -H 'SOAPAction: AffiliatesAPI' <<DONE

curl --trace trace.txt -d @- "${URL}" -H 'SOAPAction: AffiliatesAPI' <<DONE
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<Request>
<xmlString>`cat ${XMLFILE}.encoded`</xmlString>
</Request>
</soap:Body>
</soap:Envelope>
DONE

Cheers

No comments posted yet

Your Answer:

Login to answer
152 Like 52 Dislike
Previous forums Next forums
Other forums

=> and <=
So I was digging through some code when I came across the <= operator. This is the first tim

Undefined Variable: PHP_SELF, pls help
Hi,

Im a newbie on PHP / MySQL programming and Im running a script to search one field on my

Windows Authentication
I have a website which is windows authenticated.
now i want something more on this application.<

path to include folder
Hi everyone,

When I'm testing locally, I have to add the name of the site folder as part of t

If statement help please.
Hello on my site I have 2 content boxes. 1 is for the main content (which is the biggest one) and th

CE 7.1 and External GIS integration
Hi All,

We want to develop an application on CE 7.1 which uses GIS features from an exter

Calling All PHPFREAKS Blackberry Users
Are you a member of PHPFreaks and have a blackberry? Well RIM just recently released Blackberry Mes

Form Help
Here is the form:

Line number On/Off | Expand/Contract<? include("../include/sess

How to restrict the display of report variants
Hello All,

I want t know how to restrict the display of report variants.
I mean, whe

losing session vars when arriving from an email link
Hi,

I've got a confirmation script made that sends an email with a link for a user to confirm

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash