C# web service and sproxy generated proxy problem

M

Mark Sztainbok

I have a C# web service for which I have generated a C++ proxy using sproxy.
I'm having a problem with the generated proxy and one of the methods of the
web service. The method has the following signature:
public bool submitTemperatureData(String userId, String password, String
consignmentGUID, String uid, ConfigurationData configuration,
TemperatureData[] data, bool handheld, SignatureData[] signatureData)

The problem I'm having is that sproxy generates a proxy with the following
code which doesn't allow me to pass an null array for the data or
signatureData parameters (it returns E_POINTER):

emplate <typename TClient>

inline HRESULT CExagoDataServiceT<TClient>::submitTemperatureData(

BSTR userId,

BSTR password,

BSTR consignmentGUID,

BSTR uid,

ConfigurationData configuration,

TemperatureData* data, int __data_nSizeIs,

bool handheld,

SignatureData* signatureData, int __signatureData_nSizeIs,

bool* submitTemperatureDataResult

)

{

if ( data == NULL )

return E_POINTER;

if ( signatureData == NULL )

return E_POINTER;

if ( submitTemperatureDataResult == NULL )

return E_POINTER;



This problem has only happened since I upgraded my Visual Studio .NET 2002
project to Visual Studio .NET 2003 so the behaviour is specific to the
proxies generated by the 2003 version of sproxy.

Has anyone else had this problem? If so, how did they fix it? Is there
anyway to fix it without having to manually change the generated proxy file?

Any help would be greatly appreciated.

Thanks,

Mark
 
D

Dan Rogers

Hi,

I don't think it's valid to pass a null pointer for an array that is
required. An option you do have is to change the generated code to the
behaviors you desire.

I hope this helps,

Dan Rogers
Microsoft Corporation
--------------------
From: "Mark Sztainbok" <[email protected]>
Subject: C# web service and sproxy generated proxy problem
Date: Wed, 1 Dec 2004 22:13:10 +1100
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices,microsoft.public.vc.atl
,microsoft.public.vc.utilities,microsoft.public.webservices
NNTP-Posting-Host: adsl-21-105.swiftdsl.com.au 218.214.21.105
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.vc.atl:65264
microsoft.public.vc.utilities:17001 microsoft.public.webservices:2570
microsoft.public.dotnet.framework.aspnet.webservices:26929
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

I have a C# web service for which I have generated a C++ proxy using sproxy.
I'm having a problem with the generated proxy and one of the methods of the
web service. The method has the following signature:
public bool submitTemperatureData(String userId, String password, String
consignmentGUID, String uid, ConfigurationData configuration,
TemperatureData[] data, bool handheld, SignatureData[] signatureData)

The problem I'm having is that sproxy generates a proxy with the following
code which doesn't allow me to pass an null array for the data or
signatureData parameters (it returns E_POINTER):

emplate <typename TClient>

inline HRESULT CExagoDataServiceT<TClient>::submitTemperatureData(

BSTR userId,

BSTR password,

BSTR consignmentGUID,

BSTR uid,

ConfigurationData configuration,

TemperatureData* data, int __data_nSizeIs,

bool handheld,

SignatureData* signatureData, int __signatureData_nSizeIs,

bool* submitTemperatureDataResult

)

{

if ( data == NULL )

return E_POINTER;

if ( signatureData == NULL )

return E_POINTER;

if ( submitTemperatureDataResult == NULL )

return E_POINTER;



This problem has only happened since I upgraded my Visual Studio .NET 2002
project to Visual Studio .NET 2003 so the behaviour is specific to the
proxies generated by the 2003 version of sproxy.

Has anyone else had this problem? If so, how did they fix it? Is there
anyway to fix it without having to manually change the generated proxy file?

Any help would be greatly appreciated.

Thanks,

Mark
 
M

Mark Sztainbok

Thing is that according to the WSDL file, the array isn't required as it has
minOccurs =0.

The proxy generated by the 2002 version of sproxy allowed a null array to be
passed and converted it correctly to an XML nil which became null again when
the ASMX file processed it.

If I pass a zero length array to the 2003 proxy, it generates an assertion
but the data still successfully goes to the web service so the 2003 version
of atlsoap.h does support zero length and null arrays. Just code in the
proxy that disallows.

I could manually remove the checks for the null arrays but this would cause
problems within my team as if they have to regenerate the proxy for some
reason, they may not remember/know to make the changes to the generated
code.

Any ideas of a way around this?

Mark

Dan Rogers said:
Hi,

I don't think it's valid to pass a null pointer for an array that is
required. An option you do have is to change the generated code to the
behaviors you desire.

I hope this helps,

Dan Rogers
Microsoft Corporation
--------------------
From: "Mark Sztainbok" <[email protected]>
Subject: C# web service and sproxy generated proxy problem
Date: Wed, 1 Dec 2004 22:13:10 +1100
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <#[email protected]>
Newsgroups:
microsoft.public.dotnet.framework.aspnet.webservices,microsoft.public.vc.atl
,microsoft.public.vc.utilities,microsoft.public.webservices
NNTP-Posting-Host: adsl-21-105.swiftdsl.com.au 218.214.21.105
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.vc.atl:65264
microsoft.public.vc.utilities:17001 microsoft.public.webservices:2570
microsoft.public.dotnet.framework.aspnet.webservices:26929
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

I have a C# web service for which I have generated a C++ proxy using sproxy.
I'm having a problem with the generated proxy and one of the methods of the
web service. The method has the following signature:
public bool submitTemperatureData(String userId, String password, String
consignmentGUID, String uid, ConfigurationData configuration,
TemperatureData[] data, bool handheld, SignatureData[] signatureData)

The problem I'm having is that sproxy generates a proxy with the following
code which doesn't allow me to pass an null array for the data or
signatureData parameters (it returns E_POINTER):

emplate <typename TClient>

inline HRESULT CExagoDataServiceT<TClient>::submitTemperatureData(

BSTR userId,

BSTR password,

BSTR consignmentGUID,

BSTR uid,

ConfigurationData configuration,

TemperatureData* data, int __data_nSizeIs,

bool handheld,

SignatureData* signatureData, int __signatureData_nSizeIs,

bool* submitTemperatureDataResult

)

{

if ( data == NULL )

return E_POINTER;

if ( signatureData == NULL )

return E_POINTER;

if ( submitTemperatureDataResult == NULL )

return E_POINTER;



This problem has only happened since I upgraded my Visual Studio .NET 2002
project to Visual Studio .NET 2003 so the behaviour is specific to the
proxies generated by the 2003 version of sproxy.

Has anyone else had this problem? If so, how did they fix it? Is there
anyway to fix it without having to manually change the generated proxy file?

Any help would be greatly appreciated.

Thanks,

Mark
 
M

Mark Sztainbok

Another problem is that when I do a Rebuild on the project, it regenerates
the proxy using sproxy and overwrites any changes that I've made...

Mark

Mark Sztainbok said:
Thing is that according to the WSDL file, the array isn't required as it has
minOccurs =0.

The proxy generated by the 2002 version of sproxy allowed a null array to be
passed and converted it correctly to an XML nil which became null again when
the ASMX file processed it.

If I pass a zero length array to the 2003 proxy, it generates an assertion
but the data still successfully goes to the web service so the 2003 version
of atlsoap.h does support zero length and null arrays. Just code in the
proxy that disallows.

I could manually remove the checks for the null arrays but this would cause
problems within my team as if they have to regenerate the proxy for some
reason, they may not remember/know to make the changes to the generated
code.

Any ideas of a way around this?

Mark

Dan Rogers said:
Hi,

I don't think it's valid to pass a null pointer for an array that is
required. An option you do have is to change the generated code to the
behaviors you desire.

I hope this helps,

Dan Rogers
Microsoft Corporation
microsoft.public.dotnet.framework.aspnet.webservices,microsoft.public.vc.atl
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.vc.atl:65264
microsoft.public.vc.utilities:17001 microsoft.public.webservices:2570
microsoft.public.dotnet.framework.aspnet.webservices:26929
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

I have a C# web service for which I have generated a C++ proxy using sproxy.
I'm having a problem with the generated proxy and one of the methods of the
web service. The method has the following signature:
public bool submitTemperatureData(String userId, String password, String
consignmentGUID, String uid, ConfigurationData configuration,
TemperatureData[] data, bool handheld, SignatureData[] signatureData)

The problem I'm having is that sproxy generates a proxy with the following
code which doesn't allow me to pass an null array for the data or
signatureData parameters (it returns E_POINTER):

emplate <typename TClient>

inline HRESULT CExagoDataServiceT<TClient>::submitTemperatureData(

BSTR userId,

BSTR password,

BSTR consignmentGUID,

BSTR uid,

ConfigurationData configuration,

TemperatureData* data, int __data_nSizeIs,

bool handheld,

SignatureData* signatureData, int __signatureData_nSizeIs,

bool* submitTemperatureDataResult

)

{

if ( data == NULL )

return E_POINTER;

if ( signatureData == NULL )

return E_POINTER;

if ( submitTemperatureDataResult == NULL )

return E_POINTER;



This problem has only happened since I upgraded my Visual Studio .NET 2002
project to Visual Studio .NET 2003 so the behaviour is specific to the
proxies generated by the 2003 version of sproxy.

Has anyone else had this problem? If so, how did they fix it? Is there
anyway to fix it without having to manually change the generated proxy file?

Any help would be greatly appreciated.

Thanks,

Mark
 
D

Dan Rogers

Some issues here. A "nill" in XML is not the same thing as not passing the
element since on the wire it turns into "<fooElement nill="true"/> instead
of not being expressed. Have you considered a less cryptic interface - I
was not able to figure out why you would want to process a nothing? If you
really mean to make it an optional processing element, try encapsulating
the arguments here into a type on it's own, and then making that type the
argument.

I think you are stumbling on some of the cross platform/language issues
that you'll encounter with this kind of interface. I do know that the
sproxy tool does what it does, so we can't change that. To me, I think
there is a big difference between a nill argument and a null pointer - and
since there aren't really pointers in the CLR, I think that this is a
work-around for the differences between the languages ... it seems to be
saying "you must pass a pointer.".

Sorry I am not of more help here.

Dan
--------------------
From: "Mark Sztainbok" <[email protected]>
References: <#[email protected]>
Subject: Re: C# web service and sproxy generated proxy problem
Date: Thu, 2 Dec 2004 08:59:03 +1100
Lines: 132
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: ext58.myretsu.com 203.62.151.58
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:26964
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

Thing is that according to the WSDL file, the array isn't required as it has
minOccurs =0.

The proxy generated by the 2002 version of sproxy allowed a null array to be
passed and converted it correctly to an XML nil which became null again when
the ASMX file processed it.

If I pass a zero length array to the 2003 proxy, it generates an assertion
but the data still successfully goes to the web service so the 2003 version
of atlsoap.h does support zero length and null arrays. Just code in the
proxy that disallows.

I could manually remove the checks for the null arrays but this would cause
problems within my team as if they have to regenerate the proxy for some
reason, they may not remember/know to make the changes to the generated
code.

Any ideas of a way around this?

Mark

Dan Rogers said:
Hi,

I don't think it's valid to pass a null pointer for an array that is
required. An option you do have is to change the generated code to the
behaviors you desire.

I hope this helps,

Dan Rogers
Microsoft Corporation
--------------------
From: "Mark Sztainbok" <[email protected]>
Subject: C# web service and sproxy generated proxy problem
Date: Wed, 1 Dec 2004 22:13:10 +1100
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <#[email protected]>
Newsgroups:
microsoft.public.dotnet.framework.aspnet.webservices,microsoft.public.vc.at l
,microsoft.public.vc.utilities,microsoft.public.webservices
NNTP-Posting-Host: adsl-21-105.swiftdsl.com.au 218.214.21.105
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP1 0
phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.vc.atl:65264
microsoft.public.vc.utilities:17001 microsoft.public.webservices:2570
microsoft.public.dotnet.framework.aspnet.webservices:26929
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

I have a C# web service for which I have generated a C++ proxy using sproxy.
I'm having a problem with the generated proxy and one of the methods of the
web service. The method has the following signature:
public bool submitTemperatureData(String userId, String password, String
consignmentGUID, String uid, ConfigurationData configuration,
TemperatureData[] data, bool handheld, SignatureData[] signatureData)

The problem I'm having is that sproxy generates a proxy with the following
code which doesn't allow me to pass an null array for the data or
signatureData parameters (it returns E_POINTER):

emplate <typename TClient>

inline HRESULT CExagoDataServiceT<TClient>::submitTemperatureData(

BSTR userId,

BSTR password,

BSTR consignmentGUID,

BSTR uid,

ConfigurationData configuration,

TemperatureData* data, int __data_nSizeIs,

bool handheld,

SignatureData* signatureData, int __signatureData_nSizeIs,

bool* submitTemperatureDataResult

)

{

if ( data == NULL )

return E_POINTER;

if ( signatureData == NULL )

return E_POINTER;

if ( submitTemperatureDataResult == NULL )

return E_POINTER;



This problem has only happened since I upgraded my Visual Studio .NET 2002
project to Visual Studio .NET 2003 so the behaviour is specific to the
proxies generated by the 2003 version of sproxy.

Has anyone else had this problem? If so, how did they fix it? Is there
anyway to fix it without having to manually change the generated proxy file?

Any help would be greatly appreciated.

Thanks,

Mark
 
M

Mark Sztainbok

I've done a diff between the source of atlsoap.h in VS .NET 2002 and 2003
and also done one of the generated proxy and there is minimal differences
between the 2 and the only change in the function calls is the extra NULL
checks at the beginning.

The code was interacting perfectly with the ASP.NET web service when it was
compiled with VC++ 2002 so why did they make the change in VC++ 2003 as it
breaks code that previously worked?????

Anyway, I changed the code to use a C# wrapper struct that simply contains
the array as suggested and sproxy allows me to pass the array as NULL and
works so looks like I have a solution. Just annoying that I had to do this.

Mark

Dan Rogers said:
Some issues here. A "nill" in XML is not the same thing as not passing the
element since on the wire it turns into "<fooElement nill="true"/> instead
of not being expressed. Have you considered a less cryptic interface - I
was not able to figure out why you would want to process a nothing? If you
really mean to make it an optional processing element, try encapsulating
the arguments here into a type on it's own, and then making that type the
argument.

I think you are stumbling on some of the cross platform/language issues
that you'll encounter with this kind of interface. I do know that the
sproxy tool does what it does, so we can't change that. To me, I think
there is a big difference between a nill argument and a null pointer - and
since there aren't really pointers in the CLR, I think that this is a
work-around for the differences between the languages ... it seems to be
saying "you must pass a pointer.".

Sorry I am not of more help here.

Dan
--------------------
From: "Mark Sztainbok" <[email protected]>
References: <#[email protected]>
Subject: Re: C# web service and sproxy generated proxy problem
Date: Thu, 2 Dec 2004 08:59:03 +1100
Lines: 132
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: ext58.myretsu.com 203.62.151.58
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:26964
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

Thing is that according to the WSDL file, the array isn't required as it has
minOccurs =0.

The proxy generated by the 2002 version of sproxy allowed a null array to be
passed and converted it correctly to an XML nil which became null again when
the ASMX file processed it.

If I pass a zero length array to the 2003 proxy, it generates an assertion
but the data still successfully goes to the web service so the 2003 version
of atlsoap.h does support zero length and null arrays. Just code in the
proxy that disallows.

I could manually remove the checks for the null arrays but this would cause
problems within my team as if they have to regenerate the proxy for some
reason, they may not remember/know to make the changes to the generated
code.

Any ideas of a way around this?

Mark

Dan Rogers said:
Hi,

I don't think it's valid to pass a null pointer for an array that is
required. An option you do have is to change the generated code to the
behaviors you desire.

I hope this helps,

Dan Rogers
Microsoft Corporation
--------------------
From: "Mark Sztainbok" <[email protected]>
Subject: C# web service and sproxy generated proxy problem
Date: Wed, 1 Dec 2004 22:13:10 +1100
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <#[email protected]>
Newsgroups:
microsoft.public.dotnet.framework.aspnet.webservices,microsoft.public.vc.at
l
,microsoft.public.vc.utilities,microsoft.public.webservices
NNTP-Posting-Host: adsl-21-105.swiftdsl.com.au 218.214.21.105
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP1
0
phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.vc.atl:65264
microsoft.public.vc.utilities:17001 microsoft.public.webservices:2570
microsoft.public.dotnet.framework.aspnet.webservices:26929
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

I have a C# web service for which I have generated a C++ proxy using
sproxy.
I'm having a problem with the generated proxy and one of the methods of
the
web service. The method has the following signature:
public bool submitTemperatureData(String userId, String password, String
consignmentGUID, String uid, ConfigurationData configuration,
TemperatureData[] data, bool handheld, SignatureData[] signatureData)

The problem I'm having is that sproxy generates a proxy with the following
code which doesn't allow me to pass an null array for the data or
signatureData parameters (it returns E_POINTER):

emplate <typename TClient>

inline HRESULT CExagoDataServiceT<TClient>::submitTemperatureData(

BSTR userId,

BSTR password,

BSTR consignmentGUID,

BSTR uid,

ConfigurationData configuration,

TemperatureData* data, int __data_nSizeIs,

bool handheld,

SignatureData* signatureData, int __signatureData_nSizeIs,

bool* submitTemperatureDataResult

)

{

if ( data == NULL )

return E_POINTER;

if ( signatureData == NULL )

return E_POINTER;

if ( submitTemperatureDataResult == NULL )

return E_POINTER;



This problem has only happened since I upgraded my Visual Studio .NET 2002
project to Visual Studio .NET 2003 so the behaviour is specific to the
proxies generated by the 2003 version of sproxy.

Has anyone else had this problem? If so, how did they fix it? Is there
anyway to fix it without having to manually change the generated proxy
file?

Any help would be greatly appreciated.

Thanks,

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top