私はMacでRESTClient(wiztools)を使って手動で使うことができる簡単なRESTリクエストを持っています。 URLはhttp://ws-argos.clsamerica.com/argosDws/services/DixService?getXmlで、体は以下の通りです:linuxコマンドラインからの単純なカールの失敗
<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>
これは、実際のデータをたっぷりとXMLのきちんとしたビットを返します。だから私はデータがあることを知っていることを知っている。しかし、私は、Linuxで毎晩スクリプトでこれを自動化したい、と下の2つのスクリプトを使用して、このためにCURLを使用しようとしています:
<?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>
:とのsoap.xmlを呼び出し
curl -H "content-type: application/soap+xml" \
-H "SOAPAction:" \
[email protected] \
-X POST http://ws-argos.clsamerica.com/argosDws/services/DixService?getXml \
> output.xml
出力は次のとおりです。
<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>
誰もがこれを解決する方法を知っている、またはに良い方法ありませんそれを自動化する?私はCURLを初めて使っていますが、もし誰かがそれを可能性として示唆すれば、Javaで何かを作ることができます(例:-))