# SOAP Noob



## dubya008 (Dec 13, 2006)

I'm trying to pull order info from a Web services for our fulfillment company. I keep getting an error saying that there isn't an instance of the object. I have to pass 3 parameters (probably where the error is)
Username
Password
orderId

below is my code to run the request. Can someone look at it and tell me what I am doing wrong? I've searched all over the internet and haven't been able to find a solution.

```
$params = array('Username'=>'UserTest', 'Password'=>'test', 'orderID'=>'ZoneTest'); 
$wsdl_url ="http://lynxmin.lynxfulfillment.com/pmomsws/order.asmx?wsdl";
	$client     = new SoapClient($wsdl_url);
	$client->__soapCall("GetOrderInfo", array($params));
	//echo "REQUEST:\n" . $client->__getLastRequest() . "\n";
```
Obviously I'm using PHP. Here is the web api for the web services
http://lynxmin.lynxfulfillment.com/pmomsws/order.asmx


----------



## ehymel (Aug 12, 2007)

I don't use SOAP, but a first glance at your code I would guess the problem is this line:


```
$client->__soapCall("GetOrderInfo", array($params));
```
I would think that $params is already an array, so your array specification in this line is extraneous. Try this instead:


```
$client->__soapCall("GetOrderInfo", $params);
```


----------



## dubya008 (Dec 13, 2006)

Hey Thanx for the quick response. unfortunatly I have the same problem after changing it.
Perhaps the value for orderId isn't coming over as a string. Is there a way to force that value to be a string???


----------



## ehymel (Aug 12, 2007)

It already is a string since you have the definition in single quotes.

According to the page you linked to, the name of orderid is orderId, while you have orderID. Capitalization is different, so check that.


----------



## dubya008 (Dec 13, 2006)

Thanks ehymel. Checked it same error is occuring. I'm really stumped


----------



## ehymel (Aug 12, 2007)

hmmm.

I notice that the link you sent, under the GetOrderInfo page, it says:



> The test form is only available for requests from the local machine.


What is the error message you are getting?


----------



## dubya008 (Dec 13, 2006)

Fatal error: Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: *Object reference not set to an instance of an object. at ProMail.WebServices.OMS.Order.GetOrderInfo(String orderId) *in c:\Inetpub\wwwroot\Pmomsws\App_Code\Order.cs:line 200 --- End of inner exception stack trace --- in /home/jrauto1/public_html/Testing/SoapTest2.php:14 Stack trace: #0 /home/jrauto1/public_html/Testing/SoapTest2.php(14): SoapClient->__soapCall('GetOrderInfo', Array) #1 {main} thrown in /home/jrauto1/public_html/Testing/SoapTest2.php on line 14

The bold area tells me that there isn't an order number being passed over


----------

