0
A
回答
5
謝里夫,
下面是一個命令行示例中,我寫了一個很久以前。以下假設在此示例中使用:與演示 應用數據庫安裝
- 客戶端應用程序訪問Acumatica ERP實例。 Web服務WSDL定義文件被導入 和在AR303000包中生成的代理類。
Web服務WSDL定義文件被導入,代理類 在AR303000包中生成。
private static String getCookie(BindingProvider port) { Map<String, ?> headers = (Map<String, ?>) port.getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS); StringBuilder sb = new StringBuilder(); List<String> cookie = (List<String>) headers.get("Set-Cookie"); for (String c : cookie) { int idx = c.indexOf(";"); if (idx != -1) { sb.append(c.substring(0, idx)); } else sb.append(c); sb.append("; "); } return sb.toString(); } private static void setCookie(BindingProvider port, String value) { port.getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS, Collections.singletonMap("Cookie", Collections.singletonList(value))); } public static void main(String[] args) { Screen service = new Screen(); ScreenSoap screen = service.getScreenSoap(); LoginResult lres = screen.login("admin", "123"); String cookie = getCookie((BindingProvider) screen); setCookie((BindingProvider) screen, cookie); Content content = screen.getSchema(); ArrayOfCommand commands = new ArrayOfCommand(); commands.getCommand().add(content.getCustomerSummary().getServiceCommands().getEveryCustomerID()); commands.getCommand().add(content.getCustomerSummary().getCustomerName()); commands.getCommand().add(content.getGeneralInfoMainAddress().getCity()); ArrayOfArrayOfString result = screen.export(commands, null, 0, true, true); List<ArrayOfString> lines = result.getArrayOfString(); for (int i = 0; i < lines.size(); i++) { List<String> currentLine = lines.get(i).getString(); System.out.printf("%s (%s)\n", currentLine.get(0), currentLine.get(1)); } } }
相關問題
- 1. Java 8服務器事務的代碼示例
- 2. 如何在Acumatica Web服務中使用JSON代替XML
- 3. 代理的Java Web服務
- 4. Java Web服務中的單例對象
- 5. Acumatica web服務API登錄失敗
- 6. 示例Web服務 - 更新
- 7. 示例SSL代碼服務器
- 8. NodeJS聊天服務器示例代碼
- 9. 替代Java中的Web服務
- 10. Web服務中的代碼解釋器
- 11. Acumatica - 來自代碼
- 12. Web服務中的例外
- 13. java - pngcrush示例代碼snipet
- 14. Hyperic java api示例代碼
- 15. Java服務器代碼/ Web服務器中的基本/摘要認證實現
- 16. 當我從服務器運行Web服務時,java代碼中的空日期
- 17. 需要簡單的Web服務示例
- 18. JDK 1.4的簡單web服務示例
- 19. C++中的示例服務器/客戶端代碼(不是C)
- 20. ASP.NET中擁有OpenId服務器的示例代碼?
- 21. 使用Web服務的Java或.NET應用程序示例?
- 22. 具有DTO和DAO的示例Java EE Web服務
- 23. java web客戶端的示例使用ws02身份服務器
- 24. 示例非平凡的Java EE web服務實現?
- 25. .NET代理Web服務的任何示例?
- 26. Web服務中的Java FileInputStream
- 27. java中的Restful web服務
- 28. Java Web服務中的NoSuchMethodException
- 29. 替代基於Java/Spring的Web服務
- 30. 在Nim中支持web套接字的Web服務器示例
喜加布裏埃爾,精彩......謝謝你這麼多 – SharifA
[這裏是我的老文章] [1] [1]:http://forum.acumatica.com/forum/ acumatica轉銷商和獨立軟件開發商社區/顯影和定製/ 740-API如何做創建的API項目和使用的,它與 - C-PHP-java的?p = 3391#post3391 – srodionov