Skip to Content
author's profile photo
Former Member

Url Connection

<b>Hi,

I need to invoke an url from webdynpro and get the response back from the url and store this response in a variable.</b>

<b>The url:</b> http://inld50026617.blrl.sap.corp:1080/ProjectServer/lgnpsau.asp?un=rpm&pwd=sliadmin

<b>IP Address:</b> 10.53.129.55

<b>If I give this link in the IE directly and hit enter I get the following response:</b>

<?xml version="1.0" ?>

- <Reply>

<HRESULT>0</HRESULT>

- <Cookie>

- <![CDATA[ svc={2A080D24-F2BA-4FF2-B0F2-FF1933F2A08D}&session={0243BAC8- 24CA-49AF-8267-FB6D553E1B52}&prxy={EFBA0018-337F-4A35-9454-E7E1155F92A4} &org=ProjectServer

]]>

</Cookie>

</Reply>

<b>

But when I invoke the url from webdynpro using URLConnection or HttpUrlConnection then I get only</b>

<?xml version="1.0" ?><Reply><HRESULT>5011</HRESULT></Reply>

<b>But I need to get the cookie value.</b>

<b>

If I give the url link as a reference to IFrame control of WebDynpro then it gives the cookie value also with HRESULT 0. But I don't know how to read the data from the IFrame control.</b>

<b>

Can you help me how to get this cookie value?

Thanks and regards

Radha Krishna .B</b>

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on Feb 21, 2005 at 10:42 AM

    Hi Krishna

    I would still encourage you to go the URLConnection way , use a HTTP sniffer to findout the difference between the request created by Web Dypro and the browser, alternatively if you have access to the asp , you can write a small code to write the header and body content of the request into a file and compare the difference. There must be something that the ASP expects which Web Dynpro does not seem to be supplying.

    Regards

    Pran

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Feb 22, 2005 at 11:14 AM

    Hi,

    Quite simple, I guess:

    1. Built-in URLConnection <b>does not</b> handles cookies automatically. So it does not include "Accept-cookie" header in request

    2. Server expect this header, while only cookie-based sessions are available, therefore server replies with error.

    Solution: use something like Apache Jakarta HttpClient http://jakarta.apache.org/commons/httpclient/ for handling conversation with server.

    BUT: first and foremost as Pran suggested explore more details with some http sniffer

    VS

    Add comment
    10|10000 characters needed characters exceeded