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.

Did you know?Explore Trending and Topic pages for more stories like this.
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

url- go to webpage
i have an input text field and submit button.

how do i make the url entered into the textfiel

php slowing my site?
Hi all,

I think that one of the reasons that my site doesn't work fast is that the code is ve

cURL Sending File as Post
This is a bit complicated, I'm just hoping someone else has run into this and knows how to do it a d

line breaks in between fetched file names
Hi,

I have this code:
Code: <?php
if($dir = opendir('files')){
while (($f

cURL error
So here is my code... I got it off of here... http://www.youtube.com/watch?v=XcgQUsorF_8
Because

Create multiple (n) arrays
Hi there,

I have the following need:

I have 2 arrays (coming from a databases)

socket communication between c++/java and sending image
hi,

i have a class in c++ called win32_sockserver which creates socket to java. i am trying

Upload, SSL and more php help
I recently just installed a ssl cert and do i use https for the whole site or just for the checkout.

Map.php
I am a complete beginner to PHP and am looking for some help with a program I am messing around with

fire away
i launched about 4 months ago as a lagit co. i have 2 paying clients, 1probono, 1 side progect, and

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