使用PHP连接到样本SOAP 1.1用于CEBROKER

时间:2017-04-26 06:49:27

标签: php web-services soap nsnetservicebrowser

我需要在php中连接到CEBroker SOAP Web服务。 SOAP请求是:

POST /CEBrokerWebService.asmx HTTP/1.1
Host: test.ws.cebroker.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.cebroker.com/CEBrokerWebService/TestUploadXMLFile"


<?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>
    <TestUploadXMLFile xmlns="http://www.cebroker.com/CEBrokerWebService/" />
  </soap:Body>
</soap:Envelope>

到目前为止,这是我的代码,

<?php
$username = "xxxxxxxx";
$password = "xxxxxxxx";
$options = array(
    "login" => $username,
    "password" => $password,
    'use' => SOAP_LITERAL
);

$client = new SoapClient('test.ws.cebroker.com//CEBrokerWebService.asmx?ws‌​dl', $options);

echo "<pre>";
//print_r($client);die();

$response = $client->TestUploadXMLFile(array(
    "licensee_profession" => 'Licensed Practical Nurse',
    "licensee_number"     => '6547852-25',
    "cebroker_state"      => 'AR',
    "first_name"          => 'Dalton',
    "last_name"           => 'Developer',
    "date_completed"      => '2017-04-06 22:52:16',
));

print_r($response);

0 个答案:

没有答案