Link to home
Start Free TrialLog in
Avatar of PsychoDazey
PsychoDazey

asked on

error 1009

I am gettting the following error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at app_Code::WebserviceManager/onWSDLFault()
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.rpc::AbstractService/dispatchEvent()
      at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
      at mx.rpc.soap::Operation/send()
      at Function/http://adobe.com/AS3/2006/builtin::apply()
      at mx.rpc::AbstractService/http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()
      at app_Code::RCLogin/Submit()
      at app_GUI::Login/__txtPassword_enter()
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/dispatchEvent()
      at mx.controls::TextInput/keyDownHandler()
 Here is my Onwsdlfault code below.
private function onWSDLFault(fault:FaultEvent):void
		{
			// code source: http://www.binarygiant.com/blog/?p=6
		/*if the fault detail is that we were unable to load the wsdl, then we know that there is a problem communiating with the server*/
		if(fault.fault.faultDetail.toLowerCase() == "unable to load wsdl"
		|| fault.fault.faultString.toLowerCase() == "http request error"
		|| fault.fault.faultCode.toLowerCase() == "server.error.request")
		{
			
		var alert:Alert = Alert.show("The application is unable to communicate with the web server, please try again. If you continue to experience this problem, " +
		"please contact your system administrator");
		}
		
		}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Siva Prasanna Kumar
Siva Prasanna Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PsychoDazey
PsychoDazey

ASKER

Here you go:
(mx.messaging.messages::ErrorMessage)#0
  body = (Object)#1
  clientId = "DirectHTTPChannel0"
  correlationId = "D25179CD-2423-9118-385D-5DC517D10975"
  destination = ""
  extendedData = (null)
  faultCode = "Server.Error.Request"
  faultDetail = "Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/RepeatingComponents/Service.asmx"]. URL: http://localhost/RepeatingComponents/Service.asmx"
  faultString = "HTTP request error"
  headers = (Object)#2
  messageId = "CA92144A-838B-0540-9572-5DC5183EE423"
  rootCause = (flash.events::IOErrorEvent)#3
    bubbles = false
    cancelable = false
    currentTarget = (flash.net::URLLoader)#4
      bytesLoaded = 0
      bytesTotal = 0
      data = (null)
      dataFormat = "text"
    eventPhase = 2
    target = (flash.net::URLLoader)#4
    text = "Error #2032: Stream Error. URL: http://localhost/RepeatingComponents/Service.asmx"
    type = "ioError"
  timestamp = 0
  timeToLive = 0
See I was right your Webservice is unknown please give the actual (proper) WSDL url, to check if the wsdl  url is proper open the same url in any browser you must get an WSDL (XML) document.
but this is running it on the local machine????  I get this error when I open the file on the server that the swf resides on:
http://localhost/repeatingcomponents/repeatingcomponents.html
yes it will run on your localhost because your application is able to find the Web service Definition specified by "http://localhost/RepeatingComponents/Service.asmx?wsdl"

where as when you are running the same page containing that swf it will still try to get the definition on that system (localhost means the system on which the app is running). where as your web service will not be present on that system hence you are getting the above exception or error.
Yes, I understand...what I mean is that the error I showed you came up even when running it on the server that my app is on.  I changed the url to the server name, now it comes up and just says "null".
is your web service up and running can you open that WSDL link in web browser and see the WSDL?

if yes please provide your application code lets see whats null
yes, the service is running.

if i run the file as http://servername/repeatingcomponents/repeatingcomponents.html it opens without the error.  Now it seems like it isn't hitting the database  aaaarrrrggghhh!!!!!
Oh do u mean the web service is not able to hit the DB?
no, if i go to the webservice it hits the db but the flex app wont post the data anymore.
wont post the data anymore??  Can you please put forward how you are calling the webservice atleast? are you still getting the fault??
no, there is no error.  What code do you want me to post?
no, there is no error. so is it working?

what is the current state, it is simply showing the blank application ?
psycho can you post the mxml and actionscript? can you provide a link to the webservice? thanks
I got past that part by changing it back to localhost...ugh, I'm going in circles.  Now it will constantly just lose connection with the webservice...I can log in and navigate around the app, but every once in a while it will lose the webservice until I restart iis.
are you using authentication in webservice? how is that set up on flex side?
Im not sure what you mean..
forget it, I thought you were using some authentication before calling methods in webservice, but I just saw you are not.
no, no authentication
what were you saying earlier about checking concurrency?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
let me ask this; I have some pages that generate dynamic radio buttons.  They need to be refreshed each time the screen loads.  I make the same call to generate the buttons on creationComplete and on show...could this be causing the webservice to fail?  Should I just set it to load the buttons on show?
you need to refresh those everytime they show up? or only when you enter the app? there is no need to call it twice in show and creation.
every time they show up.
so keep it only on show event, no need to put it in the creationcomplete too.
ok, I am going to try that and see if my issue goes away.  The server this test app sits on is very slow, I am thinking it takes longer to complete the webserice call on that server which is why it keeps showing up there.
split points because shiva helped me to get the actual error message which led to the solution provided by juliano