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:

  1. client application access acumatica erp instance installed demo application database. web services wsdl definition file imported , proxy class generated in ar303000 package.
  2. 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

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -