0

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.

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)).

I've downloaded the SOAP toolkit 3.0 and imported it in my application reference. here is my 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")

--Update-- 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:

  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none" />
   </s:Header>
   <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">
     <q1:verifyTransaction xmlns:q1="urn:Foo">
  <String_1 xsi:type="xsd:string">12345678901234567890</String_1>
  <String_2 xsi:type="xsd:string">00109902-129251</String_2>
</q1:verifyTransaction>
</s:Body>
</s:Envelope>

and I have method to consume the SOAP XML which returns Internal Server Error 500 !!!!! You think which part is wrong ?!

 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("<Action s:" + "ReferencePayment>")
    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("<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>")
    sb.Append("<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'>")
    sb.Append("<q1:verifyTransaction xmlns:q1='urn:Foo'>")
    sb.Append("xml:xsd='http://www.w3.org/2001/XMLSchema'")
    sb.Append("<verifyTransaction xmlns='urn:Foo'")
    sb.Append("<String_1 xsi:type='xsd:string'>12345678901234567890</String_1>")
    sb.Append("<String_2 xsi:type='xsd:String'>00109902-129251</String_2>")
    sb.Append("</q1:verifyTransaction> </s:Body></s:Envelope>")
    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
danialmoghaddam
  • 343
  • 1
  • 6
  • 21

1 Answers1

0

There appears to be a problem with that tool, you may want to use the WCFTest Client, which should work with you soap message, thise can be found from within the VS2010 folder

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\WcfTestClient.exe

Just add the service you want to open, it should then create a client proxy for you on the fly.

Update:

You may want to use add web reference and create a webservice project as part of a VS project.

Hope this helps.

Cheers

Iain
  • 6,392
  • 2
  • 30
  • 50
  • Thanks for you answer. using your method I would be able to test the feedback from the server which I've been already able to do. The problem is when I upload my application on the web server (hosting server) it gives me that error message. – danialmoghaddam Nov 21 '12 at 13:36
  • Does you webservice call any unmanaged resources, COM, Win32 api? – Iain Nov 22 '12 at 08:28
  • yes, I'm calling MSSOAPLib30 DLL which I added as COM reference – danialmoghaddam Nov 22 '12 at 09:12
  • If your hosting externally, you may be in medium trust environment, http://stackoverflow.com/questions/2617454/what-is-medium-trust-in-asp-net, and will not be able to run Win32 Api's – Iain Nov 22 '12 at 10:09
  • Lain, Please check my update on this post, you may have clue to help me. thanks – danialmoghaddam Nov 22 '12 at 13:40
  • Just wondering if you have tried adding adding a web reference to your project and creating webservice project? – Iain Nov 22 '12 at 14:25
  • you maaaaade my day, thank you for the help. it works now. you re-post this as another answer to help other people. thank you again – danialmoghaddam Nov 22 '12 at 15:15