Using KSoap2 with VB.Net webservice

by MaximG » Thu, 16 Apr 2009 00:56:29 GMT

Sponsored Links
 ello All,
I am having some serious difficulty using KSoap2 to connect to a
VB.Net webservice and am hoping I could get some help from someone who
is smarter than me. I have been trying to work this out for 2 weeks
with no luck.

So this is my problem. Using KSoap2 on the Android platform I have
successfully queried a super simple web service that I created using (It can be found at
I receive a XML result which looks quite reasonable to me.

ReturnCustomerObject2Result=anyType{CustomerID=1; FirstName=This is a
test; };

However at the point where I try to cast the object I am returning
from the webservice into a KvmSerializable object (as required by
KSoap2) I receive a java.lang.ClassCastException.

This is my object (I have excluded imports for brevity):

public class Customer extends BaseObject {

private int m_CustomerID;
private String m_FirstName;
public static Class<? extends Customer> Customer_CLASS = new Customer

public void setCustomerID(int CustomerID) {
m_CustomerID = CustomerID;
public int getCustomerID() {
return m_CustomerID;
public void setFirstName(String FirstName) {
m_FirstName = FirstName;
public String getFirstName() {
return m_FirstName;

public void getPropertyInfo(int index, Hashtable properties,
PropertyInfo info) {
switch (index)
case 0:
info.type = PropertyInfo.INTEGER_CLASS; = "CustomerID";
case 1:
info.type = PropertyInfo.STRING_CLASS; = "FirstName";


public Object getProperty(int index)
switch (index) {
case 0:
return m_CustomerID;
case 1:
return m_FirstName;
return null;

public int getPropertyCount() {
return 2;

public void setProperty(int index, Object value) {

switch (index) {
case 0:
m_CustomerID = Integer.parseInt(value.toString());
case 1:
m_FirstName = value.toString();


private static final String SOAP_ACTION = "
private static final String METHOD_NAME = "ReturnCustomerObject2";
private static final String NAMESPACE = "";
private static final String URL = "http://";

public Boolean ExecuteSoapAction() {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope
envelope.encodingStyle = SoapSerializationEnvelope.XSD;
"ReturnCustomerObject2", new Customer().getC

Other Threads

1. Two Problems with ExpandableListView

Very pleased  :) with the way ExpandableListView works but am unclear
how to set the clicked view as invalid in OnDismiss.

Problem One

In the onChildClick(ExpandableListView parent, View v, int
groupPosition, int childPosition, long id)
I call the Dialog "Enter" and wait for dismiss so:-

Value = new Value_Input(test2.this,0, custno, itemno, day);
            Value.setOnDismissListener(new OnDismissListener() {
            public void onDismiss(DialogInterface arg0) {


the invalidateViews() seems a bit heavyweight when I only want to
redraw the clicked view.

the other options are:-

getExpandableListView().invalidate(l, t, r, b)
getExpandableListView().invalidateChild(child, dirty)
getExpandableListView().invalidateChildInParent(location, dirty)

basically how do I get from groupPosition, childPosition to the View
after the event??
or how to use one of the above??

What I  need is:-

( groupPosition, childPosition)

Problem Two

How do I get the adapter not to draw GONE views.  I have tried the
trick I used in the simple BaseAdapter in both getGroupView and
getChildView but it does not work :-

                boolean found=false;
                int count = getExpandableListView().getChildCount();
                for(int i=0;i<count;i++){
                        View block2 = 
                        if (block2.getVisibility()==View.GONE){
                if (found){

What do I do???  Why doesn't the adapter look after this for me??

I would argue that both of the above problems currently require the
user to have an understanding of what is going on inside the adapter
other than the basics. (dangerous)  Or am I missing something basic??

Many thanks in advance


2. Adding a shortcut to Programs (launchers) programmatically


I'd like to programmatically add shortcuts to "Applications" (list of
launchers) - typically these are added automatically when an
application is installed.

The shortcuts could be to native executables or to regular application

Is this possible at all? If so, could someone help me figure out how?

Thank you,

3. interrupt dialog

4. SurfaceFlinger and SurfaceComposerClient problem.

5. call addFlags in xml

6. OpenGL ES - How to get the current ModelView matrix?

7. .Net support