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

Why does this file not return file names that start with numbers?
This file returns a list of filenames to help populate a drop down in my form. For some reason it ig

HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane.

how to load a Sys file with system load and call images?
normally you need register the module as a service with CreateService, and start the service

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

Limiting checkboxes?
Hi guys,

I have this code: Code: if(isset($_POST['selected'])) {
foreach($_POST['selec

get multiple rows
Hi I want to get multiple rows from a db

I am using this for the db query
Code: public

Call to undefined function mysql_fetch_accoc()
New to php/mysql coding. What's wrong with this sequence, or am I
just not seeing to obvious?

problems with php variables in mysql query
i can't seem to get the following query to work.

select $q1c from $vote_rate where id = $re

Getting Subdomain Name With PHP?
I want to grab the subdomain name with PHP so I can generate database queries.

for example my

TimeZoneOffset
Hello,

Please i need your help. I have a system that users can use to punch in and out. This

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