2016-03-05 33 views
0

我正在尝试调用Zuora Soap API的更新方法以便'CloseAccountingPeriod'。什么是应该做的正确的方式这通过SOAP在Zuora中关闭AccountingPeriod

require 'savon' 
    message = {'username' => 'username','password' => 'password' } 
    client = Savon.client(wsdl: 'zuora.a.75.0.wsdl') 
    response = client.call(:login, message: message) 
    @response = client.call :update do 
    soap.header = { 
    } 

    soap.body = { 
       :Status=> "closed", 
       :ids=>"4028e699235ea4defd5d68" 
       } 
    end  

的Zuora的肥皂看起来是这样的:

<?xml version='1.0' encoding='UTF-8'?> 
    <soapenv:Envelope xmlns:soapenv= 
    "http://schemas.xmlsoap.org/soap/envelope/"> 
    <soapenv:Header> 
    <ns1:SessionHeader xmlns:ns1= 
    "http://api.zuora.com/" soapenv:mustUnderstand="0"> 
    <ns1:session>[replace with your session]</ns1:session> 
    </ns1:SessionHeader> 
    </soapenv:Header> 
    <soapenv:Body> 
    <ns1:update xmlns:ns1="http://api.zuora.com/"> 
    <ns1:zObjects xmlns:ns2="http://object.api.zuora.com/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:type="ns2:AccountingPeriod"> 
    <ns2:Id>402892a83711418b01371142cc5801a9</ns2:Id> 
    <ns2:Status>Closed</ns2:Status> 
    </ns1:zObjects> 
    </ns1:update> 
    </soapenv:Body> 
    </soapenv:Envelope> 

回答

0

这个例子是正确的

所需的最小数据

  • 会话密钥
  • AccountingPeriod的32个字符的标识
  • 状态“关闭”
+0

如果您遇到让你的样品工作,你可能会想尝试在他们的[API论坛]张贴问题(http://community.zuora.com/t5/API/bd-p/API) – user2763008

+0

对不起,这是一个不好的链接我认为这是正确的地方[Zuora API论坛](http://community.zuora.com/t5/API/bd-p/API) – user2763008