Phpsoap extends the Simple Object Access Protocol, which is a protocol specification for data exchange. It is a lightweight, simple, XML-based protocol (a subset of standard General Markup Language, it is designed to exchange structured and solidified information on the WEB, next let's take a look at the small compilation of php soap extension opening and _ soapCall use problems php soap extension Simple Object Access Protocol is a protocol specification for data exchange, it is a lightweight, simple, XML-based protocol (a subset of standard General Markup Language) that is designed to exchange structured and solidified information on the WEB, next let's take a look at the small compilation of php soap extension enabling and _ soapCall usage Problems
Script ec (2); script
Example
Try {
$ Client = new SoapClient ("http: // localhost: 8080/Webtest/NewService? Wsdl ");
// $ Result = $ client->__ soapCall ("operation", array (4); // fault
// $ Result = $ client->__ soapCall ("operation", array ("id" => 4); // fault
// $ Result = $ client-> operation (4); // fault
$ Result = $ client-> operation (array ("id" => 4); // OK
$ Back = json_encode ($ result );
Echo $ back;
} Catch (SoapFault $ fault ){
Echo "Error:", $ fault-> faultcode, ", string:", $ fault-> faultstring;
}
?>
// Only the row marked as OK can successfully return the number 4. The other returned values are digits 0 (the parameter should not be passed, and the server id is initially 0 ).
// Soapcall example in the manual:
$ Client = new SoapClient ("some. wsdl ");
$ Client-> SomeFunction ($ a, $ B, $ c );
$ Client->__ soapCall ("SomeFunction", array ($ a, $ B, $ c ));
$ Client->__ soapCall ("SomeFunction", array ($ a, $ B, $ c), NULL,
New SoapHeader (), $ output_headers );
$ Client = new SoapClient (null, array ('location' => "http: // localhost/soap. php ",
'Url' => "http: // test-uri /"));
$ Client-> SomeFunction ($ a, $ B, $ c );
$ Client->__ soapCall ("SomeFunction", array ($ a, $ B, $ c ));
$ Client->__ soapCall ("SomeFunction", array ($ a, $ B, $ c ),
Array ('soapaction' => 'some _ action ',
'Uris '=> 'some _ uri '));
?>