title: Acumatica Web Services API Login
body: <p>I am attempting to perform some basic integration using Acumatica's web services. Unfortunatly, I'm having problems logging in. According to their documentation, this process should look something like:</p>
  
  <pre><code>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");
  </code></pre>
  
  <p>Simple enough. However, after creating and importing a WSDL file from Acumatica into Visual Studio, I found I don't have a Screen object. I do, however have a ScreenSoapClient object, which has a similar Login() method. </p>
  
  <pre><code>ScreenSoapClient context = new Acumatica.ScreenSoapClient("ScreenSoap");
  LoginResult result = context.Login("username", "password");
  </code></pre>
  
  <p>That part works. In fact, the LoginResult give me a session ID. However, if I try to make any calls to the service, such as:</p>
  
  <pre><code>CR401000Content cr401000 = context.CR401000GetSchema();
  </code></pre>
  
  <p>I get an error: <strong>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> PX.Data.PXNotLoggedInException: Error #185: You are not currently logged in.</strong></p>
  
  <p>While the version of Acumatica we're using does appear to be slightly newer, I'm unsure why the Screen() object isn't available.  Consequently, if I try a bad username/password, Login() does fail (as it should). From what I can the tell, the ScreenSoapClient class is using service model details from web.config, so it's getting the endpoint address and other details there. </p>
  
  <p>Is there something I'm missing or doing wrong?</p>