cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Curl XML and PHP

From: Leonardo Santillán <leo_at_azultel.net>
Date: Wed, 16 Mar 2005 18:15:28 -0300

I can connect to the script but i get next error: "Missing xml request
document". Its like the script is not getting correctly the xml string im
sending to it. What could it be?
Thanks,

----- Original Message -----
From: "Davor @ Velcom" <davor_at_velcom.com>
To: "Programming PHP/CURL" <curl-and-php_at_cool.haxx.se>
Sent: Wednesday, March 16, 2005 2:27 PM
Subject: Re: Curl XML and PHP

> Leonardo Santillán wrote:
>
> > Hi,
> >
> > Im trying to post a XML string to a secure server and get the XML
> > response from it in a PHP variable but i cant make it.
> > I'll appreciate any help.
> > Thanks,
> >
> > Im using this code:
> >
> > $url = "https//www.server.com";
> > $xmlcontent = "<?xml version=\"1.0\" ?>";
> > $xmlcontent .= "<blah prod=\"ggg\">";
> > $xmlcontent .= "<session><aaa><id>123</id>";
> > $xmlcontent .= "<user><firstName>me</firstName></user></aaa>";
> > $xmlcontent .= "</session>";
> > $xmlcontent .= "</blah>";
> > $data = "id=888$request=$xmlcontent";
> >
> > $result = shell_exec("curl -m 120 -d \"$data\" $url -L");
> > echo $result;
> >
> > and/or
> >
> > $ch = curl_init();
> > curl_setopt($ch, CURLOPT_URL,$url);
> > curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
>
> curl_setopt($ch, CURLOPT_HEADER, 0);
> curl_setopt($ch, CURLOPT_POST, 1);
>
> > curl_setopt($ch, CURLOPT_TIMEOUT, 4);
> > curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
> > $result = curl_exec($ch);
> > echo $result;
>
>
>
Received on 2005-03-16