对于 Soap NSURLConnection,请确保您的应用支持 IPv6 网络,因为需要兼容 IPv6 [英] For Soap NSURLConnection, Please ensure that your app supports IPv6 networks, as IPv6 compatibility is required

查看:33
本文介绍了对于 Soap NSURLConnection,请确保您的应用支持 IPv6 网络,因为需要兼容 IPv6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 AppStore 提交了我的应用,如果由于以下原因,他们会拒绝.

I've submitted my app in AppStore, they reject if due to following reason.

Hello,

        Thank you for providing this information. Upon further review, we were still unable to login to the app.

        Please note that apps are reviewed on an IPv6 network. Please ensure that your app supports IPv6 networks, as IPv6 compatibility is required.

        For information about supporting IPv6 Networks, refer to Supporting iPv6 DNS64/NAT64 Networks.

        For a networking overview, please see About Networking.

        Best regards,

        App Store Review

我正在使用 SOAP Envelope 服务来使用它,

I am using SOAP Envelope service to use it,

这是我的代码

@property(retain,nonatomic)NSString *xmlString;

@property(nonatomic,retain)NSMutableData *webResponseData;


-(void)method_GetUpcomingLotteries
{

    NSString *soapMessage = [NSString stringWithFormat:@"<?xml version="1.0" encoding="UTF-8"?>
"
                             "<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn:Lottery.Intf-ILottery" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
"
                             "<env:Body>
"
                             "<ns1:GetUpcomingLotteries env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
"
                             "<EntityID xsi:type="xsd:int">2</EntityID>
"
                             "<Password xsi:type="xsd:string">Smart@Winners</Password>
"
                             "<SortBy xsi:type="xsd:int">0</SortBy>
"
                             "<limit xsi:type="xsd:int">0</limit>
"
                             "</ns1:GetUpcomingLotteries>
"
                             "</env:Body>
"
                             "</env:Envelope>"];


    NSURL *sRequestURL = [NSURL URLWithString:@"http://isapi.mekashron.com/soapclient/soapclient.php?"];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:sRequestURL];
    NSString *sMessageLength = [NSString stringWithFormat:@"%d", [soapMessage length]];

    [request addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
    [request addValue: @"urn:Lottery.Intf-ILottery/GetUpcomingLotteries" forHTTPHeaderField:@"SOAPAction"];
    [request addValue: sMessageLength forHTTPHeaderField:@"Content-Length"];

    [request setHTTPMethod:@"POST"];



    [request setHTTPBody:[soapMessage dataUsingEncoding:NSUTF8StringEncoding]];

    NSLog(@"soapMessage===
 %@",soapMessage);

    NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];

    if( theConnection ) {
        NSLog(@"hiii");
        self.webResponseData = [NSMutableData data];
    }else {
        NSLog(@"Some error occurred in Connection");

    }
}



- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    NSLog(@"Received Bytes from server: %lu", (unsigned long)[self.webResponseData length]);

    NSString * strXml = [[NSString alloc] initWithBytes: [self.webResponseData mutableBytes] length:[self.webResponseData length] encoding:NSUTF8StringEncoding];

    NSLog(@"---- %@" ,strXml);



}

-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {

    [self.webResponseData  setLength:0];
}

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

-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
    NSLog(@"Some error in your Connection. Please try again.");


}

我的问题:

1) 请告诉我我需要改变我的方法还是我必须改变服务器端才能将我的 API 从 IPv4 转移到 IPv6?

1) Please tell me do I need to change my method or I've to change the server end to transfer my API from IPv4 to IPv6 ?

2) 在 ios9 下使用 SOAP 方法的 IpV6 代码可以替代 NSURLConnection

2) Code for IpV6 using SOAP method under ios9 that work replacing NSURLConnection

推荐答案

在 WWDC 2015 上,Apple 宣布在 iOS 9 中过渡到仅支持 IPV6 的网络服务.现在从 2016 年 6 月 1 日起,Apple 强制要求该应用程序必须支持iPV6.

At WWDC 2015, apple announced the transition to IPV6-only network services in iOS 9. Now from June 1, 2016 apple has made mandatory that the app should support iPV6.

如果开发者使用Apple提供的NSURLSession和CFNetwork API等标准网络API,应该不会遇到任何问题.否则,您必须将代码移至支持 IPV6 的 API.

If developers use the standard networking APIs like NSURLSession and CFNetwork APIs provided by apple, they should not experience any problem. Otherwise you will have to move your code to the APIs that support IPV6.

如果您正在寻找使用一些标准网络库,如 AFNetworking.根据此站点 AFNetworking 3.0 支持 IPV6.

If you are looking for to use some standard network library like AFNetworking. According to this site AFNetworking 3.0 support IPV6.

Apple 有关于如何测试的文档IPV6 支持.

这篇关于对于 Soap NSURLConnection,请确保您的应用支持 IPv6 网络,因为需要兼容 IPv6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆