How to use PHP to call WebService

Source: Internet
Author: User
How can I use PHP to call WebService? Other systems have a WebService, 118.145.3.40: 9082 running webserviceservicesmaicarinfoservice? I want to use PHP to call this WebService. I checked it online and wrote: $ client & nbsp; new & nbsp; how does SoapClie use PHP to call WebService?
Other systems have a WebService, http: // 118.145.3.40: 9082/WebService/services/MaiCarInfoService? Wsdl
I want to use PHP to call this WebService. I checked it online and wrote the following:

$ Client = new SoapClient ("http: // 118.145.3.40: 9082/published webservice/services/MaiCarInfoService? Wsdl ",
Array ('encoding' => 'utf-8 '));
$ Parm1 = "abcdefg ";
$ Param = array ('param0' => $ parm1 );
$ Arr = $ client-> sendMaiCarInfo ($ param );
Var_dump ($ arr );

I should have passed the XML string. I first passed an abcdefg test, but the other party said it was not called at all.
Let's take a look at what's going on. I am not familiar with PHP either ~~

Share: More


------ Solution --------------------
$parm1  = "abcdefg";
$param = array('in0' => $parm1);
$arr = $client->sendMaiCarInfo($param);

Return
StdClass Object
(
[Out] => XML parsing error, not compliant with XML standards
)

$parm1 = '
 
  1234
 ';
$param = array('in0' => $parm1);
$arr = $client->sendMaiCarInfo($param);

Return
StdClass Object
(
[Out] => success
)

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.