我正在尝试使用nusoap和php 5.3填充请求。我尝试的一切都给我留下了空洞的要求。我哪里错了?
这就是我想要创造的......
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
<soap:Header>
<CardSoapHeader xmlns="https://service.pct.com/">
<Username>username</Username>
<Password>password</Password>
<Account>account</Account>
</CardSoapHeader>
</soap:Header>
<soap:Body>
<AddressLookup xmlns="https://service.pct.com/">
<request>
<CompanyReferenceGuid>00000000-0000-0000-0000</CompanyReferenceGuid>
<AdminUserIdentifier>00000000-0000-0000-0000</AdminUserIdentifier>
<MirrorRequest>false</MirrorRequest>
<Surname>surname</Surname>
<Postcode>postcode</Postcode>
<HouseName>1</HouseName>
<AuthenticateCardApplicants>false</AuthenticateCardApplicants>
</request>
</AddressLookup>
</soap:Body>
</soap:Envelope>
这是我的php ...
<?php
require_once('./soap/lib/nusoap.php');
$client = new nusoap_client('https://uat.service.efirstcard.co.uk/v3_1/SignupService.asmx?wsdl', 'wsdl');
$requestArray[] = array(
/*
'CardSoapHeader' => array('Username' => 'username',
'Password' => 'password',
'Account' => 'account'),
*/
'CompanyReferenceGuid' => '00000000-0000-0000-0000',
'AdminUserIdentifier' => '00000000-0000-0000-0000',
'MirrorRequest' =>'false',
'Surname' =>'surname',
'Postcode' =>'postcode',
'HouseName' =>'1',
'AuthenticateCardApplicants' =>'false');
// Doc/lit parameters get wrapped
$result = $client->call('AddressLookup', array('request' => array($requestArray)));
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>
这就是它产生的......
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns9681="http://tempuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<AddressLookup xmlns="https://service.pct.com/">
<request></request>
</AddressLookup>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>