Samisa, Team,

Looks like the current code is *BAD* at handling cases where the
ordering of the elements on the wire is different from that specified
in wsdl/xsd....See enclosed diff that i had to apply to the generated
code to make it work. If people can't use public web services with our
code...they will have a hard time justifying its usage.

Thanks,
dims


On Mon, 21 Mar 2005 07:55:48 +0000, Samisa Abeysinghe
<[EMAIL PROTECTED]> wrote:
> 
> 
> Sorry, I did not get any time to look into this these days.
> 
> Thanks,
> Samisa...
> 
> On Sat, 2005-03-19 at 13:37, Davanum Srinivas wrote:
> > Samisa,
> >
> > Any word on this?
> >
> > thanks,
> > dims
> >
> >
> > On Wed, 9 Mar 2005 10:01:54 +0600, Samisa Abeysinghe
> > <[EMAIL PROTECTED]> wrote:
> > > Hi Krishna,
> > >         As there are quite a number of files that I would have to look
> > > into, please give me some time.
> > >         I will get back to you.
> > > Thanks,
> > > Samisa...
> > >
> > > -----Original Message-----
> > > From: krishna [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, March 09, 2005 7:05 AM
> > > To: [email protected]
> > > Cc: Krishna Kumar Rajagopalan
> > > Subject: Re:Google with Axis
> > >
> > > Hi Samisa
> > >
> > > I have attached the source code files with a description.
> > >
> > > 1.Google.cpp - File written by me for Client side which calls
> > > doGoogleSearch
> > >
> > > 2.GoogleSearchPort.cpp1(renamed) - Original GoogleSearchPort .cpp file
> > > generated by wsdl2ws tool
> > >
> > > 3.error1  -   SOAP message generated when GoogleSearchPort.cpp1 was used
> > >
> > > 4.GoogleSearchPort2.cpp2(modified) - Order of function calls changed to
> > > that of wsdl as shown below
> > >
> > >                 m_pCall->addParameter((void*)&Value1, "key",
> > > XSD_STRING);
> > >                 m_pCall->addParameter((void*)&Value9, "q", XSD_STRING);
> > >                 m_pCall->addParameter((void*)&Value3, "start", XSD_INT);
> > >                 m_pCall->addParameter((void*)&Value7, "maxResults",
> > > XSD_INT);
> > >                 m_pCall->addParameter((void*)&Value0, "filter",
> > > XSD_BOOLEAN);
> > >                 m_pCall->addParameter((void*)&Value2, "restrict",
> > > XSD_STRING);
> > >                 m_pCall->addParameter((void*)&Value5, "safeSearch",
> > > XSD_BOOLEAN);
> > >                 m_pCall->addParameter((void*)&Value6, "lr", XSD_STRING);
> > >                 m_pCall->addParameter((void*)&Value4, "ie", XSD_STRING);
> > >                 m_pCall->addParameter((void*)&Value8, "oe", XSD_STRING);
> > >
> > > 5.error2 - SOAP message generated when GoogleSearchPort.cpp2(modified)
> > > was used
> > >
> > > 6.All other files generated by the WSDL2WS tool are attached
> > >
> > > 7.compile - sample script to compile files
> > >
> > > After the run with GoogleSearchPort.cpp2(modified) the code exits with a
> > >
> > > segmentation fault
> > >
> > > Regards
> > > Krishna
> > >
> > > uic.edu/~krajag2
> > >
> > > Hi Krishna,
> > >     It would be helpfult to fix this problem if you could send the
> > > SOAP message and the generated code that you are using.
> > >
> > > Thanks,
> > > Samisa,,,
> > >
> > >
> --
> Samisa Abeysinghe <[EMAIL PROTECTED]>
> Virtusa Corporation
> 
> --------------------------- 
> -----------------------------------------------------------------
> This message, including any attachments, contains confidential information 
> intended for a specific individual and purpose, and is intended for the 
> addressee only. Any unauthorized disclosure, use, dissemination, copying, or 
> distribution of this message or any of its attachments or the information 
> contained in this e-mail, or the taking of any action based on it, is 
> strictly prohibited. If you are not the intended recipient, please notify the 
> sender immediately by return e-mail and delete this message.
> 
> ---------------------------------------------------------------------------------------------
> This message, including any attachments, contains confidential information 
> intended for a specific individual and purpose, and is intended for the 
> addressee only. Any unauthorized disclosure, use, dissemination, copying, or 
> distribution of this message or any of its attachments or the information 
> contained in this e-mail, or the taking of any action based on it, is 
> strictly prohibited. If you are not the intended recipient, please notify the 
> sender immediately by return e-mail and delete this message.
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/
diff -u ClientOut\GoogleSearchPort.cpp ClientOut.work\GoogleSearchPort.cpp
--- ClientOut\GoogleSearchPort.cpp      Sun Mar 20 23:10:52 2005
+++ ClientOut.work\GoogleSearchPort.cpp Sun Mar 20 23:13:59 2005
@@ -165,16 +165,18 @@
                m_pCall->setSOAPVersion(SOAP_VER_1_1);
                m_pCall->setOperation("doGoogleSearch", "urn:GoogleSearch");
                applyUserPreferences();
+
+        m_pCall->addParameter((void*)Value1, "key", XSD_STRING);
+               m_pCall->addParameter((void*)Value9, "q", XSD_STRING);
+               m_pCall->addParameter((void*)&Value3, "start", XSD_INT);
+               m_pCall->addParameter((void*)&Value7, "maxResults", XSD_INT);
                m_pCall->addParameter((void*)&Value0, "filter", XSD_BOOLEAN);
-               m_pCall->addParameter((void*)Value1, "key", XSD_STRING);
                m_pCall->addParameter((void*)Value2, "restrict", XSD_STRING);
-               m_pCall->addParameter((void*)&Value3, "start", XSD_INT);
-               m_pCall->addParameter((void*)Value4, "ie", XSD_STRING);
                m_pCall->addParameter((void*)&Value5, "safeSearch", 
XSD_BOOLEAN);
                m_pCall->addParameter((void*)Value6, "lr", XSD_STRING);
-               m_pCall->addParameter((void*)&Value7, "maxResults", XSD_INT);
+               m_pCall->addParameter((void*)Value4, "ie", XSD_STRING);
                m_pCall->addParameter((void*)Value8, "oe", XSD_STRING);
-               m_pCall->addParameter((void*)Value9, "q", XSD_STRING);
+
                if (AXIS_SUCCESS == m_pCall->invoke())
                {
                        if(AXIS_SUCCESS == 
m_pCall->checkMessage("doGoogleSearchResponse", "urn:GoogleSearch"))
diff -u ClientOut\GoogleSearchResult.cpp ClientOut.work\GoogleSearchResult.cpp
--- ClientOut\GoogleSearchResult.cpp    Sun Mar 20 23:10:52 2005
+++ ClientOut.work\GoogleSearchResult.cpp       Sun Mar 20 22:57:05 2005
@@ -69,34 +69,45 @@
  */
 int Axis_DeSerialize_GoogleSearchResult(GoogleSearchResult* param, 
IWrapperSoapDeSerializer* pIWSDZ)
 {
-       xsd__boolean* p_documentFiltering = 
(pIWSDZ->getElementAsBoolean("documentFiltering",0));
+       param->directoryCategories = 
(DirectoryCategory_Array&)pIWSDZ->getCmplxArray((void*)Axis_DeSerialize_DirectoryCategory
+               , (void*)Axis_Create_DirectoryCategory, 
(void*)Axis_Delete_DirectoryCategory
+               , (void*)Axis_GetSize_DirectoryCategory, "directoryCategories", 
Axis_URI_DirectoryCategory);
+       
+    xsd__boolean* p_documentFiltering = 
(pIWSDZ->getElementAsBoolean("documentFiltering",0));
        param->documentFiltering = *p_documentFiltering;
        delete p_documentFiltering;
-       param->searchComments = pIWSDZ->getElementAsString("searchComments",0);
-       xsd__int* p_estimatedTotalResultsCount = 
(pIWSDZ->getElementAsInt("estimatedTotalResultsCount",0));
-       param->estimatedTotalResultsCount = *p_estimatedTotalResultsCount;
-       delete p_estimatedTotalResultsCount;
-       xsd__boolean* p_estimateIsExact = 
(pIWSDZ->getElementAsBoolean("estimateIsExact",0));
+
+    xsd__int* p_endIndex = (pIWSDZ->getElementAsInt("endIndex",0));
+       param->endIndex = *p_endIndex;
+       delete p_endIndex;
+       
+    xsd__boolean* p_estimateIsExact = 
(pIWSDZ->getElementAsBoolean("estimateIsExact",0));
        param->estimateIsExact = *p_estimateIsExact;
        delete p_estimateIsExact;
-       param->resultElements = 
(ResultElement_Array&)pIWSDZ->getCmplxArray((void*)Axis_DeSerialize_ResultElement
+       
+    xsd__int* p_estimatedTotalResultsCount = 
(pIWSDZ->getElementAsInt("estimatedTotalResultsCount",0));
+       param->estimatedTotalResultsCount = *p_estimatedTotalResultsCount;
+       delete p_estimatedTotalResultsCount;
+       
+    param->resultElements = 
(ResultElement_Array&)pIWSDZ->getCmplxArray((void*)Axis_DeSerialize_ResultElement
                , (void*)Axis_Create_ResultElement, 
(void*)Axis_Delete_ResultElement
                , (void*)Axis_GetSize_ResultElement, "resultElements", 
Axis_URI_ResultElement);
-       param->searchQuery = pIWSDZ->getElementAsString("searchQuery",0);
-       xsd__int* p_startIndex = (pIWSDZ->getElementAsInt("startIndex",0));
-       param->startIndex = *p_startIndex;
-       delete p_startIndex;
-       xsd__int* p_endIndex = (pIWSDZ->getElementAsInt("endIndex",0));
-       param->endIndex = *p_endIndex;
-       delete p_endIndex;
-       param->searchTips = pIWSDZ->getElementAsString("searchTips",0);
-       param->directoryCategories = 
(DirectoryCategory_Array&)pIWSDZ->getCmplxArray((void*)Axis_DeSerialize_DirectoryCategory
-               , (void*)Axis_Create_DirectoryCategory, 
(void*)Axis_Delete_DirectoryCategory
-               , (void*)Axis_GetSize_DirectoryCategory, "directoryCategories", 
Axis_URI_DirectoryCategory);
-       xsd__double* p_searchTime = 
(pIWSDZ->getElementAsDouble("searchTime",0));
+       
+    param->searchComments = pIWSDZ->getElementAsString("searchComments",0);
+
+    param->searchQuery = pIWSDZ->getElementAsString("searchQuery",0);
+       
+    xsd__double* p_searchTime = (pIWSDZ->getElementAsDouble("searchTime",0));
        param->searchTime = *p_searchTime;
        delete p_searchTime;
-       return pIWSDZ->getStatus();
+       
+    param->searchTips = pIWSDZ->getElementAsString("searchTips",0);
+       
+    xsd__int* p_startIndex = (pIWSDZ->getElementAsInt("startIndex",0));
+       param->startIndex = *p_startIndex;
+       delete p_startIndex;
+
+    return pIWSDZ->getStatus();
 }
 void* Axis_Create_GoogleSearchResult(GoogleSearchResult* pObj, bool bArray = 
false, int nSize=0)
 {
Only in ClientOut.work: main.cpp
diff -u ClientOut\ResultElement.cpp ClientOut.work\ResultElement.cpp
--- ClientOut\ResultElement.cpp Sun Mar 20 23:10:52 2005
+++ ClientOut.work\ResultElement.cpp    Sun Mar 20 23:00:09 2005
@@ -57,19 +57,19 @@
  */
 int Axis_DeSerialize_ResultElement(ResultElement* param, 
IWrapperSoapDeSerializer* pIWSDZ)
 {
-       param->summary = pIWSDZ->getElementAsString("summary",0);
        param->URL = pIWSDZ->getElementAsString("URL",0);
-       param->snippet = pIWSDZ->getElementAsString("snippet",0);
-       param->title = pIWSDZ->getElementAsString("title",0);
        param->cachedSize = pIWSDZ->getElementAsString("cachedSize",0);
-       xsd__boolean* p_relatedInformationPresent = 
(pIWSDZ->getElementAsBoolean("relatedInformationPresent",0));
-       param->relatedInformationPresent = *p_relatedInformationPresent;
-       delete p_relatedInformationPresent;
-       param->hostName = pIWSDZ->getElementAsString("hostName",0);
        param->directoryCategory = 
(DirectoryCategory*)pIWSDZ->getCmplxObject((void*)Axis_DeSerialize_DirectoryCategory
                , (void*)Axis_Create_DirectoryCategory, 
(void*)Axis_Delete_DirectoryCategory
                , "directoryCategory", Axis_URI_DirectoryCategory);
        param->directoryTitle = pIWSDZ->getElementAsString("directoryTitle",0);
+       param->hostName = pIWSDZ->getElementAsString("hostName",0);
+       xsd__boolean* p_relatedInformationPresent = 
(pIWSDZ->getElementAsBoolean("relatedInformationPresent",0));
+       param->relatedInformationPresent = *p_relatedInformationPresent;
+       delete p_relatedInformationPresent;
+       param->snippet = pIWSDZ->getElementAsString("snippet",0);
+       param->summary = pIWSDZ->getElementAsString("summary",0);
+       param->title = pIWSDZ->getElementAsString("title",0);
        return pIWSDZ->getStatus();
 }
 void* Axis_Create_ResultElement(ResultElement* pObj, bool bArray = false, int 
nSize=0)

Reply via email to