Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Use Dynamic NAV web services with Android (Java)

$
0
0
Hello guys,

since a few days I try to use web services with the Android SDK. Normally it should not be a big problem, because Android supports SOAP and I never had any problem to use web services from webpages. But NAV makes problems.
I haven't got any problems to establish a connection to the webservice, it seems that the request doesn't work...

Take a look:
String great = "";
String namespace = "urn:microsoft-dynamics-schemas/codeunit/CU_Vendor";
String url = "http://mch:7047/DynamicsNAV/WS/CRONUS International Ltd./Codeunit/CU_Vendor";	
String soap_action = "urn:microsoft-dynamics-schemas/Codeunit/CU_Vendor:Getvendor";
String method_name = "Getvendor";
	    
try
{
		SoapObject request = new SoapObject(namespace, method_name);    
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
		        
		 envelope.dotNet = true;   
		 envelope.setOutputSoapObject(request);   
		 HttpTransportSE transport = new HttpTransportSE(url);    
		 transport.call(soap_action, envelope); // Receive Error here!
	         SoapObject result = (SoapObject) envelope.getResponse();
	         great = result.toString();
}
catch (Exception e)
{
			great = e.toString();
}
return great; // Out there is a DialogAlert which manages output.

I get following Errormessage:
org.xmlpull.v1.xmlpullparserexception:
unexpected type (position: END_DOCUMENT null@1:0 in
Java.io.inputstreamreader@44c4d2f0)

The Codeunit "CU_Vendor" has got "Getvendor" a function which returns the name of the first vendor.
I use the ksoap2-Library.
The same code works perfectly with web services from webpages.

Has anybody a idea to solve my problem?

Greetings:

El Barto

Viewing all articles
Browse latest Browse all 10032

Trending Articles