具有多个参数值的 ksoap2 属性信息?
我在 android 中的应用程序中使用 ksoap2 。 我正在发送复杂类型,但我有一个问题: 现在我正在做:
UriList urlL = new UriList();
urlL.uriList= "#literal";
PropertyInfo pi = new PropertyInfo();
pi.setName("documents");
pi.setValue(urlL);
pi.setType(UriList.class);
sobj.addProperty(pi);
这给了我一个肥皂请求,看起来像:
<文件>
< uriList>#literal< /uriList>
< /documents>
如果我想多次重复
怎么办? uriList> ?即:
<文件>
< uriList>#literal< /uriList>
< uriList>#literal2< /uriList>
< uriList>#literal3< /uriList>
< /documents>
我怎样才能在 ksoap2 中做到这一点?
感谢您的帮助:)
i am using ksoap2 for my application in android.
i am sending complex types, but i have a question:
right now i am doing :
UriList urlL = new UriList();
urlL.uriList= "#literal";
PropertyInfo pi = new PropertyInfo();
pi.setName("documents");
pi.setValue(urlL);
pi.setType(UriList.class);
sobj.addProperty(pi);
this gives me a soap request that will look like:
< documents>
< uriList>#literal< /uriList>
< /documents>
what if i want to have several repetition of < uriList> ? ie:
< documents>
< uriList>#literal< /uriList>
< uriList>#literal2< /uriList>
< uriList>#literal3< /uriList>
< /documents>
how can i do that in ksoap2?
thanks for the help :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过将参数 urllist - 在实现 kvmserialized- 的类中作为列表来修复此问题,并且它有效
i fixed this by doing the paramter urlist -in the class that implements kvmserializable- as a list and it worked
当我必须做同样的事情时,我使用了envelope.addMapping()函数。几乎您创建了一个实现 KvmSerialized 的对象,并在参数中保存您想要的所有数据。它会为您添加项目。
您可以在以下网站上找到有关它的更多信息:http://seesharpgears.blogspot.com/2010/10/ksoap-android-web-service-tutorial-with.html
I used the envelope.addMapping() function when I had to do the same thing. Pretty much you create an object that implements KvmSerializable and holds all the data you want in the Parameter. It will take care of adding the items for you.
You can find more info about it on the following site: http://seesharpgears.blogspot.com/2010/10/ksoap-android-web-service-tutorial-with.html