Ewayとつながるサイトを開発中です。SandboxでRebillの顧客を作ろうとしています。しかし、呼び出しにいくつかのエラーがあります。
<?php
$url = "https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx";
$post_string = '<?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:Header>
<eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
<eWAYCustomerID>9194****</eWAYCustomerID>
<Username>******@********d.com.sand</Username>
<Password>S******55</Password>
</eWAYHeader>
</soap:Header>
<soap:Body>
<CreateRebillCustomer xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
<customerTitle>Mr</customerTitle>
<customerFirstName>Achintha</customerFirstName>
<customerLastName>Samindika</customerLastName>
<customerAddress>SID Designs</customerAddress>
<customerSuburb>Colombo</customerSuburb>
<customerState>ACT<</customerState>
<customerCompany>SID Con</customerCompany>
<customerPostCode>2111</customerPostCode>
<customerCountry>Australia</customerCountry>
<customerEmail>a****@ymail.com</customerEmail>
<customerFax>0298989898</customerFax>
<customerPhone1>0298989558</customerPhone1>
<customerPhone2>0295489898</customerPhone2>
<customerRef>REF585</customerRef>
<customerJobDesc>Dev</customerJobDesc>
<customerComments>Please Ship ASASP</customerComments>
<customerURL>www.****.com</customerURL>
</CreateRebillCustomer>
</soap:Body>
</soap:Envelope>';
$header = "POST /gateway/rebill/test/manageRebill_test.asmx HTTP/1.1 \r\n";
$header .= "Host: www.eway.com.au \r\n";
$header .= "Content-Type: text/xml; charset=utf-8 \r\n";
$header .= "Content-Length: ".strlen($post_string)." \r\n";
//$header .= 'SOAPAction: "http://www.eway.com.au/gateway/rebill/manageRebill/CreateRebillCustomer"'. "\r\n";
$header .= "Connection: close \r\n\r\n";
$header .= $post_string;
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);
$data = curl_exec($ch);
$status = curl_getinfo($ch);
if(curl_errno($ch))
print curl_error($ch);
else{
curl_close($ch);
echo '<pre>';
print_r($data);
print_r($status);
echo '</pre>';
//echo '<div align="center"><h3>Thank you.</h3></div>';
}
?>