SF BSP order number query interface SOAP request example_PHP tutorial

WBOY
Release: 2016-07-13 10:16:07
Original
1683 people have browsed it

SOAP request example of SF BSP order number query interface

SOAP requests are sometimes used in the design of some interfaces, such as the interface of SF BSP.

I tried different POST requests, but either couldn’t request anything at all, or received garbled codes, all of which ended in failure.

The core code of the SOAP request for the SF Express interface is shared as follows:

The code is as follows
 代码如下  

/**
* 发送soap请求
*/
private function _soap()
{
$client = new SoapClient($this->serviceUrl);
$info = new stdClass();
$info->arg0 = $this->xml;
$param = array($info);
$response = $client->__call(“sfexpressService”,$param);
return $response->return ;
}

/**
* 拼接出请求的xml
*/
public function createXml()
{
$xml = ‘
’.$this->user.’,’.$this->passWord.’

invoice_no.’” />

’;
$this->xml = $xml;
}

/**

* Send soap request
*/
private function _soap()
{

$client = new SoapClient($this->serviceUrl); $info = new stdClass(); $info->arg0 = $this->xml;

$param = array($info);

$response = $client->__call(“sfexpressService”,$param); } /** * Splice out the requested xml*/ public function createXml() { $xml = ‘ ’.$this->user.’,’.$this->passWord.’ invoice_no.’” />
’; $this->xml = $xml;
}
Tips: 1.$this->serviceUrl is the BSP request address assigned by SF Express. Note that it is the address of ?wsdl 2.$this->user, $this->passWord are the ID and verification code assigned by SF Express 3. The returned return is an XML String, and you may need simplexml_load_string to parse it. http://www.bkjia.com/PHPjc/898890.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/898890.htmlTechArticleSF BSP order number query interface SOAP request example. SOAP requests are sometimes used in the design of some interfaces. For example, the interface of SF Express BSP. I tried different POST requests...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template