Closed GoogleCodeExporter closed 9 years ago
To build the code you just have to run
mvn clean install
in the root of the project. A patch would be great..
Original comment by mosa...@gmail.com
on 2 Aug 2011 at 5:59
I've managed to fix the main issue of the c:arrayType="c:Array[1]" attribute,
but i cant seem to get rid of the i:type="d:string" attribute. but since its
not actually breaking anything the only reason i can see to remove it is so the
xml looks clean and all the tags are formatted the same way when implicitTypes
is true. I have a couple more functions to test with before I send the file
over. I should be done in the next few days. Thanks for your help.
Original comment by jwLindem...@gmail.com
on 2 Aug 2011 at 2:29
Great. Send it as a patch file or as pull request on github. Whatever you
prefer? Ideally with some tests and also you contact details for the license
file.
Original comment by mosa...@gmail.com
on 2 Aug 2011 at 5:19
Original comment by mosa...@gmail.com
on 2 Aug 2011 at 5:19
https://github.com/mosabua/ksoap2-android/pull/8 should fix this and will be
released with 2.5.8 coming up, please test from the github master branch and
confirm
Original comment by mosa...@gmail.com
on 23 Aug 2011 at 5:07
I deleted my local copy of files and got a fresh copy from github, everything
seems to be working correctly.
Original comment by jwLindem...@gmail.com
on 25 Aug 2011 at 1:18
Original comment by mosa...@gmail.com
on 26 Aug 2011 at 5:34
I have a similar problem (with ver. 2.6.4). I must send an array of custom
objects to a .NET 4.0 WebService and the less verbose SOAP envelope I succeeded
to get is the following:
<v:Envelope xmlns:i="http://www.w3.org/1999/XMLSchema-instance"
xmlns:d="http://www.w3.org/1999/XMLSchema"
xmlns:c="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header/>
<v:Body>
<SetDeliveries xmlns="http://tempuri.org/">
<n0:deliveries i:type="c:Array" xmlns:n0="http://tempuri.org/">
<n1:InputDeliveryInfo xmlns:n1="http://schemas.datacontract.org/2004/07/onPostServer">
<n1:Code>AD00001</n1:Code>
<n1:DeliveryDate>2012-05-23T11:29:17.904Z</n1:DeliveryDate>
<n1:Latitude>0.0</n1:Latitude>
<n1:Longitude>0.0</n1:Longitude>
<n1:Recipient>serf</n1:Recipient>
<n1:Status>0</n1:Status>
</n1:InputDeliveryInfo>
<n2:InputDeliveryInfo xmlns:n2="http://schemas.datacontract.org/2004/07/onPostServer">
<n2:Code>AD00002</n2:Code>
<n2:DeliveryDate>2012-05-23T07:12:48.678Z</n2:DeliveryDate>
<n2:Latitude>0.0</n2:Latitude>
<n2:Longitude>0.0</n2:Longitude>
<n2:Recipient>giivanni</n2:Recipient>
<n2:Status>0</n2:Status>
</n7:InputDeliveryInfo>
</n0:deliveries>
</SetDeliveries>
</v:Body>
</v:Envelope>
The namespace declaration is added to every item of the array (useless and too
verbose). The only way I have to make the server accept the data is to use
VER10 otherwise I get a parsing error because KSOAP2 does not remove the
attribute i:type="c:Array" in <deliveries>. The java code that produces the
SOAP envelope above is the following:
SoapObject request = new SoapObject(wsai.getNamespace(),
WSAccessInfo.methodSendDeliveries);
HttpTransportSE androidHttpTransport = new HttpTransportSE(wsai.getURL());
androidHttpTransport.debug = true;
MarshalDate mdate = new MarshalDate();
MarshalFloat mfloat = new MarshalFloat();
PropertyInfo pInfo = new PropertyInfo();
pInfo.setName("deliveries");
pInfo.setValue(listDeliveriesWSO);
pInfo.setNamespace(wsai.getNamespace());
pInfo.setType(Object.class);
pInfo.elementType = new PropertyInfo();
pInfo.elementType.type = DeliveryInfoWSO.class;
pInfo.elementType.name = "InputDeliveryInfo";
pInfo.elementType.namespace =
"http://schemas.datacontract.org/2004/07/onPostServer";
request.addProperty(pInfo);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope
SoapEnvelope.VER10);/*If I set VER12 I get an exception (strange behavior). If
I set VER11 the sttibute i:type causes the server to return an unknown type
error (and it is right...ksoap2 is faulty)*/
mdate.register(envelope);
mfloat.register(envelope);
envelope.avoidExceptionForUnknownProperty = true;
envelope.dotNet = true;
envelope.implicitTypes = true;
envelope.setAddAdornments(false);
envelope.setOutputSoapObject(request);
envelope.addMapping(wsai.getNamespace(),
wsai.getMethosReturnTypeName(WSAccessInfo.methodSendDeliveries),
new DeliveryInfoWSO().getClass());
androidHttpTransport.call(wsai.getAction(WSAccessInfo.methodSendDeliveries),
envelope);
ksoap2 should produce as less verbose XML as possible instead it generates and
adds useless and verbose attributes and namespaces. For a mobile device with
limited resources that is not exactly waht we would like to get
Original comment by sergio.b...@gmail.com
on 23 May 2012 at 3:07
Please do not comment on closed issues but rather create a new one. Also if you
want to improvements making the requeste lighter feel free to do so and send a
pull request on github.
Original comment by mosa...@gmail.com
on 23 May 2012 at 6:57
Sorry, but I'm not commenting a closed issue...it is very open indeed. In fact
I have the last version of ksoap2 and the problem is still present.
Original comment by sergio.b...@gmail.com
on 24 May 2012 at 7:26
This issue is verified/closed... it was closed in August last year. Please
create a new one and maybe link to this one..
Original comment by mosa...@gmail.com
on 24 May 2012 at 4:08
Original issue reported on code.google.com by
jwLindem...@gmail.com
on 1 Aug 2011 at 1:43