[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2011-10-06
4
Medium Priority
?
3,630 Views
Last Modified: 2012-05-12
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;
0
Comment
Question by:Gabriel_Espinoza
  • 2
4 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 400 total points
ID: 36925886
Try


param1.name = "CODIGO_PROYECTO";

Open in new window

0
 
LVL 47

Accepted Solution

by:
for_yan earned 1600 total points
ID: 36926074


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
 
LVL 86

Expert Comment

by:CEHJ
ID: 36926100
>>I guess this si how you can do it:

How does that differ from what i already stated?
0
 

Author Closing Comment

by:Gabriel_Espinoza
ID: 36926510
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month19 days, 17 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question