2011-06-23 2 views
0

のためのC#で、このXML応答から値を取得しますが、XML応答である:どのように私はここにWinFormsの

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="somehttp.."> 
     <soap:Body> 
     <get4GAddressResponse xmlns="http://somelink/"> 
      <get4GCAddressResult> 
      <located>true</located> 
      <matchStatus>S</matchStatus> 
      <errorCode>0</errorCode> 
      <message>Single Address Match</message> 
      <addressList> 
       <anyType xsi:type="Address"> 
       <street>4301 some St</street> 
       <city>ABC</city> 
       <state>TX</state> 
       <zip>78751</zip> 
       <longitude>-97.700000</longitude> 
       <latitude>30.308000</latitude> 
       <coverageTypes> 
        <anyType xsi:type="NetworkCoverage"> 
        <type>4G</type> 
        <isCovered>false</isCovered> 
        </anyType> 
       </coverageTypes> 
       </anyType> 
      </addressList> 
      </get4GAddressResult> 
     </get4GAddressResponse> 
     </soap:Body> 
    </soap:Envelope>" 

私は、XML要素から値を取得しようとしています:「覆わ」 私が取得できています値は

<located>true</located> 
      <matchStatus>S</matchStatus> 
      <errorCode>0</errorCode> 
      <message>Single Address Match</message> 

ですが、私はIsCoveredの価値が必要です。

C#コード:

Location result = new TestWebService.Location(); 
    result = get4GAddress(street, city, state, zip); 
        if (result != null) 
        { 
         if (result.errorCode.Equals("0")) 
         { 
          locationresult = new LocationResponse(); 
          locationresult.located = result.located; 
          locationresult.addressList = result.addressList; 
          locationresult.matchStatus = result.matchStatus; 
          locationresult.message = result.message; 
         } 
        } 

答えて

0

あなたの応答ストリームをデシリアライズするためにSoapFormatterを使用することができます。

関連する問題