asp.net Web サービスを使用する php ソープクライアントを作成する必要があります。私はマニュアルページを読みましたが、私は PHP にかなり慣れていないことを認めます。型付き言語の 20 年間は、私が愚かなままでいる可能性があります。
私はsoapvar、配列、クラスを試しました。それらはすべて、通常、「オブジェクト以外のメンバー関数 CreatePurchase() への呼び出し...」で終了します。
ASP.net コードは正常に動作し、Fiddler で釣り上げるとこれが生成されます。
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><CreatePurchase xmlns="http://licensing.mancosoftware.com/webservices/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><axCustomer><Customer Name="Ron Howard" EMail="RH@Anysite.com" FirstName="Ron E" LastName="Howard" Salutation="Mr." Company="RHP" Address="1313 Mockingbird Rd." Address2="1" City="Los Angles" StateCode="CA" CountryISOCode="USA" PostCode="99999-9999" Phone="888.888.8888" Fax="888.888.8888" Comments="Now is time for all good men to come to the aid of their country" xmlns=""><Purchase LicenseID="0" PurchaseDate="9/23/2012" Income="0.00" Comments="AOTC"></Purchase></Customer></axCustomer></CreatePurchase></s:Body></s:Envelope>
では、CreatePurchase は、私が見逃しているパラメーター フィールドで何を探しているのでしょうか?
よろしく、
PHP バージョン 5.3.21 アパッチ 2.2.22
WSDL は次のとおりです。
http://www.mancosoftware.com/ActivationService/ActivationService.asmx?WSDL
<s:element name="CreatePurchase"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="axCustomer"><s:complexType><s:sequence><s:any/></s:sequence></s:complexType></s:element><s:element minOccurs="1" maxOccurs="1" name="returnFullSaleInfo" type="s:boolean"/></s:sequence></s:complexType></s:element>
<s:element name="CreatePurchaseResponse"><s:complexType><s:sequence><s:element minOccurs="1" maxOccurs="1" name="CreatePurchaseResult" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="aoUnlockKeyList" type="tns:ArrayOfString"/></s:sequence></s:complexType></s:element>
CreatePurchase { axCustomer axCustomer; boolean returnFullSaleInfo; }" [5]=> string(36) "struct axCustomer { any; }"
POST /ActivationService/ActivationService.asmx HTTP/1.1
Host: www.mancosoftware.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://licensing.mancosoftware.com/webservices/CreatePurchase"
<?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>
<CreatePurchase xmlns="http://licensing.mancosoftware.com/webservices/">
<axCustomer>xml</axCustomer>
<returnFullSaleInfo>boolean</returnFullSaleInfo>
</CreatePurchase>
</soap:Body>
</soap:Envelope>
<?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>
<CreatePurchaseResponse xmlns="http://licensing.mancosoftware.com/webservices/">
<CreatePurchaseResult>boolean</CreatePurchaseResult>
<aoUnlockKeyList>
<string>string</string>
<string>string</string>
</aoUnlockKeyList>
</CreatePurchaseResponse>
</soap:Body>
</soap:Envelope>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$params['trace'] = true;
$soapURL = "http://www.mancosoftware.com/ActivationService/ActivationService.asmx?WSDL";
$client = new SoapClient($soapURL, $params);
$result = $client->Login(array(
"asUserName" => "xxx",
"asPassword" => "xxx"
));
$name = "Ron Howard";
$email = "rh@abc.com";
$firstname = "Ron";
$lastname = "Howard";
$salutation = "Mr.";
$company = "RHP";
$address = "1313 Mockingbird Lane";
$address2 = "";
$city = "LA";
$statecode = "CA";
$countryISOcode = "USA";
$postcode = "99999";
$phone = "8888888";
$fax = "8888888";
$comments = "test 1";
$purchasedate = date("m/d/Y");
$writer = new XMLWriter();
$writer->openMemory();
$writer->setIndent(4);
$writer->startElement('Customer');
$writer->writeAttribute('Name', $name);
$writer->writeAttribute('EMail', $email);
$writer->writeAttribute('FirstName', $firstname);
$writer->writeAttribute('LastName', $lastname);
$writer->writeAttribute('Salutation', $salutation);
$writer->writeAttribute('Company', $company);
$writer->writeAttribute('Address', $address);
$writer->writeAttribute('Address2', $address2);
$writer->writeAttribute('City', $city);
$writer->writeAttribute('StateCode', $statecode);
$writer->writeAttribute('CountryISOcode', $countryISOcode);
$writer->writeAttribute('PostCode', $postcode);
$writer->writeAttribute('Phone', $phone);
$writer->writeAttribute('Fax', $fax);
$writer->writeAttribute('Comments', $comments);
$writer->startElement('Purchase');
$writer->writeAttribute('LicenseID', '0');
$writer->writeAttribute('PurchaseDate', $purchasedate);
$writer->writeAttribute('Income', '0');
$writer->writeAttribute('Comments', 'Test');
$writer->endElement();
$writer->endElement();
$Customer1 = ($writer->outputMemory(True));
$result = $Client->CreatePurchase(this is where I break down and cry and beg for help)
$result1 = $client->Logout();
?>