小编kev*_*mcg的帖子

PHP SoapClient - 具有相同键的多个属性

我正在使用 SoapClient,试图为这个规范制作一些东西:

<?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>
    <WSUser xmlns="http://webservices.listrak.com/v31/">
      <UserName>string</UserName>
      <Password>string</Password>
    </WSUser>
  </soap:Header>
  <soap:Body>
    <SetContact xmlns="http://webservices.listrak.com/v31/">
      <WSContact>
        <EmailAddress>string</EmailAddress>
        <ListID>int</ListID>
        <ContactProfileAttribute>
          <AttributeID>int</AttributeID>
          <Value>string</Value>
        </ContactProfileAttribute>
        <ContactProfileAttribute>
          <AttributeID>int</AttributeID>
          <Value>string</Value>
        </ContactProfileAttribute>
      </WSContact>
      <ProfileUpdateType>NotDefined or Update or Append or Overwrite</ProfileUpdateType>
      <ExternalEventIDs>string</ExternalEventIDs>
      <OverrideUnsubscribe>boolean</OverrideUnsubscribe>
    </SetContact>
  </soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)

我研究了很多,包括以下内容,并认为我有答案。但是,它不起作用。这就是我正在做的:

foreach ($attributes as $key => $value) {
            $obj = array('AttributeID' => $key, 'Value' => $value);
            $attrs[] = $obj;
    }
    $final_attrs = array('ContactProfileAttribute' => $attrs);

    $params = array(
                    'WSContact' => array(
                                    'EmailAddress' => $email,
                                    'ListID' => $listId, …
Run Code Online (Sandbox Code Playgroud)

php soap-client

5
推荐指数
1
解决办法
4495
查看次数

标签 统计

php ×1

soap-client ×1