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

curl-and-php

RE: PHP/CURL : Post 2 xml in multipart/xml...

From: <no-return_at_cardiff.fr>
Date: Fri, 27 Mar 2009 06:56:08 +0100

Follow - up :

 

I managed to post multipart to my webservice,

For those searching here is code :

$this->headers[] = 'Accept: */*';

$this->headers[] = 'Connection: Keep-Alive';

$this->headers[] = 'Content-Type: multipart/related; charset=utf-8';

                               curl_setopt($process, CURLOPT_HTTPHEADER,
$this->headers);

$Xpost_data['body']='@/home//www/curl/'.$data;

$Xpost_data['fichier']='@/home/www/curl/'.$fichier_xml;

                               curl_setopt($process, CURLOPT_POST, 1);

                               curl_setopt($process, CURLOPT_POSTFIELDS,
$Xpost_data);

 

Watch out, order curl_setopt matters.. it is this that was sending to
webservice a 0 content length stream instead of the data.

 

but now I am getting a 500 error from the server. I think post format is not
respected, giving me the error.

 

Here is verbose log :

> POST /services/Service HTTP/1.1

User-Agent: WORKSHOP/AGENT

Host: [confidential]

Accept-Encoding: gzip

Accept: */*

Connection: Keep-Alive

SOAPAction: SoapCall

Content-Length: 34646

Expect: 100-continue

Content-Type: multipart/related; charset=utf-8;
boundary=----------------------------8d57b72d35bd

 

< HTTP/1.1 100 Continue

* The requested URL returned error: 500

* Closing connection #0

 

I'm wondering if that Content-Type sending after Expect: 100-continue, is
not troubling the webservice server and that it throws me the 500 error.

I suppose webservice is awaiting HTTP 100 continue signal that it hasn't
received and thus rejects the treatment.

 

Any ideas on how to solve this ??? Or am I making wrong direction, and what
am I missing ???

 

Tdldp

 

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-03-27