Internal Server Error

Discussion in 'ASP .Net' started by Stephen, Nov 16, 2005.

  1. Stephen

    Stephen Guest

    Hi,
    I am using only windows authentication for webpage access (anonymous access
    removed) to read a page. I am using this code to read a page and then use
    the StreamReader to convert the Page to PDF.

    Private Function GetHTML(ByVal sUrl As String) As StreamReader
    Dim oReq As HttpWebRequest
    Dim oResp As HttpWebResponse = Nothing
    Dim lTime As Long = Now.Ticks

    oReq = HttpWebRequest.Create(sUrl)
    oReq.Credentials = CredentialCache.DefaultCredentials ........ <- I
    wonder whether it takes Domain Credentials here
    oResp = oReq.GetResponse ........ here <-System.Net.WebException:
    The remote server returned an error: (500) Internal Server Error

    Dim sr As New StreamReader(oResp.GetResponseStream)
    Return sr
    End Function

    why does this happens? what settings i need to have?
    I guess I have all the right permissions set, I even have <identity
    impersonate = "true"> if i set it to "false", I get insufficient permissions
    message.

    Please Advice,
    Stephen
     
    Stephen, Nov 16, 2005
    #1
    1. Advertising

  2. Stephen

    Bruce Barker Guest

    you need to switch to Kerberos security and enable credentials forwarding.

    see:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;810572


    -- bruce (sqlwork.com)




    "Stephen" <> wrote in message
    news:...
    > Hi,
    > I am using only windows authentication for webpage access (anonymous
    > access
    > removed) to read a page. I am using this code to read a page and then use
    > the StreamReader to convert the Page to PDF.
    >
    > Private Function GetHTML(ByVal sUrl As String) As StreamReader
    > Dim oReq As HttpWebRequest
    > Dim oResp As HttpWebResponse = Nothing
    > Dim lTime As Long = Now.Ticks
    >
    > oReq = HttpWebRequest.Create(sUrl)
    > oReq.Credentials = CredentialCache.DefaultCredentials ........ <- I
    > wonder whether it takes Domain Credentials here
    > oResp = oReq.GetResponse ........ here <-System.Net.WebException:
    > The remote server returned an error: (500) Internal Server Error
    >
    > Dim sr As New StreamReader(oResp.GetResponseStream)
    > Return sr
    > End Function
    >
    > why does this happens? what settings i need to have?
    > I guess I have all the right permissions set, I even have <identity
    > impersonate = "true"> if i set it to "false", I get insufficient
    > permissions
    > message.
    >
    > Please Advice,
    > Stephen
    >
    >
     
    Bruce Barker, Nov 16, 2005
    #2
    1. Advertising

  3. Stephen

    Stephen Guest

    Thanks Bruce,
    The article was good and solved the problem.
    Stephen

    "Bruce Barker" <> wrote in message
    news:ucgmK%...
    > you need to switch to Kerberos security and enable credentials forwarding.
    >
    > see:
    >
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;810572
    >
    >
    > -- bruce (sqlwork.com)
    >
    >
    >
    >
    > "Stephen" <> wrote in message
    > news:...
    > > Hi,
    > > I am using only windows authentication for webpage access (anonymous
    > > access
    > > removed) to read a page. I am using this code to read a page and then

    use
    > > the StreamReader to convert the Page to PDF.
    > >
    > > Private Function GetHTML(ByVal sUrl As String) As StreamReader
    > > Dim oReq As HttpWebRequest
    > > Dim oResp As HttpWebResponse = Nothing
    > > Dim lTime As Long = Now.Ticks
    > >
    > > oReq = HttpWebRequest.Create(sUrl)
    > > oReq.Credentials = CredentialCache.DefaultCredentials ........ <-

    I
    > > wonder whether it takes Domain Credentials here
    > > oResp = oReq.GetResponse ........ here <-System.Net.WebException:
    > > The remote server returned an error: (500) Internal Server Error
    > >
    > > Dim sr As New StreamReader(oResp.GetResponseStream)
    > > Return sr
    > > End Function
    > >
    > > why does this happens? what settings i need to have?
    > > I guess I have all the right permissions set, I even have <identity
    > > impersonate = "true"> if i set it to "false", I get insufficient
    > > permissions
    > > message.
    > >
    > > Please Advice,
    > > Stephen
    > >
    > >

    >
    >
     
    Stephen, Nov 16, 2005
    #3
  4. Stephen

    brinda

    Joined:
    Sep 7, 2010
    Messages:
    2
    Problem In Web Service.Internal Server Error

    I receive Problem in Web Service :internal Server Error when i click The Link in Grid .
    But Web Service works fine.
    Pl Help


    function CellClick(tableName,itemName, Btn)
    {
    var column =igtbl_getColumnById(itemName);
    var oRow = igtbl_getRowById(itemName);
    cnt = oRow.getCell(4).getValue();
    StyleId = oRow.getCell(5).getValue();
    if(column.Key=="Style")
    {
    cellobj = igtbl_getElementById(itemName);
    cellobj.style.cursor = 'wait';
    var x;
    if(clickval==0) {
    clickval=1;
    window.status='Waiting for Page...';
    LoadXmlForEncryption(CommonServiceUrl + '/common.asmx/GetEncryptString?InputString=' + StyleId);
    }
    }
    }

    function LoadXmlForEncryption(url)
    {
    // branch for native XMLHttpRequest object
    //code for Mozilla, etc
    if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
    req.onreadystatechange = GetEncryptString();
    req.open("GET", url, true);
    req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
    isIE = true;
    req = new ActiveXObject("Microsoft.XMLHTTP")
    if (req) {
    req.onreadystatechange = GetEncryptString
    req.open("GET", url, true)
    req.send()
    }
    }
    }

    function GetEncryptString()
    {
    if (req.readyState == 4) {
    if (req.status == 200) {
    response = req.responseXML.documentElement;
    EncStr = response.getElementsByTagName('OutputString')[0].firstChild.data;
    LoadXmlForDocLock(CommonServiceUrl + '/common.asmx/LockEntry?sDocNo=' + StyleId + '&sPrefix=STY&sMisc=' + 'StyleEntry.aspx' + '&ToInsert=True');
    } else {
    alert("Problem in Web Service :\n" + req.statusText);
    DefaultCursor();
    }
    }

    }
     
    brinda, Sep 7, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Bonds
    Replies:
    2
    Views:
    2,769
    Amaryllis
    Aug 3, 2004
  2. =?Utf-8?B?RGFubnk=?=
    Replies:
    1
    Views:
    1,127
    Joerg Jooss
    Dec 3, 2005
  3. Replies:
    5
    Views:
    80,393
    cpdarkman
    Aug 26, 2009
  4. BobbyOwens
    Replies:
    0
    Views:
    4,664
    BobbyOwens
    Jan 23, 2009
  5. Replies:
    0
    Views:
    776
Loading...

Share This Page