PHP:Webservice错误SoapClient
来自SoapUI的请求PHP:Webservice错误SoapClient,php,Php,来自SoapUI的请求 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:not="http://xxx.xxx.xxx.com/"> <soapenv:Header/> <soapenv:Body> <not:SaasNotificationResponse> <hostID>UC
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:not="http://xxx.xxx.xxx.com/">
<soapenv:Header/>
<soapenv:Body>
<not:SaasNotificationResponse>
<hostID>UCALL</hostID>
<orderID>1180000335810000000010</orderID>
<custID>1180000335770000000010</custID>
<typeTransaction>SUSPENSION</typeTransaction>
<status>3</status>
<message>SUSPENSION 1180000335770000000010</message>
<notifyAttr>
<name>?</name>
<value>?</value>
</notifyAttr>
</not:SaasNotificationResponse>
</soapenv:Body>
</soapenv:Envelope>
错误应用程序。
致命错误:调用C:\wamp\www\spgdtws\notification.php中未定义的方法soapclient::SaasNotificationResponse()
我在php Web服务应用程序中遇到了一个问题。如果使用soapUI。可以调用webservice服务器。但是当我在客户端上使用应用程序时。发生错误。请帮助您似乎正在调用Telkom服务的通知WSDL。 这个代码对我有用
<?php
function sendNotification($orderID,$custID,$typeTransaction,$status,$message) {
try {
$client = new SoapClient("XXXXXXXXX/Notification?wsdl",array("trace"=>1,"exceptions"=>1));
$data = array( 'hostID' => '',
'orderID' => $orderID,
'custID' => $custID,
'typeTransaction' => $typeTransaction,
'status' => $status,
'message' => $message,
'notifyAttr' => array(
array('name'=>'','value'=>''),
array('name'=>'','value'=>'')
)
);
$return=$client->SaasNotificationResponse($data);
var_dump($return);
}catch (SoapFault $e){
echo $e;
}
}
sendNotification('1180000339980000000010','4720562','TERMINATION','3','TERMINATION success');
?>
你不需要包括nusoap。改用本机PHP的SOAP。SoapClient类属于本机PHP
供参考:
检查soap类的路径这是否有效$客户端->\uuuSOAPCALL(“SaasNotificationResponse”,$data);试试这个
$client->uu getFunctions()
检查SaasNotificationResponse
方法是否存在。致命错误:调用C:\wamp\www\spgdtws\notification.php第19行中未定义的方法soapclient::\uuu soapCall()?您是否尝试过PHP内部SoapClient?
require_once('lib/nusoap.php');
try {
$client = new SoapClient("http://xxx.xxx.xxx/Notification?WSDL");
$data = array( 'hostID' => 'UCALL',
'orderID' => '1180000335810000000010',
'custID' => '1180000335810000000010',
'typeTransaction' => 'ACTIVATION',
'status' => '3',
'message' => 'Activation complete',
'notifyAttr' => array(
array('name'=>'AccountID','value'=>'110022101010'),
array('name'=>'PackageID','value'=>'1')
)
);
$return=$client->SaasNotificationResponse($data);
//$return=$client->call('SaasNotificationResponse',($data));
print_r($return);
}catch (SoapFault $e){
echo $e;
}
<?php
function sendNotification($orderID,$custID,$typeTransaction,$status,$message) {
try {
$client = new SoapClient("XXXXXXXXX/Notification?wsdl",array("trace"=>1,"exceptions"=>1));
$data = array( 'hostID' => '',
'orderID' => $orderID,
'custID' => $custID,
'typeTransaction' => $typeTransaction,
'status' => $status,
'message' => $message,
'notifyAttr' => array(
array('name'=>'','value'=>''),
array('name'=>'','value'=>'')
)
);
$return=$client->SaasNotificationResponse($data);
var_dump($return);
}catch (SoapFault $e){
echo $e;
}
}
sendNotification('1180000339980000000010','4720562','TERMINATION','3','TERMINATION success');
?>