1

I want call a web service with parameter from my iphone app.

The parameter is a string and where and how I have to specify the parameter calling the web service using xml or whatever it is.

Please tell me if somebody knows about it. I want to send a state name to the web service.

please help me to solve this issue.

NSString *soapMessage = 
    [NSString stringWithFormat:
     @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
     "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
     "<soap:Body>"
     "<stateWiseHospitalName  xmlns=\"http://ws.centricare.org\" />"
     "</soap:Body>"
     "</soap:Envelope>"

     ];
Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99
user1523344
  • 123
  • 1
  • 1
  • 8

3 Answers3

1

Simply :

"<stateWiseHospitalName  xmlns=\"http://ws.centricare.org\" />"
"<first parameter>value</first parameter> <second parameter>value</second parameter>
...... "
"</stateWiseHospitalName> /n " 
Meseery
  • 844
  • 6
  • 11
-1

iOS doesn't have any built-in support for SOAP, so you may want to find a library to help with creating and interpreting SOAP messages. If you're comfortable doing that yourself and just need help to post the message to a server, you can use NSURLRequest and NSURLConnection for that.

Community
  • 1
  • 1
Caleb
  • 124,013
  • 19
  • 183
  • 272
-1

I don't recommend using SOAP. Been there, done that, it's a gruelling experience.

I prefer using JSON for web services. The folks at http://www.three20.info have a comprehensive framework to dealing with it.