c# - Acumatica Web Services API Login -


i attempting perform basic integration using acumatica's web services. unfortunatly, i'm having problems logging in. according documentation, process should like:

apitest.screen context = new apitest.screen(); context.cookiecontainer = new system.net.cookiecontainer(); context.allowautoredirect = true; context.enabledecompression = true; context.timeout = 1000000; context.url = "http://localhost/webapivirtual/soap/apitest.asmx"; loginresult result = context.login("admin", "e618"); 

simple enough. however, after creating , importing wsdl file acumatica visual studio, found don't have screen object. do, have screensoapclient object, has similar login() method.

screensoapclient context = new acumatica.screensoapclient("screensoap"); loginresult result = context.login("username", "password"); 

that part works. in fact, loginresult give me session id. however, if try make calls service, such as:

cr401000content cr401000 = context.cr401000getschema(); 

i error: system.web.services.protocols.soapexception: server unable process request. ---> px.data.pxnotloggedinexception: error #185: not logged in.

while version of acumatica we're using appear newer, i'm unsure why screen() object isn't available. consequently, if try bad username/password, login() fail (as should). can tell, screensoapclient class using service model details web.config, it's getting endpoint address , other details there.

is there i'm missing or doing wrong?

as see, use wcf create service reference. should enable cookies in service binding:

var binding = new basichttpbinding() {     allowcookies = true };  var address = new endpointaddress("http://localhost/webapivirtual/soap/apitest.asmx");  var c = new servicereference1.screensoapclient(binding, address); 

or, can use old asmx web service reference (http://msdn.microsoft.com/en-us/library/bb628649.aspx). same in acumatica`s documentation.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -