QName serviceName = new QName("http://org.jboss.ws/jaxws/endpoint", "TestService");
ServiceMetaData serviceMetaData = new ServiceMetaData(umd, serviceName);
QName portName = new QName("http://org.jboss.ws/jaxws/endpoint", "EndpointInterfacePort");
QName portTypeName = new QName("http://org.jboss.ws/jaxws/endpoint", "EndpointInterface");
EndpointMetaData epMetaData = new ServerEndpointMetaData(serviceMetaData, null, portName, portTypeName, Type.JAXWS);
Map<String, Class> map = new HashMap<String, Class>();
map.put("http://schemas.xmlsoap.org/ws/2005/02/rm/policy", NopAssertionDeployer.class);
map.put("http://www.fabrikam123.example.com/stock", NopAssertionDeployer.class);
map.put("http://schemas.xmlsoap.org/ws/2005/07/securitypolicy", NopAssertionDeployer.class);
PolicyDeployer deployer = PolicyDeployer.newInstance(map);
PolicyMetaDataBuilder builder = new PolicyMetaDataBuilder(deployer);
WSDLDefinitions wsdlDefinitions = readWsdl("resources/jaxws/wspolicy/TestService.wsdl");
builder.processPolicyExtensions(epMetaData, wsdlDefinitions);
PolicyMetaExtension policyExt = (PolicyMetaExtension)epMetaData.getExtension(Constants.URI_WS_POLICY);
Collection<Policy> bindingPolicies = policyExt.getPolicies(PolicyScopeLevel.WSDL_BINDING);
assertNotNull(bindingPolicies);
assertEquals(2, bindingPolicies.size());
Iterator<Policy> bindingPoliciesIterator = bindingPolicies.iterator();
String id1 = bindingPoliciesIterator.next().getId();