Bonjour,

Je suis entrain de mettre place une application avec flex qui consomme un service web java tournant sur un même ordinateur.

Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
        <mx:Script>
        <![CDATA[
		   import mx.rpc.events.ResultEvent;
		   [Bindable]
		   var resultat:Object;
		 /*
		   function WSsommeErrorHandler(Error:event.fault.faultstring):void{
		     mx.controls.Alert.show(Error);
		   }
		   */
 
		   function WSsommeResultHandler(e:ResultEvent):void{
		      resultat = e.result;
		   }
 
		]]>
		</mx:Script>
		<mx:WebService 
					id="WSsommeId"
					wsdl="http://localhost:8080/axis/sommer.jws?wsdl"
					useProxy = "false"
					result = "WSsommeResultHandler(event)">
 
					<mx:operation name="getsomme">
					     <mx:request>
								<a>{int(myinput1.text)}</a>
								<b>{int(myinput2.text)}</b>
						 </mx:request>
					</mx:operation>
		</mx:WebService>
		<mx:Form>
		<mx:VBox>
		    <mx:HBox>
				<mx:Label text="Entrez 1"  color="red"/>
				<mx:TextInput id="myinput1"/>
			</mx:HBox>
			<mx:HBox>
				<mx:Label text="Entrez 2"/>
				<mx:TextInput id="myinput2"/>
			</mx:HBox>
			<mx:HBox>
				<mx:Label text="La somme est de:"/>
				<mx:TextInput id="myinput3" text="{resultat}"/>
			</mx:HBox>
			<mx:Button label="Submit" click="WSsommeId.getsomme()"/>
		</mx:VBox>
		</mx:Form>
</mx:Application>
Lorsque j’ouvre mon fichier consommeWS.swf dans firefox , j’obtiens cette erreur :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
 
[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://localhost:8080/axis/sommer.jws?wsdl)"]
	at mx.rpc.wsdl::WSDLLoader/faultHandler()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
	at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
	at mx.rpc::Responder/fault()
	at mx.rpc::AsyncRequest/fault()
	at DirectHTTPMessageResponder/securityErrorHandler()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at flash.net::URLLoader/redirectEvent()
ceci n’empeche que l’interface (le formulaire) s’affiche. Mais lorsque je clicque sur le bouton l’appel de la fonction ne se fait pas.

Merci d'avance pour l'aide.