Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-01-2010, 12:57 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2009
Age: 26
Posts: 57
asrekik is on a distinguished road
Default MapKit under Proxy

Hi,
I'm truing to test some application including a MapKit, when i started my appli in the iphone similator, i received this error: server returned error 407. after a little search, i understood that this error is related to proxy

have you any idea that let's mapkit use proxy?
asrekik is offline   Reply With Quote
Old 06-01-2010, 01:46 PM   #2 (permalink)
Registered Member
 
Join Date: Nov 2009
Age: 26
Posts: 57
asrekik is on a distinguished road
Default

I have found a solution, we need to add Credentials to user's keychain
here is my code
Code:
NSURLCredentialStorage * credentialStorage=[NSURLCredentialStorage sharedCredentialStorage]; (1)
NSURLCredential * newCredential;
newCredential=[NSURLCredential credentialWithUser:@"myUserName" password:@"myPWD" persistence:NSURLCredentialPersistencePermanent];(2)
NSURLProtectionSpace * mySpaceHTTP=[[NSURLProtectionSpace alloc] initWithProxyHost:@"ipProxy" port:port type:NSURLProtectionSpaceHTTPProxy realm:nil authenticationMethod:nil];(3)
NSURLProtectionSpace * mySpaceHTTPS=[[NSURLProtectionSpace alloc] initWithProxyHost:@"ipProxy" port:port type:NSURLProtectionSpaceHTTPSProxy realm:nil authenticationMethod:nil];(4)
[credentialStorage setCredential:newCredential forProtectionSpace:mySpaceHTTP];(5)
[credentialStorage setCredential:newCredential forProtectionSpace:mySpaceHTTPS];(6)
I recovered first the sharedCredentialStorage (1), then i created new NSURLCredential containing my user name, password, and the type
of persistence to use (2) . After that I created two NSURLProtectionSpace (3)(4): one for HTTPS Connexion, and one for HTTP Connexion

And finally, i added NSURLCredential the sharedCredentialStorage for these ProtectionSpaces (5)(6)

I hope that this code can help you
asrekik is offline   Reply With Quote
Old 11-09-2011, 09:03 AM   #3 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 3
giusti is on a distinguished road
Default

Quote:
Originally Posted by asrekik View Post
I have found a solution, we need to add Credentials to user's keychain
here is my code
Code:
NSURLCredentialStorage * credentialStorage=[NSURLCredentialStorage sharedCredentialStorage]; (1)
NSURLCredential * newCredential;
newCredential=[NSURLCredential credentialWithUser:@"myUserName" password:@"myPWD" persistence:NSURLCredentialPersistencePermanent];(2)
NSURLProtectionSpace * mySpaceHTTP=[[NSURLProtectionSpace alloc] initWithProxyHost:@"ipProxy" port:port type:NSURLProtectionSpaceHTTPProxy realm:nil authenticationMethod:nil];(3)
NSURLProtectionSpace * mySpaceHTTPS=[[NSURLProtectionSpace alloc] initWithProxyHost:@"ipProxy" port:port type:NSURLProtectionSpaceHTTPSProxy realm:nil authenticationMethod:nil];(4)
[credentialStorage setCredential:newCredential forProtectionSpace:mySpaceHTTP];(5)
[credentialStorage setCredential:newCredential forProtectionSpace:mySpaceHTTPS];(6)
I recovered first the sharedCredentialStorage (1), then i created new NSURLCredential containing my user name, password, and the type
of persistence to use (2) . After that I created two NSURLProtectionSpace (3)(4): one for HTTPS Connexion, and one for HTTP Connexion

And finally, i added NSURLCredential the sharedCredentialStorage for these ProtectionSpaces (5)(6)

I hope that this code can help you

Help, in ios5 does not work anymore..
giusti is offline   Reply With Quote
Old 11-14-2011, 10:32 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 3
giusti is on a distinguished road
Default

up
giusti is offline   Reply With Quote
Old 11-21-2011, 05:45 AM   #5 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 3
giusti is on a distinguished road
Angry

No one has this error?
giusti is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 340
12 members and 328 guests
ajay123123, Anwerbl, ashaman64, baja_yu, ChrisYates, HemiMG, mini998, mottdog, newDev, Objective Zero, pkIDSF, Steven.C
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,878
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:58 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0