5 Replies Latest reply on May 15, 2006 9:41 AM by Newsgroup_User

    Simple Google Web Service App Help

    kmurray24
      I tried to create a web service app to call google and return some results. I can't seem to get this web service stuff right. Could someone who is in the Web Service know help me get my simple Google App to work? Right now I'm getting an error:
      The prefix "xsi" for attribute "xsi:type" is not bound. I get this for each line. Here's my current attempt:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">

      <mx:WebService id="ws" wsdl="C:\Documents and Settings\murrayk\My Documents\googleapi\GoogleSearch.wsdl" useProxy="false">
      <mx:operation name="doGoogleSearch">
      <mx:request xmlns="">
      <ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch">
      <key xsi:type="xsd:string">00000000000000000000000000000000</key>
      <q xsi:type="xsd:string">ti_searchparm.text</q>
      <start xsi:type="xsd:int">0</start>
      <maxResults xsi:type="xsd:int">10</maxResults>
      <filter xsi:type="xsd:boolean">true</filter>
      <restrict xsi:type="xsd:string" />
      <safeSearch xsi:type="xsd:boolean">false</safeSearch>
      <lr xsi:type="xsd:string" />
      <ie xsi:type="xsd:string">latin1</ie>
      <oe xsi:type="xsd:string">latin1</oe>
      </ns1:doGoogleSearch>
      </mx:request>
      </mx:operation>
      </mx:WebService>

      <mx:Button x="38" y="31" label="Search" click="ws.doGoogleSearch.send()"/>
      <mx:TextInput x="38" y="73" id="ti_searchparm"/>
      <mx:TextArea x="38" y="141" width="412" height="299" id="ta_searchresults" text="{ws.doGoogleSearch.result}"/>
      </mx:Application>

        • 1. Re: Simple Google Web Service App Help
          Level 7
          Hello,
          I've contacted someone internally who gave the following response (I've
          edited it a little bit).
          - Rob

          The request normally should look more like this :

          <mx:request>
          <key>00000000000000000000000000000000</key>
          <q>{ti_searchparm.text}</q>
          <start>0</start>
          <maxResults>10</maxResults>
          <filter>true</filter>
          <restrict/>
          <safeSearch>false</safeSearch>
          <lr/>
          <ie>latin1</ie>
          <oe>latin1</oe>
          </mx:request>

          We do all of the namespace stuff for you unless you specify to use an XML
          requestFormat (really no need unless the simple version won�t work for you
          for some reason). And looking at the generated SOAP request it looks like
          we DO have a bug here - nil entries are going a cross as [object Object]. I�ll
          log this momentarily.

          <SOAP-ENV:Envelope
          xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/"
          xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsd=" http://www.w3.org/2001/XMLSchema">
          <SOAP-ENV:Body>
          <ns0:doGoogleSearch xmlns:ns0="urn:GoogleSearch" SOAP-
          ENV:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/">
          <key
          xsi:type="xsd:string">00000000000000000000000000000000</key>
          <q xsi:type="xsd:string">banana</q>
          <start xsi:type="xsd:int">0</start>
          <maxResults xsi:type="xsd:int">10</maxResults>
          <filter xsi:type="xsd:boolean">true</filter>
          <restrict xsi:type="xsd:string">[object Object]</restrict>
          <safeSearch xsi:type="xsd:boolean">false</safeSearch>
          <lr xsi:type="xsd:string">[object Object]</lr>
          <ie xsi:type="xsd:string">latin1</ie>
          <oe xsi:type="xsd:string">latin1</oe>
          </ns0:doGoogleSearch>
          </SOAP-ENV:Body>
          </SOAP-ENV:Envelope>

          So for the time being the customer can use the XML format like so:

          <mx:request format="xml">
          <ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch"
          xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
          <key xsi:type="xsd:string">00000000000000000000000000000000</key>
          <q xsi:type="xsd:string">{ti_searchparm.text}</q>
          <start xsi:type="xsd:int">0</start>
          <maxResults xsi:type="xsd:int">10</maxResults>
          <filter xsi:type="xsd:boolean">true</filter>
          <restrict xsi:type="xsd:string" />
          <safeSearch xsi:type="xsd:boolean">false</safeSearch>
          <lr xsi:type="xsd:string" />
          <ie xsi:type="xsd:string">latin1</ie>
          <oe xsi:type="xsd:string">latin1</oe>
          </ns1:doGoogleSearch>
          </mx:request>


          "kmurray24" <webforumsuser@macromedia.com> wrote in message
          news:e3ua64$jh2$1@forums.macromedia.com...
          >I tried to create a web service app to call google and return some results.
          >I
          > can't seem to get this web service stuff right. Could someone who is in
          > the
          > Web Service know help me get my simple Google App to work? Right now I'm
          > getting an error:
          > The prefix "xsi" for attribute "xsi:type" is not bound. I get this for
          > each
          > line. Here's my current attempt:
          > <?xml version="1.0" encoding="utf-8"?>
          > <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
          > layout="absolute">
          >
          > <mx:WebService id="ws" wsdl="C:\Documents and Settings\murrayk\My
          > Documents\googleapi\GoogleSearch.wsdl" useProxy="false">
          > <mx:operation name="doGoogleSearch">
          > <mx:request xmlns="">
          > <ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch">
          > <key xsi:type="xsd:string">00000000000000000000000000000000</key>
          > <q xsi:type="xsd:string">ti_searchparm.text</q>
          > <start xsi:type="xsd:int">0</start>
          > <maxResults xsi:type="xsd:int">10</maxResults>
          > <filter xsi:type="xsd:boolean">true</filter>
          > <restrict xsi:type="xsd:string" />
          > <safeSearch xsi:type="xsd:boolean">false</safeSearch>
          > <lr xsi:type="xsd:string" />
          > <ie xsi:type="xsd:string">latin1</ie>
          > <oe xsi:type="xsd:string">latin1</oe>
          > </ns1:doGoogleSearch>
          > </mx:request>
          > </mx:operation>
          > </mx:WebService>
          >
          > <mx:Button x="38" y="31" label="Search"
          > click="ws.doGoogleSearch.send()"/>
          > <mx:TextInput x="38" y="73" id="ti_searchparm"/>
          > <mx:TextArea x="38" y="141" width="412" height="299"
          > id="ta_searchresults"
          > text="{ws.doGoogleSearch.result}"/>
          > </mx:Application>
          >
          >
          >


          • 2. Re: Simple Google Web Service App Help
            kmurray24 Level 1
            Your reply is greatly appreciated!!! Thanks!!! I finally got the Google Web API to work and I'm getting results back. The reason I have all of the XSI stuff is because Google's examples show this. If I knew I could do without xsi I would have. But, your solution worked! I don't understand even what the xsi does, but I'll look into it later! Thanks again!
            • 3. Re: Simple Google Web Service App Help
              Level 7
              Any ideas on how to request simple Google maps? Just the map image
              (topographic, Arial, hybrid) so that one can then overlay Flash graphics
              over it as a mash-up?


              --
              ===============================
              Dr. Yechezkal Gutfreund
              Team Macromedia for Mobile Devices
              ===============================


              "kmurray24" <webforumsuser@macromedia.com> wrote in message
              news:e40dqb$f0e$1@forums.macromedia.com...
              > Your reply is greatly appreciated!!! Thanks!!! I finally got the Google
              > Web
              > API to work and I'm getting results back. The reason I have all of the
              > XSI
              > stuff is because Google's examples show this. If I knew I could do
              > without xsi
              > I would have. But, your solution worked! I don't understand even what
              > the
              > xsi does, but I'll look into it later! Thanks again!
              >
              >


              • 4. Re: Simple Google Web Service App Help
                Larry McLister (Adobe) Adobe Employee
                I'm not sure about Google but check out the API that Yahoo offers.

                Yahoo! Maps Flash® APIs
                http://developer.yahoo.com/maps/flash/index.html

                -Larry
                Flex Builder Team
                • 5. Re: Simple Google Web Service App Help
                  Level 7
                  Thank you Larry.

                  FYI: The Google maps API:

                  http://www.google.com/apis/maps/documentation/

                  Describes how to use the google maps for a mash-up. But the api is largely
                  implemented as a JavaScript library that one links into one's web page. It
                  does not expose the underlying xml protocol (I don't even know if it is
                  SOAP).

                  I supposed I can bring up an TCP trace utility and watch the messages go
                  back and forth. But I was hoping someone had already contacted GOOGLE about
                  this sort of a mash-up. Since it seems very very profitable.

                  The flex API for Yahoo will do fine (and is splendidly documented!) for our
                  initial investigations. I hope to bring up this bit of competitive
                  information when I get to talk to the Google Labs people later!

                  Dr. YSG - ACE (Macromedia Team Mobile)

                  "