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();

アイデア なぜ?

編集:返信アクションを追加しましたが、まだ返信がありません

[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

MessageVersionに変更MessageVersion.Soap12WSAddressing10

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

操作のReplyActionは 1 つの値に設定され (正確には覚えていませんが、既定値です)、 のActionプロパティを使用して応答メッセージを作成していますOpReplyActionでプロパティを設定してみてOperationContract、応答メッセージを作成するときに同じ値を使用してください。

于 2013-01-20T18:31:50.953 に答える