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/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Cache-control: private
Transfer-Encoding: chunked
Date: Mon, 07 Jun 2004 14:13:21 GMT
Server: GFE/1.3

2b00
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/1999/XMLSchema";>
<SOAP-ENV:Body>
<ns1:doGoogleSearchResponse xmlns:ns1="urn:GoogleSearch" SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<return xsi:type="ns1:GoogleSearchResult">
<directoryCategories xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/";
xsi:type="ns2:Array" ns2:arrayType="ns1:DirectoryCategory[0]">
</directoryCategories>
<documentFiltering xsi:type="xsd:boolean">false</documentFiltering>
<endIndex xsi:type="xsd:int">10</endIndex>
<estimateIsExact xsi:type="xsd:boolean">false</estimateIsExact>
<estimatedTotalResultsCount
xsi:type="xsd:int">9180</estimatedTotalResultsCount>
<resultElements xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/";
xsi:type="ns3:Array" ns3:arrayType="ns1:ResultElement[10]">
<item xsi:type="ns1:ResultElement">
<URL xsi:type="xsd:string">http://www.comdig.org/hawking.php</URL>
<cachedSize xsi:type="xsd:string">4k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string">&amp;quot;I think the next century will be
the century of &lt;b&gt;complexity&lt;/b&gt;.&amp;quot;. Stephen&lt;br&gt;
&lt;b&gt;Hawking&lt;/b&gt;. Source: SAN JOSE MERCURY NEWS &amp;#39;UNIFIED
THEORY&amp;#39; IS &lt;b&gt;...&lt;/b&gt;  </snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">&lt;b&gt;Complexity&lt;/b&gt; Digest:
&lt;b&gt;Hawking&lt;/b&gt; Quote</title>
</item>
<item xsi:type="ns1:ResultElement">
<URL xsi:type="xsd:string">http://www.comdig.org/resource.php?
source1=Warns+Hawking%2C+Guardian</URL>
<cachedSize xsi:type="xsd:string">6k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string">ComDig Resources Warns
&lt;b&gt;Hawking&lt;/b&gt;, Guardian. First &lt;b&gt;...&lt;/b&gt; Page.
Quote url: http://www.comdig.com/resource.php?
source1=Warns+&lt;b&gt;Hawking&lt;/b&gt;%2C+Guardian
&lt;b&gt;...&lt;/b&gt;  </snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">&lt;b&gt;Complexity&lt;/b&gt; Digest
Resources: Warns &lt;b&gt;Hawking&lt;/b&gt;, Guardian</title>
</item>
<item xsi:type="ns1:ResultElement">
<URL
xsi:type="xsd:string">http://www.hawking.org.uk/lectures/dice.html</URL>
<cachedSize xsi:type="xsd:string">15k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string"> &lt;b&gt;...&lt;/b&gt; audience. But the
trouble is, Laplace was rather like Prewst, in that&lt;br&gt; he wrote
sentences of inordinate length and &lt;b&gt;complexity&lt;/b&gt;. So
&lt;b&gt;...&lt;/b&gt;  </snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">Professor Stephen
&lt;b&gt;Hawking&lt;/b&gt;</title>
</item>
<item xsi:type="ns1:ResultElement">
<URL
xsi:type="xsd:string">http://www.hawking.org.uk/text/public/dice.html</URL>
<cachedSize xsi:type="xsd:string">27k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string"> &lt;b&gt;...&lt;/b&gt; audience. But the
trouble is, Laplace was rather like Prewst, in that&lt;br&gt; he wrote
sentences of inordinate length and &lt;b&gt;complexity&lt;/b&gt;. So
&lt;b&gt;...&lt;/b&gt;  </snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">Professor Stephen
&lt;b&gt;Hawking&lt;/b&gt;</title>
</item>
<item xsi:type="ns1:ResultElement">
<URL
xsi:type="xsd:string">http://clinton4.nara.gov/Initiatives/Millennium/shawk
ing.html</URL>
<cachedSize xsi:type="xsd:string">31k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string"> &lt;b&gt;...&lt;/b&gt; Science in the Next
Millennium Remarks by Stephen &lt;b&gt;Hawking&lt;/b&gt;.
&lt;b&gt;...&lt;/b&gt; The ultimate theory will&lt;br&gt; place no limit
on the &lt;b&gt;complexity&lt;/b&gt; of systems that we can produce and it
is in &lt;b&gt;...&lt;/b&gt;  </snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">Stephen &lt;b&gt;Hawking&lt;/b&gt;</title>
</item>
<item xsi:type="ns1:ResultElement">
<URL
xsi:type="xsd:string">http://clinton4.nara.gov/textonly/Initiatives/Millenn
ium/shawking.html</URL>
<cachedSize xsi:type="xsd:string">24k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string"> &lt;b&gt;...&lt;/b&gt; Instead, I expect
&lt;b&gt;complexity&lt;/b&gt; to increase at a rapid rate, both
in&lt;br&gt; the biological and electronic spheres. &lt;b&gt;...&lt;/b&gt;
Q&amp;amp;As at &lt;b&gt;Hawking&lt;/b&gt; Lecture.
&lt;b&gt;...&lt;/b&gt;  </snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">Stephen &lt;b&gt;Hawking&lt;/b&gt;</title>
</item>
<item xsi:type="ns1:ResultElement">
<URL
xsi:type="xsd:string">http://agelesslearner.com/intros/complexity.html</URL
>
<cachedSize xsi:type="xsd:string">36k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string"> &lt;b&gt;...&lt;/b&gt; I think the next
century will be the century of
&lt;b&gt;complexity&lt;/b&gt;.&amp;quot; ...Stephen&lt;br&gt;
&lt;b&gt;Hawking&lt;/b&gt;. &amp;quot;Ideas thus made up of several simple
ones put &lt;b&gt;...&lt;/b&gt;  </snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">Learn about &lt;b&gt;Complexity&lt;/b&gt; ::
Ageless Learner</title>
</item>
<item xsi:type="ns1:ResultElement">
<URL xsi:type="xsd:string">http://www.complexity-
society.com/digest.htm</URL>
<cachedSize xsi:type="xsd:string">101k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string"> &lt;b&gt;...&lt;/b&gt; resguide/comdig/
(Chinese GB-Code). &amp;quot;I think the next century will&lt;br&gt; be
the century of &lt;b&gt;complexity&lt;/b&gt;.&amp;quot; Stephen
&lt;b&gt;Hawking&lt;/b&gt;. 9 February 2004. &lt;b&gt;...&lt;/b&gt;
</snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">&lt;b&gt;Complexity&lt;/b&gt; Society Digest
2004</title>
</item>
<item xsi:type="ns1:ResultElement">
<URL xsi:type="xsd:string">http://vlad-home-
page.fcpages.com/UWS/MAchaos.html</URL>
<cachedSize xsi:type="xsd:string">22k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string">&amp;quot;I think the 21st century will be
the century of &lt;b&gt;complexity&lt;/b&gt;. &amp;quot; Stephen&lt;br&gt;
&lt;b&gt;Hawking&lt;/b&gt;. &lt;b&gt;COMPLEXITY&lt;/b&gt;, CHAOS and
CREATIVITY. Masters Program &lt;b&gt;...&lt;/b&gt;  </snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">&lt;b&gt;Complexity&lt;/b&gt; and
Chaos</title>
</item>
<item xsi:type="ns1:ResultElement">
<URL xsi:type="xsd:string">http://www.lns.cornell.edu/spr/2001-
06/msg0033443.html</URL>
<cachedSize xsi:type="xsd:string">6k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string"> &lt;b&gt;...&lt;/b&gt; that
&lt;b&gt;Hawking&lt;/b&gt; assigned Laflamme is outlined in the book about
the movie about the&lt;br&gt; book. Regards, George: References: Re:
Universe/Entropy/&lt;b&gt;Complexity&lt;/b&gt; (again): From
&lt;b&gt;...&lt;/b&gt;  </snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">Re:
Universe/Entropy/&lt;b&gt;Complexity&lt;/b&gt; (again)</title>
</item>
</resultElements>
<searchComments xsi:type="xsd:string"></searchComments>
<searchQuery xsi:type="xsd:string">Complexity Hawking</searchQuery>
<searchTime xsi:type="xsd:double">0.216859</searchTime>
<searchTips xsi:type="xsd:string"></searchTips>
<startIndex xsi:type="xsd:int">1</startIndex>
</return>
</ns1:doGoogleSearchResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

0

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/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Cache-control: private
Transfer-Encoding: chunked
Date: Mon, 07 Jun 2004 14:22:18 GMT
Server: GFE/1.3

8ea
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/1999/XMLSchema";>
<SOAP-ENV:Body>
<ns1:doGoogleSearchResponse xmlns:ns1="urn:GoogleSearch" SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<return xsi:type="ns1:GoogleSearchResult">
<directoryCategories xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/";
xsi:type="ns2:Array" ns2:arrayType="ns1:DirectoryCategory[0]">
</directoryCategories>
<documentFiltering xsi:type="xsd:boolean">false</documentFiltering>
<endIndex xsi:type="xsd:int">1</endIndex>
<estimateIsExact xsi:type="xsd:boolean">false</estimateIsExact>
<estimatedTotalResultsCount
xsi:type="xsd:int">9250</estimatedTotalResultsCount>
<resultElements xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/";
xsi:type="ns3:Array" ns3:arrayType="ns1:ResultElement[1]">
<item xsi:type="ns1:ResultElement">
<URL xsi:type="xsd:string">http://www.comdig.org/hawking.php</URL>
<cachedSize xsi:type="xsd:string">4k</cachedSize>
<directoryCategory xsi:type="ns1:DirectoryCategory">
<fullViewableName xsi:type="xsd:string"></fullViewableName>
<specialEncoding xsi:type="xsd:string"></specialEncoding>
</directoryCategory>
<directoryTitle xsi:type="xsd:string"></directoryTitle>
<hostName xsi:type="xsd:string"></hostName>
<relatedInformationPresent
xsi:type="xsd:boolean">true</relatedInformationPresent>
<snippet xsi:type="xsd:string">&amp;quot;I think the next century will be
the century of &lt;b&gt;complexity&lt;/b&gt;.&amp;quot;. Stephen&lt;br&gt;
&lt;b&gt;Hawking&lt;/b&gt;. Source: SAN JOSE MERCURY NEWS &amp;#39;UNIFIED
THEORY&amp;#39; IS &lt;b&gt;...&lt;/b&gt;  </snippet>
<summary xsi:type="xsd:string"></summary>
<title xsi:type="xsd:string">&lt;b&gt;Complexity&lt;/b&gt; Digest:
&lt;b&gt;Hawking&lt;/b&gt; Quote</title>
</item>
</resultElements>
<searchComments xsi:type="xsd:string"></searchComments>
<searchQuery xsi:type="xsd:string">Complexity Hawking</searchQuery>
<searchTime xsi:type="xsd:double">0.389783</searchTime>
<searchTips xsi:type="xsd:string"></searchTips>
<startIndex xsi:type="xsd:int">1</startIndex>
</return>
</ns1:doGoogleSearchResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

0

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???

===================================
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