2009年7月6日星期一

SOASuite_006:观察BPEL Process 交互的SOAP消息 (SOA Suite 10g)

说明:以下实验的开发运行环境为JDeveloper10.1.3.4 + Oracle SOA Suite10.1.3.1.0

1. 观察同步调用的SOAP 消息
(1)进入 Oracle BPEL PM 的bin目录:如 C:\product\10.1.3.1\OracleAS_1\bpel\bin。
(2)执行 obsetenv
(3)执行 java -classpath %OB_CLASSPATH% org.collaxa.thirdparty.apache.axis.utils.tcpmon 8888 localhost 80
(4)修改 bpel.xml,增加"location",它将覆盖服务的端点地址。

<partnerLinkBinding name="CreditRatingService">
<property name="wsdlLocation">
http://pma-cn.cn.oracle.com:80/orabpel/default/CreditRatingService/CreditRatingService?wsdl
</property>
<property name="location">
http://pma-cn.cn.oracle.com:8888/orabpel/default/CreditRatingService
</property>
</partnerLinkBinding>

(5)编译、发布、在BPEL Console中测试。
(6)在TCPMonitor 中观察SOAP消息。


以下为监控到的完整的HTTP请求(OrderBooking 调用CreditRatingService ):

POST /orabpel/default/CreditRatingService HTTP/1.1
Host: localhost:8888
Connection: Keep-Alive, TETE: trailers, deflate, gzip, compress
User-Agent: Oracle HTTPClient Version 10h
SOAPAction: "process"
Accept-Encoding: gzip, x-gzip, compress, x-compress
Content-type: text/xml; charset=UTF-8
Content-length: 305

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<ssn xmlns="http://services.otn.com/">Antilla Electronics</ssn>
</env:Body>
</env:Envelope>


以下为监控到的完整的HTTP响应(来自CreditRatingService的响应 ):

HTTP/1.1 200 OK
Date: Wed, 03 Dec 2008 02:09:01 GMT
Server: Oracle-Application-Server-10g/10.1.3.1.0 Oracle-HTTP-Server
Content-Length: 169
SOAPAction: ""
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/xml; charset=UTF-8
X-Pad: avoid browser bug

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<rating xmlns="http://services.otn.com">560</rating>
</env:Body>
</env:Envelope>





2. 观察异步调用的SOAP 消息(1)启动另一个 TCP listener,监听8889端口,并转发到80端口。
(2)进入BPEL Admin Console,
http://localhost/BPELAdmin,修改soapCallbackUrl,端口改成8889。
(3)其余步骤同上。

以下为监控到的完整的HTTP请求(OrderBooking调用RapidDistributors):

POST /orabpel/default/RapidDistributors HTTP/1.1
Host: pma-cn.cn.oracle.com:8888
Connection: TE
TE: trailers, deflate, gzip, compress
User-Agent: Oracle HTTPClient Version 10h
SOAPAction: "initiate"
Accept-Encoding: gzip, x-gzip, compress, x-compress
Content-type: text/xml; charset=UTF-8
Content-length: 1240

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
<ReplyTo xmlns="http://schemas.xmlsoap.org/ws/2003/03/addressing">
<Address>http://pma-cn.cn.oracle.com:8889/orabpel/default/OrderBooking/1.0/RapidDistributors/RapidDistributorsRequester</Address>
<PortType xmlns:ptns="http://xmlns.oracle.com/RapidDistributors">ptns:RapidDistributorsCallback</PortType>
<ServiceName xmlns:snns="http://xmlns.oracle.com/RapidDistributors">snns:RapidDistributorsCallbackService</ServiceName>
</ReplyTo>
<MessageID xmlns="http://schemas.xmlsoap.org/ws/2003/03/addressing" ans1:rootId="480001" xmlns:ans1="http://schemas.oracle.com/bpel" ans1:parentId="480001" ans1:priority="0">
bpel://localhost/default/OrderBooking~1.0/480001-BpInv1-BpSeq0.3-3
</MessageID>
</env:Header>
<env:Body>
<OrderItems xmlns="http://www.globalcompany.com/ns/sales">
<Item>
<ProductName/>
<itemType/>
<partnum/>
<price/>
<Quantity/>
</Item>
</OrderItems>
</env:Body>
</env:Envelope>

由于是异步调用,调用马上返回,返回的是一个空的SOAP消息(来自RapidDistributors)。

HTTP/1.1 200 OK
Date: Wed, 03 Dec 2008 07:00:39 GMT
Server: Oracle-Application-Server-10g/10.1.3.1.0 Oracle-HTTP-Server
Content-Length: 107
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body/>
</env:Envelope>


以下为监控到的完整的HTTP请求(RapidDistributors回调OrderBooking):

POST /orabpel/default/OrderBooking/1.0/RapidDistributors/RapidDistributorsRequester HTTP/1.1
Host: localhost:8889
Connection: Keep-Alive, TE
TE: trailers, deflate, gzip, compress
User-Agent: Oracle HTTPClient Version 10h
SOAPAction: "onResult"
Accept-Encoding: gzip, x-gzip, compress, x-compress
Content-type: text/xml; charset=UTF-8
Content-length: 570

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
<RelatesTo xmlns="http://schemas.xmlsoap.org/ws/2003/03/addressing">
bpel://localhost/default/OrderBooking~1.0/470001-BpInv1-BpSeq0.3-3
</RelatesTo>
</env:Header>
<env:Body>
<SupplierInfo xmlns="http://www.globalcompany.com/ns/sales">
<SupplierPrice>5000</SupplierPrice><SupplierName>
RapidDistributors</SupplierName></SupplierInfo>
</env:Body>
</env:Envelope>


返回的同样是一个空的SOAP消息(来自OrderBooking)。

HTTP/1.1 200 OK
Date: Wed, 03 Dec 2008 07:01:10 GMT
Server: Oracle-Application-Server-10g/10.1.3.1.0 Oracle-HTTP-Server
Content-Length: 107
SOAPAction: ""
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/xml; charset=UTF-8
X-Pad: avoid browser bug

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body/>
</env:Envelope>


可以看出,这里使用了WS-Addressing规范来实现异步调用,有关WS-Addressing的详细说明请参考《WS-Addressing 介绍》 。

3. 观察使用correlationSets的SOAP 消息


参考文献:
1. 《
TCP Tunneling

没有评论: