Author: palin
Date: 2007-05-09 17:52:50 -0400 (Wed, 09 May 2007)
New Revision: 3032
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
Log:
Bug fix: publish the user provided wsdl (if available) even if some processing on policies
has been done.
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
---
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-05-09
21:27:34 UTC (rev 3031)
+++
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-05-09
21:52:50 UTC (rev 3032)
@@ -480,23 +480,28 @@
localPolicyRegistry.register(policy.getPolicyURI(), policy);
}
- WSDLService wsdlService =
wsdlDefinitions.getService(epMetaData.getServiceMetaData().getServiceName().getLocalPart());
- WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoint(epMetaData.getPortName());
- WSDLInterface wsdlInterface =
wsdlDefinitions.getInterface(epMetaData.getPortTypeName());
- WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(epMetaData.getPortTypeName());
-
//Port scope
- if (wsdlEndpoint != null)
+ WSDLService wsdlService =
wsdlDefinitions.getService(epMetaData.getServiceMetaData().getServiceName());
+ if (wsdlService != null)
{
- List<WSDLExtensibilityElement> portPolicyRefList =
wsdlEndpoint.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
- deployPolicies(portPolicyRefList, PolicyScopeLevel.WSDL_PORT,
localPolicyRegistry, epMetaData);
+ WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoint(epMetaData.getPortName());
+ if (wsdlEndpoint != null)
+ {
+ List<WSDLExtensibilityElement> portPolicyRefList =
wsdlEndpoint.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ deployPolicies(portPolicyRefList, PolicyScopeLevel.WSDL_PORT,
localPolicyRegistry, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot get port
'"+epMetaData.getPortName()+"' from the given wsdl definitions! Eventual
policies attached to this port won't be considered.");
+ }
}
else
{
- log.warn("Cannot get port '"+epMetaData.getPortName()+"'
from the given wsdl definitions!");
+ log.warn("Cannot get service
'"+epMetaData.getServiceMetaData().getServiceName()+"' from the given
wsdl definitions! Eventual policies attached to this service won't be
considered.");
}
//Binding scope
+ WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(epMetaData.getPortTypeName());
if (wsdlBinding != null)
{
List<WSDLExtensibilityElement> bindingPolicyRefList =
wsdlBinding.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
@@ -504,10 +509,11 @@
}
else
{
- log.warn("Cannot get binding for portType
'"+epMetaData.getPortTypeName()+"' from the given wsdl
definitions!");
+ log.warn("Cannot get binding for portType
'"+epMetaData.getPortTypeName()+"' from the given wsdl definitions!
Eventual policies attached to this binding won't be considered.");
}
//PortType scope
+ WSDLInterface wsdlInterface =
wsdlDefinitions.getInterface(epMetaData.getPortTypeName());
if (wsdlInterface != null)
{
List<WSDLExtensibilityElement> portTypePolicyRefList =
wsdlInterface.getExtensibilityElements(Constants.WSDL_PROPERTY_POLICYURIS);
@@ -515,7 +521,7 @@
}
else
{
- log.warn("Cannot get portType
'"+epMetaData.getPortTypeName()+"' from the given wsdl
definitions!");
+ log.warn("Cannot get portType
'"+epMetaData.getPortTypeName()+"' from the given wsdl definitions!
Eventual policies attached to this portType won't be considered.");
}
}
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-09
21:27:34 UTC (rev 3031)
+++
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-05-09
21:52:50 UTC (rev 3032)
@@ -354,21 +354,19 @@
WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
if (wsdlLocation != null)
{
- //we can no longer use the user provided wsdl without parsing it right now,
- //since we need to look for policies, eventually choose the supported
- //policy alternatives and generate the final wsdl
- //serviceMetaData.setWsdlLocation(wsdlLocation);
+ //we can no longer use the user provided wsdl without parsing it right now,
since we
+ //need to look for policies and eventually choose the supported policy
alternatives
WSDLDefinitions wsdlDefinitions = factory.parse(wsdlLocation);
processPolicyMetaDataExtension(epMetaData, wsdlDefinitions);
- if (policyLocation == null)
+ if (policyLocation != null)
{
//process wsdl fragment with additional policies
WSDLDefinitions policyDefinitions = factory.parse(policyLocation);
processPolicyMetaDataExtension(epMetaData, policyDefinitions);
}
- //generate the wsdl4j model again for the actual UMDM containing policy data
- WSDLDefinitions actualWsdlDefinitions = generator.generate(serviceMetaData);
- writeWsdl(serviceMetaData,actualWsdlDefinitions,epMetaData);
+ //now we have the UMDM containing policy data; anyway we can't write a
new wsdl file with
+ //the supported alternatives and so on, since we need to publish the file the
user provided
+ serviceMetaData.setWsdlLocation(wsdlLocation);
}
else
{
Show replies by date