473,388 Members | 1,492 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,388 software developers and data experts.

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

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
Nov 23 '05 #1
2 6052
DC
you need to look at p/invoke,
try the interop newsgroup.

The high-order bit here is not webservices, but p/invoke.

"WTH" <sp*******@Ih8it.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 23 '05 #2
WTH
DC <di****@online.microsoft.com> loquated like no one had ever loquated
before with:
you need to look at p/invoke,
try the interop newsgroup.

The high-order bit here is not webservices, but p/invoke.


Could you give me a little clarification about that before I go to the
interop ng?

I mean, I trace it into the ATL soap code and see where an ATL function
asserts that the pointer I pass in is not NULL, and then, and the end of
this same method, it calls:

*in_pMyPoint = _params.AtlCopyOfMyStructure

WTH
Nov 23 '05 #3

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

Similar topics

4
by: Amr Mostafa | last post by:
Hello :) I'm trying to write a script that deals with a web service. I'm using NuSoap class. my question is : Can I pass some variables By Reference to the web service and get the result back...
19
by: Method Man | last post by:
I understand that arrays and structs can't be passed by value into and out of functions since they can be arbitrarily big. My question is: Why are types allowed to be passed by value? Couldn't my...
8
by: kalinga1234 | last post by:
there is a problem regarding passing array of characters to another function(without using structures,pointer etc,).can anybody help me to solve the problem.
33
by: Peter Seaman | last post by:
I understand that structures are value types and arrays and classes are reference types. But what about arrays as members of structures i.e. as in C struct x { int n; int a; }
0
by: SB | last post by:
I have few web service methods that take and return array of structures. I created these web methods in .NET with the default encoding (document/literal). They worked perfectly during my testing....
10
by: David Fort | last post by:
Hi, I'm upgrading a VB6 app to VB.net and I'm having a problem with a call to a function provided in a DLL. The function takes the address of a structure which it will fill in with values. I...
6
by: =?Utf-8?B?QWxleGFuZGVyZmU=?= | last post by:
Hi, I have a C# program that uses an unmanaged dll that has a function similar to the signature below : void f(out MyStruct arr, out int num); // num = actual array length returned The array...
8
by: S. | last post by:
Hi all, Can someone please help me with this? I have the following struct: typedef struct { char *name; int age; } Student;
5
by: Eric Fortin | last post by:
I have a disconnected handheld device that I want to send the results of the day to a database through a web service (on an intranet) What's the best method to do this? XML? Tab...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.