Consuming Outside Web Services
So far, the only web services we have worked with are the ones we built ourselves. That's not the idea behind web services. The idea is that anyone can build them, and anyone can use them as long as they know how to work with them.There are a couple of great sites on the web that store references to web services for people to work with:http://www.webservicex.net/WS/default.aspxhttp://www.xmethods.com/The one we will be using can be found athttp://www.aspxpressway.com/maincontent/webservices/piglatin.asmxThis web service will translate a string of text we send it to pig Latin and return it.For those not familiar with pig Latin, it's a language that moves the first letter from the front of certain words to the end and then adds an "ay" to it.So if you have a sentence just like this, it would read like this:So if you avehay a entencesay ustjay ikelay isthay, it ouldway eadray ikelay isthay.The following example will build an application to do just that. But before you jump in to the example, add the WSDL to the Web Services panel (http://www.aspxpressway.com/maincontent/webservices/piglatin.asmx?WSDL).
Now test the movie, place this paragraph in (or one of your own), and click the Translate button. When the results are returned, you should see something like Figure 25.11.
Figure 25.11. Using external web services with Flash is fun and easy with the WebServiceConnector and Data Binding.
