title: Error when calling web service from Domino
body: <p>I need to connect to a .net application via it's SOAP Web Service but can't get it working from Domino.  Using XPages I want to connect to the web service to return data to the xpage.  I tried creating an agent to make the call, but that hasn't worked.  I receive the following java StackTrace when I run the agent:</p>
  
  <pre><code>WebServiceEngineFault
   faultCode: {http://www.lotus.com/domino/ws/}HTTP
   faultSubcode:
   faultString: (401) Unauthorized
   faultActor:
   faultNode:
   faultDetail:
          {}string:
  
  (401) Unauthorized
          at lotus.domino.axis.transport.http.HTTPSender.readFromSocket(Unknown Source)
          at lotus.domino.axis.transport.http.HTTPSender.invoke(Unknown Source)
          at lotus.domino.axis.strategies.InvocationStrategy.visit(Unknown Source)
          at lotus.domino.axis.SimpleChain.doVisiting(Unknown Source)
          at lotus.domino.axis.SimpleChain.invoke(Unknown Source)
          at lotus.domino.axis.client.AxisClient.invoke(Unknown Source)
          at lotus.domino.axis.client.Call.invokeEngine(Unknown Source)
          at lotus.domino.axis.client.Call.invoke(Unknown Source)
          at lotus.domino.axis.client.Call.invoke(Unknown Source)
          at lotus.domino.axis.client.Call.invoke(Unknown Source)
          at lotus.domino.axis.client.Call.invoke(Unknown Source)
          at lotus.domino.websvc.client.Call.invoke(Unknown Source)
          at com.imanage.worksite.IWOVServicesSoapStub.getFolders(Unknown Source)
          at JavaAgent.NotesMain(Unknown Source)
          at lotus.domino.AgentBase.runNotes(Unknown Source)
          at lotus.domino.NotesThread.run(Unknown Source)
  </code></pre>
  
  <p>I am able to call it successfully from soapUI passing in the user id, password and domain credentials.</p>
  
  <p>I set credentials in the agent that consumes the web service:</p>
  
  <pre><code>                            String arg0 = "DOMAINNAME\\USERID";
                              String arg1 = "PASSWORD";
                              stub.setCredentials(arg0, arg1);
  </code></pre>
  
  <p>and also in the web service consumer itself (in the SoapStub class - within the getFolders call):</p>
  
  <pre><code>                    _call.setUsername("DOMAINNAME\\USERID");
                      _call.setPassword("PASSWORD");
  </code></pre>
  
  <p>I'm new to XPages and Java.  Does anyone have any ideas what I might be missing or should check for?</p>
  
  <p>(I can't use Lotusscript for the web service consumer as the variable names generated by the WSDL are too long, so I have to use java in this case).</p>