Home

 

WS-MetadataExchange (WS-MEX)

In WebSphere Application Server Version v7.0, using JAX-WS, you can enable the Web Services Metadata Exchange (WS-MetadataExchange) protocol so that the policy configuration of the service provider is included in the WSDL and is available to a WS-MetadataExchange GetMetadata request. A service provider can use a WS-MetadataExchange request to share its policies, and a service client can use a WS-MetadataExchange request to apply the policies of a provider.

One advantage of using the WS-MetadataExchange protocol is that you can apply transport-level or message-level security to WS-MetadataExchange GetMetadata requests by using a suitable system policy set. Another advantage is that the client does not have to match the provider configuration, or have a policy set attached. The client only needs the binding information, and then the client can operate based on the provider policy, or based on the intersection of the client and provider policies.

To configure a service provider to share its policy configuration using WS-MEX, do the following steps:

In the Services view, right-click RAD75WebServiceWeb:{...}BankService and select Manage Policy Set Attachment.

The Username WSSecurity default should be listed as the attached policy set from the last section. Click Next.

In the Configure Policy Sharing dialog, select the service and then click Configure.

Select Share Policy Information using WS-MetadataExchange and click OK (Figure | 8-55).

Figure 18-55 Share policy set using WS-MetadataExchange

Click Ignore for the warning, and then click Finish.

To configure the client.policy configuration using WS-MEX, do the following steps:

Right-click RAD75WebServiceClient: service/BankService, select Manage Policy Set Attachment. and then click Use Provider Policy

In the Configure Policy acquisition for Web Service Client page, select WS-MetadataExchange and then click OK.

Click Ignore for the warning, and then click Finish.

Test the Web service again. In the TCP/IP Monitor, you can see the client first issues a WS-MEX GetMetadata request to the actual Web service endpoint, and the dialect of the request is WSDL (Example | 8-27).

Example 18-27 WS-MEX request

<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
	<wsa:To>http://localhost:11487/RAD75WebServiceWeb/BankService</wsa:To>
	<wsa:MessageID>urn:uuid:5F71ABE9421927F47C1228500226211</wsa:MessageID>
	<wsa:Action>
		http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request
	</wsa:Action>
</soapenv:Header>
<soapenv:Body>
	<mex:GetMetadata xmlns:mex="http://schemas.xmlsoap.org/ws/2004/09/mex">
		<mex:Dialect>http://schemas.xmlsoap.org/wsdl/</mex:Dialect>
	</mex:GetMetadata>
</soapenv:Body>

The GetMetadata response returns the WSDL with the policy information.
ibm.com/redbooks