title: WCF + WebClient + Powershell
body: <p>I tried it works fine for the asmx (simple web services) but for WCf do we need to do some thing different.</p>
  
  <p>Can the Same work for the WCF services as i get the error for the WCF service also.
  i just created the Simple WCF service in .net and tried to access. but was not successful.</p>
  
  <p>Error:</p>
  
  <pre><code>$Url = "http://localhost:4637/WCFService2/Service.svc"
  
  $webclient = new-object System.Net.WebClient
  
  $soapMessage = @"
  &lt;soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/"&gt;
     &lt;soap:Header/&gt;
     &lt;soap:Body&gt;
        &lt;tem:GetData&gt;
           &lt;!--Optional:--&gt;
           &lt;tem:value&gt;hji&lt;/tem:value&gt;
        &lt;/tem:GetData&gt;
     &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  "@
  $webclient.headers.Add("SOAPAction","http://localhost:4637/WCFService2/Service.svc/GetData")
  $webclient.headers.Add("Content-Type", "text/xml; charset=utf-8")
  
  $result = ([XML]$webclient.UploadString($Url, $soapMessage))#.envelope.body.GetWeatherByPlaceNameResponse.GetWeatherByPlaceNameResult
  
  $result
  </code></pre>