Rimvis
asked on
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="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</fa ultcode>
<faultstring>System.Web.Se rvices.Pro tocols.Soa pException : Server was unable to process request. ---> System.NullReferenceExcept ion: Object reference not set to an instance of an object.
at WST1.Service1.Capitalize(S tring sText) in \\xxxxx.xxx.xx\Tests$\WST1 \Service1. asmx.vb:li ne 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?
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</fa
<faultstring>System.Web.Se
at WST1.Service1.Capitalize(S
--- 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?
ASKER
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 :(
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 :(
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.
http://www.dotnet247.com/247reference/msgs/15/79837.aspx
It says you will need SOAP Toolkit 2.0 for VC6.
-Nauman.
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.SoapC lient") 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.Serve rXMLHTTP") oServerXML.Open "GET",
"http://localhost/WebService1/Service1.asmx/CanYouTellMe?index=10";, False
oServerXML.setRequestHeade r "Content-Type",
"application/x-www-form-ur lencoded" MsgBox oServerXML.responseText Set
oServerXML = nothing
HTH, Nauman.
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.SoapC
SoapClient.mssoapinit("http://localhost/webservice1/service1.asmx?wsdl";)
MsgBox (SoapClient.CanYouTellMe("
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.Serve
"http://localhost/WebService1/Service1.asmx/CanYouTellMe?index=10";, False
oServerXML.setRequestHeade
"application/x-www-form-ur
oServerXML = nothing
HTH, Nauman.
ASKER
Hi, Nauman
I reverted to SOAP 2.0, but still no luck. Calls to methods with parameters failes.
I reverted to SOAP 2.0, but still no luck. Calls to methods with parameters failes.
ASKER
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().
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().
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.cuj.com/documents/s=9716/ddj0402b/
http://www.builderau.com.au/architect/webservices/0,39024590,20267072,00.htm
http://www.codecomments.com/archive321-2005-3-417044.html
Best, Nauman.