title: Unregistered SOAP Client 3.0 on Windows Server
body: <p>I've developed a Web Application (web site) using VS 2010 and VB.NET. I'm able to run the application successfully from VS. But when I Publish and upload it on my hosting server this error message occurs. </p>
  
  <pre><code>Retrieving the COM class factory for component with CLSID {7F017F97-9257-11D5-87EA-00B0D0BE6479} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
  </code></pre>
  
  <p>I've downloaded the SOAP toolkit 3.0 and imported it in my application reference. here is my code:</p>
  
  <pre><code>Imports MSSOAPLib30
  
  
  Dim objSoapClient As New SoapClient30             '=== Create an instance of SoapClient
  
              '=== Set Client Properties
              objSoapClient.ClientProperty("ServerHTTPRequest") = True
  
              '=== Retrieve KWMP web services WSDL
              Call objSoapClient.mssoapinit("https://example.com/ReferencePayment?WSDL", "ReferencePayment")
              '=== Set connection property to be over SSL
              objSoapClient.ConnectorProperty("UseSSL") = False
  
              '=== Now consume the web sevices according to KWMP Specification
              Dim output As String = objSoapClient.verifyTransaction(RCode, "00105952-129251")
  </code></pre>
  
  <p><strong>--Update--</strong>
  except the method above, I was thinking of using POST web method to consume the SOAP XML.
  here is the xml request generated by WCF Test Client:</p>
  
  <pre><code>  &lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;s:Header&gt;
      &lt;Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none" /&gt;
     &lt;/s:Header&gt;
     &lt;s:Body s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
       &lt;q1:verifyTransaction xmlns:q1="urn:Foo"&gt;
    &lt;String_1 xsi:type="xsd:string"&gt;12345678901234567890&lt;/String_1&gt;
    &lt;String_2 xsi:type="xsd:string"&gt;00109902-129251&lt;/String_2&gt;
  &lt;/q1:verifyTransaction&gt;
  &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  
  <p>and I have method to consume the SOAP XML which returns Internal Server Error 500 !!!!! You think which part is wrong ?!</p>
  
  <pre><code> Public Function ServiceCall(RefCode As String) As String
      Dim resultXml As String
      Dim wbrqst As WebRequest = WebRequest.Create("https://modern.enbank.net/ref-payment/ws/ReferencePayment?WSDL")
      Dim httpreq As HttpWebRequest = DirectCast(wbrqst, HttpWebRequest)
      httpreq.Method = "POST"
      httpreq.ContentType = "Content-Type: text/xml; charset=utf-8"
      httpreq.Headers.Add("SOAPAction", "https://modern.enbank.net/ref-payment/ws/ReferencePayment")
      'httpreq.Headers.Add("&lt;Action s:" + "ReferencePayment&gt;")
      httpreq.ProtocolVersion = HttpVersion.Version11
      httpreq.Credentials = CredentialCache.DefaultCredentials
      Dim requestStream As Stream = httpreq.GetRequestStream()
      Dim streamWriter As New StreamWriter(requestStream, Encoding.ASCII)
      Dim sb As New StringBuilder()
      sb.Append("&lt;s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'&gt;")
      sb.Append("&lt;s:Body s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'&gt;")
      sb.Append("&lt;q1:verifyTransaction xmlns:q1='urn:Foo'&gt;")
      sb.Append("xml:xsd='http://www.w3.org/2001/XMLSchema'")
      sb.Append("&lt;verifyTransaction xmlns='urn:Foo'")
      sb.Append("&lt;String_1 xsi:type='xsd:string'&gt;12345678901234567890&lt;/String_1&gt;")
      sb.Append("&lt;String_2 xsi:type='xsd:String'&gt;00109902-129251&lt;/String_2&gt;")
      sb.Append("&lt;/q1:verifyTransaction&gt; &lt;/s:Body&gt;&lt;/s:Envelope&gt;")
      streamWriter.Write(sb.ToString())
      streamWriter.Close()
      Dim wr As HttpWebResponse = DirectCast(httpreq.GetResponse(), HttpWebResponse)
      Dim srd As New StreamReader(wr.GetResponseStream())
      resultXml = srd.ReadToEnd()
      Return resultXml
  
  End Function
  </code></pre>