0

我没有收到来自 Web 服务的任何返回响应,正在接收输入消息 XML 好的。

尝试获取并返回符合集成标准的自定义 XML,这就是我使用 SSCMessage 作为参数的原因。

using System.ServiceModel.Channels;

[ServiceContract(Namespace = "urn:hl7-org:v3")]
public interface IHL7v3
{
    [OperationContract(Name = "PRPA_IN201301UV02", Action = "urn:hl7-org:v3:PRPA_IN201301UV02")]
    Message PIXManager_PRPA_IN201301UV02(Message input);
}

public class PIXService : IHL7v3
{
    public Message PIXManager_PRPA_IN201301UV02(Message input)
    {
         // this code is being reached and executing fine
         return Message.CreateMessage(MessageVersion.Soap12, "Op", "Content"); // will be replaced by an actual XML text
    }
}

服务设置代码:

        Uri baseAddress = new Uri("http://192.168.2.120:31002/HL7Service");
        ServiceHost selfHost = new ServiceHost(typeof(PIXService), baseAddress);

        selfHost.Description.Name = "PIXManager";
        selfHost.Description.Namespace = "urn:hl7-org:v3";

        try
        {
            System.ServiceModel.Channels.Binding binder = new WSHttpBinding(SecurityMode.None);

            binder.Name = "PIXManager_Binding_Soap12";
            selfHost.AddServiceEndpoint(
                typeof(IHL7v3),
                binder,
                "PIX");

            ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
            smb.HttpGetEnabled = true;
            Console.WriteLine(smb.HttpGetUrl);
            selfHost.Description.Behaviors.Add(smb);
            selfHost.AddServiceEndpoint(
              ServiceMetadataBehavior.MexContractName,
              MetadataExchangeBindings.CreateMexHttpBinding(),
              "mex"
            );

            selfHost.Open();

想法为什么?

编辑:添加了ReplyAction,仍然没有回复

[OperationContract(Name = "PRPA_IN201301UV02", Action = "urn:hl7-org:v3:PRPA_IN201301UV02", ReplyAction = "urn:hl7-org:v3:MCCI_IN000002UV01")]
// ..
return Message.CreateMessage(MessageVersion.Soap12, "urn:hl7-org:v3:MCCI_IN000002UV01", "Something");
4

2 回答 2

1

更改MessageVersionMessageVersion.Soap12WSAddressing10

return Message.CreateMessage(MessageVersion.Soap12WSAddressing10, "Op", "Content");
于 2013-01-21T14:45:07.050 回答
0

您的ReplyAction操作设置为一个值(我不记得确切是哪个值,但它是默认值),并且您正在创建具有.Action属性的响应消息Op。尝试在 中设置ReplyAction属性OperationContract,并在创建响应消息时使用相同的值。

于 2013-01-20T18:31:50.953 回答