簡體   English   中英

用於respone的wsdl php soap示例

[英]wsdl php soap example for respone

這是wsdl的一部分:

 <message name="addSubscriberRequest">
    <part name="api_key" type="xsd:string"/>
    <part name="group_id" type="xsd:int"/>
    <part name="email" type="xsd:string"/>
    <part name="name" type="xsd:string"/>
 </message>
    <message name="addSubscriberResponse">
    <part name="error" type="tns:ErrorTypeEnum"/>
 </message>

 <operation name="addSubscriber">
     <input message="tns:addSubscriberRequest"/>
     <output message="tns:addSubscriberResponse"/>
 </operation>

好? 現在我要發送一些數據到該服務器:

$client = new soapclient('http://mailerlite.com/soapserver.php?wsdl');
$client->addSubscriber('EMtest', 44983, 'name@example.com', 'Name');

該代碼目前正在工作...

現在

我有這個:

Return Codes
0: Success - the subscription was successful
1: Invalid email address
100: Invalid API Key
101: Invalid GroupID
201: Is Unsubscribed
202: Is Bounced

現在如何獲取錯誤代碼? 我寫了這段代碼,但這是錯誤的...

$respone=$client->addSubscriberResponse();
$client = new soapclient('http://mailerlite.com/soapserver.php?wsdl');
$response=$client->addSubscriber('EMtest', 44983, 'name@example.com', 'Name');
echo $response;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM