title: How to parse SOAP xml response in iPhone programming
body: <p>I am unable to parse soap response,I have tried many ways but not solved my problem,I need the value of USERNAME and PASSWORD.
  I am getting following response after soap request :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"   
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;soap:Body&gt;
  &lt;AuthenticateResponse xmlns="http://tempuri.org/"&gt;
  &lt;AuthenticateResult&gt;
  &lt;DocumentElement&gt;   
  &lt;Status&gt;
  &lt;USERNAME&gt;True&lt;/USERNAME&gt;
  &lt;PASSWORD&gt;true&lt;/PASSWORD&gt;
  &lt;/Status&gt;
  &lt;/DocumentElement&gt;
  &lt;/AuthenticateResult&gt;
  &lt;/AuthenticateResponse&gt;
  &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>Here is my code :</p>
  
  <pre><code>-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *) namespaceURI qualifiedName:(NSString *)qName attributes: (NSDictionary *)attributeDict
  {
  
   if ( [elementName isEqualToString:@"AuthenticateResponse"]||[elementName    
       isEqualToString:@"AuthenticateResult"] || [elementName   isEqualToString:@"DocumentElement"])
   {
   statusArray = [[NSMutableArray alloc] init];
   }
  else if ([elementName isEqualToString:@"Status"])
  {
      authenticate = [[Authenticate alloc] init];
  }
  else if ([elementName isEqualToString:@"USERNAME"])
  {
      currentElementValue = [[NSMutableString alloc] init];
  }
  else if ([elementName isEqualToString:@"PASSWORD"])
  {
      currentElementValue = [[NSMutableString alloc] init];
  }
  
  }
  -(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
  {
  if (currentElementValue) 
  {
      [currentElementValue appendString:string];
  }
  
  }
  
  -(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI: (NSString *)namespaceURI qualifiedName:(NSString *)qName
  {
  
  if( [elementName isEqualToString:@"USERNAME"])
  {
      authenticate.userName = currentElementValue;
  }
  else if ([elementName isEqualToString:@"PASSWORD"])
  {
      authenticate.strAuthenticate = currentElementValue;
  }
   else if ([elementName isEqualToString:@"Status"]) {
       [statusArray addObject:authenticate];
  }
  
  
  }
  </code></pre>
  
  <p>How can i get the values of username and password,can someone help me to parse this.
  Thanks in advance.</p>