gpt4 book ai didi

iphone - iphone中的休息网络服务

转载 作者:行者123 更新时间:2023-12-01 17:27:52 25 4
gpt4 key购买 nike

我现在有个问题。我需要将一个 transactionID 和一个用户密码传递给一个休息服务,它应该返回一个真/假值(以 XML 格式)。但是,它一直在返回我(null)。我完全失去了一些人请帮助。

    NSString *urlString = [NSString stringWithFormat:@"https://10.124.128.93:8443/axis2/services/C3WebService/completeWithdrawal  Transaction?transactionId=%@&password=%@", _transactionID.text, _userPassword.text];

NSURL *url = [[NSURL alloc] initWithString:urlString];
NSString *result = [[NSString alloc] initWithContentsOfURL:url];


NSLog(@"%@",result );

我的结果总是让我返回 null。我如何从这里继续?

最佳答案

.h:
NSMutableData *responseData;

.m:
- (void)load {
NSURL *myURL = [NSURL URLWithString:@"https://10.124.128.93:8443/axis2/services/C3WebService/completeWithdrawal Transaction?transactionId=%@&password=%@", _transactionID.text, _userPassword.text];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:myURL
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
timeoutInterval:60];

[[NSURLConnection alloc] initWithRequest:request delegate:self];
}

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
responseData = [[NSMutableData alloc] init];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[responseData appendData:data];
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
[responseData release];
[connection release];
[textView setString:@"Unable to fetch data"];
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSLog(@"Succeeded! Received %d bytes of data",[responseData
`enter code here` length]);
NSString *txt = [[[NSString alloc] initWithData:responseData encoding: NSASCIIStringEncoding] autorelease];

}

关于iphone - iphone中的休息网络服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7269780/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com