PHP soap extension enabling and _ soapCall-PHP source code

Source: Internet
Author: User
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 '));

?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.