The method setName(String) is undefined for the type PropertyInfo

I have an android app that is using ksoap to connect to a .NET WebService

everything works smoothly but when I try to create parameters it throws several errors with the following code
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME1);

PropertyInfo param1 = new PropertyInfo();
param1.setName("CODIGO_PROYECTO");
param1.setValue(CODIGO_PROYECTO); 
request.addProperty(param1);

Open in new window


it throws the following messages of error:

The method setName(String) is undefined for the type PropertyInfo
The method setValue(String) is undefined for the type PropertyInfo
The method addProperty(PropertyInfo, Object) in the type SoapObject is not applicable for the arguments (PropertyInfo)

I have the following includes:

import org.ksoap2.*;
import org.ksoap2.serialization.*;
import org.ksoap2.transport.*;
import org.w3c.dom.Text;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
Gabriel_EspinozaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
Try


param1.name = "CODIGO_PROYECTO";

Open in new window

0
for_yanCommented:


I guess this si how you can do it:
see
http://stackoverflow.com/questions/6896670/ksoap-set-property-type

SoapObject _client = new SoapObject("...)
        PropertyInfo UIDInfo = new PropertyInfo ();

        UIDInfo.name = ("CODIGO_PROYECTO");

        UIDInfo.type = PropertyInfo.STRING_CLASS;
        _client.addProperty(UIDInfo,CODIGO_PROYECTO)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CEHJCommented:
>>I guess this si how you can do it:

How does that differ from what i already stated?
0
Gabriel_EspinozaAuthor Commented:
Thank you both :)

I granted more points to for_yan because he gave me more detailed information about not only the name but the type and value.

Thanks again :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Android

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.