Visual C++ .NET/Network/Web Services

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Web Service with C++.net

<source lang="csharp"> <%@ WebService Class=MyServiceClass %>

using namespace System; using namespace System::Web; using namespace System::Web::Services; namespace MyService {

 [WebService(Description="Web Service",Namespace="http://www.yourdomain.ru")]
   public ref class UltraMaxServiceClass : public WebService
   {
   public:
     [WebMethod(EnableSession=false, CacheDuration=60,BufferResponse=true, Description="descr here")]
   String^ Uppercase(String^ text)
   {
     return text->ToUpper();
   }
   [WebMethod(Description="Adds two integers")]
   int Add(int a, int b)
   {
     return a + b;
   }
   
   [WebMethod]
   void DoNothing() {}
 };

}

 </source>