Hi all,

I had one question to ask regarding web services in flex 2.Actually i
trying to switch from XFire to Axis2.However, my flex client's codes
work well when using XFire and it will hit an error when i trying to
use Axis2.The error is as shown in the following:-

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
        at
mx.rpc.soap::WSDLParser/http://www.adobe.com/2006/flex/mx/internal::parseMessage()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\WSDLParser.as:626]
        at
mx.rpc.soap::WSDLOperation/parseMessages()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\WSDLOperation.as:62]
        at
mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::invokePendingCall()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\Operation.as:532]
        at
mx.rpc.soap::Operation/send()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\Operation.as:492]
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at
TestWebServicesClient/TestWebServicesClient::wsdlLoadedHandler()[D:\Project\TestWebServices\Client\src\TestWebServicesClient.mxml:118]
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at
mx.rpc::AbstractService/dispatchEvent()[C:\dev\enterprise_bali\frameworks\mx\rpc\AbstractService.as:236]
        at
mx.rpc.soap::WebService/http://www.adobe.com/2006/flex/mx/internal::wsdlHandler()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\WebService.as:662]
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at
mx.rpc.soap::WSDLParser/dispatchEvent()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\WSDLParser.as:788]
        at
mx.rpc.soap::WSDLParser/mx.rpc.soap:WSDLParser::parseCompleted()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\WSDLParser.as:305]
        at
mx.rpc.soap::WSDLParser/http://www.adobe.com/2006/flex/mx/internal::httpResultHandler()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\WSDLParser.as:181]
        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()[C:\dev\enterprise_bali\frameworks\mx\rpc\AbstractInvoker.as:146]
        at
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[C:\dev\enterprise_bali\frameworks\mx\rpc\AbstractInvoker.as:168]
        at
mx.rpc::Responder/result()[C:\dev\enterprise_bali\frameworks\mx\rpc\Responder.as:48]
        at
mx.rpc::AsyncRequest/acknowledge()[C:\dev\enterprise_bali\frameworks\mx\rpc\AsyncRequest.as:82]
        at
DirectHTTPChannel.as$139::DirectHTTPMessageResponder/completeHandler()[C:\dev\enterprise_bali\frameworks\mx\messaging\channels\DirectHTTPChannel.as:359]
        at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/flash.net:URLLoader::onComplete()


My flex client's snippet code:

...
_ws = new WebService();
_ws.addEventListener(LoadEvent.LOAD, wsdlLoadedHandler);        
_ws.loadWSDL("http://localhost:8080/testWebServices/services/TestWebServices?wsdl";);

...
                        
private function wsdlLoadedHandler(event:LoadEvent):void
{
    var operation:Operation = _ws["getBase64String"];
    operation.resultFormat = "e4x";
    operation.addEventListener(ResultEvent.RESULT, resultHandler);
    operation.addEventListener(FaultEvent.FAULT, faultHandler);
                                
    var test:String = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
                        
    operation.send.apply(this, [test]);  ---->> error occurs
}


Do anyone have an idea on what's happening? Thanks

Reply via email to