3

我有一个示例 XML 文件,它连接到 SOAP 服务器并将“usero1”的“Tier”属性设置为“pkg01”。

在 SOAP UI 上运行此 XML 文件时,它可以工作。

我想通过 PHP 为这项工作创建一个 SOAP 函数。但我不知道如何开始,我必须调用多少个函数?任何人请帮助。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.subscriberservices.sandvine.com">
   <soapenv:Header xmlns:svsec="http://services.sandvine.com">
      <svsec:username>username</svsec:username>
      <svsec:password>password</svsec:password>
   </soapenv:Header>
   <soapenv:Body>
      <ws:SetSubscriberAttributesRequest>
         <Debug>false</Debug>
         <BulkOperationFailureBehaviour>AllOrNothing</BulkOperationFailureBehaviour>
         <SetSubscriberAttributeParameterSets>
            <SetSubscriberAttributeParameterSet>
               <SubscriberKey>
                  <SubscriberRealmKey>
                     <Name>DEFAULT</Name>
                  </SubscriberRealmKey>
                  <Name>user01</Name>
               </SubscriberKey>
               <SubscriberAttributeDefinitionKey>
                  <Name>Tier</Name>
               </SubscriberAttributeDefinitionKey>
               <Value>pkg01</Value>
            </SetSubscriberAttributeParameterSet>
        </SetSubscriberAttributeParameterSets>
         <ResponseGroups>
            <ResponseGroup>Subscriber.Shallow</ResponseGroup>
         </ResponseGroups>
      </ws:SetSubscriberAttributesRequest>
   </soapenv:Body>
</soapenv:Envelope>
4

1 回答 1

0

XML 文件未连接到 SOAP 服务器 - XML 文件表示 SOAP 请求。

您需要做的是为您的 SOAP 服务器编写一个 php SOAP 客户端。为此,您将需要:

  1. SOAP 服务器的 wsdl 文件的 uri(这本质上是允许您的客户端创建请求的元数据 - 它描述了服务器允许的功能)
  2. Zend_Soap_Client 类 - http://framework.zend.com/manual/2.0/en/modules/zend.soap.client.html

您可以在此处阅读有关 PHP 和 SOAP 的更多信息使用 Zend 框架实现 SOAP 服务

于 2013-03-21T10:51:14.767 回答