0 Replies Latest reply on Apr 18, 2012 9:56 AM by ErikCIng2421

    Accessing .Net web service via local Flash Builder environment

    ErikCIng2421 Level 1

      I have developed a web service in VB.Net that resides out on a development server. Let's call it "http://devServer.company.com/aWebSvc.asmx". Meanwhile, I am creating an application in Flex, using Flash Builder 4.0.1, the Flex 4.5 SDK and ActionScript 3.0. Forgive me if I'm not completely accurate here as Flex/ActionScript is not my strongest skillset. Anyway... I have a crossdomain.xml file in the root of my development web server that allows access from "*.company.com" and allows request headers from same.


      The Flash application is set up as a web based app that runs using the local ASP.NET development server, so when I press play and/or debug, it launches as "http://locahost:3000/MyFlashApp/flex_bin/MyFlashApp.html". When I run it from my local Flash Builder environment, I am able to access the web service with no issues. HOWEVER... I have a peer developer, using the same set-up in his local development environment, and he is UNABLE to access the web service. We have tried this two different ways.

      First: We declared the web service thusly in our main mxml file:

      <mx:WebService id="dataWebSvc" wsdl="resources/WebVizSvc.wsdl" fault="{webSvcErrHandler(event)}>

      The above statement referencing a locally-stored wsdl file in the resources directory. Then, in a corresponding actionscript file, a typical call to the web service looks like this:

      dataWebSvc.GetSomeData.resultFormat = "e4x";
      .GetSomeData.addEventListener("result", putTheDataInAGrid);
      .GetSomeData.send(parameter1, parameter2, ...);

      We also tried using the built-in "Connect-to-Data" wizard in Flash Builder, choosing the ".Net Web Service" option, entering the full URL to the web service wsdl ("http://devServer.company.com/aWebSvc.asmx?wsdl") and letting Flash Builder do the introspection. Using this approach, my peer developer is able to get a full definition of the web service, including the auto-generated classes. He is also able run tests against the web service using the built-in testing harnesses within Flash Builder.


      But that's as far as he can get. At runtime, using either the first example I listed above, or using the generated web service classes, he, or more specifically, his Flash development environment, seems to be denied access to the service. The generated class methodology results in an "unable to load wsdl" error message in Flash. And using the first methodology, basically, nothing happens. Either way, we are stumped and cannot figure out why only one of us (me) would be able to hit the web service from Flash Builder.


      I use message boards like this almost daily to get answers, tips, etc. as they generally contain questions/answers similar to whatever it is I'm looking for. However, in this case, I've found nothing that resembles the problem we are currently trying to solve. I would greatly appreciate any feedback someone might have on this.