I am trying to call GetOrdersEx() from PHP, but it's throwing an exception:
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 Tessitura.WebAPI.Tessitura.GetOrdersEx(String sWebSessionId, Int32 iOrderNumber, String sPhoneNumber, Char cPrint, String dtStartDate, String dtEndDate, Int32 iSeason, Int32 iCustomerNumber, Int32 iMos, Char cRenewals, Int32 iDeliveryMethod)
My function call looks like this:
$results = $tessClient->GetOrdersEx(array( 'sWebSessionID' => $_SESSION['tessSessionKey'], 'iOrderNumber' => 0, 'sPhoneNumber' => "", 'cPrint' => "N", 'dtStartDate' => date("n/j/Y"), 'dtEndDate' => "", 'iSeason' => 0, 'iCustomerNumber' => $_SESSION['customerNumber'], 'iMos' => 0, 'cRenewals' => "N", 'iDeliveryMethod' => 0));
$tessClient, $_SESSION['tessSessionKey'], and $_SESSION['customerNumber'] are all properly defined and work in the same context to call other Tessitura API functions.
Thanks for your help.
Hi Bryan,
Good day.
this GetOrdersEx() is calling WP_GET_ORDERS in databse.
so you can open sql profiler try to catch this sql statement.
then take a look what is passing to the database.
if you cannot catch this WP_GET_ORDERS, then you need to get a debug tool to find out what the web page is doing.
Fiddler
http://www.fiddler2.com/fiddler2/
devils is in the details.
have fun.
Ben
Ben,
Your idea inspired me.
Similarly to your suggestion, I used PHP's SoapClient method, __getLastRequest(), to inspect the contents of the SOAP request produced by the GetOrdersEx() method call. It produces the following, which I have restructured for clarity:
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tessiturasoftware.com/"> <SOAP-ENV:Body> <ns1:GetOrdersEx> <ns1:iOrderNumber>0</ns1:iOrderNumber> <ns1:cPrint>0</ns1:cPrint> <ns1:iSeason>0</ns1:iSeason> <ns1:iCustomerNumber>488757</ns1:iCustomerNumber> <ns1:iMos>0</ns1:iMos> <ns1:cRenewals>0</ns1:cRenewals> <ns1:iDeliveryMethod>0</ns1:iDeliveryMethod> </ns1:GetOrdersEx> </SOAP-ENV:Body></SOAP-ENV:Envelope>
Notice something conspicuously absent? For some reason, the "sWebSessionID" variable is not being included in the call. I inspected the SOAP request for a different function that requires that variable, LoginEx2(), and session key appears.
Now, why would GetOrdersEx() fail to append a required variable to the call, and how can I force it to do so?
Stranger still, when calling GetOrdersEx(), if I leave out any other required variable, I get an exception that indicates the missing variable. If I leave out "sWebSessionID", the exception doesn't mention it, but produces the same "Object reference not set to an instance of an object" exception.
Finally, if you inspect the SOAP call above, you can see that it's converting the "cPrint" and "cRenewals" variables to zeros. Both are defined as "N" in the PHP code. If I change them to "Y" and inspect the SOAP request, they still appear as zeros. This can't be proper behavior.
I'm at a loss for what to do.
Bryan