Take the 2-minute tour ×

I've tried to google around for a working example. I've tried KSOAP2 and JCIFS examples but no success. The web service i'm trying to connect is 3rd parties (Microsoft Dynamics NAV) and can't be modified. It uses SOAP and either SPNEGO or NTLM authentication. And I guess it's already NTLMv2 but I'm not sure on that. Can anybody please suggest me a full code for the following SOAP request?

$<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:item="urn:microsoft-dynamics-schemas/page/items">
$   <soapenv:Header/>
$   <soapenv:Body>
$      <item:ReadMultiple>
$         <!--1 or more repetitions:-->
$         <item:filter>
$            <item:Field>No</item:Field>
$            <item:Criteria>1000</item:Criteria>
$         </item:filter>
$         <item:setSize>500</item:setSize>
$      </item:ReadMultiple>
$   </soapenv:Body>

I've validated this request with soapUI and it works fine. But when I tried to run it with KSOAP2 and JCIFS I get an error message "Connection refused". Important to note I am a beginner in Java and Android.

share|improve this question
Hello, could you please provide us sample code for ntlm Authentication in android for navision webservice ? we are try ntlm authentication using (JCIF) samba lib. –  iOS Developer Oct 10 '13 at 14:20
add comment

1 Answer

I have had limited experience with NAV and SOAP, however I had a similar issue with Authentication.

What I needed to do is actually run the request twice. For some reason the first request would never go through (maybe as part of a handshake?), but the second would return a valid response. The best debugging tool was a simple HTTP Proxy (such as Burpsuite) which let me see what exactly was being sent (in terms of headers etc) and what the response was.

Secondly, as I was manually creating this SOAP Request, I had missed out the SOAPAction header for NAV. I'm not sure if this is standard, but I needed to use the HTTP Proxy with a .NET Web Service connection (The official way of talking to NAV through SOAP) and discover how it was talking.

share|improve this answer
add comment

Your Answer


