0
У меня есть следующий интерфейс веб-сервиса..NET wcf service output
[ServiceContract(Namespace = "http://customnamespacehere")]
public interface IDebtKnowledge
{
[OperationContract]
SubscriberOutput GetSubscribers(SubscriberInput subscriberInput);
}
Он генерирует выходные данные ниже. Но я хочу сгенерировать его без v1: GetSubscribers тег. Его имя моего метода.
<soapenv:Body>
<v1:GetSubscribers>
<v1:subscriberInput>
<akt:IpAddress>?</akt:IpAddress>
<akt:OperatorCode>?</akt:OperatorCode>
<akt:Password>?</akt:Password>
<akt:Username>?</akt:Username>
</v1:subscriberInput>
</v1:GetSubscribers>
Как я могу получить выход ниже?
<soapenv:Body>
<v1:subscriberInput>
<akt:IpAddress>?</btk:IpAddress>
<akt:OperatorCode>?</btk:OperatorCode>
<akt:Password>?</akt:Password>
<akt:Username>?</akt:Username>
</v1:subscriberInput>
</soapenv:Body>
Я пометил свой класс SubscriberInput и все родительский класс с
[DataContract]
[MessageContract(IsWrapped = false)]
тогда я получил это исключение.
The operation 'GetSubscribers' could not be loaded because it has a parameter or return type of type System.ServiceModel.Channels.Message or a type that has MessageContractAttribute and other parameters of different types. When using System.ServiceModel.Channels.Message or types with ssageContractAttribute, the method must not use any other types of parameters.
Вы не хотите имя метода? Зачем? – Amit
Потому что мой клиент так хочет. –
Тогда как насчет операцииcontract как SubscriberOutput абонентский вход (IpAddress, OperatorCode, Password, UserName); – Amit