<?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 &amp;quot;415 unsupported media type&amp;quot;-error when using proc http with POST method. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/quot-415-unsupported-media-type-quot-error-when-using-proc-http/m-p/648792#M194422</link>
    <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;Im trying to get a simple example code to Work. I have a very simple XML file that I want to use as my content body to a SAS webservice that I have exposed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;onboarding&amp;gt;
	&amp;lt;streams&amp;gt;
		&amp;lt;in_xml&amp;gt;
			&amp;lt;Value&amp;gt;
			&amp;lt;ape:Apply xmlns:ape="http://ape.dfr.dk/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../AutomatedProductEstablishmentService.xsd"&amp;gt;			
	&amp;lt;Origin&amp;gt;
		&amp;lt;Agent&amp;gt;Smith&amp;lt;/Agent&amp;gt;
		&amp;lt;AgentReference&amp;gt;1234&amp;lt;/AgentReference&amp;gt;
	&amp;lt;/Origin&amp;gt;
	&amp;lt;Context&amp;gt;Onboarding&amp;lt;/Context&amp;gt;
	&amp;lt;MainApplicant&amp;gt;
		&amp;lt;SocialSecurityNumber&amp;gt;1234567891&amp;lt;/SocialSecurityNumber&amp;gt;
		&amp;lt;FirstName&amp;gt;My&amp;lt;/FirstName&amp;gt;
		&amp;lt;LastName&amp;gt;Man&amp;lt;/LastName&amp;gt;
		&amp;lt;StreetAddress&amp;gt;Gadevej 1&amp;lt;/StreetAddress&amp;gt;
		&amp;lt;PostalCode&amp;gt;1234&amp;lt;/PostalCode&amp;gt;
		&amp;lt;City&amp;gt;City2&amp;lt;/City&amp;gt;
		&amp;lt;MobileNumber&amp;gt;20200202&amp;lt;/MobileNumber&amp;gt;
		&amp;lt;Email&amp;gt;mymail@gmail.com&amp;lt;/Email&amp;gt;
	&amp;lt;/MainApplicant&amp;gt;
&amp;lt;/ape:Apply&amp;gt;
&amp;lt;/Value&amp;gt;
		&amp;lt;/in_xml&amp;gt;
	&amp;lt;/streams&amp;gt;
&amp;lt;/onboarding&amp;gt;&lt;/PRE&gt;&lt;PRE&gt;proc http 
	url			= 'http://&amp;lt;hostname&amp;gt;/SASBIWS/rest/storedProcesses/STP/AML/onboarding' 
	method 		= 'POST'
	in			= payload
	out			= response
	headerout	= head_out
	verbose
	;
	headers 'Content-Type' 	= 'text/xml'
	;
run;&lt;/PRE&gt;&lt;P&gt;My request never reaches the storedprocess server, it gets an error from the webserver:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOTE: Macro variable SYS_PROC_HTTP_CACHE created for PROC HTTP System cache.
URL                  =
http://&amp;lt;hostname&amp;gt;/SASBIWS/rest/storedProcesses/STP/AML/onboarding
METHOD               = POST
In                   = \\&amp;lt;fileshare&amp;gt;\AML-T-SHARE\SAS\Realtime
CDD\OneDrive\resources\2020.05.07_from_Ali\Onboarding Lite 1 + 2.AlexVersion.xml
Out                  = C:\Users\u3199\AppData\Local\Temp\SAS Temporary
Files\_TD12888_SDCF2707_\#LN00011
Header Out           = C:\Users\u3199\AppData\Local\Temp\SAS Temporary
Files\_TD12888_SDCF2707_\#LN00010

45       headers 'Content-Type'  = 'text/xml'
46       ;
Setting Header: Content-Type: text/xml
47   run;

NOTE: PROCEDURE HTTP used (Total process time):
      real time           0.37 seconds
      cpu time            0.01 seconds

NOTE: 415 Unsupported Media Type&lt;/PRE&gt;&lt;P&gt;Any idea what i might be doing wrong here?&lt;/P&gt;</description>
    <pubDate>Tue, 19 May 2020 09:53:03 GMT</pubDate>
    <dc:creator>alch</dc:creator>
    <dc:date>2020-05-19T09:53:03Z</dc:date>
    <item>
      <title>"415 unsupported media type"-error when using proc http with POST method.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-415-unsupported-media-type-quot-error-when-using-proc-http/m-p/648792#M194422</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;Im trying to get a simple example code to Work. I have a very simple XML file that I want to use as my content body to a SAS webservice that I have exposed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;onboarding&amp;gt;
	&amp;lt;streams&amp;gt;
		&amp;lt;in_xml&amp;gt;
			&amp;lt;Value&amp;gt;
			&amp;lt;ape:Apply xmlns:ape="http://ape.dfr.dk/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../AutomatedProductEstablishmentService.xsd"&amp;gt;			
	&amp;lt;Origin&amp;gt;
		&amp;lt;Agent&amp;gt;Smith&amp;lt;/Agent&amp;gt;
		&amp;lt;AgentReference&amp;gt;1234&amp;lt;/AgentReference&amp;gt;
	&amp;lt;/Origin&amp;gt;
	&amp;lt;Context&amp;gt;Onboarding&amp;lt;/Context&amp;gt;
	&amp;lt;MainApplicant&amp;gt;
		&amp;lt;SocialSecurityNumber&amp;gt;1234567891&amp;lt;/SocialSecurityNumber&amp;gt;
		&amp;lt;FirstName&amp;gt;My&amp;lt;/FirstName&amp;gt;
		&amp;lt;LastName&amp;gt;Man&amp;lt;/LastName&amp;gt;
		&amp;lt;StreetAddress&amp;gt;Gadevej 1&amp;lt;/StreetAddress&amp;gt;
		&amp;lt;PostalCode&amp;gt;1234&amp;lt;/PostalCode&amp;gt;
		&amp;lt;City&amp;gt;City2&amp;lt;/City&amp;gt;
		&amp;lt;MobileNumber&amp;gt;20200202&amp;lt;/MobileNumber&amp;gt;
		&amp;lt;Email&amp;gt;mymail@gmail.com&amp;lt;/Email&amp;gt;
	&amp;lt;/MainApplicant&amp;gt;
&amp;lt;/ape:Apply&amp;gt;
&amp;lt;/Value&amp;gt;
		&amp;lt;/in_xml&amp;gt;
	&amp;lt;/streams&amp;gt;
&amp;lt;/onboarding&amp;gt;&lt;/PRE&gt;&lt;PRE&gt;proc http 
	url			= 'http://&amp;lt;hostname&amp;gt;/SASBIWS/rest/storedProcesses/STP/AML/onboarding' 
	method 		= 'POST'
	in			= payload
	out			= response
	headerout	= head_out
	verbose
	;
	headers 'Content-Type' 	= 'text/xml'
	;
run;&lt;/PRE&gt;&lt;P&gt;My request never reaches the storedprocess server, it gets an error from the webserver:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOTE: Macro variable SYS_PROC_HTTP_CACHE created for PROC HTTP System cache.
URL                  =
http://&amp;lt;hostname&amp;gt;/SASBIWS/rest/storedProcesses/STP/AML/onboarding
METHOD               = POST
In                   = \\&amp;lt;fileshare&amp;gt;\AML-T-SHARE\SAS\Realtime
CDD\OneDrive\resources\2020.05.07_from_Ali\Onboarding Lite 1 + 2.AlexVersion.xml
Out                  = C:\Users\u3199\AppData\Local\Temp\SAS Temporary
Files\_TD12888_SDCF2707_\#LN00011
Header Out           = C:\Users\u3199\AppData\Local\Temp\SAS Temporary
Files\_TD12888_SDCF2707_\#LN00010

45       headers 'Content-Type'  = 'text/xml'
46       ;
Setting Header: Content-Type: text/xml
47   run;

NOTE: PROCEDURE HTTP used (Total process time):
      real time           0.37 seconds
      cpu time            0.01 seconds

NOTE: 415 Unsupported Media Type&lt;/PRE&gt;&lt;P&gt;Any idea what i might be doing wrong here?&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 09:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-415-unsupported-media-type-quot-error-when-using-proc-http/m-p/648792#M194422</guid>
      <dc:creator>alch</dc:creator>
      <dc:date>2020-05-19T09:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: "415 unsupported media type"-error when using proc http with POST method.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-415-unsupported-media-type-quot-error-when-using-proc-http/m-p/649041#M194526</link>
      <description>&lt;P&gt;The cause seems quite clear: the content you are sending is not what is expected.&lt;/P&gt;
&lt;P&gt;"&amp;nbsp;A&amp;nbsp;415 Unsupported Media Type&amp;nbsp;error occurs when the origin server refuses a particular request since the resource is in a format that is not supported by the server for the HTTP method used. This&amp;nbsp;unsupported&amp;nbsp;format&amp;nbsp;type&amp;nbsp;issue can be caused by what is defined in the resource's Content-Type&lt;SPAN&gt;&amp;nbsp;or Content-Encoding headers. "&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 23:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-415-unsupported-media-type-quot-error-when-using-proc-http/m-p/649041#M194526</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-19T23:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: "415 unsupported media type"-error when using proc http with POST method.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-415-unsupported-media-type-quot-error-when-using-proc-http/m-p/649097#M194565</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just dont understand why the server is saying this. Im sending XML in the payload and I have set the header for the request to content-Type = text/XML. The STP is registered with a data instream that requires text/XML input data. Where do I need to make a change?&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 06:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-415-unsupported-media-type-quot-error-when-using-proc-http/m-p/649097#M194565</guid>
      <dc:creator>alch</dc:creator>
      <dc:date>2020-05-20T06:25:34Z</dc:date>
    </item>
  </channel>
</rss>

