Apache CXF

CXF 是一个开源的 service 框架。

CXF 使用 WSDL协议 描述发布一个服务,使用 SOAP协议 进行消息的交换,使用 HTTP协议 进行消息的传输。同时使用 JAX-WS API 向外暴露接口。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!-- request -->
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:getCustomersByName
xmlns:ns2="http://customerservice.example.com/">
<name>
Smith
</name>
</ns2:getCustomersByName>
</soap:Body>
</soap:Envelope>

<!-- response -->
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:getCustomersByNameResponse
xmlns:ns2="http://customerservice.example.com/">
<return>
<customerId>
0
</customerId>
<name>
Smith
</name>
<address>
Pine Street 200
</address>
<numOrders>
1
</numOrders>
<revenue>
10000.0
</revenue>
<test>
1.5
</test>
<birthDate>
2009-02-01+08:00
</birthDate>
<type>
BUSINESS
</type>
</return>
<return>
<customerId>
0
</customerId>
<name>
Smith
</name>
<address>
Pine Street 200
</address>
<numOrders>
1
</numOrders>
<revenue>
10000.0
</revenue>
<test>
1.5
</test>
<birthDate>
2009-02-01+08:00
</birthDate>
<type>
BUSINESS
</type>
</return>
</ns2:getCustomersByNameResponse>
</soap:Body>
</soap:Envelope>

$. 参考

  1. SOAP (originally Simple Object Access Protocol)
  2. SOAP Version 1.1
  3. SOAP Version 1.2
  4. Web services protocol stack
  5. Web Services Description Language(WSDL)
  6. SOAP W3C page
  7. Web Services Description Language (WSDL) Version 2.0 W3C page
  8. Web Services Description Language (WSDL) 1.1 W3C page