Android :: Passing Parameters Using KSoap2 To Net Web Service / Null Values

Dec 9, 2009

I'm having a problem in calling .net c# web services from android using ksoap2. The call is executed just fine without parameters, but when I pass parameters of any type, the web service just receives a null value. I tried everything possible but no luck so far. I hope someone can help, The client side code is:

public static boolean temp(){try {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME_TEMP);
PopertyInfo p = new PropertyInfo();
p.type = PropertyInfo.INTEGER_CLASS;
p.setName("num");
p.setValue(5);
p.setNamespace(NAMESPACE);
request.addProperty(p);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope (SoapEnvelope.VER11 );
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.ENC;
envelope.setOutputSoapObject(request);
AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport (URL);
androidHttpTransport.setXmlVersionTag("<?xml version= "1.0" encoding="UTF-8"?>")
androidHttpTransport.call(SOAP_ACTION_TEMP, envelope); ....

Android :: Passing Parameters Using KSoap2 to Net Web Service / Null Values


Android :: Passing Parameters Using KSoap2 To Net Web Service/Null Values

Jul 21, 2010

I am new to android applications, I am using Ksoap2 to access .Net webservice and The call is executed just fine without parameters. But with parameters I am getting Empty. I followed all the steps provided in sites. I tried everything possible but no luck so far.

private static final String SOAP_ACTION = "http://www.agilelearning.com/GetProvincelist1";
private static final String METHOD_NAME = "GetProvincelist1 ";
private static final String NAMESPACE = "http://www.agilelearning.com" ;
private static final String URL = "http://192.168.1.24/Service.asmx";

//Method executed when Province is selected
private OnItemSelectedListener selectListener = new OnItemSelectedListener(){
public void onItemSelected(AdapterView parent, View v, int position, long id){
try{
ArrayList districts=new ArrayList();
int Provinceid=position+1;//parent.getItemAtPosition(position).toString();
SoapObject request1 = new SoapObject(NAMESPACE, METHOD_NAME1);
request1.addProperty("Provincename","East Province");
SoapSerializationEnvelope envelope1 = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope1.dotNet = true;
envelope1.setOutputSoapObject(request1);
HttpTransportSE at = new HttpTransportSE(URL);
at.debug = true;
at.setXmlVersionTag("");
at.call(SOAP_ACTION1, envelope1);
SoapObject rs = (SoapObject)envelope1.getResponse();
int count=rs.getPropertyCount();
for(int i=0;i aa;
aa = new ArrayAdapter(home1.this, android.R.layout.simple_spinner_item, districts); aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sd.setAdapter(aa);
}catch(Exception ex){
MessageBox("No Districts found");}}

View 2 Replies View Related

Android :: Passing Parameters To .net Web Service

Dec 15, 2009

Im using ksoap2 to call web .net services. The call works just fine except when I pass paramaters. The passed paramaters are always recieved as null values by the web service. I dont know what the problem is, I hope someone can help.

View 7 Replies View Related

Android :: Web Service Recieves Null Parameters From Application Using Ksoap Method

Jun 15, 2010

I've seen topics discussing this but no one has seemed to post a solution. At the moment, I'm testing passing parameters to my .Net web service. When the parameters reach the web service it adds it with an additional string then returns it too my application; but all I'm returning is the string message, not the parameter I passed. Is there something wrong with my web service or my soap method?

Soap:

CODE:..........

Here is my simple .Net web service:

CODE:..............

View 2 Replies View Related

Android :: Passing Parameters To New Activity

Mar 2, 2009

I'm programming an Activity that launches a second one through startActivity just like in the Forwarding example. The main difference is that I'd like to pass some data to the second Activity when starting it, for example an item selected in a list owned by the first Activity. I can't find how to do that. Am I missing something? I guess I do.

View 3 Replies View Related

Android :: Error - Org.ksoap2.Soapfault - Null

Oct 18, 2010

There is no error in Web service But there is an error. Error:org.ksoap2.Soapfault=null

View 2 Replies View Related

Passing Parameters - Launch Jars

Feb 28, 2012

I am working on a project that require porting a program from Linux to Android; I have been successful to make work the required equinox3.6(modified) on Android and to make call the osgi by the application itself, BUT through the adb shell, running a script that launches the files in the .jar. At this point I should create an activity.apk that includes everything and makes it work the same way.

More in details, until now I have uploaded some archives.jar (containing the classes.dex) in the emulator: two jars for the program itself, a jar for equinox, other jars for support.Then there is the script.sh that launches the main.class of my program passing it some parameters necessary to the program and to equinox to start; the main.class launches the equinox framework and then the program can load bundles and do its job.To make it clear here is the starting script:

#/bin/sh
/system/bin/dalvikvm -Xbootclasspath:/system/framework/core.jar -Xverify:none -Dosgi.debug=file:.options -Dosgi.framework=file: org.eclipse.osgi_3.6.0.v20100517.jar -Dosgi.install.area=file:/bundles/ -Dosgi.java.profile=file: dalvik_Core_Library-0.9.profile -Dosgi.parentClassloader=ext -Dnetserv.container.ctrlport=7001 -Dnetserv.container.serveripv4=127.0.0.1 -Djava.security.policy=all.policy -Dnetserv.security.bindableports=1024 -Dnetserv.container.user=jae -classpath org.eclipse.osgi_3.6.0.v20100517.jar:netservlaunch .jar NetServ.launch.Main -console -clean

I have been trying to create an activity that behaves similar to my script, but without any success.I added all my archives.jar to my project the way of "Add External jars" and tryed to launch the main.class as it was another activity, using Intent, and passed the parameters using putExtra(), but on the other side, in the jar of the program, I cannot retrieve and use the needed parameters, because it is not an apk..

View 1 Replies View Related

Android :: Display A Dialog In Non-Activity - Simple Java - Class By Passing Parameters

Jun 23, 2010

I am trying to display a dialog box in a simple Java class that is called from my main Activity but not successful. Please help me to figure it out.

I am passing the required values as parametrs.

I have two class: class MainActivity extends Activity :: Main *starting point *of Application class ShowMyDialog :: a simple java program In which I *generate an URl* and *display a dialog with WebView*.

I am passing the Acitivity from my MainActivity to this class as a parameter in function.

But I am *unable to call* the onCreateDialog method that I have *defined in the simple java class.

However, If I define the *onCreateDialog method in MainActivity, I am able to display it successfully.

What Should I pass as Parameter to the non Activity class from MainActivity class so that I am able to display the dialog as defined by showdialog method in JAVA class ???*

My steps of source code is as follow:

code:.........................

View 3 Replies View Related

Android :: Passing Values With Intents

Nov 17, 2010

I have searched and searched and I just can't get this code to work. I have a main.xml layout and a setting.xml. I have some values I would like the Settings.class to change in my main apps class.Three string to be exact. I have tried this simple test code in my main app class.

settings.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), Settings.class);
startActivityForResult(intent, 0);}});

//Then a function
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent){
super.onActivityResult(requestCode, resultCode, intent);
Bundle extras = intent.getExtras();
String value = extras.getString("myKey");
if(value!=null){
Log.d("hmmm",value);}}}

In my settings.class I have the following
returnHome.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.putExtra("myKey", "YEAH");
setResult(RESULT_OK, intent);
finish();}});

Back in main app class it is not getting logged. Like I said I have three string in the main class that I want settings class to change and send back.

View 2 Replies View Related

Android :: Passing Values From One Activity To Another

Feb 11, 2010

I have an app which makes use of several layout-views. Every layout - view also got a class for it, which extend the Activity class. One class for example retrieves some database values whilst offering a search form to the user. Afterwards the user can select one of those values and he gets presented with another screen which gives similar options as the one selected. Anyways, I'd like for the first Activity to be able to send an array with data (Strings for example) to the second one. Right now I show an activity by using:

Intent i = new Intent(this, activitysName.class); startActivity(i);

I have no idea whilst using this construction how I can "initialize" the new object with the String array I want to pass to it. So how should this be achieved ? Should I be using something else instead of an Intent-Activity combination ?

View 5 Replies View Related

Android :: Passing Values From Activity To Another File

Nov 20, 2010

I have a need where I must pass some values from an Activity to another file which extends View class (instead of Activity). Its not the normal passing of values from one activity to another. In my Activity, I will pass some co-ordinate values to the class that extends View. In this class, I will draw an image and place points over the image on the required co-ordinates. But, the problem is, I cant send values using Intent.

View 11 Replies View Related

Android :: How Can I Call A Web Service Without Using KSOAP2?

Aug 12, 2009

I can call a webservice with KSOAP2 from android,now i want to know is it possible to call it without using KSOAP.

View 1 Replies View Related

Android :: Error Connecting To Web Service Using Ksoap2

Oct 27, 2009

Please help... I am having trouble getting past the line when using ksoap2 to connect to .net web services Code...

View 2 Replies View Related

Android :: Call To .NET Web Service Timed Out - Dev Using KSOAP2

Sep 4, 2010

I'm getting a Java Socket Exception "Operation timed out" when trying to call a .NET web service method. I've followed the many examples out there on the web to get my android to call a .net web service.

I'm running the web service using VS2010 in debug mode. The web method I'm calling is very simple -> "string GetVersion()"

I've read some posts that eclipse needs to be configured to access the internet by modifying the Proxy preferences "Preferences -> General -> Network Connections" from the Window menu item. I haven't been able to figure out exactly what I need to configure in the Proxy to get things to work if that is the problem.

I've also tried to access the .net web service root page (service.asmx) from my android with no success. I can access the asmx page with no problems using IE on the local machine. I've turned off the firewall and that didn't solve anything either. This is the first time I've tried to access a web service from a remote computer when it was running using VS2010 in debug mode.

I don't know if I have a configuration issue on the eclipse side or on the VS2010 side.

I'm also running Windows 7 Home Premium.

Below is a code snippet...

CODE:.................

View 4 Replies View Related

Android : Way To Call A WCF Service Using Ksoap2 On Droid?

Apr 7, 2010

Here is my code...

View 4 Replies View Related

Android :: Access Web Service / Can't Use Ksoap2 , Should I Create Soap Library?

Oct 23, 2010

I'm having a problem while accessing a web service through ksoap2 library, is there any other way to access the web service. I can't use ksoap2 library for my project. Should I create a soap library or any other way.

View 3 Replies View Related

Android :: Passing Parameter Value To Web Service

Nov 4, 2010

How to pass parameter value to web service in Android?

View 2 Replies View Related

Android :: Passing A Service Handler

Aug 9, 2009

I've read the android AIDL documentation and have a general idea of how RPC works between an Activity and a Service. However, for my application it seems overboard to implement such features: basically, I want to pass a Service a nice handler so its thread can pass data to my Activity. Currently I'm getting around this by using a static public member (a hack) but I would prefer just passing a Handler object in the Service's starting Intent. However since a Handler isn't serialize-able , I haven't found a way to pass it to the service without a simple static member hack. Any insight? Or, am I just going to have to suck it up and do a formal RPC to the service?

View 1 Replies View Related

Android :: Passing AppWidgetId To A Service

Sep 2, 2010

I got a Widget on my HomeScreen on which i add an click to a Button. I pass the widget id from the Widget to a Service, but when im reading the WidgetId at the Service it's always 3.

View 1 Replies View Related

Android :: Passing Arguments To JSON C# .net Web Service

Sep 27, 2010

i searched the net to find something about how to pass arguments to JSON c# .net web service, but i didn't find anything useful for me. I have to pass arguments like GUID or at least Username and Password. Is params.put("var", ""); the right thing? How do i pass multiple parameters like this, let's say username and password?

View 24 Replies View Related

Android :: Passing Data Between Service And Activity

Sep 19, 2010

So I'm getting really confused on how to do this whole thing and I was hoping someone could break it down for me a little bit.I have a service that should always be running, and at certain times it needs to alert the user that a task is to be completed(probably through a notification bar icon). When the user accepts the task, the service needs to look into the local database, construct some non primitive objects, and give them to the activity that it just started.I have looked all over and gotten very confused as to a proper approach so I have a few questions to help me wrap my head around it.If an activity creates a local SQLite database can the service and activities of that application access that same database later?Does the service and activity need to be in the same or separate packages? I would think no but for some reason I remember seeing something about this elsewhere.

How would I do the data transmission from the service to the activity? I was thinking a content provider but it seems like there should be an easier way for the service to just hand off the data. Similar to an Intent but for non primitives.

View 2 Replies View Related

Android :: Passing Intents From Service To New Launch From Main Activity

Mar 30, 2009

How do you pass an intent from a service to a new activity launched from a main activity? There's a passextra( intent src ); but I don't think thats what I am looking for?

activity main > start service( intent wuteverserviceintent );
activity main > start activity( intent newactivityintent );

View 2 Replies View Related

Android : Null Pointer Exception When Trying To Connect To Web Service

Jun 2, 2010

My web service should be returning an integer, but every time i run the code i get the NullPointerException error. i think my url string may be the problem, but i've tried using my ip with no luck. Code...

View 1 Replies View Related

Android :: Access Radio Button Values From A Service?

Mar 19, 2009

In my Android app, a Service runs in the background and logs GPS readings to a database. The user sees an Activity that presents them with radio buttons. I'd like to also log their currently selected radio button to the database. How can I access the radio button object from the Service?

View 1 Replies View Related

Give Values To A Web Service

Nov 30, 2011

I'm building an app which connects to various web services via ksoap2. Most of the services provide some sort of response in the form of a string which I use in the app, however one of the services doesn't actually provide a response to be used it simply takes the inputted vales and the .net service updates the relevant DB tables.Would the set up and call to the service be the same as to the other services that I get information back from? My code is as follows;

SoapObject Request =
new SoapObject(NAMESPACE, METHOD_NAME);
Request.addProperty(
"Sub_Seq",Sub_Seq);
Request.addProperty(
"Start_Time",startDate.toString());
[code]...

View 1 Replies View Related

Android :: Service Change Values Of Variables And UI Textfields Of Activities

Oct 20, 2010

I have an application that get/send data from/to a remote DB on internet.

I need to get my application working in background mode, then i supose that i have to put all the send/get remote data in a service..... but.... How can this service change values of variables and UI textfields of my activities? i can't find any information about this, all the tutorials i am finding are of simple services that doesn't do something like that.

View 7 Replies View Related

Android : Need To Write A Background Service To Get Latitude / Longitude Values

Sep 4, 2010

I need to write a background service to get latitude and longitude values. I have an android application in which it has to find where the user is currently.So i seemed of getting the values of latitude and longitude values. Is there any way programatically to get the values from the system services or even program giving the values of lat,long is better for me. Any suggestions on this will be appreciable. I am in real help,so i am in fond of your suggestions soon.

View 2 Replies View Related

General :: How To Edit Default Values Of Memory Min-free Values Of Rom Reside

Apr 9, 2014

I want to ask where does the defaults values of memory min-free values of a Rom reside? I mean what file I would have to edit to edit those values?

View 1 Replies View Related

Android :: Using Ksoap2 Via Https?

Feb 11, 2010

Has any one been able to connect to a soap server using ksoap2 android via https?

I keep getting the error that "Hostname <###>was not verified"

CODE:..........

Apparently looking back at other ksoap which isn't for android your ment to us a different call to connect via https, but i can't find a way to do it in the android version.

View 1 Replies View Related

Android :: How To Call A .NET Webservice Using KSOAP2

Jun 27, 2009

I have a problem while calling the webservice,i have a .NET web service in the server and i am using KSOAP2(ksoap2-j2se-full-2.1.2) in android.While running the program i got an runtime Exception
like "org.ksoap2.serialization.SoapPrimitive".

I dont know what to do.Here is my code.

CODE:................

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved