Hi,
I am developing both a webservice and a Windows Forms webservice client.
After I've deployed my webservice to the webserver I update my webservice
reference in my client application, but the code generated by the webservice
import program (wsdl version 1.1.4322.573) does not compile. I have to edit
it manually to get it working.
My webservice looks something like this (cut-down):
namespace MyNamespace {
public __gc class MyWebService: public System::Web::Services::WebService
{
public:
__value struct MyDataStruct {
int id;
String *name;
};
// ...
private:
// ...
public:
// web methods go here...
[System::Web::Services::WebMethod(Description="Give s some data
back")]
MyDataStruct GetData(void);
};
}
Now when I import this with VC++ in my client application, it generates a
header file that looks something like this:
namespace MyNamespace {
public __gc class MyWebService: public System::Web::Services::WebService
{
public:
[System::Xml::Serialization::XmlTypeAttribute(Names pace=S"http://mynamespace
")]
public __gc class MyDataStruct {
/// <remarks/>
public: System::Int32 id;
/// <remarks/>
public: System::String * name;
};
// ...
private:
// ...
public:
// web methods go here...
inline MyWebService::MyDataStruct * MyWebService::GetData(void)
{ // <-- Error here
System::Object * results[] = this->Invoke(S"GetData", new
System::Object * [0]);
return (__try_cast<MyWebService::MyDataStruct * >(results[0]));
// <-- Error here
};
};
}
This code will not compile because MyWebService::MyDataStruct is not a valid
type when defined within class MyWebService. So I have to manually replace
all occurences of "MyWebService::MyDataStruct" to "MyDataStruct" for the
code to compile (and thus before I can use it).
This is rather annoying so I'd like to ask if anyone has experienced this
before and could tell me if I am doing something wrong or this is just a bug
and (hopefully) will be fixed soon.
Thanks in advance.
Best Regards,
Thijs