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 07-14-2011, 01:48 AM   #1 (permalink)
Registered Member
 
ngaikwad's Avatar
 
Join Date: Feb 2011
Location: Mobile World
Posts: 450
ngaikwad is on a distinguished road
Default WSDl SOAP iPhone connection

hi all,

i want to call wsdl soap service on iphone so can any one help me.
i go through this Link but there no use. the request cant hit on server. and no response get.
please help me
__________________
Thank & Regard
NI3(Not Impossible 3)
ngaikwad is offline   Reply With Quote
Old 07-14-2011, 01:49 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

read this tutorial WebService [How-To]
__________________
dany_dev is offline   Reply With Quote
Old 07-14-2011, 01:56 AM   #3 (permalink)
Registered Member
 
ngaikwad's Avatar
 
Join Date: Feb 2011
Location: Mobile World
Posts: 450
ngaikwad is on a distinguished road
Default

hi dany
I read all that also implement but when run the application i dont get error as well as output also no request hit to server i run log on server to check that

so do you have any tutorial for this
__________________
Thank & Regard
NI3(Not Impossible 3)
ngaikwad is offline   Reply With Quote
Old 07-14-2011, 02:26 AM   #4 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

post the code that you tried....i will take a look.
__________________
dany_dev is offline   Reply With Quote
Old 07-14-2011, 03:36 AM   #5 (permalink)
Registered Member
 
ngaikwad's Avatar
 
Join Date: Feb 2011
Location: Mobile World
Posts: 450
ngaikwad is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
post the code that you tried....i will take a look.

Code:
//this is my request which i send 
	Soapmessage=@"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><checkone><CardType Name=\"Gift\" Method=\"Send\" AppVersion=\"5.1\"><GiftCardInfo><GiftCardNo>7800000000000000161</GiftCardNo><AccessCode>266217</AccessCode></GiftCardInfo></CardType></checkone>";
//this is the soap envelop
	NSMutableString *sreqiset=[[NSMutableString alloc]init];
	[sreqiset appendString:@"<?xml version=\"1.0\" encoding\"utf-8\"?>"];
	[sreqiset appendString:@"<soap:envelop xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.zmlsoap.org/soap/envelope/\">"];
	[sreqiset appendString:@"<soap:Body>"];
	[sreqiset appendString:@"<giftcard xmlns=\"http://10.20.10.225:8081/MyWebService/\">"];
	[sreqiset appendString:@"<request>"];
	[sreqiset appendString:Soapmessage];
	[sreqiset appendString:@"</request>"];
	[sreqiset appendString:@"</giftcard>"];
	[sreqiset appendString:@"</soap:Body>"];
	[sreqiset appendString:@"<soap:Envelope>"];
	


	
	
	NSURL *url=[NSURL URLWithString:@"http://10.20.10.225:8081/MyWebService/"];
	NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:url];
	//  NSString *msglength=[NSString stringWithFormat:@"%d",[Soapmessage length]];
	
	
	[theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
	[theRequest addValue: @"http://10.20.10.225:8081/MyWebService/GiftCard" forHTTPHeaderField:@"SOAPAction"];
	//   [theRequest addValue: msglength forHTTPHeaderField:@"Content-Length"];
	[theRequest setHTTPMethod:@"POST"];
	[theRequest setHTTPBody: [sreqiset dataUsingEncoding:NSUTF8StringEncoding]];
	//NSLog(theRequest);
	NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
	
	if( theConnection )
	{
		webData = [[NSMutableData data] retain];
		//NSLog(@"-----------",webData);
	}
	else
	{
		NSLog(@"theConnection is NULL");
	}
	[NSURLConnection connectionWithRequest:theRequest delegate:self];
	NSError *werror;
	NSURLResponse *wresponse;
	NSMutableData *dataa;
	dataa=[NSURLConnection sendSynchronousRequest:theRequest returningResponse:&wresponse error:&werror];
//	NSLog(werror);
//	NSLog(wresponse);
any help
__________________
Thank & Regard
NI3(Not Impossible 3)

Last edited by ngaikwad; 07-15-2011 at 04:06 AM.
ngaikwad is offline   Reply With Quote
Old 07-16-2011, 01:42 AM   #6 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

1- the code is not the same of the tutorial
2- your xml is malformed, don't hardcode happending\writing directly on code, create a file. and however NSLog it and try to see if it is correct (sending it with a test software like soapUI or just open with a browser to see if it is synthatically correct)
__________________

Last edited by dany_dev; 07-16-2011 at 01:50 AM.
dany_dev 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: 373
9 members and 364 guests
apatsufas, chemistry, Kirkout, leostc, lzwasyc, MarkC, Sami Gh, SamorodovAlex, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

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