Login  
Search All Forums
Dart Home | PowerTCP Web for ActiveX | Custom Development Reply | PowerTCP Web for ActiveX Topics | Forums   
AuthorForum: PowerTCP Web for ActiveX
Topic: Incomplete page data returned from server
adgooroo
rich@adgooroo.com

From: Chicago, IL USA
Posts: 7
Member Since: 03/15/04
posted March 15, 2004 5:51 PM

Hi everyone,

This has got me stumped, I hope someone here has an idea...

I am using the webtool to query (via POST) my Google AdWords account over SSL. Most of the time, the results come back perfect. However, on one particular page, I frequently get the following from the server:

<html> <head>

and then the data stops! The webtool control doesn't give an error. To get around this, I simply waited 10 seconds and tried again, but now we're querying some larger pages and this doesn't seem to be working.

Any ideas?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted March 15, 2004 10:17 PM

The only thing I can think of is that the server sent the little bit of data and then closed for some reason. That would explain getting no error as we would just assume that that was it for the page.

If you can give me a way to duplicate this I may be able to offer more.
adgooroo
rich@adgooroo.com

From: Chicago, IL USA
Posts: 7
Member Since: 03/15/04
posted March 15, 2004 10:43 PM

That does seem to be a reasonable hypothesis.

I could get you an install package that demonstrates the problem, but you'll need an active AdWords account to duplicate.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted March 15, 2004 10:48 PM

I meant that if there was some way you could narrow it down to something reproducible that did not involve your specific scenario.

I was thinking more along the lines of you finding a site that fails when using our pagefetch sample.

If you really need us to troubleshoot your app, you'll need to contact us outside of the forum to discuss other support options.

Thanks.
adgooroo
rich@adgooroo.com

From: Chicago, IL USA
Posts: 7
Member Since: 03/15/04
posted March 17, 2004 4:43 PM

Ok, here's my code...

============================================

        Http1.Url = URL

        If CheckHeader() Then
          If GetPage(PostData) Then
            HTML = m_sContent
            PostError = False
            If HTML.Length > 300 Then
              bLoadSuccessful = True  
          End If
        End If

============================================

the above code frequently bombs because the length is 20. The HTML returned is "<html><head>" (and some undisplayable characters).

Drilling down a little deeper, here's my getpage() routine:

============================================
Private Function GetPage(Optional ByVal PostData As String = "") As Boolean
    On Error GoTo OnError

    If PostData = "" Then
      ' If Request Headers are specified use GetEx
      If m_oRequestHeader.Count > 0 Then
        GUI.HTTP1.GetEx(m_oRequestHeader, m_sContent, m_oResponseHeader)
      Else
        GUI.Http1.Timeout = 20000
'I am developing in .NET so I'm using a DartStream as per the documentation.
        Dim dotnetworkaround As New DartSock.DartStream
        GUI.Http1.Get(dotnetworkaround, m_oResponseHeader)
        dotnetworkaround.Position = 0
        m_sContent = dotnetworkaround.ReadString()
        'try again.
        If m_sContent.Length < 300 Then
'It bombs here because of the same problem.
          end if
        dotnetworkaround = Nothing
        End If
    Else
        GUI.Http1.Post(PostData, , m_sContent)
    End If

    ' If there was no error, return true
    GetPage = True
    System.Diagnostics.Debug.WriteLine("LENGTH: " & CStr(Len(m_sContent)))
    Exit Function
OnError:
    Mediator.Instance.Log("Page Load Error: " & Err.Number & ": " & Err.Description)
    GetPage = False
  End Function

============================================

Any thoughts?



adgooroo
rich@adgooroo.com

From: Chicago, IL USA
Posts: 7
Member Since: 03/15/04
posted March 17, 2004 4:46 PM

A couple of other data points for you ...

1. I'm not POSTing data, it's a straight URL query.
2. It's using https

-Rich
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted March 17, 2004 4:52 PM

I'm sorry but I don't see anything obvious in here that would point me to your problem. At this point I would suggest contacting us directly (support@dart.com or 315-790-5456) to discuss other support options.
adgooroo
rich@adgooroo.com

From: Chicago, IL USA
Posts: 7
Member Since: 03/15/04
posted March 17, 2004 4:53 PM

Ah ha ... even more data for you...

the responseheader object had the following in it:

--------------------------------
Content-Type: text/html; charset=ISO-8859-1
Cache-control: private
Content-length: 20
Date: Wed, 17 Mar 2004 21:48:00 GMT
Server: GFE/1.3
--------------------------------

The 'content-length: 20' suggests to me that the server is actually sending us an empty document... is this correct? Why could this be happening?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted March 17, 2004 4:55 PM

Please see my response immediately before your last post.
adgooroo
rich@adgooroo.com

From: Chicago, IL USA
Posts: 7
Member Since: 03/15/04
posted March 17, 2004 5:19 PM

Not so quick on closing this support ticket, my friend!

I may have gotten to the bottom of it, and it may be due to improper coding of the sample that ships with the control.

I modified the above code to perform a 2nd http1.get() immediately after the first one (the one that returns only 20 characters). 

The code then worked.

What happened? The header returned from the first get() that I posted above indicates a successful fetch of 20 characters. The second get() returned a different header:

-----------------------------------
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Cache-control: private
Date: Wed, 17 Mar 2004 22:14:03 GMT
Server: GFE/1.3
-----------------------------------

This get() also returned all of the data.

What I believe is happening is that the sample code does not correctly handle chunked requests. It should, if I understand the protocol correctly, be looping through until the data stops.

Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted March 17, 2004 5:23 PM

It's more likely that the WININET.DLL component (which we use in the WebTool) does not do chunking. Try the WebASP control that comes with the WebEnterprise kit and see if that has the same problem. That doesn't use WININET. There is a sample that is identical to the one you are using except that it uses the WebASP control.
adgooroo
rich@adgooroo.com

From: Chicago, IL USA
Posts: 7
Member Since: 03/15/04
posted March 17, 2004 5:40 PM

Why on earth would Dart offer two different controls to do similar things, but one without standard http 1.1 capability (ie: chunking)? After all, I bought this control due to Dart's claims that it could handle all HTTP/SSL transfers.

This is leaving me in a bit a predicament. My beta program has been stuck for three weeks around this issue, and when I've finally managed to track it down myself, I'm told I have to buy a different, more expensive component?

I realize that this isn't anybody's fault, but I'm in a bit of a predicament now. Would you be willing to upgrade me to this component free of charge? This is going to force me to rewrite and test all of my code ...

Rich

Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted March 17, 2004 6:54 PM

We made the WebASP control for people who wanted to do more complictated things with cookies and sessions and to use in ASP, since MS recommends not using WININET in ASP.

If you can give me the url of a site that does the chunking that causes the Pagefetch sample to fail, I can see what I can do.

Reply | PowerTCP Web for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX