we have a simple REST request that I can use manually on my Mac with RESTClient (from wiztools). The url is http://ws-argos.clsamerica.com/argosDws/services/DixService?getXml and the body is below:
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:typ="http://service.dataxmldistribution.argos.cls.fr/types">
<soap:Body>
<typ:xmlRequest>
<typ:username>******</typ:username>
<typ:password>******</typ:password>
<typ:platformId>62518,62688,62520,62602,62608</typ:platformId>
<typ:nbDaysFromNow>10</typ:nbDaysFromNow>
</typ:xmlRequest>
</soap:Body>
</soap:Envelope>
This returns a neat bit of XML with plenty of real data. So I know the data are there to be grabbed. However, I want to automate this on a nightly script in Linux, and am trying to use CURL for this using the two scripts below:
curl -H "content-type: application/soap+xml" \
-H "SOAPAction:" \
-d@soap.xml \
-X POST http://ws-argos.clsamerica.com/argosDws/services/DixService?getXml \
> output.xml
which calls soap.xml with:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://service.dataxmldistribution.argos.cls.fr/types">
<soap:Body>
<typ:xmlRequest>
<typ:username>******</typ:username>
<typ:password>******</typ:password>
<typ:platformId>62518,62688,62520,62602,62608</typ:platformId>
<typ:nbDaysFromNow>10</typ:nbDaysFromNow>
</typ:xmlRequest>
</soap:Body>
The output is:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body><soap:Fault>
<soap:Code><soap:Value>soap:Sender</soap:Value></soap:Code>
<soap:Reason><soap:Text xml:lang="en">Error reading XMLStreamReader.</soap:Text>
</soap:Reason>
</soap:Fault></soap:Body></soap:Envelope>
Does anyone know how to resolve this, or a better way to automate it? I'm new to CURL, but could create something in Java if anyone suggests that as possibility (with examples ;-))