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

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called

explode() function problem maybe
Hi I'm having trouble searching my database. When I type two words in the search field it only searc

BackButton Behaviour in AJAX
I have an ASPX Page AJAX Enabled!The page has a gridView and a DDL for filtering on it. The Gridview

How do I know when getBounds Method is ready to be called.
I have an application that changes out stylesheets client side. Once I change stylesheet the browse

need help with mail()
hi i want to send an email with attaching pdf file using php. i have the following script but the pr

GMail like Chat in ASP.NET
Hi,Can anyone suggest me, how to incorporate GMail like chat in my existing ASP.Net application.I wa

How to make a mail Form secure?
I want to create an email Form on my web site. How can I make the Form secure so the submitted info

Good Programming and Web Design Books
Hi,

I recived a pm today from a fellow phpfreaker regarding php books, i replied with the fo

Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter

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