Yes, logout is a reserved method that we have on the AbstractService class.  If your WebService has a logout method you’ll need to call service.getOperation(“logout”).send(arg1, arg2, …).

 

Matt

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Vishwajit Girdhari
Sent: Thursday, October 19, 2006 12:51 AM
To: [email protected]
Subject: [flexcoders] Problem invoking any webservice operation if the API contains a method called 'logout'

 

Figured out a weird issue with Flex 2.0 / Flash Player 9 .  Your comments welcome.

 

 

Issue:

When you are calling any webservice where the API contains a method/function/operation named 'logout' your call wont be processed.

and you get the exception mentioned in trace .

 

Just to confirm the issue I tried  writing webservice  in Intersystems Cache and .NET 1.0 .

The issue lies with webmethod name 'logout' , if its renamed to something else the life is good.

 

Trace :

TypeError: Error #1034: Type Coercion failed: cannot convert MC{mx.rpc.soap.mxml::WebService@1393c41 mx.rpc::AbstractService/logout()[EMAIL PROTECTED] to mx.rpc.soap.Operation.
 at mx.rpc.soap::WebService/::createOperationsFromPort()
 at mx.rpc.soap::WebService/::setPort()
 at mx.rpc.soap::WebService/http://www.adobe.com/2006/flex/mx/internal::wsdlHandler()
 at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at mx.rpc.soap::WSDLParser/dispatchEvent()
 at mx.rpc.soap::WSDLParser/::parseCompleted()
 at mx.rpc.soap::WSDLParser/http://www.adobe.com/2006/flex/mx/internal::httpResultHandler()
 at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
 at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
 at mx.rpc::Responder/result()
 at mx.rpc::AsyncRequest/acknowledge()
 at ::DirectHTTPMessageResponder/completeHandler()
 at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at flash.net::URLLoader/flash.net:URLLoader::onComplete()

 

 

Code:

.Net (C#)  Webservice

----------------------------------

using System;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Diagnostics;

using System.Web;

using System.Web.Services;

namespace TestWS

{

[WebService(Namespace="http://vishwajit.com")]

public class Service1 : System.Web.Services.WebService

{

public Service1()

{

InitializeComponent();

}

private IContainer components = null;

private void InitializeComponent()

{

}

protected override void Dispose( bool disposing )

{

if(disposing && components != null)

{

components.Dispose();

}

base.Dispose(disposing);

}

[WebMethod]

public string login(string loginId , string password)

{

return "ok" ;

}

[WebMethod]

public string logout(string sessionId)

{

return "ok" ;

}

}//class

}//namespace

Flex 2.0 (AS3) Code for Webservice Client

--------------------------------------------------------------------

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="creationCompleteHandler()" >
 <mx:WebService id="loginWS"
 wsdl="http://vishwajit/TestWS/Service1.asmx?WSDL"
 useProxy="false" 
 fault="wsFault(event)" >
 
 <mx:operation name="login" result="getLoginResult(event)"  >
    <mx:request xmlns="" >  
    <username>a1</username>
    <password>a1</password> 
   </mx:request>
  </mx:operation>
 </mx:WebService>
 
 
 <mx:Script>
  <![CDATA[
  import mx.controls.Alert;
  
  public function creationCompleteHandler()
  {
   loginWS.login.send();  
  }
  public function getLoginResult(result : Object)
  {
    Alert.show(loginWS.login.lastResult + "");
  }
   
  public function wsFault(fault:Object)
  {
   Alert.show(""+fault);
  }
   
  ]]>
 </mx:Script>
</mx:Application>

 

--------------------------

 

Thank you.

 

Feedback / comments welcome.

 

 Vishwajit Girdhari  

 

The best way to be prepared for future is to invent it !

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to