I have used the Flex Application with IE. Now I have change Browser and make it Firefox.
There are two steps.
1) First Select Menu—> windows –> Preferences –> General –> Web Browser…
After that you may able to change the browser.
2) Go to Command Prompt and type
-–> ftype http=”c:\Program Files\Mozilla Firefox\firefox.exe”
Reopen Flex Application.
Now run your application then browser is changed.
thnx
Here I am Explain how to use Web Services in Flex Application.
Steps:
1) First we create web service in Asp.net with C#. create new Web method in Web service is GetName.
[WebMethod]
public string GetName(string UserName)
{
return "WelCome " + UserName;
}
My web service name is WebServices.
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WebService : System.Web.Services.WebService {
public WebService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
[WebMethod]
public string GetName(string UserName) {
return "WelCome " + UserName;
}
}
2) Open Flex Application.
3) Put below control in to application.
3.1) WebService (ID =MyWebService)
3.2) Label for display Information
3.3) TextArea (ID=txtUserName) – get value and pass value in to WebService
3.4) Button (ID=btnSubmit) – Call Web service
3.5) TextArea (ID=txtResult) – Display result from Web service
Application Page Info.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<!--Web Service Information
wsdl URL of Web Service
fault if any error loading web service
operation method name in Webservices
request pass the parameter to Webservices
*here I get the TextBox Value
-->
<mx:WebService id="MyWebService" wsdl="http://localhost:3549/ChangeWebConfigFile/WebService.asmx?WSDL"
fault="mx.controls.Alert.show(event.fault.faultString)" >
<mx:operation name="GetName">
<mx:request>
<UserName>{txtUserName.text}</UserName>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:VBox>
<mx:Label text="Enter User Name">
</mx:Label>
<mx:TextArea id="txtUserName" text="test">
</mx:TextArea>
<mx:Button id="btnSubmit" label="Submit.." click="checkUserName();">
</mx:Button>
<mx:TextArea id="txtResult"/>
</mx:VBox>
<mx:Script>
<![CDATA[
private function checkUserName():void
{
MyWebService.GetName.send();
txtResult.text= MyWebService.GetName.lastResult;
}
]]>
</mx:Script>
</mx:Application>
4) Run Flex Application.
thnx
I have got this Error when I used asp.net web services in FLEX. I found Solution which is mention below.
Steps:
1) Check the URL of your Web Services
you can put direct URL of Web services here I am used URL is http://localhost:3549/ChangeWebConfigFile/WebService.asmx and got Error.
2)
change in URL http://localhost:3549/ChangeWebConfigFile/WebService.asmx?WSDL and solve the Error.
thnx
Recent Comments