ksoap2

Adding kSOAP dependency to Gradle project

喜欢而已 提交于 2019-12-03 18:40:27
问题 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

When to use Soapobject and SoapPrimitive

丶灬走出姿态 提交于 2019-12-03 17:45:17
问题 I have been working with ksoap2 lately. I am still confused whether what is the EXACT difference between SoapObject and SoapPrimitive . And when to use them. I guess its something related to string and arrays. Is it true? I found some links but got confused. Can anyone tell me the difference and when to use which one in the simplest form of English? Thanks :) 回答1: SoapObject is used when we need to get the Response for a Class type, like Customer, Product, etc. (From the SoapObject you need

ksoap2 casting getResponse()

风流意气都作罢 提交于 2019-12-03 15:45:54
Calling a .net SOAP1.1 web service from android using ksoap2 lib I met a problem of casting response to a custom object. For instance the code below is called correct after httpTransport.call(soapAction, soapEnvelope); and have data inside. But I cant't cast it to specific object neither to SoapObject or Vector as I saw in several examples, I get CastException or simple nothing. If somebody knows how to deal with it, please help. public StatusSetting[] GetAllStatuses(String installation){ StatusSetting[] statuses = null; String methodName = "GetAllStatuses"; String soapAction = NAMESPACE + "/"

Get List from .net Web Service on Android

百般思念 提交于 2019-12-03 14:15:28
问题 I have .net Web Service and I want to use it on android. This web service's methods return List(Of String) and I didn't get response on android. What can I do ? Here is the code.. I'm working on it for 3 days and I didn't find any solution yet. In short, I need some list from .net web service and add this list's items to spinner. Please help me. public class MainActivity extends Activity { private Spinner myspinner; private static final String METHOD_NAME = "Sektorler"; private static final

Where to see the generated XML (KSOAP2)

≯℡__Kan透↙ 提交于 2019-12-03 12:32:21
问题 I'm having a hard time trying to get to see the generated XML with my SoapRequest. This is my code: SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); PropertyInfo propInfo=new PropertyInfo(); propInfo.setName("arg0"); propInfo.setType(PropertyInfo.STRING_CLASS); propInfo.setValue(sessionId); request.addProperty(propInfo); // Sending the array representing our board: Fields fieldsVector = new

Send an image from Android to an ASP.NET Web Service

為{幸葍}努か 提交于 2019-12-03 10:08:42
问题 I'm developing an Android App that should send an image to my ASP.NET Web Service where the image will be saved as a file. I've seen a couple of ways to do this and I went for this one: convert the image to a byte array -> convert the byte array to a string -> send the string to the web service using KSOAP2 -> receive the String at the Web Service -> convert it to a byte array -> Save it as an image: IVtest = (ImageView)findViewById(R.id.carticon); BitmapDrawable drawable = (BitmapDrawable)

How to consume WCF .SVC in Android

爱⌒轻易说出口 提交于 2019-12-03 08:52:19
i red a lot of documents about, but i can't consume this .svc file. I've no problem with .ASMX file. Only SVC i'm not able to consume. It's very very very stressfull....! I can't modify WCF part. I post WSDL file and my try to consume it: WSDL <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org

Transferring byte array from soap service to android

情到浓时终转凉″ 提交于 2019-12-03 08:43:23
I have an android client that makes a request to a soap service. The soap service reads an image into a series of bytes and returns a byte array (quite a large one). Would this be seen as a primitive transfer type? The reason I ask is because I have the service code that reads an image and prints the first 5 bytes. Then it returns the byte array. @Override public byte[] getImage() { byte[] imageBytes = null; try { File imageFile = new File("C:\\images\\car.jpg"); BufferedImage img = ImageIO.read(imageFile); ByteArrayOutputStream baos = new ByteArrayOutputStream(1000); ImageIO.write(img, "jpg",

Where to see the generated XML (KSOAP2)

自作多情 提交于 2019-12-03 02:58:36
I'm having a hard time trying to get to see the generated XML with my SoapRequest. This is my code: SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); PropertyInfo propInfo=new PropertyInfo(); propInfo.setName("arg0"); propInfo.setType(PropertyInfo.STRING_CLASS); propInfo.setValue(sessionId); request.addProperty(propInfo); // Sending the array representing our board: Fields fieldsVector = new Fields(); for (int i=0; i<65; i++) { fieldsVector.add(move[i].toString()); } PropertyInfo

Generating Java from WSDL for use on Android with ksoap2-android SOAP client?

做~自己de王妃 提交于 2019-12-03 02:54:23
问题 I have to access a existing SOAP webservice from an Android application. I have been provided some WSDL files describing the webservice. Reading some other answers here on SO, it seems ksoap2-android is the way to go, with respect to which SOAP client to use. The next issue is then how to generate the Java classes needed from the WSDL files, and this is where I am coming up short. As far as I can see there are the following options: AXIS2 code generator WSDL2ksoap JAX-WS wsimport tool I