Author: dkulp
Date: Tue Feb 5 19:41:22 2008
New Revision: 618866
URL: http://svn.apache.org/viewvc?rev=618866&view=rev
Log:
Merged revisions 617250 via svnmerge from
https://svn.apache.org/repos/asf/incubator/cxf/trunk
........
r617250 | dkulp | 2008-01-31 16:42:25 -0500 (Thu, 31 Jan 2008) | 4 lines
[CXF-1409] Patch from Sergey applied. Thanks!
* Fixes Endpoint polices referenced from WSPolicyFeature can not be applied
if EndpointPolicy already exists
........
Added:
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/ReliableGreeterImpl2.java
- copied unchanged from r617250,
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/ReliableGreeterImpl2.java
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/greeter.wsdl
- copied unchanged from r617250,
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/greeter.wsdl
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl_server.xml
- copied unchanged from r617250,
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl_server.xml
Modified:
incubator/cxf/branches/2.0.x-fixes/ (props changed)
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/EndpointPolicy.java
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
incubator/cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
incubator/cxf/branches/2.0.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/ReliableGreeterImpl.java
incubator/cxf/branches/2.0.x-fixes/testutils/src/main/resources/wsdl/greeter_control.wsdl
Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/EndpointPolicy.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/EndpointPolicy.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/EndpointPolicy.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/EndpointPolicy.java
Tue Feb 5 19:41:22 2008
@@ -35,6 +35,7 @@
public interface EndpointPolicy {
Policy getPolicy();
+ EndpointPolicy updatePolicy(Policy p);
Collection<Assertion> getChosenAlternative();
Modified:
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java
Tue Feb 5 19:41:22 2008
@@ -70,10 +70,10 @@
// available throughout the inbound path
EndpointPolicy getClientEndpointPolicy(EndpointInfo ei, Conduit conduit);
-
EndpointPolicy getServerEndpointPolicy(EndpointInfo ei, Destination
destination);
- void setEndpointPolicy(EndpointInfo ei, EndpointPolicy ep);
+ void setServerEndpointPolicy(EndpointInfo ei, EndpointPolicy ep);
+ void setClientEndpointPolicy(EndpointInfo ei, EndpointPolicy ep);
// only available after message type has been determined
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
Tue Feb 5 19:41:22 2008
@@ -35,6 +35,7 @@
import org.apache.cxf.service.model.BindingOperationInfo;
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.neethi.Assertion;
+import org.apache.neethi.ExactlyOne;
import org.apache.neethi.Policy;
/**
@@ -51,10 +52,38 @@
private List<Interceptor> interceptors;
private List<Interceptor> faultInterceptors;
+ private EndpointInfo ei;
+ private PolicyEngineImpl engine;
+ private boolean requestor;
+ private Assertor assertor;
+
+ public EndpointPolicyImpl() {
+
+ }
+
+ public EndpointPolicyImpl(EndpointInfo ei,
+ PolicyEngineImpl engine,
+ boolean requestor,
+ Assertor assertor) {
+ this.ei = ei;
+ this.engine = engine;
+ this.requestor = requestor;
+ this.assertor = assertor;
+ }
+
public Policy getPolicy() {
return policy;
}
+ public EndpointPolicy updatePolicy(Policy p) {
+ EndpointPolicyImpl epi = createEndpointPolicy();
+ Policy np = (Policy)p.normalize(true);
+ epi.setPolicy(getPolicy().merge(np));
+ epi.checkExactlyOnes();
+ epi.finalizeConfig();
+ return epi;
+ }
+
public Collection<Assertion> getChosenAlternative() {
return chosenAlternative;
}
@@ -75,21 +104,27 @@
return faultInterceptors;
}
+ void initialize() {
+ initializePolicy();
+ checkExactlyOnes();
+ finalizeConfig();
+ }
- void initialise(EndpointInfo ei, boolean isRequestor, PolicyEngineImpl
engine, Assertor assertor) {
- initialisePolicy(ei, engine);
- chooseAlternative(engine, assertor);
- initialiseVocabulary(ei, isRequestor, engine);
- initialiseInterceptors(ei, isRequestor, engine);
+ void finalizeConfig() {
+ chooseAlternative();
+ initializeVocabulary();
+ initializeInterceptors();
}
- void initialisePolicy(EndpointInfo ei, PolicyEngineImpl engine) {
+ void initializePolicy() {
policy = engine.getAggregatedServicePolicy(ei.getService());
policy = policy.merge(engine.getAggregatedEndpointPolicy(ei));
- policy = (Policy)policy.normalize(true);
+ if (!policy.isEmpty()) {
+ policy = (Policy)policy.normalize(true);
+ }
}
- void chooseAlternative(PolicyEngineImpl engine, Assertor assertor) {
+ void chooseAlternative() {
Collection<Assertion> alternative = engine.getAlternativeSelector()
.selectAlternative(policy, engine, assertor);
if (null == alternative) {
@@ -99,7 +134,7 @@
}
}
- void initialiseVocabulary(EndpointInfo ei, boolean requestor,
PolicyEngineImpl engine) {
+ void initializeVocabulary() {
vocabulary = new ArrayList<Assertion>();
if (requestor) {
faultVocabulary = new ArrayList<Assertion>();
@@ -143,7 +178,7 @@
}
}
- void initialiseInterceptors(EndpointInfo ei, boolean requestor,
PolicyEngineImpl engine) {
+ void initializeInterceptors() {
PolicyInterceptorProviderRegistry reg
=
engine.getBus().getExtension(PolicyInterceptorProviderRegistry.class);
interceptors = new ArrayList<Interceptor>();
@@ -206,5 +241,37 @@
faultInterceptors = inFault;
}
-
+ protected EndpointPolicyImpl createEndpointPolicy() {
+ return new EndpointPolicyImpl(this.ei,
+ this.engine,
+ this.requestor,
+ this.assertor);
+ }
+
+ void checkExactlyOnes() {
+ // Policy has been normalized and merged by now but unfortunately
+ // ExactlyOnce have not been normalized properly by Neethi, for ex
+ // <Policy>
+ // <ExactlyOne><All><A></All></ExactlyOne>
+ // <ExactlyOne><All><B></All></ExactlyOne>
+ // </Policy>
+ // this is what we can see after the normalization happens but in fact
this
+ // is still unnormalized expression, should be
+ // <Policy>
+ // <ExactlyOne><All><A></All><All><B></All></ExactlyOne>
+ // </Policy>
+
+ List<?> assertions = policy.getPolicyComponents();
+ if (assertions.size() <= 1) {
+ return;
+ }
+
+ Policy p = new Policy();
+ ExactlyOne alternatives = new ExactlyOne();
+ p.addPolicyComponent(alternatives);
+ for (Object a : assertions) {
+
alternatives.addPolicyComponents(((ExactlyOne)a).getPolicyComponents());
+ }
+ setPolicy(p);
+ }
}
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
Tue Feb 5 19:41:22 2008
@@ -65,18 +65,13 @@
private AlternativeSelector alternativeSelector;
private Map<BindingOperation, EffectivePolicy> clientRequestInfo;
-
private Map<BindingOperation, EffectivePolicy> clientResponseInfo;
-
private Map<BindingFault, EffectivePolicy> clientFaultInfo;
-
private Map<BindingOperation, EffectivePolicy> serverRequestInfo;
-
private Map<BindingOperation, EffectivePolicy> serverResponseInfo;
-
private Map<BindingFault, EffectivePolicy> serverFaultInfo;
-
- private Map<EndpointInfo, EndpointPolicy> endpointInfo;
+ private Map<EndpointInfo, EndpointPolicy> serverEndpointInfo;
+ private Map<EndpointInfo, EndpointPolicy> clientEndpointInfo;
public PolicyEngineImpl() {
init();
@@ -214,25 +209,30 @@
}
public EndpointPolicy getClientEndpointPolicy(EndpointInfo ei, Conduit
conduit) {
- EndpointPolicy endpointPolicy = endpointInfo.get(ei);
- if (null != endpointPolicy) {
- return endpointPolicy;
- }
Assertor assertor = conduit instanceof Assertor ? (Assertor)conduit :
null;
- return createEndpointPolicyInfo(ei, true, assertor);
+ return getEndpointPolicy(ei, clientEndpointInfo.get(ei), true,
assertor);
}
public EndpointPolicy getServerEndpointPolicy(EndpointInfo ei, Destination
destination) {
- EndpointPolicy endpointPolicy = endpointInfo.get(ei);
- if (null != endpointPolicy) {
- return endpointPolicy;
- }
+
Assertor assertor = destination instanceof Assertor ?
(Assertor)destination : null;
- return createEndpointPolicyInfo(ei, false, assertor);
+ return getEndpointPolicy(ei, serverEndpointInfo.get(ei), false,
assertor);
+ }
+
+ private EndpointPolicy getEndpointPolicy(
+ EndpointInfo ei, EndpointPolicy ep, boolean isRequestor, Assertor
assertor) {
+ if (null != ep) {
+ return ep;
+ }
+ return createEndpointPolicyInfo(ei, isRequestor, assertor);
}
- public void setEndpointPolicy(EndpointInfo ei, EndpointPolicy ep) {
- endpointInfo.put(ei, ep);
+ public void setClientEndpointPolicy(EndpointInfo ei, EndpointPolicy ep) {
+ clientEndpointInfo.put(ei, ep);
+ }
+
+ public void setServerEndpointPolicy(EndpointInfo ei, EndpointPolicy ep) {
+ serverEndpointInfo.put(ei, ep);
}
public EffectivePolicy getEffectiveServerRequestPolicy(EndpointInfo ei,
BindingOperationInfo boi) {
@@ -303,7 +303,9 @@
clientFaultInfo
= new ConcurrentHashMap<BindingFault, EffectivePolicy>();
- endpointInfo
+ serverEndpointInfo
+ = new ConcurrentHashMap<EndpointInfo, EndpointPolicy>();
+ clientEndpointInfo
= new ConcurrentHashMap<EndpointInfo, EndpointPolicy>();
serverRequestInfo
@@ -496,13 +498,16 @@
}
EndpointPolicyImpl createEndpointPolicyInfo(EndpointInfo ei, boolean
isRequestor, Assertor assertor) {
- EndpointPolicyImpl epi = createEndpointPolicyInfo();
- epi.initialise(ei, isRequestor, this, assertor);
- endpointInfo.put(ei, epi);
+ EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, this, isRequestor,
assertor);
+ epi.initialize();
+
+ Map<EndpointInfo, EndpointPolicy> map = isRequestor ?
clientEndpointInfo : serverEndpointInfo;
+ map.put(ei, epi);
return epi;
- }
-
+ }
+
+
/**
* Check if a given list of assertions can potentially be supported by
* interceptors or by an already installed assertor (a conduit or transport
@@ -530,7 +535,7 @@
public void stopServer(Server server) {
EndpointInfo ei = server.getEndpoint().getEndpointInfo();
- endpointInfo.remove(ei);
+ serverEndpointInfo.remove(ei);
}
/**
@@ -615,7 +620,5 @@
return new EffectivePolicyImpl();
}
- EndpointPolicyImpl createEndpointPolicyInfo() {
- return new EndpointPolicyImpl();
- }
+
}
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/WSPolicyFeature.java
Tue Feb 5 19:41:22 2008
@@ -21,7 +21,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.List;
import java.util.ResourceBundle;
import org.w3c.dom.Element;
@@ -33,7 +32,7 @@
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.feature.AbstractFeature;
-import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.ws.policy.attachment.reference.ReferenceResolver;
import org.apache.cxf.ws.policy.attachment.reference.RemoteReferenceResolver;
import org.apache.neethi.Policy;
@@ -104,18 +103,24 @@
@Override
public void initialize(Client client, Bus bus) {
Endpoint endpoint = client.getEndpoint();
-
- intializeEndpoint(endpoint, bus);
+ Policy p = initializeEndpointPolicy(endpoint, bus);
+ PolicyEngine pe = bus.getExtension(PolicyEngine.class);
+ EndpointInfo ei = endpoint.getEndpointInfo();
+ EndpointPolicy ep = pe.getClientEndpointPolicy(ei, null);
+ pe.setClientEndpointPolicy(ei, ep.updatePolicy(p));
}
@Override
public void initialize(Server server, Bus bus) {
Endpoint endpoint = server.getEndpoint();
-
- intializeEndpoint(endpoint, bus);
+ Policy p = initializeEndpointPolicy(endpoint, bus);
+ PolicyEngine pe = bus.getExtension(PolicyEngine.class);
+ EndpointInfo ei = endpoint.getEndpointInfo();
+ EndpointPolicy ep = pe.getServerEndpointPolicy(ei, null);
+ pe.setServerEndpointPolicy(ei, ep.updatePolicy(p));
}
- private void intializeEndpoint(Endpoint endpoint, Bus bus) {
+ private Policy initializeEndpointPolicy(Endpoint endpoint, Bus bus) {
initialize(bus);
@@ -139,20 +144,21 @@
}
}
- List<ServiceInfo> sis = endpoint.getService().getServiceInfos();
- for (ServiceInfo si : sis) {
- if (policies != null) {
- for (Policy p : policies) {
- si.addExtensor(p);
- }
+ Policy thePolicy = new Policy();
+
+ if (policies != null) {
+ for (Policy p : policies) {
+ thePolicy = thePolicy.merge(p);
}
-
- if (loadedPolicies != null) {
- for (Policy p : loadedPolicies) {
- si.addExtensor(p);
- }
+ }
+
+ if (loadedPolicies != null) {
+ for (Policy p : loadedPolicies) {
+ thePolicy = thePolicy.merge(p);
}
}
+
+ return thePolicy;
}
public Collection<Policy> getPolicies() {
@@ -210,6 +216,7 @@
if (null == p) {
throw new PolicyException(new
Message("UNRESOLVED_POLICY_REFERENCE_EXC", BUNDLE, ref.getURI()));
}
+
return p;
}
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java
Tue Feb 5 19:41:22 2008
@@ -29,6 +29,7 @@
import javax.xml.namespace.QName;
import org.apache.cxf.Bus;
+import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.interceptor.Interceptor;
import org.apache.cxf.service.model.BindingFaultInfo;
import org.apache.cxf.service.model.BindingInfo;
@@ -36,7 +37,10 @@
import org.apache.cxf.service.model.BindingOperationInfo;
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.neethi.All;
import org.apache.neethi.Assertion;
+import org.apache.neethi.Constants;
+import org.apache.neethi.ExactlyOne;
import org.apache.neethi.Policy;
import org.easymock.classextension.EasyMock;
import org.easymock.classextension.IMocksControl;
@@ -50,6 +54,15 @@
public class EndpointPolicyImplTest extends Assert {
private IMocksControl control;
+ final class TestEndpointPolicy extends EndpointPolicyImpl {
+ @Override
+ protected EndpointPolicyImpl createEndpointPolicy() {
+ return new TestEndpointPolicy();
+ }
+ @Override
+ void finalizeConfig() {
+ }
+ };
@Before
public void setUp() {
@@ -88,36 +101,36 @@
}
@Test
- public void testInitialise() throws NoSuchMethodException {
- Method m1 =
EndpointPolicyImpl.class.getDeclaredMethod("initialisePolicy",
- new Class[] {EndpointInfo.class, PolicyEngineImpl.class});
- Method m2 =
EndpointPolicyImpl.class.getDeclaredMethod("chooseAlternative",
- new Class[] {PolicyEngineImpl.class, Assertor.class});
- Method m3 =
EndpointPolicyImpl.class.getDeclaredMethod("initialiseVocabulary",
- new Class[] {EndpointInfo.class, boolean.class,
PolicyEngineImpl.class});
- Method m4 =
EndpointPolicyImpl.class.getDeclaredMethod("initialiseInterceptors",
- new Class[] {EndpointInfo.class, boolean.class,
PolicyEngineImpl.class});
+ public void testInitialize() throws NoSuchMethodException {
+ Method m1 =
EndpointPolicyImpl.class.getDeclaredMethod("initializePolicy",
+ new Class[] {});
+ Method m2 =
EndpointPolicyImpl.class.getDeclaredMethod("checkExactlyOnes",
+ new Class[] {});
+ Method m3 =
EndpointPolicyImpl.class.getDeclaredMethod("chooseAlternative",
+ new Class[] {});
+ Method m4 =
EndpointPolicyImpl.class.getDeclaredMethod("initializeVocabulary",
+ new Class[] {});
+ Method m5 =
EndpointPolicyImpl.class.getDeclaredMethod("initializeInterceptors",
+ new Class[] {});
EndpointPolicyImpl epi = control.createMock(EndpointPolicyImpl.class,
- new Method[] {m1, m2, m3,
m4});
- EndpointInfo ei = control.createMock(EndpointInfo.class);
- boolean isRequestor = false;
- PolicyEngineImpl pe = control.createMock(PolicyEngineImpl.class);
- Assertor a = control.createMock(Assertor.class);
+ new Method[] {m1, m2, m3,
m4, m5});
- epi.initialisePolicy(ei, pe);
+ epi.initializePolicy();
EasyMock.expectLastCall();
- epi.chooseAlternative(pe, a);
+ epi.checkExactlyOnes();
EasyMock.expectLastCall();
- epi.initialiseInterceptors(ei, isRequestor, pe);
+ epi.chooseAlternative();
+ EasyMock.expectLastCall();
+ epi.initializeInterceptors();
EasyMock.expectLastCall();
control.replay();
- epi.initialise(ei, isRequestor, pe, a);
+ epi.initialize();
control.verify();
}
@Test
- public void testInitialisePolicy() {
+ public void testInitializePolicy() {
EndpointInfo ei = control.createMock(EndpointInfo.class);
PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
ServiceInfo si = control.createMock(ServiceInfo.class);
@@ -131,26 +144,29 @@
EasyMock.expect(merged.normalize(true)).andReturn(merged);
control.replay();
- EndpointPolicyImpl epi = new EndpointPolicyImpl();
- epi.initialisePolicy(ei, engine);
+ EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, engine, true,
null);
+ epi.initializePolicy();
assertSame(merged, epi.getPolicy());
control.verify();
}
@Test
public void testChooseAlternative() {
- EndpointPolicyImpl epi = new EndpointPolicyImpl();
Policy policy = new Policy();
- epi.setPolicy(policy);
+
PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
Assertor assertor = control.createMock(Assertor.class);
AlternativeSelector selector =
control.createMock(AlternativeSelector.class);
+
+ EndpointPolicyImpl epi = new EndpointPolicyImpl(null, engine, true,
assertor);
+ epi.setPolicy(policy);
+
EasyMock.expect(engine.getAlternativeSelector()).andReturn(selector);
EasyMock.expect(selector.selectAlternative(policy, engine,
assertor)).andReturn(null);
control.replay();
try {
- epi.chooseAlternative(engine, assertor);
+ epi.chooseAlternative();
fail("Expected PolicyException not thrown.");
} catch (PolicyException ex) {
// expected
@@ -162,7 +178,7 @@
Collection<Assertion> alternative = new ArrayList<Assertion>();
EasyMock.expect(selector.selectAlternative(policy, engine,
assertor)).andReturn(alternative);
control.replay();
- epi.chooseAlternative(engine, assertor);
+ epi.chooseAlternative();
Collection<Assertion> choice = epi.getChosenAlternative();
assertSame(choice, alternative);
control.verify();
@@ -170,16 +186,20 @@
@Test
public void testInitialiseVocabularyServer() {
- dotestInitialiseVocabulary(false);
+ dotestInitializeVocabulary(false);
}
@Test
public void testInitialiseVocabularyClient() {
- dotestInitialiseVocabulary(true);
+ dotestInitializeVocabulary(true);
}
- private void dotestInitialiseVocabulary(boolean requestor) {
- EndpointPolicyImpl epi = new EndpointPolicyImpl();
+ private void dotestInitializeVocabulary(boolean requestor) {
+
+ EndpointInfo ei = control.createMock(EndpointInfo.class);
+ PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
+
+ EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, engine, requestor,
null);
List<Assertion> alternative = new ArrayList<Assertion>();
epi.setChosenAlternative(alternative);
Assertion ea = control.createMock(Assertion.class);
@@ -189,12 +209,11 @@
alternative.add(eaOpt);
EasyMock.expect(eaOpt.isOptional()).andReturn(true);
- EndpointInfo ei = control.createMock(EndpointInfo.class);
BindingInfo bi = control.createMock(BindingInfo.class);
EasyMock.expect(ei.getBinding()).andReturn(bi);
BindingOperationInfo boi =
control.createMock(BindingOperationInfo.class);
EasyMock.expect(bi.getOperations()).andReturn(Collections.singletonList(boi));
- PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
+
Policy op = control.createMock(Policy.class);
EasyMock.expect(engine.getAggregatedOperationPolicy(boi)).andReturn(op);
Assertion oa = control.createMock(Assertion.class);
@@ -220,7 +239,7 @@
}
control.replay();
- epi.initialiseVocabulary(ei, requestor, engine);
+ epi.initializeVocabulary();
Collection<Assertion> expected = new ArrayList<Assertion>();
expected.add(ea);
expected.add(oa);
@@ -256,32 +275,79 @@
}
@Test
+ public void testUpdatePolicy() {
+
+ EndpointPolicyImpl epi = new TestEndpointPolicy();
+
+ Policy p1 = new Policy();
+ QName aqn1 = new QName("http://x.y.z", "a");
+ p1.addAssertion(mockAssertion(aqn1, 5, true));
+
+ Policy p2 = new Policy();
+ QName aqn2 = new QName("http://x.y.z", "b");
+ p2.addAssertion(mockAssertion(aqn2, 5, true));
+ control.replay();
+
+ epi.setPolicy((Policy)p1.normalize(true));
+
+ Policy ep = epi.updatePolicy(p2).getPolicy();
+
+ List<ExactlyOne> pops =
+ CastUtils.cast(ep.getPolicyComponents(), ExactlyOne.class);
+ assertEquals("New policy must have 1 top level policy operator", 1,
pops.size());
+ List<All> alts =
+ CastUtils.cast(pops.get(0).getPolicyComponents(), All.class);
+ assertEquals("2 alternatives should be available", 2, alts.size());
+
+ List<Assertion> assertions1 =
+ CastUtils.cast(alts.get(0).getAssertions(), Assertion.class);
+ assertEquals("1 assertion should be available", 1, assertions1.size());
+
+ List<Assertion> assertions2 =
+ CastUtils.cast(alts.get(1).getAssertions(), Assertion.class);
+ assertEquals("1 assertion should be available", 1,
assertions2.size());
+
+ QName n1 = assertions1.get(0).getName();
+ QName n2 = assertions2.get(0).getName();
+ assertTrue("Policy was not merged",
+ n1.equals(aqn1) && n2.equals(aqn2) || n1.equals(aqn2) &&
n2.equals(aqn1));
+ }
+
+ private Assertion mockAssertion(QName name, int howMany, boolean
normalize) {
+ Assertion a = control.createMock(Assertion.class);
+ EasyMock.expect(a.getName()).andReturn(name).times(howMany);
+ if (normalize) {
+
EasyMock.expect(a.getType()).andReturn(Constants.TYPE_ASSERTION).times(howMany);
+ EasyMock.expect(a.normalize()).andReturn(a).times(howMany);
+ }
+ return a;
+ }
+
+ @Test
public void testInitialiseInterceptorsServer() {
- doTestInitialiseInterceptors(false);
+ doTestInitializeInterceptors(false);
}
@Test
public void testInitialiseInterceptorsClient() {
- doTestInitialiseInterceptors(true);
+ doTestInitializeInterceptors(true);
}
- private void doTestInitialiseInterceptors(boolean requestor) {
- EndpointPolicyImpl epi = new EndpointPolicyImpl();
+ private void doTestInitializeInterceptors(boolean requestor) {
+
+ EndpointInfo ei = control.createMock(EndpointInfo.class);
+ PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
+
+ EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, engine, requestor,
null);
Collection<Assertion> v = new ArrayList<Assertion>();
Collection<Assertion> fv = new ArrayList<Assertion>();
- Assertion a = control.createMock(Assertion.class);
- v.add(a);
QName aqn = new QName("http://x.y.z", "a");
- EasyMock.expect(a.getName()).andReturn(aqn).times(requestor ? 2 : 1);
- Assertion aa = control.createMock(Assertion.class);
- v.add(aa);
- EasyMock.expect(aa.getName()).andReturn(aqn).times(requestor ? 2 : 1);
+ v.add(mockAssertion(aqn, requestor ? 2 : 1, false));
+ v.add(mockAssertion(aqn, requestor ? 2 : 1, false));
fv.addAll(v);
epi.setVocabulary(v);
epi.setFaultVocabulary(fv);
- EndpointInfo ei = control.createMock(EndpointInfo.class);
- PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
PolicyInterceptorProviderRegistry reg =
control.createMock(PolicyInterceptorProviderRegistry.class);
setupPolicyInterceptorProviderRegistry(engine, reg);
@@ -296,7 +362,7 @@
}
control.replay();
- epi.initialiseInterceptors(ei, requestor, engine);
+ epi.initializeInterceptors();
assertEquals(1, epi.getInterceptors().size());
assertSame(api, epi.getInterceptors().get(0));
if (requestor) {
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
Tue Feb 5 19:41:22 2008
@@ -91,7 +91,6 @@
assertTrue(engine.isEnabled());
assertSame(selector, engine.getAlternativeSelector());
assertNotNull(engine.createOutPolicyInfo());
- assertNotNull(engine.createEndpointPolicyInfo());
}
@@ -306,30 +305,48 @@
@Test
public void testCreateEndpointPolicyInfo() throws NoSuchMethodException {
- Method m =
PolicyEngineImpl.class.getDeclaredMethod("createEndpointPolicyInfo", new
Class[] {});
- engine = control.createMock(PolicyEngineImpl.class, new Method[] {m});
+ Method m1 =
PolicyEngineImpl.class.getDeclaredMethod("createEndpointPolicyInfo",
+ new Class[] {EndpointInfo.class, boolean.class, Assertor.class});
+ engine = control.createMock(PolicyEngineImpl.class, new Method[] {m1});
engine.init();
EndpointInfo ei = control.createMock(EndpointInfo.class);
Assertor assertor = control.createMock(Assertor.class);
EndpointPolicyImpl epi = control.createMock(EndpointPolicyImpl.class);
- EasyMock.expect(engine.createEndpointPolicyInfo()).andReturn(epi);
- epi.initialise(ei, false, engine, assertor);
- EasyMock.expectLastCall();
+ EasyMock.expect(engine.createEndpointPolicyInfo(ei, false,
assertor)).andReturn(epi);
control.replay();
assertSame(epi, engine.createEndpointPolicyInfo(ei, false, assertor));
control.verify();
}
@Test
- public void testSetEndpointPolicy() {
+ public void testEndpointPolicyWithEqualPolicies() {
engine = new PolicyEngineImpl();
EndpointInfo ei = control.createMock(EndpointInfo.class);
+ ServiceInfo si = control.createMock(ServiceInfo.class);
+ ei.getService();
+ EasyMock.expectLastCall().andReturn(si).times(2);
+ si.getExtensor(Policy.class);
+ EasyMock.expectLastCall().andReturn(null).times(2);
EndpointPolicyImpl epi = control.createMock(EndpointPolicyImpl.class);
- engine.setEndpointPolicy(ei, epi);
+ control.replay();
+ engine.setServerEndpointPolicy(ei, epi);
+ engine.setClientEndpointPolicy(ei, epi);
+
assertSame(epi, engine.getClientEndpointPolicy(ei, (Conduit)null));
- assertSame(epi, engine.getServerEndpointPolicy(ei,
(Destination)null));
+ assertSame(epi, engine.getServerEndpointPolicy(ei, (Destination)null));
+
+ control.reset();
+ ei.getService();
+ EasyMock.expectLastCall().andReturn(si).times(2);
+ Policy p = new Policy();
+ si.getExtensor(Policy.class);
+ EasyMock.expectLastCall().andReturn(p).times(2);
+ epi.getPolicy();
+ EasyMock.expectLastCall().andReturn(p).times(2);
+ control.replay();
+ assertSame(epi, engine.getServerEndpointPolicy(ei, (Destination)null));
}
-
+
@Test
public void testDontAddBusInterceptors() {
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
Tue Feb 5 19:41:22 2008
@@ -285,7 +285,11 @@
.getEndpointInfo(), null) :
engine.getClientEndpointPolicy(applicationEndpoint.getEndpointInfo(),
conduit);
- engine.setEndpointPolicy(ei, ep);
+ if (conduit != null) {
+ engine.setClientEndpointPolicy(ei, ep);
+ } else {
+ engine.setServerEndpointPolicy(ei, ep);
+ }
EffectivePolicy effectiveOutbound = new EffectivePolicyImpl(ep, reg,
true, false);
EffectivePolicy effectiveInbound = new EffectivePolicyImpl(ep, reg,
false, false);
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
Tue Feb 5 19:41:22 2008
@@ -287,7 +287,7 @@
EasyMock.expect(pe.getServerEndpointPolicy(aei, null)).andReturn(epi);
EasyMock.expect(epi.getChosenAlternative()).andReturn(new
ArrayList<Assertion>());
- pe.setEndpointPolicy(ei, epi);
+ pe.setServerEndpointPolicy(ei, epi);
EasyMock.expectLastCall();
BindingInfo bi = control.createMock(BindingInfo.class);
EasyMock.expect(ei.getBinding()).andReturn(bi);
Modified:
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java
Tue Feb 5 19:41:22 2008
@@ -28,20 +28,16 @@
import org.apache.cxf.BusFactory;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.endpoint.Client;
-import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.greeter_control.BasicGreeterService;
import org.apache.cxf.greeter_control.Greeter;
import org.apache.cxf.greeter_control.PingMeFault;
import org.apache.cxf.interceptor.Interceptor;
-import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.systest.ws.util.ConnectionHelper;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
import org.apache.cxf.ws.policy.PolicyConstants;
import org.apache.cxf.ws.policy.ServerPolicyInInterceptor;
import org.apache.cxf.ws.policy.ServerPolicyOutInterceptor;
-import org.apache.neethi.Policy;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -83,7 +79,7 @@
@BeforeClass
public static void startServers() throws Exception {
- assertTrue("server did not launch correctly",
launchServer(Server.class));
+ assertTrue("server did not launch correctly",
launchServer(Server.class, false));
}
@Test
@@ -103,13 +99,6 @@
ConnectionHelper.setKeepAliveConnection(greeter, true);
- Client client = ClientProxy.getClient(greeter);
- List<ServiceInfo> sis =
client.getEndpoint().getService().getServiceInfos();
-
- ServiceInfo si = sis.get(0);
- Policy p = si.getExtensor(Policy.class);
- assertNotNull(p);
-
testInterceptors(bus);
// oneway
Modified:
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
Tue Feb 5 19:41:22 2008
@@ -19,19 +19,18 @@
package org.apache.cxf.systest.ws.policy;
+import java.util.List;
import java.util.logging.Logger;
-import javax.xml.ws.Endpoint;
-
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.endpoint.ServerRegistry;
import org.apache.cxf.greeter_control.Greeter;
import org.apache.cxf.greeter_control.PingMeFault;
import org.apache.cxf.greeter_control.ReliableGreeterService;
-import org.apache.cxf.interceptor.LoggingInInterceptor;
-import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.systest.ws.util.ConnectionHelper;
import org.apache.cxf.systest.ws.util.InMessageRecorder;
import org.apache.cxf.systest.ws.util.MessageFlow;
@@ -40,8 +39,12 @@
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
import org.apache.cxf.ws.policy.PolicyConstants;
+import org.apache.cxf.ws.policy.PolicyEngine;
import org.apache.cxf.ws.rm.RMConstants;
-
+import org.apache.neethi.All;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.ExactlyOne;
+import org.apache.neethi.Policy;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -70,20 +73,30 @@
protected void run() {
SpringBusFactory bf = new SpringBusFactory();
- Bus bus =
bf.createBus("org/apache/cxf/systest/ws/policy/rmwsdl.xml");
- PolicyTestUtils.setPolicyConstants(bus,
-
PolicyConstants.NAMESPACE_W3_200607);
+ Bus bus =
bf.createBus("org/apache/cxf/systest/ws/policy/rmwsdl_server.xml");
BusFactory.setDefaultBus(bus);
- LoggingInInterceptor in = new LoggingInInterceptor();
- bus.getInInterceptors().add(in);
- LoggingOutInterceptor out = new LoggingOutInterceptor();
- bus.getOutInterceptors().add(out);
- bus.getOutFaultInterceptors().add(out);
- ReliableGreeterImpl implementor = new ReliableGreeterImpl();
- String address = "http://localhost:9020/SoapContext/GreeterPort";
- Endpoint.publish(address, implementor);
- LOG.info("Published greeter endpoint.");
+ ServerRegistry sr = bus.getExtension(ServerRegistry.class);
+ PolicyEngine pe = bus.getExtension(PolicyEngine.class);
+
+ List<Assertion> assertions1 = getAssertions(pe,
sr.getServers().get(0));
+ assertEquals("2 assertions should be available", 2,
assertions1.size());
+ List<Assertion> assertions2 = getAssertions(pe,
sr.getServers().get(1));
+ assertEquals("1 assertion should be available", 1,
assertions2.size());
+
+ LOG.info("Published greeter endpoints.");
+ }
+
+ protected List<Assertion> getAssertions(PolicyEngine pe,
org.apache.cxf.endpoint.Server s) {
+ Policy p1 = pe.getServerEndpointPolicy(
+ s.getEndpoint().getEndpointInfo(),
null).getPolicy();
+ List<ExactlyOne> pops =
+ CastUtils.cast(p1.getPolicyComponents(), ExactlyOne.class);
+ assertEquals("New policy must have 1 top level policy operator",
1, pops.size());
+ List<All> alts =
+ CastUtils.cast(pops.get(0).getPolicyComponents(), All.class);
+ assertEquals("1 alternatives should be available", 1, alts.size());
+ return CastUtils.cast(alts.get(0).getAssertions(),
Assertion.class);
}
public static void main(String[] args) {
Modified:
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/ReliableGreeterImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/ReliableGreeterImpl.java?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/ReliableGreeterImpl.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/policy/ReliableGreeterImpl.java
Tue Feb 5 19:41:22 2008
@@ -27,10 +27,10 @@
*
*/
[EMAIL PROTECTED](serviceName = "ReliableGreeterService",
[EMAIL PROTECTED](serviceName = "RerliableGreeterService",
portName = "GreeterPort",
endpointInterface = "org.apache.cxf.greeter_control.Greeter",
targetNamespace = "http://cxf.apache.org/greeter_control",
- wsdlLocation = "testutils/greeter_control.wsdl")
+ wsdlLocation = "org/apache/cxf/systest/ws/policy/greeter.wsdl")
public class ReliableGreeterImpl extends AbstractGreeterImpl {
}
Modified:
incubator/cxf/branches/2.0.x-fixes/testutils/src/main/resources/wsdl/greeter_control.wsdl
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/testutils/src/main/resources/wsdl/greeter_control.wsdl?rev=618866&r1=618865&r2=618866&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/testutils/src/main/resources/wsdl/greeter_control.wsdl
(original)
+++
incubator/cxf/branches/2.0.x-fixes/testutils/src/main/resources/wsdl/greeter_control.wsdl
Tue Feb 5 19:41:22 2008
@@ -279,7 +279,7 @@
<wswa:UsingAddressing
xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
</wsdl:port>
</wsdl:service>
-
+
<wsdl:service name="ReliableGreeterService">
<wsdl:port binding="tns:GreeterSOAPBinding" name="GreeterPort">
<soap:address
location="http://localhost:9020/SoapContext/GreeterPort"/>
@@ -291,7 +291,16 @@
<wsrmp:BaseRetransmissionInterval Milliseconds="30000"/>
</wsrmp:RMAssertion>
</wsp:Policy>
+ </wsdl:port>
+ <wsdl:port binding="tns:GreeterSOAPBinding" name="GreeterPort2">
+ <soap:address
location="http://localhost:9020/SoapContext/GreeterPort2"/>
+ <wsp:Policy xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
+ <wsam:Addressing
xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata">
+ <wsp:Policy/>
+ </wsam:Addressing>
+ </wsp:Policy>
</wsdl:port>
+
</wsdl:service>
<wsdl:service name="BasicGreeterService">