Рассмотрим в качестве примера создание с помощью ASP.NET веб-службы, которая переводит любое целое десятичное число в один из форматов по выбору: двоичный, восьмеричный, десятичный.
Service1.asmx.cs.Программная логика веб-службы будет реализована на языке C# в CodeBehind файле Service1.asmx.cs:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
namespace ASPNETCalcWebService
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}
Service1.asmx.cs метод HelloWorld() на 3 новых метода, при помощи которых будут выполняться все преобразования:using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
namespace ASPNETCalcWebService
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
// Преобразование в двоичную систему счисления
[WebMethod]
public string Binary(int x) {
return Convert.ToString(x, 2);
}
// Преобразование в восьмеричную систему счисления
[WebMethod]
public string Octal(int x)
{
return Convert.ToString(x, 8);
}
// Преобразование в шестнадцатиричную систему счисления
[WebMethod]
public string Hexadecimal(int x)
{
return Convert.ToString(x, 16);
}
}
Атрибут WebMethod в этом файле указывает на то, что описываемый метод должен быть доступен по протоколу HTTP для пользователей.

<?xml version="1.0" encoding="utf-8" ?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> <s:element name="Binary"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="x" type="s:int" /> </s:sequence> </s:complexType> </s:element> <s:element name="BinaryResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="BinaryResult" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="Octal"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="x" type="s:int" /> </s:sequence> </s:complexType> </s:element> <s:element name="OctalResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="OctalResult" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="Hexadecimal"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="x" type="s:int" /> </s:sequence> </s:complexType> </s:element> <s:element name="HexadecimalResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="HexadecimalResult" type="s:string" /> </s:sequence> </s:complexType> </s:element> </s:schema> </wsdl:types> <wsdl:message name="BinarySoapIn"> <wsdl:part name="parameters" element="tns:Binary" /> </wsdl:message> <wsdl:message name="BinarySoapOut"> <wsdl:part name="parameters" element="tns:BinaryResponse" /> </wsdl:message> <wsdl:message name="OctalSoapIn"> <wsdl:part name="parameters" element="tns:Octal" /> </wsdl:message> <wsdl:message name="OctalSoapOut"> <wsdl:part name="parameters" element="tns:OctalResponse" /> </wsdl:message> <wsdl:message name="HexadecimalSoapIn"> <wsdl:part name="parameters" element="tns:Hexadecimal" /> </wsdl:message> <wsdl:message name="HexadecimalSoapOut"> <wsdl:part name="parameters" element="tns:HexadecimalResponse" /> </wsdl:message> <wsdl:portType name="ServiceSoap"> <wsdl:operation name="Binary"> <wsdl:input message="tns:BinarySoapIn" /> <wsdl:output message="tns:BinarySoapOut" /> </wsdl:operation> <wsdl:operation name="Octal"> <wsdl:input message="tns:OctalSoapIn" /> <wsdl:output message="tns:OctalSoapOut" /> </wsdl:operation> <wsdl:operation name="Hexadecimal"> <wsdl:input message="tns:HexadecimalSoapIn" /> <wsdl:output message="tns:HexadecimalSoapOut" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="ServiceSoap" type="tns:ServiceSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="Binary"> <soap:operation soapAction="http://tempuri.org/Binary" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="Octal"> <soap:operation soapAction="http://tempuri.org/Octal" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="Hexadecimal"> <soap:operation soapAction="http://tempuri.org/Hexadecimal" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="ServiceSoap12" type="tns:ServiceSoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="Binary"> <soap12:operation soapAction="http://tempuri.org/Binary" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="Octal"> <soap12:operation soapAction="http://tempuri.org/Octal" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="Hexadecimal"> <soap12:operation soapAction="http://tempuri.org/Hexadecimal" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="Service"> <wsdl:port name="ServiceSoap" binding="tns:ServiceSoap"> <soap:address location="http://localhost/NumConvert/Service.asmx" /> </wsdl:port> <wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap12"> <soap12:address location="http://localhost/NumConvert/Service.asmx" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
Description в атрибуте WebMethod, например:[WebMethod (Description = "Перевод целого числа в двоичную систему счисления")]
public string Binary(int x)
{
return Convert.ToString(x, 2);
}
В результате в браузере будет получена следующая страница:

В результате работы веб-службы (после ввода числа и нажатия кнопки "Запуск") будет создана загрузится следующая страница:

Создайте ASP.NET веб-службу, поддерживающую три метода, возвращающие соответственно название текущего дня недели, номер текущего дня в месяце, номер текущего дня в году.
Для получения необходимых данных на стороне сервера можно использовать свойства и методы:
Label1.Text = DateTime.Now.DayOfWeek.ToString(); Label1.Text = DateTime.Now.Day.ToString(); Label1.Text = DateTime.Now.DayOfYear.ToString();
Для получения официальных документов о завершении программы дополнительного профессионального образования (удостоверения о повышении квалификации, дипломов о профессиональной переподготовке и MBA) необходимо предоставить:
Внимание! Вы можете не заказывать доставку бумажной версии официального документы, а скачать его в электронном виде и распечатать самостоятельно. Информация о выданном документе в течение 1 месяца загружается в Федеральную информационную систему «Федеральный реестр сведений о документах об образовании и (или) о квалификации, документах об обучении» - ФИС ФРДО.
Доступ на новый сайт осуществляется с использованием адреса электронной почты, который был указан вами при регистрации на "старом". Мы постарались перенести все ваши данные с прежнего ресурса, однако не исключена вероятность потери части информации.
При возникновении проблемы со входом, воспользуйтесь функцией сброса пароля
Если вы обнаружите несоответствия, пожалуйста, сообщите нам.