Curl command to post headers


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 05-26-2016
Curl command to post headers

I am trying post SOAP header from file to curl command.

The curl command is
Code:
curl -vk -H "$(cat curl-test1.txt)" -X POST https://xvcfvusdgfsd.sdfjd.gf/cmsws/CMSService

The contet of curl file is
Code:
POST: https://cmsuat.chrysler.com/cmsusws/CMSService HTTP/1.1
SOAPAction: "http://jaxws.cmsws.cxxxxxxxx.com/ExecuteDataProcess"
GenericID:xxxxxxxx
Password:xxxxx
DataKey:3XwSVgQrd1WB9iqau7VOh33FwaXM2674/icCtJYbminOGGTCN+XxmEIOrrd5ap2fh37WHEGP1Vnc70rN86cuh3GujOYCVZ9h6m514po0IqcyTXjG+jRBGNhCGBxD/uaBvtN3kWbim01PM3vOlVx412LjykEUDmhfUZhyFJ0CAsy9KLQBLCazGP5fNhri0c/YAldEKgZ2sLn1SyPfydI8j8zBbtKjZn8kWCZ4Le5yBZUba0YjRT7cgek7yS9dT2MN02+2ABoQUQ2iwa+bz1nGMEVf8zdc76W2hIUnqjl1cAIv4AORw2RhVuyOcPGhyVnFrMGMwZyekIymfxjB7v92nQ34C7LXw8AjVn1qDVKxchctctdqey33lCvoNukhTkD5mRwJ4zGT9AixW5/V6SV898KzWV08lXaE/9z/wALoSPodgHFKFCZkb0psi9WwEVxG03NPHaeclHBKFDfOVVd/OG2rDnSXUBhMKw+p63cQq6sQ1mMASQs9YPKngEMk4L2yMLlICy6It26W+rSRzW2LfpLDnFPSOpkmgGML3ltAZVMUKvLlMnz3SWzBiviwjJ3AAazZTRktRBKlk9CxqOFBdQ/w3hOUadiOvrL5fWnlKa2TsFBFj9nmN8O/PND3BUSzFv+dXojpyn7DUg0wCJfyREovpvSBtVtn3wXGnwLwZLtPcrDZh/NuGBEfcNMSMKN2rTk/nUhpbojj0XCEqCKkPqpTNkyfwnZeZ7/5vXZQ34mvc4hvQXbkxBCvl2kgJLnvg6cEfilQoJqv1hRILEWS2tefiBACTcoYGaT7JyCq2uk8+SiLDziqGGBmOat+PijJLnMH/eXK8wGKBFHbzj2IAuIvZfa/g8YFylsitgU9ujJCfO0Q/v+8AnwBiUFFxFCRCOOd3gam+SFxFGe1gZdmqlTWsbVOuAzK45myW+YDFhzLcOv9tOQ36YT2gmOJV9YdB3hBATuGmxPLkPPHJxYgapJlNWiJzC8JimMaMWAuHVmCWnBR+h9iFr+3kSoJ1zMSvm/nfF1Bj9ECEkPhAsb/S16Faclg0JFHegLFC0hGU+7iiXq+i6yc/TsQ1/eV5fH+wx2XF196j5y+DxYluCjLiiwB+7AUKuo7weRXIzyeYU/IYJ48idJOoQFjSr0cdD7aJw3rC69+cQfz98z3zgNihZMOTulVB29X1tW5DctneHsUyYjN59LiZzkY9qTJnfRqbJJx4Qgvi10/sPaSsDsPHZXxd+rjwVzfSjoUeQsdw+xBQ5L9hVjOtUkW7j3ZxkVB
TimeStamp:2013-12-10 20:07:57.813
Market: US
SOAPInput: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jax="http://jaxws.cmsws.cms.xxxxxx">
   <soapenv:Header>
</soapenv:Header>
   <soapenv:Body>
      <jax:ExecuteDataProcess>
      </jax:ExecuteDataProcess>
   </soapenv:Body>
</soapenv:Envelope>


The error am getting is

Code:
*   Trying xxx.xx.xx.xx....
* Connected to xxxxxxx (xxxxxxxx) port 443 (#0)
* TLS 1.0 connection using TLS_RSA_WITH_AES_256_CBC_SHA
* Server certificate: cmsuat.chrysler.com
> POST /cmsws/CMSService HTTP/1.1
> Host: xxxxxxxxxx
> User-Agent: curl/7.43.0
> Accept: */*
> POST: https://xxxxxxxxxxx/cmsusws/CMSService HTTP/1.1
> SOAPAction: "http://jaxws.cmsws.xxxxxxxx/ExecuteDataProcess"
> GenericID:xxxxx
> Password:xxxxxxx
> DataKey:3XwSVgQrd1WB9iqau7VOh33FwaXM2674/icCtJYbminOGGTCN+XxmEIOrrd5ap2fh37WHEGP1Vnc70rN86cuh3GujOYCVZ9h6m514po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neHsUyYjN59LiZzkY9qTJnfRqbJJx4Qgvi10/sPaSsDsPHZXxd+rjwVzfSjoUeQsdw+xBQ5L9hVjOtUkW7j3ZxkVB
> TimeStamp:2013-12-10 20:07:57.813
> Market: US
> SOAPInput: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jax="http://jaxws.cmsws.xxxxxxxxx">
>    <soapenv:Header>
> </soapenv:Header>
>    <soapenv:Body>
>       <jax:ExecuteDataProcess>
>       </jax:ExecuteDataProcess>
>    </soapenv:Body>
> </soapenv:Envelope>
> 
< HTTP/1.1 500 Internal Server Error
< Date: Wed, 25 May 2016 21:29:31 GMT
< Content-Length: 471
< Connection: close
< Content-Type: application/soap+xml; charset=UTF-8; action="http://www.w3.org/2005/08/addressing/soap/fault"
< Content-Language: en-US
< 
* Closing connection 0
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Receiver</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text xml:lang="en-US">javax.xml.stream.XMLStreamException: The root element is required in a well-formed document.</soapenv:Text></soapenv:Reason><soapenv:Detail></soapenv:Detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>


Last edited by dineshaila; 05-26-2016 at 07:04 AM..
# 2  
Old 05-26-2016
I can't help much with SOAP, but I'm certain what you have as SOAPInput should be the body of the message, not mixed in with the headers, as headers cannot contain newlines.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
CURL - Post Form Isssue ( sequel ) Fred13 Web Development 4 2 Weeks Ago 12:33 PM
Curl - post form issue Fred13 Web Development 3 2 Weeks Ago 06:11 AM
How to post content file of data using curl? fajar_3t3 Shell Programming and Scripting 0 03-19-2018 01:33 AM
Wget and curl to post data SkySmart Shell Programming and Scripting 1 10-12-2016 06:03 PM
Data Post with curl iddfcr Web Development 1 11-17-2014 11:34 AM
Curl Script - Post a file (multipart/form-data) Anooja G Shell Programming and Scripting 0 04-28-2014 09:08 AM
Faster command to remove headers for files in a directory alexcol Shell Programming and Scripting 5 11-13-2012 09:17 PM
Using cURL to submit a post form hansvg Shell Programming and Scripting 2 07-24-2012 03:50 PM
curl - sending headers, no-cache webhope UNIX for Dummies Questions & Answers 0 06-14-2012 07:27 AM
Using sed command to remove multiple instances of repeating headers in one file? rebazon UNIX for Dummies Questions & Answers 1 09-29-2011 02:55 PM
Issue in Curl to send http POST request with attachment/multipart manishmaha UNIX for Advanced & Expert Users 1 05-19-2010 02:12 AM
Merging of files with different headers to make combined headers file marut_ashu Shell Programming and Scripting 1 08-07-2009 05:10 AM
maintaining form post session using curl Allasso Shell Programming and Scripting 1 01-13-2009 06:26 PM
Remove text between headers while leaving headers intact Trones Shell Programming and Scripting 3 12-27-2008 08:06 PM
mailx command with headers rgremill Solaris 5 02-09-2006 05:23 PM