The "useProxy" property determines whether the WebService instance on the 
client sends its requests to a BlazeDS or LCDS proxy service (useProxy=true) or 
whether it sends requests direct (useProxy=false). If false, the WebService 
will send a direct request to the web service endpoint using the player/browser 
HTTP stack. There are limitations in the plugin API that interfere with 
processing SOAP faults which are returned with a status code of 500; these 
responses aren't passed into the player by the browser.

So the proxy service works around that to get SOAP faults into the player where 
they can be handled. But SOAP headers should work the same with useProxy either 
true or false, and the service you're invoking may or may not use them.

Best,
Seth

 ________________________________________
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
gregariousgregmi
Sent: Friday, January 25, 2008 5:27 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Use message.clientID to access same session?

Thanks Seth.
To see the headers coming back, does useProxy have to be set to True?

--- In flexcoders@yahoogroups.com, "Seth Hodgson" <[EMAIL PROTECTED]> 
wrote:
>
> The clientId value identifies a Producer or Consumer instance on 
the client that is either sending or receiving messages. RPC-related 
components such as WebService use the core messaging layer under the 
hood. I'd recommend against using clientId in your scenario.
> 
> Most session-based web service APIs define an initial call to 
initiate a session that returns you a session token. You'd then add 
that as a header to subsequent calls, or pass it directly in 
subsequent calls depending on the API.
> 
> If you need to fabricate a session token on the client and use that 
for a sequence of calls, use the following method to generate your 
unique token: 
http://livedocs.adobe.com/flex/2/langref/mx/utils/UIDUtil.html#createU
ID()
> 
> Hope that helps,
> Seth
> ________________________________________
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of gregariousgregmi
> Sent: Wednesday, January 23, 2008 7:21 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Use message.clientID to access same session?
> 
> Imported a WSDL in flex 3 beta 2. I would like to use the 
> same "session" for several sequential calls into a web service.
> 
> Is the clientID the property to pass to the subsequent call?
> 
> When I assign a variable to what I believe is the clientID I 
> get "DirectHTTPChannel0". I was expecting something like a GUID.
> 
> Any ideas on the correct action script code would be appreciated.
> 
> The following is the function that processes the result (sorry 
about 
> the formatting):
> 
> private function processResult
(result:Object,wrappedData:Object):void
> {
> var token:AsyncToken = wrappedData.returnToken;
> var currentOperation:WSDLOperation = wrappedData.operation;
> var decoder:SOAPDecoder = new SOAPDecoder();
> decoder.resultFormat="object";
> decoder.ignoreWhitespace = true;
> decoder.makeObjectsBindable=true;
> decoder.wsdlOperation = currentOperation;
> decoder.schemaManager = currentOperation.schemaManager;
> var msgstr:WSDLMessage = currentOperation.outputMessage;
> var body:Object = result.message.body;
> var stringResult:String = String(body);
> var msgId:String = result.message.clientId;
> if(stringResult == null || stringResult == "")
> return;
> var soapResult:SOAPResult = decoder.decodeResponse
> (result.message.body);
> if(soapResult.isFault)
> {
> var faults:Array = soapResult.result as Array;
> for each (var soapFault:Fault in faults)
> {
> var soapFaultEvent:FaultEvent = FaultEvent.createEvent
> (soapFault,token,null);
> token.dispatchEvent(soapFaultEvent);
> }
> } else {
> result = decoder.decodeResponse
> (result.message.body).result; 
> if(result is ArrayCollection)
> {
> //shoud upcast to specific type here
> var arrayTypedClass:Class = 
> SchemaTypeRegistry.getClass(currentOperation.outputMessage.parts
> [0].type);
> result = new arrayTypedClass
> (result.source);
> }
> //added by GF 1-11-08 to ensure data is 
> returned. Test showed
> //that result was null but body and 
> stringResult had data.
> 
> if (result == null || result == "")
> {
> result = body; 
> 
> } 
> var event:ResultEvent = 
> ResultEvent.createEvent(result,token,null) 
> token.dispatchEvent(event);
> }
> }
>
 

Reply via email to