473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://soapinterop.org/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://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="echoStringRequest">
<part name="inputString" type="s:string" />
</message>
<message name="echoStringResponse">
<part name="return" type="s:string" />
</message>
<message name="multIntRequest">
<part name="input" type="s:int" />
</message>
<message name="multIntResponse">
<part name="return" type="s:int" />
</message>
<portType name="InteropTestPortType">
<operation name="echoString">
<input message="tns:echoStringRequest" />
<output message="tns:echoStringResponse" />
</operation>
<operation name="multInt">
<input message="tns:multIntRequest" />
<output message="tns:multIntResponse" />
</operation>
</portType>
<binding name="InteropTestBinding"
type="tns:InteropTestPortType">
<soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="rpc" />
<operation name="echoString">
<soap:operation soapAction="http://stage-
internal.reflectivity.com/nusoap_server.html"
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:operation soapAction="http://stage-
internal.reflectivity.com/nusoap_server.html"
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="InteropTest">
<port name="InteropTestPort"
binding="tns:InteropTestBinding">
<soap:address location="http://stage-
internal.reflectivity.com/nusoap_server.html" />
</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("warning: defining _WIN32_WINDOWS =
0x0410")
#define _WIN32_WINDOWS 0x0410
#endif

#include <atlsoap.h>

namespace InteropTest
{

template <typename TClient = CSoapSocketClientT<> >
class CInteropTestT :
public TClient,
public CSoapRootHandler
{
protected:

const _soapmap ** GetFunctionMap();
const _soapmap ** GetHeaderMap();
void * GetHeaderValue();
const wchar_t * GetNamespaceUri();
const char * GetServiceName();
const char * GetNamespaceUriA();
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 (InlineIsEqualGUID(riid, IID_IUnknown)
||
InlineIsEqualGUID(riid,
IID_ISAXContentHandler))
{
*ppv =
static_cast<ISAXContentHandler *>(this);
return S_OK;
}

return E_NOINTERFACE;
}

ULONG __stdcall AddRef()
{
return 1;
}

ULONG __stdcall Release()
{
return 1;
}

CInteropTestT(ISAXXMLReader *pReader = NULL)
:TClient(_T("http://stage-
internal.reflectivity.com/nusoap_server.html"))
{
SetClient(true);
SetReader(pReader);
}

~CInteropTestT()
{
Uninitialize();
}

void Uninitialize()
{
UninitializeSOAP();
}

HRESULT echoString(
BSTR inputString,
BSTR* __retval
);

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

typedef CInteropTestT<> CInteropTest;

struct __CInteropTest_echoString_struct
{
BSTR inputString;
BSTR __retval;
};

extern __declspec(selectany) const _soapmapentry
__CInteropTest_echoString_entries[] =
{

{
0x0B8B8DA7,
"inputString",
L"inputString",
sizeof("inputString")-1,
SOAPTYPE_STRING,
SOAPFLAG_NONE | SOAPFLAG_IN | SOAPFLAG_RPC
| SOAPFLAG_ENCODED | SOAPFLAG_NULLABLE,
offsetof(__CInteropTest_echoString_struct,
inputString),
NULL,
NULL,
-1,
},
{
0x11515F60,
"return",
L"return",
sizeof("return")-1,
SOAPTYPE_STRING,
SOAPFLAG_NONE | SOAPFLAG_OUT |
SOAPFLAG_RPC | SOAPFLAG_ENCODED | SOAPFLAG_NULLABLE,
offsetof(__CInteropTest_echoString_struct,
__retval),
NULL,
NULL,
-1,
},
{ 0x00000000 }
};

extern __declspec(selectany) const _soapmap
__CInteropTest_echoString_map =
{
0xC9995F96,
"echoString",
L"echoString",
sizeof("echoString")-1,
sizeof("echoString")-1,
SOAPMAP_FUNC,
__CInteropTest_echoString_entries,
sizeof(__CInteropTest_echoString_struct),
1,
-1,
SOAPFLAG_NONE | SOAPFLAG_RPC | SOAPFLAG_ENCODED,
0x534A4B71,
"http://soapinterop.org/",
L"http://soapinterop.org/",
sizeof("http://soapinterop.org/")-1
};
struct __CInteropTest_multInt_struct
{
int input;
int __retval;
};

extern __declspec(selectany) const _soapmapentry
__CInteropTest_multInt_entries[] =
{

{
0x07AA4A90,
"input",
L"input",
sizeof("input")-1,
SOAPTYPE_INT,
SOAPFLAG_NONE | SOAPFLAG_IN | SOAPFLAG_RPC
| SOAPFLAG_ENCODED,
offsetof(__CInteropTest_multInt_struct,
input),
NULL,
NULL,
-1,
},
{
0x11515F60,
"return",
L"return",
sizeof("return")-1,
SOAPTYPE_INT,
SOAPFLAG_NONE | SOAPFLAG_OUT |
SOAPFLAG_RPC | SOAPFLAG_ENCODED,
offsetof(__CInteropTest_multInt_struct,
__retval),
NULL,
NULL,
-1,
},
{ 0x00000000 }
};

extern __declspec(selectany) const _soapmap
__CInteropTest_multInt_map =
{
0xDF5AA74D,
"multInt",
L"multInt",
sizeof("multInt")-1,
sizeof("multInt")-1,
SOAPMAP_FUNC,
__CInteropTest_multInt_entries,
sizeof(__CInteropTest_multInt_struct),
1,
-1,
SOAPFLAG_NONE | SOAPFLAG_RPC | SOAPFLAG_ENCODED,
0x534A4B71,
"http://soapinterop.org/",
L"http://soapinterop.org/",
sizeof("http://soapinterop.org/")-1
};

extern __declspec(selectany) const _soapmap *
__CInteropTest_funcs[] =
{
&__CInteropTest_echoString_map,
&__CInteropTest_multInt_map,
NULL
};

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

HRESULT __atlsoap_hr = InitializeSOAP(NULL);
if (FAILED(__atlsoap_hr))
{
SetClientError
(SOAPCLIENT_INITIALIZE_ERROR);
return __atlsoap_hr;
}

CleanupClient();

CComPtr<IStream> __atlsoap_spReadStream;
__CInteropTest_echoString_struct __params;
memset(&__params, 0x00, sizeof(__params));
__params.inputString = inputString;

__atlsoap_hr = SetClientStruct(&__params, 0);
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_OUTOFMEMORY);
goto __skip_cleanup;
}

__atlsoap_hr = GenerateResponse(GetWriteStream());
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_GENERATE_ERROR);
goto __skip_cleanup;
}

__atlsoap_hr = SendRequest(_T("SOAPAction:
\"http://stage-
internal.reflectivity.com/nusoap_server.html\"\r\n"));
if (FAILED(__atlsoap_hr))
{
goto __skip_cleanup;
}
__atlsoap_hr = GetReadStream
(&__atlsoap_spReadStream);
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_READ_ERROR);
goto __skip_cleanup;
}

// cleanup any in/out-params and out-headers from
previous calls
Cleanup();
__atlsoap_hr = BeginParse(__atlsoap_spReadStream);
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_PARSE_ERROR);
goto __cleanup;
}

*__retval = __params.__retval;
goto __skip_cleanup;

__cleanup:
Cleanup();
__skip_cleanup:
ResetClientState(true);
memset(&__params, 0x00, sizeof(__params));
return __atlsoap_hr;
}

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

HRESULT __atlsoap_hr = InitializeSOAP(NULL);
if (FAILED(__atlsoap_hr))
{
SetClientError
(SOAPCLIENT_INITIALIZE_ERROR);
return __atlsoap_hr;
}

CleanupClient();

CComPtr<IStream> __atlsoap_spReadStream;
__CInteropTest_multInt_struct __params;
memset(&__params, 0x00, sizeof(__params));
__params.input = input;

__atlsoap_hr = SetClientStruct(&__params, 1);
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_OUTOFMEMORY);
goto __skip_cleanup;
}

__atlsoap_hr = GenerateResponse(GetWriteStream());
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_GENERATE_ERROR);
goto __skip_cleanup;
}

__atlsoap_hr = SendRequest(_T("SOAPAction:
\"http://stage-
internal.reflectivity.com/nusoap_server.html\"\r\n"));
if (FAILED(__atlsoap_hr))
{
goto __skip_cleanup;
}
__atlsoap_hr = GetReadStream
(&__atlsoap_spReadStream);
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_READ_ERROR);
goto __skip_cleanup;
}

// cleanup any in/out-params and out-headers from
previous calls
Cleanup();
__atlsoap_hr = BeginParse(__atlsoap_spReadStream);
if (FAILED(__atlsoap_hr))
{
SetClientError(SOAPCLIENT_PARSE_ERROR);
goto __cleanup;
}

*__retval = __params.__retval;
goto __skip_cleanup;

__cleanup:
Cleanup();
__skip_cleanup:
ResetClientState(true);
memset(&__params, 0x00, sizeof(__params));
return __atlsoap_hr;
}

template <typename TClient>
ATL_NOINLINE inline const _soapmap **
CInteropTestT<TClient>::GetFunctionMap()
{
return __CInteropTest_funcs;
}

template <typename TClient>
ATL_NOINLINE inline const _soapmap **
CInteropTestT<TClient>::GetHeaderMap()
{
static const _soapmapentry
__CInteropTest_echoString_atlsoapheader_entries[] =
{
{ 0x00000000 }
};

static const _soapmap
__CInteropTest_echoString_atlsoapheader_map =
{
0xC9995F96,
"echoString",
L"echoString",
sizeof("echoString")-1,
sizeof("echoString")-1,
SOAPMAP_HEADER,

__CInteropTest_echoString_atlsoapheader_entries,
0,
0,
-1,
SOAPFLAG_NONE | SOAPFLAG_RPC |
SOAPFLAG_ENCODED,
0x534A4B71,
"http://soapinterop.org/",
L"http://soapinterop.org/",
sizeof("http://soapinterop.org/")-1
};

static const _soapmapentry
__CInteropTest_multInt_atlsoapheader_entries[] =
{
{ 0x00000000 }
};

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

__CInteropTest_multInt_atlsoapheader_entries,
0,
0,
-1,
SOAPFLAG_NONE | SOAPFLAG_RPC |
SOAPFLAG_ENCODED,
0x534A4B71,
"http://soapinterop.org/",
L"http://soapinterop.org/",
sizeof("http://soapinterop.org/")-1
};
static const _soapmap * __CInteropTest_headers[] =
{

&__CInteropTest_echoString_atlsoapheader_map,
&__CInteropTest_multInt_atlsoapheader_map,
NULL
};

return __CInteropTest_headers;
}

template <typename TClient>
ATL_NOINLINE inline void *
CInteropTestT<TClient>::GetHeaderValue()
{
return this;
}

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

template <typename TClient>
ATL_NOINLINE inline const char *
CInteropTestT<TClient>::GetServiceName()
{
return NULL;
}

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

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

template <typename TClient>
ATL_NOINLINE inline HRESULT
CInteropTestT<TClient>::GetClientReader(ISAXXMLRea der
**ppReader)
{
if (ppReader == NULL)
{
return E_INVALIDARG;
}

CComPtr<ISAXXMLReader> spReader = GetReader();
if (spReader.p != NULL)
{
*ppReader = spReader.Detach();
return S_OK;
}
return TClient::GetClientReader(ppReader);
}

} // 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 4140

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

Similar topics

0
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...
0
by: Leonid | last post by:
Thanks a lot for your time! Here is WSDL: <?xml version="1.0" encoding="utf-8"?>
0
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...
0
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...
4
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...
16
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...
1
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
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...
2
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.