1

I'm getting with my hotel provider:

Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient() Stack trace: #0 SoapClient->SoapClient(NULL, Array) #1

I managed once to make a booking but then start getting this message.

Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient() [soapclient.soapclient]: 'uri' option is required in nonWSDL mode in /home/fanzy44/public_html/FLuxuryWorld.com/HotelCollection/wp-content/themes/agility-child/single-bookhotel.php:1983
Stack trace:
#0 /home/fanzy44/public_html/FLuxuryWorld.com/HotelCollection/wp-content/themes/agility-child/single-bookhotel.php(1983): SoapClient->SoapClient(NULL, Array)
#1 /home/fanzy44/public_html/FLuxuryWorld.com/HotelCollection/wp-includes/template-loader.php(47): include('/home/fanzy44/p...')
#2 /home/fanzy44/public_html/FLuxuryWorld.com/HotelCollection/wp-blog-header.php(16): require_once('/home/fanzy44/p...')
#3 /home/fanzy44/public_html/FLuxuryWorld.com/HotelCollection/index.php(17): require('/home/fanzy44/p...')
#4 {main} thrown in /home/fanzy44/public_html/FLuxuryWorld.com/HotelCollection/wp-content/themes/agility-child/single-bookhotel.php on line 1983

9
  • 1
    Do you seriously expect us to find out what's wrong without a piece of code? Commented Feb 21, 2013 at 0:51
  • Gordon, is this error coming from your code or an external source? There's not much you can do about external errors other than report them to the service's maintainer. Commented Feb 21, 2013 at 1:01
  • 1
    SOAP is a pain in the ass to set up.. I speak from experience, I advise using something like JSON... Commented Feb 21, 2013 at 1:24
  • Jeffrey (i'm sorry I'm new) here is some code Commented Feb 21, 2013 at 12:13
  • { // create SOAP client object //Hotels Pro Booking URL $client = new SoapClient($hotelProBookingURL, array('trace' => 1)); try { // Create rooms arrays $rooms[] = array(); // take out the value of rooms $str_roomData = explode('rooms', $valRoomAdultChild); // total rooms will be in $str_roomData[0] if ($str_roomData[0] > 1) { $isMultipleRooms = true; $requestedRoom = $str_roomData[0]; } Commented Feb 21, 2013 at 12:13

1 Answer 1

3

According to the exception,

Uncaught SoapFault exception: ... 'uri' option is required in nonWSDL mode

So, referring to the SoapClient documentation:

options

An array of options. If working in WSDL mode, this parameter is optional. If working in non-WSDL mode, the location and uri options must be set, where location is the URL of the SOAP server to send the request to, and uri is the target namespace of the SOAP service.

Looking at your code:

$client = new SoapClient($hotelProBookingURL, array('trace' => 1)); 

What's the value of $hotelProBookingURL? If it's null, you're missing necessary options, causing your error.

Sign up to request clarification or add additional context in comments.

3 Comments

thanks a lot Brad; it's actually 1. I have the feeling that something else "changed" because I managed to make a booking once and then gave fatal error again
What's 1? Hopefully not the value of $hotelProBookingURL. If your code keeps changing, please simply place your most recent code and error in your question.
It is for array('trace' => 1)); not null. I have commented the defines.php file // Live server $hotelProBookingURL = "api.hotelspro.com/4.1/hotel/b2bHotelSOAP.wsdl"; // Test server $hotelProBookingURL = "api.hotelspro.com/4.1_test/hotel/b2bHotelSOAP.wsdl"; and I solve the issue with booking. However, the problem now is that I get the url of the test server in the front site (like in fluxuryworld.com/HotelCollection/bookhotel/oberoi-mauritius-2 )

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.