FLUGR
FLUGR Forums
Forums | Profile | Inbox | Members | Search | Login | RSS
New Topic Reply Subscription Options   Previous Page  Page: 1   Previous Page

Forums: Java integration: WebServices
Created on: 06/15/08 05:40 AM Views: 1617 Replies: 4
WebServices
Posted Sunday, June 15, 2008 at 5:40 AM

Hello,

I'm trying to create my first flex client app which connects to a webservice. It looks like it can connect to several webservices on the net, but NOT to my own Sad

For example working is:
- http://www.webservicex.net/WeatherForecast.asmx?WSDL

But I can't call for example the default getVersion service of axis.
- http://s01.domingo.nl:8080/axis2/services/Version?wsdl

What can be the problem ??

My client code:
<?xml version="1.0" encoding="UTF-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

   <mx:WebService
      id="versionService"
      wsdl="http://s01.domingo.nl:8080/axis2/services/Version?wsdl"
      useProxy="false">
      <mxSurprisedperation name="getVersion">
      </mxSurprisedperation>
   </mx:WebService>
   
   <mx:Button click="versionService.getVersion.send()" label="getVersion"></mx:Button>
   <mx:Label text="Version:"></mx:Label>
   <mx:TextArea text="{versionService.getVersion.lastResult}"></mx:TextArea>
   
   <mx:HRule></mx:HRule>
   
   <mx:WebService id="WS"
wsdl="http://www.webservicex.net/WeatherForecast.asmx?WSDL"
useProxy="false">

<mxSurprisedperation name="GetWeatherByZipCode" resultFormat="e4x" >
<mx:request>
<ZipCode>30117</ZipCode>
</mx:request>
</mxSurprisedperation>
</mx:WebService>
<mx:Button click="WS.GetWeatherByZipCode.send()" label="getWeather"></mx:Button>
<mx:TextArea text="{WS.GetWeatherByZipCode.lastResult}"></mx:TextArea>
   


</mx:Application>

My crossdomain xml:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>


Please give me some tips.

RE: WebServices
Posted Sunday, June 15, 2008 at 5:41 AM

Oops, forgot the error I'm getting:

[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Unable to load WSDL. If currently online, please verify the URI and/or format of the WSDL (http://s01.domingo.nl:8080/axis2/services/Version?wsdl)"]
   at mx.rpc.wsdl::WSDLLoader/faultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\wsdl\WSDLLoader.as:98]
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:168]
   at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:220]
   at mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49]
   at mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
   at DirectHTTPMessageResponder/securityErrorHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:368]
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at flash.net::URLLoader/redirectEvent()

RE: WebServices
Posted Monday, June 16, 2008 at 4:28 PM

A few questions to start with.
Did you put your crossdomain file in the root of your domain?
Is the url accessible from the IP address you are calling it from, so the client using the application.
And a last question what Error do you get if you try to import your webservice inside FlexBuilder 3.

Mark

Adobe Certified Instructor at Prisma IT.
Blog:http://flexpair.org

www email
RE: WebServices
Posted Monday, June 16, 2008 at 4:44 PM

Thank you for your response.

Yesterday I managed to get my application to work.
It turned out I needed to specify my port in the crossdomain file, because by default it used port 80.

After configuring it to use an other port everything started to work.

Have fun,
Raymond

RE: WebServices
Posted Monday, June 16, 2008 at 6:04 PM

Ok, I'm glad it's working.

Mark

Adobe Certified Instructor at Prisma IT.
Blog:http://flexpair.org

www email

New Topic Reply Subscription Options   Previous Page  Page: 1   Previous Page
Subscription Options
Subscription options are available after you log in.

There are 1 active user sessions right now.