0
NSString *urlString = @"http://172.29.165.219:8090/abc/services/Abc";
NSString *soapMessage = [NSString stringWithFormat:
@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<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/\">\n"
"<soap:Body>\n"
"<getUserInfo>\n"
"<email>%@</email>\n"
"<pwd>%@</pwd>\n"
"</getUserInfo>\n"
"</soap:Body>\n"
"</soap:Envelope>\n", @"[email protected]",@"UGFzc0AxMjM="//,@"50006F0063006B0065007400500043000000-444556494345454D00",@"PocketPC"
];
NSMutableURLRequest *loginRequest = [RequestGenerator -generateSOAPRequestWithURLString:urlString soapMessage:soapMessage contentType:@"text/xml; charset=utf-8" action:@"getUserInfo"];
WebServiceHandler *connection = [[WebServiceHandler alloc]init];
上面的代碼,它工作正常,但是當我添加額外的標籤作爲父標籤的ID和密碼SOAP消息的錯誤
NSString *urlString = @"http://172.29.165.219:8090/abc/services/Abc";
NSString *soapMessage = [NSString stringWithFormat:
@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<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/\">\n"
"<soap:Body>\n"
"<getUserInfo>\n"
**"<ABC>\n"**
"<email>%@</email>\n"
"<pwd>%@</pwd>\n"
**"</ABC>\n"**
"</getUserInfo>\n"
"</soap:Body>\n"
"</soap:Envelope>\n", @"[email protected]",@"UGFzc0AxMjM="//,@"50006F0063006B0065007400500043000000-444556494345454D00",@"PocketPC"
];
NSMutableURLRequest *loginRequest = [RequestGenerator generateSOAPRequestWithURLString:urlString soapMessage:soapMessage contentType:@"text/xml; charset=utf-8" action:@"getUserInfo"];
WebServiceHandler *connection = [[WebServiceHandler alloc]init];
它顯示異常,出現此錯誤:
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
它甚至不允許我打到服務器。
你試圖使標籤ABC像 ,而不是? –
2011-04-12 12:00:27
在服務器端,你有這個新的標籤識別嗎? – Ravin 2011-04-12 12:04:43