Calling vb.net web service from visual c++

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi. I am new to this so this may be a dumb question:

I am trying to call a web service that is Written in VB.NET from my C++ dll.

here is what I did:

1. Create a sample web service (with helloworld function)
2. Create an empty ATL application (it compiled)
3. Added a reference to the wsdl document of the web service to the project.
4. tried to compile it and got an error:

syntax error : expecting a type specification near "HelloWorldResult"

error points to this line:

[id(4), helpstring("method HelloWorld")] HRESULT HelloWorld([out, retval]
HelloWorldResult *);

Here is the code that was generated by Soap Tool Kit when I added a reference:

// TestSoapTool.idl : IDL source for TestSoapTool.dll
//

// This file will be processed by the MIDL tool to
// produce the type library (TestSoapTool.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";
[
object,
uuid(433144B5-225D-42D8-8E2C-875467ABE7FA),
dual,
helpstring("IService1SoapProxy Interface"),
pointer_default(unique)
]
interface IService1SoapProxy : IDispatch
{
[propget, id(1), helpstring("property URL")] HRESULT URL([out, retval]
BSTR *pVal);
[propput, id(1), helpstring("property URL")] HRESULT URL([in] BSTR newVal);
[propget, id(2), helpstring("property ProxyServerAddress")] HRESULT
ProxyServerAddress([out, retval] BSTR *pVal);
[propput, id(2), helpstring("property ProxyServerAddress")] HRESULT
ProxyServerAddress([in] BSTR newVal);
[propget, id(3), helpstring("property ProxyServerPort")] HRESULT
ProxyServerPort([out, retval] BSTR *pVal);
[propput, id(3), helpstring("property ProxyServerPort")] HRESULT
ProxyServerPort([in] BSTR newVal);
[id(4), helpstring("method HelloWorld")] HRESULT HelloWorld([out, retval]
HelloWorldResult *);
};

[
uuid(A07EF164-8E81-41FF-9D91-BD74F3C1F67E),
version(1.0),
helpstring("TestSoapTool 1.0 Type Library")
]
library TESTSOAPTOOLLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");

[
uuid(C7AC7808-58F3-4109-B2D9-ACC22521C055),
helpstring("Service1SoapProxy Class")
]
coclass Service1SoapProxy
{
[default] interface IService1SoapProxy;
};
};

Before I go any further I wanted to know if it is even doable: calling
vb-based functions from c++ since all types are different. Is this a common
issue? Did I do anything wrong in my steps or is there anything I did not do?

Thanks for the help.

.



Relevant Pages

  • Re: Dataset retunring Null ..a gurus opinion required!
    ... Dim estateOleAdapter As New OleDbDataAdapter ... and updated the service reference in the client..but the same exception is ... toolbox to the design area to establish the connection. ... To ensure that my web service is well connected to my Access database, ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: WinForms and WebServices
    ... I appreciate you taking the time to review my question and answers but you're focusing on the wrong thing and completely missing the point. ... To be able to use the methods and properties of the service I HAVE TO add a web reference to the service in the application references and the VS guide that helps you doing that has to be able to access the service itself to list it's methods and properties. ... So I cannot add the web reference and thus I cannot create a web service object instance and use the web service methods and properties in the app. ... I suppose I could install a "dummy" service on my own web server and reference that. ...
    (microsoft.public.dotnet.languages.vb)
  • Calling .Net web services from Visual C++ (Soap Tool Kit)
    ... I am trying to call a web service that is Written in VB.NET from my C++ dll. ... Added a reference to the wsdl document of the web service to the project. ... Here is the code that was generated by Soap Tool Kit when I added a reference: ... // produce the type library and marshalling code. ...
    (microsoft.public.vc.language)
  • Calling VB.NET web service from Visual C++
    ... I am trying to call a web service that is Written in VB.NET from my C++ dll. ... Added a reference to the wsdl document of the web service to the project. ... Here is the code that was generated by Soap Tool Kit when I added a reference: ... // produce the type library and marshalling code. ...
    (microsoft.public.vc.mfc)
  • Calling VB.NET Web service from Visual C++
    ... I am trying to call a web service that is Written in VB.NET from my C++ dll. ... Added a reference to the wsdl document of the web service to the project. ... Here is the code that was generated by Soap Tool Kit when I added a reference: ... // produce the type library and marshalling code. ...
    (microsoft.public.vc.ide_general)