Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 01:43
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  Web Services: XML, Soap, WSDL, UDDI, and Flash Integration (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis)
| | |-+  SOAP, Floogle help
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: SOAP, Floogle help  (Read 2670 times)
//JMD
Server what's that
*
Posts: 2



View Profile WWW Email
« on: 05/11/02, 20:32 »

Jeff,

After visiting your site a few weeks ago and seeing the superb Floogle demo I was inspired to get the Google API and get 'down and dirty' with Flash & XML/SOAP.

Using CF, I've got the security issue sorted, I've got the XML into Flash but am having real trouble getting at the elements/attributes. Obviously, I'm not expecting you to do it for me but any pointers or 'top-tips' would be much appreciated as I seem to be going round in a circle.
Apologies if you've already got a tutorial about this on the site but I couldn't see it.

Cheers,
James
Logged
Flash-db
Administrator
Systems Administrator
*****
Posts: 1867



View Profile WWW
« Reply #1 on: 05/11/02, 20:55 »

I'm really not that much help with CF but here's an example in PHP:


This would be a language translator:

<?php
require_once 'SOAP/Client.php';
$soapclient = new SOAP_Client("WSDL/BabelFishService.wsdl","wsdl");
$result = $soapclient->call("BabelFish",array("translationmode"=>$Mode, "sourcedata" => $InputText));

print "&OutputText=$result&Go=Yes";
?>

// Mode and Input text is sent from Flash - Output text is sent back.

(Flash would just have an Input text box for what you want to translate - and a dynamic text box for what is returned)  ( http://www.flash-db.net/Soap/Translate.html)

- This makes it about 10 times easier and faster then dealing with Flash.

------------------------------

The google one is about the same but slightly more complex.

I always do all the parsing on the server side to make it faster and easier to work with, try to avoid the XML part of all this as much as possible - makes it harder to format all the results (in my experience).

For Google here's how I parse all the returned Data:

for($t=0;$t<$numR;$t++) {

print "<font COLOR=\"#0066cc\" SIZE=\"+14\"><u><a href=\"$Element[URL]\" target=\"_blank\">$Element[title]</a></u></font><br>-$Element[snippet]<br><font COLOR=\"#999999\">Description: </font> <i>$Element[summary]</i><br><font COLOR=\"#008000\">$Element[URL]</font> - <b>$Element[cachedSize]</b><br><br>";
}

--------------------------

Their's a bit that's missing to that - but what it basically does is grabs the Soap Response and Loops through each returned element - Printing out the results in a format that's easy to change around.  The response is then returned to Flash.

In the case of Flooge - The actual Flash is basically just 2 dynamic text area's and nothing else.  1 for search term and 1 to hold the response.

Personally I hate formatting XML with Flash's XML parser so I tend to do things this way.



   



Logged

-Jeff.
//JMD
Server what's that
*
Posts: 2



View Profile WWW Email
« Reply #2 on: 05/11/02, 21:15 »

Jeff,

Thanks so much for your reply and the great help. That's cleared up my main question which was "where's the parsing done, 'cos this puppy is pretty damn quick?". I'm going to persevere with getting my flash client to do all the parsing (for the experience) but I think I need to get on with some server-side, CF parsing. If I have any success with it I'll send you some notes or if I get a mo perhaps post a tutorial! ;-p

Thanks again,
James
Logged
Flash-db
Administrator
Systems Administrator
*****
Posts: 1867



View Profile WWW
« Reply #3 on: 05/11/02, 21:26 »

That would be great.

Yeah I know everyone's always talking about how great the XML parsing is in Flash - but honestly I've always had much better success parsing XML on the server side and then only returning what is absolutly needed to Flash.

To me it's sort of like why spend all the time Parsing in Flash to just get a couple of values out of it when the it can just as easily be written like Variable1=Value1&Variable2=Value2.. on the server.

I'm sure their's a reason when you get to the really complicated stuff - but I've been trying to get their - and even when their's a database with millions of records it still seems like their's nothing that the Flash XML parser makes any easier.


If you need more complex results returned you can just add a count onto the variable Name or order it more specifically.
Logged

-Jeff.
pp
Server what's that
*
Posts: 10



View Profile Email
« Reply #4 on: 07/11/02, 01:16 »

Jeff, this would be the parsing on the php:
for($t=0;$t<$numR;$t++) {

print "<font COLOR=\"#0066cc\" SIZE=\"+14\"><u><a href=\"$Element[URL]\" target=\"_blank\">$Element[title]</a></u></font><br>-$Element[snippet]<br><font COLOR=\"#999999\">Description: </font> <i>$Element[summary]</i><br><font COLOR=\"#008000\">$Element[URL]</font> - <b>$Element[cachedSize]</b><br><br>";
}

i am right..
but can you write the code to access to google from php...

like you did to BabelFish (this one)


<?php
require_once 'SOAP/Client.php';
$soapclient = new SOAP_Client("WSDL/BabelFishService.wsdl","wsdl");
$result = $soapclient->call("BabelFish",array("translationmode"=>$Mode, "sourcedata" => $InputText));

print "&OutputText=$result&Go=Yes";
?>


Thanks Jeff!

Cheesy
Logged
Flash-db
Administrator
Systems Administrator
*****
Posts: 1867



View Profile WWW
« Reply #5 on: 07/11/02, 01:26 »

You can check this link for some more info as well:

http://sebastian-bergmann.de/index.php?page=google&session=2df072a46344a0cb89f2d8d346944d40


- sorry at some point I'll put together an easy to use method for this, soon.
Logged

-Jeff.
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!