emreaatalay22 / ksoap2-android Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/ksoap2-android
Automatically exported from code.google.com/p/ksoap2-android
What steps will reproduce the problem?
1. Call a WS that returns a single-element string response
2. Try to get the response with getResponse()
What is the expected output? What do you see instead?
Object expected.
What version of the product are you using? On what operating system?
I'm using version 2.3 on debian
Please provide any additional information below.
I got the problem on the code, the solution is as easy as to do a
instanceof check and don't try to do the KvmSerializable cast. I've found
this on my first steps with WS creation and connection. Hope it helps ;)
Original issue reported on code.google.com by [email protected]
on 16 Nov 2009 at 6:56
In the API I can see the methods, but on this XML it does not work:
E.g. Prescription="false" and ProfessionallySourced="false" of the return
element are not recognized.
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:getMedicationResponse xmlns:ns2="http://foo.bar.com/"
xmlns:ns3="http://www.dossia.org/v2.0/xml/phr"
xmlns:ns4="http://www.dossia.org/v2.0/api"
xmlns:ns5="http://www.w3.org/2005/08/addressing">
<return Prescription="false" ProfessionallySourced="false">
<ns3:Origin Classification="PHR">
<ns3:Organization>
<ns3:OrganizationName>Dossia</ns3:OrganizationName>
</ns3:Organization>
</ns3:Origin>
<ns3:Date Type="Actual">
<ns3:StartDate>2009-10-08</ns3:StartDate>
<ns3:EndDate>2009-10-08</ns3:EndDate>
</ns3:Date>
<ns3:Comments/>
<ns3:Drug>
<ns3:Code MajorVersion="" MinorVersion="" System="NDC">
<ns3:Code>672960489</ns3:Code>
<ns3:LongDescription>TYLENOL 3 (300 MG
ACETAMINOPHEN, 30 MG CODEINE PHOSPHATE) (by REDPHARM
DRUG)</ns3:LongDescription>
</ns3:Code>
<ns3:Route>Oral</ns3:Route>
</ns3:Drug>
</return>
</ns2:getMedicationResponse>
</S:Body>
</S:Envelope>
Original issue reported on code.google.com by [email protected]
on 2 Mar 2010 at 11:09
What steps will reproduce the problem?
1. Launing my app
2. Reaching the line of Http call
What is the expected output? What do you see instead?
No idea what would be the proper response but the an error is thrown which
first lines look like this:
Couldn't create SOAP message. Expecting Envelope in namespace
http://schemas.xmlsoap.org/soap/envelope/, but got
http://www.w3.org/2001/12/soap-envelope
What version of the product are you using? On what operating system?
I switching between version 11 and 12 for testing but usually I go with
version 12. I am programming for the Android OS Version 2.1.
Please provide any additional information below.
I already got a threat going with the sourcecode of my app with I problem I
guess I have solved by now =), here is the link:
http://code.google.com/p/ksoap2-android/issues/detail?id=20
Thanks a lot you folks!
Original issue reported on code.google.com by [email protected]
on 24 May 2010 at 9:49
The dependency kobjects-j2me uses some properties and feature which are
not available in java.lang.System under j2me. To stay compatible I have
created a fixed version without these classes (Actually only the ISODate
and maybe the Base64 is interesting I guess for kSOAP2):
http://globalplatform.sourceforge.net/repo/m2-repository/net/sourceforge/
kobjects/kobjects-j2me/0.0-SNAPSHOT-20040926/
Error preverifying class org.kobjects.xmlrpc.Driver
VERIFIER ERROR org/kobjects/xmlrpc/Driver.main([Ljava/lang/String;)V:
Cannot find class java/io/FileReader
I have excluded the dependency and used my fixed version. The classifier
"fixed" is used.
Can you adjust your version, so that this hack does not have to be done?
Original issue reported on code.google.com by [email protected]
on 28 Jan 2010 at 1:54
Hi everyone, I am trying to access a Webservice with kSOAP2 on an Android
Phone. I think the connection is being established, but the server won't
answer my request since I'm not providing a SOAP Action Header which seems
to be required in SOAP Version 1.1(please correct me if I'm wrong here)
which I have to use since the server does not support Version 1.2 . The
concrete Faultcode which is returning in the request looks like this:
faultactor null
faultcode "S:Server" (id=830064966432)
faultstring "String index out of range: -11" (id=830064966736)
The errorcode which is generated on the server (I'm running it on a
localhost) looks like this:
4.05.2010 20:20:29 com.sun.xml.internal.ws.transport.http.HttpAdapter
fixQuotesAroundSoapAction
WARNUNG: Received WS-I BP non-conformant Unquoted SoapAction HTTP header:
http://server.contextlayer.bscwi.de/createContext
24.05.2010 20:20:29
com.sun.xml.internal.ws.server.sei.EndpointMethodHandler invoke
SCHWERWIEGEND: String index out of range: -11
java.lang.StringIndexOutOfBoundsException: String index out of range: -11
at java.lang.String.substring(Unknown Source)
at de.bscwi.contextlayer.xml.XmlValidator.isValid(XmlValidator.java:41)
at de.bscwi.contextlayer.server.ContextWS.createContext(ContextWS.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.xml.internal.ws.api.server.InstanceResolver$1.invoke(Unknown
Source)
at com.sun.xml.internal.ws.server.InvokerTube$2.invoke(Unknown Source)
at
com.sun.xml.internal.ws.server.sei.EndpointMethodHandler.invoke(Unknown Source)
at
com.sun.xml.internal.ws.server.sei.SEIInvokerTube.processRequest(Unknown
Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(Unknown Source)
at
com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(Unknown
Source)
at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(Unknown
Source)
at
com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(Unkno
wn
Source)
at
com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(Unknown
Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.AuthFilter.doFilter(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown
Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The relevant part of the WSDL (at least that's what I'm thinking) looks
like this:
<operation name="createContext">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
In my code I'm adding a Header, but it seems like I'm doing it wrong:
private static final String SOAP_ACTION = "";
//...
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope
(SoapEnvelope.VER11);
soapEnvelope.setOutputSoapObject(Request);
AndroidHttpTransport aht = new AndroidHttpTransport (URL);
//...
aht.call(SOAP_ACTION, soapEnvelope);
SoapPrimitive resultString = (SoapPrimitive)
soapEnvelope.getResponse();
Any advice would be great since I'm running out of ideas.. Thanks folks!
Note: I also posted this at StackOverflow.com
(http://stackoverflow.com/questions/2899392/ksoap2-and-soapaction-on-android)
Original issue reported on code.google.com by [email protected]
on 24 May 2010 at 6:59
What steps will reproduce the problem?
1.try to connect to a https soap sevrer
What is the expected output? What do you see instead?
i was hoping that it would connect but i get "ERROR:java.io.IOException:
Hostname <#######> was not verified
What version of the product are you using?
2.3
is there a different call for connecting to https soap servers?
Original issue reported on code.google.com by [email protected]
on 11 Feb 2010 at 10:00
What steps will reproduce the problem?
1. Apply patch from issue 7 so SOAP faults can be parsed.
2. Make a SOAP call that returns a SOAP fault.
What is the expected output? What do you see instead?
The SOAP "fault string" would be sensible to put here, better than an empty
message.
What version of the product are you using? On what operating system?
"ksoap2-android-assembly-2.3-jar-with-dependencies.jar" Aug 16 + patch from
issue 7, Android 1.6.
Please provide any additional information below.
Patch attached to return faultstring.
Original issue reported on code.google.com by chris.boyle.name
on 23 Oct 2009 at 2:01
Attachments:
It would be great if the project could publish the artifacts to maven central.
You could use the approach documented here
https://docs.sonatype.com/display/NX/OSS+Repository+Hosting
then any users of the project would not have to add the custom repository
and you would not have to maintain it either..
Original issue reported on code.google.com by [email protected]
on 11 Mar 2010 at 11:57
What steps will reproduce the problem?
1. AndroidServiceConnection class uses classes from package
org.apache.commons.httpclient, which is not available in android.jar
2. If you try to use AndroidHttpTransport class to call a web service,
android application closes unexpectedly.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
android-sdk-windows-1.1_r1, and ksoap2-android-2.2-jar-with-
dependencies.jar ( Version 2.2 release of ksoap2-android with all
dependencies included )
On windows XP.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 29 Apr 2009 at 12:07
What steps will reproduce the problem?
1. Add lib folder to project
2. add ksoap2-android-2.2-jar-with-dependencies.jar to folder
3. add library to project
What is the expected output? What do you see instead?
When the library added, eclipse gave errors,like:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added:
Lorg/ksoap2/transport/AndroidHttpTransport;
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.dex.file.DexFile.add(DexFile.java:143)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.command.dexer.Main.processClass(Main.java:299)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.command.dexer.Main.access$100(Main.java:56)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245
)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.command.dexer.Main.processOne(Main.java:245)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
[2009-04-11 11:41:44 - WebService1] at
com.android.dx.command.dexer.Main.run(Main.java:139)
[2009-04-11 11:41:44 - WebService1] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[2009-04-11 11:41:44 - WebService1] at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[2009-04-11 11:41:44 - WebService1] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[2009-04-11 11:41:44 - WebService1] at java.lang.reflect.Method.invoke(Unknown
Source)
[2009-04-11 11:41:44 - WebService1] at
com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
[2009-04-11 11:41:44 - WebService1] at
com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown Source)
[2009-04-11 11:41:44 - WebService1] at
com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:3
09)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
[2009-04-11 11:41:44 - WebService1] at
org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
[2009-04-11 11:41:44 - WebService1] 1 error; aborting
[2009-04-11 11:41:44 - WebService1] Conversion to Dalvik format failed with
error 1
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 11 Apr 2009 at 8:45
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
kSOAP2-android2.2 with dependencies
Windows Vista SP2
Android SDK 1.5 Cupcake
Please provide any additional information below.
It appears that org.ksoap2.transport.AndroidServiceConnection is
referencing a class that doesn't exist...is there a workaround?
Original issue reported on code.google.com by [email protected]
on 11 Jun 2009 at 9:12
What steps will reproduce the problem?
1. Staring the Application, since it's quite small I think that should do
it here.
What is the expected output? What do you see instead?
Well actually I'm not quite sure what should be the output in the end, but
while debugging the app I noticed that it won't execute the line:
aht.call(SOAP_ACTION, soapEnvelope);
and the errorlog says the following:
expected: START_TAG {http://www.w3.org/2001/12/soap-envelope}Envelope
(position:START_TAG <h1>@1:4 in java.io.InputStreamReader@43d1b8f8)
Maybe you folks already know what's the problem is, but just to be sure
I'll provide the code of my app here, thanks a lot:
// Most of the code is taken from this really good video
// http://www.vimeo.com/9633556
package com.Connect;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class connect extends Activity {
/** Called when the activity is first created. */
// tempuri.Org wird aus der WSDL File genommen.
// private static final String SOAP_ACTION =
"http://server.contextlayer.bscwi.de/createContext";
// private static final String SOAP_ACTION = "ClientWS";
private static final String SOAP_ACTION = "";
private static final String METHOD_NAME = "createContext";
private static final String NAME_SPACE =
"http://server.contextlayer.bscwi.de/";
// WICHTIG: nicht wsdl File!!
private static final String URL = "http://10.0.2.2:10360/ContextWS";
//private static final String URL = "http://10.0.2.2:10360/ContextWSService";
TextView tv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tv = (TextView) findViewById (R.id.TextView01);
SoapObject Request = new SoapObject (NAME_SPACE, METHOD_NAME);
Request.addProperty("arg0", "testSituation");
SoapSerializationEnvelope soapEnvelope = new
SoapSerializationEnvelope (SoapEnvelope.VER12);
// soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(Request);
AndroidHttpTransport aht = new AndroidHttpTransport (URL);
try{
aht.call(SOAP_ACTION, soapEnvelope);
Object bla =
soapEnvelope.getResponse();
System.out.println(bla.toString());
SoapPrimitive resultBoolean = (SoapPrimitive)
soapEnvelope.getResponse();
// Eigentlich nicht sonderlich viel Anhnung was er bei einem
Boolean ausgibt, naja mal sehen.
tv.setText("Result: "+ (bla));}
catch(Exception e){
e.printStackTrace();
System.out.println(e);
}
}
}
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 19 May 2010 at 6:15
Problem: ksoap2 does not serialize Object[]
What steps will reproduce the problem?
1.create a web service with a methode with a parameter which is an array of
objects
2.create an object (which extends SoapObject) client side, with that array
of objects into its properties.
3. perform a soap call passing that object
What is the expected output? What do you see instead?
I expect my array of objects to be serialized into the soapEnvelope.
Instead i see that serialization throws an Exception.
What version of the product are you using? On what operating system?
i am using ksoap2-android-assembly-2.4-jar-with-dependencies.jar under
Linux/Ubuntu, IDE Eclipse
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 17 May 2010 at 5:12
I get a Verifier error when preverifying the class for J2ME:
Error preverifying class org.ksoap2.serialization.SoapSerializationEnvelope
VERIFIER ERROR org/ksoap2/serialization/
SoapSerializationEnvelope.readInstance(Lorg/xmlpull/v1/XmlPullParser;Ljava/
lang/String;Ljava/lang/String;Lorg/ksoap2/serialization/
PropertyInfo;)Ljava/lang/Object;:
Illegal type in constant pool
Error preverifying class org.kobjects.xmlrpc.Driver
VERIFIER ERROR org/kobjects/xmlrpc/Driver.main([Ljava/lang/String;)V:
Cannot find class java/io/FileReader
The classes in the repo should be compiled with the target 1.1/source 1.3
switch.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.3</source>
<target>1.1</target>
</configuration>
</plugin>
I guess for the base, the midp and the extras modules this switch is
enough.
Original issue reported on code.google.com by [email protected]
on 28 Jan 2010 at 1:57
What steps will reproduce the problem?
1. Hello...I found the problem the "old" org.apache.commons.httpclient.xxx
library..I'd like to recompile this project, but where are the sources?
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by lunard
on 28 Jul 2009 at 9:54
What steps will reproduce the problem?
1. Add ksoap2-android-2.2-jar-with-dependencies.jar to the android project.
2. It gives error that AndroidHttpTransport class is already added.
3. Open jar file with winrar and check the org.ksoap2.transport package,
there are 2 duplicate class files are there.
What is the expected output? What do you see instead?
...possibly there is some error while building the jar.
What version of the product are you using? On what operating system?
...Version 2.2 release of ksoap2-android with all dependencies included
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 22 Apr 2009 at 1:47
Please remove the SVN checkout instructions from the page and give git
instructions instead.
Original issue reported on code.google.com by [email protected]
on 27 Jan 2010 at 9:35
What steps will reproduce the problem?
1. Just use the svn commands in the source tab to check out the code as
read-only
It is very common for open source projects to provide a jar that contains the
source code (like "xxx-sources.jar" or "xxx.src.jar"). This is especially
useful when you need to do debugging in Eclipse, as it needs the source code
attached.
However, you don't release a full src jar for the code in your jar, and also
the svn repository that is documented in the "Source" tab is empty. Can you
please provide us the source code? I believe it is in git, but it is definitely
worth providing the source jar for many developers. I don't really need the
code for committing changes, I just need to use it for debugging, and it would
be great if you just provide the jar and release me from the burden of doing
this every time I update my ksoap2 version.
Original issue reported on code.google.com by [email protected]
on 17 Jun 2010 at 12:16
we should use cookie for save session
we must access URLConnection so you must
add ServiceConnectionSE method getServiceConnection so we can use cookie
full code below
package com.glenet.androidWfLib.util;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;
import org.ksoap2.transport.ServiceConnectionSE;
import org.xmlpull.v1.XmlPullParserException;
import com.sonalb.net.http.cookie.Client;
import com.sonalb.net.http.cookie.CookieJar;
public class newAndroidHttpTransport extends AndroidHttpTransport {
private ServiceConnectionSE connection;
public newAndroidHttpTransport(String url) {
super(url);
// TODO Auto-generated constructor stub
}
@Override
protected synchronized ServiceConnectionSE getServiceConnection()
throws IOException {
// TODO Auto-generated method stub
// return super.getServiceConnection();
if (connection == null) {
connection = new ServiceConnectionSE(url);
return connection;
} else {
return connection;
}
}
public CookieJar call(String soapAction, SoapEnvelope envelope, CookieJar cj) throws IOException,
XmlPullParserException {
if (soapAction == null)
soapAction = "\"\"";
byte[] requestData = createRequestData(envelope);
requestDump = debug ? new String(requestData) : null;
responseDump = null;
ServiceConnectionSE connection = getServiceConnection();
connection.setRequestProperty("User-Agent", "kSOAP/2.0");
connection.setRequestProperty("SOAPAction", soapAction);
connection.setRequestProperty("Content-Type", "text/xml");
connection.setRequestProperty("Connection", "close");
connection.setRequestProperty("Content-Length", "" + requestData.length);
connection.setRequestMethod("POST");
Client client = new Client();
if (cj != null)
{
client.setCookies(connection.getConnection(), cj);
}
connection.connect();
OutputStream os = connection.openOutputStream();
os.write(requestData, 0, requestData.length);
os.flush();
os.close();
requestData = null;
InputStream is;
try {
connection.connect();
is = connection.openInputStream();
if(cj == null){
cj = client.getCookies(connection.getConnection());
}
} catch (IOException e) {
is = connection.getErrorStream();
if (is == null) {
connection.disconnect();
throw (e);
}
}
if (debug) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buf = new byte[256];
while (true) {
int rd = is.read(buf, 0, 256);
if (rd == -1)
break;
bos.write(buf, 0, rd);
}
bos.flush();
buf = bos.toByteArray();
responseDump = new String(buf);
is.close();
is = new ByteArrayInputStream(buf);
}
parseResponse(envelope, is);
return cj;
}
}
Original issue reported on code.google.com by [email protected]
on 14 Jul 2010 at 6:00
I've been thinking a bit lately about what would make this library more
useful for me. The library has always felt a bit half-finished to me...
there's too many things it should do, but doesn't.
Short of a more end-to-end solution like I've heard Apache Axis is, I think
it would be best to ensure that users of the library can more easily poke
at the raw XML. Can things be refactored such that developers could choose
whether to use DOM, SAX, or XMLPULL? In a way that lets them read and
write the SOAP body and headers, while still ensuring all necessary
attributes, etc. are present?
I'm not sure, but I'd like to look into it some.
Original issue reported on code.google.com by [email protected]
on 2 Jan 2010 at 8:08
A repo must be manually added. I had to add:
<repository>
<id>ibiblio</id>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
</repository>
Original issue reported on code.google.com by [email protected]
on 27 Jan 2010 at 11:30
What steps will reproduce the problem?
Call org.ksoap2.serialization.SoapObject.getPropertyInfo() with an
PropertyInfo object.
What is the expected output? What do you see instead?
The PropertyInfo.value field is null whereas other fields are set correctly.
What version of the product are you using? On what operating system?
2.3
Original issue reported on code.google.com by [email protected]
on 18 Nov 2009 at 10:45
It would be nice if the node attribute patch could be integrated into the
ksoap2 Android builds.
Perhaps attributes can be solved today by writing your own marhals, but the
patch seems to
simplify the procedure a lot.
http://sourceforge.net/tracker/?func=detail&aid=1473145&group_id=158028&atid=806
189
Original issue reported on code.google.com by [email protected]
on 5 Jun 2009 at 3:30
What steps will reproduce the problem?
1. Make any SOAP call that returns a SOAP fault
What is the expected output? What do you see instead?
I expect org.ksoap2.SoapFault to be thrown. Instead, I see:
org.xmlpull.v1.XmlPullParserException: expected: END_TAG
{http://schemas.xmlsoap.org/soap/envelope/}Body (position:END_TAG
</{http://schemas.xmlsoap.org/soap/envelope/}soap:Fault>@1:650 in
java.io.InputStreamReader@438fff30)
What version of the product are you using? On what operating system?
This is "ksoap2-android-assembly-2.3-jar-with-dependencies.jar" which your
downloads page lists as uploaded Aug 16, on Android 1.6.
Please provide any additional information below.
I'm looking at ksoap2-base/src/main/java/org/ksoap2/SoapFault.java and
SoapFault.parse() looks suspicious. It calls parser.require for the start
Fault tag, but not the end Fault tag.
Here is transport.responseDump:
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope
xmlns:zeusns_1_1="http://soap.zeus.com/zxtm/1.1/"
xmlns:zeusns_1_2="http://soap.zeus.com/zxtm/1.2/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:zeusns="http://soap.zeus.com/zxtm/1.0/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultc
ode>soap:Client</faultcode><faultstring>Unknown function called
'http://soap.zeus.com/zxtm/test.wrongNS/Diagnose/diagnoseSystem'</faultstri
ng></soap:Fault></soap:Body></soap:Envelope>
Original issue reported on code.google.com by chris.boyle.name
on 23 Oct 2009 at 12:43
What steps will reproduce the problem?
1. Create a .net web service method GetAllCategories() which returns Category[]
. Each Category is a class containing CategoryId (int) , Name (String) and
Description (String)
2. Use this code
public static final String SOAP_ACTION =
"http://vladozver.org/GetAllCategories";
public static final String METHOD_NAME = "GetAllCategories";
public static final String NAMESPACE = "http://vladozver.org/";
public static final String URL = "http://192.168.1.3/Services/CategoryServices.asmx";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView)findViewById(R.id.TextView01);
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
Category C = new Category();
C.CategoryId = 1;
PropertyInfo pi = new PropertyInfo();
pi.setName("Category");
pi.setValue(C);
pi.setType(C.getClass());
// Request.addProperty(pi);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(Request);
envelope.addMapping(NAMESPACE, "Category",new Category().getClass());
AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
try
{
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject response = (SoapObject)envelope.getResponse();
Category[] res = new Category[response.getPropertyCount()];
for (int i = 0; i < res.length; i++) {
// THROWS EXCEPTION
Category CTry = (Category)response.getProperty(i);
}
catch(Exception e)
{
e.printStackTrace();
}
}
public class Category implements KvmSerializable
{
public int CategoryId;
public String Name;
public String Description;
@Override
public Object getProperty(int arg0) {
switch(arg0)
{
case 0:
return CategoryId;
case 1:
return Name;
case 2:
return Description;
}
return null;
}
@Override
public int getPropertyCount() {
// TODO Auto-generated method stub
return 3;
}
@Override
public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
// TODO Auto-generated method stub
switch(index)
{
case 0:
info.type = PropertyInfo.INTEGER_CLASS;
info.name = "CategoryId";
break;
case 1:
info.type = PropertyInfo.STRING_CLASS;
info.name = "Name";
break;
case 2:
info.type = PropertyInfo.STRING_CLASS;
info.name = "Description";
break;
default:break;
}
}
@Override
public void setProperty(int index, Object value) {
// TODO Auto-generated method stub
switch(index)
{
case 0:
CategoryId = Integer.parseInt(value.toString());
break;
case 1:
Name = value.toString();
break;
case 2:
Description = value.toString();
break;
default:
break;
}
}
}
3. Run the code
What is the expected output? What do you see instead?
A category array with the returned categories. Instead a cast exception occurs.
I don't know how to access the result set of a web service that returns an
array of objects, in my case Category objects.
What version of the product are you using? On what operating system?
Latest, i downloaded it yesterday. Windows 7, Eclipse.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 19 Jun 2010 at 5:03
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.