Acumatica - Web services sample code in Java -
has written acumatica web services in java language? need sample code of screen in acumatica.
thank you, sharif a
sharif,
here's command line sample wrote long time ago. following assumptions used in example:
- client application access acumatica erp instance installed demo application database. web services wsdl definition file imported , proxy class generated in ar303000 package.
web services wsdl definition file imported , proxy class generated in ar303000 package.
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"); (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(); (int = 0; < lines.size(); i++) { list<string> currentline = lines.get(i).getstring(); system.out.printf("%s (%s)\n", currentline.get(0), currentline.get(1)); } } }
Comments
Post a Comment