Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Webservice consumer: works on FlexBuilder fails on Tomcat

Avatar

Avatar
Level 1
Pirlock
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
Pirlock
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
Pirlock
Level 1

19-11-2008

Hello guys!



I have just started messing around with Flex, and I thought
that a good practice would be trying to connect to one of the web
services that my company offers developing a simple client on Flex.



I used Flex Builder and found it really easy: With only a few
lines of code a really nice GUI... impressive!



So now lets show it to my colleagues...but UPS!



I place the application under my local Tomcat and instead of
retrieving data I get:



[FaultEvent fault=[RPC Fault faultString="Security error
accessing url" faultCode="Channel.Security.Error"
faultDetail="Destination: DefaultHTTP"] messageId=null type="fault"
bubbles=true cancelable=true eventPhase=2]



After a lot of research I cannot make it work... I have read
about crossdomain.xml, I have copied this file into my
tomcat\webapps\ROOT folder allowing all domains:



<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "
http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

<allow-access-from domain="*" />

<allow-http-request-headers-from domain="*" headers="*"
/>

</cross-domain-policy>



Because this crossdomain.xml should be on the server were my
Flex client is placed, isn't it? I have read some articles, and
they say that this XML has to be placed on the server which offers
the web service. I think this cannot be possible, in that case I
have to ask to my IT department to upload that file, and they for
sure aren't going to allow that.



Could you please help me? Why is the client working under
Flex Builder and not when I deploy it on my Tomcat? And when I says
deploy I mean that I have copied what Flex Builder generates on
"bin-release" folder into the Tomcat's webapps folder.



Thanks for your help in advance!

Replies

Avatar

Avatar
Affirm 1
Level 2
Zee_Yang
Level 2

Likes

0 likes

Total Posts

29 posts

Correct Reply

1 solution
Top badges earned
Affirm 1
View profile

Avatar
Affirm 1
Level 2
Zee_Yang
Level 2

Likes

0 likes

Total Posts

29 posts

Correct Reply

1 solution
Top badges earned
Affirm 1
View profile
Zee_Yang
Level 2

20-11-2008

the cross-domain file has to be placed on the web service
server.



you can use blazeds or lcds to proxy your ws calls. this
tutorial should help,
http://learn.adobe.com/wiki/display/Flex/Creating+a+BlazeDS+web+service+application+in+Flex+Builder