axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Dick <adrian.d...@uk.ibm.com>
Subject Re: Failure of Google Search API web service using Axis
Date Wed, 18 Jan 2006 10:56:27 GMT
Hi,

Comparing your SOAP request to the WSDL, it would appear the message parts
have been sent in the wrong order, hence the Fault message you're receiving
from the server.
The WSDL defines the order as:
      key, q, start, maxResults, filer, restrict, safeSearch, lr, ie, oe
While the SOAP request is sending:
      filter, key, restrict, start, ie, safeSearch, lr, maxResults, oe, q

This sounds like a problem within Axis C, which will need to looking into.

It's not a problem I'm previously aware of, but have you tried using the
Axis C++ 1.6 nightly builds, to see if it has been resolved?

If not, can you raise a Jira, attaching the SOAP messages and WSDL, to aid
investigation.  ( Jira can be accessed here:
http://issues.apache.org/jira/browse/AXISCPP )

Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)


Ashutosh Kumar <meetashutosh@gmail.com> wrote on 18/01/2006 09:08:05:

> Hi !
> Enclosed here are the serialized SOAP request and response that my
> machine is sending/receiving to/from the server. Please help me
> identify the probable error in the Soap data being send to the Google
Server.
>
>
> File being send
> ******************
> POST http://api.google.com/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 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>
> </SOAP-ENV:Envelope>
>
> File received from server
> ****************************
> HTTP/1.1 500 Internal Server Error
> Content-Type: text/xml; charset=utf-8
> Cache-control: private
> Transfer-Encoding: chunked
> Date: Wed, 18 Jan 2006 08:46:06 GMT
> Server: GFE/1.3
> Cneonction: Close
> 6b9
> <?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>
> <SOAP-ENV:Fault>
> <faultcode>SOAP-ENV:Server</faultcode>
> <faultstring>Exception while handling service request: com.google.
> soap.search.GoogleSearchService.doGoogleSearch(boolean,java.lang.
> String,java.lang.String,int,java.lang.String,boolean,java.lang.
> String,int,java.lang.String ,java.lang.String) -- no signature
> match</faultstring>
> <faultactor>/search/beta2</faultactor>
> <detail>
> <stackTrace>java.lang.NoSuchMethodException: com.google.soap.search.
> GoogleSearchService.doGoogleSearch (boolean,java.lang.String,java.
> lang.String,int,java.lang.String,boolean,java.lang.String,int,java.
> lang.String,java.lang.String) -- no signature match
>  at org.apache.soap.util.MethodUtils.getEntryPoint(MethodUtils.java:194)
>  at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:548)
>  at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:528)
>  at org.apache.soap.server.RPCRouter.invoke(RPCRouter.java:114)
>  at org.apache.soap.providers.RPCJavaProvider.invoke
> (RPCJavaProvider.java:129)
>  at org.apache.soap.server.http.RPCRouterServlet.
> doPost(RPCRouterServlet.java:288)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>  at javax.servlet.http.HttpServlet.service (HttpServlet.java:802)
>  at com.google.gse.HttpConnection.runServlet(HttpConnection.java:436)
>  at com.google.gse.HttpConnection.run(HttpConnection.java:376)
>  at com.google.gse.DispatchQueue$WorkerThread.run(DispatchQueue.java
:254)
> </stackTrace>
> </detail>
> </SOAP-ENV:Fault>
>
> 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