• Home
  • Raw
  • Download

Lines Matching +full:google +full:- +full:java +full:- +full:format +full:- +full:diff

2 From: Ecco Park <eccopark@google.com>
3 Date: Tue, 8 May 2018 13:44:14 -0700
6 Change-Id: Iace4c0f3cb31c9532c5fa0c44c2dc863bd81b23e
7 Signed-off-by: Ecco Park <eccopark@google.com>
8 ---
9 .../main/java/org/ksoap2/SoapEnvelope.java | 17 +-
10 .../src/main/java/org/ksoap2/SoapFault12.java | 13 +-
11 .../serialization/AttributeContainer.java | 128 +++++-
12 .../java/org/ksoap2/serialization/DM.java | 57 ++-
13 .../ksoap2/serialization/HasAttributes.java | 16 +
14 .../ksoap2/serialization/HasInnerText.java | 17 +
15 .../ksoap2/serialization/KvmSerializable.java | 25 +-
16 .../org/ksoap2/serialization/Marshal.java | 3 +-
17 .../ksoap2/serialization/MarshalBase64.java | 3 +-
18 .../org/ksoap2/serialization/MarshalDate.java | 3 +-
19 .../serialization/MarshalHashtable.java | 8 +-
20 .../org/ksoap2/serialization/SoapObject.java | 340 +++++++++++++-
21 .../ksoap2/serialization/SoapPrimitive.java | 20 +-
22 .../SoapSerializationEnvelope.java | 419 ++++++++++++------
23 .../org/ksoap2/serialization/ValueWriter.java | 13 +
24 .../ksoap2/transport/ServiceConnection.java | 13 +-
25 .../java/org/ksoap2/transport/Transport.java | 131 ++++--
26 .../ksoap2/serialization/MarshalFloat.java | 3 +-
27 .../transport/HttpResponseException.java | 60 +++
28 .../org/ksoap2/transport/HttpTransportSE.java | 348 +++++++--------
29 .../transport/HttpsServiceConnectionSE.java | 58 ++-
30 .../ksoap2/transport/HttpsTransportSE.java | 81 ++--
31 .../transport/KeepAliveHttpsTransportSE.java | 20 +-
32 .../ksoap2/transport/ServiceConnectionSE.java | 44 +-
33 24 files changed, 1298 insertions(+), 542 deletions(-)
34 create mode 100644 ksoap2-base/src/main/java/org/ksoap2/serialization/HasAttributes.java
35 create mode 100644 ksoap2-base/src/main/java/org/ksoap2/serialization/HasInnerText.java
36 create mode 100644 ksoap2-base/src/main/java/org/ksoap2/serialization/ValueWriter.java
37 create mode 100644 ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpResponseException.java
39 diff --git a/ksoap2-base/src/main/java/org/ksoap2/SoapEnvelope.java b/ksoap2-base/src/main/java/org…
41 --- a/ksoap2-base/src/main/java/org/ksoap2/SoapEnvelope.java
42 +++ b/ksoap2-base/src/main/java/org/ksoap2/SoapEnvelope.java
43 @@ -54,10 +54,8 @@ public class SoapEnvelope {
45 public static final String XSI1999 = "http://www.w3.org/1999/XMLSchema-instance";
47 - //public static final String NS20 = "http://www.wi-fi-org/specifications/hotspot2dot0/spp/1.0/…
48 public static final String NS20 = "http://www.wi-fi.org/specifications/hotspot2dot0/v1.0/spp";
50 - //public static final String OMADM12 = "http://www.openmobilealliance.org/tech/DTD/dm_ddf-v1_2…
54 @@ -105,9 +103,8 @@ public class SoapEnvelope {
58 - ///M: HS20 Add by Jungo
61 - public String omadm;
65 @@ -129,10 +126,8 @@ public class SoapEnvelope {
69 -
72 - //omadm = SoapEnvelope.OMADM12;
73 -
77 @@ -206,13 +201,9 @@ public class SoapEnvelope {
81 - ///M: HS20 modify by Jungo
82 - //writer.setPrefix("i", xsi);
83 - //writer.setPrefix("d", xsd);
84 - //writer.setPrefix("c", enc);
85 - writer.setPrefix("soap", env);//the prefix for namespace env in xml output
89 - //writer.setPrefix("omadm", omadm);
93 diff --git a/ksoap2-base/src/main/java/org/ksoap2/SoapFault12.java b/ksoap2-base/src/main/java/org/…
95 --- a/ksoap2-base/src/main/java/org/ksoap2/SoapFault12.java
96 +++ b/ksoap2-base/src/main/java/org/ksoap2/SoapFault12.java
97 @@ -72,27 +72,28 @@ public class SoapFault12 extends SoapFault {
103 - if (name.equals("Code")) {
107 - } else if (name.equals("Reason")) {
111 - } else if (name.equals("Node")) {
115 - } else if (name.equals("Role")) {
119 - } else if (name.equals("Detail")) {
127 - parser.require(XmlPullParser.END_TAG, SoapEnvelope.ENV2003, name);
132 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/AttributeContainer.java b/ksoap2-ba…
134 --- a/ksoap2-base/src/main/java/org/ksoap2/serialization/AttributeContainer.java
135 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/AttributeContainer.java
136 @@ -3,8 +3,8 @@ package org.ksoap2.serialization;
138 import java.util.Vector;
140 -public class AttributeContainer {
141 - private Vector attributes = new Vector();
147 @@ -29,9 +29,9 @@ public class AttributeContainer {
151 - /**
152 - * Get the attribute's toString value.
153 - */
160 @@ -51,6 +51,20 @@ public class AttributeContainer {
181 @@ -65,6 +79,19 @@ public class AttributeContainer {
201 @@ -76,6 +103,16 @@ public class AttributeContainer {
218 @@ -91,6 +128,21 @@ public class AttributeContainer {
240 @@ -108,6 +160,23 @@ public class AttributeContainer {
264 @@ -117,6 +186,16 @@ public class AttributeContainer {
281 @@ -160,13 +239,25 @@ public class AttributeContainer {
304 -
308 @@ -178,6 +269,18 @@ public class AttributeContainer {
327 @@ -198,4 +301,17 @@ public class AttributeContainer {
345 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/DM.java b/ksoap2-base/src/main/java
347 --- a/ksoap2-base/src/main/java/org/ksoap2/serialization/DM.java
348 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/DM.java
349 @@ -20,9 +20,12 @@
353 -import java.io.*;
354 -import org.xmlpull.v1.*;
355 -import org.ksoap2.*;
356 +import java.io.IOException;
365 @@ -30,8 +33,7 @@ import org.ksoap2.*;
369 - public Object readInstance(XmlPullParser parser, String namespace, String name,
370 - PropertyInfo expected)
375 @@ -49,9 +51,10 @@ class DM implements Marshal {
379 - * Write the instance out. In case it is an AttributeContainer write those our first though.
380 - * @param writer
381 - * the xml serializer.
389 @@ -62,11 +65,43 @@ class DM implements Marshal {
393 - writer.attribute(attributeInfo.getNamespace(), attributeInfo.getName(),
394 - attributeInfo.getValue().toString());
422 - writer.text(instance.toString());
436 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/HasAttributes.java b/ksoap2-base/sr…
439 --- /dev/null
440 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/HasAttributes.java
441 @@ -0,0 +1,16 @@
458 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/HasInnerText.java b/ksoap2-base/src…
461 --- /dev/null
462 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/HasInnerText.java
463 @@ -0,0 +1,17 @@
481 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/KvmSerializable.java b/ksoap2-base/…
483 --- a/ksoap2-base/src/main/java/org/ksoap2/serialization/KvmSerializable.java
484 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/KvmSerializable.java
485 @@ -39,31 +39,26 @@ public interface KvmSerializable {
489 - /**
490 - * @return the number of serializable properties
498 - *
499 - * @param index
500 - * the index to be set
501 - * @param value
502 - * the value of the property
511 - *
512 - * @param index
513 - * the index to be queried
514 - * @param properties
515 - * information about the (de)serializer. Not frequently used.
516 - * @param info
517 - * The return parameter, to be filled with information about the
518 - * property with the given index.
527 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/Marshal.java b/ksoap2-base/src/main…
529 --- a/ksoap2-base/src/main/java/org/ksoap2/serialization/Marshal.java
530 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/Marshal.java
531 @@ -41,8 +41,7 @@ public interface Marshal {
535 - public Object readInstance(XmlPullParser parser, String namespace, String name,
536 - PropertyInfo expected)
541 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/MarshalBase64.java b/ksoap2-base/sr…
543 --- a/ksoap2-base/src/main/java/org/ksoap2/serialization/MarshalBase64.java
544 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/MarshalBase64.java
545 @@ -31,8 +31,7 @@ import org.xmlpull.v1.*;
549 - public Object readInstance(XmlPullParser parser, String namespace, String name,
550 - PropertyInfo expected)
555 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/MarshalDate.java b/ksoap2-base/src/…
557 --- a/ksoap2-base/src/main/java/org/ksoap2/serialization/MarshalDate.java
558 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/MarshalDate.java
559 @@ -31,8 +31,7 @@ import org.ksoap2.kobjects.isodate.*;
563 - public Object readInstance(XmlPullParser parser, String namespace, String name,
564 - PropertyInfo expected)
569 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/MarshalHashtable.java b/ksoap2-base…
571 --- a/ksoap2-base/src/main/java/org/ksoap2/serialization/MarshalHashtable.java
572 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/MarshalHashtable.java
573 @@ -46,8 +46,7 @@ public class MarshalHashtable implements Marshal {
577 - public Object readInstance(XmlPullParser parser, String namespace, String name,
578 - PropertyInfo expected)
583 @@ -81,7 +80,7 @@ public class MarshalHashtable implements Marshal {
587 - envelope.writeObjectBody(writer, item);
592 @@ -89,7 +88,6 @@ public class MarshalHashtable implements Marshal {
595 int resolvedIndex = -1;
596 -
600 @@ -107,7 +105,7 @@ public class MarshalHashtable implements Marshal {
604 - } else {
609 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/SoapObject.java b/ksoap2-base/src/m…
611 --- a/ksoap2-base/src/main/java/org/ksoap2/serialization/SoapObject.java
612 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/SoapObject.java
613 @@ -38,7 +38,7 @@ import java.util.*;
617 -public class SoapObject extends AttributeContainer implements KvmSerializable {
622 @@ -54,6 +54,8 @@ public class SoapObject extends AttributeContainer implements KvmSerializable {
631 @@ -181,6 +183,230 @@ public class SoapObject extends AttributeContainer implements KvmSerializable…
862 @@ -301,9 +527,9 @@ public class SoapObject extends AttributeContainer implements KvmSerializable {
866 - if (index != null) {
869 - if (propertyInfo.getType() != SoapObject.class) {
874 @@ -326,9 +552,9 @@ public class SoapObject extends AttributeContainer implements KvmSerializable {
878 - if (index != null) {
881 - if (propertyInfo.getType() != SoapObject.class) {
886 @@ -348,9 +574,9 @@ public class SoapObject extends AttributeContainer implements KvmSerializable {
890 - if (index != null) {
893 - if (propertyInfo.getType() != SoapObject.class) {
898 @@ -374,9 +600,9 @@ public class SoapObject extends AttributeContainer implements KvmSerializable {
902 - if (index != null) {
905 - if (propertyInfo.getType() != SoapObject.class) {
910 @@ -397,6 +623,18 @@ public class SoapObject extends AttributeContainer implements KvmSerializable {
929 @@ -453,6 +691,17 @@ public class SoapObject extends AttributeContainer implements KvmSerializable {
947 @@ -466,17 +715,17 @@ public class SoapObject extends AttributeContainer implements KvmSerializable…
951 - PropertyInfo propertyInfoClonned = (PropertyInfo) propertyInfo.clone();
952 - o.addProperty(propertyInfoClonned);
953 - } else if (prop instanceof SoapObject) {
954 - o.addSoapObject(((SoapObject) prop).newInstance());
965 - // attributes.elementAt(attribIndex);
970 @@ -513,11 +762,49 @@ public class SoapObject extends AttributeContainer implements KvmSerializable…
992 - ///M: HS20 modify by Jungo
1021 @@ -597,12 +884,12 @@ public class SoapObject extends AttributeContainer implements KvmSerializable…
1025 - if (prop instanceof PropertyInfo) {
1028 - .append(((PropertyInfo) prop).getName())
1029 - .append("=")
1030 - .append(getProperty(i))
1031 - .append("; ");
1039 @@ -610,4 +897,17 @@ public class SoapObject extends AttributeContainer implements KvmSerializable {
1057 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/SoapPrimitive.java b/ksoap2-base/sr…
1059 --- a/ksoap2-base/src/main/java/org/ksoap2/serialization/SoapPrimitive.java
1060 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/SoapPrimitive.java
1061 @@ -34,11 +34,14 @@ package org.ksoap2.serialization;
1065 - String namespace;
1066 - String name;
1067 - String value;
1072 - public SoapPrimitive(String namespace, String name, String value) {
1080 @@ -50,7 +53,7 @@ public class SoapPrimitive extends AttributeContainer {
1084 - && (namespace == null ? p.namespace == null : namespace.equals(p.namespace))
1089 @@ -60,7 +63,7 @@ public class SoapPrimitive extends AttributeContainer {
1093 - return value;
1098 @@ -70,4 +73,9 @@ public class SoapPrimitive extends AttributeContainer {
1108 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/SoapSerializationEnvelope.java b/ks…
1110 --- a/ksoap2-base/src/main/java/org/ksoap2/serialization/SoapSerializationEnvelope.java
1111 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/SoapSerializationEnvelope.java
1112 @@ -27,9 +27,9 @@ import org.xmlpull.v1.XmlPullParserException;
1115 import java.io.IOException;
1116 +import java.util.ArrayList;
1117 import java.util.Hashtable;
1118 import java.util.Vector;
1119 -import java.io.ByteArrayOutputStream;
1123 @@ -43,29 +43,29 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1132 - private static final String NULL_LABEL = "null";
1133 - private static final String NIL_LABEL = "nil";
1140 - static final Marshal DEFAULT_MARSHAL = new DM();
1142 -
1143 - Hashtable idMap = new Hashtable();
1144 - Vector multiRef; // = new Vector();
1145 -
1148 * are automatically generated (with type "anyType") in the XML-Request, if you don't call the
1149 …* Method addMapping. This is needed by some Servers which have problems with these type-definition…
1152 -
1160 * .Net-Services. This feature is an extremely ugly hack. A much better option is to change the
1161 @@ -96,9 +96,10 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1168 - public SoapSerializationEnvelope(int version)
1169 - {
1174 @@ -107,23 +108,21 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1178 - public boolean isAddAdornments()
1179 - {
1185 - * @param addAdornments
1186 - * the addAdornments to set
1189 - public void setAddAdornments(boolean addAdornments)
1190 - {
1196 … * Set the bodyOut to be empty so that no un-needed xml is create. The null value for bodyOut will
1200 * @see "http://code.google.com/p/ksoap2-android/issues/detail?id=77"
1202 @@ -133,8 +132,7 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1206 - public void parseBody(XmlPullParser parser) throws IOException, XmlPullParserException
1207 - {
1212 @@ -161,10 +159,11 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1216 - /** Read a SoapObject. This extracts any attributes and then reads the object as a KvmSerializ…
1221 - XmlPullParserException
1222 - {
1227 @@ -173,11 +172,21 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1231 - /** Read a KvmSerializable. */
1236 - XmlPullParserException
1237 - {
1238 - while (parser.nextTag() != XmlPullParser.END_TAG) {
1253 @@ -188,8 +197,7 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1257 - if ((name.equals(info.name) && info.namespace == null)
1258 - ||
1263 @@ -199,21 +207,42 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1267 - while (parser.next() != XmlPullParser.END_TAG
1268 - || !name.equals(parser.getName())) {
1291 // I can only make this work for SoapObjects - hence the check above
1293 - ((SoapObject) obj).addProperty(parser.getName(),
1294 - read(parser, obj, obj.getPropertyCount(),
1295 - ((SoapObject) obj).getNamespace(), name, PropertyInfo.OBJECT_TYPE)…
1311 @@ -278,9 +307,8 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1315 - so.addProperty(parser.getName(),
1316 - read(parser, so, so.getPropertyCount(), null, null,
1317 - PropertyInfo.OBJECT_TYPE));
1323 @@ -293,12 +321,15 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1327 - return value.length() - start < 3 ? dflt : Integer.parseInt(value.substring(start + 1,
1328 - value.length() - 1));
1330 + return value.length() - start < 3 ? dflt : Integer.parseInt(value.substring(start + 1,
1331 + value.length() - 1));
1337 - protected void readVector(XmlPullParser parser, Vector v, PropertyInfo elementType)
1338 - throws IOException,
1343 @@ -337,14 +368,23 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1350 + * But in theory there could be a different value format, like cid:value, etc...
1361 - public Object read(XmlPullParser parser, Object owner, int index, String namespace,
1362 - String name,
1363 - PropertyInfo expected) throws IOException, XmlPullParserException {
1370 @@ -352,7 +392,7 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1374 - href = href.substring(1);
1379 @@ -402,21 +442,8 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1383 - Object hlp = idMap.get(id);
1384 - if (hlp instanceof FwdRef) {
1385 - FwdRef f = (FwdRef) hlp;
1386 - do {
1387 - if (f.obj instanceof KvmSerializable) {
1388 - ((KvmSerializable) f.obj).setProperty(f.index, obj);
1389 - } else {
1390 - ((Vector) f.obj).setElementAt(obj, f.index);
1391 - }
1392 - f = f.next;
1393 - } while (f != null);
1394 - } else if (hlp != null) {
1395 - throw new RuntimeException("double ID");
1396 - }
1397 - idMap.put(id, obj);
1403 @@ -424,12 +451,30 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1428 * is used by the SoapParser in order to convert the XML code to Java objects.
1430 - public Object readInstance(XmlPullParser parser, String namespace, String name,
1431 - PropertyInfo expected)
1436 @@ -448,10 +493,30 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1467 @@ -476,15 +541,11 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1471 - return new Object[] {
1472 - so.getNamespace(), so.getName(), null, null
1473 - };
1478 - return new Object[] {
1479 - sp.getNamespace(), sp.getName(), null, DEFAULT_MARSHAL
1480 - };
1485 @@ -492,9 +553,7 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1489 - return new Object[] {
1490 - xsd, ANY_TYPE_LABEL, null, null
1491 - };
1496 @@ -503,11 +562,8 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1500 - .put(new SoapPrimitive(namespace, name, null), marshal == null ? (Object) clazz
1501 - : marshal);
1502 - classToQName.put(clazz.getName(), new Object[] {
1503 - namespace, name, null, marshal
1504 - });
1510 @@ -528,11 +584,14 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1514 - * @since 2.0.3
1526 @@ -554,8 +613,7 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1530 - * @param writer
1531 - * XmlSerializer object to write the body into.
1536 @@ -564,36 +622,48 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1540 - writer.startTag((dotNet) ? "" : (String) qName[QNAME_NAMESPACE],
1541 - (String) qName[QNAME_TYPE]); //<spp:sppPostDevData
1542 - if (dotNet) {
1543 - writer.attribute(null, "xmlns", (String) qName[QNAME_NAMESPACE]);
1544 - }
1556 - writeElement(writer, bodyOut, null, qName[QNAME_MARSHAL]); //....
1557 - writer.endTag((dotNet) ? "" : (String) qName[QNAME_NAMESPACE],
1558 - (String) qName[QNAME_TYPE]);//</spp:sppPostDevData>
1564 - /**
1565 - * Writes the body of an SoapObject. This method write the attributes and then calls
1566 - * "writeObjectBody (writer, (KvmSerializable)obj);"
1567 - */
1568 - public void writeObjectBody(XmlSerializer writer, SoapObject obj) throws IOException {
1569 - SoapObject soapObject = (SoapObject) obj;
1576 - writer.attribute(attributeInfo.getNamespace(), attributeInfo.getName(), attributeInfo
1577 - .getValue()
1578 - .toString());
1591 - writeObjectBody(writer, (KvmSerializable) obj);
1603 @@ -614,9 +684,12 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1607 - writer.startTag(propertyInfo.namespace, propertyInfo.name);
1608 - writeProperty(writer, obj.getProperty(i), propertyInfo);
1609 - writer.endTag(propertyInfo.namespace, propertyInfo.name);
1619 @@ -633,46 +706,47 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1623 - // treat MO data as CDATA
1624 - if (name.equals("DevInfo") || name.equals("DevDetail")
1625 - || name.equals("PerProviderSubscription") || // format v4
1626 - name.equals("MgmtTree") // format v6
1627 - ) {
1628 - ByteArrayOutputStream bos = new ByteArrayOutputStream();
1629 - XmlSerializer xw = new KXmlSerializer();
1630 - xw.setOutput(bos, "UTF-8");
1631 - xw.startTag((dotNet) ? "" : namespace, name);
1632 - if (!implicitTypes) {
1633 - String prefix = writer.getPrefix(namespace, true);
1634 - writer.attribute(xsi, TYPE_LABEL, prefix + ":" + type);
1635 - }
1636 - writeObjectBody(xw, nestedSoap);
1637 - xw.endTag((dotNet) ? "" : namespace, name);
1638 - xw.flush();
1639 - //bos.write('\r');
1640 - //bos.write('\n');
1641 - bos.flush();
1642 - writer.cdsect(bos.toString());
1674 - writer.startTag((dotNet) ? "" : namespace, name);
1675 - if (!implicitTypes) {
1676 - String prefix = writer.getPrefix(namespace, true);
1677 - writer.attribute(xsi, TYPE_LABEL, prefix + ":" + type);
1678 - }
1679 - writeObjectBody(writer, nestedSoap);
1680 - writer.endTag((dotNet) ? "" : namespace, name);
1688 - protected void writeProperty(XmlSerializer writer, Object obj, PropertyInfo type)
1689 - throws IOException {
1690 - if (obj == null) {
1691 - ///M: Modify for HS20
1692 - //writer.attribute(xsi, version >= VER12 ? NIL_LABEL : NULL_LABEL, "true");
1699 @@ -692,15 +766,19 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1703 - private void writeElement(XmlSerializer writer, Object element, PropertyInfo type,
1704 - Object marshal)
1709 - } else if (element instanceof SoapObject) {
1710 - writeObjectBody(writer, (SoapObject) element);
1711 - } else if (element instanceof KvmSerializable) {
1712 - writeObjectBody(writer, (KvmSerializable) element);
1725 @@ -708,6 +786,65 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1791 @@ -727,9 +864,13 @@ public class SoapSerializationEnvelope extends SoapEnvelope
1795 - writer.attribute(enc, ARRAY_TYPE_LABEL, writer.getPrefix((String) arrType[0], false)
1796 - + ":"
1807 diff --git a/ksoap2-base/src/main/java/org/ksoap2/serialization/ValueWriter.java b/ksoap2-base/src/…
1810 --- /dev/null
1811 +++ b/ksoap2-base/src/main/java/org/ksoap2/serialization/ValueWriter.java
1812 @@ -0,0 +1,13 @@
1817 +import java.io.IOException;
1820 + * Created by robocik on 2015-09-25.
1826 diff --git a/ksoap2-base/src/main/java/org/ksoap2/transport/ServiceConnection.java b/ksoap2-base/sr…
1828 --- a/ksoap2-base/src/main/java/org/ksoap2/transport/ServiceConnection.java
1829 +++ b/ksoap2-base/src/main/java/org/ksoap2/transport/ServiceConnection.java
1830 @@ -21,8 +21,10 @@
1834 +import java.io.IOException;
1835 +import java.io.InputStream;
1836 +import java.io.OutputStream;
1837 import java.util.List;
1838 -import java.io.*;
1842 @@ -58,6 +60,13 @@ public interface ServiceConnection {
1856 @@ -88,6 +97,8 @@ public interface ServiceConnection {
1865 diff --git a/ksoap2-base/src/main/java/org/ksoap2/transport/Transport.java b/ksoap2-base/src/main/j…
1867 --- a/ksoap2-base/src/main/java/org/ksoap2/transport/Transport.java
1868 +++ b/ksoap2-base/src/main/java/org/ksoap2/transport/Transport.java
1869 @@ -23,9 +23,13 @@
1873 +import java.util.HashMap;
1874 +import java.util.Iterator;
1875 import java.util.List;
1876 import java.io.*;
1877 +import java.net.MalformedURLException;
1878 import java.net.Proxy;
1879 +import java.net.URL;
1883 @@ -40,9 +44,9 @@ import org.xmlpull.v1.*;
1887 - * Added to enable web service interactions on the emulator
1888 - * to be debugged with Fiddler2 (Windows) but provides utility
1889 - * for other proxy requirements.
1896 @@ -61,6 +65,12 @@ abstract public class Transport {
1909 @@ -82,9 +92,12 @@ abstract public class Transport {
1913 - * @param proxy Specifies the proxy server to use for
1914 - * accessing the web service or <code>null</code> if a direct connection is available
1915 - * @param url Specifies the web service url
1925 @@ -114,23 +127,30 @@ abstract public class Transport {
1938 - protected byte[] createRequestData(SoapEnvelope envelope, String encoding) throws IOException {
1939 - System.out.println("createRequestData");
1945 - System.out.println("bos.write");
1947 - System.out.println("new KXmlSerializer");
1952 - System.out.println("xw.setOutput");
1958 - System.out.println("envelope.write");
1962 @@ -138,14 +158,14 @@ abstract public class Transport {
1966 - System.out.println("createRequestData end");
1973 - protected byte[] createRequestData(SoapEnvelope envelope) throws IOException {
1979 @@ -159,6 +179,12 @@ abstract public class Transport {
1991 * version=\"1.0\" encoding=\"UTF-8\"?>
1992 @@ -177,57 +203,94 @@ abstract public class Transport {
1996 - * Perform a soap call with a given namespace and the given envelope providing
1997 - * any extra headers that the user requires such as cookies. Headers that are
1998 - * returned by the web service will be returned to the caller in the form of a
1999 - * <code>List</code> of <code>HeaderProperty</code> instances.
2027 - * @param targetNamespace
2033 - * <code>List</code> of <code>HeaderProperty</code> headers to send with the SOAP request.
2041 - * <code>HeaderProperty</code> instances.
2044 - abstract public List call(String targetNamespace, SoapEnvelope envelope, List headers)
2045 - throws IOException, XmlPullParserException;
2053 - * @param targetNamespace
2059 - public void call(String targetNamespace, SoapEnvelope envelope) throws IOException,
2060 - XmlPullParserException {
2061 - call(targetNamespace, envelope, null);
2069 - *
2073 - abstract public String getHost();
2080 - * Return the port number of the host that is specified as the web service target
2081 - *
2087 - abstract public int getPort();
2095 - *
2099 - abstract public String getPath();
2107 diff --git a/ksoap2-j2se/src/main/java/org/ksoap2/serialization/MarshalFloat.java b/ksoap2-j2se/src…
2109 --- a/ksoap2-j2se/src/main/java/org/ksoap2/serialization/MarshalFloat.java
2110 +++ b/ksoap2-j2se/src/main/java/org/ksoap2/serialization/MarshalFloat.java
2111 @@ -27,8 +27,7 @@ import org.xmlpull.v1.*;
2115 - public Object readInstance(XmlPullParser parser, String namespace, String name,
2116 - PropertyInfo propertyInfo)
2121 diff --git a/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpResponseException.java b/ksoap2-j2s…
2124 --- /dev/null
2125 +++ b/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpResponseException.java
2126 @@ -0,0 +1,60 @@
2129 +import java.io.IOException;
2130 +import java.util.List;
2187 diff --git a/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpTransportSE.java b/ksoap2-j2se/src/…
2189 --- a/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpTransportSE.java
2190 +++ b/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpTransportSE.java
2191 @@ -25,24 +25,21 @@
2195 -import java.util.List;
2196 -import java.util.zip.GZIPInputStream;
2202 import java.io.*;
2203 -import java.net.MalformedURLException;
2204 import java.net.Proxy;
2205 -import java.net.URL;
2206 -
2207 -import org.ksoap2.*;
2208 -import org.ksoap2.serialization.SoapSerializationEnvelope;
2209 -import org.xmlpull.v1.*;
2210 +import java.util.*;
2211 +import java.util.zip.GZIPInputStream;
2218 - private ServiceConnection serviceConnection;
2219 -
2223 @@ -107,249 +104,254 @@ public class HttpTransportSE extends Transport {
2231 - public void call(String soapAction, SoapEnvelope envelope) throws IOException,
2232 - XmlPullParserException {
2233 -
2246 - *
2247 - * set the desired soapAction header field
2248 - *
2255 - * the desired soapAction
2258 - * the envelope containing the information for the soap call.
2261 - * a list of HeaderProperties to be http header properties when establishing the …
2266 - * @return <code>CookieJar</code> with any cookies sent by the server
2267 - * @throws IOException
2268 - * @throws XmlPullParserException
2275 - public List call(String soapAction, SoapEnvelope envelope, List headers)
2276 - throws IOException, XmlPullParserException {
2284 - System.out.println("call action:" + soapAction);
2285 byte[] requestData = createRequestData(envelope, "UTF-8");
2287 - if (requestData != null) {
2288 - requestDump = debug ? new String(requestData) : null;
2289 - }
2290 - else {
2291 - requestDump = null;
2292 - }
2295 -
2296 - System.out.println("requestDump:" + requestDump);
2299 - System.out.println("connection:" + connection);
2301 connection.setRequestProperty("User-Agent", USER_AGENT);
2304 // @see "http://code.google.com/p/ksoap2-android/issues/detail?id=67
2305 - System.out.println("envelope:" + envelope);
2306 - if (envelope != null) {
2307 - if (envelope.version != SoapSerializationEnvelope.VER12) {
2308 - connection.setRequestProperty("SOAPAction", soapAction);
2309 - }
2314 - if (envelope.version == SoapSerializationEnvelope.VER12) {
2315 - connection.setRequestProperty("Content-Type", CONTENT_TYPE_SOAP_XML_CHARSET_UTF_8);
2316 - } else {
2317 - connection.setRequestProperty("Content-Type", CONTENT_TYPE_XML_CHARSET_UTF_8);
2318 - }
2320 + connection.setRequestProperty("Content-Type", CONTENT_TYPE_SOAP_XML_CHARSET_UTF_8);
2322 + connection.setRequestProperty("Content-Type", CONTENT_TYPE_XML_CHARSET_UTF_8);
2325 - connection.setRequestProperty("Connection", "close");
2326 - connection.setRequestProperty("Accept-Encoding", "gzip");
2327 - connection.setRequestProperty("Content-Length", "" + requestData.length);
2330 + connection.setRequestProperty("Accept-Encoding", "gzip");
2332 - //M: Retry for HTTP Authentication
2333 - //connection.setFixedLengthStreamingMode(requestData.length);
2335 - // Pass the headers provided by the user along with the call
2336 - if (headers != null) {
2337 - for (int i = 0; i < headers.size(); i++) {
2338 - HeaderProperty hp = (HeaderProperty) headers.get(i);
2339 - connection.setRequestProperty(hp.getKey(), hp.getValue());
2340 - }
2347 -
2348 - connection.setRequestMethod("POST");
2349 -
2350 - }
2351 - else {
2352 - connection.setRequestProperty("Connection", "close");
2353 - connection.setRequestProperty("Accept-Encoding", "gzip");
2354 - connection.setRequestMethod("GET");
2357 - if (requestData != null) {
2358 - OutputStream os = connection.openOutputStream();
2359 -
2360 - os.write(requestData, 0, requestData.length);
2361 - os.flush();
2362 - os.close();
2363 - requestData = null;
2364 - }
2365 - InputStream is;
2374 - boolean bcaCert = false;
2380 - System.out.println("[HttpTransportSE] retHeaders = " + retHeaders);
2383 - HeaderProperty hp = (HeaderProperty) retHeaders.get(i);
2391 + if (hp.getKey().equalsIgnoreCase("content-length") ) {
2402 + // Check the content-type header to see if we're getting back XML, in case of a
2404 + if (hp.getKey().equalsIgnoreCase("Content-Type")
2412 if (hp.getKey().equalsIgnoreCase("Content-Encoding")
2413 - && hp.getValue().equalsIgnoreCase("gzip")) {
2418 - if (gZippedContent) {
2419 - is = getUnZippedInputStream(connection.openInputStream());
2420 - } else {
2421 - is = connection.openInputStream();
2422 - }
2423 - } catch (IOException e) {
2424 - if (gZippedContent) {
2425 - is = getUnZippedInputStream(connection.getErrorStream());
2426 - } else {
2427 - is = connection.getErrorStream();
2428 - }
2430 - if (is == null) {
2431 - connection.disconnect();
2432 - throw (e);
2438 - }
2439 -
2440 - if (debug) {
2441 - ByteArrayOutputStream bos = new ByteArrayOutputStream();
2442 - byte[] buf = new byte[8192];
2444 - while (true) {
2445 - int rd = is.read(buf, 0, 8192);
2446 - if (rd == -1) {
2447 - break;
2464 - bos.write(buf, 0, rd);
2467 - bos.flush();
2468 - buf = bos.toByteArray();
2476 - responseDump = new String(buf);
2484 - System.out.println("responseDump:" + responseDump);
2485 - is.close();
2486 - is = new ByteArrayInputStream(buf);
2491 - if (envelope != null) {
2492 - parseResponse(envelope, is);
2502 + //This fixes Issue 173 read my explanation here: https://code.google.com/p/ksoap2-android/…
2508 - private InputStream getUnZippedInputStream(InputStream inputStream) throws IOException {
2509 - /* workaround for Android 2.3
2510 - (see http://stackoverflow.com/questions/5131016/)
2511 - */
2512 - try {
2513 - return (GZIPInputStream) inputStream;
2514 - } catch (ClassCastException e) {
2515 - return new GZIPInputStream(inputStream);
2516 - }
2517 - }
2521 + connection.setRequestProperty("Content-Length", "" + requestData.length);
2524 - public ServiceConnection getServiceConnection() throws IOException {
2525 - if (serviceConnection == null) {
2526 - System.out.println("new ServiceConnectionSE:" + proxy + " " + url + " " + timeout);
2527 - serviceConnection = new ServiceConnectionSE(proxy, url, timeout);
2528 - }
2529 - return serviceConnection;
2536 - public String getHost() {
2537 -
2538 - String retVal = null;
2539 -
2540 - try {
2541 - retVal = new URL(url).getHost();
2542 - } catch (MalformedURLException e) {
2543 - e.printStackTrace();
2544 - }
2545 -
2546 - return retVal;
2553 - public int getPort() {
2554 -
2555 - int retVal = -1;
2557 - try {
2558 - retVal = new URL(url).getPort();
2559 - } catch (MalformedURLException e) {
2560 - e.printStackTrace();
2570 - return retVal;
2571 - }
2572 -
2573 - public String getPath() {
2574 -
2575 - String retVal = null;
2578 - try {
2579 - retVal = new URL(url).getPath();
2580 - } catch (MalformedURLException e) {
2581 - e.printStackTrace();
2584 + if (rd == -1) {
2590 - return retVal;
2591 - }
2592 -
2593 - public String getQuery() {
2594 -
2595 - String retVal = null;
2596 -
2597 - try {
2598 - retVal = new URL(url).getQuery();
2599 - } catch (MalformedURLException e) {
2600 - e.printStackTrace();
2614 -
2615 - return retVal;
2618 - /**
2619 - * @hide
2620 - */
2621 - public byte[] getRequestData(SoapEnvelope envelope, String encoding) {
2627 - return createRequestData(envelope, encoding);
2628 - } catch (Exception e) {
2629 - e.printStackTrace();
2636 - return null;
2641 diff --git a/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpsServiceConnectionSE.java b/ksoap2-
2643 --- a/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpsServiceConnectionSE.java
2644 +++ b/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpsServiceConnectionSE.java
2645 @@ -1,21 +1,16 @@
2653 import java.io.IOException;
2654 import java.io.InputStream;
2655 import java.io.OutputStream;
2656 +import java.net.Proxy;
2657 import java.net.URL;
2658 -import java.util.Iterator;
2659 -import java.util.LinkedList;
2660 -import java.util.Map;
2661 -import java.util.List;
2662 -import java.util.Set;
2663 -
2664 -import javax.net.ssl.HostnameVerifier;
2665 -import javax.net.ssl.SSLSocketFactory;
2666 -import javax.net.ssl.HttpsURLConnection;
2667 -//import com.android.okhttp.internal.http.HttpsURLConnectionImpl;
2668 -import org.ksoap2.HeaderProperty;
2669 +import java.util.*;
2673 @@ -49,10 +44,29 @@ public class HttpsServiceConnectionSE implements ServiceConnection {
2677 - public HttpsServiceConnectionSE(String host, int port, String file,
2678 - int timeout) throws IOException {
2679 - connection = (HttpsURLConnection) new URL(HttpsTransportSE.PROTOCOL, host, port, file)
2680 - .openConnection();
2707 @@ -89,6 +103,10 @@ public class HttpsServiceConnectionSE implements ServiceConnection {
2718 @@ -101,6 +119,11 @@ public class HttpsServiceConnectionSE implements ServiceConnection {
2730 @@ -128,9 +151,4 @@ public class HttpsServiceConnectionSE implements ServiceConnection {
2734 -
2735 - public void setHostnameVerifier(HostnameVerifier v) {
2736 - connection.setHostnameVerifier(v);
2737 - }
2738 -
2740 diff --git a/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpsTransportSE.java b/ksoap2-j2se/src…
2742 --- a/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpsTransportSE.java
2743 +++ b/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpsTransportSE.java
2744 @@ -1,8 +1,8 @@
2745 -
2748 import java.io.IOException;
2749 import java.net.MalformedURLException;
2750 +import java.net.Proxy;
2751 import java.net.URL;
2754 @@ -14,17 +14,31 @@ import java.net.URL;
2763 - private ServiceConnection serviceConnection = null;
2764 - private final String host;
2765 - private final int port;
2766 - private final String file;
2767 - private final int timeout;
2772 - public HttpsTransportSE(String host, int port, String file, int timeout) {
2773 - super(HttpsTransportSE.PROTOCOL + "://" + host + ":" + port + file);
2774 - System.out.println("Establistion connection to: " + HttpsTransportSE.PROTOCOL + "://"
2775 - + host + ":" + port + file);
2795 @@ -37,48 +51,11 @@ public class HttpsTransportSE extends HttpTransportSE {
2799 - if (serviceConnection == null) {
2800 - serviceConnection = new HttpsServiceConnectionSE(host, port, file, timeout);
2801 - }
2802 - return serviceConnection;
2803 - }
2804 -
2805 - public String getHost() {
2806 -
2807 - String retVal = null;
2808 -
2809 - try {
2810 - retVal = new URL(url).getHost();
2811 - } catch (MalformedURLException e) {
2812 - e.printStackTrace();
2819 -
2820 - return retVal;
2821 - }
2822 -
2823 - public int getPort() {
2824 -
2825 - int retVal = -1;
2826 -
2827 - try {
2828 - retVal = new URL(url).getPort();
2829 - } catch (MalformedURLException e) {
2830 - e.printStackTrace();
2831 - }
2832 -
2833 - return retVal;
2834 - }
2835 -
2836 - public String getPath() {
2837 -
2838 - String retVal = null;
2839 -
2840 - try {
2841 - retVal = new URL(url).getPath();
2842 - } catch (MalformedURLException e) {
2843 - e.printStackTrace();
2844 - }
2845 -
2846 - return retVal;
2849 diff --git a/ksoap2-j2se/src/main/java/org/ksoap2/transport/KeepAliveHttpsTransportSE.java b/ksoap2
2851 --- a/ksoap2-j2se/src/main/java/org/ksoap2/transport/KeepAliveHttpsTransportSE.java
2852 +++ b/ksoap2-j2se/src/main/java/org/ksoap2/transport/KeepAliveHttpsTransportSE.java
2853 @@ -24,18 +24,8 @@ import java.io.IOException;
2857 - private final String host;
2858 - private final int port;
2859 - private final String file;
2860 - private final int timeout;
2861 - private ServiceConnection serviceConnection;
2862 -
2863 - public KeepAliveHttpsTransportSE(String host, int port, String file, int timeout) {
2866 - this.host = host;
2867 - this.port = port;
2868 - this.file = file;
2869 - this.timeout = timeout;
2873 @@ -47,11 +37,9 @@ public class KeepAliveHttpsTransportSE extends HttpsTransportSE
2877 - if (serviceConnection == null) {
2878 - serviceConnection = new HttpsServiceConnectionSEIgnoringConnectionClose(host, port,
2879 - file, timeout);
2880 - serviceConnection.setRequestProperty("Connection", "keep-alive");
2881 - }
2884 + serviceConnection.setRequestProperty("Connection", "keep-alive");
2888 diff --git a/ksoap2-j2se/src/main/java/org/ksoap2/transport/ServiceConnectionSE.java b/ksoap2-j2se/…
2890 --- a/ksoap2-j2se/src/main/java/org/ksoap2/transport/ServiceConnectionSE.java
2891 +++ b/ksoap2-j2se/src/main/java/org/ksoap2/transport/ServiceConnectionSE.java
2892 @@ -21,16 +21,16 @@
2896 -import java.io.*;
2897 -import java.net.*;
2898 -import java.util.Iterator;
2899 -import java.util.LinkedList;
2900 -import java.util.List;
2901 -import java.util.Map;
2902 -import java.util.Set;
2903 -
2906 +import java.io.IOException;
2907 +import java.io.InputStream;
2908 +import java.io.OutputStream;
2909 +import java.net.HttpURLConnection;
2910 +import java.net.Proxy;
2911 +import java.net.URL;
2912 +import java.util.*;
2917 @@ -80,23 +80,29 @@ public class ServiceConnectionSE implements ServiceConnection {
2921 - public List getResponseProperties() {
2922 - Map properties = connection.getHeaderFields();
2923 - Set keys = properties.keySet();
2927 - for (Iterator i = keys.iterator(); i.hasNext();) {
2928 - String key = (String) i.next();
2929 - List values = (List) properties.get(key);
2930 -
2931 - for (int j = 0; j < values.size(); j++) {
2932 - retList.add(new HeaderProperty(key, (String) values.get(j)));
2956 @@ -116,6 +122,10 @@ public class ServiceConnectionSE implements ServiceConnection {
2967 --
2968 2.17.0.441.gb46fe60e1d-goog