It would be strange for the proxy to be unable to handle "chunked" data -- handling 
chunked encoding is a requirement of HTTP 1.1.  The .NET docn re HTTP says that it 
"supports chunking" -- but I don't know why you'd see those length strings (including 
the trailing "0") given that's the case.  But you seem to have "stepped in" at a low 
level to grab the raw response, so perhaps the code to handle chunked responses hasn't 
happened yet.

I'm not certain where your Google and googleCall classes came from -- did you download 
an assembly from Google, or did you generate a proxy class from WSDL that Google 
provides?

You could try digging down a bit and see if you can set the ProtocolVersion property 
of the underlying HttpWebRequest to HttpVersion.Version10 before the request is sent 
to Google; that should prevent the response from coming back with "chunked" encoding 
(as it's HTTP 1.1 that defines the protocol).

But the text saying that .NET "supports chunking" implies that the data read from the 
stream returned by HttpWebRequest.Response.GetResponseStream has the chunked encoding 
removed.  I haven't determined one way or another whether that's true.

Good luck...

At 10:16 AM 6/15/2004, Nicholas Nicoloudis wrote
>Here is the code:
>
>Google.GoogleSearchResult gsrResult =
>googleCall.doGoogleSearch(googleAccount,page.Name,0,1,page.Filter,page.R
>estrictions,page.SafeSearch,"","","");
>
>You should get a GoogleSearchResult, however since the proxy class fails
>to render the returned type by default it returns and XmlElement array.
>I would love to modify the way the data is transmitted, however you do
>no have access to those properties from the SoapHttpClient.
>
>As for your question about having 0 to terminate the message, I agree!
>However I think the SoapHttpClient looks for the Content-Length rather
>than the 0 at the end chunked call.  So the SoapHttpClient is not
>parsing the message properly.  And what it does sometimes is read the
>first chunked message and appends it to the end, so you end up with 1.5
>messages which is a malformed Soap envelope. It could be an internal
>class like the SoapMessage class causing the error, however I can not
>debug to that level.  Hopefully I have clarified my problem.
>
>-----Original Message-----
>From: Unmoderated discussion of advanced .NET topics.
>[mailto:[EMAIL PROTECTED] On Behalf Of J. Merrill
>Sent: Tuesday, 15 June 2004 11:28 AM
>To: [EMAIL PROTECTED]
>Subject: Re: [ADVANCED-DOTNET] SoapHttpClientProtocol doing strange
>things with 3rd party web services
>
>You say you're getting a particular exception in some .NET code, but you
>give us any of your code.  You think you should get a
>GoogleSearchResult; that must mean that you've generated a proxy from
>the Google WSDL, and are calling one of its methods.  Are you doing that
>in both cases?
>
>You said [quote] How ever, I use my application where I use exact web
>proxy, all I do is change the user agent name: [end quote].  Is "exact
>web proxy" a software product?  How are you changing the "user agent
>name"?
>
>Without knowing what "exact web proxy" means, and not having even one
>line of your .NET code, it's hard to help.
>
>At least part of what you wrote is a red herring.  "Transfer-Encoding:
>chunked" means that the data comes back in multiple sections.  The
>"2b00" and "8ea" at the beginning the respective results (after the
>headers), and the "0" on a line by itself at the end of each, are the
>lengths of the multiple "chunks" received.  There's no issue with
>knowing when everything is received; when a "chunk" with a length of 0
>is received, you're done.  You must not be seeing the "raw" SOAP
>responses in your code; if you were, you'd need to deal with the
>chunk-encoded data.  What .NET class is doing the work of turning the
>SOAP result into a GoogleSearchResult in one case, and an XMLTreeNode in
>the other?
>
>At 10:33 AM 6/7/2004, Nick wrote
>>Hi Guys,
>>
>>I'm really stuck on this problem and I am hoping somone has a quick
>fix,
>>only because I'll have to write my own hack if required.  So, what I'm
>>doing is simply calling the google web service.  I've been stuck on
>this
>>problem for a while.  I receive a "Specified Cast Exception".  When I
>>investigate further, the type returned is an XmlTreeNode, where it
>should
>>be a GoogleSearchResult. I programmed a seperate .NET application that
>>calls the web service and it works no problem.  My application
>dynamically
>>loads an assembly which invokes the Google web service proxy.  What I
>have
>>done is captured the SOAP calls, the following is what happens when I
>call
>>it from my test application:
>>[HTTP headers, chunked SOAP response removed]
>>This is a successful find, so all is good.  How ever, I use my
>application
>>where I use exact web proxy, all I do is change the user agent name:
>>[HTTP headers, chunked SOAP response removed]
>>
>>This example shows that they are exactly the same.  Now, the first one
>>worked and the second one didn't.  Why, your guess is as good as mine.
>>However, what I have noticed is that there is no content length
>attatched,
>>which leaved the soap proxy guessing when the call is finished.
>However,
>>it manages the first call ok but falls over on the second one.  Is this
>>possibly something to do with threading? Is there a thread waiting and
>it
>>never fires back?  I've notified Google, but I don't think they really
>>care since everyone else is ok.  Any quick fixes???


J. Merrill / Analytical Software Corp

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to