Curl command to post headers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Curl command to post headers
# 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+XxmEIOrrd5ap2fh37WHEGP1Vnc70rN86cuh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ZMOTulVB29X1tW5DctneHsUyYjN59LiZzkY9qTJnfRqbJJx4Qgvi10/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 Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

CURL - Post Form Isssue ( sequel )

Hi, I write a new thread to discuss about my closed topic with new information ( /280990-curl-post-form-issue.html ) The previous post was closed because of missing informations, I didn't have access yet to server logs. ----------------------------------------------------------------------... (4 Replies)
Discussion started by: Fred13
4 Replies

2. Web Development

Curl - post form issue

I'm having an issue with curl post form, I dont' understand what I'm mising. I would like to send a post command login/password to a form, quite simple in the paper. URL : http: // <myebsite> / login Here the form source code : <form action="/login_check" method="post"> <input... (3 Replies)
Discussion started by: Fred13
3 Replies

3. Shell Programming and Scripting

How to post content file of data using curl?

HI All, i want to asking about my case , how to post content file of data using curl. currently if i wanna post data file , i can use this command below : curl --cacert maxaj.cer -X POST -F 'fileupload=@/data/report_3300_xxx/log/traffic_3300_20180319_1051.txt'... (0 Replies)
Discussion started by: fajar_3t3
0 Replies

4. Shell Programming and Scripting

Wget and curl to post data

i'm using this command to post data to a remote host: wget --post-data="My Data" http://<my-ip>:80 -O /dev/null -q and curl --data "My Data" http://<my-ip>:80 however, when i run the above, i see the following in my access log on the remote host: Wget: 10.10.10.10 - - "POST /... (1 Reply)
Discussion started by: SkySmart
1 Replies

5. Web Development

Data Post with curl

how to make the bash script ? http://server.com/mysql.php POST /mysql.php HTTP/1.1 Host: server.com User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language:... (1 Reply)
Discussion started by: iddfcr
1 Replies

6. Shell Programming and Scripting

Using cURL to submit a post form

I am trying to write a shell script to use curl in order to automate downloading data from a website. The URL with the post form is here: http://try-db.org/de/InfoBySpecies.php . I have a list of about 1800 different species I want to check. For Example, choose the first species and use the... (2 Replies)
Discussion started by: hansvg
2 Replies

7. UNIX for Dummies Questions & Answers

curl - sending headers, no-cache

Hello, I have question about curl - how can I disable caching on server side? I actually am not on unix/linux but I use win32gnu curl. I look for some good web- manual and I would like to find some good site which describes how looks headers of various Browsers (Safari, Opera). I have FF and... (0 Replies)
Discussion started by: webhope
0 Replies

8. Shell Programming and Scripting

Merging of files with different headers to make combined headers file

Hi , I have a typical situation. I have 4 files and with different headers (number of headers is varible ). I need to make such a merged file which will have headers combined from all files (comman coluns should appear once only). For example - File 1 H1|H2|H3|H4 11|12|13|14 21|22|23|23... (1 Reply)
Discussion started by: marut_ashu
1 Replies

9. Shell Programming and Scripting

maintaining form post session using curl

Hello, I have searched for a good part of the day, but cannot seem to find an answer to this. I hope this is an appropriate forum for my question. I am wanting to download a blog web page using a script. It requires username and password login. I have tried the following (an example) to no... (1 Reply)
Discussion started by: Allasso
1 Replies

10. Shell Programming and Scripting

Remove text between headers while leaving headers intact

Hi, I'm trying to strip all lines between two headers in a file: ### BEGIN ### Text to remove, contains all kinds of characters ... Antispyware-Downloadserver.com (Germany)=http://www.antispyware-downloadserver.c om/updates/ Antispyware-Downloadserver.com #2... (3 Replies)
Discussion started by: Trones
3 Replies
Login or Register to Ask a Question