New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
iOS and Apps All your questions and discussion of iOS or iOS Apps.

View Poll Results:
0 0%
Voters: 0. You may not vote on this poll

How to send HTTPS synchronous request to server using SOAP web services


Post Reply New Thread Subscribe

 
Thread Tools
umeshchalla

 
Member Since: Mar 21, 2012
Posts: 2
umeshchalla is on a distinguished road

umeshchalla is offline
NSString *urlString=@"http://projdemo.com/MobileWebServices/Service.asmx";
soapRequestStr = [self CreateRequest];
NSString* soapAction;
soapAction =@"http://www.projdemo.com/FetchAll";
urlRequest=NULL;
responseData=NULL;
httpBodyData=[soapRequestStr dataUsingEncoding: NSUTF8StringEncoding];
url=[[NSURL alloc]initWithString: urlString];
urlRequest = [NSMutableURLRequest requestWithURL:url];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setHTTPBody:httpBodyData];
[urlRequest setValue:@"projdemo.com" forHTTPHeaderField:@"Host"];
[urlRequest setValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[urlRequest setValueNSString stringWithFormat:@"%d",[soapRequestStr length]]
forHTTPHeaderField:@"Content-Length"];
[urlRequest setValue:soapAction forHTTPHeaderField:@"SOAPAction"];
responseData = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:nil
error:nil];
response = nil;
error = nil;
responseString=NULL;
responseString = [[NSString alloc] initWithData:responseData
encoding:NSASCIIStringEncoding];
NSLog(@"data is %@",responseData);
NSLog(@"Response string is %@",responseString);


soapRequestStr is the XML file formatted string we are going to pass to server. Here its working fine, when URL changed to https its getting response as

Error Response:

<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.2.20 (Ubuntu) Server at projdemo.com Port 443</address>
</body></html>

My problem is how to send soap request to https server
QUOTE Thanks
RavingMac

 
RavingMac's Avatar
 
Member Since: Jan 07, 2008
Location: In Denial
Posts: 7,615
RavingMac has a reputation beyond reputeRavingMac has a reputation beyond reputeRavingMac has a reputation beyond reputeRavingMac has a reputation beyond reputeRavingMac has a reputation beyond reputeRavingMac has a reputation beyond reputeRavingMac has a reputation beyond reputeRavingMac has a reputation beyond reputeRavingMac has a reputation beyond reputeRavingMac has a reputation beyond reputeRavingMac has a reputation beyond repute
Mac Specs: 4GB Mac Mini 2012, 13" MBA, 15" MacBook Pro OSX 10.7, 32 GB iPhone 3GS, iPad2 64gb 3G

RavingMac is offline
POLL Deleted

You will get better response and help by clearly stating your question/request for help at the beginning of your post.

I've always wanted to be smart, handsome and modest. But, I guess I'll have to be satisfied with two out of three . . .
QUOTE Thanks
umeshchalla

 
Member Since: Mar 21, 2012
Posts: 2
umeshchalla is on a distinguished road

umeshchalla is offline
Quote:
Originally Posted by Razormac View Post
POLL Deleted

You will get better response and help by clearly stating your question/request for help at the beginning of your post.
I need to send Synchronous request to https server, i am able to send sync request to http server, but same code is not working for https server
QUOTE Thanks

Post Reply New Thread Subscribe


« App to show iPhone/iPad screen on projector | App for IELTS preparation »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Web page server request problem (online banking) echosa OS X - Apps and Games 0 05-08-2007 11:24 AM
Is godaddy.com anygood? skye Schweb's Lounge 27 02-24-2007 10:19 AM
os x server web cache software? sentofuno OS X - Operating System 2 02-11-2007 02:32 PM
Microsoft Server 2003/ Mac file web hosting Mandysue Web Design and Hosting 1 08-21-2005 12:34 PM
HELP I'm trying to clean out old web site files from server bluerose Web Design and Hosting 8 02-16-2005 09:42 PM

All times are GMT -4. The time now is 06:44 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?