[android-developers] android ksoap2 Caused by: java.lang.RuntimeException: Cannot seralize (double data type)

2010-09-30 Thread mindus
Hi
In my project i am using ksoap2-android-assembly-2.4-jar-with-
dependencies.jar for web service purpose.

I got able to access the service and passing simple parameters and get
the objects and iterate it.

But the problem is i cant able to send the complex object. Can anybody
know how to pass the complex object with date and double values.

Employee object have string name, int number, double salary and Date
dateOfBirth.

And the employee object implements KvmSerializable
name=Mike
number=2;
salary=2
dateOfBirth = new Date();

and the code is

SOAP_ACTION = http://xysed/GetHRA;;
METHOD_NAME = GetHRA;

TextView authenticate = new TextView(this);

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

PropertyInfo pi = new PropertyInfo();
pi.setName(employee);
Employee e = new Employee();
e.setNumber(4);
e.setName(Ananth);
e.setSalary(2);
e.setDob(new Date());
pi.setValue(e);
pi.setType(Employee.EMPLOYEE_CLASS);
request.addProperty(pi);
request.addProperty(employee, e);


SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
Marshal dateMarshal = new MarshalDate();
dateMarshal.register(envelope);
//envelope.addMapping(Employee.NAMESPACE, Employee, new
Employee().getClass());
try {
AndroidHttpTransport androidHttpTransport = new
AndroidHttpTransport(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);

//String fullName = (String)envelope.getResponse();
Log.v(Full String :, envelope.getResponse().toString());
Log.v(body in :, envelope.bodyIn.toString());
Log.v(body out :, envelope.bodyOut.toString());

authenticate.setText(envelope.getResponse().toStri ng());
this.setContentView(authenticate);

} catch (IOException ioe) {
ioe.printStackTrace();
} catch (XmlPullParserException xpe) {
xpe.printStackTrace();
}



I pass this employee object as a request i got an error like

java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.oak.soap.test/com.oak.soap.test.WebserviceDisplay}:
java.lang.RuntimeException: Cannot serialize: 2.0

here 2.0 is a salary ( double value)

ERROR/AndroidRuntime(287): Caused by: java.lang.RuntimeException:
Cannot serialize: 2.0


Can anybody provide samples for how to pass complex object as request
to web service

Thanks
mindus

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Using PackageManager display word/Xsl Document

2010-09-16 Thread mindus
Hi
  Presently i am working on android project. I am using webview in one
of my screen to display pdf/word/xsl documents and tiff images. As i
came to know by default, the webview won't display any pdf/word/xsl
documents. So i used Package manager to display the pdf file in the
webview. For that in the emulator i installed pdf viewer and it will
display pdf file.

   Like that i want to display word/excel document tiff
images. Any body have idea how to do this. If we can use same package
manager then how can we check the setDataAndType for word and xsl
document.

 Is there is any other way to approach this problem. If it is
there please share your comments.


Thanks
mindus

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Display pdf file using webview

2010-09-16 Thread mindus
Hi
  I can able to display pdf file (download to the device and using
package manager dispaly it).

 The above things are working fine if the url ends with .pdf
extension. But it is not working if the pdf url ends with doc+2+pdf.


Any idea how to display pdf file (pdf url ends wih doc+2+pdf)


Thanks
mindus

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en