<?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: CL_HTTP_CLIENT authentication and data hosts are not same in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024036#M1498394</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mr. Thomas I know how to read the values if it returns any value into cookies internal table. But it returns the cookies internal table with null value . I see the values when i set the attribute IF_HTTP_CLIENT&lt;SUB&gt;PROPERTYTYPE_ACCEPT_COOKIE of the client instance with value IF_HTTP_CLIENT&lt;/SUB&gt;CO_PROMPT in foreground.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 04 Jul 2010 15:45:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-04T15:45:43Z</dc:date>
    <item>
      <title>CL_HTTP_CLIENT authentication and data hosts are not same</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024032#M1498390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have to call login.ford.com.tr for authentication with u2018https://login.xxx.com/authenticate.aspx?userid=&amp;amp;password=u2019&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i have to call u2018https://fosnapp.xxx.com/get_orders.aspx?order_id=u2018     to get data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you see the host name of this two address is different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i create two CL_HTTP_CLIENT instance for each link ( http_authentication and http_data ) in my program. I could not get any data by http_data instance. (I think this is normal because each instance creates its own session)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i create only one instance for u2018https://fosnapp.xxx.comu2019 than call two link by this instance. It gives error that says you are not logged in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is summary of my code. What can i do for this complex case? Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Musa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method cl_http_client=&amp;gt;create_by_url&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    url                = lv_url&lt;/P&gt;&lt;P&gt;    SSL_ID             = 'XXX'&lt;/P&gt;&lt;P&gt;  importing&lt;/P&gt;&lt;P&gt;    client             = http_client&lt;/P&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;    argument_not_found = 1&lt;/P&gt;&lt;P&gt;    plugin_not_active  = 2&lt;/P&gt;&lt;P&gt;    internal_error     = 3&lt;/P&gt;&lt;P&gt;    others             = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  http_client-&amp;gt;request-&amp;gt;set_header_field( name  = '~request_method'&lt;/P&gt;&lt;P&gt;                             value = 'POST' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD http_client-&amp;gt;REQUEST-&amp;gt;SET_HEADER_FIELD&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      NAME  = '~request_uri'&lt;/P&gt;&lt;P&gt;      VALUE = lv_login_all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method http_client-&amp;gt;send&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      http_communication_failure = 1&lt;/P&gt;&lt;P&gt;      http_invalid_state         = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method http_client-&amp;gt;receive&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      http_communication_failure = 1&lt;/P&gt;&lt;P&gt;      http_invalid_state         = 2&lt;/P&gt;&lt;P&gt;      http_processing_failed     = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gv_str = http_client-&amp;gt;response-&amp;gt;get_cdata( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD http_client-&amp;gt;REQUEST-&amp;gt;SET_HEADER_FIELD&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      NAME  = '~request_uri'&lt;/P&gt;&lt;P&gt;      VALUE = lv_data_url.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method http_client-&amp;gt;send&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      http_communication_failure = 1&lt;/P&gt;&lt;P&gt;      http_invalid_state         = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method http_client-&amp;gt;receive&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      http_communication_failure = 1&lt;/P&gt;&lt;P&gt;      http_invalid_state         = 2&lt;/P&gt;&lt;P&gt;      http_processing_failed     = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gv_str = http_client-&amp;gt;response-&amp;gt;get_cdata( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: MusaCEBE on Jun 16, 2010 9:58 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jun 2010 07:58:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024032#M1498390</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-16T07:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: CL_HTTP_CLIENT authentication and data hosts are not same</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024033#M1498391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not a Web Dynpro related question and therefore doesn't belong in this form.  I am moving it to ABAP general.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You definetely can't use two different instances of CL_HTTP_CLIENT (as you found out) as you would have two different sessions and authentication can't be shared between them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise I can't say why you aren't getting authenticated.  You should be able to change URLs between calls as you have done.  What authentication mechanism is the site using?  Some form of cookie based authentication.  Do you have your CL_HTTP_CLIENT set to accept cookies?  Can you look at the request/response object in the debugger and see the cookie?  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is really difficult to speculate further without knowing more about the authentication mechanism being used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jun 2010 12:33:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024033#M1498391</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2010-06-16T12:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: CL_HTTP_CLIENT authentication and data hosts are not same</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024034#M1498392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mr. Thomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How  can i get the values into a variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see the cookie value byi debugging http_client-&amp;gt;receive_cookies method while i call receive method of http_client.&lt;/P&gt;&lt;P&gt;But  i can not get the values into program variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used http_client-&amp;gt;response-&amp;gt;get_cookies(       changing cookies = cookies ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Musa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 12:52:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024034#M1498392</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-01T12:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: CL_HTTP_CLIENT authentication and data hosts are not same</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024035#M1498393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;But i can not get the values into program variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure what you mean.  Get cookies returns an internal table. You can loop through that or perform a READ with key NAME = &amp;lt;the name of the cookie you are looking for).  The value will be in the VALUE column of the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 17:18:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024035#M1498393</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2010-07-01T17:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: CL_HTTP_CLIENT authentication and data hosts are not same</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024036#M1498394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mr. Thomas I know how to read the values if it returns any value into cookies internal table. But it returns the cookies internal table with null value . I see the values when i set the attribute IF_HTTP_CLIENT&lt;SUB&gt;PROPERTYTYPE_ACCEPT_COOKIE of the client instance with value IF_HTTP_CLIENT&lt;/SUB&gt;CO_PROMPT in foreground.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Jul 2010 15:45:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024036#M1498394</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-04T15:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: CL_HTTP_CLIENT authentication and data hosts are not same</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024037#M1498395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi MusaCEBE and Mr. Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing the same problem as you did. Can you please tell me, how did you solved it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 05:12:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024037#M1498395</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-23T05:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: CL_HTTP_CLIENT authentication and data hosts are not same</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024038#M1498396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi i could not solve the problem with abap. We developed another application by using another programming language for this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i think you should create an instance for authantication. After authantication you should get the cookies . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then create a new instance for other link and before send and receive methods set cookies ( which you got from authantication session ) for other link in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We did not have enough time to solve this in ABAP. Hope you will solve. If you solve please let me know how you have solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code(another programming language), may be it will help you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;req = (HttpWebRequest)WebRequest.Create(@"https://login.xxx.com/authenticate.aspx?userid=xxx&amp;amp;password=xxx");&lt;/P&gt;&lt;P&gt;      req.CookieContainer = cc;&lt;/P&gt;&lt;P&gt;      HttpWebResponse httpResponse = (HttpWebResponse)req.GetResponse();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(@"https://yyy.com/postxml.aspx");&lt;/P&gt;&lt;P&gt;      httpRequest.CookieContainer = cc;&lt;/P&gt;&lt;P&gt;      httpRequest.Method = "POST";&lt;/P&gt;&lt;P&gt;      httpRequest.ContentType = "text/xml";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: MusaCEBE on Sep 23, 2010 4:34 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 14:34:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-http-client-authentication-and-data-hosts-are-not-same/m-p/7024038#M1498396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-23T14:34:39Z</dc:date>
    </item>
  </channel>
</rss>

