惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
C
Cyber Attacks, Cyber Crime and Cyber Security
Recent Announcements
Recent Announcements
爱范儿
爱范儿
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Security Latest
Security Latest
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Cisco Talos Blog
Cisco Talos Blog
Apple Machine Learning Research
Apple Machine Learning Research
C
Check Point Blog
T
Threat Research - Cisco Blogs
I
Intezer
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
腾讯CDC
Google DeepMind News
Google DeepMind News
Project Zero
Project Zero
T
Tenable Blog
V
Visual Studio Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Spread Privacy
Spread Privacy
GbyAI
GbyAI
T
Tailwind CSS Blog
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
NISL@THU
NISL@THU
Blog — PlanetScale
Blog — PlanetScale
G
GRAHAM CLULEY
K
Kaspersky official blog
T
The Exploit Database - CXSecurity.com
S
Schneier on Security
P
Proofpoint News Feed
S
SegmentFault 最新的问题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
The Hacker News
The Hacker News
博客园 - 【当耐特】
Cyberwarzone
Cyberwarzone
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
V
Vulnerabilities – Threatpost
H
Help Net Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Last Week in AI
Last Week in AI
博客园 - 叶小钗

博客园 - chnking

Biztalk AS2开发经验总结 BizTalk调用WS-Security的web services BizTalk中利用ESSO保存外部系统用户凭据 biztalk大规模高性能高可用部署方案 Biztalk 2009在Windows 2008 R2环境中的High Availability(Cluster群集)部署(下)--AA模式 Biztalk 2009在Windows 2008 R2环境中的High Availability(Cluster群集)部署(上)--AP模式 biztalk中使用biztalk adapter Pack适配器之一 – WCF-SQL WCF系列_分布式事务(下) WCF系列_分布式事务(上) Biztalk中Host Instance线程控制 biztalk在用户代码中构造多部分消息 使用biztalk API新建Receive Location 主流SOA厂商和相关产品 WCF系列(九) - WCF安全系列(四) - WSHttpBinding绑定之Transport安全模式 WCF系列(八) - WCF安全系列(三) - netTCPBinding绑定之Message安全模式 WCF系列(七) - WCF安全系列(二) - netTCPBinding绑定之Transport安全模式 WCF系列(六) - WCF安全系列(一) - basicHttpBinding 深入biztalk的Sequential Convoys保护 IIS客户端证书访问配置
BizTalk发布WS-Security的web services
chnking · 2016-12-12 · via 博客园 - chnking

最近做个项目,biztalkOTMOracle Transportation Management)系统做对接,双方通过web services通讯,这部分是BizTalk发布WS-Securityweb services,使用WS-SecurityUsername Token验证方式。

所以需要使用UsernameToken Web Service Security Policy,并使用HTTPS加密此SOAP消息的传输。

这样的web services是可以跟被java客户端调用的。

https的请求内容格式如下:

POST https://URL HTTP/1.1

Content-Type: text/xml; charset=utf-8

SOAPAction: "process"

Host: host

Content-Length: 6115

Expect: 100-continue

Accept-Encoding: gzip, deflate

Connection: Keep-Alive

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">

    <env:Header>

        <ns1:Security>

            <ns1:UsernameToken>

                <ns1:Username>GUEST.ADMIN</ns1:Username>

                <ns1:Password>CHANGEME</ns1:Password>

            </ns1:UsernameToken>

        </ns1:Security>

    </env:Header>

    <env:Body>

        ...your message content goes here...

    </env:Body>

</env:Envelope>

  1. 新建用于发布web servicdesschema

为测试目的,新建一个简单的用于发布为web servicdesschema

  1. 新建一个简单的接收请求返回结果的orchestration

为测试目的,新建一个简单的接收前面新建的schemarequest,简单映射为response的消息直接返回:

  1. orchestration的接收端口发布为WCF

部署这个BizTalk project,然后使用BizTalk WCF Services Publishing Wizardorchestration的接收端口发布为WCF

要发布使用WS-Securityweb servicdes必须使用WCF-CustomIsolateTransport type,下一步:

选择"Publish BizTalk orchestration as WCF Service",下一步:

选择前面建立的BizTalk projectdll,下一步:

这里显示了选择的dll中包含的orchestrationorchestration包含的可以发布为WCF的接收端口,下一步:

设置发布的WCFTarget namespace,下一步:

这是指定要发布到IIS的路径,同时选择"Allow anonymous access to WCF servicde",允许IIS中匿名访问web services,因为用户的身份验证是在消息内的。

发布完成后,在BizTalkApplication中会生成一个WCF-CustomIsolate的接收端口:

  1. 设置WCF-CustomIsolate接收位置的Application Pools

发布的WCF-CustomIsolate的接收位置在IIS中生成的ApplicationApplication Pool默认使用DefaultAppPool,这个Application PoolIdentityWindows內建的ApplicationPoolIdentity账号,不具有访问BizTalk数据库的权限,所以需要将Application Pool改为具有访问BizTalk数据库的权限IdentityApplication Pool

否则访问发布的WCF会出现这样的提示:

  1. 设置WCF-CustomIsolate接收位置的配置

查看WCF-CustomIsolate的属性:

点击"Configure…":

修改这里的Binding

  1. 增加security Extension

增加security Extension,并把它移动到最顶层的位置,并把authenticationMode设置为UserNameOverTransport

  1. 设置textMessageEncoding Extension

textMessageEncodingmessageVersion设置为"Soap11":

  1. httpTransport改为httpsTransport

删除httpTransport Extension,增加httpsTransport,因为需要使用TLS进行消息的加密传输:

  1. 增加ServicesBehavior

Behavior标签下,增加serviceCredentialsserviceBehaviors

确认在UserNameAuthentication下的userNamePasswordValidationMode设置为Windows,表示验证客户端的UsernameToken将使用Windows的用户验证,即客户端的UsernameToken将跟windows的用户进行比对,如果windows的用户有跟客户端的UsernameToken匹配的即验证成功。

  1. 测试发布的WCF

可以新建一个简单的c# console应用作为客户端调用发布的WCF,然后用Fiddler抓取通讯的数据格式,判断发布的WCF是否符合WS-Security

c# console应用中引用前面发布的WCF

具体调用WCF的代码如下:

其中的chnkingwindows的用户,Jjz123356是这个windows用户的密码。

执行这段代码执行调用WCF的过程,使用Fiddler抓取数据查看请求消息格式为:

可以看到这个请求调用web services的消息格式完全符合WS-Security的格式。

再看,返回的消息格式:

可以看到,服务端返回的正常的结果。