When using the WCF adapter, I have the message body part being send as the body of the WCF message, but can I do to get the Biztalk message context to be sent as well (hopefully within the WCF message header)?
相关问题
- How to make a .svc file write to asp.net Trace.axd
- WCF Service Using Client Certificates Requires Ano
- WCF error with net.tcp "The service endpoint faile
- WCF Service Reference Support Files Not Updating
- WCF Web Service: Upload a file, Process that file,
相关文章
- WCF发布Windows服务 POST方式报错 GET方式没有问题 应该怎么解决?
- XCopy or MOVE do not work when a WCF Service runs
- Could not find default endpoint element that refer
- The 'DbProviderFactories' section can only
- Do I need to expose a constructor in a WCF DataCon
- exposing net.tcp endpoint
- When is destructor called in a WCF service
- Getting error detail from WCF REST
The following page in MSDN succinctly explains how you can use custom SOAP headers when sending messages outside BizTalk with the WCF adapters.
Basically, you cannot directly send the context of your BizTalk messages outside BizTalk. This would be meaningless. Rather, you can select a subset of the properties in the context of your BizTalk messages to be sent to the WCF adapter through custom SOAP headers.
Handling Custom SOAP Headers Outgoing WCF Request
SOAP headers associated with an outgoing request must explicitly be written to the context of the outgoing message.
When using the WCF Adapters, SOAP Headers are defined with the built-in WCF.OutboundCustomHeaders context property. This property holds all custom SOAP headers, wrapped inside an additional <headers> tag.
Headers can be specified from within an orchestration with the following syntax in an Expression shape:
Please, note that the custom SOAP Headers <tns1:Header1> and <tns2:Header2> used for illustration purposes above must be part of your WCF service contract. When you create a service reference for the consumed WCF service, those custom SOAP headers will be available as generated schemas in your orchestration.
How to Send Specific Context Properties in Custom SOAP Header
Now that you know how to specify custom SOAP Headers, you can use this syntax to send specific properties from the context of your messages to the custom SOAP headers like so:
In the example above, the two builtin context properties FILE.ReceivedFileName and BTS.MessageType have been selected and written inside the custom SOAP header. In a real world scenario, you would want to check whether the properties exist in the context before using them.
You can also use any custom context property, provided they have been declared in an appropriate Property Schema.