Код: Выделить всё
``
``
`....`
Код: Выделить всё
using System.ServiceModel;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml;
using System.Xml.Serialization;
namespace WebApplication2
{
[WebService(Namespace = "http://tempuri.org/")]
[ServiceContract(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class WebService1 : WebService
{
public ActionHeader ActionHeader;
public WebService1()
{
ActionHeader = new ActionHeader { Action = "http://test.com.co" };
}
[WebMethod]
[SoapHeader("ActionHeader", Direction = SoapHeaderDirection.In)]
public string GetTransactionInformationInvoice()
{
return "Bienvenido, WebServiceTest";
}
}
[XmlRoot(ElementName = "Action", Namespace = "wsa")]
public class ActionHeader : SoapHeader
{
[XmlText]
public string Action { get; set; }
}
}
Мне удалось получить атрибут wsa:action в заголовке, но он не принимает значение, которое я назначаю, вместо http://test.com.co
остается "e gero".
Код: Выделить всё
`e gero`
Код: Выделить всё
http://www.test.com.co
, чтобы использовать
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/787 ... es-c-sharp