<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic QueryDocumentOutputRequestIn Web Service in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/querydocumentoutputrequestin-web-service/m-p/12095455#M1972319</link>
    <description>&lt;P&gt;Hi every body,&lt;/P&gt;
  &lt;P&gt;I would like to retreive all Customers invoices PDF.&lt;/P&gt;
  &lt;P&gt;I am not experimented with using the SAP API and I need some help.&lt;/P&gt;
  &lt;P&gt;To retreive the PDF, I wrote a PHP Script using Curl and QueryDocumentOutputReques Web Service.&lt;/P&gt;
  &lt;P&gt;While testing it, I enabled CURL verbose and always got a "500 internal error". &lt;/P&gt;
  &lt;P&gt;However, I saw the authentication was correct. Therefore, I thought it was my request which was wrong.&lt;/P&gt;
  &lt;P&gt;You can find below, my php CURL use and my request.&lt;/P&gt;
  &lt;P&gt;Thank you to everybody who can help.&lt;/P&gt;
  &lt;P&gt;Extract of my PHP script:&lt;/P&gt;
  &lt;P&gt;39 function RecupUrl($url,$request) &lt;/P&gt;
  &lt;P&gt;40 { &lt;/P&gt;
  &lt;P&gt;41 $headers = array( &lt;/P&gt;
  &lt;P&gt;42 "Content-type:text/xml", &lt;/P&gt;
  &lt;P&gt;43 "Accept: multipart/form-data", &lt;/P&gt;
  &lt;P&gt;44 "Cache-Control: no-cache", &lt;/P&gt;
  &lt;P&gt;45 "Pragma: no-cache", &lt;/P&gt;
  &lt;P&gt;46 "SOAPAction: &amp;lt;url&amp;gt;", &lt;/P&gt;
  &lt;P&gt;47 "Content-length: ".strlen($request), &lt;/P&gt;
  &lt;P&gt;48 ); &lt;/P&gt;
  &lt;P&gt;49 &lt;/P&gt;
  &lt;P&gt;51 $ch = curl_init(); &lt;/P&gt;
  &lt;P&gt;52 &lt;/P&gt;
  &lt;P&gt;53 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); &lt;/P&gt;
  &lt;P&gt;54 curl_setopt($ch, CURLOPT_VERBOSE, 1); &lt;/P&gt;
  &lt;P&gt;55 curl_setopt($ch, CURLOPT_URL, $url); &lt;/P&gt;
  &lt;P&gt;56 curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); &lt;/P&gt;
  &lt;P&gt;57 curl_setopt($ch, CURLOPT_USERPWD, 'XXXXX:PPPPP); // XXXX=user name, PPPPP=Password &lt;/P&gt;
  &lt;P&gt;58 curl_setopt($ch, CURLOPT_POST, 1); &lt;/P&gt;
  &lt;P&gt;59 curl_setopt ( $ch, CURLOPT_CUSTOMREQUEST, "POST" ); &lt;/P&gt;
  &lt;P&gt;60 curl_setopt($ch, CURLOPT_POSTFIELDS,$request); &lt;/P&gt;
  &lt;P&gt;61 curl_setopt($ch, CURLOPT_FAILONERROR, true); &lt;/P&gt;
  &lt;P&gt;62 curl_setopt($ch, CURLOPT_FORBID_REUSE, true); &lt;/P&gt;
  &lt;P&gt;63 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); &lt;/P&gt;
  &lt;P&gt;67 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); &lt;/P&gt;
  &lt;P&gt;68 &lt;/P&gt;
  &lt;P&gt;69 curl_setopt($ch, CURLOPT_HEADER, array( &lt;/P&gt;
  &lt;P&gt;70 "Content-Type: multipart/form-data" &lt;/P&gt;
  &lt;P&gt;71 )); &lt;/P&gt;
  &lt;P&gt;73 $data = curl_exec($ch); &lt;/P&gt;
  &lt;P&gt;74 curl_close($ch); &lt;/P&gt;
  &lt;P&gt;76 return $data; &lt;/P&gt;
  &lt;P&gt;78 }&lt;/P&gt;
  &lt;P&gt;The request : &lt;/P&gt;
  &lt;P&gt;$request='&lt;/P&gt;
  &lt;P&gt; &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global"&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;soapenv:Header/&amp;gt; &lt;/P&gt;
  &lt;P&gt; &amp;lt;soapenv:Body&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;glob:DocumentOutputRequestPdf_sync&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;DocumentOutputRequestPDFInformation&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;ReadByDocumentUUID&amp;gt;XXXX-XXXX-XXXX&amp;lt;/ReadByDocumentUUID&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;/DocumentOutputRequestPDFInformation&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;/glob:DocumentOutputRequestPdf_sync&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;/soapenv:Body&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;/soapenv:Envelope&amp;gt;';&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2019 06:34:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2019-10-16T06:34:31Z</dc:date>
    <item>
      <title>QueryDocumentOutputRequestIn Web Service</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querydocumentoutputrequestin-web-service/m-p/12095455#M1972319</link>
      <description>&lt;P&gt;Hi every body,&lt;/P&gt;
  &lt;P&gt;I would like to retreive all Customers invoices PDF.&lt;/P&gt;
  &lt;P&gt;I am not experimented with using the SAP API and I need some help.&lt;/P&gt;
  &lt;P&gt;To retreive the PDF, I wrote a PHP Script using Curl and QueryDocumentOutputReques Web Service.&lt;/P&gt;
  &lt;P&gt;While testing it, I enabled CURL verbose and always got a "500 internal error". &lt;/P&gt;
  &lt;P&gt;However, I saw the authentication was correct. Therefore, I thought it was my request which was wrong.&lt;/P&gt;
  &lt;P&gt;You can find below, my php CURL use and my request.&lt;/P&gt;
  &lt;P&gt;Thank you to everybody who can help.&lt;/P&gt;
  &lt;P&gt;Extract of my PHP script:&lt;/P&gt;
  &lt;P&gt;39 function RecupUrl($url,$request) &lt;/P&gt;
  &lt;P&gt;40 { &lt;/P&gt;
  &lt;P&gt;41 $headers = array( &lt;/P&gt;
  &lt;P&gt;42 "Content-type:text/xml", &lt;/P&gt;
  &lt;P&gt;43 "Accept: multipart/form-data", &lt;/P&gt;
  &lt;P&gt;44 "Cache-Control: no-cache", &lt;/P&gt;
  &lt;P&gt;45 "Pragma: no-cache", &lt;/P&gt;
  &lt;P&gt;46 "SOAPAction: &amp;lt;url&amp;gt;", &lt;/P&gt;
  &lt;P&gt;47 "Content-length: ".strlen($request), &lt;/P&gt;
  &lt;P&gt;48 ); &lt;/P&gt;
  &lt;P&gt;49 &lt;/P&gt;
  &lt;P&gt;51 $ch = curl_init(); &lt;/P&gt;
  &lt;P&gt;52 &lt;/P&gt;
  &lt;P&gt;53 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); &lt;/P&gt;
  &lt;P&gt;54 curl_setopt($ch, CURLOPT_VERBOSE, 1); &lt;/P&gt;
  &lt;P&gt;55 curl_setopt($ch, CURLOPT_URL, $url); &lt;/P&gt;
  &lt;P&gt;56 curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); &lt;/P&gt;
  &lt;P&gt;57 curl_setopt($ch, CURLOPT_USERPWD, 'XXXXX:PPPPP); // XXXX=user name, PPPPP=Password &lt;/P&gt;
  &lt;P&gt;58 curl_setopt($ch, CURLOPT_POST, 1); &lt;/P&gt;
  &lt;P&gt;59 curl_setopt ( $ch, CURLOPT_CUSTOMREQUEST, "POST" ); &lt;/P&gt;
  &lt;P&gt;60 curl_setopt($ch, CURLOPT_POSTFIELDS,$request); &lt;/P&gt;
  &lt;P&gt;61 curl_setopt($ch, CURLOPT_FAILONERROR, true); &lt;/P&gt;
  &lt;P&gt;62 curl_setopt($ch, CURLOPT_FORBID_REUSE, true); &lt;/P&gt;
  &lt;P&gt;63 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); &lt;/P&gt;
  &lt;P&gt;67 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); &lt;/P&gt;
  &lt;P&gt;68 &lt;/P&gt;
  &lt;P&gt;69 curl_setopt($ch, CURLOPT_HEADER, array( &lt;/P&gt;
  &lt;P&gt;70 "Content-Type: multipart/form-data" &lt;/P&gt;
  &lt;P&gt;71 )); &lt;/P&gt;
  &lt;P&gt;73 $data = curl_exec($ch); &lt;/P&gt;
  &lt;P&gt;74 curl_close($ch); &lt;/P&gt;
  &lt;P&gt;76 return $data; &lt;/P&gt;
  &lt;P&gt;78 }&lt;/P&gt;
  &lt;P&gt;The request : &lt;/P&gt;
  &lt;P&gt;$request='&lt;/P&gt;
  &lt;P&gt; &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global"&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;soapenv:Header/&amp;gt; &lt;/P&gt;
  &lt;P&gt; &amp;lt;soapenv:Body&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;glob:DocumentOutputRequestPdf_sync&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;DocumentOutputRequestPDFInformation&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;ReadByDocumentUUID&amp;gt;XXXX-XXXX-XXXX&amp;lt;/ReadByDocumentUUID&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;/DocumentOutputRequestPDFInformation&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;/glob:DocumentOutputRequestPdf_sync&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;/soapenv:Body&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;/soapenv:Envelope&amp;gt;';&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 06:34:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querydocumentoutputrequestin-web-service/m-p/12095455#M1972319</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-10-16T06:34:31Z</dc:date>
    </item>
  </channel>
</rss>

