Daedelus
Daedelus

Reputation: 266

SOAP request format in objective c

Maybe this is a very easy question but i didn't figure it out. What is the correct version of this?

[NSString stringWithFormat:
 @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
 "<soap:Envelope 
 xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" 
 xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" 
 xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
 "<soap:Body>"
 "<GetQuote 
 xmlns=\"http://www.webserviceX.NET/\">"
 "<symbol>%@</symbol>"
 "</GetQuote>"
 "</soap:Body>"
 "</soap:Envelope>",
 textBox.text
 ];

Upvotes: 0

Views: 441

Answers (2)

Apurv
Apurv

Reputation: 17186

Use it by below way:

[NSString stringWithFormat:
      @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
      "<soap:Envelope "
      "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
      "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" 
      "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
      "<soap:Body>"
      "<GetQuote "
      "xmlns=\"http://www.webserviceX.NET/\">"
      "<symbol>%@</symbol>"
      "</GetQuote>"
      "</soap:Body>"
      "</soap:Envelope>",
      textBox.text
      ];

Upvotes: 0

kimar
kimar

Reputation: 211

Try this one:

[NSString stringWithFormat:
 @"<?xml version=\"1.0\" encoding=\"utf-8\"?>
 <soap:Envelope 
 xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" 
 xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" 
 xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
 <soap:Body>
 <GetQuote 
 xmlns=\"http://www.webserviceX.NET/\">
 <symbol>%@</symbol>
 </GetQuote>
 </soap:Body>
 </soap:Envelope>",
 textBox.text
 ];

Upvotes: 1

Related Questions