2 Replies Latest reply on Jul 17, 2007 2:13 AM by p_repetti

    1034 error

    p_repetti
      Hello

      I'm getting a flex error as follows
      TypeError: Error #1034: Type coercion failed: cannot convert MC{mx.rpc.soap.mxml::WebService@4e98d81 mx.rpc::AbstractService/logout()}@54fe3a9 in mx.rpc.soap.Operation.

      at startup.
      In the mxml I reference a web service which incidentally has a method logout() but that method is never called and can't understand why it should conflict with the flex application.

      Any help ?
        • 1. Re: 1034 error
          ntsiii Level 3
          Show some code.
          Tracy
          • 2. Re: 1034 error
            p_repetti Level 1
            Flex 2.0.

            Create a WS with two operations, checkLogin() and logout(). Call it TestLogoutWS.
            Create a flex application as follows:

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationPolicy="all" creationComplete="initApp()"
            horizontalAlign="left" minWidth="900" minHeight="550" backgroundGradientColors="#8CADBD" backgroundColor="#8CADBD">
            <mx:Model id="Source"/>
            <mx:WebService id="LogoutWS"
            wsdl="/TestLogoutWS/LogoutWS?WSDL" useProxy="false" showBusyCursor="true">
            <mx:operation name="checkLogin" result="checkLogin(event)">
            <mx:request>
            <String_1>{token}</String_1>
            </mx:request>
            </mx:operation>
            </mx:WebService>

            <mx:Script>
            <![CDATA[

            import mx.controls.Alert;

            public var token:String;

            public function initApp():void {
            LogoutWS.getOperation("checkLogin").send("hello") ;
            }

            public function checkLogin(event:Event):void {
            Alert.show("User is authorized");
            }

            ]]>
            </mx:Script>

            <mx:Label x="45" y="29" text="This is a test with a WS which declares a logout operation"/>
            <mx:Button x="59" y="74" label="Do not push me"/>

            </mx:Application>

            Invoke the WS. You get the following error even if you never invoke logout().

            TypeError: Error #1034: Type coercion failed: cannot convert MC{mx.rpc.soap.mxml::WebService@5fc0e21 mx.rpc::AbstractService/logout()}@5f5f741 in 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()