如何在WCF服务中指定wsdl:message名称

时间:2013-04-24 23:22:04

标签: wcf

我已经在下面修改了一个wcf服务。生成的wsdl包含消息名称和操作输入/输出名称,这些名称似乎基于消息协定类名称,以及基于web.config绑定名称的绑定名称和服务端口名称+定义的端口名称服务合同。

如果我想要消息名称,操作输入/输出名称以及绑定&的特定值。端口名称,我该如何指定?

[ServiceBehavior(
    /*Sets the wdl:service name*/ Name = "RCMR_AR000003UV01",
    Namespace = Constants.HL7v3Namespace)]
public class Service1 : IService1
{
    public MCCI_IN000002UV01_ResponseContract GetMessage(RCMR_IN000002UV01_RequestContract query)
    {
        return ...        
    }
}

[ServiceContract(
        /*Set wsdl targetNamespae*/ Namespace ="urn:hl7-org:v3",
        /*Set wsdl portType name*/  Name = "RCMR_AR000003UV01")] 
    public interface IService1
    {
        [OperationContract( 
            /*Set wsdl request action*/  Action = "urn:hl7-org:v3/RCMR_IN000002UV01.LE20090501",
            /*Set wsdl response action*/ ReplyAction = "urn:hl7-org:v3/MCCI_IN000002UV01.LE20090501",
            /*Set wsdl operation name*/ Name = "RCMR_IN000002UV01")]
        MCCI_IN000002UV01_ResponseContract GetMessage(RCMR_IN000002UV01_RequestContract query);
    }


[System.ServiceModel.MessageContract(IsWrapped = false, WrapperNamespace = "urn:hl7-org:v3")]
public class RCMR_IN000002UV01_RequestContract
{
    [MessageBodyMember(Name = "RCMR_IN000002UV01", Namespace = "urn:hl7-org:v3")]
    public RCMR_IN000002UV01 data { get; set; }
}

[System.ServiceModel.MessageContract(IsWrapped = false, WrapperNamespace = "urn:hl7-org:v3")]
public class MCCI_IN000002UV01_ResponseContract
{        
    [MessageBodyMember(Name = "MCCI_IN000002UV01", Namespace = "urn:hl7-org:v3")]
    public MCCI_IN000002UV01 data { get; set; }
}

enter image description here

0 个答案:

没有答案