我收到了“致命错误:未捕获的SoapFault异常:[客户端] SoapClient :: SoapClient()堆栈跟踪:#0 SoapClient-> SoapClient(NULL,Array)#1”

时间:2013-02-21 00:29:00

标签: php soap

我和酒店提供商在一起:

  

致命错误:未捕获的SoapFault异常:[客户端] SoapClient :: SoapClient()堆栈跟踪:#0 SoapClient-> SoapClient(NULL,数组)#1

我设法做了一次预订,然后开始收到这条消息。

  

致命错误:未捕获的SoapFault异常:[客户端] SoapClient :: SoapClient()[soapclient.soapclient]:在/home/fanzy44/public_html/FLuxuryWorld.com/HotelCollection/wp-中的非WSDL模式中需要'uri'选项内容/主题/敏捷孩子/单bookhotel.php:1983
  堆栈跟踪:
  #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 ...')
  1983年/home/fanzy44/public_html/FLuxuryWorld.com/HotelCollection/wp-content/themes/agility-child/single-bookhotel.php投放#4 {main}

1 个答案:

答案 0 :(得分:3)

根据例外,

  

未捕获的SoapFault异常:...在非WSDL模式下需要'uri'选项

所以,参考SoapClient文档:

  

选项

     

一系列选项。如果在WSDL模式下工作,则此参数是可选的。如果在非WSDL模式下工作,则必须设置location和uri选项,其中location是要将请求发送到的SOAP服务器的URL,而uri是SOAP服务的目标名称空间。

查看您的代码:

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

$ hotelProBookingURL的价值是多少?如果它为null,则表示您缺少必要的选项,导致错误。