Как прикрепить PDF-документ base64 в SOAP-запрос curl (командной строки)? - PullRequest
0 голосов
/ 10 января 2019

Я искал в интернете несколько примеров 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 (командной строке)?

...