cancel
Showing results for 
Search instead for 
Did you mean: 

Error Parsing : blackberry

LGA
Participant
0 Kudos

hi,

I develop an application in blackberry which I call a web service that is the addition of two numbers that I created with ECC, the problem is when I return the result it gives me an error :

error

parsing ...org.xmlpull.v1.xmlPULLParserException : unexpected type (position : end_document null@ 1 in java.io.inputStream@6a933e95

I develop an application in blackberry which I call a web service that is the addition of two numbers that I created with ECC, the problem is when I return the result it gives me an error

I think this is a prblem authentication because I tested the web service with soapUI and it works, I do not know how to pass the login and password with ksoap2.

I used HttpTransportSE class but it did not work.

thank you for your help

Accepted Solutions (0)

Answers (3)

Answers (3)

LGA
Participant
0 Kudos

I solved it right

LGA
Participant
0 Kudos

I solved it right

Former Member
0 Kudos
LGA
Participant
0 Kudos

thank you for your reply

I have already used this idea but it does not work here my my source code

public void doKSOAP(String valeur1, String valeur2)
	{
	

		//Step 3 : Operation will be invoked on the endpoint (URL)
		//SoapObject take too params "web service name space, by default(http://tempuri.org/)" & "function"
		SoapObject rpc = new SoapObject(serviceNamespace, "Zmafonctionsws");
		rpc.addProperty("Valeur1", valeur1);
		rpc.addProperty("Valeur2", valeur2);
		

		//Step 2 : Instanciate the envelope that wraps the SOAP request or response //(version is ksoap 1.2)
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

		envelope.bodyOut = rpc;
		//envelope.dotNet = true;
		envelope.encodingStyle = SoapSerializationEnvelope.XSD;

		//Step 1 : Create HTTP connection to the webservice and the function needed
		//HttpTransport ht = new HttpTransport(serviceUrl);
		

		AuthTransportSE bb = new AuthTransportSE(serviceUrl, "toto", "titi");
		//Step 5 : Create debug parameters to say content buffer for input/output
		bb.debug = true;

		try
		{
			//Step 6 : Making the call			
			//ht.call(null, envelope);
			bb.call(null, envelope);

			//Step 7 : Get reponse from envelope
			//String result = (envelope.getResult()).toString();

			SoapObject body = (SoapObject)envelope.bodyIn;

			String result = (String)body.getProperty("Result").toString();
			System.out.println("resultat "+result);
			lab2.setText(result.toString());

			lab1.setText("Result :" + result);
		}
		catch(org.xmlpull.v1.XmlPullParserException ex2)
		{
			lab2.setText("Error !!!??? Parsing ...." + ex2.toString());
		}
		catch(Exception ex)
		{
			lab3.setText("Oth Except ..." + ex.toString());
		}
	}
}