Changes from 2.6.0 to 2.6.1

14 views
Skip to first unread message

Manfred Moser

unread,
Jan 20, 2012, 7:33:24 PM1/20/12
to ksoap2-...@googlegroups.com
Hi all!


This is mostly a question for Andrew but might be worth for others to know about.

I am assembling my requests building a SoapObject tree.

E.g. I build my SoapObject like this

SoapObject salesOrderSoap = new SoapObject(NAMESPACE, "NewSalesOrder");

and then add it to the request like this

request.addProperty("SalesOrder", salesOrderSoap);

Now I noticed that add property seems to ignore the first parameter with 2.6.1 since I get

<v:Body>
<SubmitOrder xmlns="http://...">
<n2:NewSalesOrder xmlns:n2="http://..">

rather than

<v:Body>
<SubmitOrder xmlns="http://..">
<SalesOrder i:type="n2:NewSalesOrder" xmlns:n2="http://..">

I noticed in the changelog and pull request that  SoapSerializationEnvelope#writeObjectBody as well as 
SoapObject#setProperty and newInstance changed. 

Is my guess right that those will most likely be the culprit? Wanna see if you can fix it? 

I might be able to look at it next week, but in general I think we need to ensure that the requests stay as they were before. 

I am hoping to be able to fix this (assuming you all agree that this is wrong) and release a new version soon.

manfred

Andrew Oppenlander

unread,
Jan 20, 2012, 7:39:37 PM1/20/12
to ksoap2-...@googlegroups.com
Most likely it has to do with SoapSerializationEnvelope#writeObjectBody. I will take a look at it tonight. Could you send me exactly what you're trying to build the object with?
--
Andrew Oppenlander

Manfred Moser

unread,
Jan 20, 2012, 7:46:31 PM1/20/12
to ksoap2-...@googlegroups.com
The above is pretty much it.. just lots more nested.. but the above already drops it. Notice how NewSalesOrder and SalesOrder are different.. 

For the envelope I just use

 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            envelope.dotNet = true;
            envelope.headerOut = security;
            envelope.encodingStyle = SoapEnvelope.ENC;
            envelope.setAddAdornments(false);

Hope that helps enough... gotta run now. More tonight.. 

manfred

Andrew Oppenlander

unread,
Jan 20, 2012, 8:55:35 PM1/20/12
to ksoap2-...@googlegroups.com
From the looks of it writing nested SoapObject has worked like that since I implemented it. I will need to dive a bit deeper into the code to get a fix. 
--
Andrew Oppenlander

Andrew Oppenlander

unread,
Jan 20, 2012, 10:24:00 PM1/20/12
to ksoap2-...@googlegroups.com
Completed a fix for it. I basically just changed the write tag to write it the same as PropertyInfo properties.
Let me know if this is what you were looking for.
For anyone interested, here is my git repo with a download link.
--
Andrew Oppenlander

Manfred Moser

unread,
Jan 21, 2012, 4:48:20 PM1/21/12
to ksoap2-...@googlegroups.com
Thanks. That seems to have worked although I am not sure why your patch specifies dotNet .. will have to look closer at some stage.

Currently I get failures from the same upgrade with arrays. 

It seem the name of an array is dropped e.g. with 2.6.0 my code generated 

 <Details i:type="n2:ArrayOfDetailBase">
                <Detail i:type="n2:DetailBase">
                    <PartNumber i:type="d:string">1050-1017-ND</PartNumber>
                    <Quantity i:type="d:string">5</Quantity>
                </Detail>
            </Details>

but now with 2.6.1. it generates 

  <ArrayOfDetailBase i:type="n2:ArrayOfDetailBase">
                <DetailBase i:type="n2:DetailBase">
                    <PartNumber i:type="d:string">1050</PartNumber>
                    <Quantity i:type="d:string">1</Quantity>
                </DetailBase>
            </ArrayOfDetailBase>

It some how drops the "Details" and autogenerates ArrayOfDetailBase... not sure yet where it does that.

It looks like the public Object getProperty(int index)  in SoapObject still has the correct data in the PropertyInfo but it takes the value of it only there and the value has the generated ArrayOfDetailBase and the "Details" in the name field of the PropertyInfo is dropped/ignored. Seems like the SoapObject is generated wrongly when added or so.

Not sure yet... I will have to dig further. Any hints or ideas appreciated.. 

manfred

Reply all
Reply to author
Forward
0 new messages