Code Monkey home page Code Monkey logo

Comments (28)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Can you confirm that you are happy to license these patches as Apache V2 for 
inclusion and provide your contact details to add to the license file? 

Original comment by [email protected] on 12 Oct 2010 at 6:57

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024

Original comment by [email protected] on 12 Oct 2010 at 6:57

  • Changed state: Started

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Yes, I have no problem licensing the patches as Apache V2. How should I provide 
my contact details?

Original comment by [email protected] on 20 Oct 2010 at 7:57

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Just your full name and email address to add to the license.txt file. You can 
email me personally instead of posting here.

Original comment by [email protected] on 21 Oct 2010 at 4:42

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024

Original comment by [email protected] on 21 Oct 2010 at 4:42

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Applied patch to github: 
http://github.com/mosabua/ksoap2-android/commit/a5231af66fad440a0ade78dce5ba4ac0
e954abb0

It will make it out with the next release. Can you verify it works for you in 
the meantime?

Original comment by [email protected] on 22 Oct 2010 at 3:55

  • Changed state: Fixed

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Yes, I will verify it on this ongoing week. I will let you know on 
Saturday-Sunday. I have mailed you my contact details.

Thank you!

Original comment by [email protected] on 4 Nov 2010 at 7:07

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
You are already in the license file and this patch went out with the last 
release. 2.5.2

Original comment by [email protected] on 4 Nov 2010 at 7:13

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Ok, there is no problem. Sorry for the late response. I will update and start 
using the official release.

Thank you again!

Original comment by [email protected] on 4 Nov 2010 at 7:25

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
No problem. Thank you. Keep the patches coming ;-)

Original comment by [email protected] on 4 Nov 2010 at 7:56

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Is this patch already released and does it work fine? Do I need to do anything 
special to get rid of <Item> tag while serializing vectors? I tried 2.5.2 and 
2.5.4 and I still get <Item> tag while serializing vector and that throws off 
JAXWS based webservice on the server side. Please advise...

Original comment by [email protected] on 12 Apr 2011 at 4:10

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Is this patch already released and does it work fine? Do I need to do anything 
special to get rid of <Item> tag while serializing vectors? I tried 2.5.2 and 
2.5.4 and I still get <Item> tag while serializing vector and that throws off 
JAXWS based webservice on the server side. Please advise...

Original comment by [email protected] on 12 Apr 2011 at 4:11

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Is this patch already released and does it work fine? Do I need to do anything 
special to get rid of <Item> tag while serializing vectors? I tried 2.5.2 and 
2.5.4 and I still get <Item> tag while serializing vector and that throws off 
JAXWS based webservice on the server side. Please advise...

Original comment by [email protected] on 12 Apr 2011 at 4:11

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Is this patch already released and does it work fine? Do I need to do anything 
special to get rid of <Item> tag while serializing vectors? I tried 2.5.2 and 
2.5.4 and I still get <Item> tag while serializing vector and that throws off 
JAXWS based webservice on the server side. Please advise...

Original comment by [email protected] on 12 Apr 2011 at 4:12

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
First of all, this patch was intended for .NET server, although it may work for 
servers based on php, java, etc.

When you create your envelope your envelope, specify that you are using a 
dotNet server and you are using implicitTypes:

SoapSerializationEnvelope envelope = new 
SoapSerializationEnvelope(SoapSerializationEnvelope.VER11);
envelope.dotNet = true;
envelope.implicitTypes = true;

Lastly, when you add your object to the envelope, you should add it with the 
help of PropertyInfo class like this:

PropertyInfo pi = new PropertyInfo();
pi.setName("NameOfTheTagForYourVector");
pi.setValue(YourVector);
pi.setType(PropertyInfo.VECTOR_CLASS); 
pi.elementType = new PropertyInfo();
pi.elementType.type = YourVectorItemsClass.class;
pi.elementType.name = "NameOfTheTagForTheItems"; // <-- This is what will be 
sent in the output instead of the "<Item>".
yourRequest.addProperty(pi); 

That should print "NameOfTheTagForTheItems" instead of "Item" on the child 
nodes of the vector.


Original comment by [email protected] on 12 Apr 2011 at 4:46

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
[deleted comment]

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
How do I do this if I am passing object A with embedded vector of Object B in A?

Original comment by [email protected] on 12 Apr 2011 at 5:31

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
In my example, I was adding an array in the toplevel of the request. If you 
have a soap object that contains an array inside, the code is exactly the same. 
The only difference is that instead calling "yourRequest.addProperty(pi);" you 
call "yourSoapObject.addProperty(pi)";

If you are implementing KmlSerializable, you should add this to the 
getPropertyInfo method of your class.

Original comment by [email protected] on 12 Apr 2011 at 7:47

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
[deleted comment]

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Can you please give me a quick snippet of getPropertyInfo with two vectors 
embedded into the top level object? I am still not clear as "yourSoapObject" in 
your comment above does not seem to have "addProperty"" method. That's really 
my top level object which is KmlSerializable.

Original comment by [email protected] on 12 Apr 2011 at 8:54

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
I only use this on one of my objects, and my class that implements 
KmlSerializable has only one vector, and the method getPropertyInfo is as 
follows:

    public Vector<PointSerializable> Vertices;

    public void getPropertyInfo(int idx, Hashtable hash, PropertyInfo propInfo) {
        Field f = this.getClass().getFields()[idx];

        propInfo.name = f.getName();
        propInfo.type = f.getType();

        PropertyInfo arrType = new PropertyInfo();
        arrType.name = "point";
        arrType.type = PointSerializable.class;
        arrType.namespace "businessNS";
        propInfo.elementType = arrType;
    }

This is exactly as I have implemented the code (I copied and pasted the method) 
on a class implementing KmlSerializable with only ONE attribute. If your class 
has more attributes, you only need to make a switch on "idx" and fill propInfo 
with the correct data for every case.

Hope this is more clear. If not, feel free to ask more details.

Original comment by [email protected] on 12 Apr 2011 at 9:04

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
If you could please see attached the code and let me know what i am doing 
wrong. 
I am expecting this in the body:
<person><contacts<kind>Phone</kind><type>Home</type><value>4809998888</value><pr
eferred 
i:type="d:boolean">false</preferred></contacts><company>MyCo</company><displayNa
me>MyDisplayName</displayName><firstName>F222</firstName><lastName>L222</lastNam
e><middleName/><modifiedDate/><personId></person>

-----------------------------

But getting something like this: Notice double <contacts> tags...that's the 
major issue.

<person><contacts 
c:arrayType="d:anyType[1]"><contacts><kind>Phone</kind><type>Home</type><value>4
809998888</value><preferred 
i:type="d:boolean">false</preferred></contacts></contacts><addresses 
c:arrayType="d:anyType[0]" 
/><company>MyCo</company><displayName>MyDisplayName</displayName><firstName>F222
</firstName><lastName>L222</lastName><middleName i:null="true" /><modifiedDate 
i:null="true" /><personId i:null="true" /></person>

Original comment by [email protected] on 12 Apr 2011 at 9:40

Attachments:

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
In the output you provided, kSoap is working correctly. My provided patch was 
done to work this way.

As far I know, vector support in kSoap (I think that this should be confirmed 
by the project owner) was included to generate an output like this:

<object>
 <vectorItemsContainer>
  <vectorItem1/>
  <vectorItem2/>
  [...]
  <vectorItemN/>
 </vectorItemsContainer>

 <attribute1/>
 <attribute2/>
 [...]
 <attributeN/>
</object>

But... I understand that you want an output like this (ommiting the container 
for the items of the vector):

<object>
 <vectorItem1/>
 <vectorItem2/>
 [...]
 <vectorItemN/>

 <attribute1/>
 <attribute2/>
 [...]
 <attributeN/>
</object>

Sorry, but this goes out of the scope of vector support in kSoap (again, this 
should be confirmed by the project owner).

You can obtain the output that you need, but you need to do another kind of 
tricks in your Person class.


Original comment by [email protected] on 13 Apr 2011 at 3:33

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Thanks for the response. I dont think I want to ommit the container. As you can 
see 
I want something like below where "contacts" is the vercor container. It is 
just that I am not able to achieve that with the example that you provided. Can 
you please give me a better code snippet that will work for me? 

<person><contacts<kind>Phone</kind><type>Home</type><value>4809998888</value><pr
eferred 
i:type="d:boolean">false</preferred></contacts><company>MyCo</company><displayNa
me>MyDisplayName</displayName><firstName>F222</firstName><lastName>L222</lastNam
e><middleName/><modifiedDate/><personId></person>

Original comment by [email protected] on 13 Apr 2011 at 4:23

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
On line 56 of your attached code, I would put arrType.name = "contact"; or 
arrType.name = "personContact", or whatever. This will remove the duplicate 
"contacts" tag. However, the output will be:

<person>
 <contacts>
  <personContact>
   <kind>Phone</kind>
   <type>Home</type>
   [...]
  </personContact>
  <personContact>
   <kind>Phone</kind>
   <type>Work</type>
   [...]
  </personContact>

  [... More contacts ...]
 </contacts>

 [...More fields...]
</person>

If the node "contacts" is the vector container (the one you say want to have in 
the output), then, there still remains the "personContact" tags. If you don't 
want these tags, you are removing the nodes that identify and delimit each item 
on the vector, which (again) is not possible with kSoap vector support. 

I don't know how you want your output if the vector contains more than one item 
(contact). You are giving an example of how it should be if the vector contains 
only one item. If your vector won't contain more than one item, simply don't 
use a vector and you will have your needed output. 


Original comment by [email protected] on 13 Apr 2011 at 4:59

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
So here is the working request going out from JAXWS generated client and that 
works. Notice there are two contacts going out. How do I achieve this?

<?xml version="1.0" ?><S:Envelope 
xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:addPerson 
xmlns:ns2="http://test/"><accountID>123456</accountID><person><firstName>NB1</fi
rstName><lastName>NB2</lastName><contacts><kind>Phone</kind><value>5556667777</v
alue><type>Work</type><preferred>true</preferred></contacts><contacts><kind>Phon
e</kind><value>5556667777</value><type>Work</type><preferred>true</preferred></c
ontacts></person></ns2:addPerson></S:Body></S:Envelope>

Original comment by [email protected] on 13 Apr 2011 at 5:10

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Your JAXWS generated client is effectively ommiting the node that acts as a 
container for the items of the vector. This is what I tried to explain in the 
comment #23, and you said you don't want to do on comment #24.

Sorry, but you can't get this output from kSoap using KmlSerializable and 
Vectors. You will need to use some tricks to get this request using 
KmlSerializable. Another option is use SoapObject class instead of implementing 
KmlSerializable.

I haven't needed the output for vectors like this, so I don't have any code to 
make suggestions to include in your Person class, and it is not very trivial. 
Sorry for not being able to help you too much.

On the other hand, SoapObject class is so easy to use, that I don't think you 
need too much help to achieve what you need. Just try first!

Please, note that this "Issues" list is for placing queries about potential 
problems (defects, errors, enhacements, etc) with the kSoap library, not for 
asking how to use kSoap. I have been answering having in mind that my patch may 
be causing an error and may have a bug, but it is clear that it isn't and the 
thread has gone out of scope. So, I think that I shouldn't answer anymore to 
you question on "how to achieve your required request".

If you need to ask more questions, please use any forum that you can find on 
the Internet. In forums, there is much more people that can help (including 
me). Here are only the mantainers of the project.

If you believe that kSoap should support vectors on the way require, please 
open a new Issue to see if it is approved. 


Original comment by [email protected] on 13 Apr 2011 at 6:56

from ksoap2-android.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 3, 2024
Sir,i am new to android and want to know how to implement the above code in my 
application in order to call .Net webservice in my application.
Thanks in advance

Original comment by [email protected] on 14 Oct 2011 at 6:56

from ksoap2-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.