cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_URL returning FALSE

From: Isaac Sanni-Thomas <isaacsannithomas_at_gmail.com>
Date: Wed, 16 Dec 2009 11:45:31 +0000

On 12/16/2009 07:45 AM, nitin.mittal_at_rsa.com wrote:
>
> & strHttpContent is initialized like:
>
> std::string strHttpContent="<s:Envelope
> xmlns:s="http://www.w3.org/2003/05/soap-envelope"
> xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
> xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"
> xmlns:n="http://schemas.xmlsoap.org/ws/2004/09/enumeration"
> xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><s:Header><a:To
>> http://10.31.251.161:5985/wsman</a:To><w:ResourceURI
> s:mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/window
> s/EventLog</w:ResourceURI><a:ReplyTo><a:Address
> s:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing
> /role/anonymous</a:Address></a:ReplyTo><a:Action
> s:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/eventing/S
> ubscribe</a:Action><w:MaxEnvelopeSize
> s:mustUnderstand="true">153600</w:MaxEnvelopeSize><a:MessageID>uuid:0f3d
> 7fd4-421e-438c-a75a-832d2c85cb58</a:MessageID><w:Locale xml:lang="en-US"
> s:mustUnderstand="false" /><w:OptionSet
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><w:Option
> Name="SubscriptionName">RSAenVision</w:Option><w:Option
> Name="ContentFormat">RenderedText</w:Option><w:Option
> Name="ReadExistingEvents" xsi:nil="true"/><w:Option
> Name="IgnoreChannelError"
> xsi:nil="true"/></w:OptionSet><w:OperationTimeout>PT60.000S</w:Operation
> Timeout></s:Header><s:Body><e:Subscribe><e:Delivery
> Mode="http://schemas.dmtf.org/wbem/wsman/1/wsman/Pull"><w:Heartbeats>PT2
> 000.000S</w:Heartbeats><w:Locale
> xml:lang="en-US"/><w:ContentEncoding>UTF-8</w:ContentEncoding></e:Delive
> ry><w:Filter
> Dialect="http://schemas.microsoft.com/win/2004/08/events/eventquery"><Qu
> eryList><Query Id="0"><Select Path="Application">*</Select><Select
> Path="System">*</Select><Select
> Path="Security">*</Select></Query></QueryList></w:Filter><w:SendBookmark
> s/></e:Subscribe></s:Body></s:Envelope>"

Hi Nitin,

1) Escape the quotes in the strHttpContent. I believe the xml content is
not fed to the SOAP server in its entirety. Escaping the quotes in the
strHttpContent may help.
2) Also test with a PHP script or Java code that the SOAP server is
receiving request properly and sends response.
3)Set the header to "Content-Type: text/xml"
curl_easy_setopt(mCurl, CURLOPT_POSTFIELDS,strHttpContent.c_str());
curl_easy_setopt(mCurl, CURLOPT_POSTFIELDSIZE, strHttpContent.length());
  curl_easy_setopt(mCurl, CURLOPT_HTTPHEADER, headers);
  curl_easy_perform(mCurl);
4) Write the content of the response from curl to a file. Using the
WRITEHEADER will not put the content of the response in the file.
Maintain the WRITEDATA I showed you earlier. It works for me.
5)If not try writing your code in traditional C.

regards,
Isaac

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-12-16