1

我已经构建了一个如下定义的 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; }
}

在此处输入图像描述

4

0 回答 0