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.
About the cPrint and cRenewals showing up as 0 I wouldn’t be too concerned about that since it is logically a binary parameter (N=0, Y=1) essentially.
Nathan Campbell Manager of Support and Systems Analysis Dallas Symphony Orchestra Morton H. Meyerson Symphony Center Schlegel Administrative Suites 2301 Flora Street Dallas, Texas 75201 214-871-4026 - phone 214-953-1218 - fax
From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Bryan Drenner Sent: Wednesday, October 06, 2010 10:32 AM To: Nathan Campbell Subject: Re: [Tessitura Technical Forum] calling GetOrdersEx() from PHP
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
From: Ben Gu <bounce-bengu4278@tessituranetwork.com> Sent: 10/5/2010 11:30:46 PM
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
This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!
Nathan,
I thought the same thing, but if "N" becomes 0 in the SOAP request, shouldn't "Y" then become 1?
Firstly, apologees for reviving such an old thread, but I think this fits best here.
I've just started working on a Tessitura install in PHP and have run in to this same problem with the 'cRenewals' value on the GetOrdersEx method. Whether I pass Y or N I always get the following error:
"Invalid Renewals_Only value at Tessitura.WebAPI.Tessitura.GetOrdersEx(..."
I've also tried passing 0, 1 and '0' and '1' with no luck. When I use exact the same values from asmx form it works correctly - is there some parsing step between the PHP soap client and the function that could be causing this behaviour?
ThanksMark
Hi Murray - With char params outside of .NET, you'll likely want to pass an ASCII value insted of a string char. Can you try cRenewals as '89' or '78' instead of 'Y' or 'N' and see if that gets you a more positive response?
Let us know if that doesn't do the trick!H
Ah that's got it!
Thanks very much for the quick response.