Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8631893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:16:45+00:00 2026-06-12T09:16:45+00:00

I need to pass a List<string> or List<object> to consume WCF soap service from

  • 0

I need to pass a List<string> or List<object> to consume WCF soap service from Android. I have tried a lot of ways.

When i used below code:

public class MarshalArray implements Marshal{

@Override
public Object readInstance(XmlPullParser parser, String namespace, String name,
        PropertyInfo expected) throws IOException, XmlPullParserException {

    return GenericType.getObject(parser.nextText());
}

@Override
public void register(SoapSerializationEnvelope envelope) {
    envelope.addMapping("http://schemas.datacontract.org/2004/07/WcfService1", "GenericType", GenericType.class, this);
}

@Override
public void writeInstance(XmlSerializer writer, Object obj)
        throws IOException {
    GenericType sp =  (GenericType) obj;

    writer.startTag("http://schemas.datacontract.org/2004/07/WcfService1", "mydata");       
    for(String str : sp.mydata){
        writer.startTag("http://schemas.datacontract.org/2004/07/WcfService1", "string");
        writer.text(str);
        writer.endTag("http://schemas.datacontract.org/2004/07/WcfService1", "string");

    }       
    writer.endTag("http://schemas.datacontract.org/2004/07/WcfService1", "mydata"); 

    }}

With below wcf service:

[ServiceContract]
[ServiceKnownType(typeof(WcfService1.GenericType<string>))]
public interface IService1
{

    [OperationContract]
    [ServiceKnownType(typeof(WcfService1.GenericType<string>))]
    string GetDataList(GenericType<string> objs);
} 

 [DataContract(Name = "GenericType")]
public class GenericType<T>
{
    List<T> data;

    [DataMember]
    public List<T> mydata
    {
        get { return data; }
        set { data = value; }
    }
}

Wcf service return a soap fault error like:
Internal service error..

Then I tried in another way:

public class Members extends Vector<String> implements KvmSerializable {

private static final long serialVersionUID = -1166006770093411055L;

@Override
public Object getProperty(int index) {
    return this.get(index);
}

@Override
public int getPropertyCount() {
    return this.size();
}

@Override
public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo param) {
    param.name = "String";
    param.type = PropertyInfo.STRING_CLASS;
}

@Override
public void setProperty(int arg0, Object obj) {
    this.add(obj.toString());
}

}

With below wcf service:

[ServiceContract]

public interface IService1
{

[OperationContract]

string GetDataList(List<string> objs);

}

I got soap fault error which return from wcf service:

Deserialization fail...

Every time I got an error from wcf service .. I think my wcf service got something wrong.
If somebody know the answer .. please kindly answer my question.

Thanks awfully…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:16:46+00:00Added an answer on June 12, 2026 at 9:16 am

    Finally I got the answer…

    I decided used MarshalArray class, not Members(KvmSerializable).

    While using MarshalArray,
    the problem is in MarshalArray class in android..

    here is the old code that occur error:

     for(String str : sp.mydata){
        writer.startTag("http://schemas.datacontract.org/2004/07/WcfService1", "string");
        writer.text(str);
        writer.endTag("http://schemas.datacontract.org/2004/07/WcfService1", "string");
    
    }       
    

    I changed it to like below:

    for(String str:gt.mydata){
            writer.startTag("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string");
            writer.text(str);
            writer.endTag("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string");               
        }
    

    Then it works successfully…

    Thanks for your help, stepoverflow. I had to find out the answer myself…. !!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of strings that I need to pass to a process
I have a list of integers or of strings and need to pass it
i need to pass a long list of Ids from one page to another,
I need to pass 4 arguments (3 strings and one comma separated list) from
I want to pass a custom made vector object containing data from background service
I have following java object Obj: ---- String id; List<A>; A: -- String A_ID;
I have a servlet method where i need to pass a json object. This
I have a List object. How can I pass these list values to separate
I have a rather silly question, I need to pass a parameter from one
I need to pass a list of strings as parameter to a console application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.