title: How to consume WCF .svc service in iOS 8 using swift?
body: <p>I am beginner in iOS &amp; i want to call WCF .svc service from my application using swift.</p>
  
  <p>My service return soap data in response.</p>
  
  <p>I have consumed asmx service using following code ,can same code be used to call wcf .svc service or i do need to change the code.</p>
  
  <pre><code> var celcius = txtCelsius.text
  
      var soapMessage = "&lt;?xml version='1.0' encoding='utf-8'?&gt;&lt;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/'&gt;&lt;soap:Body&gt;&lt;CelsiusToFahrenheit xmlns='http://www.w3schools.com/webservices/'&gt;&lt;Celsius&gt;\(celcius)&lt;/Celsius&gt;&lt;/CelsiusToFahrenheit&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;"
  
  
      var urlString = "http://www.w3schools.com/webservices/tempconvert.asmx"
  
  
  
      var url:NSURL = NSURL(string: urlString)!
  
      var theRequest = NSMutableURLRequest(URL: url)
  
      var msgLength = String(countElements(soapMessage))
  
      theRequest.addValue("text/xml; charset=utf-8", forHTTPHeaderField: "Content-Type")
      theRequest.addValue(msgLength, forHTTPHeaderField: "Content-Length")
      theRequest.HTTPMethod = "POST"
      theRequest.HTTPBody = soapMessage.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) // or false
  
      var connection = NSURLConnection(request: theRequest, delegate: self, startImmediately: true)
      connection?.start()
  
      if (connection == true) {
          var mutableData : Void = NSMutableData.initialize()
      }
  </code></pre>
  
  <p>Please help me .</p>