?
Solved

Problems working with .NET WebService and SOAP SDK 3.0

Posted on 2005-05-09
8
Medium Priority
?
959 Views
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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <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 \\xxxxx.xxx.xx\Tests$\WST1\Service1.asmx.vb:line 55
   --- End of inner exception stack trace ---</faultstring>
      <detail />
    </soap:Fault>
  </soap:Body>
</soap:Envelope>

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?



0
Comment
Question by:Rimvis
  • 3
  • 3
7 Comments
 
LVL 19

Author Comment

by:Rimvis
ID: 13959541
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 :(

0
 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 13959711
Checkout the following link:

http://www.dotnet247.com/247reference/msgs/15/79837.aspx

It says you will need SOAP Toolkit 2.0 for VC6.  

-Nauman.
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 13959716
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 http://msdn.microsoft.com/soap):

Set SoapClient = CreateObject("MSSOAP.SoapClient") Call
SoapClient.mssoapinit("http://localhost/webservice1/service1.asmx?wsdl";)
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.
0
 
LVL 19

Author Comment

by:Rimvis
ID: 13966037
Hi, Nauman

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

Author Comment

by:Rimvis
ID: 13966052
I found solution myself. It's quite simple:
http://www.forum4designers.com/archive26-2004-8-73505.html

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

Accepted Solution

by:
OzzMod earned 0 total points
ID: 14001828
Closed, 500 points refunded.
OzzMod
Community Support Moderator (Graveyard shift)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Loops Section Overview
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

830 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