You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sc...@apache.org on 2007/08/19 15:41:56 UTC
svn commit: r567402 - in
/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description:
impl/EndpointDescriptionImpl.java impl/ServiceDescriptionImpl.java
validator/EndpointDescriptionValidator.java
Author: scheu
Date: Sun Aug 19 06:41:55 2007
New Revision: 567402
URL: http://svn.apache.org/viewvc?view=rev&rev=567402
Log:
AXIS2-3131
Contributor: Roy Wood
Additional JSR-181 validation checking
Modified:
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?view=diff&rev=567402&r1=567401&r2=567402
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Sun Aug 19 06:41:55 2007
@@ -1380,6 +1380,15 @@
break;
}
}
+ // We need to convert the wsdl-based SOAP and HTTP namespace into the expected namespace for
+ //SOAPBindings or HTTPBindings
+ if (SOAP11_WSDL_BINDING.equals(wsdlBindingType)) {
+ wsdlBindingType = SOAPBinding.SOAP11HTTP_BINDING;
+ } else if (SOAP12_WSDL_BINDING.equals(wsdlBindingType)) {
+ wsdlBindingType = SOAPBinding.SOAP12HTTP_BINDING;
+ } else if (HTTP_WSDL_BINDING.equals(wsdlBindingType)) {
+ wsdlBindingType = javax.xml.ws.http.HTTPBinding.HTTP_BINDING;
+ }
}
return wsdlBindingType;
}
@@ -1428,6 +1437,9 @@
if (clientBindingID == null) {
if (getWSDLDefinition() != null) {
clientBindingID = getWSDLBindingType();
+ if (clientBindingID == null) {
+ clientBindingID = DEFAULT_CLIENT_BINDING_ID;
+ }
} else {
clientBindingID = DEFAULT_CLIENT_BINDING_ID;
}
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?view=diff&rev=567402&r1=567401&r2=567402
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Sun Aug 19 06:41:55 2007
@@ -1353,6 +1353,28 @@
.getMessage("serverSideAsync", mdc.getDeclaringClass(), mdc
.getMethodName()));
}
+ // Verify that the SOAPBinding annotation values are supported.
+ if (mdc.getSoapBindingAnnot() != null) {
+
+ // For this JAXWS engine, SOAPBinding.Use = ENCODED is unsupported
+ if (mdc.getSoapBindingAnnot().use() == javax.jws.soap.SOAPBinding.Use.ENCODED) {
+ throw ExceptionFactory.
+ makeWebServiceException(Messages.getMessage("soapBindingUseEncoded",
+ mdc.getDeclaringClass(),
+ mdc.getMethodName()));
+
+ }
+
+ // Verify that, if a SOAPBinding annotation exists, that its style be set to
+ // only DOCUMENT JSR181-Sec 4.7.1
+ if (mdc.getSoapBindingAnnot().style() == javax.jws.soap.SOAPBinding.Style.RPC) {
+ throw ExceptionFactory.
+ makeWebServiceException(Messages.getMessage("soapBindingStyle",
+ mdc.getDeclaringClass(),
+ mdc.getMethodName()));
+ }
+
+ }
}
}
// TODO: Fill this out to validate all MethodDescriptionComposite (and
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java?view=diff&rev=567402&r1=567401&r2=567402
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java Sun Aug 19 06:41:55 2007
@@ -68,6 +68,8 @@
private boolean validateWSDLBindingType() {
boolean isBindingValid = false;
String bindingType = endpointDesc.getBindingType();
+ //The wsdl binding type that we now receive has been previously mapped to the expected
+ //SOAP and HTTP bindings. So, there is now limited validation to perform
String wsdlBindingType = endpointDescWSDL.getWSDLBindingType();
if (bindingType == null) {
// I don't think this can happen; the Description layer should provide a default
@@ -90,27 +92,27 @@
isBindingValid = true;
}
// Validate that the WSDL value is valid
- else if (!EndpointDescriptionWSDL.SOAP11_WSDL_BINDING.equals(wsdlBindingType) &&
- !EndpointDescriptionWSDL.SOAP12_WSDL_BINDING.equals(wsdlBindingType) &&
- !EndpointDescriptionWSDL.HTTP_WSDL_BINDING.equals(wsdlBindingType)) {
+ else if (!SOAPBinding.SOAP11HTTP_BINDING.equals(wsdlBindingType)
+ && !SOAPBinding.SOAP12HTTP_BINDING.equals(wsdlBindingType)
+ && !javax.xml.ws.http.HTTPBinding.HTTP_BINDING.equals(wsdlBindingType)) {
addValidationFailure(this, "Invalid wsdl binding value specified: " + wsdlBindingType);
isBindingValid = false;
}
// Validate that the WSDL and annotations values indicate the same type of binding
- else if (wsdlBindingType.equals(EndpointDescriptionWSDL.SOAP11_WSDL_BINDING)
+ else if (wsdlBindingType.equals(SOAPBinding.SOAP11HTTP_BINDING)
&& (bindingType.equals(SOAPBinding.SOAP11HTTP_BINDING) ||
bindingType.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING))) {
isBindingValid = true;
- } else if (wsdlBindingType.equals(EndpointDescriptionWSDL.SOAP12_WSDL_BINDING)
+ } else if (wsdlBindingType.equals(SOAPBinding.SOAP12HTTP_BINDING)
&& (bindingType.equals(SOAPBinding.SOAP12HTTP_BINDING) ||
bindingType.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING))) {
isBindingValid = true;
- } else if (wsdlBindingType.equals(EndpointDescriptionWSDL.HTTP_WSDL_BINDING) &&
- bindingType.equals(HTTPBinding.HTTP_BINDING)) {
+ } else if (wsdlBindingType.equals(HTTPBinding.HTTP_BINDING)
+ && bindingType.equals(HTTPBinding.HTTP_BINDING)) {
isBindingValid = true;
}
// The HTTP binding is not valid on a Java Bean SEI-based endpoint; only on a Provider based one.
- else if (wsdlBindingType.equals(EndpointDescriptionWSDL.HTTP_WSDL_BINDING) &&
+ else if (wsdlBindingType.equals(HTTPBinding.HTTP_BINDING) &&
endpointDesc.isEndpointBased()) {
addValidationFailure(this,
"The HTTPBinding can not be specified for SEI-based endpoints");
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org