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

curl-and-php

Re: Using CURL to post SOAP messages

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 18 May 2001 08:03:58 +0200 (MET DST)

On Thu, 17 May 2001, Tim Uckun wrote:

> >Check out a POST example. In PHP lingo, it would look similar to this:
> >
> > curl_setopt($curl, CURLOPT_POST, 1);
> > curl_setopt($curl, CURLOPT_POSTFIELDS, [chunk of data]);
>
> The post example would not work (I think).

Why not?

> Its pretty confusing to me but nowhere does it do I see where I would
> include the SOAP envelope as a field or a value pair. According to my
> reading of the spec the body of the request itself is the soap env. Does
> this make sense to you?

Yes. The body of the request is the post fields (using the words of the curl
interface). (And if 'POST' isn't the correct HTTP command to use, that can
also be replaced with the proper SOAP one...)

The data you pass to the CURLOPT_POSTFIELDS option is what will appear in the
request body. Don't get stuck on the "field or a value pair" wording. That
particular phrase was added to make people realize how to fill in POST data
as when posting from a regular HTML form.

When you post a SOAP request, the CURLOPT_POSTFIELDS should be the soap env.

> I have an HTTP sample which opens up the port (80) and send the entire
> string including the headers and sends it over to the server. Is is
> possible to do the same with CURL.

No, then it would be no point to use curl at all. Curl adds a layer between
to make it easier for people to make HTTP (or other protocol) operations.

> Can I manually construct a message and send it over https 433 port?

No. Not with curl. And there should be no need to do that just to be able to
send SOAP requests, AFAIK.

-- 
     Daniel Stenberg -- curl dude -- http://curl.haxx.se/
_______________________________________________
Curl-and-php mailing list
Curl-and-php_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-and-php
Received on 2001-05-18