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

Please help with SMTP Authenticated PHP Email Form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
what is wrong with this

Code: [Select]<?php
if ($_SERVER['HTTP_REFERER'])
{

Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyon

PEAR Email Attachment w/ $gpg
I have no issues with this code if I take out the attachement section and include the info in the em

Php If in MySql query (hiding labels if a field is empty)
Okay, I've been trying to do this for a while, and I'm finally going to ask for help so I can get th

Save cookie to DB
I'm working on a pixel tracking script for an incentive website and I need to use an ASP script to s

Gantt Chart Tool
Does anyone know of a good free gantt chart creator tool

Thanks

Delete Client 066 Earlywatch
Hi all,

in former times client earlywatch was required for SAPs remote access to SAP inst

drop-down with sub-category appear
Hello,

i know how to build a simple dro-down list, im looking for a code when im gonna choose

Cursor statement failed with errors
Following statement failed with the errors.

cursor proj_cursor1 is (select projectID from

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