axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashutosh Kumar <meetashut...@gmail.com>
Subject Re: Failure of Google Search API web service using Axis
Date Tue, 17 Jan 2006 11:50:28 GMT
Hi Adrian,
The SOAP request that is being send is as follows
**********************************************************


POST /search/beta2 HTTP/1.1

Host: api.google.com:80.

Content-Type: text/xml; charset=UTF-8

SOAPAction: "urn:GoogleSearchAction"

Content-Length: 784



<?xml version='1.0' encoding='utf-8' ?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">

<SOAP-ENV:Body>

<ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch">

<filter xsi:type="xsd:boolean">true</filter>

<key xsi:type="xsd:string">GOOGLE LICENCE KEY</key>

<restrict xsi:type="xsd:string"></restrict>

<start xsi:type="xsd:int">0</start>

<ie xsi:type="xsd:string">UTF-8</ie>

<safeSearch xsi:type="xsd:boolean">true</safeSearch>

<lr xsi:type="xsd:string">lang_en</lr>

<maxResults xsi:type="xsd:int">10</maxResults>

<oe xsi:type="xsd:string">UTF-8</oe>

<q xsi:type="xsd:string">QUERY TERM</q>

</ns1:doGoogleSearch>
</SOAP-ENV:Body>

After sending this request the program continues but does not recieve any
response. So when it tries to compare the value of "doGoogleSearchResponse",
parameter of checkmessage() function with that of the response, because of
no response it finds the value as default and therefore raise the exception.
Please check the SOAP request going to the Google Server and tell me if
there is any flaw in it. Please also let me know the reason as well as the
solution for the problem. The wsdl file I am using is already with you.

Thanks & Regards
Ashutosh Kumar



On 1/17/06, Adrian Dick <adrian.dick@uk.ibm.com> wrote:
>
> Hi,
>
>
> I need the "on-the-wire" request/response messages to fully determine the
> problem.
>
> However, based on your description it sounds like you received a Fault
> back
> from the server, rather than the expected response.  This will cause an
> exception to be thrown, but the generated stub should be catching this,
> determining it's a Fault and deserializing the fault.
>
> In turn this will be thrown and should be caught by your application.
> As your WSDL (below) doesn't specify any Faults you will need to catch
> "OtherFaultException".  Using the method getFaultDetail on this will give
> the contents of the fault detail received.
>
> Knowing the detail returned in the Fault will aid in diagnosing the
> problem, but having the request/responses messages will be particularly
> useful.
>
> Adrian
> _______________________________________
> Adrian Dick (adrian.dick@uk.ibm.com)
>
>
> Ashutosh Kumar <meetashutosh@gmail.com> wrote on 17/01/2006 09:34:28:
>
> > Hi Adrian,
> > I am using "axis-c-src-1-5-win32" for my project and I am getting
> > "abnormal termination of program" when using Google Search API in my
> > C++ code generated using Axis, GoogleSearch.wsdl (copy of which is
> > enclosed here with the mail) and Eclipse to generate client side
> > stubs. In the project when I am calling
> > m_pcall->checkMessage("doGoogleSearchResponse", "urn:GoogleSearch");
> >
> > Inside this function,
> >
> > soapdeserialiser::checkmessagebody() function is called and inside
> > this function, the condition
> >
> > if (0 != strcmp (m_pNode->m_pchNameOrValue, pName))
> >
> > fails as the value stored in
> >
> > m_pNode->m_pchNameOrValue = "Fault"  & pName =
> > "doGoogleSearchResponse". This leads to exception and untimely
> > termination of the program. I need to know when does this "m_pnode"
> > gets popultated and this value Fault is coming from the wsdl file or
> > is getting populated while execution of the program.
> >
> > The wsdl file being used is
> > ******************************
> >   <?xml version="1.0" ?>
> > - <!--
> >  WSDL description of the Google Web APIs.
> >      The Google Web APIs are in beta release. All interfaces are subject
> to
> >      change as we refine and extend our APIs. Please see the terms of
> use
> >      for more information.
> >   -->
> > - <!--
> >  Revision 2002-08-16
> >   -->
> > - <definitions name="GoogleSearch " targetNamespace="urn:GoogleSearch "
> > xmlns:typens="urn:GoogleSearch " xmlns:xsd="
> http://www.w3.org/2001/XMLSchema"
> > xmlns:soap=" http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="
> > http://schemas.xmlsoap.org/soap/encoding/ " xmlns:wsdl=" http:
> > //schemas.xmlsoap.org/wsdl/" xmlns ="http://schemas.xmlsoap.org/wsdl/" >
> > - <!--
> >  Types for search - result elements, directory categories
> >   -->
> > - <types>
> > - <xsd:schema xmlns=" http://www.w3.org/2001/XMLSchema" targetNamespace
> ="
> > urn:GoogleSearch">
> > - <xsd:complexType name="GoogleSearchResult ">
> > - <xsd:all>
> >   <xsd:element name="documentFiltering" type="xsd:boolean" />
> >   <xsd:element name="searchComments" type="xsd:string" />
> >   <xsd:element name="estimatedTotalResultsCount" type="xsd:int" />
> >   <xsd:element name="estimateIsExact" type="xsd:boolean" />
> >   <xsd:element name="resultElements" type="typens:ResultElementArray" />
> >   <xsd:element name="searchQuery" type="xsd:string" />
> >   <xsd:element name="startIndex" type="xsd:int" />
> >   <xsd:element name="endIndex" type="xsd:int" />
> >   <xsd:element name="searchTips" type="xsd:string" />
> >   <xsd:element name="directoryCategories"
> type="typens:DirectoryCategoryArray
> > " />
> >   <xsd:element name="searchTime" type="xsd:double" />
> >   </xsd:all >
> >   </xsd:complexType >
> > - <xsd:complexType name="ResultElement ">
> > - <xsd:all>
> >   <xsd:element name="summary" type="xsd:string" />
> >   <xsd:element name="URL" type="xsd:string" />
> >   <xsd:element name="snippet" type="xsd:string" />
> >   <xsd:element name="title" type="xsd:string" />
> >   <xsd:element name="cachedSize" type="xsd:string" />
> >   <xsd:element name="relatedInformationPresent" type="xsd:boolean" />
> >   <xsd:element name="hostName" type="xsd:string" />
> >   <xsd:element name="directoryCategory" type="typens:DirectoryCategory"
> />
> >   <xsd:element name="directoryTitle" type="xsd:string" />
> >   </xsd:all >
> >   </xsd:complexType >
> > - <xsd:complexType name="ResultElementArray ">
> > - <xsd:complexContent>
> > - <xsd:restriction base="soapenc:Array ">
> >   <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:
> > ResultElement[]" />
> >   </xsd:restriction >
> >   </xsd:complexContent >
> >   </xsd:complexType >
> > - <xsd:complexType name="DirectoryCategoryArray ">
> > - <xsd:complexContent>
> > - <xsd:restriction base="soapenc:Array ">
> >   <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:
> > DirectoryCategory[]" />
> >   </xsd:restriction >
> >   </xsd:complexContent >
> >   </xsd:complexType >
> > - <xsd:complexType name="DirectoryCategory ">
> > - <xsd:all>
> >   <xsd:element name="fullViewableName" type="xsd:string" />
> >   <xsd:element name="specialEncoding" type="xsd:string" />
> >   </xsd:all >
> >   </xsd:complexType >
> >   </xsd:schema >
> >   </types >
> > - <!--
> >  Messages for Google Web APIs - cached page, search, spelling.
> >   -->
> > - <message name="doGetCachedPage ">
> >   <part name="key" type="xsd:string" />
> >   <part name="url" type="xsd:string" />
> >   </message >
> > - <message name="doGetCachedPageResponse ">
> >   <part name="return" type="xsd:base64Binary" />
> >   </message >
> > - <message name="doSpellingSuggestion ">
> >   <part name="key" type="xsd:string" />
> >   <part name="phrase" type="xsd:string" />
> >   </message >
> > - <message name="doSpellingSuggestionResponse ">
> >   <part name="return" type="xsd:string" />
> >   </message >
> > - <!--
> >  note, ie and oe are ignored by server; all traffic is UTF-8.
> >   -->
> > - <message name="doGoogleSearch ">
> >   <part name="key" type="xsd:string" />
> >   <part name="q" type="xsd:string" />
> >   <part name="start" type="xsd:int" />
> >   <part name="maxResults" type="xsd:int" />
> >   <part name="filter" type="xsd:boolean" />
> >   <part name="restrict" type="xsd:string" />
> >   <part name="safeSearch" type="xsd:boolean" />
> >   <part name="lr" type="xsd:string" />
> >   <part name="ie" type="xsd:string" />
> >   <part name="oe" type="xsd:string" />
> >   </message >
> > - <message name="doGoogleSearchResponse ">
> >   <part name="return" type="typens:GoogleSearchResult" />
> >   </message >
> > - <!--
> >  Port for Google Web APIs, "GoogleSearch"
> >   -->
> > - <portType name="GoogleSearchPort ">
> > - <operation name="doGetCachedPage ">
> >   <input message="typens:doGetCachedPage" />
> >   <output message="typens:doGetCachedPageResponse" />
> >   </operation >
> > - <operation name="doSpellingSuggestion ">
> >   <input message="typens:doSpellingSuggestion" />
> >   <output message="typens:doSpellingSuggestionResponse" />
> >   </operation >
> > - <operation name="doGoogleSearch ">
> >   <input message="typens:doGoogleSearch" />
> >   <output message="typens:doGoogleSearchResponse" />
> >   </operation >
> >   </portType >
> > - <!--
> >  Binding for Google Web APIs - RPC, SOAP over HTTP
> >   -->
> > - <binding name="GoogleSearchBinding " type="typens:GoogleSearchPort ">
> >   <soap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http
> > " />
> > - <operation name="doGetCachedPage ">
> >   <soap:operation soapAction="urn:GoogleSearchAction" />
> > - <input>
> >   <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle ="
> > http://schemas.xmlsoap.org/soap/encoding/" />
> >   </input >
> > - <output>
> >   <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle ="
> > http://schemas.xmlsoap.org/soap/encoding/" />
> >   </output >
> >   </operation >
> > - <operation name="doSpellingSuggestion ">
> >   <soap:operation soapAction="urn:GoogleSearchAction" />
> > - <input>
> >   <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle ="
> > http://schemas.xmlsoap.org/soap/encoding/" />
> >   </input >
> > - <output>
> >   <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle ="
> > http://schemas.xmlsoap.org/soap/encoding/" />
> >   </output >
> >   </operation >
> > - <operation name="doGoogleSearch ">
> >   <soap:operation soapAction="urn:GoogleSearchAction" />
> > - <input>
> >   <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle ="
> > http://schemas.xmlsoap.org/soap/encoding/" />
> >   </input >
> > - <output>
> >   <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle ="
> > http://schemas.xmlsoap.org/soap/encoding/" />
> >   </output >
> >   </operation >
> >   </binding >
> > - <!--
> >  Endpoint for Google Web APIs
> >   -->
> > - <service name="GoogleSearchService ">
> > - <port name="GoogleSearchPort " binding="typens:GoogleSearchBinding ">
> >   <soap:address location="http://api.google.com/search/beta2 " />
> >   </port >
> >   </service >
> >   </definitions >
> > ***************************************
> >
> > Please reply with the probable solution and also with the reason how
> > this value Fault is coming into picture.
> >
> > Thanks & Regards
> > Ashutosh
> >
> >
> > On 1/16/06, Adrian Dick <adrian.dick@uk.ibm.com> wrote:
> > Hi,
> >
> > This sounds like the received message doesn't match the expected.
> >
> > Can you capture the server response message?  Then it will be possible
> to
>
> > compare with the WSDL and generated stubs for the expected response.
> > ( You can use org.apache.axis.utils.tcpmon, within axis.jar, as part of
> the
> > WSDL2Ws tooling).
> >
> > Also, can you confirm which version of Axis C++ you're using.
> >
> > Adrian
> > _______________________________________
> > Adrian Dick (adrian.dick@uk.ibm.com)
> >
> >
> > Ashutosh Kumar <meetashutosh@gmail.com > wrote on 16/01/2006 09:57:09:
> >
> > > Hi !
> > > I am trying to call google search api in my c++ clinet code
> > > generated using GoogleSearch.wsdl, axis and eclipse. The query being
> > > made is as follows
> > >
> > > doGoogleSearch(true,license key,"",0,utf-8,true,"",10,utf-8,query
> term);
> > >
> > > which in turn is calling GoogleSearchPort::doGoogleSearch() and
> > > inside this function it is failing while calling
> > >
> > > m_pCall->checkMessage("doGoogleSearchResponse", "urn:GoogleSearch").
> > >
> > > The Debug error that I am getting is "abnormal program termination".
> > > This error message is set after the failure of checkMessageBody()
> > > function in SoapDeserializer.cpp file of axis/soap.
> > >
> > > Could you provide some help in this matter.
> > >
> > > Thanks & Regards
> > > Ashutosh Kumar
> > >
>
>

Mime
View raw message