Problems working with .NET WebService and SOAP SDK 3.0

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?

LVL 19
Who is Participating?
OzzModConnect With a Mentor Commented:
Closed, 500 points refunded.
Community Support Moderator (Graveyard shift)
RimvisAuthor Commented:
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 :(

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Checkout the following link:

It says you will need SOAP Toolkit 2.0 for VC6.  

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.
RimvisAuthor Commented:
Hi, Nauman

I reverted to SOAP 2.0, but still no luck. Calls to methods with parameters failes.
RimvisAuthor Commented:
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().
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.