2010-11-05 26 views
3

J'ai rencontré un problème avec le code généré par SvcUtil lors de la génération d'un client WCF en C++/CLI. Quand j'exécute "SvcUtil.exe/t: code/l: cpp http://localhost:2772/mex/", il génère un fichier d'en-tête contenant la classe client ci-dessous.Comment réparer le code généré par SvcUtil avec des erreurs pour un client WCF C++/CLI?

[System::Diagnostics::DebuggerStepThroughAttribute, 
System::CodeDom::Compiler::GeneratedCodeAttribute(L"System.ServiceModel", L"3.0.0.0")] 
public ref class DemoClient : public System::ServiceModel::ClientBase<IDemo^ >, public IDemo 
{ 

    public: DemoClient(); 
    public: DemoClient(System::String^ endpointConfigurationName); 
    public: DemoClient(System::String^ endpointConfigurationName, System::String^ remoteAddress); 
    public: DemoClient(System::String^ endpointConfigurationName, System::ServiceModel::EndpointAddress^ remoteAddress); 
    public: DemoClient(System::ServiceModel::Channels::Binding^ binding, System::ServiceModel::EndpointAddress^ remoteAddress); 
    public: virtual System::String^ GetDemoString() sealed; 
}; 

Il en résulte beaucoup d'erreurs, ce que je ne m'attendais pas étant donné qu'il est généré du code.

Demo.h(41): error C3766: 'DemoClient' must provide an implementation for the interface method 'void System::ServiceModel::ICommunicationObject::Closed::add(System::EventHandler ^)' : see declaration of 'System::ServiceModel::ICommunicationObject::Closed::add' 
Demo.h(41): error C3766: 'DemoClient' must provide an implementation for the interface method 'void System::ServiceModel::ICommunicationObject::Closed::remove(System::EventHandler ^)' : see declaration of 'System::ServiceModel::ICommunicationObject::Closed::remove' 
Demo.h(41): error C3766: 'DemoClient' must provide an implementation for the interface method 'void System::ServiceModel::ICommunicationObject::Closing::add(System::EventHandler ^)' : see declaration of 'System::ServiceModel::ICommunicationObject::Closing::add' 
Demo.h(41): error C3766: 'DemoClient' must provide an implementation for the interface method 'void System::ServiceModel::ICommunicationObject::Closing::remove(System::EventHandler ^)' : see declaration of 'System::ServiceModel::ICommunicationObject::Closing::remove' 
Demo.h(41): error C3766: 'DemoClient' must provide an implementation for the interface method 'void System::ServiceModel::ICommunicationObject::Faulted::add(System::EventHandler ^)' : see declaration of 'System::ServiceModel::ICommunicationObject::Faulted::add' 
Demo.h(41): error C3766: 'DemoClient' must provide an implementation for the interface method 'void System::ServiceModel::ICommunicationObject::Faulted::remove(System::EventHandler ^)' : see declaration of 'System::ServiceModel::ICommunicationObject::Faulted::remove' 
Demo.h(41): error C3766: 'DemoClient' must provide an implementation for the interface method 'void System::ServiceModel::ICommunicationObject::Opened::add(System::EventHandler ^)' : see declaration of 'System::ServiceModel::ICommunicationObject::Opened::add' 
Demo.h(41): error C3766: 'DemoClient' must provide an implementation for the interface method 'void System::ServiceModel::ICommunicationObject::Opened::remove(System::EventHandler ^)' : see declaration of 'System::ServiceModel::ICommunicationObject::Opened::remove' 
Demo.h(41): error C3766: 'DemoClient' must provide an implementation for the interface method 'void System::ServiceModel::ICommunicationObject::Opening::add(System::EventHandler ^)' : see declaration of 'System::ServiceModel::ICommunicationObject::Opening::add' 
Demo.h(41): error C3766: 'DemoClient' must provide an implementation for the interface method 'void System::ServiceModel::ICommunicationObject::Opening::remove(System::EventHandler ^)' : see declaration of 'System::ServiceModel::ICommunicationObject::Opening::remove' 

Des suggestions sur ce que j'ai besoin de changer ou d'ajouter pour corriger cela? Devrais-je simplement ajouter une implémentation pour les méthodes d'interface listées?

Répondre