Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Web Service



hello!

does anybody knows a good technique for the transfer of parameters from web-service to flash?
For example if I want a user to register on my website, he has to enter 16 fields. How should I send this data to the webservice? I think using arrays is much to complicated....does flash has a heap function or other interesting data types?
Or am I completely wrong with my ideas...

please help a newbie ....

many thanks



ActionScript.org Forums > Flash General Questions > Flash 8 General Questions
Posted on: 01-11-2006, 04:43 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Is This Consider Web Service?
hi guys,

i was asked to develop a fairy hi end link for my client. but i m not sure what it is called. so maybe some of you can enlighten me. thanks!

my client selling some product online, basically helping artist to sell their handy work online. so they wanted a website that allow artist to sign in and upload the photo of the work so that user can browse through the site it self. this is not the problem.

the tough part is they actually wanted another part works more like a link, that allow user to put to their own site to promote the works.

ok, something like youtube embed code, that you can copy and put to your blog to stream video straight from youtube server to your blog.

the nearest info i can dig is web service, but somehow it still have a little different in a way.

or what do i need in terms of technology?? i have experience in AS2, PHP and MYSQL. is that sufficient enough??

can anyone tell me where should i go to to look for more info like that.
thanks!

Web Service
hi all,
Can any one tell me free web service to get stock quote.
I had one (http://www.webservicex.net/stockquote.asmx?WSDL) any other service please.
thank

Web Service And XML
My question really isn't about how to load XML from a web service. Actually, the code below does that just fine. However, what I am having trouble with is accessing any of the XML data outside of the XMLLoaded function. Currently, if I want to use the XML data inside of other functions, I need to keep those functions nested withing the XMLLoaded function. For example, if I run the trace outside of the XMLLoaded function, a null value is returned. I'm sure that this is probably very simple but how would I get access to that data outside of it's own function? It's been a long week and I'm sure that my description of the problem is as confusing to you as the problem itself is confusing to me. Any help, however, would be greatly appreciated. Thank you.


Code:
import alducente.services.WebService;
import flash.events.*;

var ws:WebService = new WebService();
ws.addEventListener(Event.CONNECT, connected);
ws.connect("http://10.1.138.22/FlashVideo/Service.asmx?WSDL");
ws.cacheResults = true;

var initTime:Number;
var flashVideo:XMLList;
var soap:Namespace = new Namespace("http://schemas.xmlsoap.org/soap/envelope/");
var fv:Namespace = new Namespace("http://tempuri.org/");
default xml namespace = fv;

function connected(evt:Event):void {
ws.removeEventListener(Event.CONNECT, connected);
ws.GetFlashVideoData(XMLLoaded, 1);
}

function XMLLoaded(XMLData:XML):void {
flashVideo = XMLData.soap::Body.GetFlashVideoDataResponse.GetFlashVideoDataResult;
trace(flashVideo.MediaTitle);
}

Web Service
Where would be a good place for free web hosting were i can build some stuff "preferably no popups and banners"

Thanks,
oPtIcS

No Service For
I have a problem on my server.


Client code now seems fine:


ActionScript Code:
import mx.remoting.NetServices;


class Test
{


private var gatewayPath:String = "";
private var servicePath:String = "";
private var serviceConnection:Object = new Object();
private var serviceObject:Object = new Object();

function Test()
{
       
    this.gatewayPath =
"http://localhost:8080/openamf/gateway";
    this.servicePath = "com.jakestone.bm.Test";
    this.setServiceObject();
    trace("Directory Created");
}


// Methods
function setServiceObject() {
    NetServices.setDefaultGatewayUrl(this.gatewayPath);
    this.serviceConnection =
NetServices.createGatewayConnection();
    this.serviceObject =
this.serviceConnection.getService(this.servicePath,
this);
}
function setGatewayPath (gatewayPath) {
    this.gatewayPath = gatewayPath;
    this.setServiceObject();
    trace("gateway: "+this.gatewayPath);
}

function setServicePath(servicePath) {
    this.servicePath = servicePath;
    this.setServiceObject();
    trace("service: "+this.servicePath);
}

function sayHello(msg:String) {
   
    this.setServiceObject();
    this.serviceObject.sayHello(msg);
}


   
}


openamf gateway servlet starts up within my webapp
just fine. My web.xml is as per the README. The
config.xml is modified as follows:




Quote:




<service>
<name>Test</name>

<service-location>com.jakestone.bm.Test</service-location>
<invoker-ref>Java</invoker-ref>
<method>
<!-- Operation's are matched by the name and
parameters -->
<name>sayHello</name>
<state-bean-ref>
<name>Authentication</name>
</state-bean-ref>
<parameter>
<!--
type can be the the name of the class,
a * for any types,
or a ? any 1 type
-->
<type>*</type>
</parameter>
</method>

</service>






My server side code is as follows:



ActionScript Code:
package com.jakestone.bm;


import com.jakestone.bm.utils.BMLogManager;

import java.util.logging.Level;
import java.io.Serializable;

public class Test     implements Serializable
{
    public void sayHello(String msg)
    {
       
BMLogManager.getDefaultLogger().log(Level.INFO,  msg+"
to you too");
    }
}


Yet the call to the server creates the following
server side error:



Quote:




May 5, 2005 11:50:48 PM org.openamf.DefaultGateway
logRequestException
SEVERE: Error in service, detail=[AMFBody:
{serviceName=com.jakestone.bm.Test, serviceMethodNam
e=sayHello, response=/1, type=ARRAY,
value=[boopoodeedoo]}], AMFBody=[AMFBody:
{serviceName=com
.jakestone.bm.Test, serviceMethodName=sayHello,
response=/1, type=ARRAY, value=[boopoodeedoo]}]

org.openamf.invoker.ServiceInvocationException:
java.lang.Exception: No service for 'com.jakest
one.bm.Test'
at
org.openamf.DefaultGateway.invokeBody(DefaultGatew ay.java:203)
at
org.openamf.DefaultGateway.processMessage(DefaultG ateway.java:190)
at
org.openamf.DefaultGateway.service(DefaultGateway. java:95)






Can anyone advise me ?

Thanks in advance.


Jake

Web Service In CS3
Hi All,

I have a Flash Application (developed using AS 2.0) that consumes the Web Service using the Web Service Connector.

I would like to migrate to the new AS 3.0. In Flash CS3, I could not find any tutorial of Action Script 3.0 talking about the Web Service / Web Service Connector Component.

Could you please let me know how can I target my application to point the Action Script 3.0 and still use the Web Service Connector component to connect to the Web Service provider and consume it.

Kind Regards,

Anton Nithianandan

Web Service And XML
My question really isn't about how to load XML from a web service. Actually, the code below does that just fine. However, what I am having trouble with is accessing any of the XML data outside of the XMLLoaded function. Currently, if I want to use the XML data inside of other functions, I need to keep those functions nested withing the XMLLoaded function. For example, if I run the trace outside of the XMLLoaded function, a null value is returned. I'm sure that this is probably very simple but how would I get access to that data outside of it's own function? It's been a long week and I'm sure that my description of the problem is as confusing to you as the problem itself is confusing to me. Any help, however, would be greatly appreciated. Thank you.









Attach Code

import alducente.services.WebService;
import flash.events.*;

var ws:WebService = new WebService();
ws.addEventListener(Event.CONNECT, connected);
ws.connect("http://10.1.138.22/FlashVideo/Service.asmx?WSDL");
ws.cacheResults = true;

var initTime:Number;
var flashVideo:XMLList;
var soap:Namespace = new Namespace("http://schemas.xmlsoap.org/soap/envelope/");
var fv:Namespace = new Namespace("http://tempuri.org/");
default xml namespace = fv;

function connected(evt:Event):void {
ws.removeEventListener(Event.CONNECT, connected);
ws.GetFlashVideoData(XMLLoaded, 1);
}

function XMLLoaded(XMLData:XML):void {
flashVideo = XMLData.soap::Body.GetFlashVideoDataResponse.GetFlashVideoDataResult;
trace(flashVideo.MediaTitle);
}

AIR Using A Web Service
I'm trying to use a web service I created but it's not working. I'm pretty sure I'm doing it all wrong but all the tutorials I found are much more complicated than what I need and I don't have much Flex/AS experience.

So the web service I created simply returns a string and I'd like to assign that string to a variable. Here's the code I'm using:


Code:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:text="flash.text.*" applicationComplete="loadList();">
<mx:Label id="txtTest" />
<mx:Script>
<![CDATA[

import mx.rpc.soap.WebService;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;

private var ws:WebService;
public var resultStr:String;

public function loadList():void
{
ws = new mx.rpc.soap.WebService();
ws.destination = "https://secure.mojointeractive.com/Flex/Quote.cfc?wsdl";
ws.getToParseList.addEventListener("result", updateParseList);
ws.addEventListener("fault", faultHandler);
ws.loadWSDL();
ws.getToParseList();
}

private function updateParseList(event:ResultEvent):void
{
resultStr = event.result.echoStr;
txtTest.text = resultStr;
}

private function faultHandler(event:FaultEvent):void
{
txtTest.text = "Error: " + event.fault.faultString;
}
]]>
</mx:Script>
</mx:WindowedApplication>
Any help would be greatly appreciated.

Web Service's
Please can some one provide links to free, open to use web services for ideally SPORT NEWS or Weather!

When I say free, I mean no charges. I know appreciation links etc will need to be complied with.

Been looking and can't seem to find any.

Map Web Service
Hi

i have in the past set clients up with news feed web services but looking at firegamblers site made me wonder if anyone knew of a free map feed. i use nusoap (for wsdl generation) and if i was to offer this service it would have to displayed in the flash movie and not load another page.

i know that there are 10's of thousands of these free feeds but i cant find an index for them.

anybody know where i can find a map feed or an index.

Web Service Component
Is it possible to store results from the web service component (Flash MX 2004 pro) in variables using actionscript.

Web Service Woes
We have set up a web service that a flash movie uses to communicate with our database.

The reason for this is that we give our flash movie to companies that enable them to use our services.

We have run into a strange situation with one client where they cannot access the web service from their network.

Every situation we have setup has not been able to reproduce the error.

I believe this to be a firewall issue, however if they run the movie as a standalone then it works.

So this seems to be a flash player security issue.

We have the crossdomain.xml file set up properly and have tested this scenerio on nearly 10 different domains. Each works.

Has anyone run into a similar situation?

Web Service Problem
Im trying to use a weather web service in flash mx2004, but for some reason I cant get the service wsdl to load. Here's the code I'm using.


Code:
import mx.services.*;
var weatherService = new WebService("http://live.capescience.com/wsdl/GlobalWeather.wsdl");
weatherService.onLoad = function() {
trace("loaded");
};
stop();


Note that this code works if I use this wsdl for stock quotes:

http://www.xmethods.net/sd/StockQuoteService.wsdl

Also, the weather web service wsdl seems to work fine when I input it in the web-services panel in flash. I dont understand why it doesn't work when I publish the above code!

I found the service here:

http://www.capescience.com/webservic...er/index.shtml

I hope someone can help!!!

Thanks

Tim.

Comsuming A Web Service?
I need to reuse VC++ DLLs in my Flash MX Appl, how can I achieve this?

Baby's First Web Service
Could someone point me to a basic tutorial on the use of Flash MX Pro's data integration with a web service? Just started using Flash again (first time since 4.0) and I'm rather lost as to where to start regarding this.

Also, is Flash Remoting only necessary when you want to overcome Flash's inherent 'sandbox' policy of only allowing connections within the same domain?

Thanks guys

Web Service Problems
Is anyone having problems with handling the delay between calling a web service and getting a return result from the service in actionscript?

I have a class that calls a web service, then sets the class properties according to the return data from the service. The problem is, the class props aren't being set properly because the service is taking a little bit of time to return a result. Is there some way of using an event listener to have the class 'stall'? Is there anyone out there with the same problem - and may have a solution?

Xp Service Pack 2
is there a way to check if the user had xp service pack 2 installed ...

this way if it is i can instruct the user to allow blocked content

Calling Web Service
How do I call a web service on a click of a button?

Web Service Connector
i'm currently using the web service connector, the data set and data grid for a database/coldfusion/flash project. how can i get rid of the component and use actionscript so i can allow the user to see if there's and error and when it's loading and submitting.

or is there an easy way to do it in my coldfusion code or with the results of the web service connector.

Web Service Error
Hi All,

I'm having an issue connecting to a web service, the error is below, any ideas would be great!


Code:
log: 10/23 21:43:22 [INFO] SOAP: Asynchronously invoking SOAPCall: GetScratched
log: 10/23 21:43:22 [INFO] SOAP: Encoding SOAPCall request
log: 10/23 21:43:22 [DEBUG] SOAP: Creating HTTP request object
log: 10/23 21:43:22 [DEBUG] SOAP: Encoding SOAP request envelope
log: 10/23 21:43:22 [DEBUG] SOAP: Encoding SOAP request body
log: 10/23 21:43:22 [INFO] SOAP: Sent SOAP Request Message
Error opening URL "http://ww3.enterdraw.com/WebService/Scratchy.asmx"
log: 10/23 21:43:22 [INFO] SOAP: Received SOAP response from network [119 millis]
log: 10/23 21:43:22 [INFO] SOAP: Decoding SOAPCall response
log: 10/23 21:43:22 [DEBUG] SOAP: No response received from remote service
found fault
faultactor : http://webservice.enterdraw.com/
faultNamespaceURI : undefined
element : undefined
detail : undefined
faultstring : Unable to connect to endpoint: http://ww3.enterdraw.com/WebService/Scratchy.asmx
faultcode : Server.Connection

Web Service Data Help
Hi,

I'm a little confused about the use of web services with Flash. What type of data can Flash handle receiving? And does it matter what language the web service is written in (php, .NET, etc)?

Reading Adobe.com, it seems Flash can handle receiving just about anything back, even things like arrays. However, after attempting this and reading up on it elsewhere, it sounds like Flash cannot, in fact, handle receiving arrays or other complex serialized data. Can someone enlighten me as to the truth?

thanks!

Trying To Connect To A Web Service [CS3]
I'm trying to connect a Flash interface with a web service over the company intranet, and so far having no luck at all. While I have a pretty good Flash background, my experience with other web technologies is limited. The web service, which spits back XML, has been put together by a web developer who doesn't have a lot of experience with Flash. I'm using a web service object to connect, and the URL he has given me to connect to looks like this:

"http://usdev.somedomain.com/PrintWebService/printwebservice.asmx?op=FindAllOfficesXML"

"http://usdev.somedomain.com/PrintWebService/printwebservice.asmx" is the web service itself and "FindAllOfficesXML" is the web service method.

But every example I can find of URLs for web services in Flash ends in ".wsdl". Is this significant? What would he need to do generate a web service whose path ends in ".wsdl" instead of ".asmx"?

[Tutorial] - Using Web Service With AS3
Some of you may have caught my post about sending XML to webservices when I was looking for a solution. Well after playing around and implementing the 'wellconsidered' webservice component, I came up with some simple classes to help with implementing the process. Hopefully this tutorial will help some of you save some time in the future when working with .NET webservices and AS3. Please note, before we get started you will need to download the wellconsidered webservice component here: http://www.wellconsidered.be/blog/as...ice-component/. So, Let's get started shall we?

The concrete classes are:
WebServiceAbstract
ServiceWrapperEvent

The wrapper class will be what you setup to expose your webservics methods. The reason I have created mine this way is to reduce writing chunks of the same code over again and also to allow me to easily instantiate an API to my webservices according to which one I want to use.

For the WebServiceAbstract class we code the following:

PHP Code:



package  
{
    import ServiceWrapperEvent;  // import namespace for custom event
    import flash.errors.IllegalOperationError;
    import flash.events.EventDispatcher;
    import flash.events.Event;
    import be.wellconsidered.services.WebService;
    import be.wellconsidered.services.Operation;
    import be.wellconsidered.services.events.OperationEvent;
    
    public class WebServiceAbstract extends EventDispatcher
    {
        private var _ws:WebService;
        protected var _operation:Operation;
        protected var _currentOperation:String;
        
        public function WebServiceAbstract(webServiceURL:String)
        {
            // set webservice location
            _ws = new WebService(webServiceURL);
            // create operation object to make calls to the web service
            _operation = new Operation(_ws);
            
            // register listeners for operation event results
            _operation.addEventListener(OperationEvent.COMPLETE, onComplete);
            _operation.addEventListener(OperationEvent.FAILED, onFailed);
        }
        
        
        // Operation listeners
        private function onComplete(e:OperationEvent):void
        {
            //trace("onComplete:", _currentOperation);
            dispatchEvent(new ServiceWrapperEvent(ServiceWrapperEvent.SW_RESPONSE_COMPLETE, _currentOperation, e.data));
            _currentOperation = "";
        }
        
        private function onFailed(e:OperationEvent):void
        {
            //trace("onFailed:", e.data.toString());
            dispatchEvent(new ServiceWrapperEvent(ServiceWrapperEvent.SW_RESPONSE_FAIL, _currentOperation, e.data));
            _currentOperation = "";
        }
    }
    
}




First off, you will notice that we are inheriting EventDispatcher class to allow event functionality to be used with the class abstract. Also, in the constructor, we are passing in our URL location for our web service to gain access to it.

Next you will see the 3 variables. The _ws (webservice) variable is set to private because once instantiated in the constructor, there will be no other reason to access it. The other 2 variables are set to protected to allow the custom wrapper class access to the inherited properties. If you are using FlashDevelop or some other editor with a nice auto-complete feature, this also comes in handy because _ws will not get populated to the auto-complete list, but the others will.

Also inside the constructor, you will see the instantiation of the operation object and registration to the onComplete and onFailed handlers.

The _currentOperation variable is used to determine what web service method is returning the event. I am a big fan of switch case method filtering for events and you will see the advantages of this variable in just a minute.

The event handlers are pretty straight forward. They dispatch the ServiceWrapper event and add the value of the currentOperation and the returned data from the OperationEvent. Also, they clear out the _currentOperation variable after dispatch. This way if you want to expose the variable through a public method, you can test against it and if it returns an empty string, then you know the web service is sitting idle.


Time to move on to the ServiceWarpperEvent.

ServiceWrapperEvent:

PHP Code:



package  
{
    import flash.events.Event;
    
    /**
     * ...
     * @author TJ Jones
     *
     * @version 1.0.0.0
     * @param operation - name of the web service operation/method
     * @param data - returned data from web service
     * @usage Proprietary - This Event is only dispatched by ServiceWrapper classes.  You must
     * register your listeners for this event in order to retrieve data returned from the
     * targeted web service.
     */

    public class ServiceWrapperEvent extends Event
    {
        public static const SW_RESPONSE_COMPLETE:String = "sw_response_complete";
        public static const SW_RESPONSE_FAIL:String = "sw_response_fail";
        
        private var _operation:String;
        private var _data:Object;
        
        public function ServiceWrapperEvent(type:String, operation:String=null, data:Object=null, bubbles:Boolean = true, cancelable:Boolean = false)
        {
            super(type, bubbles, cancelable);
            _operation = operation;
            _data = data;
        }
        
        public function get operation():String
        {
            return _operation;
        }
        
        public function get data():Object
        {
            return _data;
        }
        
        // Every custom event class must override clone(  )
        public override function clone(  ):Event
        {
            return new ServiceWrapperEvent(type, _operation, _data, bubbles, cancelable);
        }
        
                // Every custom event class must override toString(  ). Note that
        // "eventPhase" is an instance variable relating to the event flow.
        public override function toString(  ):String
        {
            return formatToString("ServiceWrapperEvent", "type", "operation", "data", "bubbles", "cancelable", "eventPhase");
        }
        
    }
    
}




Nothing special here. If you are familiar at all with Event handling, and extending the Event Class, then everything here is pretty straight forward. I also left my comments on usage in the header. If you don't understand something about this class, I recommend taking some time to read and research event handling in AS3.

Now for the ServiceWrapper class:

PHP Code:



package com.skyangel.webServices.skydev
{
    import be.wellconsidered.services.events.WebServiceEvent;
    import ServiceWrapperEvent;
    import WebServiceAbstract;
    import flash.errors.IllegalOperationError;
    import flash.events.EventDispatcher;
    import flash.events.Event;
    import be.wellconsidered.services.WebService;
    import be.wellconsidered.services.Operation;
    import be.wellconsidered.services.events.OperationEvent;
    
    /**
     * ...
     * @author TJ Jones
     *
     * @version 1.0.0.0
     * @param
     * @param
     * @dependencies:
     *         WebServiceAbstract
     *         be.wellconsidered.services.WebService
     *         be.wellconsidered.services.Operation
     *         be.wellconsidered.services.events.OperationEvent
     *
     * @usage - You will need to add the wellconsidered as3webservices component to your library.
     * All webservice functions are wrapped and exposed through public functions of the same name.  The
     * event object dispatched also carries the name of the operation for filtering processes in
     * your application.
     */
    
    public class SiteMapServiceWrapper extends WebServiceAbstract
    {
        private var _returnedData:String;
        
        public function SiteMapServiceWrapper()
        {
            // set webservice location
            super("https://your.web.service/SiteMap.asmx?wsdl");
        }
        
        // :::Web Service Operation wrappers:::
        public function GetSiteMapByID(i:int):void
        {
            _currentOperation = "GetSiteMapByID";
            _operation.GetSiteMapByID(i);
        }
        
        public function CreateNew(name:String, map:String, comments:String = null):void
        {
            _currentOperation = "CreateNew";
            _operation.CreateNew(name, map, comments);
        }
        
        public function DeleteByID(i:int):void
        {
            _currentOperation = "DeleteByID";
            _operation.DeleteByID(i);
        }
        
        public function GetSiteMapsList():void
        {
            _currentOperation = "GetSiteMapsList";
            _operation.GetSiteMapsList();
        }
        
        public function UpdateByID(id:int, name:String, map:String, comments:String):void
        {
            _currentOperation = "UpdateByID";
            _operation.UpdateByID(id, name, map, comments);
        }
        
        public function UpdateMapXmlByID(id:int, map:String):void
        {
            _currentOperation = "UpdateMapXmlByID";
            _operation.UpdateMapXmlByID(id, map);
        }
        
        public function UpdateNameByID(id:int, name:String):void
        {
            _currentOperation = "UpdateNameByID";
            _operation.UpdateNameByID(id, name);
        }
        // :::::::::::::::::::::::::::::::::::: //
    }
    
}




As you can see, we inherit the WebServiceAbstract class, and in the constructor pass the url for our webservice to it through the super() call. I have hardcoded my urls in the wrapper classes because the wrapper is specific to the service it connects to.

Next you will see several public methods. These methods reflect my web service operations signatures exactly. This helps to keep things easy to follow, especially if you have a web service with a ton of operations.

Also notice that the _currentOperation variable is being set to the name of the method called. You will see this value used as a filter in a moment.

Here is a snippet from my web service in C# to give you an idea of what's happening beyond Flash:

PHP Code:



    [WebMethod]
    [XmlInclude(typeof(SiteMapData))]
    public ArrayList GetSiteMapByID(int ID_SM)
    {
        ArrayList result = new ArrayList();
        
        string query = "EXECUTE sp_Site_Map_Get_By_ID " + ID_SM  + ";";
        SqlDataReader objRdr = SqlSkyAngel.selectDataIntoReader(query, "Intranet");

        if (objRdr.HasRows)
        {
            while (objRdr.Read())
            {
                SiteMapData siteMapData = new SiteMapData();
                siteMapData.ID_SM = Convert.ToInt32(objRdr["ID_SM"]);
                siteMapData.NAME = objRdr["NAME"].ToString();
                siteMapData.MAP = objRdr["MAP"].ToString();
                siteMapData.COMMENTS = objRdr["COMMENTS"].ToString();
                result.Add(siteMapData);
            }
        }
        return result;
    }





The only thing left is implementation and use of the new classes. We need to instantiate the object, register a listener, and fire off a web service operation through one of the wrapper's public methods. Here is an example from my application to give you some idea of how this would be done:

PHP Code:



            // construct the wrapper object
            _siteMapServiceWrapper = new SiteMapServiceWrapper();
            // Register listener
            _siteMapServiceWrapper.addEventListener(ServiceWrapperEvent.SW_RESPONSE_COMPLETE, processServiceData);
            // make a call to the web serivce operation
            _siteMapServiceWrapper.GetSiteMapsList();




As you can see, all 3 items are taken care of. Now we just need to handle the returned event. Here is my processServiceData() handler:

PHP Code:



        private function processServiceData(e:ServiceWrapperEvent):void
        {    
            switch (e.operation)
            {
                case "GetSiteMapByID":
                    trace("GetSiteMapByID:", e.data[0][2]);
                    var xml:XML = new XML(String(e.data[0][2]));
                    dispatchEvent(new MapPanelEvent(MapPanelEvent.SELECT_MAP, xml, String(e.data[0][0])));
                    // make calls to load the site map
                break;
                
                case "CreateNew":
                    //trace(e.data);
                    _siteMapServiceWrapper.GetSiteMapByID(int(e.data));
                break;
                
                case "DeleteByID":
                    
                break;
                
                case "GetSiteMapsList":
                    //trace("processServiceData");
                    //var xml:XML = new XML();
                    
                    loadMapListComboBox(e.data);
                break;
                
                case "UpdateByID":
                break;
            }
        }




Even though I do not have code to handle every operation, you can see how my switch/case statement makes it very easy to filter the results accordingly.

Hopefully this tutorial will help some of you with speed and ease of implementing web services in your projects. Please feel free to ask questions or leave comments.

Also, I need to credit pigpen for the inspiration for writing this tutorial. He was nice enough to point me over to the wellconsidered component, which allowed me to take it to the next level.

Enjoy!

-Error In Service
Hi all,

I'm trying to configure openamf with tomcat-5.0.28.I can deploy openamf as a war file
successfully without any error on tocat server console, but when I try to access http://localhost:8080/openamf/gateway link following error appears in on the tomcat
server console.
I've tried with many ways to solve this but all in vain.So any help highly appreciated.

- Server startup in 14875 ms
- Deserializing Message, for more info turn on debug level
- Error in service
java.io.EOFException
at java.io.DataInputStream.readUnsignedShort(DataInpu tStream.java:400)
at org.openamf.io.AMFDeserializer.readHeaders(AMFDese rializer.java:100)
at org.openamf.io.AMFDeserializer.<init>(AMFDeseriali zer.java:80)
at org.openamf.DefaultGateway.deserializeAMFMessage(D efaultGateway.java:
155)
at org.openamf.DefaultGateway.service(DefaultGateway. java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(Appl
icationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationF
ilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperV
alve.java:214)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValv
eContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.jav
a:520)
at org.apache.catalina.core.StandardContextValve.invo keInternal(Standard
ContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextV
alve.java:152)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValv
eContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.jav
a:520)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.j
ava:137)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValv
eContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.j
ava:118)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValv
eContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.jav
a:520)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineVal
ve.java:109)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValv
eContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.jav
a:520)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:16
0)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java
:799)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.proce
ssConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java
:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadP
ool.java:683)
at java.lang.Thread.run(Thread.java:534)

Web Service Authentication
I need to call a web service from Flash 8 but the service is requires basic HTTP authentication. How can I send this information? Flash can't even download or view the wsdl because it is being asked for username/password. I'm using the WebService class.

Thanks.

Web Service Error
Hi All,

I'm having an issue connecting to a web service, the error is below, any ideas would be great!


Code:
log: 10/23 21:43:22 [INFO] SOAP: Asynchronously invoking SOAPCall: GetScratched
log: 10/23 21:43:22 [INFO] SOAP: Encoding SOAPCall request
log: 10/23 21:43:22 [DEBUG] SOAP: Creating HTTP request object
log: 10/23 21:43:22 [DEBUG] SOAP: Encoding SOAP request envelope
log: 10/23 21:43:22 [DEBUG] SOAP: Encoding SOAP request body
log: 10/23 21:43:22 [INFO] SOAP: Sent SOAP Request Message
Error opening URL "http://ww3.enterdraw.com/WebService/Scratchy.asmx"
log: 10/23 21:43:22 [INFO] SOAP: Received SOAP response from network [119 millis]
log: 10/23 21:43:22 [INFO] SOAP: Decoding SOAPCall response
log: 10/23 21:43:22 [DEBUG] SOAP: No response received from remote service
found fault
faultactor : http://webservice.enterdraw.com/
faultNamespaceURI : undefined
element : undefined
detail : undefined
faultstring : Unable to connect to endpoint: http://ww3.enterdraw.com/WebService/Scratchy.asmx
faultcode : Server.Connection

Web Service Problem
dear all, i am facing some problem when building flash web service application. the web service is when i test the movie at flash 8 however when i run it just double click the swf or put it into the web server, it have some error, the error is
stat.data.faultcode==Client.Disconnected
stat.data.faultstring==Could not load WSDL
stat.data.detail==Unable to load WSDL, if currently online, please verify the URI and/or format of the WSDL (http://wingwa.no-ip.org/WebProj/wsdl/Converter.wsdl)

my code is as below


PHP Code:



System.security.allowDomain("http://wingwa.no-ip.org");
import mx.data.components.WebServiceConnector;
var pf:String="http://www.acad.polyu.edu.hk/~04061612d/thomas/crossdomain.xml";
System.security.loadPolicyFile(pf);
var tipWS:WebServiceConnector = new WebServiceConnector();
var WSListener:Object = new Object();
WSListener.send = function(evtObj:Object):Void {
    error_txt.text="sending data";
}
WSListener.result = function(evtObj:Object):Void {
  trace (evtObj.target.results);
  result_txt.text=evtObj.target.results;
};
WSListener.status = function (stat) {
    if (stat.code == "WebServiceFault"){
        error_txt.text="stat.data.faultcode=="+stat.data.faultcode+
        "  
stat.data.faultstring=="+stat.data.faultstring+"    
stat.data.detail=="+stat.data.detail;
      //  trace(stat.data.faultstring);
      //  trace(stat.data.detail);
    }
};

tipWS.addEventListener("send", WSListener);
tipWS.addEventListener("result", WSListener);
tipWS.addEventListener("status", WSListener);
//tipWS.WSDLURL = "http://www.flash-mx.com/mm/tips/tips.cfc?wsdl";
tipWS.WSDLURL="http://wingwa.no-ip.org/WebProj/wsdl/Converter.wsdl";
tipWS.operation = "celsiusToFarenheit";
//tipWS.operation="getTipByProduct";
tipWS.multipleSimultaneousAllowed = false;
tipWS.suppressInvalidCalls = true;
process_btn.onPress=function(){
    tipWS.params = [temp.text];
//    tipWS.params=["Flash"];
    tipWS.trigger();


Bank Web Service
Hi I just wanted to know if someone here knew a payment service that I could deploy for my webpage, You have seen it allover-a safe, secure way to shop stuff. Which and how is what im wondering, also all other information conserning expenses etc. Thanx in advance, JR

Web Service Question
Working with web services for the first time. I am using a web service in a flash movie to calculate the distance between zip codes. The app works great in test, works great in publish preview (HTML). But when I upload to the web, Nothing.

Any thoughts?

Flash Web Service Bug?
Problem: Flash Web Service is working from any PC from Intranet but not using External IPs.

I have created ASP.NET Web Service "RunSQLQuery", and Web Application "Web_ServiceTest" consuming this Service using C#,
and Flash ".swf" calling the same Web Service. For debug purposes this ".swf" is included to "Web_ServiceTest" only web page as iframe.
All ("RunSQLQuery", "Web_ServiceTest" ,".swf") are placed to the same machine.


Being desperate I step-by-step placed "crossdomain.xml" file
with
<allow-access-from domain="*" secure="false" />
to almost all folders like:
C: ; C:inetpub; C:inetpubwwwroot; and all folders and subforlders were "RunSQLQuery", "Web_ServiceTest" and ".swf" reside (even to "bin")

When I'm calling Web Service from ASP.NET part of "Web_ServiceTest" everything is OK from any IP,
but neighboring Flash works for Internal (192.168.xxx.xxx) company addresses only, not for External.
And no any response/results...

Unfortunately I can't use Proxy or Flash Remoting.

Does anybody has any idea how to resolve this issue?

Consuming An XML Service
I want my Flash program to use LoadVars to get data from an XML service every 60 seconds...or some relative timeout value. What does LoadVars support in terms of an event that can handle such a callback?

I have AJAX code that updates the webpage every 60 seconds, but I want to use Flash for a part of my project (the graphics part). If PHP or JavaScript support is needed to help support LoadVars, I can definitely implement such code - I just need the basic pseudo-code or design pattern for how to approach this - like if LoadVars has a timeout event for a callback for more XML (or variable) data.

Web Service Error
calling .net web service, sometimes see Unable to connect to endpoint and Timeout while calling method, any suggestion to improve the performance? thanks ahead!

Web Service(soap)
is there any option to use web services in actionscript 1.is it possible???

Connect To A Web Service?
Can someone please tell me how to connect to a web service and receive the array and display it in AS 2.0? It's more then one item in the array I will receive. I need to do it by code and can not use Web Service connector.

Web Service Question
Hey all, thanks for reading this!

I have a flash project im working on ... and I need it to access a webservice quite often ... like, multiple times a seconrd ... well, that part of it is fine. However, I run across issues when Im calling the webservice from multiple places at the same time.

I have a Symbol, that has an OnClipEvent(enterFrame) event ... and it calls the webservice, then I have another one. and it seems to be messing with stuff because its a hit and miss situation.

Sometimes it works, sometimes it doesnt. Is this a little too much to ask for flash and webservices or am I going about it the wrong way?

FMS Service STOPS
Hello,

This is pissing me off actually, the service is automatically stopping!

FMS version is 2.0.1, i am using windows XP. I am having this problem since today only! i thought that it might be services conflict issue, so i stopped most of the services that are not by MICROSOFT, and still the FMS stops after exactly 4 seconds or sometimes less.

I am using the Developer edition. is there any limitation for that edition such as expiring after 3 or 4 weeks? i guess not!

PLease help...

and yeah, i tried to reinstall the FMS, did not work out.

FMS Service Log On Account
Hello,

FMS 2.0.3
OS; Windows 2003 Enterprise Edition SP1

I am going to have the applications and content directories located off the local FMS platform and on an NAS. Both the FMS Server platform and the NAS are on an AD domain, so a generic AD account is needed to run the FMS service so FMS can access the NAS shares as needed. The default “Local System account” won’t work for the NAS access.

What are the minimum permission required by the account that runs the FMS service?

Thanks
~John

Web Service Support ?
Hi at all
How i can access at Web Service writed in .Net with Flash CS3/AS3?

In AS2 I use the Web Service Connector.
With AS3 I haven't found it.

I have visit more and more forum but with no a really solution for
this problem.

The only solution is Remoting ?

A.

LoadMovie And Web Service
hey action script gurus,

in my flash movies i can do this with no trouble

loadMovie("http://www.petdoors.com.au/staywell19.jpg",destinationMovie);

and load a picture of that cute cat in a movie. But when i try to access a jpeg that is dynamically generated by the server based on a url, such as this one:

http://128.138.165.117/cgi-bin/mapse...s=cities,roads

the picture never shows up inside my movie. This is a web map service that returns maps based on the information passed in the url . That link works just fine in a browser but it doesnt seem to work with a simple loadMovie. Let me add that the jpeg never actually exists as a file on the server, but only on the client. Any idea of how I could load that jpeg into flash?

Weather Web Service
hi there, I was wondering how I can invoke some certain information about a certain city ( Mexico City ) using a WebService, I was trying with this one: http://www.webservicex.net/globalweather.asmx?WSDL but is not working, can someone helpme please?, I was reading any tutorial about web services within Flash MX Pro, but I missing something....

Thanks a lot!

Anyone Know Of A Web Service For UK Postcodes?
Yo, I am trying to verify UK postcodes from my Flash site and wondered if anyone knows of a SOAP web service for UK postcodes or if anyone has seen a function online that will do this.
Thanks guys,
Hectors

Web Service Error
Hi All,

I'm having an issue connecting to a web service, the error is below, any ideas would be great!


Code:
log: 10/23 21:43:22 [INFO] SOAP: Asynchronously invoking SOAPCall: GetScratched
log: 10/23 21:43:22 [INFO] SOAP: Encoding SOAPCall request
log: 10/23 21:43:22 [DEBUG] SOAP: Creating HTTP request object
log: 10/23 21:43:22 [DEBUG] SOAP: Encoding SOAP request envelope
log: 10/23 21:43:22 [DEBUG] SOAP: Encoding SOAP request body
log: 10/23 21:43:22 [INFO] SOAP: Sent SOAP Request Message
Error opening URL "http://ww3.enterdraw.com/WebService/Scratchy.asmx"
log: 10/23 21:43:22 [INFO] SOAP: Received SOAP response from network [119 millis]
log: 10/23 21:43:22 [INFO] SOAP: Decoding SOAPCall response
log: 10/23 21:43:22 [DEBUG] SOAP: No response received from remote service
found fault
faultactor : http://webservice.enterdraw.com/
faultNamespaceURI : undefined
element : undefined
detail : undefined
faultstring : Unable to connect to endpoint: http://ww3.enterdraw.com/WebService/Scratchy.asmx
faultcode : Server.Connection

Web Service Error
Hi All,

I'm having an issue connecting to a web service, the error is below, any ideas would be great!


Code:
log: 10/23 21:43:22 [INFO] SOAP: Asynchronously invoking SOAPCall: GetScratched
log: 10/23 21:43:22 [INFO] SOAP: Encoding SOAPCall request
log: 10/23 21:43:22 [DEBUG] SOAP: Creating HTTP request object
log: 10/23 21:43:22 [DEBUG] SOAP: Encoding SOAP request envelope
log: 10/23 21:43:22 [DEBUG] SOAP: Encoding SOAP request body
log: 10/23 21:43:22 [INFO] SOAP: Sent SOAP Request Message
Error opening URL "http://ww3.enterdraw.com/WebService/Scratchy.asmx"
log: 10/23 21:43:22 [INFO] SOAP: Received SOAP response from network [119 millis]
log: 10/23 21:43:22 [INFO] SOAP: Decoding SOAPCall response
log: 10/23 21:43:22 [DEBUG] SOAP: No response received from remote service
found fault
faultactor : http://webservice.enterdraw.com/
faultNamespaceURI : undefined
element : undefined
detail : undefined
faultstring : Unable to connect to endpoint: http://ww3.enterdraw.com/WebService/Scratchy.asmx
faultcode : Server.Connection

LoadMovie And Web Service
hey action script gurus,

in my flash movies i can do this with no trouble

loadMovie("http://www.petdoors.com.au/staywell19.jpg",destinationMovie);

and load a picture of that cute cat in a movie. But when i try to access a jpeg that is dynamically generated by the server based on a url, such as this one:

http://128.138.165.117/cgi-bin/mapse...s=cities,roads

the picture never shows up inside my movie. This is a web map service that returns maps based on the information passed in the url . That link works just fine in a browser but it doesnt seem to work with a simple loadMovie. Let me add that the jpeg never actually exists as a file on the server, but only on the client. Any idea of how I could load that jpeg into flash?

Web Service Error
Hi All,

I'm having an issue connecting to a web service, the error is below, any ideas would be great!


Code:
log: 10/23 21:43:22 [INFO] SOAP: Asynchronously invoking SOAPCall: GetScratched
log: 10/23 21:43:22 [INFO] SOAP: Encoding SOAPCall request
log: 10/23 21:43:22 [DEBUG] SOAP: Creating HTTP request object
log: 10/23 21:43:22 [DEBUG] SOAP: Encoding SOAP request envelope
log: 10/23 21:43:22 [DEBUG] SOAP: Encoding SOAP request body
log: 10/23 21:43:22 [INFO] SOAP: Sent SOAP Request Message
Error opening URL "http://ww3.enterdraw.com/WebService/Scratchy.asmx"
log: 10/23 21:43:22 [INFO] SOAP: Received SOAP response from network [119 millis]
log: 10/23 21:43:22 [INFO] SOAP: Decoding SOAPCall response
log: 10/23 21:43:22 [DEBUG] SOAP: No response received from remote service
found fault
faultactor : http://webservice.enterdraw.com/
faultNamespaceURI : undefined
element : undefined
detail : undefined
faultstring : Unable to connect to endpoint: http://ww3.enterdraw.com/WebService/Scratchy.asmx
faultcode : Server.Connection

Flash And .Net Web Service
Hi,
I was wondering if anyone could help me with a troublesome problem I cannot seem to solve.



itemUID = "00000000RZ";

var variables:URLVariables = new URLVariables("var1=" + itemUID + "&var2=4");
var request:URLRequest = new URLRequest();

try
{
request.url = "http://192.168.1.20/services/Service1.asmx/getImageData";
request.method = URLRequestMethod.POST;
request.data = variables;
}
catch (error: Error)
{
//throw some error
}

var loader:URLLoader = new URLLoader();
loader.load(request);
loader.addEventListener(Event.COMPLETE, completeHandler);

function completeHandler(event:Event):void
{

var retVal:String = event.target.data;
lblError.text = "retVal: " + retVal.length.toString() + " " + retVal;
}

I would like to access a .Net 2.0 web service in flash. It works fine when being developed tested within a local environment but when it comes time to test flash using a remote client (web browser on another machine) accessing my server (iis 6.0),
I get the following error messages:


Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://192.168.1.20/services/Service1.asmx/getImageData
at imageViewII_fla::MainTimeline/imageViewII_fla::frame1()


The web service works perfectly and has been throughly tested. I have simple http get/post over soap as flash professional 9.0
doesn't fully support soap, only flex does. I have tried in flex and get similar errors.

At this stage I can only assume that there is either a permissions issue with iis or I am missing something major
about how the flash loader works.

Has anyone had issues like this before or have any insight into solving this problem

Thanks
Matt

Flash As A Service
Is it possible to have a flash program (exported as an exe) run as a service?  Or even, just run in the background, but one that doesn't need focus to capture key strokes?  Basically, it would run like a keylogger would (I know, evil word) but instead of tracking all key presses, it would only keep track of how many times certain keys are pressed.  I have the code to capture the key presses, and it outputs a report along the lines of

A pressed 312 times
F pressed 118 times

etc.

I want this to run in the background, preferrably in the tray, and keep track of key strokes as the user types an e-mail, etc.  

Thanks in advance

Al Ridley
Lucid Web Designs

Problem About Using Web Service
dear all, i am facing some problem when building flash web service application. the web service is when i test the movie at flash 8 however when i run it just double click the swf or put it into the web server, it have some error, the error is
stat.data.faultcode==Client.Disconnected
stat.data.faultstring==Could not load WSDL
stat.data.detail==Unable to load WSDL, if currently online, please verify the URI and/or format of the WSDL (http://wingwa.no-ip.org/WebProj/wsdl/Converter.wsdl)

my code is as below


ActionScript Code:
import mx.data.components.WebServiceConnector;
var pf:String="http://www.acad.polyu.edu.hk/~04061612d/thomas/crossdomain.xml";
System.security.loadPolicyFile(pf);
var tipWS:WebServiceConnector = new WebServiceConnector();
var WSListener:Object = new Object();
WSListener.send = function(evtObj:Object):Void {
    error_txt.text="sending data";
}
WSListener.result = function(evtObj:Object):Void {
  trace (evtObj.target.results);
  result_txt.text=evtObj.target.results;
};
WSListener.status = function (stat) {
    if (stat.code == "WebServiceFault"){
        error_txt.text="stat.data.faultcode=="+stat.data.faultcode+
        " 
stat.data.faultstring=="+stat.data.faultstring+"   
stat.data.detail=="+stat.data.detail;
      //  trace(stat.data.faultstring);
      //  trace(stat.data.detail);
    }
};
 
tipWS.addEventListener("send", WSListener);
tipWS.addEventListener("result", WSListener);
tipWS.addEventListener("status", WSListener);
//tipWS.WSDLURL = "http://www.flash-mx.com/mm/tips/tips.cfc?wsdl";
tipWS.WSDLURL="http://wingwa.no-ip.org/WebProj/wsdl/Converter.wsdl";
tipWS.operation = "celsiusToFarenheit";
//tipWS.operation="getTipByProduct";
tipWS.multipleSimultaneousAllowed = false;
tipWS.suppressInvalidCalls = true;
process_btn.onPress=function(){
    tipWS.params = [temp.text];
//  tipWS.params=["Flash"];
    tipWS.trigger();
}

FLV Hosting Service
I know this isn't really about Flash, but I couldn't think of anywhere else to post it.

Does anyone know of a free FLV hosting service? I was going to use my account on 4444mb.com to host my FLV's, but unfortunately there is a 5mb file size limit.

Thanks in advance,
Chuckleton

Copyright 2005-08 www.BigResource.com, All rights reserved