Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / November 2003



Tip: Looking for answers? Try searching our database.

Complex WebService

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
benflo - 26 Nov 2003 16:42 GMT
Hi,

we have to use a complex WebService and I got already grey hair.
Sorry about my English.

URL to the WebService: http://80.254.186.217/KEP_Sim/OpcDaGateway.asmx?wsdl .

This WebService uses complex Methods with different parameters, with a .NET client we have no problems to read the WebService.

Two ways to reach the point:
1. Flash Remoting:
With Flash Remoting it is no problem to read the result, but the return from the WebService is not the only thing we won?t to get back. The easiest Method of the WebService is GetStatus, this Method expected 3 Parameter.

Sample code:

#include "NetServices.as"
#include "NetDebug.as"
var stat;

function GetStatus_Result(result) {
    trace(Status);
    trace(result.ReplyTime);
    trace(result.RcvTime);
    trace(result.ServerState);
    for (var i in result.ServerState) {
            trace("i: "+i)
           trace("result: " + i + "  "+ result.ServerState);
            trace(typeof(result.ServerState));
       }
    }
function GetStatus_Status(status) {
    trace("Error:");
    trace("\ttype: " + status.type);
    trace("\tlevel: " + status.level);
    trace("\tcode: " + status.code);
    trace("\tdescription: " + status.description);
    trace("\tdetails: " + status.details);
    }

if (inited == null)
{   
    inited = true;
   
   NetServices.setDefaultGatewayUrl("http://localhost:8080/flashremoting/gateway.aspx");
   
   gateway_conn = NetServices.createGatewayConnection()   
   flashService = gateway_conn.getService("http://localhost:8080/XmlDaSampleServer/Da30Service.asmx?wsdl", this);
flashService.GetStatus("de", "1", stat);
}

stop();

If you use the WebService Browser and have look at the GetStatus Method you can see that the results give you back GetStatusResult and Status.
GetStatusResult is no problem to read but I don?t know how to get the information out of Status. So this was the point when we started to use WebService classes.

2. WebService classes:
The problem here is we can?t read the GetStatusResult but we got two thinks out of Status with no value.

Sample code:

import mx.services.*;
/* webLog */
webLog = new Log(Log.DEBUG);
webLog.onLog = function(txt) {
   trace(txt);
}

var wsdlURI = "http://80.254.186.217/KEP_Sim/OpcDaGateway.asmx?wsdl";
myWebService = new WebService(wsdlURI, webLog);
var myPendingCallObj:PendingCall = myWebService.GetStatus("en", "1", Server);
myWebService.onLoad = trace("loading");
trace("SOAP-Return? : "+ result);
trace("**********************************");
trace("SOAP-Request:1 "+ this.request);
trace("**********************************");
trace("SOAP-Reponse:2 "+ this.response);
trace("**********************************");
trace("SOAP-Values:3 "+ this.myCall);
trace("**********************************");
for (var i in result) {
           trace("i: "+i)
           trace("result: " + i + "  "+result);
           //trace(typeof(result));
       }
};

myPendingCallObj.onFault = function(fault) {
    for(i in fault){
          trace(i+ " : "+fault);
    }
};

I hope it is someone out there to give me same hint?s to solve the problem. If there is any possibility we would prefer the WebService classes.

Thanks benflo
Tom Muck - 26 Nov 2003 19:34 GMT
> If you use the WebService Browser and have look at the GetStatus Method you can see that the results give you back GetStatusResult and Status.
> GetStatusResult is no problem to read but I don?t know how to get the information out of Status. So this was the point when we started to use
WebService classes.

The web service should only return one value or object. The status object is
only returned if there is an error. The result is readable in the onResult
function, and the status is readable in the onStatus function.

> I hope it is someone out there to give me same hint?s to solve the problem. If there is any possibility we would prefer the WebService classes.

If given the choice, I would not use the WebService classes, as the Flash
Player does not have any SOAP parsing ability, and the class used to parse
SOAP results is slow as molassas. Also, the SOAP packets are huge compared
to a Remoting packet--about 4 times bigger or more.

Tom
benflo - 27 Nov 2003 09:32 GMT
Hallo Tom,

I don't mean the Error handling. In results (you can see it at the WebService Browser in FMX 2004) we get back result:
<- GetStatusResult: ReplyBase(Object)
     <- RcvTime: Date(dateTime)
      .....
      .....
<- Status: ServerStatus(Object)
    <- StartTime: Date(dateTime)
    .....
    .....

The WebService supply tow Objects. How do I get the second one (Status from type ServerStatus)?

The read WebService Method supply 3 Objects:

<- ReadResult: ReplayBase(Object)
     <- RcvTime: Date(dateTime)
      .....
      .....
<- RItemList: ReplyItemList(Array)
    <- Reserved: String
    <-[n]: ItemValue(Object)
          <- ItemPath:String(string)
          ???
          ???
<- Errors: Array

Is there any way to get the results of a complex WebService like that.

Rene
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.