2015-04-07 99 views
0

我們正在通過Web服務開發Acumatica和我們的應用程序之間的接口。我們正在使用Savon寶石在Ruby中開發它。通過網絡服務訪問採購訂單

我們已經有了一些,因爲我們需要的信息工作,像這樣的一個供應商數據的導出:

我們張貼以下SOAP調用(登錄後):

<?xml version="1.0"?> 
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.acumatica.com/typed/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> 
    <env:Body> 
    <tns:Export> 
     <tns:commands> 
     <tns:Command> 
      <tns:FieldName>AcctCD</tns:FieldName> 
      <tns:ObjectName>BAccount</tns:ObjectName> 
      <tns:Value>Account code</tns:Value> 
     </tns:Command> 
     <tns:Command> 
      <tns:FieldName>AcctName</tns:FieldName> 
      <tns:ObjectName>BAccount</tns:ObjectName> 
      <tns:Value>Account name</tns:Value> 
     </tns:Command> 
     </tns:commands> 
     <tns:filters/> 
     <tns:startRow>0</tns:startRow> 
     <tns:topCount>0</tns:topCount> 
     <tns:includeHeaders>false</tns:includeHeaders> 
     <tns:breakOnError>false</tns:breakOnError> 
    </tns:Export> 
    </env:Body> 
</env:Envelope> 

到測試端點:

http://p3.tryacumatica.com/(W(10003))/Soap/AP303000.asmx?WSDL 

我們也可以爲庫存和網站做同樣的事情。然而,我們正在努力讓它爲採購訂單工作。

我們張貼了以下內容:

<?xml version="1.0"?> 
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.acumatica.com/typed/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> 
    <env:Body> 
    <tns:Export> 
     <tns:commands> 
     <tns:Command> 
      <tns:FieldName>Type</tns:FieldName> 
      <tns:ObjectName>POOrder</tns:ObjectName> 
      <tns:Value>Type</tns:Value> 
     </tns:Command> 
     <tns:Command> 
      <tns:FieldName>OrderNbr</tns:FieldName> 
      <tns:ObjectName>POOrder</tns:ObjectName> 
      <tns:Value>Order number</tns:Value> 
     </tns:Command> 
     </tns:commands> 
     <tns:filters/> 
     <tns:startRow>0</tns:startRow> 
     <tns:topCount>0</tns:topCount> 
     <tns:includeHeaders>false</tns:includeHeaders> 
     <tns:breakOnError>false</tns:breakOnError> 
    </tns:Export> 
    </env:Body> 
</env:Envelope> 

到測試終點:

http://p3.tryacumatica.com/(W(3))/Soap/PO301000.asmx?WSDL 

我們始終只是得到一個空的輸入反應。有任何想法嗎?

+0

如果在表單中輸入相同的數據,你會得到什麼?您嘗試執行哪種形式的動作? –

+0

我試圖執行「導出」命令。我不知道如何在前端?我是否使用報告來做到這一點? –

回答

0

檢查PO模塊是否打開。還要檢查用戶是否有權查詢PO對象。數據庫是否收到查詢?一種選擇是從數據庫端進行調試。查看數據庫是否提取從Web服務輸入提交的查詢。
我知道這些都是簡單的想法,但值得一看。

+0

不幸的是,我沒有Acumatica的本地實例進行測試。我正在http://p3.tryacumatica.com上進行測試,以管理員身份登錄 它看起來像PO模塊已打開,因爲我可以從前端訪問它,並且我假定Admin用戶擁有權限,因爲我可以從前端查看PO的列表。 –

0

那麼,我的第一個問題是爲什麼你需要一個完整的列表PO?它可能是一個巨大的數據。 PO有複合鍵 - 類型,OrderNbr基本上使用導出命令,你必須像EveryOrderNbr指定值

見下文 link

0

+

舊的C#示例鏈接,SO

  Content SO301000 = context.GetSchema(); 
     context.Clear(); 

     string[][] data = context.Export(new Command[] 
     { 
      SO301000.OrderSummary.ServiceCommands.EveryOrderType, 
      SO301000.OrderSummary.ServiceCommands.EveryOrderNbr, 
      SO301000.OrderSummary.OrderType, 
      SO301000.OrderSummary.OrderNbr, 
      SO301000.OrderSummary.Description, 
      SO301000.OrderSummary.Hold, 
     }, null, 

     new Filter[] 
     { 

      new Filter { Field = SO301000.OrderSummary.OrderType, Condition = FilterCondition.Equals, Value = "IN", Operator = FilterOperator.And }, 
      new Filter { Field = SO301000.OrderSummary.OrderNbr, Condition = FilterCondition.Equals, Value = "23630843", Operator = FilterOperator.And } 
     }, 
       0, false, true);