<?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 Re: HTTP POST Request with XML file in in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-request-with-xml-file-in/m-p/5182360#M1199685</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi friend could you please share your solution regarding this query if u got it already?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jul 2009 08:44:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-09T08:44:03Z</dc:date>
    <item>
      <title>HTTP POST Request with XML file in</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-request-with-xml-file-in/m-p/5182358#M1199683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi @ all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to send an HTTP Request with an XML File in the body to an SAP System&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the target URL and the a XML File.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the question is. Is it possible to use something like the HTTP_POST FuBa to send an url post request with an xml file? &lt;/P&gt;&lt;P&gt;If yes can anybody give me a hint?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a php script which exactly do this coding. But to integrate it all in one system it is necessary to transform it into ABAP and call it there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// compose url and request and call send function&lt;/P&gt;&lt;P&gt;function test($productID, $categoryID) {&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;	// create url&lt;/P&gt;&lt;P&gt;	$PIhost = "XXX.wdf.sap.corp";&lt;/P&gt;&lt;P&gt;	$PIport = "50080";&lt;/P&gt;&lt;P&gt;	$PIurl = "/sap/xi/adapter_plain";&lt;/P&gt;&lt;P&gt;	$PIurl .= "?sap-client=800";&lt;/P&gt;&lt;P&gt;	$PIurl .= "&amp;amp;service=XXX";&lt;/P&gt;&lt;P&gt;	$PIurl .= "&amp;amp;namespace=XXX";&lt;/P&gt;&lt;P&gt;	$PIurl .= "&amp;amp;interface=Frontend_Interface";&lt;/P&gt;&lt;P&gt;	$PIurl .= "&amp;amp;qos=EO";&lt;/P&gt;&lt;P&gt;	$PIurl .= "&amp;amp;sap-user=XXX";&lt;/P&gt;&lt;P&gt;	$PIurl .= "&amp;amp;sap-password=XXX";&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;	// create xml&lt;/P&gt;&lt;P&gt;	$request = "&amp;lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&amp;gt;\n";&lt;/P&gt;&lt;P&gt;	$request .="&amp;lt;n1:FrontendInbound_MessageType xmlns:n1=\"http://crmpiebay.com\"&amp;gt;\n";&lt;/P&gt;&lt;P&gt;	$request .= "\t&amp;lt;FrontendInbound&amp;gt;\n";&lt;/P&gt;&lt;P&gt;	$request .= "\t\t&amp;lt;ProductName/&amp;gt;\n";&lt;/P&gt;&lt;P&gt;	$request .= "\t\t&amp;lt;ProductCategory&amp;gt;".$categoryID."&amp;lt;/ProductCategory&amp;gt;\n";&lt;/P&gt;&lt;P&gt;	$request .= "\t\t&amp;lt;ProductID&amp;gt;".$productID."&amp;lt;/ProductID&amp;gt;\n";&lt;/P&gt;&lt;P&gt;	$request .= "\t\t&amp;lt;MessageID/&amp;gt;\n";&lt;/P&gt;&lt;P&gt;	$request .= "\t&amp;lt;/FrontendInbound&amp;gt;\n";&lt;/P&gt;&lt;P&gt;	$request .= "&amp;lt;/n1:FrontendInbound_MessageType&amp;gt;";&lt;/P&gt;&lt;P&gt;			&lt;/P&gt;&lt;P&gt;	// send http request&lt;/P&gt;&lt;P&gt;	postToHost($PIhost, $PIport, $PIurl, $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"]."/".$_SERVER["PHP_SELF"], $request);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// send post request to PI server&lt;/P&gt;&lt;P&gt;function postToHost($host, $port, $path, $referer, $data_to_send) {&lt;/P&gt;&lt;P&gt;  $fp = fsockopen($host, $port);&lt;/P&gt;&lt;P&gt;  if($fp) {&lt;/P&gt;&lt;P&gt;  	$res="";&lt;/P&gt;&lt;P&gt;	  fputs($fp, "POST $path HTTP/1.1\r\n");&lt;/P&gt;&lt;P&gt;	  fputs($fp, "Host: $host\r\n");&lt;/P&gt;&lt;P&gt;	  fputs($fp, "Referer: $referer\r\n");&lt;/P&gt;&lt;P&gt;	  fputs($fp, "Content-type: text/plain\r\n");&lt;/P&gt;&lt;P&gt;	  fputs($fp, "Content-length: ". strlen($data_to_send) ."\r\n");&lt;/P&gt;&lt;P&gt;	  fputs($fp, "Connection: close\r\n\r\n");&lt;/P&gt;&lt;P&gt;	  fputs($fp, $data_to_send);&lt;/P&gt;&lt;P&gt;	  while(!feof($fp)) {&lt;/P&gt;&lt;P&gt;	      $res .= fgets($fp, 128);&lt;/P&gt;&lt;P&gt;	  }&lt;/P&gt;&lt;P&gt;	  fclose($fp);&lt;/P&gt;&lt;P&gt;	  return $res;&lt;/P&gt;&lt;P&gt; 	}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be great if anybody could give me a hint how to solve such a HTTP Post request with XML body data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Christian Kuehne on Feb 26, 2009 4:32 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2009 15:32:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-request-with-xml-file-in/m-p/5182358#M1199683</guid>
      <dc:creator>ChrisKuehne</dc:creator>
      <dc:date>2009-02-26T15:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP POST Request with XML file in</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-request-with-xml-file-in/m-p/5182359#M1199684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Chris I am trying the same. Have you resolved this? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 18:55:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-request-with-xml-file-in/m-p/5182359#M1199684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-01T18:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP POST Request with XML file in</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-request-with-xml-file-in/m-p/5182360#M1199685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi friend could you please share your solution regarding this query if u got it already?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 08:44:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-request-with-xml-file-in/m-p/5182360#M1199685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-09T08:44:03Z</dc:date>
    </item>
  </channel>
</rss>

