- 论坛徽章:
- 1
|
- <?php
- $content = <<<CONTENT
- <?xml version="1.0" encoding="utf-8"?>
- <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <soap:Body>
- <DurationUsageRecord xmlns="http://service.zx.chinavnet.com/v1.0/">
- <SPID>string</SPID>
- <TimeStamp>string</TimeStamp>
- <UserID>string</UserID>
- <TransactionID>string</TransactionID>
- <ServiceID>string</ServiceID>
- <ServiceItemID>string</ServiceItemID>
- <ItemName>string</ItemName>
- <StartTime>string</StartTime>
- <EndTime>string</EndTime>
- </DurationUsageRecord>
- </soap:Body>
- </soap:Envelope>
- CONTENT;
- $length = strlen($content);
- $out = <<<SOAP
- POST /bj/vnetInterface/VNetForSP/VNetCenterInterfaceForSP.asmx HTTP/1.1
- Host: service.test.chinavnet.com
- Connection: close
- Content-Type: text/xml; charset=utf-8
- Content-Length: $length
- SOAPAction: "http://service.zx.chinavnet.com/v1.0/DurationUsageRecord"
- $content
- SOAP;
- ?>
- <?php
- $fp = fsockopen("service.test.chinavnet.com", 80, $errno, $errstr, 30);
- if (!$fp) {
- echo "$errstr ($errno)<br />\n";
- } else {
- fwrite($fp, $out);
- while (!feof($fp)) {
- echo fgets($fp, 128);
- }
- fclose($fp);
- }
- ?>
复制代码 |
|