如何在curl(命令行)SOAP请求中附加base64 pdf文档?

时间:2019-01-10 07:48:09

标签: xml curl soap soapui soap-client

我在互联网上搜索了几个带有文件附件的SOAP请求示例 但不是我没有找到任何具体的东西,在SoapUI程序中,我有这个示例(和项目xml文件),并且工作正常,但是我手动附加了文件,特别是MTOM编码,

在curl .exe中,我尝试重复此请求,服务器返回了我的响应,因为它无法解码base64 Error during base64 decoding,我的请求看起来像这样:

curl -X POST -H "Content-Type: text/xml" -H "SOAPAction myaction" --data-binary @request.xml https://server/end-point

这是我的xml请求文档[request.xml]:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:uniserv20.unimaticaspa.it:types">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:richiestaFirma>
          <parametriRichiesta>
            <nome>id</nome>
            <valore>value</valore>
         </parametriRichiesta>
         <arrayOfRichiestaDocumento>
            <parametri>
               <nome>idDocumento</nome>
               <valore>document.pdf</valore>
            </parametri>
            <parametri>
               <nome>nomeDocumento</nome>
               <valore>nomedocumento</valore>
            </parametri>
      <documento>cid:document.pdf</documento>
</arrayOfRichiestaDocumento>
      </urn:richiestaFirma>
   </soapenv:Body>
</soapenv:Envelope>

我如何在curl(命令行)中更正请求?

0 个答案:

没有答案