0

也许这是一个非常简单的问题,但我没有弄清楚。这个的正确版本是什么?

[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
 ];
4

2 回答 2

1

试试这个:

[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
 ];
于 2012-07-13T09:06:14.003 回答
0

通过以下方式使用它:

[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
      ];
于 2012-07-13T11:14:30.710 回答