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 09:34:28 GMT
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" ?>
- <http://api.google.com/GoogleSearch.wsdl#> <!--

 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

  -->
 - <http://api.google.com/GoogleSearch.wsdl#> <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

  -->
 - <http://api.google.com/GoogleSearch.wsdl#> <types>
 - <http://api.google.com/GoogleSearch.wsdl#> <xsd:schema xmlns="*
http://www.w3.org/2001/XMLSchema*" targetNamespace="*urn:GoogleSearch*">
 - <http://api.google.com/GoogleSearch.wsdl#> <xsd:complexType name="*
GoogleSearchResult*">
 - <http://api.google.com/GoogleSearch.wsdl#> <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>
 - <http://api.google.com/GoogleSearch.wsdl#> <xsd:complexType name="*
ResultElement*">
 - <http://api.google.com/GoogleSearch.wsdl#> <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>
 - <http://api.google.com/GoogleSearch.wsdl#> <xsd:complexType name="*
ResultElementArray*">
 - <http://api.google.com/GoogleSearch.wsdl#> <xsd:complexContent>
 - <http://api.google.com/GoogleSearch.wsdl#> <xsd:restriction base="*
soapenc:Array*">
   <xsd:attribute ref="*soapenc:arrayType*" wsdl:arrayType="*
typens:ResultElement[]*" />
  </xsd:restriction>
  </xsd:complexContent>
  </xsd:complexType>
 - <http://api.google.com/GoogleSearch.wsdl#> <xsd:complexType name="*
DirectoryCategoryArray*">
 - <http://api.google.com/GoogleSearch.wsdl#> <xsd:complexContent>
 - <http://api.google.com/GoogleSearch.wsdl#> <xsd:restriction base="*
soapenc:Array*">
   <xsd:attribute ref="*soapenc:arrayType*" wsdl:arrayType="*
typens:DirectoryCategory[]*" />
  </xsd:restriction>
  </xsd:complexContent>
  </xsd:complexType>
 - <http://api.google.com/GoogleSearch.wsdl#> <xsd:complexType name="*
DirectoryCategory*">
 - <http://api.google.com/GoogleSearch.wsdl#> <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.

  -->
 - <http://api.google.com/GoogleSearch.wsdl#> <message name="*
doGetCachedPage*">
   <part name="*key*" type="*xsd:string*" />
   <part name="*url*" type="*xsd:string*" />
  </message>
 - <http://api.google.com/GoogleSearch.wsdl#> <message name="*
doGetCachedPageResponse*">
   <part name="*return*" type="*xsd:base64Binary*" />
  </message>
 - <http://api.google.com/GoogleSearch.wsdl#> <message name="*
doSpellingSuggestion*">
   <part name="*key*" type="*xsd:string*" />
   <part name="*phrase*" type="*xsd:string*" />
  </message>
 - <http://api.google.com/GoogleSearch.wsdl#> <message name="*
doSpellingSuggestionResponse*">
   <part name="*return*" type="*xsd:string*" />
  </message>
- <!--

 note, ie and oe are ignored by server; all traffic is UTF-8.

  -->
 - <http://api.google.com/GoogleSearch.wsdl#> <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>
 - <http://api.google.com/GoogleSearch.wsdl#> <message name="*
doGoogleSearchResponse*">
   <part name="*return*" type="*typens:GoogleSearchResult*" />
  </message>
- <!--

 Port for Google Web APIs, "GoogleSearch"

  -->
 - <http://api.google.com/GoogleSearch.wsdl#> <portType name="*
GoogleSearchPort*">
 - <http://api.google.com/GoogleSearch.wsdl#> <operation name="*
doGetCachedPage*">
   <input message="*typens:doGetCachedPage*" />
   <output message="*typens:doGetCachedPageResponse*" />
  </operation>
 - <http://api.google.com/GoogleSearch.wsdl#> <operation name="*
doSpellingSuggestion*">
   <input message="*typens:doSpellingSuggestion*" />
   <output message="*typens:doSpellingSuggestionResponse*" />
  </operation>
 - <http://api.google.com/GoogleSearch.wsdl#> <operation name="*
doGoogleSearch*">
   <input message="*typens:doGoogleSearch*" />
   <output message="*typens:doGoogleSearchResponse*" />
  </operation>
  </portType>
- <!--

 Binding for Google Web APIs - RPC, SOAP over HTTP

  -->
 - <http://api.google.com/GoogleSearch.wsdl#> <binding name="*
GoogleSearchBinding*" type="*typens:GoogleSearchPort*">
   <soap:binding style="*rpc*" transport="*
http://schemas.xmlsoap.org/soap/http*" />
 - <http://api.google.com/GoogleSearch.wsdl#> <operation name="*
doGetCachedPage*">
   <soap:operation soapAction="*urn:GoogleSearchAction*" />
 - <http://api.google.com/GoogleSearch.wsdl#> <input>
   <soap:body use="*encoded*" namespace="*urn:GoogleSearch*" encodingStyle="
*http://schemas.xmlsoap.org/soap/encoding/*" />
  </input>
 - <http://api.google.com/GoogleSearch.wsdl#> <output>
   <soap:body use="*encoded*" namespace="*urn:GoogleSearch*" encodingStyle="
*http://schemas.xmlsoap.org/soap/encoding/*" />
  </output>
  </operation>
 - <http://api.google.com/GoogleSearch.wsdl#> <operation name="*
doSpellingSuggestion*">
   <soap:operation soapAction="*urn:GoogleSearchAction*" />
 - <http://api.google.com/GoogleSearch.wsdl#> <input>
   <soap:body use="*encoded*" namespace="*urn:GoogleSearch*" encodingStyle="
*http://schemas.xmlsoap.org/soap/encoding/*" />
  </input>
 - <http://api.google.com/GoogleSearch.wsdl#> <output>
   <soap:body use="*encoded*" namespace="*urn:GoogleSearch*" encodingStyle="
*http://schemas.xmlsoap.org/soap/encoding/*" />
  </output>
  </operation>
 - <http://api.google.com/GoogleSearch.wsdl#> <operation name="*
doGoogleSearch*">
   <soap:operation soapAction="*urn:GoogleSearchAction*" />
 - <http://api.google.com/GoogleSearch.wsdl#> <input>
   <soap:body use="*encoded*" namespace="*urn:GoogleSearch*" encodingStyle="
*http://schemas.xmlsoap.org/soap/encoding/*" />
  </input>
 - <http://api.google.com/GoogleSearch.wsdl#> <output>
   <soap:body use="*encoded*" namespace="*urn:GoogleSearch*" encodingStyle="
*http://schemas.xmlsoap.org/soap/encoding/*" />
  </output>
  </operation>
  </binding>
- <!--

 Endpoint for Google Web APIs

  -->
 - <http://api.google.com/GoogleSearch.wsdl#> <service name="*
GoogleSearchService*">
 - <http://api.google.com/GoogleSearch.wsdl#> <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