RE: Sites web service in C++

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I'm getting the same error. I think the generated wrapper code is incorrect.
For my project I changed to use C# and it worked fine, so its my conclusion
that wsdl.exe is generating invalid code for Managed C++. Can you post your
wsdl?

"bill darcy" wrote:

> i'm having difficulty using the Sites web service. i'm writting an app in
> Managed C++. i used the Add Web Reference wizard to create a wrapper class
> for the Sites web service.
>
> the first problem i run into is that wrapper class fails to compile. the
> errors are below as is some code from the wrapper class that the compiler
> points out.
>
> i read somewhere that its not necessary to pass a reference to a gc type
> array, because in MC++ they're always passed by reference. so, i tried to
> remove the '&' before the TemplateList parameters. should i do something else?
>
> i'm not sure my calling code is correct either.
>
> // an array of Templates
> SPSites::Template* TemplateList[] = new SPSites::Template*[1000];
>
> // get the Site Templates
> System::UInt32 uReturn = pSites->GetSiteTemplates(1033, TemplateList);
>
> when i run this code, i get an exception who's Message is "Index was outside
> the bounds of the array". the array is big enuf. my SP site doesn't have >
> 1000 sites or templates and making that array larger doesn't help.
>
> are my problems how i've changed the generated Sites class and/or the way
> i've declared or passed the Template array?
>
> is the 2nd argument to GetSiteTemplates "an array of pointers to an array of
> Templates" or "a pointer to an array of Templates" or something else? how do
> i properly express this in MC++
>
>
> thanks.
>
>
> sites wrapper compiler errors:
> ----------------------------------------
> sPSites.h(34) : error C2234: 'TemplateList' : arrays of references are illegal
> sPSites.h(34) : error C2691: 'SPSites::Template __gc *__gc * ' : invalid
> type for __gc array element
> sPSites.h(40) : error C2234: 'TemplateList' : arrays of references are illegal
> sPSites.h(40) : error C2691: 'SPSites::Template __gc *__gc * ' : invalid
> type for __gc array element
> sPSites.h(88) : error C2234: 'TemplateList' : arrays of references are illegal
> sPSites.h(88) : error C2691: 'SPSites::Template __gc *__gc * ' : invalid
> type for __gc array element
> sPSites.h(92) : error C2440: '=' : cannot convert from 'SPSites::Template
> __gc * __gc[]' to 'SPSites::Template __gc *__gc * __gc[] '
> Can only convert a __gc array to or from Object * or Array *
> sPSites.h(104) : error C2234: 'TemplateList' : arrays of references are
> illegal
> sPSites.h(104) : error C2691: 'SPSites::Template __gc *__gc * ' : invalid
> type for __gc array element
> sPSites.h(106) : error C2440: '=' : cannot convert from 'SPSites::Template
> __gc * __gc[]' to 'SPSites::Template __gc *__gc * __gc[] '
> Can only convert a __gc array to or from Object * or Array *
>
> generated sites wrapper class code summary:
> ------------------------------------------
> public __gc class Sites : public
> System::Web::Services::Protocols::SoapHttpClientProtocol {
>
> public:
> System::UInt32 GetSiteTemplates(System::UInt32 LCID,
> SPSites::Template * & TemplateList[]);
>
> inline System::UInt32 Sites::GetSiteTemplates(System::UInt32 LCID,
> SPSites::Template * & TemplateList[])
.



Relevant Pages

  • Sites web service in C++
    ... the first problem i run into is that wrapper class fails to compile. ... i read somewhere that its not necessary to pass a reference to a gc type ... array, because in MC++ they're always passed by reference. ... // get the Site Templates ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: I want to parse @ArrayOfDays into @d1 through @d5
    ... condition on the loop indicated that the actual array length could ... -- sending the datasource, number of bins, and bin criteria as input ... My thought was to call a wrapper from the vb.net page, ... The sub-proc would parse the input array to ...
    (comp.databases.ms-sqlserver)
  • Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl)
    ... array), although every array may have semantics of container. ... for this reason containers shouldn't be all treated as abstract arrays, ... >> for wrapped type's iterators with wrappers for wrapped type's iterators' ... wrapper for containers here... ...
    (comp.lang.ada)
  • Simplified DOM idiom for building XML - revisited
    ... overcomplicated scheme for improving how we create content using the DOM API. ... you can solve all these problems with an appropriate wrapper class ... with some very trivial parsing to allow the use of compact node definition ... array as the set of children for the preceeding node in the array. ...
    (comp.text.xml)
  • Re: C# - Interop causing AccessViolationException
    ... C++ Wrapper ... // Get pointer to frame - using SharperCV wrapped for OpenCV ... char rgb_greybar = 1; ... one of the parameters is an empty byte array ...
    (microsoft.public.dotnet.framework.interop)