Managed C++ Web Service - strange reflection problems

Discussion in 'ASP .Net Web Services' started by Ray Deese, May 6, 2004.

  1. Ray Deese

    Ray Deese Guest

    Hi

    I have quite a strange problem that I can't seem to overcome on my own. I have a managed C++ web service which has one webmethod. This method returns an array of a class with 1 property in it. This array is created by another class which has IEnumerable and IEnumerator as its base class so that I can DataBind this type in the consuming application. The web service compiles fine but when you run it, it returns the following errors in the stack trace

    [NullReferenceException: Object reference not set to an instance of an object.

    [InvalidOperationException: There was an error reflecting 'QuickSortResult'.

    [InvalidOperationException: Method CService.QuickSort can not be reflected.

    [InvalidOperationException: Unable to handle request.

    [InvalidOperationException: Failed to handle request.

    I have created 2 different projects, a console application and a class library - both of those would compile the same code (mines the system::web stuff) just fine - the console app would run nicely and the class library was able to be referenced inside of another application and invoked. So suffice to say, I'm stuck! Here is the pertinent code below

    Number.h simply implement a class with a single property with get & set implemente

    -----------------------------------------------------------------
    //numbers.
    namespace numbersnamespac

    __gc public class numbers : public IEnumerable, public IEnumerato

    private
    static int position = -1;

    public:
    number *enumerator[];

    numbers(

    enumerator = new number * [NUM_ITEMS]

    ------------------------------------------------------------------------
    //Main.h
    __gc public class CServic
    {
    public:
    [WebMethod
    numbers* QuickSort();
    ------------------------------------------------------------------------
    //Main.cp
    numbers* CService::QuickSort(
    {
    //non important code is left ou

    numbers *sdata = new numbers()

    for (i = 0; i < NUM_ITEMS; i++
    sdata->enumerator = new number(__numbers);

    return sdata


    Any help/suggections are much appreciated, my email address is listed as well in case you would like to contact me that way

    Thanks in advance
    -Ray
    Ray Deese, May 6, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sharon McCarty
    Replies:
    0
    Views:
    345
    Sharon McCarty
    Nov 1, 2004
  2. Jorge Loureriro
    Replies:
    2
    Views:
    268
    Rolf Tollerud
    Feb 11, 2004
  3. Sharon McCarty

    Accessing current user in Managed C++ Web Service?

    Sharon McCarty, Nov 1, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    169
    Sharon McCarty
    Nov 9, 2004
  4. rgarf

    Managed C++ Web Service

    rgarf, Apr 6, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    115
    rgarf
    Apr 6, 2006
  5. grompl
    Replies:
    1
    Views:
    154
    Michel Posseth [MCP]
    Jun 24, 2006
Loading...

Share This Page