Skip navigation
Currently Being Moderated

How to call a .NET wcf from flex using httpService

Dec 9, 2009 10:43 AM

I have a wcf service

http://tdev/StatService.svc  and it has 4 .NET methods and all these are pure http returning in JSON/XML

 

[OperationContract]

[WebInvoke(ResponseFormat = WebMessageFormat.Json)]

 

int GetAvailablePeopleJSON(string locationName);

 

[OperationContract]

[WebInvoke(ResponseFormat = WebMessageFormat.Json)]

 

List<int> GetAvailablePeoplesListJSON(List<string> locations);

[OperationContract]

[WebInvoke(ResponseFormat = WebMessageFormat.Xml)]

 

int GetAvailablePeopleXML(string locationName);

[OperationContract]

[WebInvoke(ResponseFormat = WebMessageFormat.Xml)]

 

List<int> GetAvailablePeoplesListXML(List<string> locations);

 

I need to call these methods from my flex application. Where do i give the methods name in httpService?, please help me with an example, this is what i am doing and i am getting an http request error. Is their an other way i can accomplisg this? Thank you

 

<mx:HTTPService

 

id="httpService"

url="

http://tdev/StatService.svc" useProxy="false" method="POST"

resultFormat = "

text"

result="httpServiceResultHandler(event)" fault="httpServiceResultHandler_fault(event);"

>

 

<mx:request xmlns="">

 

<locationName>{myText.text}</locationName>

 

</mx:request>

</mx:HTTPService>

<mx:Button

 

id="button1" x="75" y="388" label="Get Available People JSON" click="httpService.send();" />

<mx:TextInput

 

id = "myText" x="426" y="517" width="223" height="34"/>

 
Replies
  • Currently Being Moderated
    Jan 28, 2011 5:38 AM   in reply to learningflex

    Hi,

     

    Please let me know if any body knows answer for below question

     

    How to call a perticular method on WCF service from flex? i mean to say i want to call WCF service from flex here where i can mention method of WCF service(Operation)

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points