如何在Flash Pro中使用Flex SOAP类

如何在Flash Pro中使用Flex SOAP类,flash,apache-flex,soap,Flash,Apache Flex,Soap,有没有一种方法可以使用FLEX从FlashCS5提供的soap web服务类?来自做过同样事情的人 引用一些相关段落: 首先,您需要从flash cs5链接到flex webservices库,您可以在下面的链接中找到它: C:\ProgramFiles(x86)\Adobe\Adobe Flash生成器 4\sdks\4.1.0\frameworks\libs 在flash文档中,首先需要导入web服务命名空间: import mx.rpc.soap.*; import mx.rpc.even

有没有一种方法可以使用FLEX从FlashCS5提供的soap web服务类?

来自做过同样事情的人

引用一些相关段落:

首先,您需要从flash cs5链接到flex webservices库,您可以在下面的链接中找到它:

C:\ProgramFiles(x86)\Adobe\Adobe Flash生成器 4\sdks\4.1.0\frameworks\libs

在flash文档中,首先需要导入web服务命名空间:

import mx.rpc.soap.*;
import mx.rpc.events.*;
import mx.rpc.AbstractOperation;
然后,当您需要调用web服务时,您需要初始化对象,然后加载WSDL调用,在触发事件加载后,您可以从此web服务调用任何方法:

var uNameWebService:WebService;
var serviceOperation:AbstractOperation;
CallService_btn.addEventListener(MouseEvent.CLICK, InitWebService);
function InitWebService(event:MouseEvent):void
{
Result_txt.text = "INIT"
uNameWebService = new WebService();
uNameWebService.loadWSDL("http://localhost:55166/Service1.asmx?WSDL");
uNameWebService.addEventListener(LoadEvent.LOAD, BuildServiceRequest);
}
function BuildServiceRequest(evt:LoadEvent)
{
Result_txt.text = "START"
serviceOperation = uNameWebService.getOperation("GetName");
serviceOperation.addEventListener(FaultEvent.FAULT, DisplayError);
serviceOperation.addEventListener(ResultEvent.RESULT, DisplayResult);
serviceOperation.send();
}
function DisplayError(evt:FaultEvent)
{
trace("error");
}
function DisplayResult(evt:ResultEvent)
{
var UserName:String = evt.result as String;
Result_txt.text = UserName;
}
从做同样事情的人那里

引用一些相关段落:

首先,您需要从flash cs5链接到flex webservices库,您可以在下面的链接中找到它:

C:\ProgramFiles(x86)\Adobe\Adobe Flash生成器 4\sdks\4.1.0\frameworks\libs

在flash文档中,首先需要导入web服务命名空间:

import mx.rpc.soap.*;
import mx.rpc.events.*;
import mx.rpc.AbstractOperation;
然后,当您需要调用web服务时,您需要初始化对象,然后加载WSDL调用,在触发事件加载后,您可以从此web服务调用任何方法:

var uNameWebService:WebService;
var serviceOperation:AbstractOperation;
CallService_btn.addEventListener(MouseEvent.CLICK, InitWebService);
function InitWebService(event:MouseEvent):void
{
Result_txt.text = "INIT"
uNameWebService = new WebService();
uNameWebService.loadWSDL("http://localhost:55166/Service1.asmx?WSDL");
uNameWebService.addEventListener(LoadEvent.LOAD, BuildServiceRequest);
}
function BuildServiceRequest(evt:LoadEvent)
{
Result_txt.text = "START"
serviceOperation = uNameWebService.getOperation("GetName");
serviceOperation.addEventListener(FaultEvent.FAULT, DisplayError);
serviceOperation.addEventListener(ResultEvent.RESULT, DisplayResult);
serviceOperation.send();
}
function DisplayError(evt:FaultEvent)
{
trace("error");
}
function DisplayResult(evt:ResultEvent)
{
var UserName:String = evt.result as String;
Result_txt.text = UserName;
}

Thnx!你有没有一个例子可以将参数传递给服务?我没有,没有。但是,Google around我确信它们确实存在。除了mxml,我发现了很多。。。我将继续搜索…thnx againSecond调用参数传递。我在谷歌上搜索了很久。第三个是参数传递的调用。Thnx!你有没有一个例子可以将参数传递给服务?我没有,没有。但是,Google around我确信它们确实存在。除了mxml,我发现了很多。。。我将继续搜索…thnx againSecond调用参数传递。我已经在谷歌上搜索很久了。第三个是参数传递。