我尝试使用 ASIFormDataRequest 请求 wsdl 服务,但没有正确回复。你能请任何人指导我的错吗?
#define SIGNON @"http://smile.stanford.edu:8080/SMILE/spring-ws/StudentSignOn.wsdl"
NSString *Message = [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"
"<stdSignon xmlns=\"http://tempuri.org/\">\n"
"<username>%@</username>\n"
"<password>%@</password>\n"
"</stdSignon>\n"
"</soap:Body>\n"
"</soap:Envelope>\n",txtUserName.text,txtPassword.text];
NSMutableData *soapdata = [[[NSMutableData alloc] initWithData:[Message dataUsingEncoding:NSUTF8StringEncoding]] autorelease];
ASIFormDataRequest *_ASIFormDataRequest = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:SIGNON]];
[_ASIFormDataRequest addRequestHeader:@"Namespace" value:@"http://stanford.edu/smile/studentsignon/schema"];
[_ASIFormDataRequest addRequestHeader:@"Content-Type" value:@"text/xml; charset=utf-8"];
[_ASIFormDataRequest addRequestHeader:@"EndpointURI" value:@"http://stanford.edu/smile/studentsignon"];
[_ASIFormDataRequest setTimeOutSeconds:20];
[_ASIFormDataRequest setPostBody:soapdata];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0
[_ASIFormDataRequest setShouldContinueWhenAppEntersBackground:YES];
#endif
[_ASIFormDataRequest setDelegate:self];
[_ASIFormDataRequest setDidFailSelector:@selector(asyncFail:)];
[_ASIFormDataRequest setDidFinishSelector:@selector(asyncSuccess:)];
[_ASIFormDataRequest startAsynchronous];