【发布时间】:2019-08-18 23:27:45
【问题描述】:
我正在 Biztalk 中创建一个发送端口,它使用 Wcf-Custom 适配器发送 SOAP 请求。
到目前为止,我一直在使用 System-ServiceModel 命名空间中的 C# 代码在 Visual Studio 中测试 SOAP 请求。见以下代码:
/ CODEGEN: Generating message contract since the operation transferPayments is neither RPC nor document wrapped.
[System.ServiceModel.OperationContractAttribute(Action="urn:CorporateService:transferPayment", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
transferPaymentsResponse transferPayments(transferPayment1 request);
[System.ServiceModel.OperationContractAttribute(Action="urn:CorporateService:transferPayment", ReplyAction="*")]
System.Threading.Tasks.Task<transferPaymentsResponse> transferPaymentsAsync(transferPayment1 request);
我需要将此“transferPayment”操作添加到适配器中的 SOAP 操作标头字段。
使用提供的示例,我想出了这个
<BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Operation Name="TransferPayment" Action="http://bankconnect.dk/schema/2014/CorporateService/TransferPayment" />
</BtsActionMapping>
其中“http://bankconnect.dk/schema/2014”是命名空间,“CorporateService”是服务,“TransferPayment”是操作。我不确定这是否是实现这一点的正确方法。
我的问题是我应该如何格式化 SOAP 操作标头,以便它们对应于使用的 c# 代码。
【问题讨论】: