j2me和ksoap如何获取asp.net webservice中的特定元素
我将 ksoap 与 j2me 一起使用。我将用户名和密码传递给 asp.net Web 服务方法,Web 服务将数据集返回给我。我的问题是我怎样才能 get 从此 ksoap 响应(数据集)获取“显示名称”元素?
<?xml version="1.0" encoding="utf-8" ?>
- <DataSet xmlns="http://tempuri.org/">
- <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="Users">
- <xs:complexType>
- <xs:sequence>
<xs:element name="Userid" type="xs:string" minOccurs="0" />
<xs:element name="Password" type="xs:string" minOccurs="0" />
<xs:element name="DisplayName" type="xs:string" minOccurs="0" />
<xs:element name="Role" type="xs:string" minOccurs="0" />
<xs:element name="Status" type="xs:string" minOccurs="0" />
<xs:element name="SessionId" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="UserAccess">
- <xs:complexType>
- <xs:sequence>
<xs:element name="Refno" type="xs:long" minOccurs="0" />
<xs:element name="UserId" type="xs:string" minOccurs="0" />
<xs:element name="MenuId" type="xs:string" minOccurs="0" />
<xs:element name="Control" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
</DataSet>
I am using ksoap with j2me. I am passing the user name and password to asp.net web service method and the web service returns the dataset to me. My problem is how can I
get Get “Display Name” element from this ksoap response (data set)?
<?xml version="1.0" encoding="utf-8" ?>
- <DataSet xmlns="http://tempuri.org/">
- <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="Users">
- <xs:complexType>
- <xs:sequence>
<xs:element name="Userid" type="xs:string" minOccurs="0" />
<xs:element name="Password" type="xs:string" minOccurs="0" />
<xs:element name="DisplayName" type="xs:string" minOccurs="0" />
<xs:element name="Role" type="xs:string" minOccurs="0" />
<xs:element name="Status" type="xs:string" minOccurs="0" />
<xs:element name="SessionId" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="UserAccess">
- <xs:complexType>
- <xs:sequence>
<xs:element name="Refno" type="xs:long" minOccurs="0" />
<xs:element name="UserId" type="xs:string" minOccurs="0" />
<xs:element name="MenuId" type="xs:string" minOccurs="0" />
<xs:element name="Control" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
</DataSet>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
设置和导航 Soap 对象,如下所示:
您可以使用 SoapObject 方法
You can set
and navigate the Soap Objects using the SoapObject approach, like this: