Passing arrays of structs from C# web service to raw C++?

W

WTH

I have a C# webservice that returns an array of struct data back to a
calling client.

It works fine when tested via the ASMX page; however, I don't know how to
make the call to this particular method from C++.

If my web method is declared as:

public MyStruct[] GetData()

and returns back a web service allocated array of structs, how do I call
this from C++?

Intellisense tells me that the signature (to C++) is:

GetData( MyService::MyStruct** GetDataResult, int* GetDataResult_nSizeIs )

How am I supposed to be declaring the C++ local variable I want the results
returned in?

Am I supposed to pre-allocate an array of structs to receive the data?
Am I supposed to supply an array of struct pointers and then I'm responsible
for releasing them?

I am having a hard time finding documentation on this...

Thanks,
WTH
 
W

WTH

This is weird.

The auto-generated SOAP code in my C++ ATL project acts like it expects a
pre-allocated array and then proceeds to act like it does not...

I can get the values if I just declare

MyService::MyStruct* l_pStruct;

and then iterate it via:

l_pStruct++;

Is that how I'm supposed to be going through these values?
Seems like a great way to leak memory.

WTH
 

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,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top