RE: Sites web service in C++
- From: "Santosh Joseph" <Santosh Joseph@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 24 May 2005 08:08:09 -0700
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[])
.
- Prev by Date: Re: Adding Webparts to MySites programmatically
- Next by Date: Manage Content only adds lists to "Home"
- Previous by thread: DirectReports, Issue with search webservice and profile:Manager property
- Next by thread: Manage Content only adds lists to "Home"
- Index(es):
Relevant Pages
|