繁体   English   中英

将肥皂标题添加到BizTalk SOAP适配器

[英]Add a soap Header to BizTalk SOAP adapter

我们有以下webservice xml请求。 为此,我开发了业务流程。 但是,当我们将请求发送到客户端时,我们需要添加SOAP标头。
你能建议我,我该怎么做?

WebService XML请求

<?xml version="1.0" encoding="utf-8" ?>
<Request xmlns="http://modeler.ass.abc/efgh/">
  <HeaderReq>
    <PartnerID>E0</PartnerID>
    <TimeStampSubmitted>2013-11-21T18:19:11</TimeStampSubmitted>
    <Version>3.0</Version>
  </HeaderReq>
  <ApplicationREQ>
    <ID>1</ID>
  </ApplicationREQ>
</Request>

SOAP标头

<soapenv:Header>
  <wsse:Security xmlns:wsse="http://adb.ddad-sdfad.org/wss/2010/01/fasd-201201-wss-wssecurity-secext-1.0.xsd">
    <wsu:Timestamp wsu:Id="TS-10">
      <wsu:Created>2013-10-11T17:26:52.890Z</wsu:Created>
      <wsu:Expires>2013-10-11T17:51:52.890Z</wsu:Expires>
    </wsu:Timestamp>
    <wsse:UsernameToken wsu:Id="UsernameToken-10">
      <wsse:Username>User</wsse:Username>
      <wsse:Password Type="http://adb.ddad-sdfad.org/wss/2010/01/fasd-201201-wss-username-token-profile-1.0#PasswordText">xxxxxxx</wsse:Password>
      <wsse:Nonce EncodingType="http://adb.ddad-sdfad.org/wss/2010/01/fasd-201201-wss-soap-message-security-1.0#Base64Binary">xxxxxxx</wsse:Nonce>
      <wsu:Created>2013-10-11T17:26:52.889Z</wsu:Created>
    </wsse:UsernameToken>
  </wsse:Security>
</soapenv:Header>

您将需要使用属性WCF.OutboundCustomHeaders

例:

xmlDoc.LoadXml("<headers><Origination>Home</Origination><Destination>Work</Destination></headers>");

接着

RequestMessageInstance(WCF.OutboundCustomHeaders) = xmlDoc.OuterXml;

我在此页面上找到了此示例: http : //msdn.microsoft.com/zh-cn/library/bb246026.aspx

希望这可以帮助!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM