Problems working with .NET WebService and SOAP SDK 3.0

Posted on 2005-05-09
Last Modified: 2011-10-03
Hi all, here's my situation:

I have web service created in VB.NET. When client that calls this service is created in .NET languages, there's no problem.
But I have to call this service from VC++ 6.0 client.

Right now I'm trying SOAP SDK 3.0. When working with simple methods without parameters, everything is OK. But when I'm putting some parameters, I'm getting exception like this:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
      <faultstring>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.NullReferenceException: Object reference not set to an instance of an object.
   at WST1.Service1.Capitalize(String sText) in \\\Tests$\WST1\Service1.asmx.vb:line 55
   --- End of inner exception stack trace ---</faultstring>
      <detail />

I don't want to create some .NET wrappers for this, because I want to make it as simple as possible.

I think problem is in SOAP request differrences between SOAP 3.0 and .NET

Is there any way arround?

Question by:Rimvis
    LVL 25

    Expert Comment

    LVL 19

    Author Comment

    Thanx for response, Nauman

    Unfortunately. I couldn't find anything that might help me in your links.
    As I said, web service is written in .NET. And my client will be VC 6.0. I can't do anything about it, because these components will be part of already existing system.
    In your articles web service is created using same SOAP SDK (unless I'm missing something).

    Right now I see two approaches: a) connect to .NET web service using SOAP 3.0 SDK; b) format request and parse result at HTTP POST level. Alas, I'm struggling with both :(

    LVL 25

    Expert Comment

    Checkout the following link:

    It says you will need SOAP Toolkit 2.0 for VC6.  

    LVL 25

    Expert Comment

    The solution for your problem is similart ...

    How to Call WebService from Legacy ASP or VBS

    *** Problem Description ***
    Is it possible to call a webservice from a 'conventional' asp application?
    i.e. from an asp page?

    *** Resolution ***
    1. Soap ToolKit2.0 (download from

    Set SoapClient = CreateObject("MSSOAP.SoapClient") Call
    MsgBox (SoapClient.CanYouTellMe("3"))

    2. If you have the .net framework installed on the ASP machine, generate a
    .net web service client proxy, mark it wit [ComVisible=true], and invoke it
    as a
    com object.

    3. ServerXMLHTTP or XMLHTTP: Set oServerXML =
    CreateObject("Msxml2.ServerXMLHTTP") oServerXML.Open "GET",
    "http://localhost/WebService1/Service1.asmx/CanYouTellMe?index=10";, False
    oServerXML.setRequestHeader "Content-Type",
    "application/x-www-form-urlencoded" MsgBox oServerXML.responseText Set
    oServerXML = nothing

    HTH, Nauman.
    LVL 19

    Author Comment

    Hi, Nauman

    I reverted to SOAP 2.0, but still no luck. Calls to methods with parameters failes.
    LVL 19

    Author Comment

    I found solution myself. It's quite simple:

    To call NET web service by using SOAP SDK, methods in web service have to be declared like this:

        <WebMethod(), SoapRpcMethod()> _
        Public Function HelloWorld() As String
            Return "Hello World. Time is " & Now.TimeOfDay.ToString
        End Function

    Note additional SoapRpcMethod().

    Accepted Solution

    Closed, 500 points refunded.
    Community Support Moderator (Graveyard shift)

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video discusses moving either the default database or any database to a new volume.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now