<?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: ABAP  intergate with  WeChat in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252052#M1986289</link>
    <description>&lt;P&gt;Hi  Mateusz,&lt;/P&gt;&lt;P&gt;                 Thank you  very much.  I'm trying the solution you've provided, and I'm still testing it.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Sep 2020 03:09:08 GMT</pubDate>
    <dc:creator>former_member701231</dc:creator>
    <dc:date>2020-09-10T03:09:08Z</dc:date>
    <item>
      <title>ABAP  intergate with  WeChat</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252049#M1986286</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt; Thank you very much for taking your time to review this issue.&lt;/P&gt;
  &lt;P&gt; In my case, I want to use ABAP development to achieve access to enterprise wechat. But always received the &lt;EM&gt;MSG 417&lt;/EM&gt; and &lt;EM&gt;failed: NIEHOST_UNKNOWN(-2) . &lt;/EM&gt;I don't know if there is no configuration or what needs to be done.&lt;/P&gt;
  &lt;P&gt; Please help me.Thank you very much for your reply.&lt;/P&gt;
  &lt;P&gt; Here is my code:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;  DATA: lo_http_client TYPE REF TO if_http_client,
        gv_json_out    TYPE string,
        lv_url         TYPE string,
        lv_auth        TYPE string,
        lv_head        TYPE string,
        lv_len         TYPE i,
        iv_json_input  TYPE string,
        ev_json_output TYPE string,
        l_content      TYPE char1024,
        l_value        TYPE savwctxt-fieldcont.

  DATA: l_sysubrc    TYPE sysubrc,
        l_error_text TYPE string.

  lv_url = 'https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=xxxxx&amp;amp;corpsecret=xxxxx'.

  CALL METHOD cl_http_client=&amp;gt;create_by_url
    EXPORTING
      url                = lv_url
*     proxy_host         = 
*     proxy_service      = 
*     ssl_id             = 
*     sap_username       =
*     sap_client         = 
    IMPORTING
      client             = lo_http_client
    EXCEPTIONS
      argument_not_found = 1
      plugin_not_active  = 2
      internal_error     = 3
      OTHERS             = 4.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*               Implement suitable error handling here
  ENDIF.

  lo_http_client-&amp;gt;propertytype_logon_popup = lo_http_client-&amp;gt;co_disabled.

  CALL METHOD lo_http_client-&amp;gt;send
    EXCEPTIONS
      http_communication_failure = 1
      http_invalid_state         = 2.

  IF sy-subrc &amp;lt;&amp;gt; 0.

  ENDIF.

  CALL METHOD lo_http_client-&amp;gt;receive
    EXCEPTIONS
      http_communication_failure = 1
      http_invalid_state         = 2
      http_processing_failed     = 3.


  IF sy-subrc &amp;lt;&amp;gt; 0.
    CALL METHOD lo_http_client-&amp;gt;get_last_error
      IMPORTING
        code    = l_sysubrc
        message = l_error_text.

    WRITE:/ l_sysubrc,
      / l_error_text.
  ENDIF.

  CLEAR ev_json_output.
  ev_json_output = lo_http_client-&amp;gt;response-&amp;gt;get_cdata( ).

  REPLACE ALL OCCURRENCES OF REGEX '\n' IN ev_json_output WITH space.

  IF ev_json_output IS INITIAL.
    WRITE: / 'faild'.
  ELSE.
    WRITE: / ev_json_output.
  ENDIF.
  CALL METHOD lo_http_client-&amp;gt;close.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; Here is the output：&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1839885-yyixh.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 10:16:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252049#M1986286</guid>
      <dc:creator>former_member701231</dc:creator>
      <dc:date>2020-09-09T10:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP  intergate with  WeChat</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252050#M1986287</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;hulianzhou&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/questions/222748/conection-error-niehostunknown-2-using-clhttpclien.html" target="test_blank"&gt;https://answers.sap.com/questions/222748/conection-error-niehostunknown-2-using-clhttpclien.html&lt;/A&gt;&lt;/P&gt;Kind regards,&lt;BR /&gt;Mateusz</description>
      <pubDate>Wed, 09 Sep 2020 10:22:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252050#M1986287</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-09-09T10:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP  intergate with  WeChat</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252051#M1986288</link>
      <description>&lt;P&gt;You may also want to refer SAP Note &lt;A href="https://launchpad.support.sap.com/#/notes/2735653"&gt;2735653 - Connections under "HTTP Connections to External Server" folder throws error- Connect to &lt;/A&gt;&lt;A href="http://xxxxxx" target="test_blank"&gt;http://xxxxxx&lt;/A&gt; failed:NIEHOST_UNKNOWN(-2)&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 17:53:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252051#M1986288</guid>
      <dc:creator>kartikrajag</dc:creator>
      <dc:date>2020-09-09T17:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP  intergate with  WeChat</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252052#M1986289</link>
      <description>&lt;P&gt;Hi  Mateusz,&lt;/P&gt;&lt;P&gt;                 Thank you  very much.  I'm trying the solution you've provided, and I'm still testing it.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 03:09:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252052#M1986289</guid>
      <dc:creator>former_member701231</dc:creator>
      <dc:date>2020-09-10T03:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP  intergate with  WeChat</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252053#M1986290</link>
      <description>&lt;P&gt;Hi Kartik，&lt;/P&gt;&lt;P&gt;    Thank you very much. I'm trying the solution you've provided, and I'm still testing it.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 03:09:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-intergate-with-wechat/m-p/12252053#M1986290</guid>
      <dc:creator>former_member701231</dc:creator>
      <dc:date>2020-09-10T03:09:47Z</dc:date>
    </item>
  </channel>
</rss>

