473,547 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SOAP Proxy for VC++

Hello,

Please help me to resolve next problem: I have Web service
installed on the network and I can communicate with it via
WSDL file from several applications including VC++6
application using SOAP Toolkit 2. After that I installed
VC++ .NET 2003 and tried to generate proxy class
using 'Add Web Reference .' menu (SProxy.exe). This wizard
just failed to generate right proxy class because it
always returns S_OK error code, but can't read data from
Web Service. I've checked generated code and didn't see
any functions name as part of argument of 'SendRequest()'
function.

Here is my WSDL file:
<?xml version="1.0" encoding="utf-8"?>
<definitions
xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/"
xmlns:tns="http ://soapinterop.org/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="htt p://schemas.xmlsoap .org/wsdl/mime/"
xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
targetNamespace ="http://soapinterop.org/"
xmlns="http://schemas.xmlsoap .org/wsdl/">
<types />
<message name="echoStrin gRequest">
<part name="inputStri ng" type="s:string" />
</message>
<message name="echoStrin gResponse">
<part name="return" type="s:string" />
</message>
<message name="multIntRe quest">
<part name="input" type="s:int" />
</message>
<message name="multIntRe sponse">
<part name="return" type="s:int" />
</message>
<portType name="InteropTe stPortType">
<operation name="echoStrin g">
<input message="tns:ec hoStringRequest " />
<output message="tns:ec hoStringRespons e" />
</operation>
<operation name="multInt">
<input message="tns:mu ltIntRequest" />
<output message="tns:mu ltIntResponse" />
</operation>
</portType>
<binding name="InteropTe stBinding"
type="tns:Inter opTestPortType" >
<soap:binding
transport="http ://schemas.xmlsoap .org/soap/http"
style="rpc" />
<operation name="echoStrin g">
<soap:operati on soapAction="htt p://stage-
internal.reflec tivity.com/nusoap_server.h tml"
style="rpc" />
<input>
<soap:body use="encoded"
namespace="http ://soapinterop.org/"
encodingStyle=" http://schemas.xmlsoap .org/soap/encoding/" /
</input>
<output>
<soap:body use="encoded"
namespace="http ://soapinterop.org/"
encodingStyle=" http://schemas.xmlsoap .org/soap/encoding/" / </output>
</operation>
<operation name="multInt">
<soap:operati on soapAction="htt p://stage-
internal.reflec tivity.com/nusoap_server.h tml"
style="rpc" />
<input>
<soap:body use="encoded"
namespace="http ://soapinterop.org/"
encodingStyle=" http://schemas.xmlsoap .org/soap/encoding/" / </input>
<output>
<soap:body use="encoded"
namespace="http ://soapinterop.org/"
encodingStyle=" http://schemas.xmlsoap .org/soap/encoding/" /

</output>
</operation>
</binding>
<service name="InteropTe st">
<port name="InteropTe stPort"
binding="tns:In teropTestBindin g">
<soap:address location="http://stage-
internal.reflec tivity.com/nusoap_server.h tml" />
</port>
</service>
</definitions>
///////////////////////////////////////////////////////////
///////////
And Here is generated by SProxy.exe class for VC++ .NET
2003:

//
// sproxy.exe generated file
// do not modify this file
//
// Created: 09/15/2003@15:45:53
//

#pragma once
#ifndef _WIN32_WINDOWS
#pragma message("warnin g: defining _WIN32_WINDOWS =
0x0410")
#define _WIN32_WINDOWS 0x0410
#endif

#include <atlsoap.h>

namespace InteropTest
{

template <typename TClient = CSoapSocketClie ntT<> >
class CInteropTestT :
public TClient,
public CSoapRootHandle r
{
protected:

const _soapmap ** GetFunctionMap( );
const _soapmap ** GetHeaderMap();
void * GetHeaderValue( );
const wchar_t * GetNamespaceUri ();
const char * GetServiceName( );
const char * GetNamespaceUri A();
HRESULT CallFunction(
void *pvParam,
const wchar_t *wszLocalName, int
cchLocalName,
size_t nItem);
HRESULT GetClientReader (ISAXXMLReader **ppReader);

public:

HRESULT __stdcall QueryInterface( REFIID riid, void
**ppv)
{
if (ppv == NULL)
{
return E_POINTER;
}

*ppv = NULL;

if (InlineIsEqualG UID(riid, IID_IUnknown)
||
InlineIsEqualGU ID(riid,
IID_ISAXContent Handler))
{
*ppv =
static_cast<ISA XContentHandler *>(this);
return S_OK;
}

return E_NOINTERFACE;
}

ULONG __stdcall AddRef()
{
return 1;
}

ULONG __stdcall Release()
{
return 1;
}

CInteropTestT(I SAXXMLReader *pReader = NULL)
:TClient(_T("ht tp://stage-
internal.reflec tivity.com/nusoap_server.h tml"))
{
SetClient(true) ;
SetReader(pRead er);
}

~CInteropTestT( )
{
Uninitialize();
}

void Uninitialize()
{
UninitializeSOA P();
}

HRESULT echoString(
BSTR inputString,
BSTR* __retval
);

HRESULT multInt(
int input,
int* __retval
);
};

typedef CInteropTestT<> CInteropTest;

struct __CInteropTest_ echoString_stru ct
{
BSTR inputString;
BSTR __retval;
};

extern __declspec(sele ctany) const _soapmapentry
__CInteropTest_ echoString_entr ies[] =
{

{
0x0B8B8DA7,
"inputStrin g",
L"inputStrin g",
sizeof("inputSt ring")-1,
SOAPTYPE_STRING ,
SOAPFLAG_NONE | SOAPFLAG_IN | SOAPFLAG_RPC
| SOAPFLAG_ENCODE D | SOAPFLAG_NULLAB LE,
offsetof(__CInt eropTest_echoSt ring_struct,
inputString),
NULL,
NULL,
-1,
},
{
0x11515F60,
"return",
L"return",
sizeof("return" )-1,
SOAPTYPE_STRING ,
SOAPFLAG_NONE | SOAPFLAG_OUT |
SOAPFLAG_RPC | SOAPFLAG_ENCODE D | SOAPFLAG_NULLAB LE,
offsetof(__CInt eropTest_echoSt ring_struct,
__retval),
NULL,
NULL,
-1,
},
{ 0x00000000 }
};

extern __declspec(sele ctany) const _soapmap
__CInteropTest_ echoString_map =
{
0xC9995F96,
"echoString ",
L"echoString ",
sizeof("echoStr ing")-1,
sizeof("echoStr ing")-1,
SOAPMAP_FUNC,
__CInteropTest_ echoString_entr ies,
sizeof(__CInter opTest_echoStri ng_struct),
1,
-1,
SOAPFLAG_NONE | SOAPFLAG_RPC | SOAPFLAG_ENCODE D,
0x534A4B71,
"http://soapinterop.org/",
L"http://soapinterop.org/",
sizeof("http://soapinterop.org/")-1
};
struct __CInteropTest_ multInt_struct
{
int input;
int __retval;
};

extern __declspec(sele ctany) const _soapmapentry
__CInteropTest_ multInt_entries[] =
{

{
0x07AA4A90,
"input",
L"input",
sizeof("input")-1,
SOAPTYPE_INT,
SOAPFLAG_NONE | SOAPFLAG_IN | SOAPFLAG_RPC
| SOAPFLAG_ENCODE D,
offsetof(__CInt eropTest_multIn t_struct,
input),
NULL,
NULL,
-1,
},
{
0x11515F60,
"return",
L"return",
sizeof("return" )-1,
SOAPTYPE_INT,
SOAPFLAG_NONE | SOAPFLAG_OUT |
SOAPFLAG_RPC | SOAPFLAG_ENCODE D,
offsetof(__CInt eropTest_multIn t_struct,
__retval),
NULL,
NULL,
-1,
},
{ 0x00000000 }
};

extern __declspec(sele ctany) const _soapmap
__CInteropTest_ multInt_map =
{
0xDF5AA74D,
"multInt",
L"multInt",
sizeof("multInt ")-1,
sizeof("multInt ")-1,
SOAPMAP_FUNC,
__CInteropTest_ multInt_entries ,
sizeof(__CInter opTest_multInt_ struct),
1,
-1,
SOAPFLAG_NONE | SOAPFLAG_RPC | SOAPFLAG_ENCODE D,
0x534A4B71,
"http://soapinterop.org/",
L"http://soapinterop.org/",
sizeof("http://soapinterop.org/")-1
};

extern __declspec(sele ctany) const _soapmap *
__CInteropTest_ funcs[] =
{
&__CInteropTest _echoString_map ,
&__CInteropTest _multInt_map,
NULL
};

template <typename TClient>
inline HRESULT CInteropTestT<T Client>::echoSt ring(
BSTR inputString,
BSTR* __retval
)
{
if ( __retval == NULL )
return E_POINTER;

HRESULT __atlsoap_hr = InitializeSOAP( NULL);
if (FAILED(__atlso ap_hr))
{
SetClientError
(SOAPCLIENT_INI TIALIZE_ERROR);
return __atlsoap_hr;
}

CleanupClient() ;

CComPtr<IStream > __atlsoap_spRea dStream;
__CInteropTest_ echoString_stru ct __params;
memset(&__param s, 0x00, sizeof(__params ));
__params.inputS tring = inputString;

__atlsoap_hr = SetClientStruct (&__params, 0);
if (FAILED(__atlso ap_hr))
{
SetClientError( SOAPCLIENT_OUTO FMEMORY);
goto __skip_cleanup;
}

__atlsoap_hr = GenerateRespons e(GetWriteStrea m());
if (FAILED(__atlso ap_hr))
{
SetClientError( SOAPCLIENT_GENE RATE_ERROR);
goto __skip_cleanup;
}

__atlsoap_hr = SendRequest(_T( "SOAPAction :
\"http://stage-
internal.reflec tivity.com/nusoap_server.h tml\"\r\n"));
if (FAILED(__atlso ap_hr))
{
goto __skip_cleanup;
}
__atlsoap_hr = GetReadStream
(&__atlsoap_spR eadStream);
if (FAILED(__atlso ap_hr))
{
SetClientError( SOAPCLIENT_READ _ERROR);
goto __skip_cleanup;
}

// cleanup any in/out-params and out-headers from
previous calls
Cleanup();
__atlsoap_hr = BeginParse(__at lsoap_spReadStr eam);
if (FAILED(__atlso ap_hr))
{
SetClientError( SOAPCLIENT_PARS E_ERROR);
goto __cleanup;
}

*__retval = __params.__retv al;
goto __skip_cleanup;

__cleanup:
Cleanup();
__skip_cleanup:
ResetClientStat e(true);
memset(&__param s, 0x00, sizeof(__params ));
return __atlsoap_hr;
}

template <typename TClient>
inline HRESULT CInteropTestT<T Client>::multIn t(
int input,
int* __retval
)
{
if ( __retval == NULL )
return E_POINTER;

HRESULT __atlsoap_hr = InitializeSOAP( NULL);
if (FAILED(__atlso ap_hr))
{
SetClientError
(SOAPCLIENT_INI TIALIZE_ERROR);
return __atlsoap_hr;
}

CleanupClient() ;

CComPtr<IStream > __atlsoap_spRea dStream;
__CInteropTest_ multInt_struct __params;
memset(&__param s, 0x00, sizeof(__params ));
__params.input = input;

__atlsoap_hr = SetClientStruct (&__params, 1);
if (FAILED(__atlso ap_hr))
{
SetClientError( SOAPCLIENT_OUTO FMEMORY);
goto __skip_cleanup;
}

__atlsoap_hr = GenerateRespons e(GetWriteStrea m());
if (FAILED(__atlso ap_hr))
{
SetClientError( SOAPCLIENT_GENE RATE_ERROR);
goto __skip_cleanup;
}

__atlsoap_hr = SendRequest(_T( "SOAPAction :
\"http://stage-
internal.reflec tivity.com/nusoap_server.h tml\"\r\n"));
if (FAILED(__atlso ap_hr))
{
goto __skip_cleanup;
}
__atlsoap_hr = GetReadStream
(&__atlsoap_spR eadStream);
if (FAILED(__atlso ap_hr))
{
SetClientError( SOAPCLIENT_READ _ERROR);
goto __skip_cleanup;
}

// cleanup any in/out-params and out-headers from
previous calls
Cleanup();
__atlsoap_hr = BeginParse(__at lsoap_spReadStr eam);
if (FAILED(__atlso ap_hr))
{
SetClientError( SOAPCLIENT_PARS E_ERROR);
goto __cleanup;
}

*__retval = __params.__retv al;
goto __skip_cleanup;

__cleanup:
Cleanup();
__skip_cleanup:
ResetClientStat e(true);
memset(&__param s, 0x00, sizeof(__params ));
return __atlsoap_hr;
}

template <typename TClient>
ATL_NOINLINE inline const _soapmap **
CInteropTestT<T Client>::GetFun ctionMap()
{
return __CInteropTest_ funcs;
}

template <typename TClient>
ATL_NOINLINE inline const _soapmap **
CInteropTestT<T Client>::GetHea derMap()
{
static const _soapmapentry
__CInteropTest_ echoString_atls oapheader_entri es[] =
{
{ 0x00000000 }
};

static const _soapmap
__CInteropTest_ echoString_atls oapheader_map =
{
0xC9995F96,
"echoString ",
L"echoString ",
sizeof("echoStr ing")-1,
sizeof("echoStr ing")-1,
SOAPMAP_HEADER,

__CInteropTest_ echoString_atls oapheader_entri es,
0,
0,
-1,
SOAPFLAG_NONE | SOAPFLAG_RPC |
SOAPFLAG_ENCODE D,
0x534A4B71,
"http://soapinterop.org/",
L"http://soapinterop.org/",
sizeof("http://soapinterop.org/")-1
};

static const _soapmapentry
__CInteropTest_ multInt_atlsoap header_entries[] =
{
{ 0x00000000 }
};

static const _soapmap
__CInteropTest_ multInt_atlsoap header_map =
{
0xDF5AA74D,
"multInt",
L"multInt",
sizeof("multInt ")-1,
sizeof("multInt ")-1,
SOAPMAP_HEADER,

__CInteropTest_ multInt_atlsoap header_entries,
0,
0,
-1,
SOAPFLAG_NONE | SOAPFLAG_RPC |
SOAPFLAG_ENCODE D,
0x534A4B71,
"http://soapinterop.org/",
L"http://soapinterop.org/",
sizeof("http://soapinterop.org/")-1
};
static const _soapmap * __CInteropTest_ headers[] =
{

&__CInteropTest _echoString_atl soapheader_map,
&__CInteropTest _multInt_atlsoa pheader_map,
NULL
};

return __CInteropTest_ headers;
}

template <typename TClient>
ATL_NOINLINE inline void *
CInteropTestT<T Client>::GetHea derValue()
{
return this;
}

template <typename TClient>
ATL_NOINLINE inline const wchar_t *
CInteropTestT<T Client>::GetNam espaceUri()
{
return L"http://soapinterop.org/";
}

template <typename TClient>
ATL_NOINLINE inline const char *
CInteropTestT<T Client>::GetSer viceName()
{
return NULL;
}

template <typename TClient>
ATL_NOINLINE inline const char *
CInteropTestT<T Client>::GetNam espaceUriA()
{
return "http://soapinterop.org/";
}

template <typename TClient>
ATL_NOINLINE inline HRESULT
CInteropTestT<T Client>::CallFu nction(
void *,
const wchar_t *, int,
size_t)
{
return E_NOTIMPL;
}

template <typename TClient>
ATL_NOINLINE inline HRESULT
CInteropTestT<T Client>::GetCli entReader(ISAXX MLReader
**ppReader)
{
if (ppReader == NULL)
{
return E_INVALIDARG;
}

CComPtr<ISAXXML Reader> spReader = GetReader();
if (spReader.p != NULL)
{
*ppReader = spReader.Detach ();
return S_OK;
}
return TClient::GetCli entReader(ppRea der);
}

} // namespace InteropTest

///////////////////////////////////////////////////////////
////////////

I've tried to call multInt(33, &iRes) and return code was
S_OK, but iRes was always = 0. This function should return
2*33 = 66 and it works with soap toolkit 2 and WSP wizard
for VC++6.

Thanks a lot for your time,
Regards
Leonid

Nov 16 '05 #1
0 4161

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1619
by: chr | last post by:
Hi, I'm trying to integrate a webservice into a c#-program, creating proxy classes from a wsdl-file with wsdl.exe. All works fine, except if containers are returned. Although I can see in the returned xml that there are entries in the containers the proxy-classes say it is empty. Has anybody an idea why this is so an how to solve this...
0
404
by: Leonid | last post by:
Thanks a lot for your time! Here is WSDL: <?xml version="1.0" encoding="utf-8"?>
0
1605
by: Sham Ramakrishnan | last post by:
guys... I have a SOAP service at my clients that I have to use to call the exposed methods... well... there are supposedly 3 ways in which I can look at doing it... 1. Create a proxy for the SOAP service using the WSDL.exe utility and use the proxy directly by creating instances of the proxy class like a SOAP Client. 2. Create a proxy for...
0
6189
by: Nalla | last post by:
Hi, I have a requirement to call webservices from my old C++ application.So first I tried with Vc++.net as follows.....There are 2 approach Dotnet frame work and soaptoolkit 3.0 I am not able to interact with webservice thru c++.I think ther is a bug in MS implementation for c++ to interact with webservice because I am able to connect to the...
4
2645
by: Jit Prasad | last post by:
I have been consuming a IBM Websphere (Java) web service using .Net 1.0 front end writen in VB.NET. The proxy class submits a soap request and gets a soap response. When I migrated the front-end to .NET1.1, the response from the web service appears as null in the proxy class. This only happens with .NET1.1, .NET1.0 is ok and works fine. I...
16
3161
by: MR | last post by:
my soap messages to a remote site are failing. as far as i can tell the only differences between what my SOAP message looks liek and what they want are in the SOAP envelope SInce they don't have a wsdl doc i created a localhost site based on their DTD documetns. How do I configure my site (and client proxy) to match thier envelope? Any...
1
3069
by: A.M-SG | last post by:
Hi, Can I view/modify SOAP message at the client proxy side without using soap extensions? Thank you,
1
317
by: Frederiek | last post by:
Hi, I need to create a Windows service that has to access a web service through a SOAP interface. I am using Visual C++ 2005. Thus far I have not really created .NET applications. Up to now I used VC++ 2005 for creating non-CLR applications. However, it seems that the SOAP Toolkit has been deprecated, and the alternative is to use the...
2
6746
by: furrypop | last post by:
Hi, I'm trying to get the Perl SOAP::Lite examples to work on a Windows PC, running Apache 2.2.4. Apache is definitely serving CGI scripts, as I've tested a dummy Hello World thing. I'm also definitely getting a hit when I use a browser to get to my hibye.cgi server (well, a blank page rather than a 404). However, when I run my hibye.pl...
0
1106
by: reco | last post by:
Hi, I am only new to development and have been given a task to convert a Perl script to a Windows Service. The issue I am facing is that the current Perl Script uses a SOAP call to an Apache Web Server to retrieve data through https xml feeds. I am unable to locate any help on how to write this in c#. I am using Visual Studios 2005. I have...
0
7510
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7463
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6032
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3493
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3473
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1923
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
748
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.