You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by em...@apache.org on 2006/10/26 09:30:53 UTC
svn commit: r467895 - in /incubator/cxf/trunk:
api/src/main/java/org/apache/cxf/endpoint/
api/src/main/java/org/apache/cxf/interceptor/
api/src/main/java/org/apache/cxf/message/
api/src/main/java/org/apache/cxf/service/ api/src/main/java/org/apache/cxf...
Author: ema
Date: Thu Oct 26 00:30:51 2006
New Revision: 467895
URL: http://svn.apache.org/viewvc?view=rev&rev=467895
Log:
* made databinding enableSchemaValidation configuration work
* Added databinding schemavlidation for SOAPDocLit type test.
* Fixed EndpointReference getSchema() issue which caused schemaFactory.newSchema() exception for a schema with imported element
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/databinding-schema-validation.xml (with props)
Removed:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPRpcLitClientTypeTest.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPRpcLitServerImpl.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/xml/XMLClientTypeTest.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/xml/XMLServerImpl.java
Modified:
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Endpoint.java
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/AbstractBasicInterceptorProvider.java
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageImpl.java
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/Service.java
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointImpl.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceImpl.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Messages.properties
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/configured-endpoints.xml
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient4.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient5.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitServerImpl.java
Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Endpoint.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Endpoint.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Endpoint.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/Endpoint.java Thu Oct 26 00:30:51 2006
@@ -19,6 +19,7 @@
package org.apache.cxf.endpoint;
+import java.util.Map;
import java.util.concurrent.Executor;
import org.apache.cxf.binding.Binding;
@@ -31,7 +32,7 @@
* Represents an endpoint that receives messages.
*
*/
-public interface Endpoint extends InterceptorProvider {
+public interface Endpoint extends Map<String, Object>, InterceptorProvider {
EndpointInfo getEndpointInfo();
@@ -46,5 +47,9 @@
MessageObserver getInFaultObserver();
MessageObserver getOutFaultObserver();
+
+ boolean getEnableSchemaValidation();
+
+ void setEnableSchemaValidation(boolean value);
}
Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/AbstractBasicInterceptorProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/AbstractBasicInterceptorProvider.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/AbstractBasicInterceptorProvider.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/AbstractBasicInterceptorProvider.java Thu Oct 26 00:30:51 2006
@@ -22,7 +22,7 @@
import java.util.ArrayList;
import java.util.List;
-public abstract class AbstractBasicInterceptorProvider implements InterceptorProvider {
+public abstract class AbstractBasicInterceptorProvider implements InterceptorProvider {
private List<Interceptor> in = new ArrayList<Interceptor>();
private List<Interceptor> out = new ArrayList<Interceptor>();
Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageImpl.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageImpl.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageImpl.java Thu Oct 26 00:30:51 2006
@@ -26,9 +26,9 @@
import java.util.Map;
import java.util.Set;
+import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.interceptor.InterceptorChain;
import org.apache.cxf.service.Service;
-import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.service.model.OperationInfo;
import org.apache.cxf.transport.Conduit;
import org.apache.cxf.transport.Destination;
@@ -126,14 +126,14 @@
}
if (val == null) {
- EndpointInfo ep = get(EndpointInfo.class);
+ Endpoint ep = getExchange().get(Endpoint.class);
if (ep != null) {
- val = ep.getProperty(key);
+ val = ep.get(key);
}
}
if (val == null) {
- Service ep = get(Service.class);
+ Service ep = getExchange().get(Service.class);
if (ep != null) {
val = ep.get(key);
}
Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/Service.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/Service.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/Service.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/Service.java Thu Oct 26 00:30:51 2006
@@ -49,4 +49,8 @@
void setInvoker(Invoker invoker);
Map<QName, Endpoint> getEndpoints();
+
+ void setEnableSchemaValidationForAllPort(boolean value);
+
+ boolean getEnableSchemaValidationForAllPort();
}
Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java Thu Oct 26 00:30:51 2006
@@ -45,18 +45,15 @@
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
-
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
-
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.StringUtils;
-//import org.apache.cxf.service.model.SchemaInfo;
import org.apache.cxf.service.model.SchemaInfo;
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.ws.addressing.AttributedURIType;
@@ -388,6 +385,33 @@
}
+ /* private static List<javax.wsdl.extensions.schema.Schema> getSchemas(Definition definition) {
+ Types types = definition.getTypes();
+ List<javax.wsdl.extensions.schema.Schema> schemaList =
+ new ArrayList<javax.wsdl.extensions.schema.Schema>();
+ if (types != null) {
+ for (Object o : types.getExtensibilityElements()) {
+ if (o instanceof javax.wsdl.extensions.schema.Schema) {
+ javax.wsdl.extensions.schema.Schema s =
+ (javax.wsdl.extensions.schema.Schema)o;
+ schemaList.add(s);
+ }
+ }
+ }
+
+ Map wsdlImports = definition.getImports();
+ for (Object o : wsdlImports.values()) {
+ if (o instanceof List) {
+ for (Object p : (List)o) {
+ if (p instanceof Import) {
+ schemaList.addAll(getSchemas(((Import)p).getDefinition()));
+ }
+ }
+ }
+ }
+ return schemaList;
+ }*/
+
public static Schema getSchema(ServiceInfo serviceInfo) {
if (serviceInfo == null) {
@@ -399,12 +423,43 @@
}
}
Schema schema = schemaMap.get(serviceInfo);
+ /*Object obj = serviceInfo.getProperty("org.apache.cxf.wsdl11.WSDLServiceBuilder.DEFINITION");
+ Definition def = (Definition)obj;*/
+ /* if (schema == null) {
+ List<javax.wsdl.extensions.schema.Schema> schemas = getSchemas(def);
+ SchemaFactory factory = SchemaFactory.newInstance(
+ XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ List<Source> schemaSources = new ArrayList<Source>();
+ for (javax.wsdl.extensions.schema.Schema s : schemas) {
+ Source source = new DOMSource(s.getElement());
+ if (source != null) {
+ schemaSources.add(source);
+ }
+ }
+ try {
+ schema = factory.newSchema(schemaSources.toArray(
+ new Source[schemaSources.size()]));
+ if (schema != null) {
+ synchronized (schemaMap) {
+ schemaMap.put(serviceInfo, schema);
+ }
+ LOG.log(Level.FINE, "Obtained schema from wsdl definition");
+ }
+ } catch (SAXException ex) {
+ // Something not right with the schema from the wsdl.
+
+ }
+ }
+ return schema;
+
+ }*/
if (schema == null) {
SchemaFactory factory = SchemaFactory.newInstance(
XMLConstants.W3C_XML_SCHEMA_NS_URI);
List<Source> schemaSources = new ArrayList<Source>();
for (SchemaInfo schemaInfo : serviceInfo.getTypeInfo().getSchemas()) {
Source source = new DOMSource(schemaInfo.getElement());
+ source.setSystemId(schemaInfo.getElement().getBaseURI());
if (source != null) {
schemaSources.add(source);
}
@@ -422,9 +477,9 @@
// Something not right with the schema from the wsdl.
LOG.log(Level.WARNING, "SAXException for newSchema()", ex);
}
+
}
return schema;
-
}
Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointImpl.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointImpl.java Thu Oct 26 00:30:51 2006
@@ -33,7 +33,7 @@
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.configuration.Configurable;
-import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
+import org.apache.cxf.interceptor.AbstractAttributedInterceptorProvider;
import org.apache.cxf.interceptor.AbstractFaultChainIntiatorObserver;
import org.apache.cxf.interceptor.InFaultChainInitiatorObserver;
import org.apache.cxf.interceptor.OutFaultChainInitiatorObserver;
@@ -42,7 +42,7 @@
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.transport.MessageObserver;
-public class EndpointImpl extends AbstractBasicInterceptorProvider implements Endpoint, Configurable {
+public class EndpointImpl extends AbstractAttributedInterceptorProvider implements Endpoint, Configurable {
private static final Logger LOG = LogUtils.getL7dLogger(EndpointImpl.class);
private static final ResourceBundle BUNDLE = LOG.getResourceBundle();
@@ -54,8 +54,9 @@
private Bus bus;
private AbstractFaultChainIntiatorObserver inFaultObserver;
private AbstractFaultChainIntiatorObserver outFaultObserver;
- private boolean validating;
-
+ private boolean schemaValidation;
+
+
public EndpointImpl(Bus bus, Service s, QName endpointName) throws EndpointException {
this(bus, s, s.getServiceInfo().getEndpoint(endpointName));
}
@@ -79,14 +80,7 @@
return endpointInfo.getName().toString();
}
- public boolean getValidating() {
- return validating;
- }
-
- public void setValidating(boolean v) {
- validating = v;
- }
-
+
public EndpointInfo getEndpointInfo() {
return endpointInfo;
}
@@ -140,4 +134,12 @@
public MessageObserver getOutFaultObserver() {
return outFaultObserver;
}
+
+ public void setEnableSchemaValidation(boolean value) {
+ schemaValidation = value;
+ }
+ public boolean getEnableSchemaValidation() {
+ return schemaValidation;
+ }
+
}
Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceImpl.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceImpl.java Thu Oct 26 00:30:51 2006
@@ -33,12 +33,16 @@
import org.apache.cxf.service.model.ServiceInfo;
public class ServiceImpl extends AbstractAttributedInterceptorProvider implements Service, Configurable {
-
private ServiceInfo serviceInfo;
private DataBinding dataBinding;
private Executor executor;
private Invoker invoker;
private Map<QName, Endpoint> endpoints = new HashMap<QName, Endpoint>();
+ private boolean enableSchemaValidationForAllPort;
+
+ public ServiceImpl() {
+
+ }
public ServiceImpl(ServiceInfo si) {
serviceInfo = si;
@@ -87,5 +91,11 @@
public void setEndpoints(Map<QName, Endpoint> endpoints) {
this.endpoints = endpoints;
}
+ public void setEnableSchemaValidationForAllPort(boolean value) {
+ enableSchemaValidationForAllPort = value;
+ }
+ public boolean getEnableSchemaValidationForAllPort() {
+ return enableSchemaValidationForAllPort;
+ }
}
Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java Thu Oct 26 00:30:51 2006
@@ -39,6 +39,7 @@
service.getInInterceptors().add(new OutgoingChainSetupInterceptor());
service.getInInterceptors().add(new OutgoingChainInterceptor());
service.getOutInterceptors().add(new MessageSenderInterceptor());
+ service.getOutFaultInterceptors().add(new OutgoingChainSetupInterceptor());
service.getOutFaultInterceptors().add(new MessageSenderInterceptor());
}
Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java Thu Oct 26 00:30:51 2006
@@ -104,7 +104,9 @@
if (cls == Object.class || cls == String.class || cls == Holder.class) {
cls = null;
- } else if (cls.isPrimitive() || cls.isInterface() || cls.isAnnotation()) {
+ } else if (cls.isPrimitive()) {
+ return cls;
+ } else if (cls.isInterface() || cls.isAnnotation()) {
cls = null;
}
if (cls != null) {
@@ -351,8 +353,15 @@
} else {
throw new Fault(new Message("UNKNOWN_SOURCE", BUNDLE, source.getClass().getName()));
}
+
} catch (Exception ex) {
- throw new Fault(new Message("MARSHAL_ERROR", BUNDLE), ex);
+ if (ex instanceof javax.xml.bind.UnmarshalException) {
+ javax.xml.bind.UnmarshalException unmarshalEx = (javax.xml.bind.UnmarshalException)ex;
+ throw new Fault(new Message("UNMARSHAL_ERROR",
+ BUNDLE, unmarshalEx.getLinkedException().getMessage()), ex);
+ } else {
+ throw new Fault(new Message("UNMARSHAL_ERROR", BUNDLE, ex.getMessage()), ex);
+ }
}
return getElementValue(obj, elName);
}
Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Messages.properties?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Messages.properties (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/Messages.properties Thu Oct 26 00:30:51 2006
@@ -22,6 +22,7 @@
SCHEMA_NOT_RESOLVED = Could not resolve URI: {0}
UNKNOWN_SOURCE = Marshalling Error, unrecognized source {0}.
MARSHAL_ERROR = Marshalling Error.
+UNMARSHAL_ERROR = Unmarshalling Error : {0}
UNKNOWN_ELEMENT_NAME = Could not determine the element name for {0}.
UNKNOWN_PACKAGE_NS = No package info found for class {0}. Cannot lookup default schema namespace.
SCHEMA_GEN_EXC = Could not generate schemas.
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java Thu Oct 26 00:30:51 2006
@@ -47,6 +47,7 @@
import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
import org.apache.cxf.jaxws.support.ProviderServiceFactoryBean;
+import org.apache.cxf.message.Message;
import org.apache.cxf.resource.DefaultResourceManager;
import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.resource.ResourceResolver;
@@ -103,8 +104,11 @@
}
serviceFactory.setBus(bus);
service = serviceFactory.create();
+
configureObject(service);
+ service.put(Message.SCHEMA_VALIDATION_ENABLED, service.getEnableSchemaValidationForAllPort());
+
if (implInfo.isWebServiceProvider()) {
service.setInvoker(new ProviderInvoker((Provider<?>)i));
} else {
@@ -227,8 +231,14 @@
if (implInfo.isWebServiceProvider()) {
getServer().setMessageObserver(new ProviderChainObserver(getEndpoint(), bus, implInfo));
}
- configureObject(getEndpoint());
+ org.apache.cxf.endpoint.Endpoint endpoint = getEndpoint();
+
+ configureObject(endpoint);
+
+ if (endpoint.getEnableSchemaValidation()) {
+ endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, endpoint.getEnableSchemaValidation());
+ }
server.start();
}
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java Thu Oct 26 00:30:51 2006
@@ -90,7 +90,7 @@
Client client = eih.getClient();
JaxWsEndpointImpl endpoint = (JaxWsEndpointImpl)client.getEndpoint();
assertEquals("Unexpected bean name", PORT_NAME.toString(), endpoint.getBeanName());
- assertTrue("Unexpected value for property validating", !endpoint.getValidating());
+ assertTrue("Unexpected value for property validating", !endpoint.getEnableSchemaValidation());
// System.out.println("endpoint interceptors");
List<Interceptor> interceptors = endpoint.getInInterceptors();
@@ -218,7 +218,7 @@
JaxWsEndpointImpl endpoint = (JaxWsEndpointImpl)ei.getEndpoint();
assertEquals("Unexpected bean name", PORT_NAME.toString(), endpoint.getBeanName());
- assertTrue("Unexpected value for property validating", !endpoint.getValidating());
+ assertTrue("Unexpected value for property validating", !endpoint.getEnableSchemaValidation());
List<Interceptor> interceptors = endpoint.getInInterceptors();
assertNull("Unexpected test interceptor", findTestInterceptor(interceptors));
@@ -273,7 +273,7 @@
JaxWsEndpointImpl endpoint = (JaxWsEndpointImpl)ei.getEndpoint();
assertEquals("Unexpected bean name", PORT_NAME.toString(), endpoint.getBeanName());
- assertTrue("Unexpected value for property validating", endpoint.getValidating());
+ assertTrue("Unexpected value for property validating", endpoint.getEnableSchemaValidation());
List<Interceptor> interceptors = endpoint.getInInterceptors();
assertEquals("Unexpected number of interceptors.", 1, interceptors.size());
assertEquals("Unexpected interceptor id.", "endpoint-in",
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/configured-endpoints.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/configured-endpoints.xml?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/configured-endpoints.xml (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/configured-endpoints.xml Thu Oct 26 00:30:51 2006
@@ -55,7 +55,7 @@
</bean>
<bean name="{http://apache.org/hello_world_soap_http}SoapPort" abstract="true">
- <property name="validating" value="true"/>
+ <property name="enableSchemaValidation" value="true"/>
<property name="inInterceptors">
<list>
<bean class="org.apache.cxf.jaxws.ConfiguredEndpointTest$TestInterceptor">
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java Thu Oct 26 00:30:51 2006
@@ -22,16 +22,11 @@
package org.apache.cxf.systest.soap12;
import java.net.URL;
-import java.util.List;
-import java.util.Map;
import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
import junit.framework.Test;
import junit.framework.TestSuite;
-
-import org.apache.cxf.message.Message;
import org.apache.cxf.systest.common.ClientServerSetupBase;
import org.apache.cxf.systest.common.ClientServerTestBase;
import org.apache.hello_world_soap12_http.Greeter;
@@ -61,18 +56,13 @@
String echo = greeter.sayHi();
assertEquals("Bonjour", echo);
}
- BindingProvider bp = (BindingProvider)greeter;
- Map<String, Object> responseContext = bp.getResponseContext();
- Integer responseCode = (Integer) responseContext.get(Message.RESPONSE_CODE);
- assertEquals(200, responseCode.intValue());
+
}
public void testPingMeFault() throws Exception {
- Greeter greeter = getGreeter();
-
+ Greeter greeter = getGreeter();
try {
greeter.pingMe();
-
fail("Should throw Exception!");
} catch (PingMeFault ex) {
FaultDetail detail = ex.getFaultInfo();
@@ -80,16 +70,6 @@
assertEquals((short)1, detail.getMinor());
assertEquals("PingMeFault raised by server", ex.getMessage());
}
-
- BindingProvider bp = (BindingProvider)greeter;
- Map<String, Object> responseContext = bp.getResponseContext();
- String contentType = (String) responseContext.get(Message.CONTENT_TYPE);
- assertEquals("application/soap+xml", contentType);
- Integer responseCode = (Integer) responseContext.get(Message.RESPONSE_CODE);
- assertEquals(500, responseCode.intValue());
- Map ct = (Map) responseContext.get(Message.PROTOCOL_HEADERS);
- List contentTypes = (List) ct.get("Content-Type");
- assertTrue(contentTypes.contains("application/soap+xml"));
}
private Greeter getGreeter() {
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java Thu Oct 26 00:30:51 2006
@@ -1541,7 +1541,7 @@
z = new Holder<String>();
try {
ret = docClient.testSimpleRestriction(x, y, z);
- //fail("x parameter maxLength=10 restriction is violated.");
+ fail("x parameter maxLength=10 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1554,7 +1554,7 @@
try {
ret = testDocLiteral ? docClient.testSimpleRestriction(x, y, z)
: xmlClient.testSimpleRestriction(x, y, z);
- //fail("y parameter maxLength=10 restriction is violated.");
+ fail("y parameter maxLength=10 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1591,7 +1591,7 @@
try {
ret = testDocLiteral ? docClient.testSimpleRestriction2(x, y, z)
: xmlClient.testSimpleRestriction2(x, y, z);
- //fail("minLength=5 restriction is violated.");
+ fail("minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1627,7 +1627,7 @@
z = new Holder<String>();
try {
ret = docClient.testSimpleRestriction3(x, y, z);
- //fail("x parameter maxLength=10 && minLength=5 restriction is violated.");
+ fail("x parameter maxLength=10 && minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1640,7 +1640,7 @@
try {
ret = testDocLiteral ? docClient.testSimpleRestriction3(x, y, z)
: xmlClient.testSimpleRestriction3(x, y, z);
- //fail("y parameter maxLength=10 && minLength=5 restriction is violated.");
+ fail("y parameter maxLength=10 && minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1677,7 +1677,7 @@
try {
ret = testDocLiteral ? docClient.testSimpleRestriction4(x, y, z)
: xmlClient.testSimpleRestriction4(x, y, z);
- //fail("x parameter minLength=5 restriction is violated.");
+ fail("x parameter minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1714,7 +1714,7 @@
z = new Holder<String>();
try {
ret = docClient.testSimpleRestriction5(x, y, z);
- //fail("maxLength=10 && minLength=5 restriction is violated.");
+ fail("maxLength=10 && minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1727,7 +1727,7 @@
try {
ret = testDocLiteral ? docClient.testSimpleRestriction5(x, y, z)
: xmlClient.testSimpleRestriction5(x, y, z);
- //fail("maxLength=10 && minLength=5 restriction is violated.");
+ fail("maxLength=10 && minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1764,7 +1764,7 @@
try {
ret = testDocLiteral ? docClient.testSimpleRestriction6(x, y, z)
: xmlClient.testSimpleRestriction6(x, y, z);
- //fail("maxLength=10 && minLength=5 restriction is violated.");
+ fail("maxLength=10 && minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1802,7 +1802,7 @@
z = new Holder<byte[]>();
try {
ret = docClient.testHexBinaryRestriction(x, y, z);
- //fail("maxLength=10 && minLength=1 restriction is violated.");
+ fail("maxLength=10 && minLength=1 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1815,7 +1815,7 @@
try {
ret = testDocLiteral ? docClient.testHexBinaryRestriction(x, y, z)
: xmlClient.testHexBinaryRestriction(x, y, z);
- //fail("maxLength=10 && minLength=1 restriction is violated.");
+ fail("maxLength=10 && minLength=1 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -1858,9 +1858,9 @@
z = new Holder<byte[]>();
try {
ret = docClient.testBase64BinaryRestriction(x, y, z);
- //fail("length=10 restriction is violated.");
+ fail("length=10 restriction is violated.");
} catch (Exception ex) {
- ex.printStackTrace();
+ // ex.printStackTrace();
}
}
}
@@ -1884,9 +1884,9 @@
try {
ret = testDocLiteral ? docClient.testSimpleListRestriction2(x, y, z)
: xmlClient.testSimpleListRestriction2(x, y, z);
- //fail("length=10 restriction is violated.");
+ fail("length=10 restriction is violated.");
} catch (Exception ex) {
- ex.printStackTrace();
+ //ex.printStackTrace();
}
} else {
String[] x = {"I", "am", "SimpleList"};
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient4.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient4.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient4.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient4.java Thu Oct 26 00:30:51 2006
@@ -1830,7 +1830,7 @@
try {
ret = testDocLiteral ? docClient.testAnyURIRestriction(x, y, z)
: xmlClient.testAnyURIRestriction(x, y, z);
- //fail("maxLength=50 restriction is violated.");
+ fail("maxLength=50 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient5.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient5.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient5.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient5.java Thu Oct 26 00:30:51 2006
@@ -72,7 +72,7 @@
ret = testDocLiteral ? docClient.testComplexRestriction(x, y, z)
: xmlClient.testComplexRestriction(x, y, z);
- //fail("maxLength=10 restriction is violated.");
+ fail("maxLength=10 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -119,7 +119,7 @@
ret = testDocLiteral ? docClient.testComplexRestriction2(x, y, z)
: xmlClient.testComplexRestriction2(x, y, z);
- //fail("length=10 restriction is violated.");
+ fail("length=10 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -164,7 +164,7 @@
z = new Holder<ComplexRestriction3>();
ret = testDocLiteral ? docClient.testComplexRestriction3(x, y, z)
: xmlClient.testComplexRestriction3(x, y, z);
- //fail("maxLength=10 && minLength=5 restriction is violated.");
+ fail("maxLength=10 && minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -177,7 +177,7 @@
z = new Holder<ComplexRestriction3>();
ret = testDocLiteral ? docClient.testComplexRestriction3(x, y, z)
: xmlClient.testComplexRestriction3(x, y, z);
- //fail("maxLength=10 && minLength=5 restriction is violated.");
+ fail("maxLength=10 && minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -222,7 +222,7 @@
z = new Holder<ComplexRestriction4>();
ret = testDocLiteral ? docClient.testComplexRestriction4(x, y, z)
: xmlClient.testComplexRestriction4(x, y, z);
- //fail("maxLength=5 restriction is violated.");
+ fail("maxLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -265,7 +265,7 @@
y = new Holder<ComplexRestriction5>(yOrig);
z = new Holder<ComplexRestriction5>();
ret = docClient.testComplexRestriction5(x, y, z);
- //fail("maxLength=50 && minLength=5 restriction is violated.");
+ fail("maxLength=50 && minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
@@ -279,7 +279,7 @@
z = new Holder<ComplexRestriction5>();
ret = testDocLiteral ? docClient.testComplexRestriction5(x, y, z)
: xmlClient.testComplexRestriction5(x, y, z);
- //fail("maxLength=50 && minLength=5 restriction is violated.");
+ fail("maxLength=50 && minLength=5 restriction is violated.");
} catch (Exception ex) {
//ex.printStackTrace();
}
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/databinding-schema-validation.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/databinding-schema-validation.xml?view=auto&rev=467895
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/databinding-schema-validation.xml (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/databinding-schema-validation.xml Thu Oct 26 00:30:51 2006
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:foo="http://cxf.apache.org/configuration/foo"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="{http://apache.org/type_test/doc}SOAPService" abstract="true">
+ <property name="enableSchemaValidationForAllPort" value="true"/>
+ </bean>
+ <bean id="{http://apache.org/type_test/rpc}SOAPService" abstract="true">
+ <property name="enableSchemaValidationForAllPort" value="true"/>
+ </bean>
+ <bean id="{http://apache.org/type_test/xml}XMLService" abstract="true">
+ <property name="enableSchemaValidationForAllPort" value="true"/>
+ </bean>
+
+</beans>
\ No newline at end of file
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/databinding-schema-validation.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/databinding-schema-validation.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/databinding-schema-validation.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java Thu Oct 26 00:30:51 2006
@@ -42,6 +42,8 @@
super(name);
}
+
+
public static Test suite() throws Exception {
TestSuite suite = new TestSuite(SOAPDocLitClientTypeTest.class);
return new ClientServerSetupBase(suite) {
@@ -51,11 +53,6 @@
}
public void setUp() throws Exception {
- // set up configuration to enable schema validation
- // URL url = getClass().getResource("../cxf-config.xml");
- // assertNotNull("cannot find test resource", url);
- // configFileName = url.toString();
- configFileName = null;
super.setUp();
initClient(AbstractTypeTestClient5.class, SERVICE_NAME, PORT_NAME, WSDL_PATH);
}
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitServerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitServerImpl.java?view=diff&rev=467895&r1=467894&r2=467895
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitServerImpl.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitServerImpl.java Thu Oct 26 00:30:51 2006
@@ -23,6 +23,7 @@
import javax.xml.ws.Endpoint;
+import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.systest.common.TestServerBase;
import org.apache.cxf.systest.type_test.TypeTestImpl;
import org.apache.type_test.doc.TypeTestPortType;
@@ -31,7 +32,9 @@
public void run() {
-
+ SpringBusFactory sf = new SpringBusFactory();
+ sf.setDefaultBus(null);
+ sf.setDefaultBus(sf.createBus("org/apache/cxf/systest/type_test/databinding-schema-validation.xml"));
Object implementor = new SOAPTypeTestImpl();
String address = "http://localhost:9007/SOAPService/SOAPPort/";
Endpoint.publish(address, implementor);