<?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: Encoding issue with proc http in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Encoding-issue-with-proc-http/m-p/363890#M64645</link>
    <description>&lt;P&gt;Look to your data&amp;nbsp;step building &amp;nbsp;Request and the contents of any input data set used in that step. The input data likely has the coding issue and may trace back to how the file was read.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2017 17:45:28 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-06-02T17:45:28Z</dc:date>
    <item>
      <title>Encoding issue with proc http</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Encoding-issue-with-proc-http/m-p/363593#M64617</link>
      <description>&lt;P&gt;I seem to be having an issue with encoding when invoking proc http.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I am using to invoke an WSDL web serivce&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename request temp;&lt;BR /&gt;filename response temp;&lt;BR /&gt;filename header temp;
 
 
        data _NULL_;
        file header;
        put 'SOAPAction: "http://tempuri.org/IGCodeService/TextsMatch"';
        run;
 
        proc http
           url="http://gcodeservice-prod/service.svc"
           method="POST"
           headerin=header
           CT="text/xml; charset=utf-8"
           in=request
           out=response;
        quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Before running the above code I have a data step that produces the following content for the request file...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&amp;gt;
    &amp;lt;s:Header/&amp;gt;
    &amp;lt;s:Body&amp;gt;
        &amp;lt;TextsMatch xmlns="http://tempuri.org/"&amp;gt;
            &amp;lt;CodingDatabaseReferences xmlns:d4p1="http://schemas.datacontract.org/2004/07/GCodeService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;
                &amp;lt;d4p1:CodingDatabaseReference&amp;gt;
                    &amp;lt;d4p1:CodingDatabaseIdentifier&amp;gt;4cdcff3c-a7cc-4ac1-b4d4-8151ec39bc55&amp;lt;/d4p1:CodingDatabaseIdentifier&amp;gt;
                    &amp;lt;d4p1:FilterUsage&amp;gt;NoFilter&amp;lt;/d4p1:FilterUsage&amp;gt;
                &amp;lt;/d4p1:CodingDatabaseReference&amp;gt;
                &amp;lt;d4p1:CodingDatabaseReference&amp;gt;
                    &amp;lt;d4p1:CodingDatabaseIdentifier&amp;gt;08c7247f-cde8-4f6d-8078-1a571f4a9117&amp;lt;/d4p1:CodingDatabaseIdentifier&amp;gt;
                    &amp;lt;d4p1:FilterUsage&amp;gt;NoFilter&amp;lt;/d4p1:FilterUsage&amp;gt;
                &amp;lt;/d4p1:CodingDatabaseReference&amp;gt;
                &amp;lt;d4p1:CodingDatabaseReference&amp;gt;
                    &amp;lt;d4p1:CodingDatabaseIdentifier&amp;gt;a5894c8c-d051-4b98-96eb-b2ac2f0457d6&amp;lt;/d4p1:CodingDatabaseIdentifier&amp;gt;
                    &amp;lt;d4p1:FilterUsage&amp;gt;NoFilter&amp;lt;/d4p1:FilterUsage&amp;gt;
                &amp;lt;/d4p1:CodingDatabaseReference&amp;gt;
                &amp;lt;d4p1:CodingDatabaseReference&amp;gt;
                    &amp;lt;d4p1:CodingDatabaseIdentifier&amp;gt;cbd141e3-248d-4209-a4f3-a2c5c4b37e4b&amp;lt;/d4p1:CodingDatabaseIdentifier&amp;gt;
                    &amp;lt;d4p1:FilterUsage&amp;gt;NoFilter&amp;lt;/d4p1:FilterUsage&amp;gt;
                &amp;lt;/d4p1:CodingDatabaseReference&amp;gt;
                &amp;lt;d4p1:CodingDatabaseReference&amp;gt;
                    &amp;lt;d4p1:CodingDatabaseIdentifier&amp;gt;f52dd135-6f04-4a19-aa08-139fe2d2e614&amp;lt;/d4p1:CodingDatabaseIdentifier&amp;gt;
                    &amp;lt;d4p1:FilterUsage&amp;gt;NoFilter&amp;lt;/d4p1:FilterUsage&amp;gt;
                &amp;lt;/d4p1:CodingDatabaseReference&amp;gt;
                &amp;lt;d4p1:CodingDatabaseReference&amp;gt;
                    &amp;lt;d4p1:CodingDatabaseIdentifier&amp;gt;65895ba3-ac4b-4135-b597-a0c97aff3851&amp;lt;/d4p1:CodingDatabaseIdentifier&amp;gt;
                    &amp;lt;d4p1:FilterUsage&amp;gt;NoFilter&amp;lt;/d4p1:FilterUsage&amp;gt;
                &amp;lt;/d4p1:CodingDatabaseReference&amp;gt;
                &amp;lt;d4p1:CodingDatabaseReference&amp;gt;
                    &amp;lt;d4p1:CodingDatabaseIdentifier&amp;gt;c506d462-6ebc-48df-b484-fb22f85c2279&amp;lt;/d4p1:CodingDatabaseIdentifier&amp;gt;
                    &amp;lt;d4p1:FilterUsage&amp;gt;NoFilter&amp;lt;/d4p1:FilterUsage&amp;gt;
                &amp;lt;/d4p1:CodingDatabaseReference&amp;gt;
                &amp;lt;d4p1:CodingDatabaseReference&amp;gt;
                    &amp;lt;d4p1:CodingDatabaseIdentifier&amp;gt;9249b1fa-e196-4ca0-9644-e19760b450b1&amp;lt;/d4p1:CodingDatabaseIdentifier&amp;gt;
                    &amp;lt;d4p1:FilterUsage&amp;gt;NoFilter&amp;lt;/d4p1:FilterUsage&amp;gt;
                &amp;lt;/d4p1:CodingDatabaseReference&amp;gt;
            &amp;lt;/CodingDatabaseReferences&amp;gt;
            &amp;lt;TextsToMatch xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;
                &amp;lt;d4p1:string&amp;gt;ELECTRONIC PRECISION EQUIPMENT R M ³NAICS-811210U&amp;lt;/d4p1:string&amp;gt;
            &amp;lt;/TextsToMatch&amp;gt;
            &amp;lt;MatchParams xmlns:d4p1="http://schemas.datacontract.org/2004/07/GCodeService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;
                &amp;lt;d4p1:Delta&amp;gt;0&amp;lt;/d4p1:Delta&amp;gt;
                &amp;lt;d4p1:ListSort&amp;gt;Code&amp;lt;/d4p1:ListSort&amp;gt;
                &amp;lt;d4p1:ListType&amp;gt;AllCode&amp;lt;/d4p1:ListType&amp;gt;
                &amp;lt;d4p1:MatchAlgorighm&amp;gt;Direct&amp;lt;/d4p1:MatchAlgorighm&amp;gt;
                &amp;lt;d4p1:MaxList&amp;gt;5&amp;lt;/d4p1:MaxList&amp;gt;
                &amp;lt;d4p1:Possible&amp;gt;0&amp;lt;/d4p1:Possible&amp;gt;
                &amp;lt;d4p1:ScoreMethod&amp;gt;WORD&amp;lt;/d4p1:ScoreMethod&amp;gt;
                &amp;lt;d4p1:Winner&amp;gt;10&amp;lt;/d4p1:Winner&amp;gt;
            &amp;lt;/MatchParams&amp;gt;
            &amp;lt;StopWhenWinnerFound&amp;gt;true&amp;lt;/StopWhenWinnerFound&amp;gt;
        &amp;lt;/TextsMatch&amp;gt;
    &amp;lt;/s:Body&amp;gt;
&amp;lt;/s:Envelope&amp;gt;&lt;/PRE&gt;&lt;P&gt;**notice the strange character in the&amp;nbsp;&amp;lt;d4p1:string&amp;gt; tag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running the above will fail with a response of 500 from the web service, however if I ensure the request file is encoded to utf-8 (I manually change it by opening it in Notepad++ and converting it) I can get it to run without error but the response contains improper characters. &amp;nbsp;Below is the response content found in the response file..part of the content returned indicates the text string that was sent to the web service.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&amp;gt;
&amp;lt;s:Body&amp;gt;
&amp;lt;TextsMatchResponse xmlns="http://tempuri.org/"&amp;gt;
&amp;lt;TextsMatchResult xmlns:a="http://schemas.datacontract.org/2004/07/GCodeService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;
&amp;lt;a:CDMatchResultSet&amp;gt;
&amp;lt;a:FilterToMatch i:nil="true"/&amp;gt;
&amp;lt;a:Items/&amp;gt;
&amp;lt;a:ResultMatchAlgorithm&amp;gt;NotApplicable&amp;lt;/a:ResultMatchAlgorithm&amp;gt;
&amp;lt;a:ResultType&amp;gt;Fail&amp;lt;/a:ResultType&amp;gt;
&amp;lt;a:TextToMatch&amp;gt;ELECTRONIC PRECISION EQUIPMENT R M Â³NAICS-811210U&amp;lt;/a:TextToMatch&amp;gt;
&amp;lt;a:Timespan&amp;gt;PT0S&amp;lt;/a:Timespan&amp;gt;
&amp;lt;/a:CDMatchResultSet&amp;gt;
&amp;lt;/TextsMatchResult&amp;gt;
&amp;lt;/TextsMatchResponse&amp;gt;
&amp;lt;/s:Body&amp;gt;
&amp;lt;/s:Envelope&amp;gt;&lt;/PRE&gt;&lt;P&gt;Notice the additional character (Â) that was added to the text string in the &amp;lt;a:TextToMatch&amp;gt;. &amp;nbsp;Note this is not something the web service is adding or any issue of the web service as it works completely fine in other environments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to ensure the encoding of all three temp files were utf-8 during file reference statements but all hell breaks out and my SAS program fails completely. &amp;nbsp;The only file that I can specify the encoding='utf-8' for is the response file...any other files cause issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe this is some sort of encoding/character translation issue but I have no idea what to do next to try and resolve this.&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 01 Jun 2017 20:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Encoding-issue-with-proc-http/m-p/363593#M64617</guid>
      <dc:creator>jeffstc</dc:creator>
      <dc:date>2017-06-01T20:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Encoding issue with proc http</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Encoding-issue-with-proc-http/m-p/363890#M64645</link>
      <description>&lt;P&gt;Look to your data&amp;nbsp;step building &amp;nbsp;Request and the contents of any input data set used in that step. The input data likely has the coding issue and may trace back to how the file was read.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 17:45:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Encoding-issue-with-proc-http/m-p/363890#M64645</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-02T17:45:28Z</dc:date>
    </item>
  </channel>
</rss>

