Author: richard.opalka(a)jboss.com
Date: 2010-05-24 07:32:01 -0400 (Mon, 24 May 2010)
New Revision: 12312
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
Log:
[JBWS-3031] fixing wsa action computation algorithm (delimeter) plus fixing regression
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2010-05-21
18:15:20 UTC (rev 12311)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2010-05-24
11:32:01 UTC (rev 12312)
@@ -655,9 +655,10 @@
String operationName = wsdlOperation.getName().getLocalPart();
final WSDLProperty faultName =
fault.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_FAULT);
+ final String delimeter = this.getDelimeter(prefix);
if (faultName != null && faultName.getValue() != null &&
!"".equals(faultName.getValue()))
{
- return prefix + operationName + "/Fault/" + faultName.getValue();
+ return prefix + operationName + delimeter + "Fault" + delimeter +
faultName.getValue();
}
throw new IllegalStateException();
@@ -665,15 +666,21 @@
private String getActionPrefix(final WSDLInterfaceOperation wsdlOperation)
{
- String tns = wsdlOperation.getName().getNamespaceURI();
- if (!tns.endsWith("/"))
- tns += "/";
-
final String portTypeName =
wsdlOperation.getWsdlInterface().getName().getLocalPart();
+ String namespace = wsdlOperation.getName().getNamespaceURI();
+ final String delimeter = this.getDelimeter(namespace);
+
+ if (!namespace.endsWith(delimeter))
+ namespace += delimeter;
- return tns + portTypeName + "/";
+ return namespace + portTypeName + delimeter;
}
+ private String getDelimeter(final String namespace)
+ {
+ return namespace.toLowerCase().startsWith("urn:") ? ":" :
"/";
+ }
+
protected void buildFaultMetaData(OperationMetaData opMetaData, WSDLInterfaceOperation
wsdlOperation)
{
TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2010-05-21
18:15:20 UTC (rev 12311)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2010-05-24
11:32:01 UTC (rev 12312)
@@ -292,18 +292,32 @@
return;
}
- // Build endpoint meta data
-
- for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
+ WSDLEndpoint wsdlEndpoint = this.getWsdlEndpoint(wsdlDefinitions,
epMetaData.getPortName());
+ if (wsdlEndpoint == null)
+ throw new WSException("Cannot find port in wsdl: " +
epMetaData.getPortName());
+
+ QName bindingName = wsdlEndpoint.getBinding();
+ WSDLBinding wsdlBinding =
wsdlEndpoint.getWsdlService().getWsdlDefinitions().getBinding(bindingName);
+ String bindingType = wsdlBinding.getType();
+ if (Constants.NS_SOAP11.equals(bindingType) ||
Constants.NS_SOAP12.equals(bindingType))
{
- QName bindingName = wsdlEndpoint.getBinding();
- WSDLBinding wsdlBinding =
wsdlEndpoint.getWsdlService().getWsdlDefinitions().getBinding(bindingName);
- String bindingType = wsdlBinding.getType();
- if (Constants.NS_SOAP11.equals(bindingType) ||
Constants.NS_SOAP12.equals(bindingType))
+ setupOperationsFromWSDL(epMetaData, wsdlEndpoint);
+ }
+ }
+
+ private WSDLEndpoint getWsdlEndpoint(WSDLDefinitions wsdlDefinitions, QName portName)
+ {
+ WSDLEndpoint wsdlEndpoint = null;
+ for (WSDLService wsdlService : wsdlDefinitions.getServices())
+ {
+ WSDLEndpoint auxEndpoint = wsdlService.getEndpoint(portName);
+ if (auxEndpoint != null)
{
- setupOperationsFromWSDL(epMetaData, wsdlEndpoint);
+ wsdlEndpoint = auxEndpoint;
+ break;
}
}
+ return wsdlEndpoint;
}
/**
Show replies by date