473,765 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with consuming a .NET web service from Flex-ActionScript

4 New Member
Hi I am new to Flex and I use Flex Builder 2 to make a web service client. So I have a web service in .NET(c#) with a simple web method that returns a string(no arguments). It works, I tested it using firefox. I have managed to consume the service in Flex by using MXML like this:

<mx:WebServic e id="wsTestWebSe rvice" wsdl="http://localhost:3521/AjaxControlTool kitWebSite2/TestFlexService .asmx?wsdl"show BusyCursor="tru e" load="wsTestWeb Service.getGame Users()">
</mx:WebService>

and then in a text control I do this:

<mx:Text x="107.5" y="534" width="243" id="text1" height="22" text="{wsTestWe bService.getGam eUsers.lastResu lt}"/>

Now my first question is this: How can I access the string that the wsTestWebServic e returns by actionscript? It seems that if I try to write

text1.text = wsTestWebServic e.getGameUsers. lastResult;

in a .as source file, I get nothing.

The thing is that I want to do everything by using actionscript so I tried that:
I placed a button in my project and a click event handler for that. The code is this:

private var isLoaded:Boolea n = false;
private var hasResult:Boole an = false;

private function OnClick():void
{
var ws:WebService = new WebService();
ws.wsdl = "http://localhost:3521/AjaxControlTool kitWebSite2/TestFlexService .asmx?wsdl";
ws.addEventList ener(LoadEvent. LOAD, load_listener);
ws.addEventList ener(ResultEven t.RESULT, result_listener );
ws.loadWSDL();
var strXML:String;
if(isLoaded)
{
ws.getGameUsers .send();
}

if(hasResult)
{
text1.text = ws.getGameUsers .lastResult;
}
}



private function load_listener(e vent:LoadEvent) :void
{
isLoaded = true;
}


private function result_listener (event:ResultEv ent):void
{
hasResult = true;
}



Nothing happens. So what's wrong with this anyway? I have problems in understanding how to use the WebService class in actionscript but that's the way I want to do it anyway, not by MXML. Thanks in advance.
Sep 19 '07 #1
0 2875

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2591
by: Tom Heathcote | last post by:
Apologies for posting a flex++ question rather than a C++ question, but there does not appear to be a flex++ newsgroup... I am trying to rebuild some old lexical scanner / analyzer code, which I believe was generated by flex++/bison++. The rebuild is required because existing code is only a 7-bit scanner (uses char rather than unsigned char as its character type, and the tables only go up to 127) and I need to work with 8-bit input.
0
1067
by: Sparky | last post by:
Hi, I am trying to use a typed dataset with a web service and am having problems with type casting errors. I have a typed dataset which is in both my web service and my consuming application. When I try to pass the typed dataset back to the consuming application from the web service through a web service function call, I get a "Specified Cast
1
3430
by: leslie_tighe | last post by:
Hello, I have webservice created with Axis 1.2.1 and that I am trying to consuming in .NET (VB) using the Microsoft provided tools. While I am able to consume methods on the service that return simple type, I cannot consume methods that return complex objects. I have tried experimenting, with this, but am at a bit of loss on where the problem lies. When I call the services from a browser, I do get back the response that contains valid...
0
2373
by: ryan | last post by:
I've been tasked with consuming a Perl web service that was written by a person in a different department of my company. The problem is it's the guy's first attempt at web services and he doesn't know how to create the WDSL. I created web service with Visual Studio that mimics his service and after some tweaking of the soapAction in the WSDL I'm able to call his service successfully. When I use SOAPScope to look the messages being sent and...
2
1353
by: s | last post by:
'project with web service <webmethod()> _ public function myws(id as integer) 'do db stuff with id and build document Dim xd As New XmlDataDocument xd.Load("D:\Inetpub\webservice_xml\redbook.xml") Return xd end function
0
1571
by: plmanikandan | last post by:
I need to develop a application to consume a webservice. For consuming web service i tried a example in Consuming a Web Service in C# in http://www.csharphelp.com.But i am uanble to use that webservices in http://upload.eraserver.net/circle24/worldtime/worldtime.asmx?WSDL.Can anybody give me simple example(website link) for consuming webservice(other than local host). Mani
1
1956
by: Mahesh Devjibhai Dhola | last post by:
Hi, Scenario: The webservice was developed on windows 2000 Pro and deployed previously on windows XP pro for testing. We have tested for many days. The client for that service was 30+ and accessing the webservice each min. It was working 100% fine. Problem: But now in actual deployment, we have deployed webservice in Win Server 2003 and we have used all the default configurations. Now the clients are accessing that service the same way...
2
3960
by: Philip Reimer | last post by:
Hello. We have here a Java web service that has been created using Apache Axis 1.4, using the document/literal wrapped style, and returns complex types in its methods. When consuming the web service with a C# client, all the fields in the returned objects are null. The SOAP message, however, contains all the expected data.
1
1653
by: =?Utf-8?B?R29yZG9u?= | last post by:
Hi; I can consume a web service from an asp.net application with no problem. The web service connects to a remote server through ODBC and returns a data set to the consuming software. When I try to consume the WS from a windows app is gives a 407 error. I didn't think that the consuming application had to worry about connecting
0
1362
by: menmaatre | last post by:
Hi all, I have a very odd problem: - System A: Win 2k3 with IIS 6 exposing a little WSDL Webservice - System B: Win 2k3 with MSSQL Server 2k5 - System C: RedHat Enterprise Server running apache 2.2.x with PHP5 and PHP Soap extension All systems are at the same subnet. xxx.xxx.xxx.10 / 11 / 12
1
9955
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9833
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.