Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP SOAP to .NET generates object reference not set

Status
Not open for further replies.

csbdeady

Programmer
May 18, 2002
119
GB
I am trying to use SOAP in PHP to retrieve data via an MS .NET web service for work. However I see the following error message:

Object reference not set to an instance of an object.

I have read the help available at which describes this exact problem, but do not understand the advice given - or rather I have tried using the example given with the WSDL I will be using and it still generates the above error.

I would be most grateful if someone could explain in lamens terms exactly how I set the instance of the object that needs to be passed to the .NET service.

Many thanks
-C
 
There must be a line number with that message that tells you where this error has occurred.

In that line, you will see an object variable with a -> operator. This -> is used to call a property or a method on that object. The problem here is that this variable does not contain an object at all. So you could reproduce it with code like:

$test = 2; // Not an object
echo $text->Whatever(); // Gives the error

This also means that the real error is earlier in your code, or that the code relies on error checking being set to hear-no-evil-see-no-evil mode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top