ksoap2

How can I cast a String to a SoapObject in ksoap2?

元气小坏坏 提交于 2019-12-01 01:56:16
In my Android app I use ksoap2 for communication with a server. I download a certain complex sports information structure via soap request and parse it later in my program. What I want to do is somehow "save" this complex structure so that I can parse it again later when all the information in that structure is final and doesn't change anymore so that I can display it without calling the web service again. I got that far that I can turn the whole structure into a string with the toString() method from the SoapObject class so that I can save it in the app's Shared preferences. BUT: To parse the

AsyncTask HttpPost execute fails on 3G, but works on Wifi

帅比萌擦擦* 提交于 2019-11-30 17:36:38
I need to do a Http post of some strings to a web service. I am using KSoap. @Override protected JSONObject doInBackground(JSONObject... params) { String result; HttpParams httpParameters = new BasicHttpParams(); // Set the timeout in milliseconds until a connection is established. // The default value is zero, that means the timeout is not used. int timeoutConnection = 30000; HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection); // Set the default socket timeout (SO_TIMEOUT) // in milliseconds which is the timeout for waiting for data. int timeoutSocket = 50000;

using addMapping without the “i:type=” attribute in ksoap2 for android

给你一囗甜甜゛ 提交于 2019-11-30 14:41:46
I am using the envelope.addMapping function in ksoap2 and I need to make it generate items with no i:type attribute. This is the soap request my code generates <v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://www.w3.org/2003/05/soap-encoding" xmlns:v="http://www.w3.org/2003/05/soap-envelope"> <v:Header> <ApiKey xmlns="urn:example:data">APIKey</ApiKey> </v:Header> <v:Body> <CreateScan xmlns="urn:example:services" id="o0" c:root="1"> <scan i:type="n3:" xmlns:n3=""> <n4:BaseUrl i:type="d:string" xmlns:n5="urn:example:data"

How to pass an enum value to wcf webservice

南笙酒味 提交于 2019-11-30 14:04:00
can ksoap2 pass an enum to webservice? there is a wcf webservice: [OperationContract] string TestEnum(CodeType code); CodeType is dotnet enum: public enum CodeType { [EnumMember] ALL, [EnumMember] VehicleColor } How can i call this wcf webservice at android client? i create a enum CodeType and implements KvmSerializable. In method getPropertyInfo, what is the value of info.name(info.type)? public enum CodeType implements KvmSerializable, BaseInterface { ALL, VehicleColor; //....... @Override public void getPropertyInfo(int index, Hashtable properties, PropertyInfo info) { //info.namespace =

Blackberry kSoap2 & Soap Header

放肆的年华 提交于 2019-11-30 10:15:15
Trying to specify a custom soap header. Not sure how the SoapEnvelope.headerOut propery is to be populated. My code so far? String soapAction = serviceNamespace + "/SearchCustomer"; SoapObject rpc = new SoapObject(serviceNamespace, "SearchCustomers"); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.bodyOut = rpc; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC; rpc.addProperty("searchBy", searchBy); rpc.addProperty("groupBy", Integer.toString(groupBy)); Here is the header WSDL extract... <soap:Header> <MISHeader

Ksoap2 Android adding Attributes to a simple property

南笙酒味 提交于 2019-11-30 09:36:34
问题 I am trying to create a new property inside a SoapObject that will contain simple string properties with attributes to them like this: <Power Unit="kw">1500</Power> here is the code i am using for my samples below. final SoapObject powerObject= new SoapObject(namespace, "Power"); powerObject.addAttribute("Unit", getPowerUnit()); PropertyInfo powerObjectProperty = new PropertyInfo(); powerObjectProperty .setName(""); powerObjectProperty .type = String.class; powerObjectProperty .setValue

Cannot serialize issue in KSOAP in android

可紊 提交于 2019-11-30 06:05:28
问题 I am using SOAP services in my application,in that when i am calling SOAP services it throwing some cannot serialization problem: SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapObject authentication = new SoapObject(NAMESPACE,"authentication"); PropertyInfo usrid =new PropertyInfo(); usrid.setName("LoginID"); usrid.setValue("sting"); usrid.setType(String.class); authentication.addProperty(usrid); PropertyInfo pass =new PropertyInfo(); pass.setName("Password"); pass.setValue(

Serialize an array of ints to send using KSOAP2

只愿长相守 提交于 2019-11-30 05:34:31
问题 I'm having a problem trying to send an array of ints to a .NET web service which expects an array in one of the arguments. That's at least what I understand from the API description on the web service which says this: <dataIndexIDs> <int>int</int> <int>int</int> </dataIndexIDs> So when I send a single int like below I do not get any errors and I think it works fine. request.addProperty("dataIndexIDs", 63); But when I try to send an array of ints: request.addProperty("dataIndexIDs", new int[]

Adding kSOAP dependency to Gradle project

↘锁芯ラ 提交于 2019-11-30 00:43:10
I'm trying to make kSOAP working in my Android project with Gradle. This is my project's build.gradle file: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories { mavenCentral() maven { url 'http://ksoap2-android.googlecode.com/svn/m2-repo' } } android { compileSdkVersion 18 buildToolsVersion "18.0.1" defaultConfig { minSdkVersion 7 targetSdkVersion 18 } } dependencies { compile 'com.android.support:support-v4:18.0.0' compile 'ch.acra:acra:4.5.0' compile 'com.google.guava:guava:12.0' compile 'com

Pass Array using Web services in Ksoap2

给你一囗甜甜゛ 提交于 2019-11-29 22:47:21
问题 I have to call a web service in which web service is called by kSoap2 method, now in this one node is a Array so how i can pass it. POST /opera/OperaWS.asmx HTTP/1.1 Host: 182.71.19.26 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/SendGroupMessageNotification" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap