cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURL custom POST commands

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Sat, 15 Aug 2015 01:27:31 -0400

On 8/14/2015 4:21 PM, Fitzgerald, Kevin wrote:
> Hello again, I have decided to try a different tack and I am using the
> sendrecv example from the site. Everything seems to work as I need it
> to, but I am getting an Internal Server Error back from the server.
>
> <?xml version="1.0" encoding="utf-8"?><soap:Envelope
> xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text
> xml:lang="en">System.Web.Services.Protocols.SoapException: Server was
> unable to process request. ---&gt; System.Xml.XmlException: Data at
> the root level is invalid. Line 1, position 1.
>
> I think I am getting this error because of a byte-order mark (BOM)
> that is being added to the HTTP. The data being sent is correct for
> the web services request. Is there a curl option to remove this from
> the request when using culr_easy_send? Any help would be appreciated.
> Below is the code:
>
> curl = curl_easy_init();
>
> if(curl)
>
> {
>
> const char *request = full_msg;
>
> curl_socket_t sockfd; /* socket */
>
> long sockextr;
>
> size_t iolen;
>
> curl_off_t nread;
>
> printf("\n\n\nYou are using libcurl/%s\n\n\n",
> curl_version_info(CURLVERSION_NOW)->version);
>
> curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
>
> /* specify target URL */
>
> curl_easy_setopt(curl, CURLOPT_URL, url);
>
> curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
>
> curl_easy_setopt(curl, CURLOPT_LOCALPORT, dcf_port);
>
> curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
>

CURLOPT_CONNECT_ONLY is for custom protocols. I don't understand why you
would need that option for sending a SOAP message. How is the BOM being
added to the HTTP? Are you trying to imitate the HTTP protocol? It
sounds like you are complicating things. Did you try sending your
message via HTTPS as I suggested, and without disabling verification?

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-08-15