sabun başlıkları sorun

0 Cevap php

Ben Test web hizmeti için aşağıdaki kodu kullanabilirsiniz çalışıyorum ama işe görünmüyordu. Ben istisna deyişi almaya devam

SoapFault exception: [soap:Client] System.Web.Services.Protocols.SoapHeaderException: eWAYCustomerID, Username and Password are required in soap header at ...

Ben sabun çok yeni gibi ben basit olan bir şey bu yüzden herhangi bir yardım için şimdiden teşekkürler eksik tahmin ediyorum. Php kodu:

class SOAPStruct {
    function SOAPStruct($s, $i, $f) 
    {
        $this->UserName = $s;
        $this->Password = $i;
        $this->eWAYCustomerID = $f;
    }
}

$struct = new SOAPStruct('test@eway.com.au', "test", "87654321");

$client = new SoapClient("https://www.eway.com.au/gateway/services/TransactionReportService.asmx?wsdl"); 

$authvalues = new SoapVar($struct, SOAP_ENC_OBJECT,'SOAPStruct',"http://www.eway.com.au/gateway/services/Transaction24HourReport");

$header =  new SoapHeader("http://www.eway.com.au/gateway/services/Transaction24HourReport","eWAYHeader", $authvalues, true);

echo $client->Transaction24HourReportByInvoiceReference('1234567');

this pdf yapısı gereği gibi olmalıdır göndermek

<soap:Header> 
<eWAYHeader 
xmlns="http://www.eway.com.au/gateway/services/Transaction24HourReport"> 
 <eWAYCustomerID>87654321</eWAYCustomerID> 
 <Username>test@eway.com.au</Username> 
 <Password>test</Password> 
</eWAYHeader> 
</soap:Header> 
<soap:Body> 
<Transaction24HourReportByInvoiceReference 
xmlns="http://www.eway.com.au/gateway/services/Transaction24HourReport"> 
 <ewayCustomerInvoiceRef>1234567</ ewayCustomerInvoiceRef > 
</ Transaction24HourReportByInvoiceReference > 
</soap:Body> 

0 Cevap