Facebook
From HarryPalheta, 1 Year ago, written in C#.
Embed
Download Paste or View Raw
Hits: 128
  1. using System;
  2. using System.Text.RegularExpressions;
  3.                                        
  4. public class Program
  5. {
  6.         public static void Main()
  7.         {
  8.                
  9.                 string pattern = @"<b:ProductKeyStateID>.*</b:ProductKeyStateID>";
  10.  
  11.                 string input = RequestResult();
  12.         RegexOptions options = RegexOptions.Multiline;
  13.        
  14.         foreach (Match m in Regex.Matches(input, pattern, options))
  15.         {
  16.             Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
  17.         }
  18.         }
  19.        
  20.         static String RequestResult(){
  21.         string input = @"
  22. --uuid:572ea376-67c5-4d00-bffd-549fc02b77d4+id=28
  23. Content-ID: <http://tempuri.org/0>
  24. Content-Transfer-Encoding: 8bit
  25. Content-Type: application/xop+xml;charset=utf-8;type=application/soap+xml
  26.  
  27. <s:Envelope xmlns:s=http://www.w3.org/2003/05/soap-envelope xmlns:a=http://www.w3.org/2005/08/addressing><s:Header><a:Action s:mustUnderstand=1>http://tempuri.org/IOA30FFKIWCF/GetDPKStatusByWIP_SNResponse</a:Action></s:Header><s:Body><GetDPKStatusByWIP_SNResponse xmlns=http://tempuri.org/><GetDPKStatusByWIP_SNResult xmlns:b=com.compal.oa30 xmlns:i=http://www.w3.org/2001/XMLSchema-instance><b:Customer_Code i:nil=true/><b:ErrorDescription/><b:OEMPartNumber i:nil=true/><b:Plant_Code i:nil=true/><b:Product i:nil=true/><b:ProductKey>MBWCR-43N77-6GDK6-KQV6T-PDK2M</b:ProductKey><b:ProductKeyID>3424334527449</b:ProductKeyID><b:ProductKeyStateID>3</b:ProductKeyStateID><b:Status>true</b:Status><b:WIP_SN>4003189900003</b:WIP_SN></GetDPKStatusByWIP_SNResult></GetDPKStatusByWIP_SNResponse></s:Body></s:Envelope>
  28. --uuid:572ea376-67c5-4d00-bffd-549fc02b77d4+id=28--
  29. ";
  30.                 return input;
  31.         }
  32.        
  33. }

Replies to XML rss

Title Name Language When
Re: XML Funky Leech dos 1 Year ago.
Re: XML Gamboge Cheetah csharp 1 Year ago.