【发布时间】:2011-02-15 10:22:54
【问题描述】:
我正在使用 Web 服务来根据特殊的公司编号呈现公司信息。 但我无法从响应 SOAP 消息中获取数据。 您可以看到响应肥皂消息的示例。 (我在标签上省略了一些公司信息)。
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<businessGetDossierV3Response xmlns="http://www.webservices.nl/soap/">
<out>
<paging>
<curpage>1</curpage>
<perpage>10</perpage>
<numpages>1</numpages>
<numresults>1</numresults>
<maxresults>100</maxresults>
</paging>
<results>
<item>
<DossierNo></DossierNo>
<SubDossierNo></SubDossierNo>
<ChamberNo></ChamberNo>
<Legalformcode></Legalformcode>
<LegalformcodeText></LegalformcodeText>
<Tradename45></Tradename45>
<EstablishmentPostcode></EstablishmentPostcode>
<EstablishmentCity></EstablishmentCity>
<EstablishmentStreetname></EstablishmentStreetname>
<EstablishmentHouseNo></EstablishmentHouseNo>
<CorrespondencePostcode></CorrespondencePostcode>
<CorrespondenceCity></CorrespondenceCity>
<CorrespondenceStreetname></CorrespondenceStreetname>
<CorrespondenceHouseNo></CorrespondenceHouseNo>
</item>
</results>
</out>
</businessGetDossierV3Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
!这是我在演示客户端上看到的结果! 但这是我在 C# 中的代码
nl.webservices.ws1.BusinessDossierV3PagedResult result = null;
result = myserviceBusiness.businessGetDossierV3(KVKnr, "0000", 1);
我想做这样的事情(但用结果而不是分页部分)
int page = result.paging.numpages;
那我想我应该是这样的
string city = result.results.item.CorrespondenceCity;
但这是给出错误信息
所以在 Visual Studio 2010 中,我只能检索 xml 分页部分中的数据并将其放入文本框中,但不能从结果部分中检索。这是因为结果部分是某种集合吗?
是的,我怎样才能将标签 EstablishmentPostcode 和 EstablishmentCity 中的数据放入默认页面的文本框中?
提前致谢
【问题讨论】:
标签: c# asp.net web-services soap