1

你能帮我或指出正确的方向吗,我正在尝试对 WSDL 提要执行肥皂请求,但我没有得到任何回报。

当我使用标准 XML 时,一切似乎都可以正常工作 - 我将如何将以下内容写入数组:

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body> 
<SupplierDirectorySearch xmlns="SOAPREQUEST"> 
<SupplierSearchDetails ClassVersion="1.0"> 
<Identification> 
<SchemeOperatorRef>59582</SchemeOperatorRef> 
<SecurityToken>MYTOKEN</SecurityToken>
</Identification>
  <ApprovedServices ServiceRepair="Y" MOT="" Tyres="" CollectionDelivery="" CourtesyCar="" WhileUWait="" Callout24Hour="" BreakdownCover="" CollectionDeliveryNotes="" CourtesyCarNotes="" Inspections=""/>
  <SupplierLocation>BB1</SupplierLocation> 
  <SearchRadiusMiles>300</SearchRadiusMiles> 
  <Preference>P</Preference> 
  <MaxReturnNumber>5</MaxReturnNumber> 
  <PageNo>0</PageNo> 
 </SupplierSearchDetails> 
 </SupplierDirectorySearch> 
</soap:Body> 
</soap:Envelope>';

我写了以下肥皂请求:

$client = new SoapClient("URL?WSDL", $option);
$res = $client->SupplierDirectorySearch(
array('SupplierSearchDetails'=> 
  array('Identification' => array('SchemeOperatorRef'=>'61', 'SecurityToken'=>'MYTOKEN'),
    'ApprovedServices' => array(
    'ServiceRepair'=>'Y',
    'MOT'=>'',
    'Tyres'=>'',
    'CollectionDelivery'=>'',
    'CourtesyCar'=>'',
    'WhileUWait'=>'',
    'Callout24Hour'=>'',
    'BreakdownCover'=>'',
    'CollectionDeliveryNotes'=>'',
    'CourtesyCarNotes'=>'',
    'Inspections'=>'',
      ),  
    'SupplierLocation' => 'BB1',
    'SearchRadiusMiles' => '2',
    'Preference' => 'P',
    'MaxReturnNumber' => '5',
    'PageNo' => '0'
  )
  )
);

什么都没有回来,我已经启用了跟踪,这就是请求中传递的内容:

REQUEST:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"    xmlns:ns1="OneLink_ServiceBookingComponent">
<SOAP-ENV:Body><ns1:SupplierDirectorySearch>            
<ns1:SupplierSearchDetails>
<ns1:Identification>
 <ns1:SchemeOperatorRef>61</ns1:SchemeOperatorRef>
 <ns1:SecurityToken>MYTOKEN</ns1:SecurityToken>
</ns1:Identification>  

<ns1:SupplierLocation>BB1</ns1:SupplierLocation>
<ns1:SearchRadiusMiles>2</ns1:SearchRadiusMiles>
<ns1:Preference>P</ns1:Preference> 
<ns1:ApprovedServices ServiceRepair="Y" MOT="" Tyres="" CollectionDelivery=""  CourtesyCar="" WhileUWait="" Callout24Hour="" BreakdownCover="" CollectionDeliveryNotes="" CourtesyCarNotes="" Inspections=""/>
<ns1:MaxReturnNumber>5</ns1:MaxReturnNumber>
<ns1:PageNo>0</ns1:PageNo>
</ns1:SupplierSearchDetails>
</ns1:SupplierDirectorySearch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

任何人都可以对此有所了解,这让我绞尽脑汁!!


我一直在寻找,你认为我将不得不像这样对部分进行编码:

<?php 
  $amount['_'] = 25; 
  $amount['currencyId'] = 'GBP'; 
  $encodded = new SoapVar($amount, SOAP_ENC_OBJECT); 

?>

斯科特

4

0 回答 0