Author: thomas.diesler(a)jboss.com
Date: 2006-12-05 20:24:09 -0500 (Tue, 05 Dec 2006)
New Revision: 1566
Added:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Style.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Deserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64DeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Serializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64SerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DeserializerFactoryBase.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/NullValueSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SerializerFactoryBase.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/SomeClass.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/JAXBAccessor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/ReflectiveMethodAccessor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/MetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCDeployment.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSCommonConfig.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSClientConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSCommonConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigFactoryJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigRootJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedApplicationMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedBeanMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedHandlerMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedMessageDrivenMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedPortComponentRefMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedServiceRefMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedSessionMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebSecurityMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ExceptionMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaXmlTypeMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/MethodParamPartsMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PackageMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PortMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceInterfaceMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/VariableMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlMessageMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlReturnValueMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/PortComponentMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebserviceDescriptionMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainsMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/DOMTypes.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/Extendable.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/NCName.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL11DefinitionFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL11Reader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL11Writer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL20Reader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL20Writer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingFault.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingMessageReference.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingOperationInput.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingOperationOutput.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLDefinitions.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLDefinitionsFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLDocumentation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLEndpoint.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLFeature.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLImport.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInclude.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterface.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceFault.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceMessageReference.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationInfault.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationInput.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationOutfault.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationOutput.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLLocatorImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLMIMEPart.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLProperty.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLRPCPart.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLRPCSignatureItem.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLSOAPHeader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLService.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLTypes.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLWriter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/XSModelTypes.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSErrorHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModel.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModelGroup.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamedMap.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObject.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObjectList.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSParticle.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSStringList.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/WSSchemaUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/SchemaUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/XSDWriter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Config.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Encrypt.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Operation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Port.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireEncryption.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireSignature.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireTimestamp.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Requires.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Sign.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Target.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Targetable.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Timestamp.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Username.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfiguration.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfigurationFactory.java
Removed:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Deserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64DeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Serializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64SerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DeserializerFactoryBase.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/NullValueSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SerializerFactoryBase.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/JAXBAccessor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/ReflectiveMethodAccessor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCDeployment.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSClientConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSCommonConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigFactoryJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigRootJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedApplicationMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedBeanMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedHandlerMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedMessageDrivenMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedPortComponentRefMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedServiceRefMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedSessionMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebSecurityMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ExceptionMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaXmlTypeMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/MethodParamPartsMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PackageMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PortMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceInterfaceMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/VariableMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlMessageMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlReturnValueMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/PortComponentMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebserviceDescriptionMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainsMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSErrorHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModel.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModelGroup.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamedMap.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObject.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObjectList.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSParticle.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSStringList.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/WSSchemaUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/SchemaUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/XSDWriter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Config.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Encrypt.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Operation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Port.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireEncryption.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireSignature.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireTimestamp.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Requires.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Sign.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Target.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Targetable.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Timestamp.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Username.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfiguration.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfigurationFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/
Modified:
branches/tdiesler/trunk/.classpath
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/EndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/OperationMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ParameterMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServerEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/TypesMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/UnifiedMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/EndpointInvocation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/SerializationContext.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/SOAPFaultHelperJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSupport.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/WSAddressingServerHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WSSecurityDispatcher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL20.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaWriter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/RPCSignature.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/XSDToJava.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToXSDHelper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/JavaToXSDIntf.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/ServiceCreatorIntf.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/client/JSR181ComplexTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/assertions/Jaxrpc20AssertionsTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/assertions/WSDL20AssertionsTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/config/globalconfig/GlobalConfigTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11Validator.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java
Log:
partial commit
Modified: branches/tdiesler/trunk/.classpath
===================================================================
--- branches/tdiesler/trunk/.classpath 2006-12-06 01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/.classpath 2006-12-06 01:24:09 UTC (rev 1566)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry
excluding="org/jboss/ws/integration/jboss50/ServiceRefHandler.java"
kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="output/tests/wstools/java"/>
<classpathentry excluding="org/jboss/test/ws/interop/" kind="src"
path="src/test/java"/>
<classpathentry kind="lib" path="thirdparty/activation.jar"/>
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,13 +34,13 @@
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.umdm.EndpointMetaData.Type;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.config.WSConfigFactory;
-import org.jboss.ws.metadata.config.jaxrpc.WSClientConfigJAXRPC;
-import org.jboss.ws.metadata.config.jaxrpc.WSConfigRootJAXRPC;
-import org.jboss.ws.metadata.config.jaxws.WSClientConfigJAXWS;
-import org.jboss.ws.metadata.config.jaxws.WSConfigRootJAXWS;
-import org.jboss.ws.metadata.config.jaxws.WSHandlerChainsConfigJAXWS;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.core.metadata.config.WSConfigFactory;
+import org.jboss.ws.core.metadata.config.jaxrpc.WSClientConfigJAXRPC;
+import org.jboss.ws.core.metadata.config.jaxrpc.WSConfigRootJAXRPC;
+import org.jboss.ws.core.metadata.config.jaxws.WSClientConfigJAXWS;
+import org.jboss.ws.core.metadata.config.jaxws.WSConfigRootJAXWS;
+import org.jboss.ws.core.metadata.config.jaxws.WSHandlerChainsConfigJAXWS;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
/**
* Client side endpoint meta data.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/EndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/EndpointMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/EndpointMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -42,16 +42,16 @@
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.common.utils.JavaUtils;
import org.jboss.ws.core.CommonSOAPBinding;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.Use;
+import org.jboss.ws.core.jaxrpc.encoding.SOAPArrayDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.SOAPArraySerializerFactory;
import org.jboss.ws.core.jaxws.JAXBDeserializerFactory;
import org.jboss.ws.core.jaxws.JAXBSerializerFactory;
import org.jboss.ws.core.jbossxb.JBossXBDeserializerFactory;
import org.jboss.ws.core.jbossxb.JBossXBSerializerFactory;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.jaxrpc.encoding.SOAPArrayDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SOAPArraySerializerFactory;
-import org.jboss.ws.metadata.config.WSCommonConfig;
+import org.jboss.ws.core.metadata.config.WSCommonConfig;
/**
* A Service component describes a set of endpoints.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/OperationMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/OperationMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/OperationMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -37,8 +37,8 @@
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.umdm.EndpointMetaData.Type;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Use;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ParameterMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ParameterMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ParameterMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -40,9 +40,9 @@
import org.jboss.ws.common.umdm.WrappedParameter.AccessorFactory;
import org.jboss.ws.common.utils.HolderUtils;
import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.metadata.acessor.ReflectiveMethodAccessor;
+import org.jboss.ws.core.metadata.acessor.ReflectiveMethodAccessor;
/**
* A request/response parameter that a given operation supports.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServerEndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServerEndpointMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServerEndpointMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,11 +32,11 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.config.WSCommonConfig;
+import org.jboss.ws.core.metadata.config.WSConfigFactory;
+import org.jboss.ws.core.metadata.config.jaxrpc.WSConfigRootJAXRPC;
+import org.jboss.ws.core.metadata.config.jaxws.WSConfigRootJAXWS;
import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.metadata.config.WSConfigFactory;
-import org.jboss.ws.metadata.config.jaxrpc.WSConfigRootJAXRPC;
-import org.jboss.ws.metadata.config.jaxws.WSConfigRootJAXWS;
/**
* Client side endpoint meta data.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -38,18 +38,18 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
+import org.jboss.ws.core.jaxrpc.Use;
import org.jboss.ws.core.jbossxb.SchemaBindingBuilder;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/TypesMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/TypesMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/TypesMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,8 +32,8 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
/**
* Types meta data
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/UnifiedMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/UnifiedMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/UnifiedMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,9 +30,9 @@
import java.util.StringTokenizer;
import org.jboss.logging.Logger;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.core.server.ServiceEndpointManager;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
/**
* The top level meta data.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -26,10 +26,10 @@
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.umdm.EndpointMetaData.Type;
+import org.jboss.ws.core.jaxrpc.SOAP11BindingJAXRPC;
+import org.jboss.ws.core.jaxrpc.SOAP12BindingJAXRPC;
import org.jboss.ws.core.jaxws.core.SOAP11BindingJAXWS;
import org.jboss.ws.core.jaxws.core.SOAP12BindingJAXWS;
-import org.jboss.ws.jaxrpc.SOAP11BindingJAXRPC;
-import org.jboss.ws.jaxrpc.SOAP12BindingJAXRPC;
/**
* Provides access to the protocol binding.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -48,14 +48,14 @@
import org.jboss.ws.common.utils.HolderUtils;
import org.jboss.ws.core.binding.EndpointInvocation;
import org.jboss.ws.core.binding.UnboundHeader;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
import org.jboss.ws.core.soap.EndpointInfo;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPConnectionImpl;
import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.handler.HandlerChainBaseImpl;
/**
* Provides support for the dynamic invocation of a service endpoint.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -29,8 +29,8 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.core.jaxrpc.Use;
import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.jaxrpc.Use;
/**
* The SOAP11Binding
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -57,6 +57,10 @@
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.EndpointInvocation;
import org.jboss.ws.core.binding.UnboundHeader;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Use;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.NameImpl;
@@ -71,10 +75,6 @@
import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
import org.jboss.ws.core.soap.attachment.CIDGenerator;
import org.jboss.ws.extras.xop.XOPContext;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.Use;
import org.jboss.xb.binding.NamespaceRegistry;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/EndpointInvocation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/EndpointInvocation.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/EndpointInvocation.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -45,8 +45,8 @@
import org.jboss.ws.common.utils.HolderUtils;
import org.jboss.ws.common.utils.JavaUtils;
import org.jboss.ws.common.utils.MimeUtils;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.soap.SOAPContentElement;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
/** A web service invocation.
*
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/SerializationContext.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/SerializationContext.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/SerializationContext.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -26,7 +26,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
import org.jboss.xb.binding.NamespaceRegistry;
/**
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java (from
rev 1565, branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,671 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.Stub;
+import javax.xml.rpc.encoding.SerializerFactory;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.SOAPException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.TypesMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.CommonClient;
+import org.jboss.ws.core.binding.UnboundHeader;
+import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.jbossxb.JBossXBDeserializerFactory;
+import org.jboss.ws.core.jbossxb.JBossXBSerializerFactory;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.extras.xop.XOPContext;
+
+/** Provides support for the dynamic invocation of a service endpoint.
+ * The javax.xml.rpc.Service interface acts as a factory for the creation of Call
instances.
+ *
+ * Once a Call instance is created, various setter and getter methods may be used to
configure this Call instance.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class CallImpl extends CommonClient implements Call
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(CallImpl.class);
+
+ // The service that created this call
+ private ServiceImpl jaxrpcService;
+ // The port type name
+ private QName portType;
+ // A Map<QName,UnboundHeader> of header entries
+ private Map<QName, UnboundHeader> unboundHeaders = new LinkedHashMap<QName,
UnboundHeader>();
+ // A Map<String,Object> of Call properties
+ private Map<String, Object> properties = new HashMap<String, Object>();
+
+ // The set of supported properties
+ private static final Set<String> standardProperties = new
HashSet<String>();
+ static
+ {
+ standardProperties.add(Call.ENCODINGSTYLE_URI_PROPERTY);
+ standardProperties.add(Call.OPERATION_STYLE_PROPERTY);
+ standardProperties.add(Call.SESSION_MAINTAIN_PROPERTY);
+ standardProperties.add(Call.SOAPACTION_URI_PROPERTY);
+ standardProperties.add(Call.SOAPACTION_USE_PROPERTY);
+ standardProperties.add(Call.USERNAME_PROPERTY);
+ standardProperties.add(Call.PASSWORD_PROPERTY);
+
+ standardProperties.add(Stub.ENDPOINT_ADDRESS_PROPERTY);
+ standardProperties.add(Stub.SESSION_MAINTAIN_PROPERTY);
+ standardProperties.add(Stub.USERNAME_PROPERTY);
+ standardProperties.add(Stub.PASSWORD_PROPERTY);
+ }
+
+ /** Create a call that needs to be configured manually
+ */
+ CallImpl(ServiceImpl service)
+ {
+ super(service.getServiceMetaData());
+ this.jaxrpcService = service;
+
+ if (epMetaData != null)
+ setTargetEndpointAddress(epMetaData.getEndpointAddress());
+ }
+
+ /** Create a call for a known WSDL endpoint.
+ *
+ * @param epMetaData A WSDLEndpoint
+ */
+ CallImpl(ServiceImpl service, EndpointMetaData epMetaData)
+ {
+ super(epMetaData);
+ this.jaxrpcService = service;
+
+ setTargetEndpointAddress(epMetaData.getEndpointAddress());
+ }
+
+ /** Create a call for a known WSDL endpoint.
+ *
+ * @param portName Qualified name for the target service endpoint
+ * @throws ServiceException
+ */
+ CallImpl(ServiceImpl service, QName portName, QName opName) throws ServiceException
+ {
+ super(service.getServiceMetaData(), portName, opName);
+ this.jaxrpcService = service;
+
+ if (epMetaData != null)
+ setTargetEndpointAddress(epMetaData.getEndpointAddress());
+ }
+
+ @Override
+ protected Map<String, Object> getRequestContext()
+ {
+ return properties;
+ }
+
+ /**
+ * Add a header that is not bound to an input parameter.
+ * A propriatory extension, that is not part of JAXRPC.
+ *
+ * @param xmlName The XML name of the header element
+ * @param xmlType The XML type of the header element
+ */
+ public void addUnboundHeader(QName xmlName, QName xmlType, Class javaType,
ParameterMode mode)
+ {
+ UnboundHeader unboundHeader = new UnboundHeader(xmlName, xmlType, javaType, mode);
+ unboundHeaders.put(xmlName, unboundHeader);
+ }
+
+ /**
+ * Get the header value for the given XML name.
+ * A propriatory extension, that is not part of JAXRPC.
+ *
+ * @param xmlName The XML name of the header element
+ * @return The header value, or null
+ */
+ public Object getUnboundHeaderValue(QName xmlName)
+ {
+ UnboundHeader unboundHeader = unboundHeaders.get(xmlName);
+ return (unboundHeader != null ? unboundHeader.getHeaderValue() : null);
+ }
+
+ /**
+ * Set the header value for the given XML name.
+ * A propriatory extension, that is not part of JAXRPC.
+ *
+ * @param xmlName The XML name of the header element
+ */
+ public void setUnboundHeaderValue(QName xmlName, Object value)
+ {
+ UnboundHeader unboundHeader = unboundHeaders.get(xmlName);
+ if (unboundHeader == null)
+ throw new IllegalArgumentException("Cannot find unbound header: " +
xmlName);
+
+ unboundHeader.setHeaderValue(value);
+ }
+
+ /**
+ * Clear all registered headers.
+ * A propriatory extension, that is not part of JAXRPC.
+ */
+ public void clearUnboundHeaders()
+ {
+ unboundHeaders.clear();
+ }
+
+ /**
+ * Remove the header for the given XML name.
+ * A propriatory extension, that is not part of JAXRPC.
+ */
+ public void removeUnboundHeader(QName xmlName)
+ {
+ unboundHeaders.remove(xmlName);
+ }
+
+ /**
+ * Get an Iterator over the registered header XML names.
+ * A propriatory extension, that is not part of JAXRPC.
+ */
+ public Iterator getUnboundHeaders()
+ {
+ return unboundHeaders.keySet().iterator();
+ }
+
+ /** Gets the address of a target service endpoint.
+ */
+ public String getTargetEndpointAddress()
+ {
+ return (String)properties.get(Stub.ENDPOINT_ADDRESS_PROPERTY);
+ }
+
+ /** Sets the address of the target service endpoint. This address must correspond to
the transport
+ * specified in the binding for this Call instance.
+ *
+ * @param address Address of the target service endpoint; specified as an URI
+ */
+ public void setTargetEndpointAddress(String address)
+ {
+ this.properties.put(Stub.ENDPOINT_ADDRESS_PROPERTY, address);
+ }
+
+ /** Adds a parameter type and mode for a specific operation.
+ */
+ public void addParameter(String paramName, QName xmlType, ParameterMode
parameterMode)
+ {
+ TypeMappingImpl typeMapping =
getEndpointMetaData().getServiceMetaData().getTypeMapping();
+ Class javaType = typeMapping.getJavaType(xmlType);
+
+ // CTS
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/AddGetRemoveAllParametersTest1
+ // tests addParameter/getParameter without giving the javaType for a custom
parameter
+ // IMHO, this flavour of addParameter should only be used for standard types,
where
+ // the javaType can be derived from the xmlType
+ if (javaType == null)
+ {
+ log.warn("Register unqualified call parameter for: " + xmlType);
+ javaType = new UnqualifiedCallParameter(xmlType).getClass();
+ typeMapping.register(javaType, xmlType, null, null);
+ }
+
+ addParameter(paramName, xmlType, javaType, parameterMode);
+ }
+
+ /** Adds a parameter type and mode for a specific operation.
+ */
+ public void addParameter(String paramName, QName xmlType, Class javaType,
ParameterMode mode)
+ {
+ QName xmlName = new QName(paramName);
+ addParameter(xmlName, xmlType, javaType, mode, false);
+ }
+
+ /** Add a parameter to the current operation description.
+ * This is a propriatary extension that gives full control over the parameter
configuration.
+ */
+ public void addParameter(QName xmlName, QName xmlType, Class javaType, ParameterMode
mode, boolean inHeader)
+ {
+ if (xmlType == null || javaType == null)
+ throw new IllegalArgumentException("Invalid null parameter");
+
+ OperationMetaData opMetaData = getOperationMetaData();
+ ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName,
xmlType, javaType.getName());
+ paramMetaData.setMode(mode);
+ paramMetaData.setInHeader(inHeader);
+ paramMetaData.setIndex(opMetaData.getParameters().size());
+ opMetaData.addParameter(paramMetaData);
+
+ registerParameterType(xmlType, javaType);
+ }
+
+ /** Removes all specified parameters from this Call instance. Note that this method
removes only the parameters and
+ * not the return type. The setReturnType(null) is used to remove the return type.
+ *
+ * @throws javax.xml.rpc.JAXRPCException This exception may be thrown If this method
is called when the method isParameterAndReturnSpecRequired returns false for this
Call's operation.
+ */
+ public void removeAllParameters()
+ {
+ OperationMetaData opMetaData = getOperationMetaData();
+ opMetaData.removeAllParameters();
+ }
+
+ /** Sets the return type for a specific operation. Invoking setReturnType(null)
removes the return type for this Call object.
+ */
+ public void setReturnType(QName xmlType)
+ {
+ Class javaType =
getEndpointMetaData().getServiceMetaData().getTypeMapping().getJavaType(xmlType);
+ setReturnType(xmlType, javaType);
+ }
+
+ /** Sets the return type for a specific operation.
+ */
+ public void setReturnType(QName xmlType, Class javaType)
+ {
+ if (xmlType == null || javaType == null)
+ throw new IllegalArgumentException("Invalid null parameter");
+
+ OperationMetaData opMetaData = getOperationMetaData();
+ QName xmlName = new QName(Constants.DEFAULT_RPC_RETURN_NAME);
+ String javaTypeName = javaType.getName();
+ ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
+ opMetaData.setReturnParameter(retMetaData);
+
+ registerParameterType(xmlType, javaType);
+ }
+
+ /** Invokes a remote method using the one-way interaction mode.
+ */
+ public void invokeOneWay(Object[] inputParams)
+ {
+ try
+ {
+ invokeInternal(operationName, inputParams, unboundHeaders, true);
+ }
+ catch (RemoteException ex)
+ {
+ throw new JAXRPCException(ex);
+ }
+ }
+
+ /** Invokes a specific operation using a synchronous request-response interaction
mode.
+ */
+ public Object invoke(Object[] inputParams) throws RemoteException
+ {
+ return invokeInternal(operationName, inputParams, unboundHeaders, false);
+ }
+
+ /** Invokes a specific operation using a synchronous request-response interaction
mode.
+ */
+ public Object invoke(QName operationName, Object[] inputParams) throws
RemoteException
+ {
+ return invokeInternal(operationName, inputParams, unboundHeaders, false);
+ }
+
+ /** Returns a List values for the output parameters of the last invoked operation.
+ *
+ * @return java.util.List Values for the output parameters. An empty List is returned
if there are no output values.
+ * @throws JAXRPCException If this method is invoked for a one-way operation or is
invoked before any invoke method has been called.
+ */
+ public List getOutputValues()
+ {
+ if (epInv == null)
+ throw new JAXRPCException("Output params not available");
+
+ try
+ {
+ OperationMetaData opMetaData = getOperationMetaData();
+
+ List<Object> objPayload = new ArrayList<Object>();
+ for (QName xmlName : epInv.getResponseParamNames())
+ {
+ Object paramValue = epInv.getResponseParamValue(xmlName);
+ if (opMetaData.isDocumentWrapped())
+ {
+ objPayload = Arrays.asList((Object[])paramValue);
+ break;
+ }
+ else
+ {
+ objPayload.add(paramValue);
+ }
+ }
+ return objPayload;
+ }
+ catch (SOAPException ex)
+ {
+ throw new JAXRPCException("Cannot obtain response payload", ex);
+ }
+ }
+
+ /** Returns a Map of {name, value} for the output parameters of the last invoked
operation.
+ * The parameter names in the returned Map are of type java.lang.String.
+ *
+ * @return Map Output parameters for the last Call.invoke(). Empty Map is returned if
there are no output parameters.
+ * @throws JAXRPCException If this method is invoked for a one-way operation or is
invoked before any invoke method has been called.
+ */
+ public Map getOutputParams()
+ {
+ if (epInv == null)
+ throw new JAXRPCException("Output params not available");
+
+ try
+ {
+ Map<String, Object> outMap = new LinkedHashMap<String, Object>();
+ for (QName xmlName : epInv.getResponseParamNames())
+ {
+ Object value = epInv.getResponseParamValue(xmlName);
+ outMap.put(xmlName.getLocalPart(), value);
+ }
+ return outMap;
+ }
+ catch (SOAPException ex)
+ {
+ throw new JAXRPCException("Cannot obtain response payload", ex);
+ }
+ }
+
+ /**
+ * Gets the qualified name of the port type.
+ *
+ * @return Qualified name of the port type
+ */
+ public QName getPortTypeName()
+ {
+ if (portType != null)
+ {
+ return portType;
+ }
+
+ /* This code could be used to derive the portType from the endpoint meta data.
+ * However, it breaks CTS
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/Client.java#SetGetPortTypeNameTest2
+ if (epMetaData != null)
+ {
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+ WSDLService wsdlService = wsdlDefinitions.getService(new
NCName(serviceMetaData.getName().getLocalPart()));
+ WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoint(epMetaData.getName());
+ WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
+ return wsdlInterface.getQName();
+ }
+ */
+
+ // CTS
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/Client.java#SetGetPortTypeNameTest2
+ return new QName("");
+ }
+
+ /**
+ * Gets the return type for a specific operation
+ *
+ * @return Returns the XML type for the return value
+ */
+ public QName getReturnType()
+ {
+ QName retType = null;
+ if (operationName != null)
+ {
+ OperationMetaData opDesc = getOperationMetaData();
+ ParameterMetaData retMetaData = opDesc.getReturnParameter();
+ if (retMetaData != null)
+ retType = retMetaData.getXmlType();
+ }
+ return retType;
+ }
+
+ /**
+ * Sets the qualified name of the interface.
+ *
+ * @param portType - Qualified name of the port type
+ */
+ public void setPortTypeName(QName portType)
+ {
+ this.portType = portType;
+ }
+
+ /**
+ * Indicates whether addParameter and setReturnType methods are to be invoked to
specify the parameter and return
+ * type specification for a specific operation.
+ *
+ * @param opName Qualified name of the operation
+ * @return Returns true if the Call implementation class requires addParameter and
setReturnType to be invoked in the client code for the specified operation. This method
returns false otherwise.
+ * @throws IllegalArgumentException If invalid operation name is specified
+ */
+ public boolean isParameterAndReturnSpecRequired(QName opName)
+ {
+ setOperationName(opName);
+ OperationMetaData opMetaData = getOperationMetaData();
+ return opMetaData.getParameters().size() == 0 &&
opMetaData.getReturnParameter() == null;
+ }
+
+ /** Gets the names of configurable properties supported by this Call object.
+ * @return Iterator for the property names
+ */
+ public Iterator getPropertyNames()
+ {
+ return standardProperties.iterator();
+ }
+
+ /** Gets the value of a named property.
+ */
+ public Object getProperty(String name)
+ {
+ if (null == name)
+ throw new JAXRPCException("Unsupported property: " + name);
+ // CTS:
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/Client.java#SetGetPropertyTest2
+ if (name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
+ throw new JAXRPCException("Unsupported property: " + name);
+
+ return properties.get(name);
+ }
+
+ /** Sets the value for a named property.
+ */
+ public void setProperty(String name, Object value)
+ {
+ if (null == name)
+ throw new JAXRPCException("Unsupported property: " + name);
+ // CTS:
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/Client.java#SetGetPropertyTest2
+ if (name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
+ throw new JAXRPCException("Unsupported property: " + name);
+
+ properties.put(name, value);
+ }
+
+ /** Removes a named property.
+ */
+ public void removeProperty(String name)
+ {
+ properties.remove(name);
+ }
+
+ /** Gets the XML type of a parameter by name.
+ */
+ public QName getParameterTypeByName(String paramName)
+ {
+ OperationMetaData opMetaData = getOperationMetaData();
+ ParameterMetaData paramMetaData = opMetaData.getParameter(new QName(paramName));
+ if (paramMetaData != null)
+ return paramMetaData.getXmlType();
+ else return null;
+ }
+
+ @Override
+ protected void setInboundContextProperties()
+ {
+ }
+
+ @Override
+ protected void setOutboundContextProperties()
+ {
+ }
+
+ private Object invokeInternal(QName opName, Object[] inputParams, Map<QName,
UnboundHeader> unboundHeaders, boolean forceOneway) throws RemoteException
+ {
+ if (opName.equals(operationName) == false)
+ setOperationName(opName);
+
+ OperationMetaData opMetaData = getOperationMetaData();
+
+ // Check or generate the the schema if this call is unconfigured
+ generateOrUpdateSchemas(opMetaData);
+
+ // Associate a message context with the current thread
+ SOAPMessageContextJAXRPC msgContext = new SOAPMessageContextJAXRPC();
+ MessageContextAssociation.pushMessageContext(msgContext);
+ Object retObj = null;
+ try
+ {
+ retObj = super.invoke(opName, inputParams, unboundHeaders, properties,
forceOneway);
+ return retObj;
+ }
+ catch (SOAPFaultException ex)
+ {
+ log.error("Call invocation failed", ex);
+ String faultCode = ex.getFaultCode().getLocalPart();
+ throw new RemoteException("Call invocation failed with code [" +
faultCode + "] because of: " + ex.getFaultString(), ex);
+ }
+ catch (RemoteException rex)
+ {
+ throw rex;
+ }
+ catch (Exception ex)
+ {
+ throw new RemoteException("Call invocation failed", ex);
+ }
+ finally
+ {
+ // Reset the message context association
+ MessageContextAssociation.popMessageContext();
+ }
+ }
+
+ @Override
+ protected boolean callRequestHandlerChain(QName portName, HandlerType type)
+ {
+ SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
+ HandlerChainBaseImpl handlerChain =
(HandlerChainBaseImpl)jaxrpcService.getHandlerChain(portName);
+ boolean status = (handlerChain != null ? handlerChain.handleRequest(msgContext,
type) : true);
+
+ if (type == HandlerType.ENDPOINT)
+ XOPContext.visitAndRestoreXOPData();
+
+ return status;
+ }
+
+ @Override
+ protected boolean callResponseHandlerChain(QName portName, HandlerType type)
+ {
+ SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
+ HandlerChainBaseImpl handlerChain =
(HandlerChainBaseImpl)jaxrpcService.getHandlerChain(portName);
+
+ boolean status = true;
+ if (handlerChain != null)
+ {
+ status = handlerChain.handleResponse(msgContext, type);
+ }
+ return status;
+ }
+
+ /** Generate or update the XSD schema for all parameters and the return.
+ * This should only be done when the Call is unconfigured, hence there is no WSDL
+ */
+ private void generateOrUpdateSchemas(OperationMetaData opMetaData)
+ {
+ ServiceMetaData serviceMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData();
+ if (serviceMetaData.getWsdlFile() == null)
+ {
+ TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
+ for (ParameterMetaData paramMetaData : opMetaData.getParameters())
+ {
+ generateOrUpdateParameterSchema(typesMetaData, paramMetaData);
+ }
+
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+ if (retMetaData != null)
+ {
+ generateOrUpdateParameterSchema(typesMetaData, retMetaData);
+ }
+ }
+ }
+
+ /** Generate or update the XSD schema for a given parameter
+ * This should only be done if the parameter is not an attachment
+ */
+ private void generateOrUpdateParameterSchema(TypesMetaData typesMetaData,
ParameterMetaData paramMetaData)
+ {
+ if (paramMetaData.isSwA() == false)
+ {
+ QName xmlType = paramMetaData.getXmlType();
+ Class javaType = paramMetaData.getJavaType();
+
+ ServiceMetaData serviceMetaData = getEndpointMetaData().getServiceMetaData();
+ TypeMappingImpl typeMapping = serviceMetaData.getTypeMapping();
+ SerializerFactory serFactory = typeMapping.getSerializer(javaType, xmlType);
+ if (serFactory instanceof JBossXBSerializerFactory)
+ {
+ SchemaGenerator xsdGenerator = new SchemaGenerator();
+ JBossXSModel model = xsdGenerator.generateXSDSchema(xmlType, javaType);
+ typesMetaData.addSchemaModel(model);
+ }
+ }
+ }
+
+ private void registerParameterType(QName xmlType, Class javaType)
+ {
+ ServiceMetaData serviceMetaData = getEndpointMetaData().getServiceMetaData();
+
+ String nsURI = xmlType.getNamespaceURI();
+ if (Constants.NS_ATTACHMENT_MIME_TYPE.equals(nsURI) == false)
+ {
+ TypeMappingImpl typeMapping = serviceMetaData.getTypeMapping();
+ Class regJavaType = typeMapping.getJavaType(xmlType);
+ if (regJavaType == null)
+ {
+ typeMapping.register(javaType, xmlType, new JBossXBSerializerFactory(), new
JBossXBDeserializerFactory());
+ }
+ else if (regJavaType != null && JavaUtils.isAssignableFrom(regJavaType,
javaType) == false)
+ {
+ throw new IllegalArgumentException("Different java type already
registered: " + regJavaType.getName());
+ }
+ }
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java
(from rev 1565, branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,207 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.rmi.RemoteException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.Stub;
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.utils.JavaUtils;
+
+/**
+ * The dynamic proxy that delegates to the underlying Call implementation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jan-2005
+ */
+public class CallProxy implements InvocationHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(CallProxy.class);
+
+ // The underlying Call
+ private CallImpl call;
+ // List<Method> of the Stub methods
+ private List stubMethods;
+ // List<Method> of the Object methods
+ private List objectMethods;
+
+ // The set of standard properties
+ private static final Set<String> standardProperties = new
HashSet<String>();
+ static
+ {
+ standardProperties.add(Stub.ENDPOINT_ADDRESS_PROPERTY);
+ standardProperties.add(Stub.SESSION_MAINTAIN_PROPERTY);
+ standardProperties.add(Stub.USERNAME_PROPERTY);
+ standardProperties.add(Stub.PASSWORD_PROPERTY);
+ }
+
+ // The map of jboss-ws4ee supported properties
+ private static final Map<String,String> legacyPropertyMap = new
HashMap<String,String>();
+ static
+ {
+ legacyPropertyMap.put("org.jboss.webservice.client.timeout",
StubExt.PROPERTY_CLIENT_TIMEOUT);
+ legacyPropertyMap.put("org.jboss.webservice.keyStore",
StubExt.PROPERTY_KEY_STORE);
+ legacyPropertyMap.put("org.jboss.webservice.keyStorePassword",
StubExt.PROPERTY_KEY_STORE_PASSWORD);
+ legacyPropertyMap.put("org.jboss.webservice.keyStoreType",
StubExt.PROPERTY_KEY_STORE_TYPE);
+ legacyPropertyMap.put("org.jboss.webservice.trustStore",
StubExt.PROPERTY_TRUST_STORE);
+ legacyPropertyMap.put("org.jboss.webservice.trustStorePassword",
StubExt.PROPERTY_TRUST_STORE_PASSWORD);
+ legacyPropertyMap.put("org.jboss.webservice.trustStoreType",
StubExt.PROPERTY_TRUST_STORE_TYPE);
+ }
+
+ public CallProxy(CallImpl call)
+ {
+ this.call = call;
+ this.stubMethods = Arrays.asList(StubExt.class.getMethods());
+ this.objectMethods = Arrays.asList(Object.class.getMethods());
+ }
+
+ /** Processes a method invocation on a proxy instance and returns the result.
+ */
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ // An invocation on the Stub interface
+ String methodName = method.getName();
+ if (stubMethods.contains(method))
+ {
+ if (methodName.equals("_getPropertyNames"))
+ {
+ return call.getPropertyNames();
+ }
+ else if (methodName.equals("_getProperty"))
+ {
+ return getProperty((String)args[0]);
+ }
+ else if (methodName.equals("_setProperty"))
+ {
+ setProperty((String)args[0], args[1]);
+ return null;
+ }
+ else
+ {
+ Method callMethod = CallImpl.class.getMethod(methodName,
method.getParameterTypes());
+ return callMethod.invoke(call, args);
+ }
+ }
+
+ // An invocation on proxy's Object class
+ else if (objectMethods.contains(method))
+ {
+ Method callMethod = CallImpl.class.getMethod(methodName,
method.getParameterTypes());
+ return callMethod.invoke(call, args);
+ }
+
+ // An invocation on the service endpoint interface
+ else
+ {
+ EndpointMetaData epMetaData = call.getEndpointMetaData();
+ OperationMetaData opMetaData = epMetaData.getOperation(method);
+ if (opMetaData == null)
+ throw new WSException("Cannot obtain operation meta data for: " +
methodName);
+
+ call.setOperationName(opMetaData.getQName());
+
+ try
+ {
+ if (opMetaData.isOneWay())
+ {
+ call.invokeOneWay(args);
+ return null;
+ }
+ else
+ {
+ Object retObj = call.invoke(args);
+ if (retObj != null)
+ {
+ Class retType = method.getReturnType();
+ if (retType == null)
+ throw new WSException("Return value not supported by: " +
opMetaData);
+
+ if (JavaUtils.isPrimitive(retType))
+ retObj = JavaUtils.getPrimitiveValueArray(retObj);
+ }
+ return retObj;
+ }
+ }
+ catch (Exception ex)
+ {
+ handleException(ex);
+ return null;
+ }
+ }
+ }
+
+ private Object getProperty(String name)
+ {
+ name = assertPropertyName(name);
+ return call.getProperty(name);
+ }
+
+ private void setProperty(String name, Object value)
+ {
+ name = assertPropertyName(name);
+ call.setProperty(name, value);
+ }
+
+ private String assertPropertyName(String name)
+ {
+ if (name != null && name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
+ throw new JAXRPCException("Unsupported property: " + name);
+
+ if (legacyPropertyMap.keySet().contains(name))
+ {
+ String jbosswsName = legacyPropertyMap.get(name);
+ log.warn("Legacy propery '" + name + "' mapped to
'" + jbosswsName + "'");
+ name = jbosswsName;
+ }
+
+ return name;
+ }
+
+ private void handleException(Exception ex) throws Throwable
+ {
+ Throwable th = ex;
+ if (ex instanceof RemoteException && ex.getCause() instanceof
SOAPFaultException)
+ {
+ SOAPFaultException faultEx = (SOAPFaultException)ex.getCause();
+ if (faultEx.getCause() != null)
+ th = faultEx.getCause();
+ }
+ throw th;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/EncodedTypeMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/EncodedTypeMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,182 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.URI;
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.core.jaxrpc.encoding.Base64DeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.Base64SerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.CalendarDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.CalendarSerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.DateDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.DateSerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.ElementDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.ElementSerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.HexDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.HexSerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.QNameDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.QNameSerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.SOAPElementDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.SOAPElementSerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.SimpleDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.SimpleSerializerFactory;
+import org.w3c.dom.Element;
+
+/**
+ * This is the representation of a type mapping.
+ * This TypeMapping implementation supports the encoded encoding style.
+ *
+ * The TypeMapping instance maintains a tuple of the type
+ * {XML typeQName, Java Class, SerializerFactory, DeserializerFactory}.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class EncodedTypeMapping extends TypeMappingImpl
+{
+
+ /**
+ * Construct the default encoded type mapping.
+ * Registers javaTypes for all standard XMLSchema types specified by JAXRPC.
+ *
+ * Note, the order of registered types is important
+ * The last xmlType wins for a given javaType
+ *
+ */
+ public EncodedTypeMapping()
+ {
+ registerStandardLiteralTypes();
+ registerStandardSOAP11EncodedTypes();
+
+ // register mapping for xsd:anyType
+ registerInternal(SOAPElement.class, Constants.TYPE_SOAP11_ANYTYPE, new
SOAPElementSerializerFactory(), new SOAPElementDeserializerFactory());
+ registerInternal(Element.class, Constants.TYPE_SOAP11_ANYTYPE, new
ElementSerializerFactory(), new ElementDeserializerFactory());
+ }
+
+ private void registerStandardSOAP11EncodedTypes()
+ {
+ registerInternal(BigDecimal.class, Constants.TYPE_SOAP11_DECIMAL, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_POSITIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NEGATIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NONPOSITIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NONNEGATIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_UNSIGNEDLONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_INTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(Date.class, Constants.TYPE_SOAP11_DATETIME, new
DateSerializerFactory(), new DateDeserializerFactory());
+
+ registerInternal(Calendar.class, Constants.TYPE_SOAP11_DATE, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
+ registerInternal(Calendar.class, Constants.TYPE_SOAP11_TIME, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
+ registerInternal(Calendar.class, Constants.TYPE_SOAP11_DATETIME, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
+
+ registerInternal(QName.class, Constants.TYPE_SOAP11_QNAME, new
QNameSerializerFactory(), new QNameDeserializerFactory());
+
+ registerInternal(String.class, Constants.TYPE_SOAP11_ANYSIMPLETYPE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_DURATION, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_GDAY, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_GMONTH, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_GMONTHDAY, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_GYEAR, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_GYEARMONTH, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_ID, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_LANGUAGE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_NAME, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_NCNAME, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_NMTOKEN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_NORMALIZEDSTRING, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_TOKEN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_STRING, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(String[].class, Constants.TYPE_SOAP11_NMTOKENS, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(URI.class, Constants.TYPE_SOAP11_ANYURI, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(boolean.class, Constants.TYPE_SOAP11_BOOLEAN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Boolean.class, Constants.TYPE_SOAP11_BOOLEAN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(byte.class, Constants.TYPE_SOAP11_BYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Byte.class, Constants.TYPE_SOAP11_BYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(byte[].class, Constants.TYPE_SOAP11_HEXBINARY, new
HexSerializerFactory(), new HexDeserializerFactory());
+ registerInternal(Byte[].class, Constants.TYPE_SOAP11_HEXBINARY, new
HexSerializerFactory(), new HexDeserializerFactory());
+ registerInternal(byte[].class, Constants.TYPE_SOAP11_BASE64BINARY, new
Base64SerializerFactory(), new Base64DeserializerFactory());
+ registerInternal(Byte[].class, Constants.TYPE_SOAP11_BASE64BINARY, new
Base64SerializerFactory(), new Base64DeserializerFactory());
+ registerInternal(byte[].class, Constants.TYPE_SOAP11_BASE64, new
Base64SerializerFactory(), new Base64DeserializerFactory());
+ registerInternal(Byte[].class, Constants.TYPE_SOAP11_BASE64, new
Base64SerializerFactory(), new Base64DeserializerFactory());
+
+ registerInternal(double.class, Constants.TYPE_SOAP11_DOUBLE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Double.class, Constants.TYPE_SOAP11_DOUBLE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(float.class, Constants.TYPE_SOAP11_FLOAT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Float.class, Constants.TYPE_SOAP11_FLOAT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(int.class, Constants.TYPE_SOAP11_UNSIGNEDSHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Integer.class, Constants.TYPE_SOAP11_UNSIGNEDSHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(int.class, Constants.TYPE_SOAP11_INT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Integer.class, Constants.TYPE_SOAP11_INT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(long.class, Constants.TYPE_SOAP11_UNSIGNEDINT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Long.class, Constants.TYPE_SOAP11_UNSIGNEDINT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(long.class, Constants.TYPE_SOAP11_LONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Long.class, Constants.TYPE_SOAP11_LONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(short.class, Constants.TYPE_SOAP11_UNSIGNEDBYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Short.class, Constants.TYPE_SOAP11_UNSIGNEDBYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(short.class, Constants.TYPE_SOAP11_SHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Short.class, Constants.TYPE_SOAP11_SHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ }
+
+ /**
+ * Returns the encodingStyle URIs (as String[]) supported by this TypeMapping
instance.
+ * A TypeMapping that contains only encoding style independent serializers and
deserializers
+ * returns null from this method.
+ *
+ * @return Array of encodingStyle URIs for the supported encoding styles
+ */
+ public String[] getSupportedEncodings()
+ {
+ return new String[] { "encoded" };
+ }
+
+ /**
+ * Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping
that contains only encoding
+ * independent serializers and deserializers requires null as the parameter for this
method.
+ *
+ * @param encodingStyleURIs Array of encodingStyle URIs for the supported encoding
styles
+ */
+ public void setSupportedEncodings(String[] encodingStyleURIs)
+ {
+ throw new NotImplementedException();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,120 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.HandlerChain;
+import javax.xml.rpc.handler.HandlerInfo;
+import javax.xml.rpc.handler.HandlerRegistry;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.jaxrpc.handler.ClientHandlerChain;
+
+/**
+ * Provides support for the programmatic configuration of
+ * handlers in a HandlerRegistry.
+ *
+ * A handler chain is registered per service endpoint, as indicated by the
+ * qualified name of a port. The getHandlerChain returns the handler chain
+ * (as a java.util.List) for the specified service endpoint. The returned
+ * handler chain is configured using the java.util.List interface. Each element
+ * in this list is required to be of the Java type
+ * javax.xml.rpc.handler.HandlerInfo.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 20-Jul-2005
+ */
+public class HandlerRegistryImpl implements HandlerRegistry
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(HandlerRegistryImpl.class);
+
+ // Map<QName,HandlerChain> the endpoint name to a HandlerChain
+ private Map<QName, HandlerChain> handlerChains = new HashMap<QName,
HandlerChain>();
+ // Maps the port name to a list of HandlerInfo objects
+ private Map<QName, List<HandlerInfo>> handlerInfos = new HashMap<QName,
List<HandlerInfo>>();
+ // The service this registry is associated with
+ private ServiceMetaData serviceMetaData;
+
+ public HandlerRegistryImpl(ServiceMetaData serviceMetaData)
+ {
+ this.serviceMetaData = serviceMetaData;
+ }
+
+ public List getHandlerChain(QName portName)
+ {
+ List<HandlerInfo> list = handlerInfos.get(portName);
+ if (list == null)
+ list = new ArrayList<HandlerInfo>();
+
+ return new ArrayList(list);
+
+ }
+
+ public void setHandlerChain(QName portName, List chain)
+ {
+ registerClientHandlerChain(portName, chain, null);
+ }
+
+ /** Get the handler chain for the given endpoint name, maybe null.
+ */
+ HandlerChain getHandlerChainInstance(QName portName)
+ {
+ HandlerChain handlerChain = handlerChains.get(portName);
+ return handlerChain;
+ }
+
+ /** Register a handler chain for the given endpoint name
+ */
+ void registerClientHandlerChain(QName portName, List<HandlerInfo> infos,
Set<String> roles)
+ {
+ ClientHandlerChain chain = new ClientHandlerChain(infos, roles);
+ handlerChains.put(portName, chain);
+ handlerInfos.put(portName, infos);
+
+ EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
+ if (epMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta data for:
" + portName);
+
+ epMetaData.clearHandlers();
+ for (HandlerInfo info : infos)
+ {
+ HandlerMetaDataJAXRPC handler = new HandlerMetaDataJAXRPC(epMetaData,
HandlerType.ENDPOINT);
+ handler.setHandlerClassName(info.getHandlerClass().getName());
+ handler.setSoapRoles(roles);
+ log.debug("Add handler to: " + portName + handler);
+ epMetaData.addHandler(handler);
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/LiteralTypeMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/LiteralTypeMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,114 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import javax.activation.DataHandler;
+import javax.mail.internet.MimeMultipart;
+import javax.xml.soap.SOAPElement;
+import javax.xml.transform.Source;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.core.jaxrpc.encoding.*;
+import org.jboss.ws.core.jbossxb.JBossXBDeserializerFactory;
+import org.jboss.ws.core.jbossxb.JBossXBSerializerFactory;
+import org.w3c.dom.Element;
+import java.awt.*;
+
+/**
+ * This is the representation of a type mapping.
+ * This TypeMapping implementation supports the literal encoding style.
+ *
+ * The TypeMapping instance maintains a tuple of the type
+ * {XML typeQName, Java Class, SerializerFactory, DeserializerFactory}.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class LiteralTypeMapping extends TypeMappingImpl
+{
+
+ /**
+ * Construct the default literal type mapping.
+ * Registers javaTypes for all standard XMLSchema types specified by JAXRPC.
+ *
+ * Note, the order of registered types is important
+ * The last xmlType wins for a given javaType
+ *
+ */
+ public LiteralTypeMapping()
+ {
+ // XOP default mapping
+ JBossXBSerializerFactory jbxbSF = new JBossXBSerializerFactory();
+ JBossXBDeserializerFactory jbxbDF = new JBossXBDeserializerFactory();
+
+ registerInternal(DataHandler.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
+ registerInternal(DataHandler.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
+ registerInternal(DataHandler.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
+ registerInternal(DataHandler.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
+ registerInternal(DataHandler.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
+
+ registerInternal(String.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
+ registerInternal(Image.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
+ registerInternal(Source.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF, jbxbDF);
+ registerInternal(MimeMultipart.class, Constants.TYPE_XMIME_DEFAULT, jbxbSF,
jbxbDF);
+
+ registerStandardLiteralTypes();
+
+ // register default mime mappings
+ registerInternal(DataHandler.class, Constants.TYPE_MIME_APPLICATION_XML, null,
null);
+ registerInternal(DataHandler.class, Constants.TYPE_MIME_IMAGE_GIF, null, null);
+ registerInternal(DataHandler.class, Constants.TYPE_MIME_IMAGE_JPEG, null, null);
+ registerInternal(DataHandler.class, Constants.TYPE_MIME_TEXT_PLAIN, null, null);
+ registerInternal(DataHandler.class, Constants.TYPE_MIME_TEXT_XML, null, null);
+ registerInternal(MimeMultipart.class, Constants.TYPE_MIME_MULTIPART_MIXED, null,
null);
+
+ // register mapping for xsd:anyType
+ registerInternal(SOAPElement.class, Constants.TYPE_LITERAL_ANYTYPE, new
SOAPElementSerializerFactory(), new SOAPElementDeserializerFactory());
+ registerInternal(Element.class, Constants.TYPE_LITERAL_ANYTYPE, new
ElementSerializerFactory(), new ElementDeserializerFactory());
+ }
+
+ /**
+ * Returns the encodingStyle URIs (as String[]) supported by this TypeMapping
instance.
+ * A TypeMapping that contains only encoding style independent serializers and
deserializers
+ * returns null from this method.
+ *
+ * @return Array of encodingStyle URIs for the supported encoding styles
+ */
+ public String[] getSupportedEncodings()
+ {
+ return new String[] { "" };
+ }
+
+ /**
+ * Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping
that contains only encoding
+ * independent serializers and deserializers requires null as the parameter for this
method.
+ *
+ * @param encodingStyleURIs Array of encodingStyle URIs for the supported encoding
styles
+ */
+ public void setSupportedEncodings(String[] encodingStyleURIs)
+ {
+ throw new NotImplementedException();
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,329 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javassist.ClassPool;
+import javassist.CtClass;
+import javassist.CtField;
+import javassist.CtNewMethod;
+import javassist.LoaderClassPath;
+import javassist.Modifier;
+
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.TypeMappingMetaData;
+import org.jboss.ws.common.umdm.TypesMetaData;
+import org.jboss.ws.common.umdm.WrappedParameter;
+import org.jboss.ws.common.utils.HolderUtils;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.jbossxb.JBossXBDeserializerFactory;
+import org.jboss.ws.core.jbossxb.JBossXBSerializerFactory;
+
+/** A helper class to wrap/unwrap ducument style request/response structures.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 06-Jun-2005
+ */
+public class ParameterWrapping
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(ParameterWrapping.class);
+
+ // This assertion should probably be moved somewhere earlier
+ private static void assertOperationMetaData(OperationMetaData opMetaData)
+ {
+ if (opMetaData.getStyle() != Style.DOCUMENT)
+ throw new WSException("Unexpected style: " + opMetaData.getStyle());
+
+ if (opMetaData.getParameterStyle() != ParameterStyle.WRAPPED)
+ throw new WSException("Unexpected parameter style: " +
opMetaData.getParameterStyle());
+ }
+
+ private static Object holderValue(Object holder)
+ {
+ if (holder == null)
+ return null;
+ if (! HolderUtils.isHolderType(holder.getClass()))
+ return holder;
+
+ return HolderUtils.getHolderValue(holder);
+ }
+
+ public static Class getWrappedType(String variable, Class wrapperType)
+ {
+ try
+ {
+ PropertyDescriptor pd = new PropertyDescriptor(variable, wrapperType);
+ Method method = pd.getWriteMethod();
+ return method.getParameterTypes()[0];
+ }
+ catch (Exception ex)
+ {
+ log.debug("Invalid request wrapper: " + ex);
+ return null;
+ }
+ }
+
+ public static Object wrapRequestParameters(ParameterMetaData request, Object[]
methodParams)
+ {
+ assertOperationMetaData(request.getOperationMetaData());
+
+ Class reqStructType = request.getJavaType();
+ log.debug("wrapRequestParameters: " + reqStructType.getName());
+ List<WrappedParameter> wrappedParameters = request.getWrappedParameters();
+ try
+ {
+ Object reqStruct = reqStructType.newInstance();
+ for (WrappedParameter param : wrappedParameters)
+ {
+ Object value = holderValue(methodParams[param.getIndex()]);
+ param.accessor().set(reqStruct, value);
+ }
+
+ return reqStruct;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Cannot wrap request structure: " + e);
+ }
+ }
+
+ public static Map<Integer, Object> unwrapRequestParameters(ParameterMetaData
request, Object reqStruct, Object[] methodParams)
+ {
+ OperationMetaData opMetaData = request.getOperationMetaData();
+ assertOperationMetaData(opMetaData);
+
+ if (reqStruct == null)
+ throw new IllegalArgumentException("Request struct cannot be null");
+
+ Class[] targetParameterTypes = opMetaData.getJavaMethod().getParameterTypes();
+ Map<Integer, Object> outParameters = new HashMap<Integer,
Object>(targetParameterTypes.length);
+ List<WrappedParameter> wrappedParameters = request.getWrappedParameters();
+ Class reqStructType = reqStruct.getClass();
+
+ log.debug("unwrapRequestParameters: " + reqStructType.getName());
+ try
+ {
+ for (WrappedParameter param : wrappedParameters)
+ {
+ Class targetType = targetParameterTypes[param.getIndex()];
+ Object value = param.accessor().get(reqStruct);
+
+ // INOUT Parameter
+ if (HolderUtils.isHolderType(targetType))
+ {
+ value = HolderUtils.createHolderInstance(value, targetType);
+ outParameters.put(param.getIndex(), value);
+ }
+
+ methodParams[param.getIndex()] = value;
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new IllegalArgumentException("Cannot unwrap request structure: "
+ e);
+ }
+
+ return outParameters;
+ }
+
+ public static Object wrapResponseParameters(ParameterMetaData returnMetaData, Object
returnValue, Map<Integer, Object> outParameters)
+ {
+ assertOperationMetaData(returnMetaData.getOperationMetaData());
+
+ Class resStructType = returnMetaData.getJavaType();
+ if (returnValue != null && returnValue.getClass() == resStructType)
+ {
+ log.debug("Response parameter already wrapped" +
resStructType.getName());
+ return returnValue;
+ }
+
+ log.debug("wrapResponseParameter: " + resStructType.getName());
+ List<WrappedParameter> wrappedParameters =
returnMetaData.getWrappedParameters();
+ try
+ {
+ Object resStruct = resStructType.newInstance();
+
+ for (WrappedParameter param : wrappedParameters)
+ {
+ Object value = (param.getIndex() < 0) ? returnValue :
holderValue(outParameters.get(param.getIndex()));
+ param.accessor().set(resStruct, value);
+ }
+ return resStruct;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Cannot wrap response structure: " + e);
+ }
+ }
+
+ public static Object unwrapResponseParameters(ParameterMetaData retMetaData, Object
resStruct, Object methodParams[])
+ {
+ OperationMetaData operationMetaData = retMetaData.getOperationMetaData();
+ assertOperationMetaData(operationMetaData);
+
+ Object retValue = null;
+ if (resStruct != null)
+ {
+ Class resStructType = resStruct.getClass();
+
+ log.debug("unwrapResponseParameter: " + resStructType.getName());
+ List<WrappedParameter> wrappedParameters =
retMetaData.getWrappedParameters();
+ Class[] targetTypes = operationMetaData.getJavaMethod().getParameterTypes();
+ try
+ {
+ for (WrappedParameter param : wrappedParameters)
+ {
+ Object value = param.accessor().get(resStruct);
+ if (param.getIndex() < 0)
+ {
+ retValue = value;
+ }
+ else
+ {
+ Class targetType = targetTypes[param.getIndex()];
+ if (HolderUtils.isHolderType(targetType))
+ value = HolderUtils.createHolderInstance(value, targetType);
+ methodParams[param.getIndex()] = value;
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new IllegalArgumentException("Cannot unwrap request structure:
" + e);
+ }
+ }
+ return retValue;
+ }
+
+ /**
+ * This is just a dummy marker class used to identify a generated
+ * document/literal wrapped type
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+ public static class WrapperType
+ {
+ }
+
+ /**
+ * Generates a wrapper type and assigns it to the passed ParameterMetaData
+ * object. This routine requires the pmd to contain completed wrappedTypes
+ * and wrappedVariables properties of the passed ParameterMetaData object.
+ *
+ * @param pmd a document/literal wrapped parameter
+ */
+ public static void generateWrapper(ParameterMetaData pmd, boolean addTypeMapping)
+ {
+ List<WrappedParameter> wrappedParameters = pmd.getWrappedParameters();
+ OperationMetaData operationMetaData = pmd.getOperationMetaData();
+ EndpointMetaData endpointMetaData = operationMetaData.getEndpointMetaData();
+ ServiceMetaData serviceMetaData = endpointMetaData.getServiceMetaData();
+ ClassLoader loader = serviceMetaData.getUnifiedMetaData().getClassLoader();
+
+ if (operationMetaData.isDocumentWrapped() == false)
+ throw new WSException("Operation is not document/literal (wrapped)");
+
+ if (wrappedParameters == null)
+ throw new WSException("Cannot generate a type when their is no wrapped
parameters");
+
+ String serviceName = serviceMetaData.getServiceName().getLocalPart();
+ String parameterName = pmd.getXmlName().getLocalPart();
+ String endpointName = endpointMetaData.getQName().getLocalPart();
+ String packageName =
endpointMetaData.getServiceEndpointInterface().getPackage().getName();
+
+ String wrapperName = packageName + "._JBossWS_" + serviceName +
"_" + endpointName + "_" + parameterName;
+ log.debug("Generating wrapper: " + wrapperName);
+
+ Class wrapperType;
+ try
+ {
+ ClassPool pool = new ClassPool(true);
+ pool.appendClassPath(new LoaderClassPath(loader));
+ CtClass clazz = pool.makeClass(wrapperName);
+ clazz.setSuperclass(pool.get(WrapperType.class.getName()));
+
+ for (WrappedParameter param : wrappedParameters)
+ {
+ CtField field = new CtField(pool.get(param.getType()), param.getVariable(),
clazz);
+ field.setModifiers(Modifier.PRIVATE);
+ clazz.addField(field);
+ clazz.addMethod(CtNewMethod.getter("get" +
JavaUtils.capitalize(param.getVariable()), field));
+ clazz.addMethod(CtNewMethod.setter("set" +
JavaUtils.capitalize(param.getVariable()), field));
+ }
+
+ wrapperType = (Class)pool.toClass(clazz, loader);
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Could not generate wrapper type: " +
wrapperName, e);
+ }
+
+ // Register type mapping if needed
+ if (addTypeMapping)
+ {
+ QName xmlType = pmd.getXmlType();
+
+ TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
+ TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData, xmlType,
wrapperName);
+ typesMetaData.addTypeMapping(tmMetaData);
+
+ TypeMappingImpl typeMapping = serviceMetaData.getTypeMapping();
+ typeMapping.register(wrapperType, xmlType, new JBossXBSerializerFactory(), new
JBossXBDeserializerFactory());
+ }
+
+ pmd.setJavaTypeName(wrapperName);
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP11BindingJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP11BindingJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc;
+
+//$Id:SOAP11BindingJAXRPC.java 1054 2006-09-26 10:33:43Z thomas.diesler(a)jboss.com $
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.core.CommonSOAP11Binding;
+import org.jboss.ws.core.soap.SOAPFaultImpl;
+
+/**
+ * The JAXRPC SOAP11Binding
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Sep-2006
+ */
+public class SOAP11BindingJAXRPC extends CommonSOAP11Binding
+{
+ // Delegate to JAXWS SOAP binding
+ private SOAPBindingJAXRPC delegate = new SOAPBindingJAXRPC();
+
+ public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
+ {
+ delegate.setSOAPActionHeader(opMetaData, reqMessage);
+ }
+
+ @Override
+ protected void throwFaultException(SOAPFaultImpl fault) throws Exception
+ {
+ throw SOAPFaultHelperJAXRPC.getSOAPFaultException(fault);
+ }
+
+ @Override
+ public SOAPMessage exceptionToFaultMessage(Exception ex)
+ {
+ return SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP12BindingJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAP12BindingJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc;
+
+//$Id:SOAP12BindingJAXRPC.java 1054 2006-09-26 10:33:43Z thomas.diesler(a)jboss.com $
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.core.CommonSOAP12Binding;
+import org.jboss.ws.core.soap.SOAPFaultImpl;
+
+/**
+ * The JAXRPC SOAP12Binding
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Sep-2006
+ */
+public class SOAP12BindingJAXRPC extends CommonSOAP12Binding
+{
+ // Delegate to JAXWS SOAP binding
+ private SOAPBindingJAXRPC delegate = new SOAPBindingJAXRPC();
+
+ public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
+ {
+ delegate.setSOAPActionHeader(opMetaData, reqMessage);
+ }
+
+ @Override
+ protected void throwFaultException(SOAPFaultImpl fault) throws Exception
+ {
+ throw SOAPFaultHelperJAXRPC.getSOAPFaultException(fault);
+ }
+
+ @Override
+ public SOAPMessage exceptionToFaultMessage(Exception ex)
+ {
+ return SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPBindingJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPBindingJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import javax.xml.rpc.Call;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+
+/**
+ * The SOAPBinding interface is an abstraction for the SOAP binding.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 04-Jul-2006
+ */
+class SOAPBindingJAXRPC
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPBindingJAXRPC.class);
+
+ public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
+ String soapAction = opMetaData.getSOAPAction();
+
+ // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
+ // with a quoted value equal to the value of the soapAction attribute of
+ // soapbind:operation, if present in the corresponding WSDL description.
+
+ // R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
+ // with a quoted empty string value, if in the corresponding WSDL description,
+ // the soapAction attribute of soapbind:operation is either not present, or
+ // present with an empty string as its value.
+
+ if (msgContext.getProperty(Call.SOAPACTION_USE_PROPERTY) != null)
+ log.info("Ignore Call.SOAPACTION_USE_PROPERTY because of BP-1.0 R2745,
R2745");
+
+ String soapActionProperty =
(String)msgContext.getProperty(Call.SOAPACTION_URI_PROPERTY);
+ if (soapActionProperty != null)
+ soapAction = soapActionProperty;
+
+ mimeHeaders.addHeader("SOAPAction", soapAction != null ? soapAction :
"");
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultHelperJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultHelperJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,317 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.encoding.TypeMapping;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.Detail;
+import javax.xml.soap.DetailEntry;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.FaultMetaData;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.ws.core.jaxrpc.encoding.DeserializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.encoding.SerializerFactoryBase;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
+import org.jboss.ws.core.soap.SOAPFactoryImpl;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.w3c.dom.Element;
+
+/**
+ * A Helper that translates between SOAPFaultException and SOAPFault.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 03-Feb-2005
+ */
+public class SOAPFaultHelperJAXRPC
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPFaultHelperJAXRPC.class);
+
+ private static List<QName> allowedFaultCodes = new ArrayList<QName>();
+ static
+ {
+ allowedFaultCodes.add(Constants.SOAP11_FAULT_CODE_CLIENT);
+ allowedFaultCodes.add(Constants.SOAP11_FAULT_CODE_SERVER);
+ allowedFaultCodes.add(Constants.SOAP11_FAULT_CODE_VERSION_MISMATCH);
+ allowedFaultCodes.add(Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND);
+ }
+
+ /** Hide constructor */
+ private SOAPFaultHelperJAXRPC()
+ {
+ }
+
+ /** Factory method for FaultException for a given SOAPFault */
+ public static SOAPFaultException getSOAPFaultException(SOAPFault soapFault)
+ {
+ QName faultCode = ((NameImpl)soapFault.getFaultCodeAsName()).toQName();
+ String faultString = soapFault.getFaultString();
+ String faultActor = soapFault.getFaultActor();
+ Detail detail = soapFault.getDetail();
+
+ SOAPFaultException faultEx = new SOAPFaultException(faultCode, faultString,
faultActor, detail);
+
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (detail != null && msgContext != null)
+ {
+ SerializationContext serContext = msgContext.getSerializationContext();
+ TypeMapping typeMapping = serContext.getTypeMapping();
+
+ Iterator it = detail.getDetailEntries();
+ while (it.hasNext())
+ {
+ DetailEntry deElement = (DetailEntry)it.next();
+ Name deName = deElement.getElementName();
+ QName xmlName = new QName(deName.getURI(), deName.getLocalName());
+
+ OperationMetaData opMetaData = msgContext.getOperationMetaData();
+ FaultMetaData faultMetaData = opMetaData.getFault(xmlName);
+ if (faultMetaData != null)
+ {
+ log.debug("Deserialize fault: " + faultMetaData);
+ QName xmlType = faultMetaData.getXmlType();
+ Class javaType = faultMetaData.getJavaType();
+
+ // Get the deserializer from the type mapping
+ DeserializerFactoryBase desFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(javaType, xmlType);
+ if (desFactory == null)
+ throw new JAXRPCException("Cannot obtain deserializer factory for:
" + xmlType);
+
+ // Try jaxb deserialization
+ try
+ {
+ //
http://jira.jboss.org/jira/browse/JBWS-955
+ // Cannot deserialize fault detail
+ String prefix = deName.getPrefix();
+ if (prefix.length() > 0)
+ {
+ String nsURI = deName.getURI();
+ String attrValue = deElement.getAttribute("xmlns:" +
prefix);
+ if (nsURI.length() > 0 && attrValue.length() == 0)
+ deElement.addNamespaceDeclaration(prefix, nsURI);
+ }
+
+ String xmlFragment = DOMWriter.printNode(deElement, false);
+ DeserializerSupport des =
(DeserializerSupport)desFactory.getDeserializer();
+ Object userEx = des.deserialize(xmlName, xmlType, xmlFragment,
serContext);
+ if (userEx == null || (userEx instanceof Exception) == false)
+ throw new WSException("Invalid deserialization result: " +
userEx);
+
+ faultEx.initCause((Exception)userEx);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot deserialize fault detail", ex);
+ }
+ }
+ else
+ {
+ log.debug("Cannot find fault meta data for: " + xmlName);
+ }
+ }
+ }
+
+ return faultEx;
+ }
+
+ /** Translate the request exception into a SOAPFault message.
+ */
+ public static SOAPMessage exceptionToFaultMessage(Exception reqEx)
+ {
+ // Get or create the SOAPFaultException
+ SOAPFaultException faultEx;
+ if (reqEx instanceof SOAPFaultException)
+ {
+ faultEx = (SOAPFaultException)reqEx;
+ }
+ else
+ {
+ QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
+ String faultString = (reqEx.getMessage() != null ? reqEx.getMessage() :
reqEx.toString());
+ faultEx = new SOAPFaultException(faultCode, faultString, null, null);
+ faultEx.initCause(reqEx);
+ }
+
+ Throwable faultCause = faultEx.getCause();
+ log.error("SOAP request exception", faultCause != null ? faultCause :
faultEx);
+
+ try
+ {
+ SOAPMessage faultMessage = toSOAPMessage(faultEx);
+ return faultMessage;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ log.error("Error creating SOAPFault message", ex);
+ throw new JAXRPCException("Cannot create SOAPFault message for: " +
faultEx);
+ }
+ }
+
+ private static SOAPMessage toSOAPMessage(SOAPFaultException faultEx) throws
SOAPException
+ {
+ assertFaultCode(faultEx.getFaultCode());
+
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ SerializationContext serContext = (msgContext != null ?
msgContext.getSerializationContext() : new SerializationContextJAXRPC());
+ NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
+
+ MessageFactory factory = new MessageFactoryImpl();
+ SOAPMessage soapMessage = factory.createMessage();
+
+ SOAPEnvelopeImpl soapEnvelope =
(SOAPEnvelopeImpl)soapMessage.getSOAPPart().getEnvelope();
+ SOAPBody soapBody = soapEnvelope.getBody();
+
+ QName faultCode = faultEx.getFaultCode();
+ if (faultCode.getNamespaceURI().length() > 0)
+ faultCode = nsRegistry.registerQName(faultCode);
+
+ String faultString = getValidFaultString(faultEx);
+ SOAPFault soapFault = soapBody.addFault(new NameImpl(faultCode), faultString);
+
+ String faultActor = faultEx.getFaultActor();
+ if (faultActor != null)
+ {
+ SOAPElement soapElement = soapFault.addChildElement("faultactor");
+ soapElement.addTextNode(faultActor);
+ }
+
+ Exception faultCause = (Exception)faultEx.getCause();
+ Detail detail = faultEx.getDetail();
+ if (detail != null)
+ {
+ soapFault.addChildElement(detail);
+ }
+ else if (faultCause != null && (faultCause instanceof RuntimeException) ==
false)
+ {
+ Class javaType = faultCause.getClass();
+
+ TypeMapping typeMapping = serContext.getTypeMapping();
+
+ OperationMetaData opMetaData = msgContext.getOperationMetaData();
+ if (opMetaData != null && opMetaData.getFault(javaType) != null)
+ {
+ FaultMetaData faultMetaData = opMetaData.getFault(javaType);
+ QName xmlName = faultMetaData.getXmlName();
+ QName xmlType = faultMetaData.getXmlType();
+
+ xmlName = nsRegistry.registerQName(xmlName);
+
+ // Get the serializer from the type mapping
+ SerializerFactoryBase serFactory =
(SerializerFactoryBase)typeMapping.getSerializer(javaType, xmlType);
+ if (serFactory == null)
+ throw new JAXRPCException("Cannot obtain serializer factory for:
" + xmlType);
+
+ try
+ {
+ SerializerSupport ser = (SerializerSupport)serFactory.getSerializer();
+ String xmlFragment = ser.serialize(xmlName, xmlType, faultCause,
serContext, null);
+
+ SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
+ Element domElement = DOMUtils.parse(xmlFragment);
+ SOAPElement soapElement = soapFactory.createElement(domElement, true);
+
+ detail = soapFault.addDetail();
+ detail.addChildElement(soapElement);
+ }
+ catch (BindingException e)
+ {
+ throw new JAXRPCException(e);
+ }
+ catch (IOException e)
+ {
+ throw new JAXRPCException(e);
+ }
+ }
+ else
+ {
+ log.debug("Cannot obtain fault meta data for: " + javaType);
+ }
+ }
+
+ return soapMessage;
+ }
+
+ private static String getValidFaultString(SOAPFaultException faultEx)
+ {
+ String faultString = faultEx.getFaultString();
+ if (faultString == null || faultString.length() == 0)
+ faultString = "Unqualified " + faultEx.getFaultCode() + "
fault";
+
+ return faultString;
+ }
+
+ private static void assertFaultCode(QName faultCode)
+ {
+ if (faultCode == null)
+ throw new IllegalArgumentException("faultcode cannot be null");
+
+ // For lazy folkes like the CTS that don't bother to give
+ // a namesapce URI, assume they use a standard code
+ String nsURI = faultCode.getNamespaceURI();
+ if ("".equals(nsURI))
+ {
+ log.warn("Empty namespace URI with fault code '" + faultCode +
"', assuming: " + Constants.NS_SOAP11_ENV);
+ faultCode = new QName(Constants.NS_SOAP11_ENV, faultCode.getLocalPart());
+ }
+
+ // WS-I allows non custom faultcodes if you use a non soap namespace
+ if (Constants.NS_SOAP11_ENV.equals(nsURI) &&
allowedFaultCodes.contains(faultCode) == false)
+ throw new IllegalArgumentException("Illegal faultcode '" +
faultCode + "', allowed values are: " + allowedFaultCodes);
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java (from
rev 1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SchemaGenerator.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SchemaGenerator.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,106 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.tools.JavaToXSD;
+
+/** A generator for XML schema that is used by unconfigured DII clients
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @since 03-Jun-2005
+ */
+public class SchemaGenerator
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SchemaGenerator.class);
+
+ private boolean restrictToTargetNamespace = true;
+
+ public JBossXSModel generateXSDSchema(QName xmlType, Class javaType)
+ {
+ log.debug("generateXSDSchema: [xmlType=" + xmlType +
",javaType=" + javaType.getName() + "]");
+ try
+ {
+ assertXmlType(xmlType);
+ String nsuri = xmlType.getNamespaceURI();
+ Class componentType = javaType;
+ while (componentType.isArray())
+ componentType = componentType.getComponentType();
+
+ JavaToXSD javaToXSD = new JavaToXSD();
+
+ // Force all DII arrays to use the same array namespace for the component
+ if (! componentType.isPrimitive())
+ {
+ Map<String, String> namespaceMap = new HashMap<String,
String>();
+ namespaceMap.put(componentType.getPackage().getName(), nsuri);
+ javaToXSD.setPackageNamespaceMap(namespaceMap);
+ }
+
+ JBossXSModel xsModel = javaToXSD.generateForSingleType(xmlType, javaType);
+ if (xsModel == null)
+ throw new WSException("Cannot generate XSModel");
+
+ log.debug("\n" + xsModel.serialize());
+ return xsModel;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new JAXRPCException("Cannot generate xsdSchema for: " + xmlType,
e);
+ }
+ }
+
+ /**
+ * Flag that indicates that the types generated fall under the target namespace
+ * default is false
+ * @param restrictToTargetNamespace The restrictToTargetNamespace to set.
+ */
+ public void setRestrictToTargetNamespace(boolean restrictToTargetNamespace)
+ {
+ this.restrictToTargetNamespace = restrictToTargetNamespace;
+ }
+
+ /** Assert that the given namespace has a valid URI
+ */
+ private void assertXmlType(QName xmlType)
+ {
+ String nsURI = xmlType.getNamespaceURI();
+ if (nsURI.length() == 0)
+ throw new IllegalArgumentException("Invalid namespace for type: " +
xmlType);
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,127 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.apache.xerces.xs.XSModel;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.TypesMetaData;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+
+/**
+ * The serialization context for JAXRPC endpoints/clients
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class SerializationContextJAXRPC extends SerializationContext
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SerializationContextJAXRPC.class);
+
+ // XML mapping from jaxrpc-mapping.xml
+ private JavaWsdlMapping jaxrpcMapping;
+
+ public JavaWsdlMapping getJavaWsdlMapping()
+ {
+ if (jaxrpcMapping == null)
+ {
+ log.debug("Generate jaxrpcMapping from typeMapping");
+
+ jaxrpcMapping = new JavaWsdlMapping();
+ for (QName xmlType : getTypeMapping().getRegisteredXmlTypes())
+ {
+ String nsURI = xmlType.getNamespaceURI();
+ if (!Constants.NS_SCHEMA_XSD.equals(nsURI) &&
!Constants.NS_ATTACHMENT_MIME_TYPE.equals(nsURI))
+ {
+ Class javaType = getTypeMapping().getJavaType(xmlType);
+ String javaTypeName = javaType.getName();
+
+ Class componentType = javaType;
+ while (componentType.isArray())
+ componentType = componentType.getComponentType();
+
+ if (JavaUtils.isPrimitive(componentType))
+ componentType = JavaUtils.getWrapperType(componentType);
+
+ Package packageObject = componentType.getPackage();
+ String packageName = (packageObject != null) ? packageObject.getName() :
"";
+ String packageType = jaxrpcMapping.getPackageNameForNamespaceURI(nsURI);
+ if (packageName.equals(packageType) == false)
+ {
+ PackageMapping packageMapping = new PackageMapping(jaxrpcMapping);
+ packageMapping.setNamespaceURI(nsURI);
+ packageMapping.setPackageType(packageName);
+ jaxrpcMapping.addPackageMapping(packageMapping);
+ log.debug("Add package mapping: " + packageMapping);
+ }
+
+ // Do not add mappings for array types
+ if (javaType.isArray())
+ continue;
+
+ JavaXmlTypeMapping xmlTypeMapping =
jaxrpcMapping.getTypeMappingForQName(xmlType);
+ if (xmlTypeMapping == null)
+ {
+ xmlTypeMapping = new JavaXmlTypeMapping(jaxrpcMapping);
+ xmlTypeMapping.setQNameScope("complexType");
+ xmlTypeMapping.setJavaType(javaTypeName);
+ xmlTypeMapping.setRootTypeQName(xmlType);
+ jaxrpcMapping.addJavaXmlTypeMappings(xmlTypeMapping);
+ log.debug("Add type mapping: " + xmlTypeMapping);
+ }
+ }
+ }
+ }
+ return jaxrpcMapping;
+ }
+
+ public void setJavaWsdlMapping(JavaWsdlMapping jaxrpcMapping)
+ {
+ this.jaxrpcMapping = jaxrpcMapping;
+ }
+
+ public XSModel getXsModel()
+ {
+ SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ OperationMetaData opMetaData = msgContext.getOperationMetaData();
+ ServiceMetaData serviceMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData();
+ TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
+ return typesMetaData.getSchemaModel();
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceExt.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceExt.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+//$Id$
+
+import javax.xml.rpc.Service;
+import javax.xml.rpc.handler.HandlerRegistry;
+
+/**
+ * Extends the JAXRPC Service with JBoss propriatary behaviour
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 27-Jan-2005
+ */
+public interface ServiceExt extends Service
+{
+ /**
+ * Get a HandlerRegistry that can be used to dynamically
+ * change the client side handler chain
+ */
+ HandlerRegistry getDynamicHandlerRegistry();
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,160 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.net.URL;
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.ServiceFactory;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+
+/**
+ * Service class acts as a factory for:
+ * <ul>
+ * <li>Dynamic proxy for the target service endpoint.
+ * <li>Instance of the type javax.xml.rpc.Call for the dynamic invocation of a
remote operation on the target service endpoint.
+ * <li>Instance of a generated stub class
+ * </ul>
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class ServiceFactoryImpl extends ServiceFactory
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(ServiceFactoryImpl.class);
+
+ /**
+ * Create an instance of the generated service implementation class for a given
service interface, if available.
+ *
+ * @param serviceInterface Service interface
+ * @return A Service
+ * @throws ServiceException If there is any error while creating the specified
service, including the case where a
+ * generated service implementation class cannot be located
+ */
+ public Service loadService(Class serviceInterface) throws ServiceException
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Create an instance of the generated service implementation class for a given
service interface, if available.
+ * An implementation may use the provided wsdlDocumentLocation and properties to help
locate the generated implementation class.
+ * If no such class is present, a ServiceException will be thrown.
+ *
+ * @param wsdlDocumentLocation URL for the WSDL document location for the service or
null
+ * @param serviceInterface Service interface
+ * @param props A set of implementation-specific properties to help
locate the generated service implementation class
+ * @return A Service
+ * @throws ServiceException If there is any error while creating the specified
service, including the case where a
+ * generated service implementation class cannot be located
+ */
+ public Service loadService(URL wsdlDocumentLocation, Class serviceInterface,
Properties props) throws ServiceException
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Create an instance of the generated service implementation class for a given
service, if available.
+ * The service is uniquely identified by the wsdlDocumentLocation and serviceName
arguments.
+ * An implementation may use the provided properties to help locate the generated
implementation class.
+ * If no such class is present, a ServiceException will be thrown.
+ *
+ * @param wsdlDocumentLocation URL for the WSDL document location for the service or
null
+ * @param serviceName Qualified name for the service
+ * @param props A set of implementation-specific properties to help
locate the generated service implementation class
+ * @return A Service
+ * @throws ServiceException If there is any error while creating the specified
service, including the case where a generated service implementation class cannot be
located
+ */
+ public Service loadService(URL wsdlDocumentLocation, QName serviceName, Properties
props) throws ServiceException
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Create a <code>Service</code> instance.
+ *
+ * @param serviceName QName for the service
+ * @return Service.
+ * @throws ServiceException If any error in creation of the specified service
+ */
+ public Service createService(QName serviceName) throws ServiceException
+ {
+ return new ServiceImpl(serviceName);
+ }
+
+ /**
+ * Create a <code>Service</code> instance.
+ *
+ * @param wsdlURL URL for the WSDL document location
+ * @param serviceName QName for the service.
+ * @return Service.
+ * @throws ServiceException If any error in creation of the specified service
+ */
+ public Service createService(URL wsdlURL, QName serviceName) throws ServiceException
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+
+ URL mappingURL = cl.getResource("META-INF/jaxrpc-mapping.xml");
+ if (mappingURL != null)
+ log.info("Use jaxrpc-mapping from: " + mappingURL);
+
+ return createService(wsdlURL, serviceName, mappingURL, null);
+ }
+
+ /**
+ * Create a <code>Service</code> instance.
+ *
+ * @param wsdlURL URL for the WSDL document location
+ * @param serviceName QName for the service.
+ * @param mappingURL URL for the jaxrpc-mapping.xml document location
+ * @return Service.
+ * @throws ServiceException If any error in creation of the specified service
+ */
+ public Service createService(URL wsdlURL, QName serviceName, URL mappingURL) throws
ServiceException
+ {
+ return createService(wsdlURL, serviceName, mappingURL, null);
+ }
+
+ /**
+ * Create a <code>Service</code> instance.
+ *
+ * @param wsdlURL URL for the WSDL document location
+ * @param serviceName QName for the service.
+ * @param mappingURL URL for the jaxrpc-mapping.xml document location
+ * @param securityURL URL for the jboss-ws-security.xml file
+ * @return Service.
+ * @throws ServiceException If any error in creation of the specified service
+ */
+ public Service createService(URL wsdlURL, QName serviceName, URL mappingURL, URL
securityURL) throws ServiceException
+ {
+ ServiceImpl service = new ServiceImpl(serviceName, wsdlURL, mappingURL,
securityURL);
+ return service;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,405 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.lang.reflect.Proxy;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.rmi.Remote;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
+import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.encoding.TypeMappingRegistry;
+import javax.xml.rpc.handler.HandlerChain;
+import javax.xml.rpc.handler.HandlerRegistry;
+
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder;
+import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
+
+/**
+ * Service class acts as a factory for:
+ * <ul>
+ * <li>Dynamic proxy for the target service endpoint.
+ * <li>Instance of the type javax.xml.rpc.Call for the dynamic invocation of a
+ * remote operation on the target service endpoint.
+ * <li>Instance of a generated stub class
+ * </ul>
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class ServiceImpl implements ServiceExt
+{
+ // The service meta data that is associated with this JAXRPC Service
+ private ServiceMetaData serviceMetaData;
+
+ // The optional WSDL location
+ private URL wsdlLocation;
+
+ // The handler registry
+ private HandlerRegistryImpl handlerRegistry;
+
+ /**
+ * Construct a Service without WSDL meta data
+ */
+ ServiceImpl(QName serviceName)
+ {
+ UnifiedMetaData wsMetaData = new UnifiedMetaData();
+ serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
+ handlerRegistry = new HandlerRegistryImpl(serviceMetaData);
+ }
+
+ /**
+ * Construct a Service that has access to some WSDL meta data
+ */
+ ServiceImpl(QName serviceName, URL wsdlURL, URL mappingURL, URL securityURL)
+ {
+ this.wsdlLocation = wsdlURL;
+ JAXRPCClientMetaDataBuilder builder = new JAXRPCClientMetaDataBuilder();
+
+ ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
+
+ serviceMetaData = builder.buildMetaData(serviceName, wsdlURL, mappingURL,
securityURL, null, ctxClassLoader);
+ handlerRegistry = new HandlerRegistryImpl(serviceMetaData);
+ }
+
+ /**
+ * Construct a Service that has access to some WSDL meta data
+ */
+ ServiceImpl(QName serviceName, URL wsdlURL, JavaWsdlMapping mappingURL,
WSSecurityConfiguration securityConfig, UnifiedServiceRefMetaData serviceRefMetaData)
+ {
+ this.wsdlLocation = wsdlURL;
+ JAXRPCClientMetaDataBuilder builder = new JAXRPCClientMetaDataBuilder();
+
+ ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
+
+ serviceMetaData = builder.buildMetaData(serviceName, wsdlURL, mappingURL,
securityConfig, serviceRefMetaData, ctxClassLoader);
+ handlerRegistry = new HandlerRegistryImpl(serviceMetaData);
+ }
+
+ public ServiceMetaData getServiceMetaData()
+ {
+ return serviceMetaData;
+ }
+
+ /**
+ * Gets the location of the WSDL document for this Service.
+ *
+ * @return URL for the location of the WSDL document for this service
+ */
+ public URL getWSDLDocumentLocation()
+ {
+ return wsdlLocation;
+ }
+
+ /**
+ * Gets the name of this service.
+ *
+ * @return Qualified name of this service
+ */
+ public QName getServiceName()
+ {
+ return serviceMetaData.getServiceName();
+ }
+
+ /**
+ * Creates a Call instance.
+ *
+ * @param portName
+ * Qualified name for the target service endpoint
+ * @return Call instance
+ * @throws javax.xml.rpc.ServiceException
+ * If any error in the creation of the Call object
+ */
+ public Call createCall(QName portName) throws ServiceException
+ {
+ String nsURI = portName.getNamespaceURI();
+ serviceMetaData.assertTargetNamespace(nsURI);
+ return new CallImpl(this, portName, null);
+ }
+
+ /**
+ * Creates a Call instance.
+ *
+ * @param portName
+ * Qualified name for the target service endpoint
+ * @param operationName
+ * Name of the operation for which this Call object is to be
+ * created.
+ * @return Call instance
+ * @throws javax.xml.rpc.ServiceException
+ * If any error in the creation of the Call object
+ */
+ public Call createCall(QName portName, String operationName) throws ServiceException
+ {
+ String nsURI = portName.getNamespaceURI();
+ serviceMetaData.assertTargetNamespace(nsURI);
+ QName opName = new QName(nsURI, operationName);
+ return new CallImpl(this, portName, opName);
+ }
+
+ /**
+ * Creates a Call instance.
+ *
+ * @param portName
+ * Qualified name for the target service endpoint
+ * @param opName
+ * Qualified name of the operation for which this Call object is
+ * to be created.
+ * @return Call instance
+ * @throws javax.xml.rpc.ServiceException
+ * If any error in the creation of the Call object
+ */
+ public Call createCall(QName portName, QName opName) throws ServiceException
+ {
+ serviceMetaData.assertTargetNamespace(portName.getNamespaceURI());
+ serviceMetaData.assertTargetNamespace(opName.getNamespaceURI());
+ return new CallImpl(this, portName, opName);
+ }
+
+ /**
+ * Creates a Call object not associated with specific operation or target
+ * service endpoint. This Call object needs to be configured using the
+ * setter methods on the Call interface.
+ *
+ * @return Call object
+ * @throws javax.xml.rpc.ServiceException
+ * If any error in the creation of the Call object
+ */
+ public Call createCall() throws ServiceException
+ {
+ return new CallImpl(this);
+ }
+
+ /**
+ * Gets an array of preconfigured Call objects for invoking operations on
+ * the specified port. There is one Call object per operation that can be
+ * invoked on the specified port. Each Call object is pre-configured and
+ * does not need to be configured using the setter methods on Call
+ * interface. <p/> Each invocation of the getCalls method returns a new
+ * array of preconfigured Call objects <p/> This method requires the Service
+ * implementation class to have access to the WSDL related metadata.
+ *
+ * @param portName
+ * Qualified name for the target service endpoint
+ * @return Call[] Array of pre-configured Call objects
+ * @throws javax.xml.rpc.ServiceException
+ * If this Service class does not have access to the required
+ * WSDL metadata or if an illegal endpointName is specified.
+ */
+ public Call[] getCalls(QName portName) throws ServiceException
+ {
+ EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
+ if (epMetaData == null)
+ throw new ServiceException("Cannot find endpoint for name: " +
portName);
+
+ List<Call> calls = new ArrayList<Call>();
+ for (OperationMetaData opMetaData : epMetaData.getOperations())
+ {
+ Call call = createCall(portName, opMetaData.getQName());
+ calls.add(call);
+ }
+
+ Call[] callArr = new Call[calls.size()];
+ calls.toArray(callArr);
+
+ return callArr;
+ }
+
+ /**
+ * J2EE components should not use the getHandlerRegistry() method. A
+ * container provider must throw a java.lang.UnsupportedOperationException
+ * from the getHandlerRegistry() method of the Service Interface. Handler
+ * support is documented in Chapter 6 Handlers.
+ */
+ public HandlerRegistry getHandlerRegistry()
+ {
+ throw new UnsupportedOperationException("Components should not use the
getHandlerRegistry() method.");
+ }
+
+ /**
+ * Get a HandlerRegistry that can be used to dynamically change the client
+ * side handler chain associated with a given endpoint.
+ */
+ public HandlerRegistry getDynamicHandlerRegistry()
+ {
+ return handlerRegistry;
+ }
+
+ /**
+ * J2EE components should not use the getTypeMappingRegistry() method. A
+ * container provider must throw a java.lang.UnsupportedOperationException
+ * from the getTypeMappingRegistry() method of the Service Interface.
+ */
+ public TypeMappingRegistry getTypeMappingRegistry()
+ {
+ throw new UnsupportedOperationException("Components should not use the
getTypeMappingRegistry() method.");
+ }
+
+ /**
+ * Returns an Iterator for the list of QNames of service endpoints grouped
+ * by this service
+ *
+ * @return Returns java.util.Iterator with elements of type
+ * javax.xml.namespace.QName
+ * @throws javax.xml.rpc.ServiceException
+ * If this Service class does not have access to the required
+ * WSDL metadata
+ */
+ public Iterator getPorts() throws ServiceException
+ {
+ ArrayList<QName> list = new ArrayList<QName>();
+ if (serviceMetaData != null)
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ list.add(epMetaData.getQName());
+ }
+ }
+ return list.iterator();
+ }
+
+ /**
+ * The getPort method returns either an instance of a generated stub
+ * implementation class or a dynamic proxy. The parameter
+ * serviceEndpointInterface specifies the service endpoint interface that is
+ * supported by the returned stub or proxy. In the implementation of this
+ * method, the JAX-RPC runtime system takes the responsibility of selecting
+ * a protocol binding (and a port) and configuring the stub accordingly. The
+ * returned Stub instance should not be reconfigured by the client.
+ */
+ public Remote getPort(Class seiClass) throws ServiceException
+ {
+ if (seiClass == null)
+ throw new IllegalArgumentException("SEI class cannot be null");
+
+ String seiName = seiClass.getName();
+ if (Remote.class.isAssignableFrom(seiClass) == false)
+ throw new ServiceException("SEI does not implement java.rmi.Remote: "
+ seiName);
+
+ if (serviceMetaData == null)
+ throw new ServiceException("Service meta data not available");
+
+ try
+ {
+ EndpointMetaData epMetaData =
serviceMetaData.getEndpointByServiceEndpointInterface(seiName);
+ if (epMetaData == null && serviceMetaData.getEndpoints().size() == 1)
+ {
+ epMetaData = serviceMetaData.getEndpoints().get(0);
+ epMetaData.setServiceEndpointInterfaceName(seiName);
+ }
+
+ if (epMetaData == null)
+ throw new ServiceException("Cannot find endpoint meta data for: " +
seiName);
+
+ return createProxy(seiClass, epMetaData);
+ }
+ catch (ServiceException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new ServiceException("Cannot create proxy", ex);
+ }
+ }
+
+ /**
+ * The getPort method returns either an instance of a generated stub
+ * implementation class or a dynamic proxy. A service client uses this
+ * dynamic proxy to invoke operations on the target service endpoint. The
+ * serviceEndpointInterface specifies the service endpoint interface that is
+ * supported by the created dynamic proxy or stub instance.
+ */
+ public Remote getPort(QName portName, Class seiClass) throws ServiceException
+ {
+ if (seiClass == null)
+ throw new IllegalArgumentException("SEI class cannot be null");
+
+ if (serviceMetaData == null)
+ throw new ServiceException("Service meta data not available");
+
+ String seiName = seiClass.getName();
+ if (Remote.class.isAssignableFrom(seiClass) == false)
+ throw new ServiceException("SEI does not implement java.rmi.Remote: "
+ seiName);
+
+ EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
+ if (epMetaData == null)
+ throw new ServiceException("Cannot obtain endpoint meta data for: " +
portName);
+
+ try
+ {
+ if (epMetaData.getServiceEndpointInterfaceName() == null)
+ epMetaData.setServiceEndpointInterfaceName(seiName);
+
+ return createProxy(seiClass, epMetaData);
+ }
+ catch (ServiceException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new ServiceException("Cannot create proxy", ex);
+ }
+ }
+
+ private Remote createProxy(Class seiClass, EndpointMetaData epMetaData) throws
Exception
+ {
+ CallImpl call = new CallImpl(this, epMetaData);
+
+ CallProxy handler = new CallProxy(call);
+ ClassLoader cl = epMetaData.getClassLoader();
+ Remote proxy = (Remote)Proxy.newProxyInstance(cl, new Class[] { seiClass,
StubExt.class }, handler);
+
+ return proxy;
+ }
+
+ /**
+ * Get the handler chain for the given endpoint name, maybe null.
+ */
+ public HandlerChain getHandlerChain(QName portName)
+ {
+ return handlerRegistry.getHandlerChainInstance(portName);
+ }
+
+ /**
+ * Register a handler chain for the given endpoint name
+ */
+ public void registerHandlerChain(QName portName, List infos, Set roles)
+ {
+ handlerRegistry.registerClientHandlerChain(portName, infos, roles);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,317 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+// $Id$
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.ObjectInputStream;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Proxy;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLEncoder;
+import java.rmi.Remote;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Set;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+import javax.naming.spi.ObjectFactory;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.handler.HandlerInfo;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+
+/**
+ * This ServiceObjectFactory reconstructs a javax.xml.rpc.Service
+ * for a given WSDL when the webservice client does a JNDI lookup
+ * <p/>
+ * It uses the information provided by the service-ref element in application-client.xml
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-April-2004
+ */
+public class ServiceObjectFactory implements ObjectFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServiceObjectFactory.class);
+
+ /**
+ * Creates an object using the location or reference information specified.
+ * <p/>
+ *
+ * @param obj The possibly null object containing location or reference
+ * information that can be used in creating an object.
+ * @param name The name of this object relative to
<code>nameCtx</code>,
+ * or null if no name is specified.
+ * @param nameCtx The context relative to which the <code>name</code>
+ * parameter is specified, or null if <code>name</code>
is
+ * relative to the default initial context.
+ * @param environment The possibly null environment that is used in
+ * creating the object.
+ * @return The object created; null if an object cannot be created.
+ * @throws Exception if this object factory encountered an exception
+ * while attempting to create an object, and no other object
factories are
+ * to be tried.
+ * @see javax.naming.spi.NamingManager#getObjectInstance
+ * @see javax.naming.spi.NamingManager#getURLContext
+ */
+ public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable
environment) throws Exception
+ {
+ try
+ {
+ Reference ref = (Reference)obj;
+
+ // Unmarshall the ServiceRefMetaData
+ UnifiedServiceRefMetaData serviceRefMetaData = null;
+ RefAddr metaRefAddr = ref.get(ServiceReferenceable.SERVICE_REF_META_DATA);
+ ByteArrayInputStream bais = new
ByteArrayInputStream((byte[])metaRefAddr.getContent());
+ try
+ {
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ serviceRefMetaData = (UnifiedServiceRefMetaData)ois.readObject();
+ ois.close();
+ }
+ catch (IOException e)
+ {
+ throw new NamingException("Cannot unmarshall service ref meta data,
cause: " + e.toString());
+ }
+
+ // reconstruct the resourceCl
+ ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
+ URL url = new
URL((String)ref.get(ServiceReferenceable.DEPLOYMENT_URL).getContent());
+ URLClassLoader resourceCL = new URLClassLoader(new URL[] { url }, contextCL);
+ serviceRefMetaData.setResourceCL(resourceCL);
+
+ // Rewrite the config-file content
+ String configFile = serviceRefMetaData.getConfigFile();
+ if (configFile != null)
+ {
+ try
+ {
+ new URL(configFile);
+ }
+ catch (MalformedURLException ex)
+ {
+ URL configURL = resourceCL.getResource(configFile);
+ if (configURL != null)
+ {
+ configFile = configURL.toExternalForm();
+ serviceRefMetaData.setConfigFile(configFile);
+ }
+ }
+ }
+
+ // Unmarshall the WSSecurityConfiguration
+ WSSecurityConfiguration securityConfig = null;
+ RefAddr wsseRefAddr = ref.get(ServiceReferenceable.SECURITY_CONFIG);
+ if (wsseRefAddr != null)
+ {
+ bais = new ByteArrayInputStream((byte[])wsseRefAddr.getContent());
+ try
+ {
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ securityConfig = (WSSecurityConfiguration)ois.readObject();
+ ois.close();
+ }
+ catch (IOException e)
+ {
+ throw new NamingException("Cannot unmarshall security config, cause:
" + e.toString());
+ }
+ }
+
+ ServiceImpl jaxrpcService = null;
+ URL wsdlURL = serviceRefMetaData.getWsdlURL();
+ if (wsdlURL != null)
+ {
+ log.debug("Create jaxrpc service from wsdl");
+
+ // Create the actual service object
+ QName serviceName = serviceRefMetaData.getServiceQName();
+ JavaWsdlMapping javaWsdlMapping =
(JavaWsdlMapping)serviceRefMetaData.getJavaWsdlMapping();
+ jaxrpcService = new ServiceImpl(serviceName, wsdlURL, javaWsdlMapping,
securityConfig, serviceRefMetaData);
+ }
+ else
+ {
+ log.debug("Create jaxrpc service with no wsdl");
+ jaxrpcService = new ServiceImpl(new QName(Constants.NS_JBOSSWS_URI,
"AnonymousService"));
+ }
+
+ // Set any service level properties
+ ServiceMetaData serviceMetaData = jaxrpcService.getServiceMetaData();
+ serviceMetaData.setProperties(serviceRefMetaData.getCallProperties());
+
+ // The web service client using a port-component-link, the contet is the URL to
+ // the PortComponentLinkServlet that will return the actual endpoint address
+ RefAddr pcLinkRef = ref.get(ServiceReferenceable.PORT_COMPONENT_LINK);
+ if (pcLinkRef != null)
+ {
+ String pcLink = (String)pcLinkRef.getContent();
+ log.debug("Resolving port-component-link: " + pcLink);
+
+ // First try to obtain the endpoint address loacally
+ String endpointAddress = null;
+ try
+ {
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ ServiceEndpointManager epManager = factory.getServiceEndpointManager();
+ ServiceEndpoint serviceEndpoint =
epManager.resolvePortComponentLink(pcLink);
+ if (serviceEndpoint == null)
+ throw new WSException("Cannot resolve port-component-link: "
+ pcLink);
+
+ endpointAddress =
serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
+ }
+ catch (Exception ex)
+ {
+ // ignore, we are probably a remote client
+ }
+
+ // We may be remote in the esoteric case where an appclient uses the
port-comonent-link feature
+ if (endpointAddress == null)
+ {
+ String servletPath =
(String)ref.get(ServiceReferenceable.PORT_COMPONENT_LINK_SERVLET).getContent();
+ servletPath += "?pcLink=" + URLEncoder.encode(pcLink,
"UTF-8");
+ InputStream is = new URL(servletPath).openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(is));
+ endpointAddress = br.readLine();
+ is.close();
+ }
+
+ log.debug("Resolved to: " + endpointAddress);
+ if (serviceMetaData.getEndpoints().size() == 1)
+ {
+ EndpointMetaData epMetaData = serviceMetaData.getEndpoints().get(0);
+ epMetaData.setEndpointAddress(endpointAddress);
+ }
+ else
+ {
+ log.warn("Cannot set endpoint address for port-component-link,
unsuported number of endpoints");
+ }
+ }
+
+ /********************************************************
+ * Setup the Proxy that implements the service-interface
+ ********************************************************/
+
+ // load the service interface class
+ Class siClass = contextCL.loadClass(serviceRefMetaData.getServiceInterface());
+ if (Service.class.isAssignableFrom(siClass) == false)
+ throw new JAXRPCException("The service interface does not implement
javax.xml.rpc.Service: " + siClass.getName());
+
+ // load all service endpoint interface classes
+ UnifiedPortComponentRefMetaData[] pcrArray =
serviceRefMetaData.getPortComponentRefs();
+ for (int i = 0; i < pcrArray.length; i++)
+ {
+ UnifiedPortComponentRefMetaData pcr = pcrArray[i];
+ Class seiClass = contextCL.loadClass(pcr.getServiceEndpointInterface());
+ if (Remote.class.isAssignableFrom(seiClass) == false)
+ throw new IllegalArgumentException("The SEI does not implement
java.rmi.Remote: " + seiClass.getName());
+ }
+
+ // Setup the handler chain
+ setupHandlerChain(jaxrpcService, serviceRefMetaData);
+
+ InvocationHandler handler = new ServiceProxy(jaxrpcService, siClass);
+ return Proxy.newProxyInstance(contextCL, new Class[] { siClass, ServiceExt.class
}, handler);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot create service", ex);
+ throw ex;
+ }
+ }
+
+ /**
+ * Setup the handler chain(s) for this service
+ * <p/>
+ * This registers a handler chain with the service for every endpoint
+ * that has handlers configured in the <service-ref> element
+ */
+ private void setupHandlerChain(ServiceImpl jaxrpcService, UnifiedServiceRefMetaData
serviceRefMetaData) throws Exception
+ {
+ List<EndpointMetaData> endpoints =
jaxrpcService.getServiceMetaData().getEndpoints();
+ for (EndpointMetaData epMetaData : endpoints)
+ {
+ QName portName = epMetaData.getQName();
+
+ Set<String> handlerRoles = new HashSet<String>();
+ ArrayList handlerInfos = new ArrayList();
+ for (HandlerMetaData handlerMetaData :
epMetaData.getHandlerMetaData(HandlerType.ALL))
+ {
+ HandlerMetaDataJAXRPC jaxrpcMetaData =
(HandlerMetaDataJAXRPC)handlerMetaData;
+ handlerRoles.addAll(jaxrpcMetaData.getSoapRoles());
+
+ HashMap hConfig = new HashMap();
+ for (HandlerInitParam param : jaxrpcMetaData.getInitParams())
+ {
+ hConfig.put(param.getParamName(), param.getParamValue());
+ }
+
+ Set<QName> headers = jaxrpcMetaData.getSoapHeaders();
+ QName[] headerArr = new QName[headers.size()];
+ headers.toArray(headerArr);
+
+ Class hClass = jaxrpcMetaData.getHandlerClass();
+ hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
+ HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
+
+ log.debug("Adding client side handler to endpoint '" + portName
+ "': " + info);
+ handlerInfos.add(info);
+
+ // register the handlers with the client engine
+ if (handlerInfos.size() > 0)
+ jaxrpcService.registerHandlerChain(portName, handlerInfos, handlerRoles);
+ }
+ }
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceProxy.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceProxy.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,162 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+// $Id$
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.rmi.Remote;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.Service;
+
+import org.jboss.logging.Logger;
+
+/**
+ * This is the proxy that implements the service interface .
+ * <p/>
+ * Additionally it handles some ws4ee functionality that is not part of jaxrpc
behaviour.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-May-2004
+ */
+public class ServiceProxy implements InvocationHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServiceProxy.class);
+
+ // The underlying jaxrpc service
+ private ServiceImpl jaxrpcService;
+
+ // The methods from java.lang.Object
+ private List objectMethods = new ArrayList();
+ // The methods from javax.xml.rpc.Service
+ private List jaxrpcServiceMethods = new ArrayList();
+ // The methods from the service interface, in case of javax.xml.rpc.Service it is
empty
+ private List serviceInterfaceMethods = new ArrayList();
+
+ // The cached getPort method
+ private Method getPortMethod;
+
+ /**
+ * Construct a client side service proxy.
+ * <p/>
+ * This proxy implements the (generated) service interface.
+ *
+ * @param service The underlying {@link javax.xml.rpc.Service}
+ * @param siClass The service interface, a subclass of {@link javax.xml.rpc.Service}
+ */
+ public ServiceProxy(ServiceImpl service, Class siClass)
+ {
+ this.jaxrpcService = service;
+
+ // initialize java.lang.Object methods
+ objectMethods.addAll(Arrays.asList(Object.class.getMethods()));
+
+ // initialize javax.xml.rpc.Service methods
+ jaxrpcServiceMethods.addAll(Arrays.asList(ServiceExt.class.getMethods()));
+
+ // initialize SI methods
+ if (siClass.getName().equals("javax.xml.rpc.Service") == false)
+ serviceInterfaceMethods.addAll(Arrays.asList(siClass.getDeclaredMethods()));
+
+ // initialize special ws4ee methods
+ try
+ {
+ getPortMethod = Service.class.getMethod("getPort", new
Class[]{Class.class});
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new JAXRPCException(e.toString());
+ }
+ }
+
+ /**
+ * Processes a method invocation on a proxy instance and returns
+ * the result.
+ */
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ String methodName = method.getName();
+
+ try
+ {
+ Object retObj = null;
+ if (jaxrpcServiceMethods.contains(method))
+ {
+ log.debug("Invoke on jaxrpc service: " + methodName);
+
+ if (method.getName().equals("getPort"))
+ {
+ Remote port = (Remote)method.invoke(jaxrpcService, args);
+ return port;
+ }
+ else
+ {
+ retObj = method.invoke(jaxrpcService, args);
+ return retObj;
+ }
+ }
+ if (serviceInterfaceMethods.contains(method))
+ {
+ log.debug("Invoke on service interface: " + methodName);
+
+ Class seiClass = method.getReturnType();
+ retObj = getPortMethod.invoke(jaxrpcService, new Object[]{seiClass});
+ return retObj;
+ }
+ if (objectMethods.contains(method))
+ {
+ log.debug("Invoke on object: " + methodName);
+
+ retObj = method.invoke(jaxrpcService, args);
+ return retObj;
+ }
+
+ throw new JAXRPCException("Don't know how to invoke: " + method);
+ }
+ catch (Exception e)
+ {
+ handleException(e);
+ return null;
+ }
+ }
+
+ /**
+ * Log the client side exception
+ */
+ private void handleException(Exception ex) throws Throwable
+ {
+ Throwable th = ex;
+ if (ex instanceof InvocationTargetException)
+ th = ((InvocationTargetException)ex).getTargetException();
+
+ log.error("Service error", th);
+ throw th;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceReferenceable.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceReferenceable.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+// $Id$
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.net.URL;
+
+import javax.naming.BinaryRefAddr;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
+import javax.naming.StringRefAddr;
+
+import org.jboss.ws.core.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfigurationFactory;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+/**
+ * A JNDI reference to a javax.xml.rpc.Service
+ * <p/>
+ * It holds the information to reconstrut the javax.xml.rpc.Service
+ * when the client does a JNDI lookup.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-April-2004
+ */
+public class ServiceReferenceable implements Referenceable
+{
+ public static final String SERVICE_REF_META_DATA = "SERVICE_REF_META_DATA";
+ public static final String DEPLOYMENT_URL = "DEPLOYMENT_URL";
+ public static final String SECURITY_CONFIG = "SECURITY_CONFIG";
+ public static final String DESCRIPTOR_LOC = "DESCRIPTOR_LOC";
+ public static final String PORT_COMPONENT_LINK = "PORT_COMPONENT_LINK";
+ public static final String PORT_COMPONENT_LINK_SERVLET =
"PORT_COMPONENT_LINK_SERVLET";
+
+ private UnifiedServiceRefMetaData refMetaData;
+ private UnifiedDeploymentInfo udi;
+
+ /**
+ * A service referenceable for a WSDL document that is part of the deployment
+ *
+ * @param refMetaData The service-ref meta data
+ * @param udi The client DeploymentInfo
+ */
+ public ServiceReferenceable(UnifiedServiceRefMetaData refMetaData,
UnifiedDeploymentInfo udi)
+ {
+ this.refMetaData = refMetaData;
+ this.udi = udi;
+ }
+
+ /**
+ * Retrieves the Reference of this object.
+ *
+ * @return The non-null Reference of this object.
+ * @throws javax.naming.NamingException If a naming exception was encountered while
retrieving the reference.
+ */
+ public Reference getReference() throws NamingException
+ {
+ Reference myRef = new Reference(ServiceReferenceable.class.getName(),
ServiceObjectFactory.class.getName(), null);
+
+ // The deployment URL of the web service client deployment
+ // Add a reference to the client deployment URL
+ URL deploymentURL = udi.url;
+ myRef.add(new StringRefAddr(DEPLOYMENT_URL, deploymentURL.toExternalForm()));
+
+ // Add a reference to the ServiceRefMetaData and WSDLDefinitions
+ myRef.add(new BinaryRefAddr(SERVICE_REF_META_DATA, marshallServiceRef()));
+
+ if (getSecurityConfigURL() != null)
+ myRef.add(new BinaryRefAddr(SECURITY_CONFIG, marshallSecurityConfig()));
+
+ // Add references to port component links
+ UnifiedPortComponentRefMetaData[] pcrArr = refMetaData.getPortComponentRefs();
+ for (int i = 0; i < pcrArr.length; i++)
+ {
+ UnifiedPortComponentRefMetaData pcr = pcrArr[i];
+ String pcLink = pcr.getPortComponentLink();
+ if (pcLink != null)
+ {
+ myRef.add(new StringRefAddr(PORT_COMPONENT_LINK, pcLink));
+ try
+ {
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ ServiceEndpointManager epManager = factory.getServiceEndpointManager();
+ String host = epManager.getWebServiceHost();
+ int port = epManager.getWebServicePort();
+
+ String servletURL = "http://" + host + ":" + port +
"/jbossws/pclink";
+ myRef.add(new StringRefAddr(PORT_COMPONENT_LINK_SERVLET, servletURL));
+ }
+ catch (Exception ex)
+ {
+ throw new NamingException("Cannot obtain path to
PortComponentLinkServlet: " + ex);
+ }
+ }
+ }
+
+ return myRef;
+ }
+
+ /** Marshall the ServiceRefMetaData to an byte array
+ */
+ private byte[] marshallServiceRef() throws NamingException
+ {
+ refMetaData.getJavaWsdlMapping();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
+ try
+ {
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(refMetaData);
+ oos.close();
+ }
+ catch (IOException e)
+ {
+ throw new NamingException("Cannot marshall service ref meta data, cause:
" + e.toString());
+ }
+ return baos.toByteArray();
+ }
+
+ /** Marshall the WSSecurityConfiguration to an byte array
+ */
+ private byte[] marshallSecurityConfig() throws NamingException
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
+ try
+ {
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ URL securityURL = getSecurityConfigURL();
+ WSSecurityConfiguration securityConfig =
WSSecurityConfigurationFactory.newInstance().parse(securityURL);
+ oos.writeObject(securityConfig);
+ oos.close();
+ }
+ catch (IOException e)
+ {
+ throw new NamingException("Cannot marshall security config, cause: " +
e.toString());
+ }
+ return baos.toByteArray();
+ }
+
+ private URL getSecurityConfigURL()
+ {
+ ClassLoader ctxClassLoader = refMetaData.getResourceCL();
+ String descriptorLoc = udi.metaData instanceof UnifiedWebMetaData ?
"WEB-INF" : "META-INF";
+ URL securityURL = ctxClassLoader.getResource(descriptorLoc + "/" +
WSSecurityConfigurationFactory.CLIENT_RESOURCE_NAME);
+ return securityURL;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServletEndpointContextImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServletEndpointContextImpl.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.security.Principal;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.server.ServletEndpointContext;
+
+import org.jboss.ws.core.server.EndpointContext;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+
+/**
+ * Implementation of <code>ServletEndpointContext</code>
+ *
+ * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
+ */
+public class ServletEndpointContextImpl implements ServletEndpointContext
+{
+ private ServletContext context;
+ private HttpServletRequest request;
+ private HttpServletResponse response;
+
+ public ServletEndpointContextImpl(EndpointContext context)
+ {
+ this.context = context.getServletContext();
+ this.request = context.getHttpServletRequest();
+ this.response = context.getHttpServletResponse();
+ }
+
+ public HttpSession getHttpSession()
+ {
+ return request.getSession();
+ }
+
+ public MessageContext getMessageContext()
+ {
+ return (MessageContext)MessageContextAssociation.peekMessageContext();
+ }
+
+ public ServletContext getServletContext()
+ {
+ return context;
+ }
+
+ public Principal getUserPrincipal()
+ {
+ return request.getUserPrincipal();
+ }
+
+ public boolean isUserInRole(String role)
+ {
+ return request.isUserInRole(role);
+ }
+
+ // BEGIN non-standard access methods
+
+ public HttpServletRequest getHttpServletRequest()
+ {
+ return request;
+ }
+
+ public HttpServletResponse getHttpServletResponse()
+ {
+ return response;
+ }
+
+ // END non-standard access methods
+}
\ No newline at end of file
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java (from
rev 1565, branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/StubExt.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/StubExt.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,112 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+
+import org.jboss.ws.common.umdm.EndpointMetaData;
+
+// $Id$
+
+/**
+ * An instance of a stub class represents a client side proxy or stub instance for the
target service endpoint.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 27-Jan-2005
+ */
+public interface StubExt extends javax.xml.rpc.Stub
+{
+ /** ClientTimeout property: org.jboss.ws.timeout */
+ static final String PROPERTY_CLIENT_TIMEOUT = "org.jboss.ws.timeout";
+ /** KeyStore property: org.jboss.ws.keyStore */
+ static final String PROPERTY_KEY_STORE = "org.jboss.ws.keyStore";
+ /** KeyStorePassword property: org.jboss.ws.keyStorePassword */
+ static final String PROPERTY_KEY_STORE_PASSWORD =
"org.jboss.ws.keyStorePassword";
+ /** KeyStoreType property: org.jboss.ws.keyStoreType */
+ static final String PROPERTY_KEY_STORE_TYPE = "org.jboss.ws.keyStoreType";
+ /** TrustStore property: org.jboss.ws.trustStore */
+ static final String PROPERTY_TRUST_STORE = "org.jboss.ws.trustStore";
+ /** TrustStorePassword property: org.jboss.ws.trustStorePassword */
+ static final String PROPERTY_TRUST_STORE_PASSWORD =
"org.jboss.ws.trustStorePassword";
+ /** TrustStoreType property: org.jboss.ws.trustStoreType */
+ static final String PROPERTY_TRUST_STORE_TYPE =
"org.jboss.ws.trustStoreType";
+ /** Authentication type, used to specify basic, etc) */
+ static final String PROPERTY_AUTH_TYPE = "org.jboss.ws.authType";
+ /** Authentication type, BASIC */
+ static final String PROPERTY_AUTH_TYPE_BASIC =
"org.jboss.ws.authType.basic";
+ /** Authentication type, WSEE */
+ static final String PROPERTY_AUTH_TYPE_WSSE = "org.jboss.ws.authType.wsse";
+ /** Enable MTOM on the stub */
+ static final String PROPERTY_MTOM_ENABLED= "org.jboss.ws.mtom.enabled";
+
+ /**
+ * Get the endpoint meta data for this stub
+ */
+ EndpointMetaData getEndpointMetaData();
+
+ /**
+ * Add a header that is not bound to an input parameter.
+ * A propriatory extension, that is not part of JAXRPC.
+ *
+ * @param xmlName The XML name of the header element
+ * @param xmlType The XML type of the header element
+ */
+ void addUnboundHeader(QName xmlName, QName xmlType, Class javaType, ParameterMode
mode);
+
+ /**
+ * Get the header value for the given XML name.
+ * A propriatory extension, that is not part of JAXRPC.
+ *
+ * @param xmlName The XML name of the header element
+ * @return The header value, or null
+ */
+ Object getUnboundHeaderValue(QName xmlName);
+
+ /**
+ * Set the header value for the given XML name.
+ * A propriatory extension, that is not part of JAXRPC.
+ *
+ * @param xmlName The XML name of the header element
+ */
+ void setUnboundHeaderValue(QName xmlName, Object value);
+
+ /**
+ * Clear all registered headers.
+ * A propriatory extension, that is not part of JAXRPC.
+ */
+ void clearUnboundHeaders();
+
+ /**
+ * Remove the header for the given XML name.
+ * A propriatory extension, that is not part of JAXRPC.
+ */
+ void removeUnboundHeader(QName xmlName);
+
+ /**
+ * Get an Iterator over the registered header XML names.
+ * A propriatory extension, that is not part of JAXRPC.
+ */
+ Iterator getUnboundHeaders();
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Style.java (from
rev 1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/Style.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/Style.java 2006-12-06
01:10:43 UTC (rev 1564)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Style.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+/** A type-safe enumeration for encoding style.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Oct-2004
+ */
+public class Style
+{
+ private String style;
+
+ public static final Style RPC = new Style("rpc");
+ public static final Style DOCUMENT = new Style("document");
+
+ private Style(String style)
+ {
+ this.style = style;
+ }
+
+ public static Style getDefaultStyle()
+ {
+ return DOCUMENT;
+ }
+
+ public static Style valueOf(String style)
+ {
+ if (RPC.style.equals(style))
+ return RPC;
+ if (DOCUMENT.style.equals(style))
+ return DOCUMENT;
+
+ throw new IllegalArgumentException("Unsupported style: " + style);
+ }
+
+ public String toString()
+ {
+ return style;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java (from
rev 1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/TypeMappingImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/TypeMappingImpl.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,624 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.encoding.DeserializerFactory;
+import javax.xml.rpc.encoding.SerializerFactory;
+import javax.xml.rpc.encoding.TypeMapping;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.jaxrpc.encoding.Base64DeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.Base64SerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.CalendarDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.CalendarSerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.DateDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.DateSerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.HexDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.HexSerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.QNameDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.QNameSerializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.SimpleDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.SimpleSerializerFactory;
+
+/**
+ * This is the representation of a type mapping.
+ * This TypeMapping implementation supports the literal encoding style.
+ *
+ * The TypeMapping instance maintains a tuple of the type
+ * {XML typeQName, Java Class, SerializerFactory, DeserializerFactory}.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public abstract class TypeMappingImpl implements TypeMapping
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(TypeMappingImpl.class);
+
+ // Map<KeyPair,FactoryPair>
+ private Map<KeyPair, FactoryPair> tupleMap = new LinkedHashMap<KeyPair,
FactoryPair>();
+
+ /**
+ * Gets the DeserializerFactory registered for the specified pair of Java type and XML
data type.
+ * @param javaType Class of the Java type
+ * @param xmlType QName of the XML type
+ * @return Registered DeserializerFactory or null if there is no registered factory
+ */
+ public DeserializerFactory getDeserializer(Class javaType, QName xmlType)
+ {
+ FactoryPair fPair = getFactoryPair(xmlType, javaType);
+ return (fPair != null ? fPair.getDeserializerFactory() : null);
+ }
+
+ /**
+ * Gets the SerializerFactory registered for the specified pair of Java type and XML
data type.
+ * @param javaType Class of the Java type
+ * @param xmlType QName of the XML type
+ * @return Registered SerializerFactory or null if there is no registered factory
+ */
+ public SerializerFactory getSerializer(Class javaType, QName xmlType)
+ {
+ FactoryPair fPair = getFactoryPair(xmlType, javaType);
+ return (fPair != null ? fPair.getSerializerFactory() : null);
+ }
+
+ /**
+ * Returns the encodingStyle URIs (as String[]) supported by this TypeMapping
instance.
+ * A TypeMapping that contains only encoding style independent serializers and
deserializers
+ * returns null from this method.
+ *
+ * @return Array of encodingStyle URIs for the supported encoding styles
+ */
+ public abstract String[] getSupportedEncodings();
+
+ /**
+ * Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping
that contains only encoding
+ * independent serializers and deserializers requires null as the parameter for this
method.
+ *
+ * @param encodingStyleURIs Array of encodingStyle URIs for the supported encoding
styles
+ */
+ public abstract void setSupportedEncodings(String[] encodingStyleURIs);
+
+ /**
+ * Checks whether or not type mapping between specified XML type and Java type is
registered.
+ * @param javaType Class of the Java type
+ * @param xmlType QName of the XML type
+ * @return boolean; true if type mapping between the specified XML type and Java type
is registered; otherwise false
+ */
+ public boolean isRegistered(Class javaType, QName xmlType)
+ {
+ return getFactoryPair(xmlType, javaType) != null;
+ }
+
+ /**
+ * Registers SerializerFactory and DeserializerFactory for a specific type mapping
between an XML type and Java type.
+ * This method replaces any existing registered SerializerFactory DeserializerFactory
instances.
+ * @param javaType Class of the Java type
+ * @param xmlType QName of the XML type
+ * @param sf SerializerFactory
+ * @param df DeserializerFactory
+ * @throws javax.xml.rpc.JAXRPCException If any error during the registration
+ */
+ public void register(Class javaType, QName xmlType, SerializerFactory sf,
DeserializerFactory df)
+ {
+ log.debug("register: TypeMappingImpl@" + hashCode() + "
[xmlType=" + xmlType + ",javaType=" + javaType.getName() + ",sf="
+ sf + ",df=" + df + "]");
+ registerInternal(javaType, xmlType, sf, df);
+ }
+
+ void registerInternal(Class javaType, QName xmlType, SerializerFactory sf,
DeserializerFactory df)
+ {
+ if (javaType == null)
+ throw new IllegalArgumentException("javaType cannot be null for: " +
xmlType);
+ if (xmlType == null)
+ throw new IllegalArgumentException("xmlType cannot be null for: " +
javaType);
+
+ KeyPair kPair = new KeyPair(xmlType, javaType);
+ FactoryPair fPair = new FactoryPair(sf, df);
+ tupleMap.put(kPair, fPair);
+ }
+
+ /**
+ * Removes the DeserializerFactory registered for the specified pair of Java type and
XML data type.
+ * @param javaType Class of the Java type
+ * @param xmlType QName of the XML type
+ * @throws javax.xml.rpc.JAXRPCException If there is error in removing the registered
DeserializerFactory
+ */
+ public void removeDeserializer(Class javaType, QName xmlType)
+ {
+ FactoryPair fPair = getFactoryPair(xmlType, javaType);
+ if (fPair != null)
+ fPair.setDeserializerFactory(null);
+ }
+
+ /**
+ * Removes the SerializerFactory registered for the specified pair of Java type and
XML data type.
+ * @param javaType Class of the Java type
+ * @param xmlType QName of the XML type
+ * @throws javax.xml.rpc.JAXRPCException If there is error in removing the registered
SerializerFactory
+ */
+ public void removeSerializer(Class javaType, QName xmlType)
+ {
+ FactoryPair fPair = getFactoryPair(xmlType, javaType);
+ if (fPair != null)
+ fPair.setSerializerFactory(null);
+ }
+
+ /** Get the list of registered XML types */
+ public List<QName> getRegisteredXmlTypes()
+ {
+ List<QName> types = new ArrayList<QName>();
+ for (KeyPair keyPair : getKeyPairs(null, null))
+ {
+ types.add(keyPair.getXmlType());
+ }
+ return types;
+ }
+
+ /** Get the list of registered Java types */
+ public List<Class> getRegisteredJavaTypes()
+ {
+ List<Class> types = new ArrayList<Class>();
+ for (KeyPair keyPair : getKeyPairs(null, null))
+ {
+ types.add(keyPair.getJavaType());
+ }
+ return types;
+ }
+
+ /** Get the Class that was registered last for this xmlType */
+ public Class getJavaType(QName xmlType)
+ {
+ Class javaType = null;
+
+ List keyPairList = getKeyPairs(xmlType, null);
+ int size = keyPairList.size();
+ if (size > 0)
+ {
+ KeyPair kPair = (KeyPair)keyPairList.get(size - 1);
+ javaType = kPair.getJavaType();
+ }
+
+ return javaType;
+ }
+
+ /**
+ * Get all of the Classes registered for this xmlType.
+ */
+ public List<Class> getJavaTypes(QName xmlType)
+ {
+ List<KeyPair> keyPairList = getKeyPairs(xmlType, null);
+ List<Class> classes = new ArrayList<Class>(keyPairList.size());
+
+ for (KeyPair current : keyPairList)
+ {
+ classes.add(current.getJavaType());
+ }
+
+ return classes;
+ }
+
+ /**
+ * Get the Class that was registered last for this xmlType
+ * If there are two Java Types registered for the xmlType
+ * return the primitive type rather than the wrapper,
+ * if available
+ */
+ public Class getJavaType(QName xmlType,boolean getPrimitive)
+ {
+ //Lets get the primitive type if available
+ Class javaType = null;
+
+ List keyPairList = getKeyPairs(xmlType, null);
+ int size = keyPairList.size();
+ if (size == 2 && getPrimitive)
+ {
+ KeyPair kPair1 = (KeyPair)keyPairList.get(0);
+ Class javaType1 = kPair1.getJavaType();
+ KeyPair kPair2 = (KeyPair)keyPairList.get(1);
+ Class javaType2 = kPair2.getJavaType();
+ if(javaType2.isPrimitive() && !javaType1.isPrimitive())
+ javaType = javaType2;
+ else
+ if(javaType1.isPrimitive() && !javaType2.isPrimitive())
+ javaType = javaType1;
+ else
+ javaType = javaType2; //Fallback on the most latest
+ }
+ else
+ return getJavaType(xmlType);
+
+ return javaType;
+ }
+
+ /** Get the Class name that was registered last for this xmlType */
+ public String getJavaTypeName(QName xmlType)
+ {
+ Class javaType = getJavaType(xmlType);
+ return (javaType != null ? javaType.getName() : null);
+ }
+
+ /** Get the QName that was registered last for this javaType */
+ public QName getXMLType(Class javaType)
+ {
+ QName xmlType = null;
+
+ List keyPairList = getKeyPairs(null, javaType);
+ int size = keyPairList.size();
+ if (size > 0)
+ {
+ KeyPair kPair = (KeyPair)keyPairList.get(size - 1);
+ xmlType = kPair.getXmlType();
+ }
+
+ return xmlType;
+ }
+
+ /**
+ * Get the QName that was registered last for this javaType
+ * @param javaType class for which XML Type is needed
+ * @param tryAssignable If the xmlType is not registered for javaType
+ * should a base class type be checked?
+ *
+ */
+ public QName getXMLType(Class javaType, boolean tryAssignable)
+ {
+ if(tryAssignable) return getXMLType(javaType);
+
+ QName xmlType = null;
+
+ List keyPairList = getKeyPairs(null, javaType, tryAssignable);
+ int size = keyPairList.size();
+ if (size > 0)
+ {
+ KeyPair kPair = (KeyPair)keyPairList.get(size - 1);
+ xmlType = kPair.getXmlType();
+ }
+
+ return xmlType;
+ }
+
+ /**
+ * Get the serializer/deserializer factory pair for the given xmlType, javaType
+ * Both xmlType, javaType may be null. In that case, this implementation still
+ * returns a FactoryPair if there is only one possible match.
+ */
+ List<KeyPair> getKeyPairs(QName xmlType, Class javaType)
+ {
+ List<KeyPair> keyPairList = new ArrayList<KeyPair>();
+
+ // Getting the exact matching pair
+ if (xmlType != null && javaType != null)
+ {
+ for (KeyPair entry : tupleMap.keySet())
+ {
+ if (xmlType.equals(entry.getXmlType()) && entry.getJavaType() ==
javaType)
+ {
+ keyPairList.add(entry);
+ }
+ }
+ // No exact match, try assignable
+ if (keyPairList.size() == 0)
+ {
+ for (KeyPair entry : tupleMap.keySet())
+ {
+ if (xmlType.equals(entry.getXmlType()) &&
JavaUtils.isAssignableFrom(entry.getJavaType(), javaType))
+ {
+ keyPairList.add(entry);
+ }
+ }
+ }
+ }
+
+ // Getting the pair for a given xmlType
+ else if (xmlType != null && javaType == null)
+ {
+ for (KeyPair entry : tupleMap.keySet())
+ {
+ if (xmlType.equals(entry.getXmlType()))
+ {
+ keyPairList.add(entry);
+ }
+ }
+ }
+
+ // Getting the pair for a given javaType
+ else if (xmlType == null && javaType != null)
+ {
+ for (KeyPair entry : tupleMap.keySet())
+ {
+ if (entry.getJavaType() == javaType)
+ {
+ keyPairList.add(entry);
+ }
+ }
+ // No exact match, try assignable
+ if (keyPairList.size() == 0)
+ {
+ for (KeyPair entry : tupleMap.keySet())
+ {
+ if (JavaUtils.isAssignableFrom(entry.getJavaType(), javaType))
+ {
+ keyPairList.add(entry);
+ }
+ }
+ }
+ }
+
+ // Getting the all pairs
+ else if (xmlType == null && javaType == null)
+ {
+ keyPairList.addAll(tupleMap.keySet());
+ }
+
+ return keyPairList;
+ }
+
+ /**
+ * Get the serializer/deserializer factory pair for the given xmlType, javaType
+ * Both xmlType, javaType may be null. In that case, this implementation still
+ * returns a FactoryPair if there is only one possible match.
+ * <br>Note: This method does not try for the base class, if no keypair exists
for the
+ * javaType in question.
+ */
+ List<KeyPair> getKeyPairs(QName xmlType, Class javaType, boolean tryAssignable)
+ {
+ if(tryAssignable) return getKeyPairs( xmlType, javaType);
+
+ List<KeyPair> keyPairList = new ArrayList<KeyPair>();
+
+ // Getting the exact matching pair
+ if (xmlType != null && javaType != null)
+ {
+ for (KeyPair entry : tupleMap.keySet())
+ {
+ if (xmlType.equals(entry.getXmlType()) && entry.getJavaType() ==
javaType)
+ {
+ keyPairList.add(entry);
+ }
+ }
+ }
+
+ // Getting the pair for a given xmlType
+ else if (xmlType != null && javaType == null)
+ {
+ for (KeyPair entry : tupleMap.keySet())
+ {
+ if (xmlType.equals(entry.getXmlType()))
+ {
+ keyPairList.add(entry);
+ }
+ }
+ }
+
+ // Getting the pair for a given javaType
+ else if (xmlType == null && javaType != null)
+ {
+ for (KeyPair entry : tupleMap.keySet())
+ {
+ if (entry.getJavaType() == javaType)
+ {
+ keyPairList.add(entry);
+ }
+ }
+ }
+
+ // Getting the all pairs
+ else if (xmlType == null && javaType == null)
+ {
+ keyPairList.addAll(tupleMap.keySet());
+ }
+
+ return keyPairList;
+ }
+
+ /**
+ * Get the serializer/deserializer factory pair for the given xmlType, javaType
+ * Both xmlType, javaType may be null. In that case, this implementation still
+ * returns a FactoryPair that was last registered
+ */
+ FactoryPair getFactoryPair(QName xmlType, Class javaType)
+ {
+ FactoryPair fPair = null;
+
+ List<KeyPair> keyPairList = getKeyPairs(xmlType, javaType);
+ int size = keyPairList.size();
+ if (size > 0)
+ {
+ KeyPair kPair = keyPairList.get(size - 1);
+ fPair = (FactoryPair)tupleMap.get(kPair);
+ }
+
+ return fPair;
+ }
+
+ protected void registerStandardLiteralTypes()
+ {
+ registerInternal(BigDecimal.class, Constants.TYPE_LITERAL_DECIMAL, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(BigInteger.class, Constants.TYPE_LITERAL_POSITIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_LITERAL_NEGATIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_LITERAL_NONPOSITIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_LITERAL_NONNEGATIVEINTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_LITERAL_UNSIGNEDLONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_LITERAL_INTEGER, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(Date.class, Constants.TYPE_LITERAL_DATETIME, new
DateSerializerFactory(), new DateDeserializerFactory());
+
+ registerInternal(Calendar.class, Constants.TYPE_LITERAL_DATE, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
+ registerInternal(Calendar.class, Constants.TYPE_LITERAL_TIME, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
+ registerInternal(Calendar.class, Constants.TYPE_LITERAL_DATETIME, new
CalendarSerializerFactory(), new CalendarDeserializerFactory());
+
+ registerInternal(QName.class, Constants.TYPE_LITERAL_QNAME, new
QNameSerializerFactory(), new QNameDeserializerFactory());
+
+ registerInternal(String.class, Constants.TYPE_LITERAL_ANYSIMPLETYPE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_DURATION, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_GDAY, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_GMONTH, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_GMONTHDAY, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_GYEAR, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_GYEARMONTH, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_ID, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_LANGUAGE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_NAME, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_NCNAME, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_NMTOKEN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_NORMALIZEDSTRING, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_TOKEN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_LITERAL_STRING, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(String[].class, Constants.TYPE_LITERAL_NMTOKENS, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(URI.class, Constants.TYPE_LITERAL_ANYURI, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(boolean.class, Constants.TYPE_LITERAL_BOOLEAN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Boolean.class, Constants.TYPE_LITERAL_BOOLEAN, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(byte.class, Constants.TYPE_LITERAL_BYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Byte.class, Constants.TYPE_LITERAL_BYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(Byte[].class, Constants.TYPE_LITERAL_HEXBINARY, new
HexSerializerFactory(), new HexDeserializerFactory());
+ registerInternal(byte[].class, Constants.TYPE_LITERAL_HEXBINARY, new
HexSerializerFactory(), new HexDeserializerFactory());
+
+ registerInternal(Byte[].class, Constants.TYPE_LITERAL_BASE64BINARY, new
Base64SerializerFactory(), new Base64DeserializerFactory());
+ registerInternal(byte[].class, Constants.TYPE_LITERAL_BASE64BINARY, new
Base64SerializerFactory(), new Base64DeserializerFactory());
+
+ registerInternal(double.class, Constants.TYPE_LITERAL_DOUBLE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Double.class, Constants.TYPE_LITERAL_DOUBLE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(float.class, Constants.TYPE_LITERAL_FLOAT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Float.class, Constants.TYPE_LITERAL_FLOAT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(int.class, Constants.TYPE_LITERAL_UNSIGNEDSHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Integer.class, Constants.TYPE_LITERAL_UNSIGNEDSHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(int.class, Constants.TYPE_LITERAL_INT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Integer.class, Constants.TYPE_LITERAL_INT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(long.class, Constants.TYPE_LITERAL_UNSIGNEDINT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Long.class, Constants.TYPE_LITERAL_UNSIGNEDINT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(long.class, Constants.TYPE_LITERAL_LONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Long.class, Constants.TYPE_LITERAL_LONG, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(short.class, Constants.TYPE_LITERAL_UNSIGNEDBYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Short.class, Constants.TYPE_LITERAL_UNSIGNEDBYTE, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(short.class, Constants.TYPE_LITERAL_SHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Short.class, Constants.TYPE_LITERAL_SHORT, new
SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ }
+
+ /** A tuple of the type {XML typeQName, Java Class, SerializerFactory,
DeserializerFactory}.
+ */
+ public static class KeyPair
+ {
+ private QName xmlType;
+ private Class javaType;
+
+ public KeyPair(QName xmlType, Class javaType)
+ {
+ this.javaType = javaType;
+ this.xmlType = xmlType;
+ }
+
+ public Class getJavaType()
+ {
+ return javaType;
+ }
+
+ public QName getXmlType()
+ {
+ return xmlType;
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (!(o instanceof KeyPair)) return false;
+
+ final KeyPair keyPair = (KeyPair)o;
+
+ if (!javaType.equals(keyPair.javaType)) return false;
+ if (!xmlType.equals(keyPair.xmlType)) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = xmlType.hashCode();
+ result = 29 * result + javaType.hashCode();
+ return result;
+ }
+
+ public String toString()
+ {
+ return "[xmlType=" + xmlType + ",javaType=" +
javaType.getName() + "]";
+ }
+ }
+
+ /** A tuple of the type {XML typeQName, Java Class, SerializerFactory,
DeserializerFactory}.
+ */
+ public static class FactoryPair
+ {
+ private SerializerFactory serializerFactory;
+ private DeserializerFactory deserializerFactory;
+
+ FactoryPair(SerializerFactory sf, DeserializerFactory df)
+ {
+ this.deserializerFactory = df;
+ this.serializerFactory = sf;
+ }
+
+ public DeserializerFactory getDeserializerFactory()
+ {
+ return deserializerFactory;
+ }
+
+ public SerializerFactory getSerializerFactory()
+ {
+ return serializerFactory;
+ }
+
+ public void setDeserializerFactory(DeserializerFactory df)
+ {
+ this.deserializerFactory = df;
+ }
+
+ public void setSerializerFactory(SerializerFactory sf)
+ {
+ this.serializerFactory = sf;
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/TypeMappingRegistryImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/TypeMappingRegistryImpl.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,164 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.encoding.TypeMapping;
+import javax.xml.rpc.encoding.TypeMappingRegistry;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.common.Constants;
+
+/**
+ * This defines a registry of TypeMapping instances for encoding styles.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class TypeMappingRegistryImpl implements TypeMappingRegistry
+{
+ // The registered typeMapping for the literal encoding style
+ private Map<String, TypeMappingImpl> typeMappings = new HashMap<String,
TypeMappingImpl>();
+
+ public TypeMappingRegistryImpl()
+ {
+ typeMappings.put(Constants.URI_LITERAL_ENC, new LiteralTypeMapping());
+ typeMappings.put(Constants.URI_SOAP11_ENC, new EncodedTypeMapping());
+ }
+
+ /**
+ * Removes all registered TypeMappings and encodingStyleURIs from this
TypeMappingRegistry.
+ */
+ public void clear()
+ {
+ typeMappings.clear();
+ }
+
+ /**
+ * Gets the registered default TypeMapping instance.
+ * This method returns null if there is no registered default TypeMapping in the
registry.
+ * @return The registered default TypeMapping instance or null
+ */
+ public TypeMapping getDefaultTypeMapping()
+ {
+ return typeMappings.get(Constants.URI_LITERAL_ENC);
+ }
+
+ /**
+ * Registers the TypeMapping instance that is default for all encoding styles
supported by the TypeMappingRegistry.
+ * A default TypeMapping should include serializers and deserializers that are
independent of and usable with any
+ * encoding style. Successive invocations of the registerDefault method replace any
existing default TypeMapping instance.
+ *
+ * If the default TypeMapping is registered, any other TypeMapping instances
registered through the
+ * TypeMappingRegistry.register method (for a set of encodingStyle URIs) override the
default TypeMapping.
+ *
+ * @param mapping TypeMapping instance
+ * @throws javax.xml.rpc.JAXRPCException If there is an error in the registration of
the default TypeMapping
+ */
+ public void registerDefault(TypeMapping mapping)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Creates a new empty TypeMapping object.
+ * @return TypeMapping instance
+ */
+ public TypeMapping createTypeMapping()
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Returns the registered TypeMapping for the specified encodingStyle URI. If there is
no registered TypeMapping for
+ * the specified encodingStyleURI, this method returns null.
+ * @param encodingStyleURI Encoding style specified as an URI
+ * @return TypeMapping for the specified encodingStyleURI or null
+ */
+ public TypeMapping getTypeMapping(String encodingStyleURI)
+ {
+ assertEncodingStyle(encodingStyleURI);
+ return typeMappings.get(encodingStyleURI);
+ }
+
+ /**
+ * Returns a list of registered encodingStyle URIs in this TypeMappingRegistry
instance.
+ * @return Array of the registered encodingStyle URIs
+ */
+ public String[] getRegisteredEncodingStyleURIs()
+ {
+ return new String[]{Constants.URI_LITERAL_ENC, Constants.URI_SOAP11_ENC};
+ }
+
+ /**
+ * Registers a TypeMapping instance with the TypeMappingRegistry.
+ * This method replaces any existing registered TypeMapping instance for the specified
encodingStyleURI.
+ *
+ * @param encodingStyleURI An encoding style specified as an URI.
+ * @param mapping TypeMapping instance
+ * @return Previous TypeMapping associated with the specified encodingStyleURI, or
null if there was no
+ * TypeMapping associated with the specified encodingStyleURI
+ * @throws javax.xml.rpc.JAXRPCException If there is an error in the registration of
the TypeMapping for the specified encodingStyleURI.
+ */
+ public TypeMapping register(String encodingStyleURI, TypeMapping mapping)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Unregisters a TypeMapping instance, if present, from the specified
encodingStyleURI.
+ * @param encodingStyleURI Encoding style specified as an URI
+ * @return TypeMapping instance that has been unregistered or null if there was no
+ * TypeMapping registered for the specified encodingStyleURI
+ */
+ public TypeMapping unregisterTypeMapping(String encodingStyleURI)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Removes a TypeMapping from the TypeMappingRegistry.
+ * A TypeMapping is associated with 1 or more encodingStyleURIs. This method
unregisters the specified
+ * TypeMapping instance from all associated encodingStyleURIs and then removes this
TypeMapping
+ * instance from the registry.
+ *
+ * @param mapping TypeMapping to be removed
+ * @return true if specified TypeMapping is removed from the TypeMappingRegistry;
+ * false if the specified TypeMapping was not in the TypeMappingRegistry
+ */
+ public boolean removeTypeMapping(TypeMapping mapping)
+ {
+ throw new NotImplementedException();
+ }
+
+ /** Assert the literal encoding style */
+ private void assertEncodingStyle(String encURI)
+ {
+ if (Constants.URI_LITERAL_ENC.equals(encURI) == false &&
Constants.URI_SOAP11_ENC.equals(encURI) == false)
+ throw new JAXRPCException("Unsupported encoding style: " + encURI);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedCallParameter.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedCallParameter.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+/**
+ * This type is used in DII clients that do not qualify the call parameter with a java
type.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 02-Aug-2005
+ */
+public class UnqualifiedCallParameter
+{
+ private QName xmlType;
+
+ public UnqualifiedCallParameter(QName xmlType)
+ {
+ this.xmlType = xmlType;
+ }
+
+ public String toString()
+ {
+ return getClass().getName() + "[xmlType=" + xmlType +"]";
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedFaultException.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedFaultException.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+/**
+ * This type is used in when there is no XML/Java mapping available.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 02-Aug-2005
+ */
+public class UnqualifiedFaultException extends Exception
+{
+ private QName xmlType;
+
+ public UnqualifiedFaultException(QName xmlType)
+ {
+ this.xmlType = xmlType;
+ }
+
+ public String toString()
+ {
+ return getClass().getName() + "[xmlType=" + xmlType +"]";
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java (from rev
1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/Use.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/Use.java 2006-12-06 01:10:43
UTC (rev 1564)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+import org.jboss.ws.common.Constants;
+
+// $Id$
+
+/** A type-safe enumeration for encoding use.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-Oct-2005
+ */
+public class Use
+{
+ private String use;
+
+ public static final Use LITERAL = new Use("literal");
+ public static final Use ENCODED = new Use("encoded");
+
+ private Use(String use)
+ {
+ this.use = use;
+ }
+
+ public static Use getDefaultUse()
+ {
+ return LITERAL;
+ }
+
+ public static Use valueOf(String encodingStyle)
+ {
+ if (Constants.URI_LITERAL_ENC.equals(encodingStyle) ||
LITERAL.use.equals(encodingStyle))
+ return LITERAL;
+ if (Constants.URI_SOAP11_ENC.equals(encodingStyle) ||
ENCODED.use.equals(encodingStyle))
+ return ENCODED;
+
+ throw new IllegalArgumentException("Unsupported encoding style: " +
encodingStyle);
+ }
+
+ public String toURI()
+ {
+ String encURI = null;
+ if (this == LITERAL)
+ encURI = Constants.URI_LITERAL_ENC;
+ else if (this == ENCODED)
+ encURI = Constants.URI_SOAP11_ENC;
+ return encURI;
+ }
+
+ public String toString()
+ {
+ return use;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding (from rev
1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Deserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Deserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,79 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.extras.xop.XOPContext;
-import org.jboss.ws.extras.xop.jaxrpc.XOPUnmarshallerImpl;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
-import org.w3c.dom.Element;
-
-import java.io.IOException;
-/**
- * Deserializer for Base64
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class Base64Deserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(Base64Deserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- byte[] value = null;
-
- String valueStr = unwrapValueStr(xmlFragment);
- if(XOPContext.isXOPMessage())
- {
- try
- {
- Element xopInclude = DOMUtils.parse(valueStr);
- String cid = xopInclude.getAttribute("href");
- XOPUnmarshaller xopUnmarshaller = new XOPUnmarshallerImpl();
- value = xopUnmarshaller.getAttachmentAsByteArray(cid);
- }
- catch (IOException e)
- {
- throw new WSException("Failed to parse xopInclude element");
- }
- }
- else if (valueStr != null)
- {
- value = SimpleTypeBindings.unmarshalBase64(valueStr);
- }
- return value;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Deserializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Deserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,79 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.extras.xop.XOPContext;
+import org.jboss.ws.extras.xop.jaxrpc.XOPUnmarshallerImpl;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
+import org.w3c.dom.Element;
+
+import java.io.IOException;
+/**
+ * Deserializer for Base64
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class Base64Deserializer extends DeserializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(Base64Deserializer.class);
+
+ public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
+ {
+ log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ byte[] value = null;
+
+ String valueStr = unwrapValueStr(xmlFragment);
+ if(XOPContext.isXOPMessage())
+ {
+ try
+ {
+ Element xopInclude = DOMUtils.parse(valueStr);
+ String cid = xopInclude.getAttribute("href");
+ XOPUnmarshaller xopUnmarshaller = new XOPUnmarshallerImpl();
+ value = xopUnmarshaller.getAttachmentAsByteArray(cid);
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to parse xopInclude element");
+ }
+ }
+ else if (valueStr != null)
+ {
+ value = SimpleTypeBindings.unmarshalBase64(valueStr);
+ }
+ return value;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64DeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64DeserializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64DeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * DeserializerFactory for base64.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class Base64DeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new Base64Deserializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64DeserializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64DeserializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64DeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64DeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.DeserializerSupport;
+
+// $Id$
+
+
+/**
+ * DeserializerFactory for base64.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class Base64DeserializerFactory extends DeserializerFactoryBase
+{
+ public DeserializerSupport getDeserializer()
+ {
+ return new Base64Deserializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Serializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Serializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,76 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.ws.extras.xop.XOPContext;
-import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
-import org.jboss.xb.binding.sunday.xop.XOPObject;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Serializer for base64
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class Base64Serializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(Base64Serializer.class);
-
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- String xmlFragment = null;
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
-
- if(XOPContext.isXOPMessage())
- {
- XOPMarshaller xopMarshaller = new XOPMarshallerImpl();
- XOPObject xopObject = new XOPObject(value);
- xopObject.setContentType("application/octet-stream");
- String cid = xopMarshaller.addMtomAttachment(xopObject,
xmlName.getNamespaceURI(), xmlType.getLocalPart() );
- String xopInclude = "<xop:Include
xmlns:xop='http://www.w3.org/2004/08/xop/include'
href='"+cid+"'/>";
- xmlFragment = wrapValueStr(xmlName, xopInclude, nsRegistry, attributes, false);
- }
- else
- {
- value = JavaUtils.getPrimitiveValueArray(value);
- String valueStr = SimpleTypeBindings.marshalBase64((byte[])value);
- xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes, true);
- }
- return xmlFragment;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Serializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Serializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,76 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.ws.extras.xop.XOPContext;
+import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
+import org.jboss.xb.binding.sunday.xop.XOPObject;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * Serializer for base64
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class Base64Serializer extends SerializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(Base64Serializer.class);
+
+ public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ String xmlFragment = null;
+ NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
+
+ if(XOPContext.isXOPMessage())
+ {
+ XOPMarshaller xopMarshaller = new XOPMarshallerImpl();
+ XOPObject xopObject = new XOPObject(value);
+ xopObject.setContentType("application/octet-stream");
+ String cid = xopMarshaller.addMtomAttachment(xopObject,
xmlName.getNamespaceURI(), xmlType.getLocalPart() );
+ String xopInclude = "<xop:Include
xmlns:xop='http://www.w3.org/2004/08/xop/include'
href='"+cid+"'/>";
+ xmlFragment = wrapValueStr(xmlName, xopInclude, nsRegistry, attributes, false);
+ }
+ else
+ {
+ value = JavaUtils.getPrimitiveValueArray(value);
+ String valueStr = SimpleTypeBindings.marshalBase64((byte[])value);
+ xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes, true);
+ }
+ return xmlFragment;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64SerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64SerializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64SerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * SerializerFactory for base64Binary.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class Base64SerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new Base64Serializer();
- }
-}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64SerializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64SerializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64SerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64SerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.SerializerSupport;
+
+// $Id$
+
+
+/**
+ * SerializerFactory for base64Binary.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class Base64SerializerFactory extends SerializerFactoryBase
+{
+ public SerializerSupport getSerializer()
+ {
+ return new Base64Serializer();
+ }
+}
\ No newline at end of file
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarDeserializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,60 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import java.util.Calendar;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.xb.binding.SimpleTypeBindings;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- * @see <a
href="http://www.w3.org/TR/xmlschema-2/#dateTime">XML Schema
3.2.16</a>
- */
-public class CalendarDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(CalendarDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- Calendar value = null;
-
- String valueStr = unwrapValueStr(xmlFragment);
- if (valueStr != null)
- {
- value = SimpleTypeBindings.unmarshalDateTime(valueStr);
- }
-
- return value;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarDeserializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarDeserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import java.util.Calendar;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.xb.binding.SimpleTypeBindings;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ * @see <a
href="http://www.w3.org/TR/xmlschema-2/#dateTime">XML Schema
3.2.16</a>
+ */
+public class CalendarDeserializer extends DeserializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(CalendarDeserializer.class);
+
+ public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
+ {
+ log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ Calendar value = null;
+
+ String valueStr = unwrapValueStr(xmlFragment);
+ if (valueStr != null)
+ {
+ value = SimpleTypeBindings.unmarshalDateTime(valueStr);
+ }
+
+ return value;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarDeserializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,42 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * A CalendarDeserializer Factory
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class CalendarDeserializerFactory extends DeserializerFactoryBase
-{
-
- public DeserializerSupport getDeserializer()
- {
- return new CalendarDeserializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarDeserializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarDeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.DeserializerSupport;
+
+// $Id$
+
+
+/**
+ * A CalendarDeserializer Factory
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class CalendarDeserializerFactory extends DeserializerFactoryBase
+{
+
+ public DeserializerSupport getDeserializer()
+ {
+ return new CalendarDeserializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarSerializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,58 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import java.util.Calendar;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- * @see <a
href="http://www.w3.org/TR/xmlschema-2/#dateTime">XML Schema
3.2.16</a>
- */
-public class CalendarSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(CalendarSerializer.class);
-
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- String valueStr = SimpleTypeBindings.marshalDateTime((Calendar)value);
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
- return xmlFragment;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarSerializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarSerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import java.util.Calendar;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ * @see <a
href="http://www.w3.org/TR/xmlschema-2/#dateTime">XML Schema
3.2.16</a>
+ */
+public class CalendarSerializer extends SerializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(CalendarSerializer.class);
+
+ public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ String valueStr = SimpleTypeBindings.marshalDateTime((Calendar)value);
+
+ NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
+ String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
+ return xmlFragment;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarSerializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,39 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class CalendarSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new CalendarSerializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarSerializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarSerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.SerializerSupport;
+
+// $Id$
+
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class CalendarSerializerFactory extends SerializerFactoryBase
+{
+ public SerializerSupport getSerializer()
+ {
+ return new CalendarSerializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateDeserializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,61 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.xb.binding.SimpleTypeBindings;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class DateDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(DateDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- Date value = null;
-
- String valueStr = unwrapValueStr(xmlFragment);
- if (valueStr != null)
- {
- Calendar cal = SimpleTypeBindings.unmarshalDateTime(valueStr);
- value = cal.getTime();
- }
-
- return value;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateDeserializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateDeserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.xb.binding.SimpleTypeBindings;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class DateDeserializer extends DeserializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(DateDeserializer.class);
+
+ public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
+ {
+ log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ Date value = null;
+
+ String valueStr = unwrapValueStr(xmlFragment);
+ if (valueStr != null)
+ {
+ Calendar cal = SimpleTypeBindings.unmarshalDateTime(valueStr);
+ value = cal.getTime();
+ }
+
+ return value;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateDeserializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * A DateDeserializer Factory
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class DateDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new DateDeserializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateDeserializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateDeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.DeserializerSupport;
+
+// $Id$
+
+
+/**
+ * A DateDeserializer Factory
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class DateDeserializerFactory extends DeserializerFactoryBase
+{
+ public DeserializerSupport getDeserializer()
+ {
+ return new DateDeserializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateSerializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,68 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Serializer for Dates.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- * @see <a
href="http://www.w3.org/TR/xmlschema-2/#dateTime">XML Schema
3.2.16</a>
- */
-public class DateSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(DateSerializer.class);
-
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- if (value != null)
- {
- Calendar cal = new GregorianCalendar();
- cal.setTime((Date)value);
- value = cal;
- }
-
- String valueStr = SimpleTypeBindings.marshalDateTime((Calendar)value);
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
- return xmlFragment;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateSerializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateSerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * Serializer for Dates.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ * @see <a
href="http://www.w3.org/TR/xmlschema-2/#dateTime">XML Schema
3.2.16</a>
+ */
+public class DateSerializer extends SerializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(DateSerializer.class);
+
+ public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+ if (value != null)
+ {
+ Calendar cal = new GregorianCalendar();
+ cal.setTime((Date)value);
+ value = cal;
+ }
+
+ String valueStr = SimpleTypeBindings.marshalDateTime((Calendar)value);
+
+ NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
+ String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
+ return xmlFragment;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateSerializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * SerializerFactory for Date primitives
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class DateSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new DateSerializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateSerializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DateSerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.SerializerSupport;
+
+// $Id$
+
+
+/**
+ * SerializerFactory for Date primitives
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class DateSerializerFactory extends SerializerFactoryBase
+{
+ public SerializerSupport getSerializer()
+ {
+ return new DateSerializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DeserializerFactoryBase.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DeserializerFactoryBase.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DeserializerFactoryBase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,52 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import java.util.Iterator;
-
-import javax.xml.rpc.encoding.Deserializer;
-import javax.xml.rpc.encoding.DeserializerFactory;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public abstract class DeserializerFactoryBase implements DeserializerFactory
-{
- public abstract DeserializerSupport getDeserializer() throws BindingException;
-
- public Deserializer getDeserializerAs(String mechanismType)
- {
- throw new NotImplementedException();
- }
-
- public Iterator getSupportedMechanismTypes()
- {
- throw new NotImplementedException();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DeserializerFactoryBase.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DeserializerFactoryBase.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/DeserializerFactoryBase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DeserializerFactoryBase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import java.util.Iterator;
+
+import javax.xml.rpc.encoding.Deserializer;
+import javax.xml.rpc.encoding.DeserializerFactory;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public abstract class DeserializerFactoryBase implements DeserializerFactory
+{
+ public abstract DeserializerSupport getDeserializer() throws BindingException;
+
+ public Deserializer getDeserializerAs(String mechanismType)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Iterator getSupportedMechanismTypes()
+ {
+ throw new NotImplementedException();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementDeserializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,65 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.w3c.dom.Element;
-
-/**
- * A deserializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jun-2005
- */
-public class ElementDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ElementDeserializer.class);
-
- /** Deserialize the given simple xmlString
- */
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- try
- {
- Element domElement = DOMUtils.parse(xmlFragment);
- return domElement;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BindingException();
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementDeserializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementDeserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.w3c.dom.Element;
+
+/**
+ * A deserializer that can handle xsd:anyType
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 23-Jun-2005
+ */
+public class ElementDeserializer extends DeserializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ElementDeserializer.class);
+
+ /** Deserialize the given simple xmlString
+ */
+ public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
+ {
+ log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+ try
+ {
+ Element domElement = DOMUtils.parse(xmlFragment);
+ return domElement;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new BindingException();
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementDeserializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Deserializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class ElementDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new ElementDeserializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementDeserializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementDeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.DeserializerSupport;
+
+// $Id$
+
+
+/**
+ * A factory for a Deserializer that can handle XMLSchema simple types.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Oct-2004
+ */
+public class ElementDeserializerFactory extends DeserializerFactoryBase
+{
+ public DeserializerSupport getDeserializer()
+ {
+ return new ElementDeserializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementSerializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,65 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A serializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class ElementSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ElementSerializer.class);
-
- /** Marshal the value for a given XMLSchema type
- * @param xmlType local part of the schema type
- * @param value the value to marshal
- * @param serContext
- * @return the string representation od the value
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes)
- throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- if (value == null)
- throw new IllegalArgumentException("Element value cannot be null");
- if ((value instanceof Element) == false)
- throw new IllegalArgumentException("Value is not a Element: " +
value.getClass().getName());
-
- String xmlFragment = DOMWriter.printNode((Element)value, false);
- return xmlFragment;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementSerializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementSerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * A serializer that can handle xsd:anyType
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Oct-2004
+ */
+public class ElementSerializer extends SerializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ElementSerializer.class);
+
+ /** Marshal the value for a given XMLSchema type
+ * @param xmlType local part of the schema type
+ * @param value the value to marshal
+ * @param serContext
+ * @return the string representation od the value
+ */
+ public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes)
+ throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+ if (value == null)
+ throw new IllegalArgumentException("Element value cannot be null");
+ if ((value instanceof Element) == false)
+ throw new IllegalArgumentException("Value is not a Element: " +
value.getClass().getName());
+
+ String xmlFragment = DOMWriter.printNode((Element)value, false);
+ return xmlFragment;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementSerializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,40 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.SerializerSupport;
-
-// $Id$
-
-/**
- * A factory for a Serializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jun-2005
- */
-public class ElementSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new ElementSerializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementSerializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementSerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.SerializerSupport;
+
+// $Id$
+
+/**
+ * A factory for a Serializer that can handle xsd:anyType
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 23-Jun-2005
+ */
+public class ElementSerializerFactory extends SerializerFactoryBase
+{
+ public SerializerSupport getSerializer()
+ {
+ return new ElementSerializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexDeserializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,60 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.xb.binding.SimpleTypeBindings;
-
-/**
- * Deserializer for hexBinary.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- * @see <a
href="http://www.w3.org/TR/xmlschema-2/#hexBinary">XML Schema
3.2.16</a>
- */
-public class HexDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(HexDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- byte[] value = null;
-
- String valueStr = unwrapValueStr(xmlFragment);
- if (valueStr != null)
- {
- value = SimpleTypeBindings.unmarshalHexBinary(valueStr);
- }
-
- return value;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexDeserializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexDeserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.xb.binding.SimpleTypeBindings;
+
+/**
+ * Deserializer for hexBinary.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ * @see <a
href="http://www.w3.org/TR/xmlschema-2/#hexBinary">XML Schema
3.2.16</a>
+ */
+public class HexDeserializer extends DeserializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(HexDeserializer.class);
+
+ public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
+ {
+ log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ byte[] value = null;
+
+ String valueStr = unwrapValueStr(xmlFragment);
+ if (valueStr != null)
+ {
+ value = SimpleTypeBindings.unmarshalHexBinary(valueStr);
+ }
+
+ return value;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexDeserializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * DeserializerFactory for hexBinary.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class HexDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new HexDeserializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexDeserializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexDeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.DeserializerSupport;
+
+// $Id$
+
+
+/**
+ * DeserializerFactory for hexBinary.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class HexDeserializerFactory extends DeserializerFactoryBase
+{
+ public DeserializerSupport getDeserializer()
+ {
+ return new HexDeserializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexSerializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,60 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Serializer for hexBinary.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- * @see <a
href="http://www.w3.org/TR/xmlschema-2/#hexBinary">XML Schema
3.2.16</a>
- */
-public class HexSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(HexSerializer.class);
-
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- value = JavaUtils.getPrimitiveValueArray(value);
- String valueStr = SimpleTypeBindings.marshalHexBinary((byte[])value);
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
- return xmlFragment;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexSerializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexSerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * Serializer for hexBinary.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ * @see <a
href="http://www.w3.org/TR/xmlschema-2/#hexBinary">XML Schema
3.2.16</a>
+ */
+public class HexSerializer extends SerializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(HexSerializer.class);
+
+ public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ value = JavaUtils.getPrimitiveValueArray(value);
+ String valueStr = SimpleTypeBindings.marshalHexBinary((byte[])value);
+
+ NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
+ String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
+ return xmlFragment;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexSerializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * SerializerFactory for hexBinary.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class HexSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new HexSerializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexSerializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/HexSerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.SerializerSupport;
+
+// $Id$
+
+
+/**
+ * SerializerFactory for hexBinary.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class HexSerializerFactory extends SerializerFactoryBase
+{
+ public SerializerSupport getSerializer()
+ {
+ return new HexSerializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/NullValueSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/NullValueSerializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/NullValueSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Serializer for null values.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Jun-2005
- */
-public class NullValueSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(NullValueSerializer.class);
-
- /**
- * Serializes an object null value.
- *
- * If a message part of an RPC parameter is defined like this
- *
- * <message name='SomeMessage'>
- * <part name='partName' element='someElement'/>
- * </message>
- *
- * it is possible that the element definition does not allow
- * null values. In that case an error should be generated.
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- nsRegistry.registerURI(Constants.NS_SCHEMA_XSI, Constants.PREFIX_XSI);
- String xmlFragment = wrapValueStr(xmlName, null, nsRegistry, attributes, true);
- return xmlFragment;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/NullValueSerializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/NullValueSerializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/NullValueSerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/NullValueSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * Serializer for null values.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 24-Jun-2005
+ */
+public class NullValueSerializer extends SerializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(NullValueSerializer.class);
+
+ /**
+ * Serializes an object null value.
+ *
+ * If a message part of an RPC parameter is defined like this
+ *
+ * <message name='SomeMessage'>
+ * <part name='partName' element='someElement'/>
+ * </message>
+ *
+ * it is possible that the element definition does not allow
+ * null values. In that case an error should be generated.
+ */
+ public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
+ nsRegistry.registerURI(Constants.NS_SCHEMA_XSI, Constants.PREFIX_XSI);
+ String xmlFragment = wrapValueStr(xmlName, null, nsRegistry, attributes, true);
+ return xmlFragment;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameDeserializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import java.io.IOException;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class QNameDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(QNameDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- QName value = null;
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- String valueStr = unwrapValueStr(xmlFragment, nsRegistry);
- if (valueStr != null)
- {
- value = SimpleTypeBindings.unmarshalQName(valueStr, nsRegistry);
- }
-
- return value;
- }
-
- /** Unwrap the value string from the XML fragment
- * @return The value string or null if the startTag contains a xsi:nil='true'
attribute
- */
- protected String unwrapValueStr(String xmlFragment, NamespaceRegistry nsRegistry)
- {
- if (isEmptyElement(xmlFragment) == false)
- {
- // Register namespace declarations
- try
- {
- Element el = DOMUtils.parse(xmlFragment);
- NamedNodeMap attribs = el.getAttributes();
- for (int i = 0; i < attribs.getLength(); i++)
- {
- Node attr = attribs.item(i);
- String nodeName = attr.getNodeName();
- if (nodeName.startsWith("xmlns:"))
- {
- String prefix = nodeName.substring(6);
- String nsURI = attr.getNodeValue();
- nsRegistry.registerURI(nsURI, prefix);
- }
- }
- }
- catch (IOException e)
- {
- throw new IllegalArgumentException("Cannot parse xmlFragment: " +
xmlFragment);
- }
- }
-
- return super.unwrapValueStr(xmlFragment);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameDeserializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameDeserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class QNameDeserializer extends DeserializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(QNameDeserializer.class);
+
+ public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
+ {
+ log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ QName value = null;
+
+ NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
+ String valueStr = unwrapValueStr(xmlFragment, nsRegistry);
+ if (valueStr != null)
+ {
+ value = SimpleTypeBindings.unmarshalQName(valueStr, nsRegistry);
+ }
+
+ return value;
+ }
+
+ /** Unwrap the value string from the XML fragment
+ * @return The value string or null if the startTag contains a xsi:nil='true'
attribute
+ */
+ protected String unwrapValueStr(String xmlFragment, NamespaceRegistry nsRegistry)
+ {
+ if (isEmptyElement(xmlFragment) == false)
+ {
+ // Register namespace declarations
+ try
+ {
+ Element el = DOMUtils.parse(xmlFragment);
+ NamedNodeMap attribs = el.getAttributes();
+ for (int i = 0; i < attribs.getLength(); i++)
+ {
+ Node attr = attribs.item(i);
+ String nodeName = attr.getNodeName();
+ if (nodeName.startsWith("xmlns:"))
+ {
+ String prefix = nodeName.substring(6);
+ String nsURI = attr.getNodeValue();
+ nsRegistry.registerURI(nsURI, prefix);
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ throw new IllegalArgumentException("Cannot parse xmlFragment: " +
xmlFragment);
+ }
+ }
+
+ return super.unwrapValueStr(xmlFragment);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameDeserializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,39 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class QNameDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new QNameDeserializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameDeserializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameDeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.DeserializerSupport;
+
+// $Id$
+
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class QNameDeserializerFactory extends DeserializerFactoryBase
+{
+ public DeserializerSupport getDeserializer()
+ {
+ return new QNameDeserializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameSerializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,78 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Serializer for QNames.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class QNameSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(QNameSerializer.class);
-
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- QName qnameValue = (QName)value;
- String nsURI = qnameValue.getNamespaceURI();
-
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
-
- // Remove prefix and register again
- if (nsURI.length() > 0)
- {
- qnameValue = new QName(qnameValue.getNamespaceURI(),
qnameValue.getLocalPart());
- qnameValue = nsRegistry.registerQName(qnameValue);
- }
-
- String valueStr = SimpleTypeBindings.marshalQName(qnameValue, nsRegistry);
- String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
-
- // Insert the NS declaration for the qnameValue
- if (nsURI.length() > 0)
- {
- StringBuilder buffer = new StringBuilder(xmlFragment);
- int indexGT = xmlFragment.indexOf(">");
- String prefix = qnameValue.getPrefix();
- buffer.insert(indexGT, " xmlns:" + prefix + "='" + nsURI
+ "'");
- xmlFragment = buffer.toString();
- }
-
- return xmlFragment;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameSerializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameSerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,78 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * Serializer for QNames.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class QNameSerializer extends SerializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(QNameSerializer.class);
+
+ public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ QName qnameValue = (QName)value;
+ String nsURI = qnameValue.getNamespaceURI();
+
+ NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
+
+ // Remove prefix and register again
+ if (nsURI.length() > 0)
+ {
+ qnameValue = new QName(qnameValue.getNamespaceURI(),
qnameValue.getLocalPart());
+ qnameValue = nsRegistry.registerQName(qnameValue);
+ }
+
+ String valueStr = SimpleTypeBindings.marshalQName(qnameValue, nsRegistry);
+ String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
+
+ // Insert the NS declaration for the qnameValue
+ if (nsURI.length() > 0)
+ {
+ StringBuilder buffer = new StringBuilder(xmlFragment);
+ int indexGT = xmlFragment.indexOf(">");
+ String prefix = qnameValue.getPrefix();
+ buffer.insert(indexGT, " xmlns:" + prefix + "='" + nsURI
+ "'");
+ xmlFragment = buffer.toString();
+ }
+
+ return xmlFragment;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameSerializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * SerializerFactory for QName primitive
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class QNameSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new QNameSerializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameSerializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameSerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.SerializerSupport;
+
+// $Id$
+
+
+/**
+ * SerializerFactory for QName primitive
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class QNameSerializerFactory extends SerializerFactoryBase
+{
+ public SerializerSupport getSerializer()
+ {
+ return new QNameSerializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,189 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import java.lang.reflect.Array;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.w3c.dom.Element;
-
-/**
- * A Deserializer that can handle SOAP encoded arrays.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class SOAPArrayDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SOAPArrayDeserializer.class);
-
- private DeserializerSupport compDeserializer;
-
- public SOAPArrayDeserializer() throws BindingException
- {
- }
-
- /**
- */
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- try
- {
- ParameterMetaData paramMetaData =
(ParameterMetaData)serContext.getProperty(ParameterMetaData.class.getName());
- QName compXmlType = paramMetaData.getSOAPArrayCompType();
- QName compXmlName = paramMetaData.getXmlName();
-
- Element arrayElement = DOMUtils.parse(xmlFragment);
- int[] arrDims = getDimensionsFromAttribute(arrayElement);
- Class compJavaType = getComponentTypeFromAttribute(arrayElement, serContext);
- Object[] retArray = (Object[])Array.newInstance(compJavaType, arrDims);
-
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
- if (compXmlType == null)
- {
- compXmlType = typeMapping.getXMLType(compJavaType);
- paramMetaData.setSOAPArrayCompType(compXmlType);
- }
-
- if (compXmlType == null)
- throw new WSException("Cannot obtain component xmlType for: " +
compJavaType);
-
- // Get the component type deserializer factory
- log.debug("Get component deserializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
- DeserializerFactoryBase compDeserializerFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(compJavaType, compXmlType);
- if (compDeserializerFactory == null)
- {
- log.warn("Cannot obtain component deserializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
- compDeserializerFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(null, compXmlType);
- }
- if (compDeserializerFactory == null)
- throw new WSException("Cannot obtain component deserializer for: "
+ compXmlType);
-
- // Get the component type deserializer
- compDeserializer =
(DeserializerSupport)compDeserializerFactory.getDeserializer();
-
- if (arrDims.length < 1 || 2 < arrDims.length)
- throw new WSException("Unsupported array dimensions: " +
Arrays.asList(arrDims));
-
- Iterator it = DOMUtils.getChildElements(arrayElement);
- if (arrDims.length == 1)
- {
- Object[] subArr = retArray;
- deserializeMemberValues(compXmlName, compXmlType, serContext, it, subArr);
- }
- if (arrDims.length == 2)
- {
- for (int i = 0; i < arrDims[0]; i++)
- {
- Object[] subArr = (Object[])retArray[i];
- deserializeMemberValues(compXmlName, compXmlType, serContext, it,
subArr);
- }
- }
-
- log.debug("deserialized: " + retArray.getClass().getName());
- return retArray;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new BindingException(e);
- }
- }
-
- private void deserializeMemberValues(QName compXmlName, QName compXmlType,
SerializationContext serContext, Iterator it, Object[] subArr) throws BindingException
- {
- int dim = subArr.length;
- for (int i = 0; i < dim; i++)
- {
- Object compValue = null;
- if (it.hasNext())
- {
- Element childElement = (Element)it.next();
- String compXMLFragment = DOMWriter.printNode(childElement, false);
- compValue = compDeserializer.deserialize(compXmlName, compXmlType,
compXMLFragment, serContext);
- compValue = JavaUtils.getWrapperValueArray(compValue);
- }
- subArr[i] = compValue;
- }
- }
-
- private int[] getDimensionsFromAttribute(Element arrayElement)
- {
- QName attrQName = new QName(Constants.URI_SOAP11_ENC, "arrayType");
- QName arrayType = DOMUtils.getAttributeValueAsQName(arrayElement, attrQName);
- if (arrayType == null)
- throw new WSException("Cannot obtain attribute: " + attrQName);
-
- String localPart = arrayType.getLocalPart();
- int dimIndex = localPart.indexOf("[");
-
- String dimStr = localPart.substring(dimIndex);
- StringTokenizer st = new StringTokenizer(dimStr, "[,]");
- int[] arrDims = new int[st.countTokens()];
- for (int i = 0; st.hasMoreTokens(); i++)
- arrDims[i] = new Integer(st.nextToken()).intValue();
-
- return arrDims;
- }
-
- private Class getComponentTypeFromAttribute(Element arrayElement, SerializationContext
serContext)
- {
- QName attrQName = new QName(Constants.URI_SOAP11_ENC, "arrayType");
- QName arrayType = DOMUtils.getAttributeValueAsQName(arrayElement, attrQName);
- if (arrayType == null)
- throw new WSException("Cannot obtain attribute: " + attrQName);
-
- String nsURI = arrayType.getNamespaceURI();
- String localPart = arrayType.getLocalPart();
- int dimIndex = localPart.indexOf("[");
- QName compXmlType = new QName(nsURI, localPart.substring(0, dimIndex));
-
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
- Class javaType = typeMapping.getJavaType(compXmlType);
- if (javaType == null)
- throw new WSException("Cannot obtain javaType for: " + compXmlType);
-
- return JavaUtils.getWrapperType(javaType);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,189 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import java.lang.reflect.Array;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.w3c.dom.Element;
+
+/**
+ * A Deserializer that can handle SOAP encoded arrays.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class SOAPArrayDeserializer extends DeserializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SOAPArrayDeserializer.class);
+
+ private DeserializerSupport compDeserializer;
+
+ public SOAPArrayDeserializer() throws BindingException
+ {
+ }
+
+ /**
+ */
+ public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
+ {
+ log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+ try
+ {
+ ParameterMetaData paramMetaData =
(ParameterMetaData)serContext.getProperty(ParameterMetaData.class.getName());
+ QName compXmlType = paramMetaData.getSOAPArrayCompType();
+ QName compXmlName = paramMetaData.getXmlName();
+
+ Element arrayElement = DOMUtils.parse(xmlFragment);
+ int[] arrDims = getDimensionsFromAttribute(arrayElement);
+ Class compJavaType = getComponentTypeFromAttribute(arrayElement, serContext);
+ Object[] retArray = (Object[])Array.newInstance(compJavaType, arrDims);
+
+ TypeMappingImpl typeMapping = serContext.getTypeMapping();
+ if (compXmlType == null)
+ {
+ compXmlType = typeMapping.getXMLType(compJavaType);
+ paramMetaData.setSOAPArrayCompType(compXmlType);
+ }
+
+ if (compXmlType == null)
+ throw new WSException("Cannot obtain component xmlType for: " +
compJavaType);
+
+ // Get the component type deserializer factory
+ log.debug("Get component deserializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
+ DeserializerFactoryBase compDeserializerFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(compJavaType, compXmlType);
+ if (compDeserializerFactory == null)
+ {
+ log.warn("Cannot obtain component deserializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
+ compDeserializerFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(null, compXmlType);
+ }
+ if (compDeserializerFactory == null)
+ throw new WSException("Cannot obtain component deserializer for: "
+ compXmlType);
+
+ // Get the component type deserializer
+ compDeserializer =
(DeserializerSupport)compDeserializerFactory.getDeserializer();
+
+ if (arrDims.length < 1 || 2 < arrDims.length)
+ throw new WSException("Unsupported array dimensions: " +
Arrays.asList(arrDims));
+
+ Iterator it = DOMUtils.getChildElements(arrayElement);
+ if (arrDims.length == 1)
+ {
+ Object[] subArr = retArray;
+ deserializeMemberValues(compXmlName, compXmlType, serContext, it, subArr);
+ }
+ if (arrDims.length == 2)
+ {
+ for (int i = 0; i < arrDims[0]; i++)
+ {
+ Object[] subArr = (Object[])retArray[i];
+ deserializeMemberValues(compXmlName, compXmlType, serContext, it,
subArr);
+ }
+ }
+
+ log.debug("deserialized: " + retArray.getClass().getName());
+ return retArray;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new BindingException(e);
+ }
+ }
+
+ private void deserializeMemberValues(QName compXmlName, QName compXmlType,
SerializationContext serContext, Iterator it, Object[] subArr) throws BindingException
+ {
+ int dim = subArr.length;
+ for (int i = 0; i < dim; i++)
+ {
+ Object compValue = null;
+ if (it.hasNext())
+ {
+ Element childElement = (Element)it.next();
+ String compXMLFragment = DOMWriter.printNode(childElement, false);
+ compValue = compDeserializer.deserialize(compXmlName, compXmlType,
compXMLFragment, serContext);
+ compValue = JavaUtils.getWrapperValueArray(compValue);
+ }
+ subArr[i] = compValue;
+ }
+ }
+
+ private int[] getDimensionsFromAttribute(Element arrayElement)
+ {
+ QName attrQName = new QName(Constants.URI_SOAP11_ENC, "arrayType");
+ QName arrayType = DOMUtils.getAttributeValueAsQName(arrayElement, attrQName);
+ if (arrayType == null)
+ throw new WSException("Cannot obtain attribute: " + attrQName);
+
+ String localPart = arrayType.getLocalPart();
+ int dimIndex = localPart.indexOf("[");
+
+ String dimStr = localPart.substring(dimIndex);
+ StringTokenizer st = new StringTokenizer(dimStr, "[,]");
+ int[] arrDims = new int[st.countTokens()];
+ for (int i = 0; st.hasMoreTokens(); i++)
+ arrDims[i] = new Integer(st.nextToken()).intValue();
+
+ return arrDims;
+ }
+
+ private Class getComponentTypeFromAttribute(Element arrayElement, SerializationContext
serContext)
+ {
+ QName attrQName = new QName(Constants.URI_SOAP11_ENC, "arrayType");
+ QName arrayType = DOMUtils.getAttributeValueAsQName(arrayElement, attrQName);
+ if (arrayType == null)
+ throw new WSException("Cannot obtain attribute: " + attrQName);
+
+ String nsURI = arrayType.getNamespaceURI();
+ String localPart = arrayType.getLocalPart();
+ int dimIndex = localPart.indexOf("[");
+ QName compXmlType = new QName(nsURI, localPart.substring(0, dimIndex));
+
+ TypeMappingImpl typeMapping = serContext.getTypeMapping();
+ Class javaType = typeMapping.getJavaType(compXmlType);
+ if (javaType == null)
+ throw new WSException("Cannot obtain javaType for: " + compXmlType);
+
+ return JavaUtils.getWrapperType(javaType);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-
-// $Id$
-
-/**
- * A factory for a Deserializer that can handle SOAP encoded arrays.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class SOAPArrayDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer() throws BindingException
- {
- return new SOAPArrayDeserializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+
+// $Id$
+
+/**
+ * A factory for a Deserializer that can handle SOAP encoded arrays.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class SOAPArrayDeserializerFactory extends DeserializerFactoryBase
+{
+ public DeserializerSupport getDeserializer() throws BindingException
+ {
+ return new SOAPArrayDeserializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,208 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A Serializer that can handle SOAP encoded arrays.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class SOAPArraySerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SOAPArraySerializer.class);
-
- private SerializerSupport compSerializer;
- private NullValueSerializer nullSerializer;
- private boolean isArrayComponentType;
- private boolean xsiNamespaceInserted;
- private StringBuilder xmlFragment;
-
- public SOAPArraySerializer() throws BindingException
- {
- nullSerializer = new NullValueSerializer();
- }
-
- /**
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + ",valueType=" + value.getClass().getName() + "]");
- try
- {
- ParameterMetaData paramMetaData =
(ParameterMetaData)serContext.getProperty(ParameterMetaData.class.getName());
- QName compXmlType = paramMetaData.getSOAPArrayCompType();
- QName compXmlName = paramMetaData.getXmlName();
- Class javaType = paramMetaData.getJavaType();
-
- Class compJavaType = javaType.getComponentType();
- isArrayComponentType = isArrayJavaType(compJavaType) &&
isArrayXmlType(compXmlType);
- while (compJavaType.getComponentType() != null && isArrayComponentType
== false)
- {
- compJavaType = compJavaType.getComponentType();
- isArrayComponentType = isArrayJavaType(compJavaType) &&
isArrayXmlType(compXmlType);
- }
-
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
- if (compXmlType == null)
- {
- compXmlType = typeMapping.getXMLType(compJavaType);
- paramMetaData.setSOAPArrayCompType(compXmlType);
- }
-
- if (compXmlType == null)
- throw new WSException("Cannot obtain component xmlType for: " +
compJavaType);
-
- // Get the component type serializer factory
- log.debug("Get component serializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
- SerializerFactoryBase compSerializerFactory =
(SerializerFactoryBase)typeMapping.getSerializer(compJavaType, compXmlType);
- if (compSerializerFactory == null)
- {
- log.warn("Cannot obtain component serializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
- compSerializerFactory =
(SerializerFactoryBase)typeMapping.getSerializer(null, compXmlType);
- }
- if (compSerializerFactory == null)
- throw new WSException("Cannot obtain component serializer for: " +
compXmlType);
-
- // Get the component type serializer
- compSerializer = (SerializerSupport)compSerializerFactory.getSerializer();
-
- // Get the corresponding wrapper type
- if (JavaUtils.isPrimitive(value.getClass()))
- value = JavaUtils.getWrapperValueArray(value);
-
- xmlFragment = new StringBuilder("<" + Constants.PREFIX_SOAP11_ENC +
":Array ");
- if (value instanceof Object[])
- {
- Object[] objArr = (Object[])value;
- String arrayDim = "" + objArr.length;
-
- // Get multiple array dimension
- Object[] subArr = (Object[])value;
- while (isArrayComponentType == false && subArr.length > 0
&& subArr[0] instanceof Object[])
- {
- subArr = (Object[])subArr[0];
- arrayDim += "," + subArr.length;
- }
-
- compXmlType = serContext.getNamespaceRegistry().registerQName(compXmlType);
- String arrayType = Constants.PREFIX_SOAP11_ENC + ":arrayType='"
+ compXmlType.getPrefix() + ":" + compXmlType.getLocalPart() + "[" +
arrayDim + "]'";
- String compns = " xmlns:" + compXmlType.getPrefix() +
"='" + compXmlType.getNamespaceURI() + "'";
- xmlFragment.append(arrayType + compns + ">");
-
- serializeArrayComponents(compXmlName, compXmlType, serContext, objArr);
- }
- else
- {
- throw new WSException("Unsupported array type: " + javaType);
- }
- xmlFragment.append("</" + Constants.PREFIX_SOAP11_ENC +
":Array>");
-
- log.debug("serialized: " + xmlFragment);
- return xmlFragment.toString();
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new BindingException(e);
- }
- }
-
- private void serializeArrayComponents(QName compXmlName, QName compXmlType,
SerializationContext serContext, Object[] objArr) throws BindingException
- {
- for (Object compValue : objArr)
- {
- if (isArrayComponentType == false && compValue instanceof Object[])
- {
- serializeArrayComponents(compXmlName, compXmlType, serContext,
(Object[])compValue);
- }
- else
- {
- SerializerSupport ser = compSerializer;
-
- // Null component value
- if (compValue == null)
- {
- ser = nullSerializer;
- if (xsiNamespaceInserted == false)
- {
- xsiNamespaceInserted = true;
- int insIndex = ("<" + Constants.PREFIX_SOAP11_ENC +
":Array ").length();
- xmlFragment.insert(insIndex, "xmlns:" + Constants.PREFIX_XSI
+ "='" + Constants.NS_SCHEMA_XSI + "' ");
- }
- }
-
- String compFragment = ser.serialize(compXmlName, compXmlType, compValue,
serContext, null);
- xmlFragment.append(compFragment);
- }
- }
- }
-
- /** True for all array xmlTypes, i.e. nmtokens, base64Binary, hexBinary
- *
- * FIXME: This method should be removed as soon as we can reliably get the SOAP
- * arrayType from wsdl + schema.
- */
- private boolean isArrayXmlType(QName xmlType)
- {
- boolean isArrayType = Constants.TYPE_SOAP11_BASE64.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_SOAP11_BASE64.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_SOAP11_BASE64BINARY.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_SOAP11_HEXBINARY.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_SOAP11_NMTOKENS.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_LITERAL_BASE64BINARY.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_LITERAL_HEXBINARY.equals(xmlType);
- isArrayType = isArrayType || Constants.TYPE_LITERAL_NMTOKENS.equals(xmlType);
- return isArrayType;
- }
-
- /** True for all array javaTypes, i.e. String[], Byte[], byte[]
- *
- * FIXME: This method should be removed as soon as we can reliably get the SOAP
- * arrayType from wsdl + schema.
- */
- private boolean isArrayJavaType(Class javaType)
- {
- boolean isBinaryType = String[].class.equals(javaType) ||
Byte[].class.equals(javaType) || byte[].class.equals(javaType);
- return isBinaryType;
- }
-
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,208 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * A Serializer that can handle SOAP encoded arrays.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class SOAPArraySerializer extends SerializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SOAPArraySerializer.class);
+
+ private SerializerSupport compSerializer;
+ private NullValueSerializer nullSerializer;
+ private boolean isArrayComponentType;
+ private boolean xsiNamespaceInserted;
+ private StringBuilder xmlFragment;
+
+ public SOAPArraySerializer() throws BindingException
+ {
+ nullSerializer = new NullValueSerializer();
+ }
+
+ /**
+ */
+ public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + ",valueType=" + value.getClass().getName() + "]");
+ try
+ {
+ ParameterMetaData paramMetaData =
(ParameterMetaData)serContext.getProperty(ParameterMetaData.class.getName());
+ QName compXmlType = paramMetaData.getSOAPArrayCompType();
+ QName compXmlName = paramMetaData.getXmlName();
+ Class javaType = paramMetaData.getJavaType();
+
+ Class compJavaType = javaType.getComponentType();
+ isArrayComponentType = isArrayJavaType(compJavaType) &&
isArrayXmlType(compXmlType);
+ while (compJavaType.getComponentType() != null && isArrayComponentType
== false)
+ {
+ compJavaType = compJavaType.getComponentType();
+ isArrayComponentType = isArrayJavaType(compJavaType) &&
isArrayXmlType(compXmlType);
+ }
+
+ TypeMappingImpl typeMapping = serContext.getTypeMapping();
+ if (compXmlType == null)
+ {
+ compXmlType = typeMapping.getXMLType(compJavaType);
+ paramMetaData.setSOAPArrayCompType(compXmlType);
+ }
+
+ if (compXmlType == null)
+ throw new WSException("Cannot obtain component xmlType for: " +
compJavaType);
+
+ // Get the component type serializer factory
+ log.debug("Get component serializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
+ SerializerFactoryBase compSerializerFactory =
(SerializerFactoryBase)typeMapping.getSerializer(compJavaType, compXmlType);
+ if (compSerializerFactory == null)
+ {
+ log.warn("Cannot obtain component serializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
+ compSerializerFactory =
(SerializerFactoryBase)typeMapping.getSerializer(null, compXmlType);
+ }
+ if (compSerializerFactory == null)
+ throw new WSException("Cannot obtain component serializer for: " +
compXmlType);
+
+ // Get the component type serializer
+ compSerializer = (SerializerSupport)compSerializerFactory.getSerializer();
+
+ // Get the corresponding wrapper type
+ if (JavaUtils.isPrimitive(value.getClass()))
+ value = JavaUtils.getWrapperValueArray(value);
+
+ xmlFragment = new StringBuilder("<" + Constants.PREFIX_SOAP11_ENC +
":Array ");
+ if (value instanceof Object[])
+ {
+ Object[] objArr = (Object[])value;
+ String arrayDim = "" + objArr.length;
+
+ // Get multiple array dimension
+ Object[] subArr = (Object[])value;
+ while (isArrayComponentType == false && subArr.length > 0
&& subArr[0] instanceof Object[])
+ {
+ subArr = (Object[])subArr[0];
+ arrayDim += "," + subArr.length;
+ }
+
+ compXmlType = serContext.getNamespaceRegistry().registerQName(compXmlType);
+ String arrayType = Constants.PREFIX_SOAP11_ENC + ":arrayType='"
+ compXmlType.getPrefix() + ":" + compXmlType.getLocalPart() + "[" +
arrayDim + "]'";
+ String compns = " xmlns:" + compXmlType.getPrefix() +
"='" + compXmlType.getNamespaceURI() + "'";
+ xmlFragment.append(arrayType + compns + ">");
+
+ serializeArrayComponents(compXmlName, compXmlType, serContext, objArr);
+ }
+ else
+ {
+ throw new WSException("Unsupported array type: " + javaType);
+ }
+ xmlFragment.append("</" + Constants.PREFIX_SOAP11_ENC +
":Array>");
+
+ log.debug("serialized: " + xmlFragment);
+ return xmlFragment.toString();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new BindingException(e);
+ }
+ }
+
+ private void serializeArrayComponents(QName compXmlName, QName compXmlType,
SerializationContext serContext, Object[] objArr) throws BindingException
+ {
+ for (Object compValue : objArr)
+ {
+ if (isArrayComponentType == false && compValue instanceof Object[])
+ {
+ serializeArrayComponents(compXmlName, compXmlType, serContext,
(Object[])compValue);
+ }
+ else
+ {
+ SerializerSupport ser = compSerializer;
+
+ // Null component value
+ if (compValue == null)
+ {
+ ser = nullSerializer;
+ if (xsiNamespaceInserted == false)
+ {
+ xsiNamespaceInserted = true;
+ int insIndex = ("<" + Constants.PREFIX_SOAP11_ENC +
":Array ").length();
+ xmlFragment.insert(insIndex, "xmlns:" + Constants.PREFIX_XSI
+ "='" + Constants.NS_SCHEMA_XSI + "' ");
+ }
+ }
+
+ String compFragment = ser.serialize(compXmlName, compXmlType, compValue,
serContext, null);
+ xmlFragment.append(compFragment);
+ }
+ }
+ }
+
+ /** True for all array xmlTypes, i.e. nmtokens, base64Binary, hexBinary
+ *
+ * FIXME: This method should be removed as soon as we can reliably get the SOAP
+ * arrayType from wsdl + schema.
+ */
+ private boolean isArrayXmlType(QName xmlType)
+ {
+ boolean isArrayType = Constants.TYPE_SOAP11_BASE64.equals(xmlType);
+ isArrayType = isArrayType || Constants.TYPE_SOAP11_BASE64.equals(xmlType);
+ isArrayType = isArrayType || Constants.TYPE_SOAP11_BASE64BINARY.equals(xmlType);
+ isArrayType = isArrayType || Constants.TYPE_SOAP11_HEXBINARY.equals(xmlType);
+ isArrayType = isArrayType || Constants.TYPE_SOAP11_NMTOKENS.equals(xmlType);
+ isArrayType = isArrayType || Constants.TYPE_LITERAL_BASE64BINARY.equals(xmlType);
+ isArrayType = isArrayType || Constants.TYPE_LITERAL_HEXBINARY.equals(xmlType);
+ isArrayType = isArrayType || Constants.TYPE_LITERAL_NMTOKENS.equals(xmlType);
+ return isArrayType;
+ }
+
+ /** True for all array javaTypes, i.e. String[], Byte[], byte[]
+ *
+ * FIXME: This method should be removed as soon as we can reliably get the SOAP
+ * arrayType from wsdl + schema.
+ */
+ private boolean isArrayJavaType(Class javaType)
+ {
+ boolean isBinaryType = String[].class.equals(javaType) ||
Byte[].class.equals(javaType) || byte[].class.equals(javaType);
+ return isBinaryType;
+ }
+
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,42 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Serializer that can handle SOAP encoded arrays.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class SOAPArraySerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer() throws BindingException
- {
- return new SOAPArraySerializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializerSupport;
+
+// $Id$
+
+
+/**
+ * A factory for a Serializer that can handle SOAP encoded arrays.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2005
+ */
+public class SOAPArraySerializerFactory extends SerializerFactoryBase
+{
+ public SerializerSupport getSerializer() throws BindingException
+ {
+ return new SOAPArraySerializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementDeserializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,67 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
-import org.w3c.dom.Element;
-
-/**
- * A deserializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jun-2005
- */
-public class SOAPElementDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SOAPElementDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- try
- {
- Element domElement = DOMUtils.parse(xmlFragment);
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- SOAPElementImpl soapElement = soapFactory.createElement(domElement, true);
- return soapElement;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BindingException();
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementDeserializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementDeserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPFactoryImpl;
+import org.w3c.dom.Element;
+
+/**
+ * A deserializer that can handle xsd:anyType
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 23-Jun-2005
+ */
+public class SOAPElementDeserializer extends DeserializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SOAPElementDeserializer.class);
+
+ public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
+ {
+ log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+ try
+ {
+ Element domElement = DOMUtils.parse(xmlFragment);
+ SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
+ SOAPElementImpl soapElement = soapFactory.createElement(domElement, true);
+ return soapElement;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new BindingException();
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementDeserializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Deserializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class SOAPElementDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new SOAPElementDeserializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementDeserializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementDeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.DeserializerSupport;
+
+// $Id$
+
+
+/**
+ * A factory for a Deserializer that can handle XMLSchema simple types.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Oct-2004
+ */
+public class SOAPElementDeserializerFactory extends DeserializerFactoryBase
+{
+ public DeserializerSupport getDeserializer()
+ {
+ return new SOAPElementDeserializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementSerializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,64 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A serializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class SOAPElementSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SOAPElementSerializer.class);
-
- /** Marshal the value for a given XMLSchema type
- * @param xmlType local part of the schema type
- * @param value the value to marshal
- * @param serContext
- * @return the string representation od the value
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
- if (value == null)
- throw new IllegalArgumentException("SOAPElement value cannot be
null");
- if ((value instanceof SOAPElement) == false)
- throw new IllegalArgumentException("Value is not a SOAPElement: " +
value.getClass().getName());
-
- String xmlFragment = DOMWriter.printNode((SOAPElement)value, false);
- return xmlFragment;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementSerializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementSerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * A serializer that can handle xsd:anyType
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Oct-2004
+ */
+public class SOAPElementSerializer extends SerializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SOAPElementSerializer.class);
+
+ /** Marshal the value for a given XMLSchema type
+ * @param xmlType local part of the schema type
+ * @param value the value to marshal
+ * @param serContext
+ * @return the string representation od the value
+ */
+ public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+ if (value == null)
+ throw new IllegalArgumentException("SOAPElement value cannot be
null");
+ if ((value instanceof SOAPElement) == false)
+ throw new IllegalArgumentException("Value is not a SOAPElement: " +
value.getClass().getName());
+
+ String xmlFragment = DOMWriter.printNode((SOAPElement)value, false);
+ return xmlFragment;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementSerializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,40 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.SerializerSupport;
-
-// $Id$
-
-/**
- * A factory for a Serializer that can handle xsd:anyType
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jun-2005
- */
-public class SOAPElementSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new SOAPElementSerializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementSerializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementSerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.SerializerSupport;
+
+// $Id$
+
+/**
+ * A factory for a Serializer that can handle xsd:anyType
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 23-Jun-2005
+ */
+public class SOAPElementSerializerFactory extends SerializerFactoryBase
+{
+ public SerializerSupport getSerializer()
+ {
+ return new SOAPElementSerializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SerializerFactoryBase.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SerializerFactoryBase.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SerializerFactoryBase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,52 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import java.util.Iterator;
-
-import javax.xml.rpc.encoding.Serializer;
-import javax.xml.rpc.encoding.SerializerFactory;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializerSupport;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public abstract class SerializerFactoryBase implements SerializerFactory
-{
- public abstract SerializerSupport getSerializer() throws BindingException;
-
- public Serializer getSerializerAs(String mechanismType)
- {
- throw new NotImplementedException();
- }
-
- public Iterator getSupportedMechanismTypes()
- {
- throw new NotImplementedException();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SerializerFactoryBase.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SerializerFactoryBase.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SerializerFactoryBase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SerializerFactoryBase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import java.util.Iterator;
+
+import javax.xml.rpc.encoding.Serializer;
+import javax.xml.rpc.encoding.SerializerFactory;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializerSupport;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public abstract class SerializerFactoryBase implements SerializerFactory
+{
+ public abstract SerializerSupport getSerializer() throws BindingException;
+
+ public Serializer getSerializerAs(String mechanismType)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Iterator getSupportedMechanismTypes()
+ {
+ throw new NotImplementedException();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleDeserializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.xb.binding.SimpleTypeBindings;
-
-import javax.xml.namespace.QName;
-
-/**
- * A deserializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 22-Oct-2004
- */
-public class SimpleDeserializer extends DeserializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SimpleDeserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- Object value = null;
- String valueStr = unwrapValueStr(xmlFragment);
-
- if (valueStr != null)
- {
- value = SimpleTypeBindings.unmarshal(xmlType.getLocalPart(), valueStr,
serContext.getNamespaceRegistry());
- }
-
- return value;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleDeserializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleDeserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.DeserializerSupport;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.xb.binding.SimpleTypeBindings;
+
+import javax.xml.namespace.QName;
+
+/**
+ * A deserializer that can handle XMLSchema simple types.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 22-Oct-2004
+ */
+public class SimpleDeserializer extends DeserializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SimpleDeserializer.class);
+
+ public Object deserialize(QName xmlName, QName xmlType, String xmlFragment,
SerializationContext serContext) throws BindingException
+ {
+ log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ Object value = null;
+ String valueStr = unwrapValueStr(xmlFragment);
+
+ if (valueStr != null)
+ {
+ value = SimpleTypeBindings.unmarshal(xmlType.getLocalPart(), valueStr,
serContext.getNamespaceRegistry());
+ }
+
+ return value;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleDeserializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.DeserializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Deserializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class SimpleDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer()
- {
- return new SimpleDeserializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleDeserializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleDeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.DeserializerSupport;
+
+// $Id$
+
+
+/**
+ * A factory for a Deserializer that can handle XMLSchema simple types.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Oct-2004
+ */
+public class SimpleDeserializerFactory extends DeserializerFactoryBase
+{
+ public DeserializerSupport getDeserializer()
+ {
+ return new SimpleDeserializer();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleSerializer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.jaxrpc.encoding;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A serializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class SimpleSerializer extends SerializerSupport
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SimpleSerializer.class);
-
- /** Marshal the value for a given XMLSchema type
- * @param xmlType local part of the schema type
- * @param value the value to marshal
- * @param serContext
- * @return the string representation od the value
- */
- public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
-
- String valueStr;
- String typeName = xmlType.getLocalPart();
- NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
-
- if ("base64Binary".equals(typeName))
- {
- throw new NotImplementedException();
- }
- else
- {
- valueStr = SimpleTypeBindings.marshal(xmlType.getLocalPart(), value,
nsRegistry);
- }
-
- String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
- return xmlFragment;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializer.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleSerializer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleSerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc.encoding;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * A serializer that can handle XMLSchema simple types.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Oct-2004
+ */
+public class SimpleSerializer extends SerializerSupport
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SimpleSerializer.class);
+
+ /** Marshal the value for a given XMLSchema type
+ * @param xmlType local part of the schema type
+ * @param value the value to marshal
+ * @param serContext
+ * @return the string representation od the value
+ */
+ public String serialize(QName xmlName, QName xmlType, Object value,
SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
+
+ String valueStr;
+ String typeName = xmlType.getLocalPart();
+ NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
+
+ if ("base64Binary".equals(typeName))
+ {
+ throw new NotImplementedException();
+ }
+ else
+ {
+ valueStr = SimpleTypeBindings.marshal(xmlType.getLocalPart(), value,
nsRegistry);
+ }
+
+ String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, attributes,
true);
+ return xmlFragment;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleSerializerFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.encoding;
-
-import org.jboss.ws.core.binding.SerializerSupport;
-
-// $Id$
-
-
-/**
- * A factory for a Serializer that can handle XMLSchema simple types.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class SimpleSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer()
- {
- return new SimpleSerializer();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializerFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleSerializerFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleSerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.encoding;
+
+import org.jboss.ws.core.binding.SerializerSupport;
+
+// $Id$
+
+
+/**
+ * A factory for a Serializer that can handle XMLSchema simple types.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Oct-2004
+ */
+public class SimpleSerializerFactory extends SerializerFactoryBase
+{
+ public SerializerSupport getSerializer()
+ {
+ return new SimpleSerializer();
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler (from rev
1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/ClientHandlerChain.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,43 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.handler;
-
-// $Id$
-
-import java.util.List;
-import java.util.Set;
-
-
-/**
- * Represents a list of handlers. All elements in the
- * HandlerChain are of the type javax.xml.rpc.handler.Handler.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-May-2004
- */
-public class ClientHandlerChain extends HandlerChainBaseImpl
-{
- public ClientHandlerChain(List infos, Set roles)
- {
- super(infos, roles);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/ClientHandlerChain.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/ClientHandlerChain.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.handler;
+
+// $Id$
+
+import java.util.List;
+import java.util.Set;
+
+
+/**
+ * Represents a list of handlers. All elements in the
+ * HandlerChain are of the type javax.xml.rpc.handler.Handler.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 06-May-2004
+ */
+public class ClientHandlerChain extends HandlerChainBaseImpl
+{
+ public ClientHandlerChain(List infos, Set roles)
+ {
+ super(infos, roles);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerChainBaseImpl.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,730 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.jaxrpc.handler;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.handler.Handler;
-import javax.xml.rpc.handler.HandlerChain;
-import javax.xml.rpc.handler.HandlerInfo;
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeaderElement;
-import javax.xml.soap.SOAPPart;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPElementWriter;
-import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * Represents a list of handlers. All elements in the
- * HandlerChain are of the type javax.xml.rpc.handler.Handler.
- * <p/>
- * Abstracts the policy and mechanism for the invocation of the registered handlers.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-May-2004
- */
-public abstract class HandlerChainBaseImpl implements HandlerChain
-{
- private static Logger log = Logger.getLogger(HandlerChainBaseImpl.class);
-
- public static final int STATE_DOES_NOT_EXIST = 0;
- public static final int STATE_CREATED = 1;
- public static final int STATE_READY = 2;
- public static final int STATE_DESTROYED = 3;
-
- // The List<Entry> objects
- protected List<HandlerEntry> handlers = new ArrayList<HandlerEntry>();
- // The roles associated with the handler chain
- protected Set<String> roles = new HashSet<String>();
- // The index of the first handler that returned false during processing
- protected int falseIndex = -1;
- // The state of this handler chain
- protected int state;
-
- /**
- * Constructs a handler chain with the given handlers infos
- */
- public HandlerChainBaseImpl(List<HandlerInfo> infos, Set<String> roles)
- {
- log.debug("Create a handler chain for roles: " + roles);
- addHandlersToChain(infos, roles);
- }
-
- /** Get the list of handler infos
- */
- public List<HandlerInfo> getHandlerInfos()
- {
- List<HandlerInfo> list = new ArrayList<HandlerInfo>();
- for (int i = 0; i < handlers.size(); i++)
- {
- HandlerEntry entry = (HandlerEntry)handlers.get(i);
- list.add(entry.info);
- }
- return list;
- }
-
- /**
- * Initialize the a handler chain with the given handlers infos
- *
- * @throws javax.xml.rpc.JAXRPCException If any error during initialization
- */
- private void addHandlersToChain(List<HandlerInfo> infos, Set<String>
roleSet)
- {
- try
- {
- if (infos != null)
- {
- for (HandlerInfo info : infos)
- {
- HandlerWrapper handler = new
HandlerWrapper((Handler)info.getHandlerClass().newInstance());
- HandlerType type =
(HandlerType)info.getHandlerConfig().get(HandlerType.class.getName());
- handlers.add(new HandlerEntry(handler, info, type));
- }
- }
- if (roleSet != null)
- {
- roles.addAll(roleSet);
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new JAXRPCException("Cannot initialize handler chain", ex);
- }
-
- // set state to created
- state = STATE_CREATED;
- }
-
- /**
- * Get the state of this handler chain
- */
- public int getState()
- {
- return state;
- }
-
- /**
- * Initializes the configuration for a HandlerChain.
- *
- * @param config Configuration for the initialization of this handler chain
- * @throws javax.xml.rpc.JAXRPCException If any error during initialization
- */
- public void init(Map config)
- {
- log.debug("init: [config=" + config + "]");
- for (int i = 0; i < handlers.size(); i++)
- {
- HandlerEntry entry = (HandlerEntry)handlers.get(i);
- entry.handler.init(entry.info);
- }
-
- // set state to ready
- state = STATE_READY;
- }
-
- /**
- * Indicates the end of lifecycle for a HandlerChain.
- *
- * @throws javax.xml.rpc.JAXRPCException If any error during destroy
- */
- public void destroy()
- {
- log.debug("destroy");
- for (int i = 0; i < handlers.size(); i++)
- {
- HandlerEntry entry = (HandlerEntry)handlers.get(i);
- entry.handler.destroy();
- }
- handlers.clear();
-
- // set state to destroyed
- state = STATE_DESTROYED;
- }
-
- /**
- * Gets SOAP actor roles registered for this HandlerChain at this SOAP node. The
returned array includes the
- * special SOAP actor next.
- *
- * @return SOAP Actor roles as URIs
- */
- public String[] getRoles()
- {
- Set<String> auxlist = new HashSet<String>(roles);
- auxlist.add(Constants.URI_SOAP11_NEXT_ACTOR);
- String[] roleArr = new String[auxlist.size()];
- auxlist.toArray(roleArr);
- return roleArr;
- }
-
- /**
- * Sets SOAP Actor roles for this HandlerChain. This specifies the set of roles in
which this HandlerChain is to act
- * for the SOAP message processing at this SOAP node. These roles assumed by a
HandlerChain must be invariant during
- * the processing of an individual SOAP message through the HandlerChain.
- * <p/>
- * A HandlerChain always acts in the role of the special SOAP actor next. Refer to the
SOAP specification for the
- * URI name for this special SOAP actor. There is no need to set this special role
using this method.
- *
- * @param soapActorNames URIs for SOAP actor name
- */
- public void setRoles(String[] soapActorNames)
- {
- List<String> newRoles = Arrays.asList(soapActorNames);
- log.debug("setRoles: " + newRoles);
-
- roles.clear();
- roles.addAll(newRoles);
- }
-
- /**
- * Initiates the request processing for this handler chain.
- *
- * @param msgContext MessageContext parameter provides access to the request SOAP
message.
- * @return Returns true if all handlers in chain have been processed. Returns false if
a handler in the chain returned false from its handleRequest method.
- * @throws javax.xml.rpc.JAXRPCException if any processing error happens
- */
- public boolean handleRequest(MessageContext msgContext)
- {
- return handleRequestInternal(msgContext, HandlerType.ALL);
- }
-
- public boolean handleRequest(MessageContext msgContext, HandlerType type)
- {
- return handleRequestInternal(msgContext, type);
- }
-
- private boolean handleRequestInternal(MessageContext msgContext, HandlerType type)
- {
- boolean doNext = true;
-
- if (handlers.size() > 0)
- {
- log.debug("Enter: handleRequest");
-
- SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
-
- // Replace handlers that did not survive the previous call
- replaceDirtyHandlers();
-
- int handlerIndex = 0;
- Handler currHandler = null;
- try
- {
- String lastMessageTrace = null;
- for (; doNext && handlerIndex < handlers.size(); handlerIndex++)
- {
- HandlerEntry handlerEntry = (HandlerEntry)handlers.get(handlerIndex);
- if (type == HandlerType.ALL || type == handlerEntry.getType())
- {
- currHandler = handlerEntry.getHandler();
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("BEFORE handleRequest - "
+ currHandler, soapPart, lastMessageTrace);
- }
-
- doNext = currHandler.handleRequest(msgContext);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("AFTER handleRequest - "
+ currHandler, soapPart, lastMessageTrace);
- }
- }
- }
- }
- catch (RuntimeException e)
- {
- log.error("RuntimeException in request handler", e);
- doNext = false;
- throw e;
- }
- finally
- {
- // we start at this index in the response chain
- if (doNext == false)
- falseIndex = (handlerIndex - 1);
-
- jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleRequest with status: " + doNext);
- }
- }
-
- return doNext;
- }
-
- /**
- * Initiates the response processing for this handler chain.
- * <p/>
- * In this implementation, the response handler chain starts processing from the same
Handler
- * instance (that returned false) and goes backward in the execution sequence.
- *
- * @return Returns true if all handlers in chain have been processed.
- * Returns false if a handler in the chain returned false from its
handleResponse method.
- * @throws javax.xml.rpc.JAXRPCException if any processing error happens
- */
- public boolean handleResponse(MessageContext msgContext)
- {
- return handleResponseInternal(msgContext, HandlerType.ALL);
- }
-
- public boolean handleResponse(MessageContext msgContext, HandlerType type)
- {
- return handleResponseInternal(msgContext, type);
- }
-
- private boolean handleResponseInternal(MessageContext msgContext, HandlerType type)
- {
- boolean doNext = true;
-
- if (handlers.size() > 0)
- {
- log.debug("Enter: handleResponse");
-
- SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
-
- int handlerIndex = handlers.size() - 1;
- if (falseIndex != -1)
- handlerIndex = falseIndex;
-
- Handler currHandler = null;
- try
- {
- String lastMessageTrace = null;
- for (; doNext && handlerIndex >= 0; handlerIndex--)
- {
- HandlerEntry handlerEntry = (HandlerEntry)handlers.get(handlerIndex);
- if (type == HandlerType.ALL || type == handlerEntry.getType())
- {
- currHandler = handlerEntry.getHandler();
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("BEFORE handleResponse -
" + currHandler, soapPart, lastMessageTrace);
- }
-
- doNext = currHandler.handleResponse(msgContext);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("AFTER handleResponse - "
+ currHandler, soapPart, lastMessageTrace);
- }
- }
- }
- }
- catch (RuntimeException rte)
- {
- log.error("RuntimeException in response handler", rte);
- doNext = false;
- throw rte;
- }
- finally
- {
- // we start at this index in the fault chain
- if (doNext == false)
- falseIndex = (handlerIndex - 1);
-
- jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleResponse with status: " + doNext);
- }
- }
-
- return doNext;
- }
-
- /**
- * Initiates the SOAP fault processing for this handler chain.
- * <p/>
- * In this implementation, the fault handler chain starts processing from the same
Handler
- * instance (that returned false) and goes backward in the execution sequence.
- *
- * @return Returns true if all handlers in chain have been processed.
- * Returns false if a handler in the chain returned false from its handleFault
method.
- * @throws javax.xml.rpc.JAXRPCException if any processing error happens
- */
- public boolean handleFault(MessageContext msgContext)
- {
- boolean doNext = true;
-
- if (handlers.size() > 0)
- {
- log.debug("Enter: handleFault");
-
- SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
-
- try
- {
- int handlerIndex = handlers.size() - 1;
- if (falseIndex != -1)
- handlerIndex = falseIndex;
-
- Handler currHandler = null;
- for (; doNext && handlerIndex >= 0; handlerIndex--)
- {
- currHandler = ((HandlerEntry)handlers.get(handlerIndex)).getHandler();
- log.debug("Handle fault: " + currHandler);
- doNext = currHandler.handleFault(msgContext);
- }
- }
- finally
- {
- jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleFault with status: " + doNext);
- }
- }
-
- return doNext;
- }
-
- /** Trace the SOAPPart, do nothing if the String representation is equal to the last
one.
- */
- protected String traceSOAPPart(String logMsg, SOAPPart soapPart, String
lastMessageTrace)
- {
- try
- {
- SOAPEnvelopeImpl soapEnv = (SOAPEnvelopeImpl)soapPart.getEnvelope();
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv, true);
- if (envStr.equals(lastMessageTrace))
- {
- log.trace(logMsg + ": unchanged");
- }
- else
- {
- log.trace(logMsg + "\n" + envStr);
- lastMessageTrace = envStr;
- }
- return lastMessageTrace;
- }
- catch (Exception ex)
- {
- log.error("Cannot trace SOAP message", ex);
- return null;
- }
- }
-
- /**
- * Replace handlers that did not survive the previous call
- */
- protected void replaceDirtyHandlers()
- {
- for (int i = 0; i < handlers.size(); i++)
- {
- HandlerEntry entry = (HandlerEntry)handlers.get(i);
- if (entry.handler.getState() == HandlerWrapper.DOES_NOT_EXIST)
- {
- log.debug("Replacing dirty handler: " + entry.handler);
- try
- {
- HandlerWrapper handler = new
HandlerWrapper((Handler)entry.info.getHandlerClass().newInstance());
- entry.handler = handler;
- handler.init(entry.info);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.error("Cannot create handler instance for: " + entry.info,
ex);
- }
- }
- }
- }
-
- /**
- * Get the handler at the requested position
- */
- protected Handler getHandlerAt(int pos)
- {
- if (pos < 0 || handlers.size() <= pos)
- throw new IllegalArgumentException("No handler at position: " + pos);
-
- HandlerEntry entry = (HandlerEntry)handlers.get(pos);
- return entry.handler;
- }
-
- /**
- * R1027 A RECEIVER MUST generate a "soap:MustUnderstand" fault when a
- * message contains a mandatory header block (i.e., one that has a
- * soap:mustUnderstand attribute with the value "1") targeted at the
- * receiver (via soap:actor) that the receiver does not understand.
- */
- public static void checkMustUnderstand(CommonMessageContext msgContext, String[]
roles)
- {
- SOAPHeaderElement mustUnderstandHeaderElement = null;
- List roleList = (roles != null ? Arrays.asList(roles) : new ArrayList());
- try
- {
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
-
- // A SOAPHeaderElement is possibly bound to the endpoint operation
- // in order to check that we need a the opMetaData
- OperationMetaData opMetaData = msgContext.getOperationMetaData();
- if (opMetaData == null)
- {
- // The security handler must have decrypted the incomming message
- // before the dispatch target operation can be known
- EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
- opMetaData = soapMessage.getOperationMetaData(epMetaData);
- }
-
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- if (soapEnvelope != null && soapEnvelope.getHeader() != null)
- {
- Iterator it = soapEnvelope.getHeader().examineAllHeaderElements();
- while (it.hasNext() && mustUnderstandHeaderElement == null)
- {
- SOAPHeaderElement soapHeaderElement = (SOAPHeaderElement)it.next();
- Name name = soapHeaderElement.getElementName();
- QName xmlName = new QName(name.getURI(), name.getLocalName());
-
- ParameterMetaData paramMetaData = (opMetaData != null ?
opMetaData.getParameter(xmlName) : null);
- boolean isBoundHeader = (paramMetaData != null &&
paramMetaData.isInHeader());
-
- if (soapHeaderElement.getMustUnderstand() && isBoundHeader ==
false)
- {
- String actor = soapHeaderElement.getActor();
- boolean noActor = (actor == null || actor.length() == 0);
- boolean nextActor = Constants.URI_SOAP11_NEXT_ACTOR.equals(actor);
- if (noActor || nextActor || roleList.contains(actor))
- {
- mustUnderstandHeaderElement = soapHeaderElement;
- }
- }
- }
- }
- }
- catch (SOAPException ex)
- {
- log.error("Cannot check mustUnderstand for headers", ex);
- }
-
- if (mustUnderstandHeaderElement != null)
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND;
- String faultString = "Unprocessed 'mustUnderstand' header element:
" + mustUnderstandHeaderElement.getElementName();
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
- }
-
- /**
- * An entry in the handler list
- */
- private class HandlerEntry
- {
- private HandlerWrapper handler;
- private HandlerInfo info;
- private HandlerType type;
-
- public HandlerEntry(HandlerWrapper handler, HandlerInfo info, HandlerType type)
- {
- if (handler == null || info == null)
- throw new IllegalStateException("Invalid handler entry");
-
- if (type == null)
- {
- log.debug("Using handler type default: " + HandlerType.ENDPOINT);
- type = HandlerType.ENDPOINT;
- }
-
- this.handler = handler;
- this.info = info;
- this.type = type;
- }
-
- public Handler getHandler()
- {
- return handler;
- }
-
- public HandlerInfo getInfo()
- {
- return info;
- }
-
- public HandlerType getType()
- {
- return type;
- }
- }
-
- // java.util.List interface
****************************************************************************************
-
- public boolean remove(Object o)
- {
- return handlers.remove(o);
- }
-
- public boolean containsAll(Collection c)
- {
- return handlers.containsAll(c);
- }
-
- public boolean removeAll(Collection c)
- {
- return handlers.removeAll(c);
- }
-
- public boolean retainAll(Collection c)
- {
- return handlers.retainAll(c);
- }
-
- public int hashCode()
- {
- return handlers.hashCode();
- }
-
- public boolean equals(Object o)
- {
- return handlers.equals(o);
- }
-
- public Iterator iterator()
- {
- return handlers.iterator();
- }
-
- public List subList(int fromIndex, int toIndex)
- {
- return handlers.subList(fromIndex, toIndex);
- }
-
- public ListIterator listIterator()
- {
- return handlers.listIterator();
- }
-
- public ListIterator listIterator(int index)
- {
- return handlers.listIterator(index);
- }
-
- public int size()
- {
- return handlers.size();
- }
-
- public void clear()
- {
- handlers.clear();
- }
-
- public boolean isEmpty()
- {
- return handlers.isEmpty();
- }
-
- public Object[] toArray()
- {
- return handlers.toArray();
- }
-
- public Object get(int index)
- {
- return handlers.get(index);
- }
-
- public Object remove(int index)
- {
- return handlers.remove(index);
- }
-
- public void add(int index, Object element)
- {
- handlers.add(index, (HandlerEntry)element);
- }
-
- public int indexOf(Object elem)
- {
- return handlers.indexOf(elem);
- }
-
- public int lastIndexOf(Object elem)
- {
- return handlers.lastIndexOf(elem);
- }
-
- public boolean add(Object o)
- {
- return handlers.add((HandlerEntry)o);
- }
-
- public boolean contains(Object elem)
- {
- return handlers.contains(elem);
- }
-
- public boolean addAll(int index, Collection c)
- {
- return handlers.addAll(index, c);
- }
-
- public boolean addAll(Collection c)
- {
- return handlers.addAll(c);
- }
-
- public Object set(int index, Object element)
- {
- return handlers.set(index, (HandlerEntry)element);
- }
-
- public Object[] toArray(Object[] a)
- {
- return handlers.toArray(a);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerChainBaseImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerChainBaseImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,730 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc.handler;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.handler.Handler;
+import javax.xml.rpc.handler.HandlerChain;
+import javax.xml.rpc.handler.HandlerInfo;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPPart;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPElementWriter;
+import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+
+/**
+ * Represents a list of handlers. All elements in the
+ * HandlerChain are of the type javax.xml.rpc.handler.Handler.
+ * <p/>
+ * Abstracts the policy and mechanism for the invocation of the registered handlers.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 06-May-2004
+ */
+public abstract class HandlerChainBaseImpl implements HandlerChain
+{
+ private static Logger log = Logger.getLogger(HandlerChainBaseImpl.class);
+
+ public static final int STATE_DOES_NOT_EXIST = 0;
+ public static final int STATE_CREATED = 1;
+ public static final int STATE_READY = 2;
+ public static final int STATE_DESTROYED = 3;
+
+ // The List<Entry> objects
+ protected List<HandlerEntry> handlers = new ArrayList<HandlerEntry>();
+ // The roles associated with the handler chain
+ protected Set<String> roles = new HashSet<String>();
+ // The index of the first handler that returned false during processing
+ protected int falseIndex = -1;
+ // The state of this handler chain
+ protected int state;
+
+ /**
+ * Constructs a handler chain with the given handlers infos
+ */
+ public HandlerChainBaseImpl(List<HandlerInfo> infos, Set<String> roles)
+ {
+ log.debug("Create a handler chain for roles: " + roles);
+ addHandlersToChain(infos, roles);
+ }
+
+ /** Get the list of handler infos
+ */
+ public List<HandlerInfo> getHandlerInfos()
+ {
+ List<HandlerInfo> list = new ArrayList<HandlerInfo>();
+ for (int i = 0; i < handlers.size(); i++)
+ {
+ HandlerEntry entry = (HandlerEntry)handlers.get(i);
+ list.add(entry.info);
+ }
+ return list;
+ }
+
+ /**
+ * Initialize the a handler chain with the given handlers infos
+ *
+ * @throws javax.xml.rpc.JAXRPCException If any error during initialization
+ */
+ private void addHandlersToChain(List<HandlerInfo> infos, Set<String>
roleSet)
+ {
+ try
+ {
+ if (infos != null)
+ {
+ for (HandlerInfo info : infos)
+ {
+ HandlerWrapper handler = new
HandlerWrapper((Handler)info.getHandlerClass().newInstance());
+ HandlerType type =
(HandlerType)info.getHandlerConfig().get(HandlerType.class.getName());
+ handlers.add(new HandlerEntry(handler, info, type));
+ }
+ }
+ if (roleSet != null)
+ {
+ roles.addAll(roleSet);
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new JAXRPCException("Cannot initialize handler chain", ex);
+ }
+
+ // set state to created
+ state = STATE_CREATED;
+ }
+
+ /**
+ * Get the state of this handler chain
+ */
+ public int getState()
+ {
+ return state;
+ }
+
+ /**
+ * Initializes the configuration for a HandlerChain.
+ *
+ * @param config Configuration for the initialization of this handler chain
+ * @throws javax.xml.rpc.JAXRPCException If any error during initialization
+ */
+ public void init(Map config)
+ {
+ log.debug("init: [config=" + config + "]");
+ for (int i = 0; i < handlers.size(); i++)
+ {
+ HandlerEntry entry = (HandlerEntry)handlers.get(i);
+ entry.handler.init(entry.info);
+ }
+
+ // set state to ready
+ state = STATE_READY;
+ }
+
+ /**
+ * Indicates the end of lifecycle for a HandlerChain.
+ *
+ * @throws javax.xml.rpc.JAXRPCException If any error during destroy
+ */
+ public void destroy()
+ {
+ log.debug("destroy");
+ for (int i = 0; i < handlers.size(); i++)
+ {
+ HandlerEntry entry = (HandlerEntry)handlers.get(i);
+ entry.handler.destroy();
+ }
+ handlers.clear();
+
+ // set state to destroyed
+ state = STATE_DESTROYED;
+ }
+
+ /**
+ * Gets SOAP actor roles registered for this HandlerChain at this SOAP node. The
returned array includes the
+ * special SOAP actor next.
+ *
+ * @return SOAP Actor roles as URIs
+ */
+ public String[] getRoles()
+ {
+ Set<String> auxlist = new HashSet<String>(roles);
+ auxlist.add(Constants.URI_SOAP11_NEXT_ACTOR);
+ String[] roleArr = new String[auxlist.size()];
+ auxlist.toArray(roleArr);
+ return roleArr;
+ }
+
+ /**
+ * Sets SOAP Actor roles for this HandlerChain. This specifies the set of roles in
which this HandlerChain is to act
+ * for the SOAP message processing at this SOAP node. These roles assumed by a
HandlerChain must be invariant during
+ * the processing of an individual SOAP message through the HandlerChain.
+ * <p/>
+ * A HandlerChain always acts in the role of the special SOAP actor next. Refer to the
SOAP specification for the
+ * URI name for this special SOAP actor. There is no need to set this special role
using this method.
+ *
+ * @param soapActorNames URIs for SOAP actor name
+ */
+ public void setRoles(String[] soapActorNames)
+ {
+ List<String> newRoles = Arrays.asList(soapActorNames);
+ log.debug("setRoles: " + newRoles);
+
+ roles.clear();
+ roles.addAll(newRoles);
+ }
+
+ /**
+ * Initiates the request processing for this handler chain.
+ *
+ * @param msgContext MessageContext parameter provides access to the request SOAP
message.
+ * @return Returns true if all handlers in chain have been processed. Returns false if
a handler in the chain returned false from its handleRequest method.
+ * @throws javax.xml.rpc.JAXRPCException if any processing error happens
+ */
+ public boolean handleRequest(MessageContext msgContext)
+ {
+ return handleRequestInternal(msgContext, HandlerType.ALL);
+ }
+
+ public boolean handleRequest(MessageContext msgContext, HandlerType type)
+ {
+ return handleRequestInternal(msgContext, type);
+ }
+
+ private boolean handleRequestInternal(MessageContext msgContext, HandlerType type)
+ {
+ boolean doNext = true;
+
+ if (handlers.size() > 0)
+ {
+ log.debug("Enter: handleRequest");
+
+ SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
+ jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
+
+ // Replace handlers that did not survive the previous call
+ replaceDirtyHandlers();
+
+ int handlerIndex = 0;
+ Handler currHandler = null;
+ try
+ {
+ String lastMessageTrace = null;
+ for (; doNext && handlerIndex < handlers.size(); handlerIndex++)
+ {
+ HandlerEntry handlerEntry = (HandlerEntry)handlers.get(handlerIndex);
+ if (type == HandlerType.ALL || type == handlerEntry.getType())
+ {
+ currHandler = handlerEntry.getHandler();
+
+ if (log.isTraceEnabled())
+ {
+ SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
+ lastMessageTrace = traceSOAPPart("BEFORE handleRequest - "
+ currHandler, soapPart, lastMessageTrace);
+ }
+
+ doNext = currHandler.handleRequest(msgContext);
+
+ if (log.isTraceEnabled())
+ {
+ SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
+ lastMessageTrace = traceSOAPPart("AFTER handleRequest - "
+ currHandler, soapPart, lastMessageTrace);
+ }
+ }
+ }
+ }
+ catch (RuntimeException e)
+ {
+ log.error("RuntimeException in request handler", e);
+ doNext = false;
+ throw e;
+ }
+ finally
+ {
+ // we start at this index in the response chain
+ if (doNext == false)
+ falseIndex = (handlerIndex - 1);
+
+ jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ log.debug("Exit: handleRequest with status: " + doNext);
+ }
+ }
+
+ return doNext;
+ }
+
+ /**
+ * Initiates the response processing for this handler chain.
+ * <p/>
+ * In this implementation, the response handler chain starts processing from the same
Handler
+ * instance (that returned false) and goes backward in the execution sequence.
+ *
+ * @return Returns true if all handlers in chain have been processed.
+ * Returns false if a handler in the chain returned false from its
handleResponse method.
+ * @throws javax.xml.rpc.JAXRPCException if any processing error happens
+ */
+ public boolean handleResponse(MessageContext msgContext)
+ {
+ return handleResponseInternal(msgContext, HandlerType.ALL);
+ }
+
+ public boolean handleResponse(MessageContext msgContext, HandlerType type)
+ {
+ return handleResponseInternal(msgContext, type);
+ }
+
+ private boolean handleResponseInternal(MessageContext msgContext, HandlerType type)
+ {
+ boolean doNext = true;
+
+ if (handlers.size() > 0)
+ {
+ log.debug("Enter: handleResponse");
+
+ SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
+ jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
+
+ int handlerIndex = handlers.size() - 1;
+ if (falseIndex != -1)
+ handlerIndex = falseIndex;
+
+ Handler currHandler = null;
+ try
+ {
+ String lastMessageTrace = null;
+ for (; doNext && handlerIndex >= 0; handlerIndex--)
+ {
+ HandlerEntry handlerEntry = (HandlerEntry)handlers.get(handlerIndex);
+ if (type == HandlerType.ALL || type == handlerEntry.getType())
+ {
+ currHandler = handlerEntry.getHandler();
+
+ if (log.isTraceEnabled())
+ {
+ SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
+ lastMessageTrace = traceSOAPPart("BEFORE handleResponse -
" + currHandler, soapPart, lastMessageTrace);
+ }
+
+ doNext = currHandler.handleResponse(msgContext);
+
+ if (log.isTraceEnabled())
+ {
+ SOAPPart soapPart = jaxrpcContext.getMessage().getSOAPPart();
+ lastMessageTrace = traceSOAPPart("AFTER handleResponse - "
+ currHandler, soapPart, lastMessageTrace);
+ }
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ log.error("RuntimeException in response handler", rte);
+ doNext = false;
+ throw rte;
+ }
+ finally
+ {
+ // we start at this index in the fault chain
+ if (doNext == false)
+ falseIndex = (handlerIndex - 1);
+
+ jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ log.debug("Exit: handleResponse with status: " + doNext);
+ }
+ }
+
+ return doNext;
+ }
+
+ /**
+ * Initiates the SOAP fault processing for this handler chain.
+ * <p/>
+ * In this implementation, the fault handler chain starts processing from the same
Handler
+ * instance (that returned false) and goes backward in the execution sequence.
+ *
+ * @return Returns true if all handlers in chain have been processed.
+ * Returns false if a handler in the chain returned false from its handleFault
method.
+ * @throws javax.xml.rpc.JAXRPCException if any processing error happens
+ */
+ public boolean handleFault(MessageContext msgContext)
+ {
+ boolean doNext = true;
+
+ if (handlers.size() > 0)
+ {
+ log.debug("Enter: handleFault");
+
+ SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
+ jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
+
+ try
+ {
+ int handlerIndex = handlers.size() - 1;
+ if (falseIndex != -1)
+ handlerIndex = falseIndex;
+
+ Handler currHandler = null;
+ for (; doNext && handlerIndex >= 0; handlerIndex--)
+ {
+ currHandler = ((HandlerEntry)handlers.get(handlerIndex)).getHandler();
+ log.debug("Handle fault: " + currHandler);
+ doNext = currHandler.handleFault(msgContext);
+ }
+ }
+ finally
+ {
+ jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ log.debug("Exit: handleFault with status: " + doNext);
+ }
+ }
+
+ return doNext;
+ }
+
+ /** Trace the SOAPPart, do nothing if the String representation is equal to the last
one.
+ */
+ protected String traceSOAPPart(String logMsg, SOAPPart soapPart, String
lastMessageTrace)
+ {
+ try
+ {
+ SOAPEnvelopeImpl soapEnv = (SOAPEnvelopeImpl)soapPart.getEnvelope();
+ String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv, true);
+ if (envStr.equals(lastMessageTrace))
+ {
+ log.trace(logMsg + ": unchanged");
+ }
+ else
+ {
+ log.trace(logMsg + "\n" + envStr);
+ lastMessageTrace = envStr;
+ }
+ return lastMessageTrace;
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot trace SOAP message", ex);
+ return null;
+ }
+ }
+
+ /**
+ * Replace handlers that did not survive the previous call
+ */
+ protected void replaceDirtyHandlers()
+ {
+ for (int i = 0; i < handlers.size(); i++)
+ {
+ HandlerEntry entry = (HandlerEntry)handlers.get(i);
+ if (entry.handler.getState() == HandlerWrapper.DOES_NOT_EXIST)
+ {
+ log.debug("Replacing dirty handler: " + entry.handler);
+ try
+ {
+ HandlerWrapper handler = new
HandlerWrapper((Handler)entry.info.getHandlerClass().newInstance());
+ entry.handler = handler;
+ handler.init(entry.info);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot create handler instance for: " + entry.info,
ex);
+ }
+ }
+ }
+ }
+
+ /**
+ * Get the handler at the requested position
+ */
+ protected Handler getHandlerAt(int pos)
+ {
+ if (pos < 0 || handlers.size() <= pos)
+ throw new IllegalArgumentException("No handler at position: " + pos);
+
+ HandlerEntry entry = (HandlerEntry)handlers.get(pos);
+ return entry.handler;
+ }
+
+ /**
+ * R1027 A RECEIVER MUST generate a "soap:MustUnderstand" fault when a
+ * message contains a mandatory header block (i.e., one that has a
+ * soap:mustUnderstand attribute with the value "1") targeted at the
+ * receiver (via soap:actor) that the receiver does not understand.
+ */
+ public static void checkMustUnderstand(CommonMessageContext msgContext, String[]
roles)
+ {
+ SOAPHeaderElement mustUnderstandHeaderElement = null;
+ List roleList = (roles != null ? Arrays.asList(roles) : new ArrayList());
+ try
+ {
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
+
+ // A SOAPHeaderElement is possibly bound to the endpoint operation
+ // in order to check that we need a the opMetaData
+ OperationMetaData opMetaData = msgContext.getOperationMetaData();
+ if (opMetaData == null)
+ {
+ // The security handler must have decrypted the incomming message
+ // before the dispatch target operation can be known
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ opMetaData = soapMessage.getOperationMetaData(epMetaData);
+ }
+
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ if (soapEnvelope != null && soapEnvelope.getHeader() != null)
+ {
+ Iterator it = soapEnvelope.getHeader().examineAllHeaderElements();
+ while (it.hasNext() && mustUnderstandHeaderElement == null)
+ {
+ SOAPHeaderElement soapHeaderElement = (SOAPHeaderElement)it.next();
+ Name name = soapHeaderElement.getElementName();
+ QName xmlName = new QName(name.getURI(), name.getLocalName());
+
+ ParameterMetaData paramMetaData = (opMetaData != null ?
opMetaData.getParameter(xmlName) : null);
+ boolean isBoundHeader = (paramMetaData != null &&
paramMetaData.isInHeader());
+
+ if (soapHeaderElement.getMustUnderstand() && isBoundHeader ==
false)
+ {
+ String actor = soapHeaderElement.getActor();
+ boolean noActor = (actor == null || actor.length() == 0);
+ boolean nextActor = Constants.URI_SOAP11_NEXT_ACTOR.equals(actor);
+ if (noActor || nextActor || roleList.contains(actor))
+ {
+ mustUnderstandHeaderElement = soapHeaderElement;
+ }
+ }
+ }
+ }
+ }
+ catch (SOAPException ex)
+ {
+ log.error("Cannot check mustUnderstand for headers", ex);
+ }
+
+ if (mustUnderstandHeaderElement != null)
+ {
+ QName faultCode = Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND;
+ String faultString = "Unprocessed 'mustUnderstand' header element:
" + mustUnderstandHeaderElement.getElementName();
+ throw new SOAPFaultException(faultCode, faultString, null, null);
+ }
+ }
+
+ /**
+ * An entry in the handler list
+ */
+ private class HandlerEntry
+ {
+ private HandlerWrapper handler;
+ private HandlerInfo info;
+ private HandlerType type;
+
+ public HandlerEntry(HandlerWrapper handler, HandlerInfo info, HandlerType type)
+ {
+ if (handler == null || info == null)
+ throw new IllegalStateException("Invalid handler entry");
+
+ if (type == null)
+ {
+ log.debug("Using handler type default: " + HandlerType.ENDPOINT);
+ type = HandlerType.ENDPOINT;
+ }
+
+ this.handler = handler;
+ this.info = info;
+ this.type = type;
+ }
+
+ public Handler getHandler()
+ {
+ return handler;
+ }
+
+ public HandlerInfo getInfo()
+ {
+ return info;
+ }
+
+ public HandlerType getType()
+ {
+ return type;
+ }
+ }
+
+ // java.util.List interface
****************************************************************************************
+
+ public boolean remove(Object o)
+ {
+ return handlers.remove(o);
+ }
+
+ public boolean containsAll(Collection c)
+ {
+ return handlers.containsAll(c);
+ }
+
+ public boolean removeAll(Collection c)
+ {
+ return handlers.removeAll(c);
+ }
+
+ public boolean retainAll(Collection c)
+ {
+ return handlers.retainAll(c);
+ }
+
+ public int hashCode()
+ {
+ return handlers.hashCode();
+ }
+
+ public boolean equals(Object o)
+ {
+ return handlers.equals(o);
+ }
+
+ public Iterator iterator()
+ {
+ return handlers.iterator();
+ }
+
+ public List subList(int fromIndex, int toIndex)
+ {
+ return handlers.subList(fromIndex, toIndex);
+ }
+
+ public ListIterator listIterator()
+ {
+ return handlers.listIterator();
+ }
+
+ public ListIterator listIterator(int index)
+ {
+ return handlers.listIterator(index);
+ }
+
+ public int size()
+ {
+ return handlers.size();
+ }
+
+ public void clear()
+ {
+ handlers.clear();
+ }
+
+ public boolean isEmpty()
+ {
+ return handlers.isEmpty();
+ }
+
+ public Object[] toArray()
+ {
+ return handlers.toArray();
+ }
+
+ public Object get(int index)
+ {
+ return handlers.get(index);
+ }
+
+ public Object remove(int index)
+ {
+ return handlers.remove(index);
+ }
+
+ public void add(int index, Object element)
+ {
+ handlers.add(index, (HandlerEntry)element);
+ }
+
+ public int indexOf(Object elem)
+ {
+ return handlers.indexOf(elem);
+ }
+
+ public int lastIndexOf(Object elem)
+ {
+ return handlers.lastIndexOf(elem);
+ }
+
+ public boolean add(Object o)
+ {
+ return handlers.add((HandlerEntry)o);
+ }
+
+ public boolean contains(Object elem)
+ {
+ return handlers.contains(elem);
+ }
+
+ public boolean addAll(int index, Collection c)
+ {
+ return handlers.addAll(index, c);
+ }
+
+ public boolean addAll(Collection c)
+ {
+ return handlers.addAll(c);
+ }
+
+ public Object set(int index, Object element)
+ {
+ return handlers.set(index, (HandlerEntry)element);
+ }
+
+ public Object[] toArray(Object[] a)
+ {
+ return handlers.toArray(a);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,200 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.jaxrpc.handler;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.handler.HandlerChain;
-import javax.xml.rpc.handler.HandlerInfo;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.HandlerDelegate;
-import org.jboss.ws.core.server.ServiceEndpointInfo;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.extras.xop.XOPContext;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/** Delegates to JAXRPC handlers
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public class HandlerDelegateJAXRPC implements HandlerDelegate
-{
- // provide logging
- private static Logger log = Logger.getLogger(HandlerDelegateJAXRPC.class);
-
- // This endpoints handler chain
- private ServerHandlerChain preHandlerChain;
- // This endpoints handler chain
- private ServerHandlerChain jaxrpcHandlerChain;
- // This endpoints handler chain
- private ServerHandlerChain postHandlerChain;
-
- public HandlerDelegateJAXRPC()
- {
- }
-
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
- ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
-
- // Initialize the handler chain
- if (sepMetaData.isHandlersInitialized() == false)
- {
- initHandlerChain(seInfo, HandlerType.PRE);
- initHandlerChain(seInfo, HandlerType.ENDPOINT);
- initHandlerChain(seInfo, HandlerType.POST);
- sepMetaData.setHandlersInitialized(true);
- }
-
- boolean status = true;
- String[] roles = null;
-
- HandlerChain handlerChain = null;
- if (type == HandlerType.PRE)
- handlerChain = preHandlerChain;
- else if (type == HandlerType.ENDPOINT)
- handlerChain = jaxrpcHandlerChain;
- else if (type == HandlerType.POST)
- handlerChain = postHandlerChain;
-
- if (handlerChain != null)
- {
- roles = handlerChain.getRoles();
- status = handlerChain.handleRequest(msgContext);
- }
-
- // BP-1.0 R1027
- if (type == HandlerType.POST)
- HandlerChainBaseImpl.checkMustUnderstand(msgContext, roles);
-
- return status;
- }
-
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
-
- HandlerChain handlerChain = null;
- if (type == HandlerType.PRE)
- handlerChain = preHandlerChain;
- else if (type == HandlerType.ENDPOINT)
- handlerChain = jaxrpcHandlerChain;
- else if (type == HandlerType.POST)
- handlerChain = postHandlerChain;
-
- boolean status = (handlerChain != null ? handlerChain.handleResponse(msgContext) :
true);
-
- if(type == HandlerType.ENDPOINT)
- XOPContext.visitAndRestoreXOPData();
-
- return status;
- }
-
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
- {
- SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
-
- HandlerChain handlerChain = null;
- if (type == HandlerType.PRE)
- handlerChain = preHandlerChain;
- else if (type == HandlerType.ENDPOINT)
- handlerChain = jaxrpcHandlerChain;
- else if (type == HandlerType.POST)
- handlerChain = postHandlerChain;
-
- boolean status = (handlerChain != null ? handlerChain.handleFault(msgContext) :
true);
-
- if(type == HandlerType.ENDPOINT)
- XOPContext.visitAndRestoreXOPData();
-
- return status;
- }
-
- /**
- * Init the handler chain
- */
- private void initHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- Set<String> handlerRoles = new HashSet<String>();
- List<HandlerInfo> hInfos = new ArrayList<HandlerInfo>();
-
- ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
- for (HandlerMetaData handlerMetaData : sepMetaData.getHandlerMetaData(type))
- {
- HandlerMetaDataJAXRPC jaxrpcMetaData = (HandlerMetaDataJAXRPC)handlerMetaData;
- handlerRoles.addAll(jaxrpcMetaData.getSoapRoles());
-
- HashMap<String, Object> hConfig = new HashMap<String, Object>();
- for (HandlerInitParam param : jaxrpcMetaData.getInitParams())
- {
- hConfig.put(param.getParamName(), param.getParamValue());
- }
-
- Set<QName> headers = jaxrpcMetaData.getSoapHeaders();
- QName[] headerArr = new QName[headers.size()];
- headers.toArray(headerArr);
-
- Class hClass = jaxrpcMetaData.getHandlerClass();
- hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
- HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
-
- log.debug("Adding server side handler to service '" +
sepMetaData.getQName() + "': " + info);
- hInfos.add(info);
- }
-
- initHandlerChain(seInfo, hInfos, handlerRoles, type);
- }
-
- private void initHandlerChain(ServiceEndpointInfo seInfo, List<HandlerInfo>
hInfos, Set<String> handlerRoles, HandlerType type)
- {
- log.debug("Init handler chain with [" + hInfos.size() + "]
handlers");
-
- ServerHandlerChain handlerChain = new ServerHandlerChain(hInfos, handlerRoles,
type);
- if (type == HandlerType.PRE)
- preHandlerChain = handlerChain;
- else if (type == HandlerType.ENDPOINT)
- jaxrpcHandlerChain = handlerChain;
- else if (type == HandlerType.POST)
- postHandlerChain = handlerChain;
-
- if (handlerChain.getState() == ServerHandlerChain.STATE_CREATED)
- {
- // what is the config for a handler chain?
- handlerChain.init(null);
- }
- }
-
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,200 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc.handler;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.HandlerChain;
+import javax.xml.rpc.handler.HandlerInfo;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.umdm.HandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.common.umdm.ServerEndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.server.HandlerDelegate;
+import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.extras.xop.XOPContext;
+
+/** Delegates to JAXRPC handlers
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-Jan-2005
+ */
+public class HandlerDelegateJAXRPC implements HandlerDelegate
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(HandlerDelegateJAXRPC.class);
+
+ // This endpoints handler chain
+ private ServerHandlerChain preHandlerChain;
+ // This endpoints handler chain
+ private ServerHandlerChain jaxrpcHandlerChain;
+ // This endpoints handler chain
+ private ServerHandlerChain postHandlerChain;
+
+ public HandlerDelegateJAXRPC()
+ {
+ }
+
+ public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ {
+ SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
+ ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
+
+ // Initialize the handler chain
+ if (sepMetaData.isHandlersInitialized() == false)
+ {
+ initHandlerChain(seInfo, HandlerType.PRE);
+ initHandlerChain(seInfo, HandlerType.ENDPOINT);
+ initHandlerChain(seInfo, HandlerType.POST);
+ sepMetaData.setHandlersInitialized(true);
+ }
+
+ boolean status = true;
+ String[] roles = null;
+
+ HandlerChain handlerChain = null;
+ if (type == HandlerType.PRE)
+ handlerChain = preHandlerChain;
+ else if (type == HandlerType.ENDPOINT)
+ handlerChain = jaxrpcHandlerChain;
+ else if (type == HandlerType.POST)
+ handlerChain = postHandlerChain;
+
+ if (handlerChain != null)
+ {
+ roles = handlerChain.getRoles();
+ status = handlerChain.handleRequest(msgContext);
+ }
+
+ // BP-1.0 R1027
+ if (type == HandlerType.POST)
+ HandlerChainBaseImpl.checkMustUnderstand(msgContext, roles);
+
+ return status;
+ }
+
+ public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ {
+ SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
+
+ HandlerChain handlerChain = null;
+ if (type == HandlerType.PRE)
+ handlerChain = preHandlerChain;
+ else if (type == HandlerType.ENDPOINT)
+ handlerChain = jaxrpcHandlerChain;
+ else if (type == HandlerType.POST)
+ handlerChain = postHandlerChain;
+
+ boolean status = (handlerChain != null ? handlerChain.handleResponse(msgContext) :
true);
+
+ if(type == HandlerType.ENDPOINT)
+ XOPContext.visitAndRestoreXOPData();
+
+ return status;
+ }
+
+ public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
+ {
+ SOAPMessageContextJAXRPC msgContext =
(SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
+
+ HandlerChain handlerChain = null;
+ if (type == HandlerType.PRE)
+ handlerChain = preHandlerChain;
+ else if (type == HandlerType.ENDPOINT)
+ handlerChain = jaxrpcHandlerChain;
+ else if (type == HandlerType.POST)
+ handlerChain = postHandlerChain;
+
+ boolean status = (handlerChain != null ? handlerChain.handleFault(msgContext) :
true);
+
+ if(type == HandlerType.ENDPOINT)
+ XOPContext.visitAndRestoreXOPData();
+
+ return status;
+ }
+
+ /**
+ * Init the handler chain
+ */
+ private void initHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ {
+ Set<String> handlerRoles = new HashSet<String>();
+ List<HandlerInfo> hInfos = new ArrayList<HandlerInfo>();
+
+ ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
+ for (HandlerMetaData handlerMetaData : sepMetaData.getHandlerMetaData(type))
+ {
+ HandlerMetaDataJAXRPC jaxrpcMetaData = (HandlerMetaDataJAXRPC)handlerMetaData;
+ handlerRoles.addAll(jaxrpcMetaData.getSoapRoles());
+
+ HashMap<String, Object> hConfig = new HashMap<String, Object>();
+ for (HandlerInitParam param : jaxrpcMetaData.getInitParams())
+ {
+ hConfig.put(param.getParamName(), param.getParamValue());
+ }
+
+ Set<QName> headers = jaxrpcMetaData.getSoapHeaders();
+ QName[] headerArr = new QName[headers.size()];
+ headers.toArray(headerArr);
+
+ Class hClass = jaxrpcMetaData.getHandlerClass();
+ hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
+ HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
+
+ log.debug("Adding server side handler to service '" +
sepMetaData.getQName() + "': " + info);
+ hInfos.add(info);
+ }
+
+ initHandlerChain(seInfo, hInfos, handlerRoles, type);
+ }
+
+ private void initHandlerChain(ServiceEndpointInfo seInfo, List<HandlerInfo>
hInfos, Set<String> handlerRoles, HandlerType type)
+ {
+ log.debug("Init handler chain with [" + hInfos.size() + "]
handlers");
+
+ ServerHandlerChain handlerChain = new ServerHandlerChain(hInfos, handlerRoles,
type);
+ if (type == HandlerType.PRE)
+ preHandlerChain = handlerChain;
+ else if (type == HandlerType.ENDPOINT)
+ jaxrpcHandlerChain = handlerChain;
+ else if (type == HandlerType.POST)
+ postHandlerChain = handlerChain;
+
+ if (handlerChain.getState() == ServerHandlerChain.STATE_CREATED)
+ {
+ // what is the config for a handler chain?
+ handlerChain.init(null);
+ }
+ }
+
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerWrapper.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,201 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.handler;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.handler.Handler;
-import javax.xml.rpc.handler.HandlerInfo;
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.logging.Logger;
-
-/**
- * A wrapper arround a {@link javax.xml.rpc.handler.Handler} that takes care of its
lifecycle.
- *
- * @author thomas.diesler(a)jboss.org
- */
-public class HandlerWrapper implements Handler
-{
- private static Logger log = Logger.getLogger(HandlerWrapper.class);
-
- public final static int DOES_NOT_EXIST = 0;
- public final static int METHOD_READY = 1;
-
- // The states as string
- private static String[] stateNames = new String[]{"DOES_NOT_EXIST",
"METHOD_READY"};
-
- // The handler to delegate to
- private Handler delegate;
- // The handler state
- private int state;
-
- /**
- * Delegate to the given handler
- */
- public HandlerWrapper(Handler handler)
- {
- delegate = handler;
- state = DOES_NOT_EXIST; // this is somewhat a lie ;-)
- }
-
- /**
- * Get the current state
- */
- public int getState()
- {
- return state;
- }
-
- /**
- * Get the current state as string
- */
- public String getStateAsString()
- {
- return stateNames[state];
- }
-
- /**
- * Gets the header blocks processed by this Handler instance.
- */
- public QName[] getHeaders()
- {
- return delegate.getHeaders();
- }
-
- /**
- * The init method enables the Handler instance to initialize itself.
- */
- public void init(HandlerInfo config) throws JAXRPCException
- {
- log.debug("init: " + delegate);
- delegate.init(config);
- state = METHOD_READY;
- }
-
- /**
- * The destroy method indicates the end of lifecycle for a Handler instance.
- */
- public void destroy() throws JAXRPCException
- {
- log.debug("destroy: " + delegate);
- state = DOES_NOT_EXIST;
- delegate.destroy();
- }
-
- /**
- * The handleRequest method processes the request message.
- */
- public boolean handleRequest(MessageContext msgContext) throws JAXRPCException,
SOAPFaultException
- {
- if (state == DOES_NOT_EXIST)
- {
- log.warn("Handler is in state DOES_NOT_EXIST, skipping
Handler.handleRequest for: " + delegate);
- return true;
- }
-
- try
- {
- return delegate.handleRequest(msgContext);
- }
- catch (RuntimeException e)
- {
- return handleRuntimeException(e);
- }
- }
-
- /**
- * The handleResponse method processes the response SOAP message.
- */
- public boolean handleResponse(MessageContext msgContext)
- {
- if (state == DOES_NOT_EXIST)
- {
- log.warn("Handler is in state DOES_NOT_EXIST, skipping
Handler.handleResponse for: " + delegate);
- return true;
- }
-
- try
- {
- return delegate.handleResponse(msgContext);
- }
- catch (RuntimeException e)
- {
- return handleRuntimeException(e);
- }
- }
-
- /**
- * The handleFault method processes the SOAP faults based on the SOAP message
processing model.
- */
- public boolean handleFault(MessageContext msgContext)
- {
- if (state == DOES_NOT_EXIST)
- {
- log.warn("Handler is in state DOES_NOT_EXIST, skipping Handler.handleFault
for: " + delegate);
- return true;
- }
-
- try
- {
- return delegate.handleFault(msgContext);
- }
- catch (RuntimeException e)
- {
- return handleRuntimeException(e);
- }
- }
-
- /**
- * As defined by JAX-RPC, a RuntimeException(other than SOAPFaultException) thrown
from any method of
- * the Handler results in the destroymethod being invoked and transition to the �Does
Not Exist� state.
- */
- private boolean handleRuntimeException(RuntimeException e)
- {
- if ((e instanceof SOAPFaultException) == false)
- {
- log.warn("RuntimeException in handler method, transition to
DOES_NOT_EXIST");
- destroy();
- }
-
- throw e;
- }
-
- /**
- * Returns a hash code value for the object.
- */
- public int hashCode()
- {
- return delegate.hashCode();
- }
-
- /**
- * Returns a string representation of the object.
- */
- public String toString()
- {
- return "[state=" + getStateAsString() + ",handler=" + delegate
+ "]";
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerWrapper.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerWrapper.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,201 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.handler;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.handler.Handler;
+import javax.xml.rpc.handler.HandlerInfo;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A wrapper arround a {@link javax.xml.rpc.handler.Handler} that takes care of its
lifecycle.
+ *
+ * @author thomas.diesler(a)jboss.org
+ */
+public class HandlerWrapper implements Handler
+{
+ private static Logger log = Logger.getLogger(HandlerWrapper.class);
+
+ public final static int DOES_NOT_EXIST = 0;
+ public final static int METHOD_READY = 1;
+
+ // The states as string
+ private static String[] stateNames = new String[]{"DOES_NOT_EXIST",
"METHOD_READY"};
+
+ // The handler to delegate to
+ private Handler delegate;
+ // The handler state
+ private int state;
+
+ /**
+ * Delegate to the given handler
+ */
+ public HandlerWrapper(Handler handler)
+ {
+ delegate = handler;
+ state = DOES_NOT_EXIST; // this is somewhat a lie ;-)
+ }
+
+ /**
+ * Get the current state
+ */
+ public int getState()
+ {
+ return state;
+ }
+
+ /**
+ * Get the current state as string
+ */
+ public String getStateAsString()
+ {
+ return stateNames[state];
+ }
+
+ /**
+ * Gets the header blocks processed by this Handler instance.
+ */
+ public QName[] getHeaders()
+ {
+ return delegate.getHeaders();
+ }
+
+ /**
+ * The init method enables the Handler instance to initialize itself.
+ */
+ public void init(HandlerInfo config) throws JAXRPCException
+ {
+ log.debug("init: " + delegate);
+ delegate.init(config);
+ state = METHOD_READY;
+ }
+
+ /**
+ * The destroy method indicates the end of lifecycle for a Handler instance.
+ */
+ public void destroy() throws JAXRPCException
+ {
+ log.debug("destroy: " + delegate);
+ state = DOES_NOT_EXIST;
+ delegate.destroy();
+ }
+
+ /**
+ * The handleRequest method processes the request message.
+ */
+ public boolean handleRequest(MessageContext msgContext) throws JAXRPCException,
SOAPFaultException
+ {
+ if (state == DOES_NOT_EXIST)
+ {
+ log.warn("Handler is in state DOES_NOT_EXIST, skipping
Handler.handleRequest for: " + delegate);
+ return true;
+ }
+
+ try
+ {
+ return delegate.handleRequest(msgContext);
+ }
+ catch (RuntimeException e)
+ {
+ return handleRuntimeException(e);
+ }
+ }
+
+ /**
+ * The handleResponse method processes the response SOAP message.
+ */
+ public boolean handleResponse(MessageContext msgContext)
+ {
+ if (state == DOES_NOT_EXIST)
+ {
+ log.warn("Handler is in state DOES_NOT_EXIST, skipping
Handler.handleResponse for: " + delegate);
+ return true;
+ }
+
+ try
+ {
+ return delegate.handleResponse(msgContext);
+ }
+ catch (RuntimeException e)
+ {
+ return handleRuntimeException(e);
+ }
+ }
+
+ /**
+ * The handleFault method processes the SOAP faults based on the SOAP message
processing model.
+ */
+ public boolean handleFault(MessageContext msgContext)
+ {
+ if (state == DOES_NOT_EXIST)
+ {
+ log.warn("Handler is in state DOES_NOT_EXIST, skipping Handler.handleFault
for: " + delegate);
+ return true;
+ }
+
+ try
+ {
+ return delegate.handleFault(msgContext);
+ }
+ catch (RuntimeException e)
+ {
+ return handleRuntimeException(e);
+ }
+ }
+
+ /**
+ * As defined by JAX-RPC, a RuntimeException(other than SOAPFaultException) thrown
from any method of
+ * the Handler results in the destroymethod being invoked and transition to the �Does
Not Exist� state.
+ */
+ private boolean handleRuntimeException(RuntimeException e)
+ {
+ if ((e instanceof SOAPFaultException) == false)
+ {
+ log.warn("RuntimeException in handler method, transition to
DOES_NOT_EXIST");
+ destroy();
+ }
+
+ throw e;
+ }
+
+ /**
+ * Returns a hash code value for the object.
+ */
+ public int hashCode()
+ {
+ return delegate.hashCode();
+ }
+
+ /**
+ * Returns a string representation of the object.
+ */
+ public String toString()
+ {
+ return "[state=" + getStateAsString() + ",handler=" + delegate
+ "]";
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/MessageContextJAXRPC.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.jaxrpc.handler;
-
-// $Id$
-
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.xb.binding.NamespaceRegistry;
-
-/**
- * The message context that is processed by a handler
- * in the handle method.
- * <p/>
- * Provides methods to manage a property set.
- * MessageContext properties enable handlers in a handler chain to share
- * processing related state.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-May-2004
- */
-public class MessageContextJAXRPC extends CommonMessageContext implements MessageContext
-{
- public static final String SERVLET_CONTEXT =
"javax.xml.ws.servlet.context";
- public static final String SERVLET_REQUEST =
"javax.xml.ws.servlet.request";
- public static final String SERVLET_RESPONSE =
"javax.xml.ws.servlet.response";
- public static final String SERVLET_SESSION =
"javax.xml.ws.servlet.session";
-
- // The SOAP message
- private SOAPMessage message;
- // The serialization context for this message ctx
- private SerializationContext serContext;
-
- public SOAPMessage getMessage()
- {
- return message;
- }
-
- public void setMessage(SOAPMessage message)
- {
- this.message = message;
- }
-
- /** Get or create the serialization context
- */
- public SerializationContext getSerializationContext()
- {
- if (serContext == null)
- {
- EndpointMetaData epMetaData = getEndpointMetaData();
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
-
- SerializationContextJAXRPC jaxrpcContext = new SerializationContextJAXRPC();
- jaxrpcContext.setTypeMapping(serviceMetaData.getTypeMapping());
- jaxrpcContext.setJavaWsdlMapping(serviceMetaData.getJavaWsdlMapping());
- serContext = jaxrpcContext;
- }
- return serContext;
- }
-
- /** Gets the namespace registry for this message context */
- public NamespaceRegistry getNamespaceRegistry()
- {
- return getSerializationContext().getNamespaceRegistry();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/MessageContextJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/MessageContextJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc.handler;
+
+// $Id$
+
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
+import org.jboss.xb.binding.NamespaceRegistry;
+
+/**
+ * The message context that is processed by a handler
+ * in the handle method.
+ * <p/>
+ * Provides methods to manage a property set.
+ * MessageContext properties enable handlers in a handler chain to share
+ * processing related state.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 06-May-2004
+ */
+public class MessageContextJAXRPC extends CommonMessageContext implements MessageContext
+{
+ public static final String SERVLET_CONTEXT =
"javax.xml.ws.servlet.context";
+ public static final String SERVLET_REQUEST =
"javax.xml.ws.servlet.request";
+ public static final String SERVLET_RESPONSE =
"javax.xml.ws.servlet.response";
+ public static final String SERVLET_SESSION =
"javax.xml.ws.servlet.session";
+
+ // The SOAP message
+ private SOAPMessage message;
+ // The serialization context for this message ctx
+ private SerializationContext serContext;
+
+ public SOAPMessage getMessage()
+ {
+ return message;
+ }
+
+ public void setMessage(SOAPMessage message)
+ {
+ this.message = message;
+ }
+
+ /** Get or create the serialization context
+ */
+ public SerializationContext getSerializationContext()
+ {
+ if (serContext == null)
+ {
+ EndpointMetaData epMetaData = getEndpointMetaData();
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+
+ SerializationContextJAXRPC jaxrpcContext = new SerializationContextJAXRPC();
+ jaxrpcContext.setTypeMapping(serviceMetaData.getTypeMapping());
+ jaxrpcContext.setJavaWsdlMapping(serviceMetaData.getJavaWsdlMapping());
+ serContext = jaxrpcContext;
+ }
+ return serContext;
+ }
+
+ /** Gets the namespace registry for this message context */
+ public NamespaceRegistry getNamespaceRegistry()
+ {
+ return getSerializationContext().getNamespaceRegistry();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/SOAPMessageContextJAXRPC.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.jaxrpc.handler;
-
-// $Id$
-
-import javax.xml.rpc.handler.soap.SOAPMessageContext;
-import javax.xml.soap.SOAPMessage;
-
-/**
- * Provides access to the SOAP message for either RPC request or response.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Dec-2004
- */
-public class SOAPMessageContextJAXRPC extends MessageContextJAXRPC implements
SOAPMessageContext
-{
- /** Default constuctor
- */
- public SOAPMessageContextJAXRPC()
- {
- }
-
- /** Gets the SOAPMessage from this message context
- *
- * @return Returns the SOAPMessage; returns null if no SOAPMessage is present in this
message context
- */
- public SOAPMessage getMessage()
- {
- return getSOAPMessage();
- }
-
- /** Sets the SOAPMessage in this message context
- *
- * @param message SOAP message
- * @throws javax.xml.rpc.JAXRPCException If any error during the setting of the
SOAPMessage in this message context
- * @throws UnsupportedOperationException - If this operation is not supported
- */
- public void setMessage(SOAPMessage message)
- {
- setSOAPMessage(message);
- }
-
- /**
- * Gets the SOAP actor roles associated with an execution of the HandlerChain and its
contained Handler instances.
- * Note that SOAP actor roles apply to the SOAP node and are managed using
HandlerChain.setRoles and HandlerChain.getRoles.
- * Handler instances in the HandlerChain use this information about the SOAP actor
roles to process the SOAP header blocks.
- * Note that the SOAP actor roles are invariant during the processing of SOAP message
through the HandlerChain.
- *
- * @return Array of URIs for SOAP actor roles
- */
- public String[] getRoles()
- {
- return new String[0];
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/SOAPMessageContextJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/SOAPMessageContextJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxrpc.handler;
+
+// $Id$
+
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import javax.xml.soap.SOAPMessage;
+
+/**
+ * Provides access to the SOAP message for either RPC request or response.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Dec-2004
+ */
+public class SOAPMessageContextJAXRPC extends MessageContextJAXRPC implements
SOAPMessageContext
+{
+ /** Default constuctor
+ */
+ public SOAPMessageContextJAXRPC()
+ {
+ }
+
+ /** Gets the SOAPMessage from this message context
+ *
+ * @return Returns the SOAPMessage; returns null if no SOAPMessage is present in this
message context
+ */
+ public SOAPMessage getMessage()
+ {
+ return getSOAPMessage();
+ }
+
+ /** Sets the SOAPMessage in this message context
+ *
+ * @param message SOAP message
+ * @throws javax.xml.rpc.JAXRPCException If any error during the setting of the
SOAPMessage in this message context
+ * @throws UnsupportedOperationException - If this operation is not supported
+ */
+ public void setMessage(SOAPMessage message)
+ {
+ setSOAPMessage(message);
+ }
+
+ /**
+ * Gets the SOAP actor roles associated with an execution of the HandlerChain and its
contained Handler instances.
+ * Note that SOAP actor roles apply to the SOAP node and are managed using
HandlerChain.setRoles and HandlerChain.getRoles.
+ * Handler instances in the HandlerChain use this information about the SOAP actor
roles to process the SOAP header blocks.
+ * Note that the SOAP actor roles are invariant during the processing of SOAP message
through the HandlerChain.
+ *
+ * @return Array of URIs for SOAP actor roles
+ */
+ public String[] getRoles()
+ {
+ return new String[0];
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/ServerHandlerChain.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,62 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.jaxrpc.handler;
-
-// $Id$
-
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.rpc.handler.MessageContext;
-
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * Represents a list of handlers. All elements in the
- * HandlerChain are of the type javax.xml.rpc.handler.Handler.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-May-2004
- */
-public class ServerHandlerChain extends HandlerChainBaseImpl
-{
- // The required type of the handler
- private HandlerType type;
-
- public ServerHandlerChain(List infos, Set roles, HandlerType type)
- {
- super(infos, roles);
- this.type = type;
- }
-
- public boolean handleRequest(MessageContext msgContext)
- {
- boolean doNext = super.handleRequest(msgContext);
- return doNext;
- }
-
- public boolean handleResponse(MessageContext msgContext)
- {
- boolean doNext = super.handleResponse(msgContext);
- return doNext;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/ServerHandlerChain.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/ServerHandlerChain.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc.handler;
+
+// $Id$
+
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.rpc.handler.MessageContext;
+
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * Represents a list of handlers. All elements in the
+ * HandlerChain are of the type javax.xml.rpc.handler.Handler.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 06-May-2004
+ */
+public class ServerHandlerChain extends HandlerChainBaseImpl
+{
+ // The required type of the handler
+ private HandlerType type;
+
+ public ServerHandlerChain(List infos, Set roles, HandlerType type)
+ {
+ super(infos, roles);
+ this.type = type;
+ }
+
+ public boolean handleRequest(MessageContext msgContext)
+ {
+ boolean doNext = super.handleRequest(msgContext);
+ return doNext;
+ }
+
+ public boolean handleResponse(MessageContext msgContext)
+ {
+ boolean doNext = super.handleResponse(msgContext);
+ return doNext;
+ }
+}
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -36,8 +36,8 @@
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.ComplexTypeDeserializer;
import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
import org.jboss.ws.extras.xop.jaxws.AttachmentUnmarshallerImpl;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
/**
* A Deserializer that can handle complex types by delegating to JAXB.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -23,7 +23,7 @@
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.encoding.DeserializerFactoryBase;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -35,8 +35,8 @@
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.ComplexTypeSerializer;
import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
import org.jboss.ws.extras.xop.jaxws.AttachmentMarshallerImpl;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
import org.w3c.dom.NamedNodeMap;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -23,7 +23,7 @@
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.encoding.SerializerFactoryBase;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/SOAPFaultHelperJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/SOAPFaultHelperJAXWS.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/SOAPFaultHelperJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -48,12 +48,12 @@
import org.jboss.ws.core.binding.DeserializerSupport;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
+import org.jboss.ws.core.jaxrpc.encoding.DeserializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.encoding.SerializerFactoryBase;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
-import org.jboss.ws.jaxrpc.SOAPFaultHelperJAXRPC;
-import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
-import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -37,8 +37,8 @@
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.utils.DOMWriter;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
-import org.jboss.ws.jaxrpc.Style;
/**
* Executes a list of JAXWS handlers.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -53,8 +53,8 @@
import org.jboss.ws.core.jaxws.client.ClientProxy;
import org.jboss.ws.core.jaxws.client.DispatchImpl;
import org.jboss.ws.core.jaxws.handler.HandlerResolverImpl;
-import org.jboss.ws.metadata.builder.jaxws.JAXWSClientEndpointMetaDataBuilder;
-import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
+import org.jboss.ws.core.metadata.builder.jaxws.JAXWSClientEndpointMetaDataBuilder;
+import org.jboss.ws.core.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
/**
* Service delegates are used internally by Service objects to allow pluggability of
JAX-WS implementations.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,8 +32,8 @@
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.ComplexTypeDeserializer;
import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
/**
* A Deserializer that can handle complex types by delegating to JAXB.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -23,7 +23,7 @@
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.encoding.DeserializerFactoryBase;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -27,10 +27,10 @@
import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.VariableMapping;
import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
import org.jboss.xb.binding.Constants;
import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -28,8 +28,8 @@
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.ComplexTypeSerializer;
import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.w3c.dom.NamedNodeMap;
import javax.xml.namespace.QName;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializerFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializerFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializerFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -23,7 +23,7 @@
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.encoding.SerializerFactoryBase;
// $Id$
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSupport.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSupport.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSupport.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -8,9 +8,9 @@
import org.jboss.ws.common.umdm.OperationMetaData;
import org.jboss.ws.common.umdm.ServiceMetaData;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.xb.binding.MarshallingContext;
import org.jboss.xb.binding.ObjectLocalMarshaller;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -29,8 +29,8 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.jboss.ws.core.metadata.jaxrpcmapping.*;
import org.jboss.ws.extras.xop.jaxrpc.JBossXBContentAdapter;
-import org.jboss.ws.metadata.jaxrpcmapping.*;
import org.jboss.xb.binding.metadata.ClassMetaData;
import org.jboss.xb.binding.metadata.PackageMetaData;
import org.jboss.xb.binding.metadata.PropertyMetaData;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -28,9 +28,9 @@
import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.VariableMapping;
import org.jboss.xb.binding.Constants;
import org.jboss.xb.binding.MappingObjectModelProvider;
import org.jboss.xb.binding.XercesXsMarshaller;
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/SomeClass.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/SomeClass.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/SomeClass.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/SomeClass.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,5 @@
+package org.jboss.ws.core.metadata;
+
+public class SomeClass {
+
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor (from rev
1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/JAXBAccessor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/JAXBAccessor.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,125 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.acessor;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-import org.jboss.ws.metadata.umdm.ParameterMetaData.AccessorFactoryCreator;
-import org.jboss.ws.metadata.umdm.WrappedParameter.Accessor;
-import org.jboss.ws.metadata.umdm.WrappedParameter.AccessorFactory;
-
-import com.sun.xml.bind.api.AccessorException;
-import com.sun.xml.bind.api.JAXBRIContext;
-import com.sun.xml.bind.api.RawAccessor;
-
-/**
- * A JAXB object accessor.
- *
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-@SuppressWarnings("unchecked")
-public class JAXBAccessor implements Accessor
-{
- private RawAccessor accessor;
-
- public static AccessorFactoryCreator FACTORY_CREATOR = new AccessorFactoryCreator()
- {
- public AccessorFactory create(ParameterMetaData parameter)
- {
- final Class clazz = parameter.getJavaType();
- final JAXBRIContext ctx;
-
- try
- {
- ctx = (JAXBRIContext) JAXBRIContext.newInstance(new Class[]{clazz});
- }
- catch (JAXBException e)
- {
- WSException ex = new WSException(e.getMessage());
- ex.setStackTrace(e.getStackTrace());
- throw ex;
- }
-
- return new AccessorFactory()
- {
- public Accessor create(WrappedParameter parameter)
- {
- RawAccessor<Object,Object> accessor;
- try
- {
- QName name = parameter.getName();
- accessor = ctx.getElementPropertyAccessor(clazz,
name.getNamespaceURI(), name.getLocalPart());
- }
- catch (Throwable t)
- {
- WSException ex = new WSException(t.getMessage());
- ex.setStackTrace(t.getStackTrace());
- throw ex;
- }
-
- if (accessor == null)
- throw new IllegalStateException("Could not obtain accessor for
parameter: " + parameter);
-
- return new JAXBAccessor(accessor);
- }
- };
- }
- };
-
- private JAXBAccessor(RawAccessor accessor)
- {
- this.accessor = accessor;
- }
-
- public Object get(Object bean)
- {
- try
- {
- return accessor.get(bean);
- }
- catch (AccessorException a)
- {
- WSException ex = new WSException(a.getMessage());
- ex.setStackTrace(a.getStackTrace());
- throw ex;
- }
- }
-
- public void set(Object bean, Object value)
- {
- try
- {
- accessor.set(bean, value);
- }
- catch (AccessorException a)
- {
- WSException ex = new WSException(a.getMessage());
- ex.setStackTrace(a.getStackTrace());
- throw ex;
- }
- }
-}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/JAXBAccessor.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/JAXBAccessor.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.acessor;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.umdm.WrappedParameter;
+import org.jboss.ws.common.umdm.ParameterMetaData.AccessorFactoryCreator;
+import org.jboss.ws.common.umdm.WrappedParameter.Accessor;
+import org.jboss.ws.common.umdm.WrappedParameter.AccessorFactory;
+
+import com.sun.xml.bind.api.AccessorException;
+import com.sun.xml.bind.api.JAXBRIContext;
+import com.sun.xml.bind.api.RawAccessor;
+
+/**
+ * A JAXB object accessor.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+@SuppressWarnings("unchecked")
+public class JAXBAccessor implements Accessor
+{
+ private RawAccessor accessor;
+
+ public static AccessorFactoryCreator FACTORY_CREATOR = new AccessorFactoryCreator()
+ {
+ public AccessorFactory create(ParameterMetaData parameter)
+ {
+ final Class clazz = parameter.getJavaType();
+ final JAXBRIContext ctx;
+
+ try
+ {
+ ctx = (JAXBRIContext) JAXBRIContext.newInstance(new Class[]{clazz});
+ }
+ catch (JAXBException e)
+ {
+ WSException ex = new WSException(e.getMessage());
+ ex.setStackTrace(e.getStackTrace());
+ throw ex;
+ }
+
+ return new AccessorFactory()
+ {
+ public Accessor create(WrappedParameter parameter)
+ {
+ RawAccessor<Object,Object> accessor;
+ try
+ {
+ QName name = parameter.getName();
+ accessor = ctx.getElementPropertyAccessor(clazz,
name.getNamespaceURI(), name.getLocalPart());
+ }
+ catch (Throwable t)
+ {
+ WSException ex = new WSException(t.getMessage());
+ ex.setStackTrace(t.getStackTrace());
+ throw ex;
+ }
+
+ if (accessor == null)
+ throw new IllegalStateException("Could not obtain accessor for
parameter: " + parameter);
+
+ return new JAXBAccessor(accessor);
+ }
+ };
+ }
+ };
+
+ private JAXBAccessor(RawAccessor accessor)
+ {
+ this.accessor = accessor;
+ }
+
+ public Object get(Object bean)
+ {
+ try
+ {
+ return accessor.get(bean);
+ }
+ catch (AccessorException a)
+ {
+ WSException ex = new WSException(a.getMessage());
+ ex.setStackTrace(a.getStackTrace());
+ throw ex;
+ }
+ }
+
+ public void set(Object bean, Object value)
+ {
+ try
+ {
+ accessor.set(bean, value);
+ }
+ catch (AccessorException a)
+ {
+ WSException ex = new WSException(a.getMessage());
+ ex.setStackTrace(a.getStackTrace());
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/ReflectiveMethodAccessor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/ReflectiveMethodAccessor.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,105 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.acessor;
-
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-import org.jboss.ws.metadata.umdm.ParameterMetaData.AccessorFactoryCreator;
-import org.jboss.ws.metadata.umdm.WrappedParameter.Accessor;
-import org.jboss.ws.metadata.umdm.WrappedParameter.AccessorFactory;
-
-/**
- * A simple JavaBean accessor that uses ordinary reflection.
- *
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-@SuppressWarnings("unchecked")
-public class ReflectiveMethodAccessor implements Accessor
-{
- private Method getter;
- private Method setter;
-
- public static AccessorFactoryCreator FACTORY_CREATOR = new AccessorFactoryCreator()
- {
- public AccessorFactory create(ParameterMetaData parameter)
- {
- final Class clazz = parameter.getJavaType();
-
- return new AccessorFactory()
- {
- public Accessor create(WrappedParameter parameter)
- {
- try
- {
- PropertyDescriptor pd = new PropertyDescriptor(parameter.getVariable(),
clazz);
- return new ReflectiveMethodAccessor(pd.getReadMethod(),
pd.getWriteMethod());
- }
- catch (Throwable t)
- {
- WSException ex = new WSException(t.getMessage());
- ex.setStackTrace(t.getStackTrace());
- throw ex;
- }
- }
- };
- }
- };
-
- private ReflectiveMethodAccessor(Method getter, Method setter)
- {
- this.getter = getter;
- this.setter = setter;
- }
-
- public Object get(Object bean)
- {
- try
- {
- return getter.invoke(bean);
- }
- catch (Throwable e)
- {
- WSException ex = new WSException(e.getMessage());
- ex.setStackTrace(ex.getStackTrace());
- throw ex;
- }
- }
-
- public void set(Object bean, Object value)
- {
- try
- {
- setter.invoke(bean, value);
- }
- catch (Throwable e)
- {
- WSException ex = new WSException(e.getMessage());
- ex.setStackTrace(ex.getStackTrace());
- throw ex;
- }
- }
-}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/ReflectiveMethodAccessor.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/acessor/ReflectiveMethodAccessor.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.acessor;
+
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.umdm.WrappedParameter;
+import org.jboss.ws.common.umdm.ParameterMetaData.AccessorFactoryCreator;
+import org.jboss.ws.common.umdm.WrappedParameter.Accessor;
+import org.jboss.ws.common.umdm.WrappedParameter.AccessorFactory;
+
+/**
+ * A simple JavaBean accessor that uses ordinary reflection.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+@SuppressWarnings("unchecked")
+public class ReflectiveMethodAccessor implements Accessor
+{
+ private Method getter;
+ private Method setter;
+
+ public static AccessorFactoryCreator FACTORY_CREATOR = new AccessorFactoryCreator()
+ {
+ public AccessorFactory create(ParameterMetaData parameter)
+ {
+ final Class clazz = parameter.getJavaType();
+
+ return new AccessorFactory()
+ {
+ public Accessor create(WrappedParameter parameter)
+ {
+ try
+ {
+ PropertyDescriptor pd = new PropertyDescriptor(parameter.getVariable(),
clazz);
+ return new ReflectiveMethodAccessor(pd.getReadMethod(),
pd.getWriteMethod());
+ }
+ catch (Throwable t)
+ {
+ WSException ex = new WSException(t.getMessage());
+ ex.setStackTrace(t.getStackTrace());
+ throw ex;
+ }
+ }
+ };
+ }
+ };
+
+ private ReflectiveMethodAccessor(Method getter, Method setter)
+ {
+ this.getter = getter;
+ this.setter = setter;
+ }
+
+ public Object get(Object bean)
+ {
+ try
+ {
+ return getter.invoke(bean);
+ }
+ catch (Throwable e)
+ {
+ WSException ex = new WSException(e.getMessage());
+ ex.setStackTrace(ex.getStackTrace());
+ throw ex;
+ }
+ }
+
+ public void set(Object bean, Object value)
+ {
+ try
+ {
+ setter.invoke(bean, value);
+ }
+ catch (Throwable e)
+ {
+ WSException ex = new WSException(e.getMessage());
+ ex.setStackTrace(ex.getStackTrace());
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/MetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/MetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,476 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.builder;
+
+// $Id$
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.management.ObjectName;
+import javax.wsdl.Definition;
+import javax.wsdl.Import;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.ClientEndpointMetaData;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.ServerEndpointMetaData;
+import org.jboss.ws.common.utils.ObjectNameFactory;
+import org.jboss.ws.core.CommonSOAPBinding;
+import org.jboss.ws.core.jaxrpc.Use;
+import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedEjbPortComponentMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData;
+import
org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfigurationFactory;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.w3c.dom.Element;
+
+/** An abstract meta data builder.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2005
+ */
+public abstract class MetaDataBuilder
+{
+ // provide logging
+ private final static Logger log = Logger.getLogger(MetaDataBuilder.class);
+
+ public static WSSecurityConfiguration getWsSecurityConfiguration(UnifiedDeploymentInfo
udi) throws IOException
+ {
+ WSSecurityConfiguration config = null;
+
+ String resource = WSSecurityConfigurationFactory.SERVER_RESOURCE_NAME;
+ if (udi.metaData instanceof UnifiedWebMetaData)
+ {
+ resource = "WEB-INF/" + resource;
+ }
+ else
+ {
+ resource = "META-INF/" + resource;
+ }
+
+ URL location = udi.classLoader.getResource(resource);
+ if (location != null)
+ {
+ config = WSSecurityConfigurationFactory.newInstance().parse(location);
+
+ // Get and set deployment path to the keystore file
+ if (config.getKeyStoreFile() != null)
+ {
+ location = udi.classLoader.getResource(config.getKeyStoreFile());
+ if (location != null)
+ config.setKeyStoreURL(location);
+ }
+
+ if (config.getTrustStoreFile() != null)
+ {
+ location = udi.classLoader.getResource(config.getTrustStoreFile());
+ if (location != null)
+ config.setTrustStoreURL(location);
+ }
+ }
+
+ return config;
+ }
+
+ /** Inititialize the endpoint binding */
+ protected void initEndpointBinding(WSDLEndpoint wsdlEndpoint, ClientEndpointMetaData
epMetaData)
+ {
+ WSDLDefinitions wsdlDefinitions =
wsdlEndpoint.getWsdlService().getWsdlDefinitions();
+ WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
+ WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName());
+ String bindingType = wsdlBinding.getType();
+ if (Constants.NS_SOAP11.equals(bindingType))
+ epMetaData.setBindingId(CommonSOAPBinding.SOAP11HTTP_BINDING);
+ else if (Constants.NS_SOAP12.equals(bindingType))
+ epMetaData.setBindingId(CommonSOAPBinding.SOAP12HTTP_BINDING);
+ }
+
+ /** Initialize the endpoint encoding style from the binding operations
+ */
+ protected void initEndpointEncodingStyle(EndpointMetaData epMetaData)
+ {
+ WSDLDefinitions wsdlDefinitions =
epMetaData.getServiceMetaData().getWsdlDefinitions();
+ for (WSDLService wsdlService : wsdlDefinitions.getServices())
+ {
+ for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
+ {
+ if (epMetaData.getQName().equals(wsdlEndpoint.getQName()))
+ {
+ QName bindQName = wsdlEndpoint.getBinding();
+ NCName ncName = new NCName(bindQName.getLocalPart());
+ WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(ncName);
+ if (wsdlBinding == null)
+ throw new WSException("Cannot obtain binding: " + ncName);
+
+ for (WSDLBindingOperation wsdlBindingOperation :
wsdlBinding.getOperations())
+ {
+ String encStyle = wsdlBindingOperation.getEncodingStyle();
+ epMetaData.setEncodingStyle(Use.valueOf(encStyle));
+ }
+ }
+ }
+ }
+ }
+
+
+ public static void initEndpointAddress(UnifiedDeploymentInfo udi,
ServerEndpointMetaData sepMetaData, String linkName)
+ {
+ String contextRoot = sepMetaData.getContextRoot();
+ String urlPattern = sepMetaData.getURLPattern();
+
+ if (udi.metaData instanceof UnifiedWebMetaData)
+ {
+ UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
+ String jbwebContextRoot = webMetaData.getContextRoot();
+ if (jbwebContextRoot != null)
+ contextRoot = jbwebContextRoot;
+
+ Map<String, String> servletMappings = webMetaData.getServletMappings();
+ urlPattern = (String)servletMappings.get(linkName);
+ if (urlPattern == null)
+ throw new WSException("Cannot obtain url pattern for servlet name:
" + linkName);
+ }
+
+ if (udi.metaData instanceof UnifiedApplicationMetaData)
+ {
+ UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)udi.metaData;
+ UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(linkName);
+ if (beanMetaData == null)
+ throw new WSException("Cannot obtain meta data for ejb link: " +
linkName);
+
+ String wsContextRoot = applMetaData.getWebServiceContextRoot();
+ if (wsContextRoot != null)
+ contextRoot = wsContextRoot;
+
+ UnifiedEjbPortComponentMetaData ejbpcMetaData =
beanMetaData.getPortComponent();
+ if (ejbpcMetaData != null && ejbpcMetaData.getPortComponentURI() !=
null)
+ {
+ String pcUrlPattern = ejbpcMetaData.getPortComponentURI();
+ if (pcUrlPattern != null)
+ urlPattern = pcUrlPattern;
+ }
+ }
+
+ // If not, derive the context root from the deployment
+ if (contextRoot == null)
+ {
+ contextRoot = "/";
+ if (udi.parent != null)
+ {
+ String shortName = udi.parent.shortName;
+ shortName = shortName.substring(0, shortName.indexOf('.'));
+ contextRoot += shortName + "-";
+ }
+ String shortName = udi.shortName;
+ shortName = shortName.substring(0, shortName.indexOf('.'));
+ contextRoot += shortName;
+ }
+
+ if (contextRoot.startsWith("/") == false)
+ contextRoot = "/" + contextRoot;
+ if (urlPattern == null)
+ urlPattern = "/" + linkName;
+ if (urlPattern.startsWith("/") == false)
+ urlPattern = "/" + urlPattern;
+
+ sepMetaData.setContextRoot(contextRoot);
+ sepMetaData.setURLPattern(urlPattern);
+
+ String servicePath = contextRoot + urlPattern;
+ sepMetaData.setEndpointAddress(getServiceEndpointAddress(null, servicePath));
+ }
+
+ public static ObjectName getServiceEndpointID(UnifiedDeploymentInfo udi,
ServerEndpointMetaData sepMetaData)
+ {
+ String linkName = sepMetaData.getLinkName();
+ String context = sepMetaData.getContextRoot();
+ if (context.startsWith("/"))
+ context = context.substring(1);
+
+ StringBuilder idstr = new StringBuilder(ServerEndpointMetaData.SEPID_DOMAIN +
":");
+ idstr.append(ServerEndpointMetaData.SEPID_PROPERTY_CONTEXT + "=" +
context);
+ idstr.append("," + ServerEndpointMetaData.SEPID_PROPERTY_ENDPOINT +
"=" + linkName);
+
+ // Add JMS destination JNDI name for MDB endpoints
+ if (udi.metaData instanceof UnifiedApplicationMetaData)
+ {
+ String ejbName = sepMetaData.getLinkName();
+ if (ejbName == null)
+ throw new WSException("Cannot obtain ejb-link from port
component");
+
+ UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)udi.metaData;
+ UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
+ if (beanMetaData == null)
+ throw new WSException("Cannot obtain ejb meta data for: " +
ejbName);
+
+ if (beanMetaData instanceof UnifiedMessageDrivenMetaData)
+ {
+ UnifiedMessageDrivenMetaData mdMetaData =
(UnifiedMessageDrivenMetaData)beanMetaData;
+ String jndiName = mdMetaData.getDestinationJndiName();
+ idstr.append(",jms=" + jndiName);
+ }
+ }
+
+ return ObjectNameFactory.create(idstr.toString());
+ }
+
+
+ /** Get the web service address for a given path
+ */
+ public static String getServiceEndpointAddress(String uriScheme, String servicePath)
+ {
+ if (servicePath == null || servicePath.length() == 0)
+ throw new WSException("Service path cannot be null");
+
+ if (servicePath.endsWith("/*"))
+ servicePath = servicePath.substring(0, servicePath.length() - 2);
+
+ if (uriScheme == null)
+ uriScheme = "http";
+
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ ServiceEndpointManager epManager = factory.getServiceEndpointManager();
+ String host = epManager.getWebServiceHost();
+ int port = epManager.getWebServicePort();
+ if ("https".equals(uriScheme))
+ port = epManager.getWebServiceSecurePort();
+
+ String urlStr = uriScheme + "://" + host + ":" + port +
servicePath;
+ try
+ {
+ return new URL(urlStr).toExternalForm();
+ }
+ catch (MalformedURLException e)
+ {
+ throw new WSException("Malformed URL: " + urlStr);
+ }
+ }
+
+ /**
+ * Read the transport guarantee from web.xml
+ */
+ protected void initTransportGuaranteeJSE(UnifiedDeploymentInfo udi,
ServerEndpointMetaData sepMetaData, String servletLink) throws IOException
+ {
+ String transportGuarantee = null;
+ if (udi.metaData instanceof UnifiedWebMetaData)
+ {
+ UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
+ Map<String, String> servletMappings = webMetaData.getServletMappings();
+ String urlPattern = servletMappings.get(servletLink);
+
+ if (urlPattern == null)
+ throw new WSException("Cannot find <url-pattern> for servlet-name:
" + servletLink);
+
+ List<UnifiedWebSecurityMetaData> securityList =
webMetaData.getSecurityMetaData();
+ for (UnifiedWebSecurityMetaData currentSecurity : securityList)
+ {
+ if (currentSecurity.getTransportGuarantee() != null &&
currentSecurity.getTransportGuarantee().length() > 0)
+ {
+ for (UnifiedWebResourceCollection currentCollection :
currentSecurity.getWebResources())
+ {
+ for (String currentUrlPattern : currentCollection.getUrlPatterns())
+ {
+ if (urlPattern.equals(currentUrlPattern))
+ {
+ transportGuarantee = currentSecurity.getTransportGuarantee();
+ }
+ }
+ }
+ }
+ }
+ }
+ sepMetaData.setTransportGuarantee(transportGuarantee);
+ }
+
+ /** Replace the address locations for a given port component.
+ */
+ public static void replaceAddressLocation(ServerEndpointMetaData sepMetaData)
+ {
+ WSDLDefinitions wsdlDefinitions =
sepMetaData.getServiceMetaData().getWsdlDefinitions();
+ QName portName = sepMetaData.getQName();
+
+ boolean endpointFound = false;
+ for (WSDLService wsdlService : wsdlDefinitions.getServices())
+ {
+ for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
+ {
+ QName wsdlPortName = wsdlEndpoint.getQName();
+ if (wsdlPortName.equals(portName))
+ {
+ endpointFound = true;
+
+ String orgAddress = wsdlEndpoint.getAddress();
+ String uriScheme = getUriScheme(orgAddress);
+
+ String transportGuarantee = sepMetaData.getTransportGuarantee();
+ if ("CONFIDENTIAL".equals(transportGuarantee))
+ uriScheme = "https";
+
+ String servicePath = sepMetaData.getContextRoot() +
sepMetaData.getURLPattern();
+ String serviceEndpointURL = getServiceEndpointAddress(uriScheme,
servicePath);
+
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ ServiceEndpointManager epManager = factory.getServiceEndpointManager();
+ boolean alwaysModify = epManager.isAlwaysModifySOAPAddress();
+
+ if (alwaysModify || uriScheme == null ||
orgAddress.indexOf("REPLACE_WITH_ACTUAL_URL") >= 0)
+ {
+ log.debug("Replace service endpoint address '" +
orgAddress + "' with '" + serviceEndpointURL + "'");
+ wsdlEndpoint.setAddress(serviceEndpointURL);
+ sepMetaData.setEndpointAddress(serviceEndpointURL);
+
+ // modify the wsdl-1.1 definition
+ if (wsdlDefinitions.getWsdlOneOneDefinition() != null)
+ replaceWSDL11SOAPAddress(wsdlDefinitions, portName,
serviceEndpointURL);
+ }
+ else
+ {
+ log.debug("Don't replace service endpoint address '"
+ orgAddress + "'");
+ try
+ {
+ sepMetaData.setEndpointAddress(new
URL(orgAddress).toExternalForm());
+ }
+ catch (MalformedURLException e)
+ {
+ throw new WSException("Malformed URL: " + orgAddress);
+ }
+ }
+ }
+ }
+ }
+
+ if (endpointFound == false)
+ throw new WSException("Cannot find port in wsdl: " + portName);
+ }
+
+ private static void replaceWSDL11SOAPAddress(WSDLDefinitions wsdlDefinitions, QName
portQName, String serviceEndpointURL)
+ {
+ Definition wsdlOneOneDefinition = wsdlDefinitions.getWsdlOneOneDefinition();
+ String tnsURI = wsdlOneOneDefinition.getTargetNamespace();
+
+ // search for matching portElement and replace the address URI
+ Port wsdlOneOnePort = modifySOAPAddress(tnsURI, portQName, serviceEndpointURL,
wsdlOneOneDefinition.getServices());
+
+ // recursivly process imports if none can be found
+ if (wsdlOneOnePort == null &&
!wsdlOneOneDefinition.getImports().isEmpty())
+ {
+
+ Iterator imports = wsdlOneOneDefinition.getImports().values().iterator();
+ while (imports.hasNext())
+ {
+ List l = (List)imports.next();
+ Iterator importsByNS = l.iterator();
+ while (importsByNS.hasNext())
+ {
+ Import anImport = (Import)importsByNS.next();
+ wsdlOneOnePort = modifySOAPAddress(anImport.getNamespaceURI(), portQName,
serviceEndpointURL, anImport.getDefinition().getServices());
+ }
+ }
+ }
+
+ // if it still doesn't exist something is wrong
+ if (wsdlOneOnePort == null)
+ throw new IllegalArgumentException("Cannot find port with name '"
+ portQName + "' in wsdl document");
+ }
+
+ private static Port modifySOAPAddress(String tnsURI, QName portQName, String
serviceEndpointURL, Map services)
+ {
+ QName SOAP12_ADDRESS = new QName(Constants.NS_SOAP12, "address");
+
+ Port wsdlOneOnePort = null;
+ Iterator itServices = services.values().iterator();
+ while (itServices.hasNext())
+ {
+ Service wsdlOneOneService = (Service)itServices.next();
+ Map wsdlOneOnePorts = wsdlOneOneService.getPorts();
+ Iterator itPorts = wsdlOneOnePorts.keySet().iterator();
+ while (itPorts.hasNext())
+ {
+ String portLocalName = (String)itPorts.next();
+ if (portQName.equals(new QName(tnsURI, portLocalName)))
+ {
+ wsdlOneOnePort = (Port)wsdlOneOnePorts.get(portLocalName);
+ List extElements = wsdlOneOnePort.getExtensibilityElements();
+ for (Object extElement : extElements)
+ {
+ QName elementType =
((ExtensibilityElement)extElement).getElementType();
+ if (extElement instanceof SOAPAddress)
+ {
+ SOAPAddress address = (SOAPAddress)extElement;
+ address.setLocationURI(serviceEndpointURL);
+ }
+ else if (SOAP12_ADDRESS.equals(elementType))
+ {
+ Element domElement =
((UnknownExtensibilityElement)extElement).getElement();
+ domElement.setAttribute("location", serviceEndpointURL);
+ }
+ }
+ }
+ }
+ }
+
+ return wsdlOneOnePort;
+ }
+
+ private static String getUriScheme(String addrStr)
+ {
+ try
+ {
+ URI addrURI = new URI(addrStr);
+ String scheme = addrURI.getScheme();
+ return scheme;
+ }
+ catch (URISyntaxException e)
+ {
+ return null;
+ }
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientDeployment.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.builder.jaxrpc;
-
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
-
-
-// $Id$
-
-/**
- * The container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class JAXRPCClientDeployment extends UnifiedDeploymentInfo
-{
-
- public JAXRPCClientDeployment(DeploymentType type)
- {
- super(type);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientDeployment.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientDeployment.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.builder.jaxrpc;
+
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+
+
+// $Id$
+
+/**
+ * The container independent deployment info.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class JAXRPCClientDeployment extends UnifiedDeploymentInfo
+{
+
+ public JAXRPCClientDeployment(DeploymentType type)
+ {
+ super(type);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,260 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.builder.jaxrpc;
-
-//$Id$
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.metadata.config.jaxrpc.WSClientConfigJAXRPC;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
-import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
-
-/**
- * A client side meta data builder.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2005
- */
-public class JAXRPCClientMetaDataBuilder extends JAXRPCMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXRPCClientMetaDataBuilder.class);
-
- /** Build from WSDL and jaxrpc-mapping.xml
- */
- public ServiceMetaData buildMetaData(QName serviceQName, URL wsdlURL, URL mappingURL,
URL securityURL,
- UnifiedServiceRefMetaData serviceRefMetaData, ClassLoader loader)
- {
- try
- {
- JavaWsdlMapping javaWsdlMapping = null;
- if (mappingURL != null)
- {
- JavaWsdlMappingFactory mappingFactory =
JavaWsdlMappingFactory.newInstance();
- javaWsdlMapping = mappingFactory.parse(mappingURL);
- }
-
- WSSecurityConfiguration securityConfig = null;
- if (securityURL != null)
- {
- securityConfig =
WSSecurityConfigurationFactory.newInstance().parse(securityURL);
- }
-
- return buildMetaData(serviceQName, wsdlURL, javaWsdlMapping, securityConfig,
serviceRefMetaData, loader);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-
- /** Build from WSDL and jaxrpc-mapping.xml
- */
- public ServiceMetaData buildMetaData(QName serviceQName, URL wsdlURL, JavaWsdlMapping
javaWsdlMapping, WSSecurityConfiguration securityConfig,
- UnifiedServiceRefMetaData serviceRefMetaData, ClassLoader loader)
- {
- log.debug("START buildMetaData: [service=" + serviceQName +
"]");
- try
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- wsMetaData.setClassLoader(loader);
-
- ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData,
serviceQName);
- wsMetaData.addService(serviceMetaData);
-
- serviceMetaData.setWsdlFile(wsdlURL.toExternalForm());
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
-
- URL mappingURL = null;
- if (javaWsdlMapping != null)
- {
- mappingURL = new URL(Constants.NS_JBOSSWS_URI +
"/dummy-mapping-url");
- wsMetaData.addMappingDefinition(mappingURL.toExternalForm(),
javaWsdlMapping);
- serviceMetaData.setJaxrpcMappingFile(mappingURL.toExternalForm());
- }
-
- if (securityConfig != null)
- {
- serviceMetaData.setSecurityConfiguration(securityConfig);
- setupSecurity(securityConfig, loader);
- }
-
- buildMetaDataInternal(serviceMetaData, wsdlDefinitions, javaWsdlMapping,
serviceRefMetaData);
-
- // eagerly initialize
- wsMetaData.eagerInitialize();
-
- log.debug("END buildMetaData: " + wsMetaData);
- return serviceMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-
- private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions
wsdlDefinitions, JavaWsdlMapping javaWsdlMapping,
- UnifiedServiceRefMetaData serviceRefMetaData) throws IOException
- {
- QName serviceQName = serviceMetaData.getServiceName();
-
- // Get the WSDL service
- WSDLService wsdlService = null;
- if (serviceQName == null)
- {
- if (wsdlDefinitions.getServices().length != 1)
- throw new IllegalArgumentException("Expected a single service
element");
-
- wsdlService = wsdlDefinitions.getServices()[0];
- serviceMetaData.setServiceName(wsdlService.getQName());
- }
- else
- {
- wsdlService = wsdlDefinitions.getService(new
NCName(serviceQName.getLocalPart()));
- }
- if (wsdlService == null)
- throw new IllegalArgumentException("Cannot obtain wsdl service: " +
serviceQName);
-
- // Build type mapping meta data
- setupTypesMetaData(serviceMetaData);
-
- // Build endpoint meta data
- for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
- {
- QName portName = wsdlEndpoint.getQName();
- QName interfaceQName = wsdlEndpoint.getInterface().getQName();
- ClientEndpointMetaData epMetaData = new ClientEndpointMetaData(serviceMetaData,
portName, interfaceQName, Type.JAXRPC);
- epMetaData.setEndpointAddress(wsdlEndpoint.getAddress());
- serviceMetaData.addEndpoint(epMetaData);
-
- // config-name, config-file
- if (serviceRefMetaData != null)
- {
- String configName = serviceRefMetaData.getConfigName();
- if (configName != null)
- epMetaData.setConfigName(configName);
-
- String configFile = serviceRefMetaData.getConfigFile();
- if (configFile != null)
- epMetaData.setConfigFile(configFile);
- }
-
- // Init the endpoint binding
- initEndpointBinding(wsdlEndpoint, epMetaData);
-
- // Init the service encoding style
- initEndpointEncodingStyle(epMetaData);
-
- ServiceEndpointInterfaceMapping seiMapping = null;
- if (javaWsdlMapping != null)
- {
- QName portType = wsdlEndpoint.getInterface().getQName();
- seiMapping =
javaWsdlMapping.getServiceEndpointInterfaceMappingByPortType(portType);
- if (seiMapping != null)
- {
-
epMetaData.setServiceEndpointInterfaceName(seiMapping.getServiceEndpointInterface());
- }
- else
- {
- log.warn("Cannot obtain the SEI mapping for: " + portType);
- }
- }
-
- processEndpointMetaDataExtensions(epMetaData, wsdlDefinitions);
- setupOperationsFromWSDL(epMetaData, wsdlEndpoint, seiMapping);
- setupHandlers(serviceRefMetaData, portName, epMetaData);
- }
- }
-
- private void setupHandlers(UnifiedServiceRefMetaData serviceRefMetaData, QName
portName, EndpointMetaData epMetaData)
- {
- // Add pre handlers
- WSClientConfigJAXRPC jaxrpcConfig =
(WSClientConfigJAXRPC)epMetaData.getEndpointConfig();
- epMetaData.addHandlers(jaxrpcConfig.getHandlers(epMetaData, HandlerType.PRE));
-
- // Setup the endpoint handlers
- if (serviceRefMetaData != null)
- {
- for (UnifiedHandlerMetaData uhmd : serviceRefMetaData.getHandlers())
- {
- Set<String> portNames = uhmd.getPortNames();
- if (portNames.size() == 0 || portNames.contains(portName.getLocalPart()))
- {
- epMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(epMetaData,
HandlerType.ENDPOINT));
- }
- }
- }
-
- // Add post handlers
- epMetaData.addHandlers(jaxrpcConfig.getHandlers(epMetaData, HandlerType.POST));
- }
-
- private void setupSecurity(WSSecurityConfiguration securityConfig, ClassLoader
loader)
- {
- if (securityConfig.getKeyStoreFile() != null)
- {
- URL location = loader.getResource(securityConfig.getKeyStoreFile());
- if (location != null)
- securityConfig.setKeyStoreURL(location);
- }
-
- if (securityConfig.getTrustStoreFile() != null)
- {
- URL location = loader.getResource(securityConfig.getTrustStoreFile());
- if (location != null)
- securityConfig.setTrustStoreURL(location);
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,260 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.builder.jaxrpc;
+
+//$Id$
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.ClientEndpointMetaData;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.common.umdm.EndpointMetaData.Type;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.config.jaxrpc.WSClientConfigJAXRPC;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfigurationFactory;
+
+/**
+ * A client side meta data builder.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2005
+ */
+public class JAXRPCClientMetaDataBuilder extends JAXRPCMetaDataBuilder
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(JAXRPCClientMetaDataBuilder.class);
+
+ /** Build from WSDL and jaxrpc-mapping.xml
+ */
+ public ServiceMetaData buildMetaData(QName serviceQName, URL wsdlURL, URL mappingURL,
URL securityURL,
+ UnifiedServiceRefMetaData serviceRefMetaData, ClassLoader loader)
+ {
+ try
+ {
+ JavaWsdlMapping javaWsdlMapping = null;
+ if (mappingURL != null)
+ {
+ JavaWsdlMappingFactory mappingFactory =
JavaWsdlMappingFactory.newInstance();
+ javaWsdlMapping = mappingFactory.parse(mappingURL);
+ }
+
+ WSSecurityConfiguration securityConfig = null;
+ if (securityURL != null)
+ {
+ securityConfig =
WSSecurityConfigurationFactory.newInstance().parse(securityURL);
+ }
+
+ return buildMetaData(serviceQName, wsdlURL, javaWsdlMapping, securityConfig,
serviceRefMetaData, loader);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
+ }
+ }
+
+ /** Build from WSDL and jaxrpc-mapping.xml
+ */
+ public ServiceMetaData buildMetaData(QName serviceQName, URL wsdlURL, JavaWsdlMapping
javaWsdlMapping, WSSecurityConfiguration securityConfig,
+ UnifiedServiceRefMetaData serviceRefMetaData, ClassLoader loader)
+ {
+ log.debug("START buildMetaData: [service=" + serviceQName +
"]");
+ try
+ {
+ UnifiedMetaData wsMetaData = new UnifiedMetaData();
+ wsMetaData.setClassLoader(loader);
+
+ ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData,
serviceQName);
+ wsMetaData.addService(serviceMetaData);
+
+ serviceMetaData.setWsdlFile(wsdlURL.toExternalForm());
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+
+ URL mappingURL = null;
+ if (javaWsdlMapping != null)
+ {
+ mappingURL = new URL(Constants.NS_JBOSSWS_URI +
"/dummy-mapping-url");
+ wsMetaData.addMappingDefinition(mappingURL.toExternalForm(),
javaWsdlMapping);
+ serviceMetaData.setJaxrpcMappingFile(mappingURL.toExternalForm());
+ }
+
+ if (securityConfig != null)
+ {
+ serviceMetaData.setSecurityConfiguration(securityConfig);
+ setupSecurity(securityConfig, loader);
+ }
+
+ buildMetaDataInternal(serviceMetaData, wsdlDefinitions, javaWsdlMapping,
serviceRefMetaData);
+
+ // eagerly initialize
+ wsMetaData.eagerInitialize();
+
+ log.debug("END buildMetaData: " + wsMetaData);
+ return serviceMetaData;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
+ }
+ }
+
+ private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions
wsdlDefinitions, JavaWsdlMapping javaWsdlMapping,
+ UnifiedServiceRefMetaData serviceRefMetaData) throws IOException
+ {
+ QName serviceQName = serviceMetaData.getServiceName();
+
+ // Get the WSDL service
+ WSDLService wsdlService = null;
+ if (serviceQName == null)
+ {
+ if (wsdlDefinitions.getServices().length != 1)
+ throw new IllegalArgumentException("Expected a single service
element");
+
+ wsdlService = wsdlDefinitions.getServices()[0];
+ serviceMetaData.setServiceName(wsdlService.getQName());
+ }
+ else
+ {
+ wsdlService = wsdlDefinitions.getService(new
NCName(serviceQName.getLocalPart()));
+ }
+ if (wsdlService == null)
+ throw new IllegalArgumentException("Cannot obtain wsdl service: " +
serviceQName);
+
+ // Build type mapping meta data
+ setupTypesMetaData(serviceMetaData);
+
+ // Build endpoint meta data
+ for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
+ {
+ QName portName = wsdlEndpoint.getQName();
+ QName interfaceQName = wsdlEndpoint.getInterface().getQName();
+ ClientEndpointMetaData epMetaData = new ClientEndpointMetaData(serviceMetaData,
portName, interfaceQName, Type.JAXRPC);
+ epMetaData.setEndpointAddress(wsdlEndpoint.getAddress());
+ serviceMetaData.addEndpoint(epMetaData);
+
+ // config-name, config-file
+ if (serviceRefMetaData != null)
+ {
+ String configName = serviceRefMetaData.getConfigName();
+ if (configName != null)
+ epMetaData.setConfigName(configName);
+
+ String configFile = serviceRefMetaData.getConfigFile();
+ if (configFile != null)
+ epMetaData.setConfigFile(configFile);
+ }
+
+ // Init the endpoint binding
+ initEndpointBinding(wsdlEndpoint, epMetaData);
+
+ // Init the service encoding style
+ initEndpointEncodingStyle(epMetaData);
+
+ ServiceEndpointInterfaceMapping seiMapping = null;
+ if (javaWsdlMapping != null)
+ {
+ QName portType = wsdlEndpoint.getInterface().getQName();
+ seiMapping =
javaWsdlMapping.getServiceEndpointInterfaceMappingByPortType(portType);
+ if (seiMapping != null)
+ {
+
epMetaData.setServiceEndpointInterfaceName(seiMapping.getServiceEndpointInterface());
+ }
+ else
+ {
+ log.warn("Cannot obtain the SEI mapping for: " + portType);
+ }
+ }
+
+ processEndpointMetaDataExtensions(epMetaData, wsdlDefinitions);
+ setupOperationsFromWSDL(epMetaData, wsdlEndpoint, seiMapping);
+ setupHandlers(serviceRefMetaData, portName, epMetaData);
+ }
+ }
+
+ private void setupHandlers(UnifiedServiceRefMetaData serviceRefMetaData, QName
portName, EndpointMetaData epMetaData)
+ {
+ // Add pre handlers
+ WSClientConfigJAXRPC jaxrpcConfig =
(WSClientConfigJAXRPC)epMetaData.getEndpointConfig();
+ epMetaData.addHandlers(jaxrpcConfig.getHandlers(epMetaData, HandlerType.PRE));
+
+ // Setup the endpoint handlers
+ if (serviceRefMetaData != null)
+ {
+ for (UnifiedHandlerMetaData uhmd : serviceRefMetaData.getHandlers())
+ {
+ Set<String> portNames = uhmd.getPortNames();
+ if (portNames.size() == 0 || portNames.contains(portName.getLocalPart()))
+ {
+ epMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(epMetaData,
HandlerType.ENDPOINT));
+ }
+ }
+ }
+
+ // Add post handlers
+ epMetaData.addHandlers(jaxrpcConfig.getHandlers(epMetaData, HandlerType.POST));
+ }
+
+ private void setupSecurity(WSSecurityConfiguration securityConfig, ClassLoader
loader)
+ {
+ if (securityConfig.getKeyStoreFile() != null)
+ {
+ URL location = loader.getResource(securityConfig.getKeyStoreFile());
+ if (location != null)
+ securityConfig.setKeyStoreURL(location);
+ }
+
+ if (securityConfig.getTrustStoreFile() != null)
+ {
+ URL location = loader.getResource(securityConfig.getTrustStoreFile());
+ if (location != null)
+ securityConfig.setTrustStoreURL(location);
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCDeployment.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCDeployment.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.builder.jaxrpc;
-
-import java.io.InputStream;
-import java.net.URL;
-
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.metadata.jsr109.WebservicesFactory;
-import org.jboss.ws.metadata.jsr109.WebservicesMetaData;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-// $Id$
-
-/**
- * The container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class JAXRPCDeployment extends UnifiedDeploymentInfo
-{
- private WebservicesMetaData jsr109MetaData;
-
- public JAXRPCDeployment(DeploymentType type, URL webservicesURL)
- {
- super(type);
-
- try
- {
- // Unmarshall webservices.xml
- InputStream is = webservicesURL.openStream();
- try
- {
- Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
- ObjectModelFactory factory = new WebservicesFactory(webservicesURL);
- jsr109MetaData = (WebservicesMetaData)unmarshaller.unmarshal(is, factory,
null);
- }
- finally
- {
- is.close();
- }
- }
- catch (Exception ex)
- {
- throw new RuntimeException(ex);
- }
- }
-
- public WebservicesMetaData getWebservicesMetaData()
- {
- return jsr109MetaData;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCDeployment.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCDeployment.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.builder.jaxrpc;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import org.jboss.ws.core.metadata.jsr109.WebservicesFactory;
+import org.jboss.ws.core.metadata.jsr109.WebservicesMetaData;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+// $Id$
+
+/**
+ * The container independent deployment info.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class JAXRPCDeployment extends UnifiedDeploymentInfo
+{
+ private WebservicesMetaData jsr109MetaData;
+
+ public JAXRPCDeployment(DeploymentType type, URL webservicesURL)
+ {
+ super(type);
+
+ try
+ {
+ // Unmarshall webservices.xml
+ InputStream is = webservicesURL.openStream();
+ try
+ {
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ ObjectModelFactory factory = new WebservicesFactory(webservicesURL);
+ jsr109MetaData = (WebservicesMetaData)unmarshaller.unmarshal(is, factory,
null);
+ }
+ finally
+ {
+ is.close();
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException(ex);
+ }
+ }
+
+ public WebservicesMetaData getWebservicesMetaData()
+ {
+ return jsr109MetaData;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,968 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.builder.jaxrpc;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.rpc.encoding.TypeMappingRegistry;
-import javax.xml.ws.addressing.AddressingProperties;
-
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.extras.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.extras.eventing.EventingConstants;
-import org.jboss.ws.extras.eventing.deployment.EventingEndpoint;
-import org.jboss.ws.extras.eventing.metadata.EventingEpMetaExt;
-import org.jboss.ws.extras.xop.jaxrpc.XOPScanner;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.jaxrpc.UnqualifiedFaultException;
-import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.metadata.builder.MetaDataBuilder;
-import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.WsdlMessageMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
-import org.jboss.ws.metadata.umdm.TypesMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLMIMEPart;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
-import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem;
-import org.jboss.ws.metadata.wsdl.WSDLSOAPHeader;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-
-/**
- * A meta data builder that is based on webservices.xml.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @authoer <a href="mailto:jason.greene@jboss.org">Jason T.
Greene</a>
- * @since 19-Oct-2005
- */
-public abstract class JAXRPCMetaDataBuilder extends MetaDataBuilder
-{
- // provide logging
- final Logger log = Logger.getLogger(JAXRPCMetaDataBuilder.class);
-
- protected QName lookupSchemaType(WSDLInterfaceOperation operation, QName element)
- {
- WSDLDefinitions wsdlDefinitions =
operation.getWsdlInterface().getWsdlDefinitions();
- WSDLTypes wsdlTypes = wsdlDefinitions.getWsdlTypes();
- return wsdlTypes.getXMLType(element);
- }
-
- protected void setupTypesMetaData(ServiceMetaData serviceMetaData)
- {
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
- JavaWsdlMapping javaWsdlMapping = serviceMetaData.getJavaWsdlMapping();
- TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
-
- // Copy the schema locations to the types meta data
- if (wsdlDefinitions != null)
- {
- WSDLTypes wsdlTypes = wsdlDefinitions.getWsdlTypes();
- typesMetaData.setSchemaModel(WSDLUtils.getSchemaModel(wsdlTypes));
- }
-
- // Copy the type mappings to the types meta data
- if (javaWsdlMapping != null)
- {
- for (JavaXmlTypeMapping xmlTypeMapping :
javaWsdlMapping.getJavaXmlTypeMappings())
- {
- String javaTypeName = xmlTypeMapping.getJavaType();
- String qnameScope = xmlTypeMapping.getQnameScope();
-
- QName xmlType = xmlTypeMapping.getRootTypeQName();
- QName anonymousXMLType = xmlTypeMapping.getAnonymousTypeQName();
- if (xmlType == null && anonymousXMLType != null)
- xmlType = anonymousXMLType;
-
- String nsURI = xmlType.getNamespaceURI();
- if (Constants.NS_SCHEMA_XSD.equals(nsURI) == false &&
Constants.URI_SOAP11_ENC.equals(nsURI) == false)
- {
- TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
- tmMetaData.setQNameScope(qnameScope);
- typesMetaData.addTypeMapping(tmMetaData);
- }
- }
-
- for (ExceptionMapping exceptionMapping :
javaWsdlMapping.getExceptionMappings())
- {
- QName xmlType = exceptionMapping.getWsdlMessage();
- String javaTypeName = exceptionMapping.getExceptionType();
- TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
- typesMetaData.addTypeMapping(tmMetaData);
- }
- }
- }
-
- protected void setupOperationsFromWSDL(EndpointMetaData epMetaData, WSDLEndpoint
wsdlEndpoint, ServiceEndpointInterfaceMapping seiMapping)
- {
- WSDLDefinitions wsdlDefinitions =
wsdlEndpoint.getInterface().getWsdlDefinitions();
-
- // For every WSDL interface operation build the OperationMetaData
- WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
- for (WSDLInterfaceOperation wsdlOperation : wsdlInterface.getOperations())
- {
- String opName = wsdlOperation.getName().toString();
- QName opQName = wsdlOperation.getQName();
-
- // Set java method name
- String javaName = opName.substring(0, 1).toLowerCase() + opName.substring(1);
- ServiceEndpointMethodMapping seiMethodMapping = null;
- if (seiMapping != null)
- {
-
epMetaData.setServiceEndpointInterfaceName(seiMapping.getServiceEndpointInterface());
-
- seiMethodMapping =
seiMapping.getServiceEndpointMethodMappingByWsdlOperation(opName);
- if (seiMethodMapping == null)
- throw new WSException("Cannot obtain method mapping for: " +
opName);
-
- javaName = seiMethodMapping.getJavaMethodName();
- }
-
- OperationMetaData opMetaData = new OperationMetaData(epMetaData, opQName,
javaName);
- epMetaData.addOperation(opMetaData);
-
- // Set the operation style
- String style = wsdlOperation.getStyle();
- epMetaData.setStyle((Constants.URI_STYLE_IRI.equals(style) ? Style.DOCUMENT :
Style.RPC));
-
- // Set the operation MEP
- if (Constants.WSDL20_PATTERN_IN_ONLY.equals(wsdlOperation.getPattern()))
- opMetaData.setOneWay(true);
-
- // Set the operation SOAPAction
- WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName());
- WSDLBindingOperation wsdlBindingOperation =
wsdlBinding.getOperationByRef(opQName);
- if (wsdlBindingOperation != null)
- opMetaData.setSOAPAction(wsdlBindingOperation.getSOAPAction());
-
- // Get the type mapping for the encoding style
- String encStyle = epMetaData.getEncodingStyle().toURI();
- TypeMappingRegistry tmRegistry = new TypeMappingRegistryImpl();
- TypeMappingImpl typeMapping =
(TypeMappingImpl)tmRegistry.getTypeMapping(encStyle);
-
- // Build the parameter meta data
- if (opMetaData.getStyle() == Style.RPC)
- {
- buildParameterMetaDataRpc(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping);
- }
- else
- {
- buildParameterMetaDataDoc(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping);
- }
-
- // Build operation faults
- buildFaultMetaData(opMetaData, wsdlOperation);
-
- // process further operation extensions
- processOpMetaExtensions(opMetaData, wsdlOperation);
- }
- }
-
- private ParameterMetaData buildInputParameter(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
TypeMappingImpl typeMapping, String partName, QName xmlName, QName xmlType, int pos)
- {
- WSDLRPCSignatureItem item = wsdlOperation.getRpcSignatureitem(partName);
- if (item != null)
- pos = item.getPosition();
-
- String javaTypeName = typeMapping.getJavaTypeName(xmlType);
- if (seiMethodMapping != null)
- {
- MethodParamPartsMapping paramMapping =
seiMethodMapping.getMethodParamPartsMappingByPartName(partName);
- if (paramMapping == null)
- throw new WSException("Cannot obtain method parameter mapping for
message part '" + partName + "' in wsdl operation: "
- + seiMethodMapping.getWsdlOperation());
-
- javaTypeName = paramMapping.getParamType();
- pos = paramMapping.getParamPosition();
- }
-
- JavaWsdlMapping javaWsdlMapping =
opMetaData.getEndpointMetaData().getServiceMetaData().getJavaWsdlMapping();
- if (javaTypeName == null && javaWsdlMapping != null)
- {
- String packageName =
javaWsdlMapping.getPackageNameForNamespaceURI(xmlType.getNamespaceURI());
- if (packageName != null)
- {
- javaTypeName = packageName + "." + xmlType.getLocalPart();
- log.warn("Guess java type from package mapping: [xmlType=" +
xmlType + ",javaType=" + javaTypeName + "]");
- }
- }
-
- if (javaTypeName == null)
- throw new WSException("Cannot obtain java type mapping for: " +
xmlType);
-
- ParameterMetaData inMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
- inMetaData.setPartName(partName);
- inMetaData.setIndex(pos);
- opMetaData.addParameter(inMetaData);
-
- TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- // In arrays of user types, wscompile does not generate a mapping in
jaxrpc-mapping.xml
- if (typesMetaData.getTypeMappingByXMLType(xmlType) == null)
- {
- String nsURI = xmlType.getNamespaceURI();
- if (Constants.NS_SCHEMA_XSD.equals(nsURI) == false &&
Constants.URI_SOAP11_ENC.equals(nsURI) == false)
- {
- TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
- typesMetaData.addTypeMapping(tmMetaData);
- }
- }
-
- return inMetaData;
- }
-
- private ParameterMetaData buildOutputParameter(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping, int
pos, String partName, QName xmlName, QName xmlType, TypeMappingImpl typeMapping)
- {
- // Default is first listed output
- boolean hasReturnMapping = opMetaData.getReturnParameter() == null;
-
- WSDLRPCSignatureItem item = wsdlOperation.getRpcSignatureitem(partName);
- if (item != null)
- {
- hasReturnMapping = item.getDirection() == Direction.RETURN;
- pos = item.getPosition();
- }
-
- String javaTypeName = typeMapping.getJavaTypeName(xmlType);
- if (seiMethodMapping != null)
- {
- MethodParamPartsMapping paramMapping =
seiMethodMapping.getMethodParamPartsMappingByPartName(partName);
- if (paramMapping != null)
- {
- javaTypeName = paramMapping.getParamType();
- pos = paramMapping.getParamPosition();
- hasReturnMapping = false;
- }
- else
- {
- WsdlReturnValueMapping returnMapping =
seiMethodMapping.getWsdlReturnValueMapping();
- String mappingPart = returnMapping.getWsdlMessagePartName();
- if (returnMapping != null && mappingPart != null &&
partName.equals(mappingPart));
- {
- javaTypeName = returnMapping.getMethodReturnValue();
- hasReturnMapping = true;
- }
- }
- }
-
- JavaWsdlMapping javaWsdlMapping =
opMetaData.getEndpointMetaData().getServiceMetaData().getJavaWsdlMapping();
- if (javaTypeName == null && javaWsdlMapping != null)
- {
- String packageName =
javaWsdlMapping.getPackageNameForNamespaceURI(xmlType.getNamespaceURI());
- if (packageName != null)
- {
- javaTypeName = packageName + "." + xmlType.getLocalPart();
- log.warn("Guess java type from package mapping: [xmlType=" +
xmlType + ",javaType=" + javaTypeName + "]");
- }
- }
-
- if (javaTypeName == null)
- throw new WSException("Cannot obtain java type mapping for: " +
xmlType);
-
- ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
- outMetaData.setPartName(partName);
-
- if (hasReturnMapping)
- {
- opMetaData.setReturnParameter(outMetaData);
- }
- else
- {
- outMetaData.setIndex(pos);
- outMetaData.setMode(ParameterMode.OUT);
- opMetaData.addParameter(outMetaData);
- }
-
- TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- // In arrays of user types, wscompile does not generate a mapping in
jaxrpc-mapping.xml
- if (typesMetaData.getTypeMappingByXMLType(xmlType) == null)
- {
- String nsURI = xmlType.getNamespaceURI();
- if (Constants.NS_SCHEMA_XSD.equals(nsURI) == false &&
Constants.URI_SOAP11_ENC.equals(nsURI) == false)
- {
- TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
- typesMetaData.addTypeMapping(tmMetaData);
- }
- }
-
- return outMetaData;
- }
-
- private int processBindingParameters(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
TypeMappingImpl typeMapping, WSDLBindingOperation bindingOperation, int wsdlPosition)
- {
- WSDLBindingOperationInput bindingInput = bindingOperation.getInputs()[0];
- for (WSDLSOAPHeader header : bindingInput.getSoapHeaders())
- {
- QName xmlName = header.getElement();
- QName xmlType = lookupSchemaType(wsdlOperation, xmlName);
- String partName = header.getPartName();
-
- ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++);
- pmd.setInHeader(true);
- }
-
- for (WSDLMIMEPart mimePart : bindingInput.getMimeParts())
- {
- String partName = mimePart.getPartName();
- QName xmlName = new QName(partName);
- QName xmlType = mimePart.getXmlType();
-
- ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++);
- pmd.setSwA(true);
- pmd.setMimeTypes(mimePart.getMimeTypes());
- }
-
- return wsdlPosition;
- }
-
- private int processBindingOutputParameters(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
TypeMappingImpl typeMapping, WSDLBindingOperation bindingOperation, int wsdlPosition)
- {
- WSDLBindingOperationOutput bindingOutput = bindingOperation.getOutputs()[0];
- for (WSDLSOAPHeader header : bindingOutput.getSoapHeaders())
- {
- String partName = header.getPartName();
- QName xmlName = header.getElement();
-
- ParameterMetaData outMetaData = opMetaData.getParameter(xmlName);
- if (outMetaData != null)
- {
- outMetaData.setMode(ParameterMode.INOUT);
- }
- else
- {
- QName xmlType = lookupSchemaType(wsdlOperation, xmlName);
-
- ParameterMetaData pmd = buildOutputParameter(opMetaData, wsdlOperation,
seiMethodMapping, wsdlPosition, partName, xmlName, xmlType, typeMapping);
- pmd.setInHeader(true);
-
- if (opMetaData.getReturnParameter() != pmd)
- wsdlPosition++;
- }
- }
-
- for (WSDLMIMEPart mimePart : bindingOutput.getMimeParts())
- {
- String partName = mimePart.getPartName();
- QName xmlName = new QName(partName);
-
- ParameterMetaData outMetaData = opMetaData.getParameter(xmlName);
- if (outMetaData != null)
- {
- outMetaData.setMode(ParameterMode.INOUT);
- }
- else
- {
- QName xmlType = mimePart.getXmlType();
-
- ParameterMetaData pmd = buildOutputParameter(opMetaData, wsdlOperation,
seiMethodMapping, wsdlPosition, partName, xmlName, xmlType, typeMapping);
- pmd.setSwA(true);
- pmd.setMimeTypes(mimePart.getMimeTypes());
-
- if (opMetaData.getReturnParameter() != pmd)
- wsdlPosition++;
- }
- }
-
- return wsdlPosition;
- }
-
- /* SOAP-ENC:Array
- *
- * FIXME: This hack should be removed as soon as we can reliably get the
- * soapenc:arrayType from wsdl + schema.
- */
- private void setupSOAPArrayParameter(ParameterMetaData paramMetaData)
- {
- Use use = paramMetaData.getOperationMetaData().getUse();
- String xmlTypeLocalPart = paramMetaData.getXmlType().getLocalPart();
- if (use == Use.ENCODED && xmlTypeLocalPart.indexOf("ArrayOf")
>= 0)
- {
- paramMetaData.setSOAPArrayParam(true);
- try
- {
- String javaTypeName = paramMetaData.getJavaTypeName();
- // This approach determins the array component type from the javaTypeName.
- // It will not work for user defined types, nor will the array dimension be
- // initialized properly. Ideally the array parameter meta data should be
initialized
- // from the XSModel or wherever it is defined in WSDL.
- Class javaType = JavaUtils.loadJavaType(javaTypeName);
- Class compJavaType = javaType.getComponentType();
-
- if (xmlTypeLocalPart.indexOf("ArrayOfArrayOf") >= 0)
- compJavaType = compJavaType.getComponentType();
-
- QName compXMLType = new LiteralTypeMapping().getXMLType(compJavaType);
- paramMetaData.setSOAPArrayCompType(compXMLType);
- }
- catch (ClassNotFoundException e)
- {
- // ignore that user defined types cannot be loaded yet
- }
- }
- }
-
- private void setupXOPAttachmentParameter(WSDLInterfaceOperation operation,
ParameterMetaData paramMetaData)
- {
- QName xmlType = paramMetaData.getXmlType();
-
- // An XOP parameter is detected if it is a complex type that derives from
xsd:base64Binary
- WSDLTypes wsdlTypes =
operation.getWsdlInterface().getWsdlDefinitions().getWsdlTypes();
- JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlTypes);
- String localPart = xmlType.getLocalPart() != null ? xmlType.getLocalPart() :
"";
- String ns = xmlType.getNamespaceURI() != null ? xmlType.getNamespaceURI() :
"";
- XSTypeDefinition xsType = schemaModel.getTypeDefinition(localPart, ns);
- XOPScanner scanner = new XOPScanner();
- if(scanner.findXOPTypeDef(xsType)!=null |
(localPart.equals("base64Binary")&&ns.equals(Constants.NS_SCHEMA_XSD)))
- {
- // FIXME: read the xmime:contentType from the element declaration
- // See SchemaUtils#findXOPTypeDef(XSTypeDefinition typeDef) for details
-
- /*
- FIXME: the classloader is not set yet
- paramMetaData.setXopContentType(
- MimeUtils.resolveMimeType(paramMetaData.getJavaType())
- );
- */
-
- paramMetaData.setXOP(true);
-
- }
- }
-
- /*
- * Perhaps the JAX-RPC mapping model should be hash based. For now we optimize just
this case.
- */
- private Map<String, String> createVariableMappingMap(VariableMapping[]
mappings)
- {
- HashMap<String, String> map = new HashMap<String, String>();
- if (mappings != null)
- for (VariableMapping mapping : mappings)
- map.put(mapping.getXmlElementName(), mapping.getJavaVariableName());
-
- return map;
- }
-
- private void buildParameterMetaDataRpc(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
- TypeMappingImpl typeMapping)
- {
- log.trace("buildParameterMetaDataRpc: " + opMetaData.getQName());
-
- WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
- if (bindingOperation == null)
- throw new WSException("Could not locate binding operation for:" +
opMetaData.getQName());
-
- // RPC has one input
- WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
- int wsdlPosition = 0;
- for (WSDLRPCPart part : input.getChildParts())
- {
- QName xmlType = part.getType();
- String partName = part.getName();
- QName xmlName = new QName(partName);
-
- ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++);
-
- setupXOPAttachmentParameter(wsdlOperation, pmd);
- setupSOAPArrayParameter(pmd);
- }
-
- wsdlPosition = processBindingParameters(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
-
- WSDLInterfaceOperationOutput[] outputs = wsdlOperation.getOutputs();
- if (outputs.length > 0)
- {
- WSDLInterfaceOperationOutput output = outputs[0];
- for (WSDLRPCPart part : output.getChildParts())
- {
- String partName = part.getName();
-
- ParameterMetaData outMetaData = opMetaData.getParameter(new
QName(partName));
- if (outMetaData != null)
- {
- outMetaData.setMode(ParameterMode.INOUT);
- }
- else
- {
- QName xmlName = new QName(partName);
- QName xmlType = part.getType();
-
- ParameterMetaData pmd = buildOutputParameter(opMetaData, wsdlOperation,
seiMethodMapping, wsdlPosition, partName, xmlName, xmlType, typeMapping);
- if (opMetaData.getReturnParameter() != pmd)
- wsdlPosition++;
-
- setupXOPAttachmentParameter(wsdlOperation, pmd);
- setupSOAPArrayParameter(pmd);
- }
- }
-
- processBindingOutputParameters(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping, bindingOperation, wsdlPosition);
- }
- else if (wsdlOperation.getPattern() != Constants.WSDL20_PATTERN_IN_ONLY)
- {
- throw new WSException("RPC style was missing an output, and was not an
IN-ONLY MEP.");
- }
- }
-
- private int processDocElement(OperationMetaData operation, WSDLInterfaceOperation
wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping,
List<WrappedParameter> wrappedParameters, List<WrappedParameter>
wrappedResponseParameters)
- {
- WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
- int wsdlPosition;
-
- QName xmlName = input.getElement();
- QName xmlType = input.getXMLType();
- String javaTypeName = typeMapping.getJavaTypeName(xmlType);
-
- TypesMetaData typesMetaData =
operation.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- TypeMappingMetaData typeMetaData = typesMetaData.getTypeMappingByXMLType(xmlType);
- if (typeMetaData != null)
- javaTypeName = typeMetaData.getJavaTypeName();
-
- if (javaTypeName == null)
- throw new WSException("Cannot obtain java type mapping for: " +
xmlType);
-
- // Check if we need to wrap the parameters
- boolean isWrapped = isWrapped(seiMethodMapping, javaTypeName);
- operation.getEndpointMetaData().setParameterStyle(isWrapped ?
ParameterStyle.WRAPPED : ParameterStyle.BARE);
-
- ParameterMetaData inMetaData = new ParameterMetaData(operation, xmlName, xmlType,
javaTypeName);
- operation.addParameter(inMetaData);
-
-
- // Set the variable names
- if (inMetaData.getOperationMetaData().isDocumentWrapped())
- {
- if (seiMethodMapping == null)
- throw new IllegalArgumentException("Cannot wrap parameters without SEI
method mapping");
-
- ServiceEndpointInterfaceMapping seiMapping =
seiMethodMapping.getServiceEndpointInterfaceMapping();
- JavaXmlTypeMapping javaXmlTypeMapping =
seiMapping.getJavaWsdlMapping().getTypeMappingForQName(xmlType);
- if (javaXmlTypeMapping == null)
- throw new WSException("Cannot obtain java/xml type mapping for: " +
xmlType);
-
-
- Map<String, String> variableMap =
createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
- for (MethodParamPartsMapping partMapping :
seiMethodMapping.getMethodParamPartsMappings())
- {
- WsdlMessageMapping wsdlMessageMapping = partMapping.getWsdlMessageMapping();
- if (wsdlMessageMapping == null)
- throw new IllegalArgumentException("wsdl-message-message mapping
required for document/literal wrapped");
-
- String elementName = wsdlMessageMapping.getWsdlMessagePartName();
- String variable =
variableMap.get(wsdlMessageMapping.getWsdlMessagePartName());
- if (variable == null)
- throw new IllegalArgumentException("Could not determine variable name
for element: " + elementName);
-
- WrappedParameter wrapped = new WrappedParameter(new QName(elementName),
partMapping.getParamType(), variable,
- partMapping.getParamPosition());
-
-
- String parameterMode = wsdlMessageMapping.getParameterMode();
- if (parameterMode == null || parameterMode.length() < 2)
- throw new IllegalArgumentException("Invalid parameter mode for
element: " + elementName);
-
- if (! "OUT".equals(parameterMode))
- wrappedParameters.add(wrapped);
- if (! "IN".equals(parameterMode))
- wrappedResponseParameters.add(wrapped);
- }
- inMetaData.setWrappedParameters(wrappedParameters);
- wsdlPosition = wrappedParameters.size();
- }
- else
- {
- if (seiMethodMapping != null)
- {
- MethodParamPartsMapping part =
seiMethodMapping.getMethodParamPartsMappingByPartName(input.getPartName());
- if (part != null)
- {
- inMetaData.setJavaTypeName(part.getParamType());
- inMetaData.setIndex(part.getParamPosition());
- }
- }
-
- setupXOPAttachmentParameter(wsdlOperation, inMetaData);
- wsdlPosition = 1;
- }
-
- return wsdlPosition;
- }
-
- private boolean isWrapped(ServiceEndpointMethodMapping seiMethodMapping, String
javaTypeName)
- {
- boolean isWrapParameters = (seiMethodMapping != null ?
seiMethodMapping.isWrappedElement() : false);
- log.trace("isWrapParameters based on wrapped-element: " +
isWrapParameters);
- if (isWrapParameters == false && seiMethodMapping != null)
- {
-
- MethodParamPartsMapping[] partsMappings =
seiMethodMapping.getMethodParamPartsMappings();
- if (partsMappings.length > 0)
- {
- boolean matchingPartFound = false;
- for (MethodParamPartsMapping partsMapping : partsMappings)
- {
- String paramTypeName = partsMapping.getParamType();
- if (paramTypeName.equals(javaTypeName))
- {
- matchingPartFound = true;
- break;
- }
- else
- {
- // Check assignability,
- // JavaUtils.isAssignableFrom("org.w3c.dom.Element",
- // "javax.xml.soap.SOAPElement")
- try
- {
- Class paramType = JavaUtils.loadJavaType(paramTypeName);
- Class javaType = JavaUtils.loadJavaType(javaTypeName);
-
- // If it is assignable the explict mapping takes presedence
- // and we don't wrap
- if (JavaUtils.isAssignableFrom(javaType, paramType))
- {
- // javaTypeName = paramTypeName;
- matchingPartFound = true;
- break;
- }
- }
- catch (ClassNotFoundException e)
- {
- // Ignore. For simple types this should work, others should
- // be lexically equal
- // if it is not wrapped.
- }
- }
- }
- // Do we really want to continue to handle invalid mappings?
- isWrapParameters = (matchingPartFound == false);
- log.trace("isWrapParameters based on matching parts: " +
isWrapParameters);
- }
- }
- return isWrapParameters;
- }
-
- private int processOutputDocElement(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation,
- ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping,
List<WrappedParameter> wrappedResponseParameters,
- int wsdlPosition)
- {
- WSDLInterfaceOperationOutput opOutput = wsdlOperation.getOutputs()[0];
- QName xmlName = opOutput.getElement();
- QName xmlType = opOutput.getXMLType();
-
- String javaTypeName = typeMapping.getJavaTypeName(xmlType);
-
- TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- if (typesMetaData.getTypeMappingByXMLType(xmlType) != null)
- javaTypeName =
typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName();
-
- if (javaTypeName == null)
- throw new WSException("Cannot obtain java/xml type mapping for: " +
xmlType);
-
- ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
-
- boolean hasReturnMapping = true;
- if (opMetaData.isDocumentWrapped())
- {
- if (seiMethodMapping == null)
- throw new IllegalArgumentException("Cannot wrap parameters without SEI
method mapping");
-
- WsdlReturnValueMapping returnValueMapping =
seiMethodMapping.getWsdlReturnValueMapping();
- if (returnValueMapping != null)
- {
- ServiceEndpointInterfaceMapping seiMapping =
seiMethodMapping.getServiceEndpointInterfaceMapping();
- JavaWsdlMapping javaWsdlMapping = seiMapping.getJavaWsdlMapping();
- JavaXmlTypeMapping javaXmlTypeMapping =
javaWsdlMapping.getTypeMappingForQName(xmlType);
- if (javaXmlTypeMapping == null)
- throw new WSException("Cannot obtain java/xml type mapping for:
" + xmlType);
-
- Map<String, String> map =
createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
- String elementName = returnValueMapping.getWsdlMessagePartName();
- String variable = map.get(elementName);
- if (variable == null)
- throw new IllegalArgumentException("Could not determine variable name
for element: " + elementName);
-
- String wrappedType = returnValueMapping.getMethodReturnValue();
- QName element = new QName(elementName);
- WrappedParameter wrappedParameter = new WrappedParameter(element,
wrappedType, variable, WrappedParameter.RETURN);
- wrappedResponseParameters.add(0, wrappedParameter);
- }
-
- outMetaData.setWrappedParameters(wrappedResponseParameters);
- }
- else
- {
- if (seiMethodMapping != null)
- {
- MethodParamPartsMapping part =
seiMethodMapping.getMethodParamPartsMappingByPartName(opOutput.getPartName());
- String mode = null;
- if (part != null)
- {
- WsdlMessageMapping wsdlMessageMapping = part.getWsdlMessageMapping();
- mode = wsdlMessageMapping.getParameterMode();
- }
- if ("INOUT".equals(mode))
- {
- ParameterMetaData inMetaData = opMetaData.getParameter(xmlName);
- if (inMetaData != null)
- {
- inMetaData.setMode(ParameterMode.INOUT);
- return wsdlPosition;
- }
-
- throw new WSException("Could not update IN parameter to be INOUT, as
indicated in the mapping: " + opOutput.getPartName());
- }
- // It's potentialy possible that an input parameter could exist with the
same part name
- else if ("OUT".equals(mode))
- {
- hasReturnMapping = false;
- javaTypeName = part.getParamType();
- outMetaData.setIndex(part.getParamPosition());
- outMetaData.setJavaTypeName(javaTypeName);
- }
- else
- {
- WsdlReturnValueMapping returnValueMapping =
seiMethodMapping.getWsdlReturnValueMapping();
- if (returnValueMapping != null)
- {
- javaTypeName = returnValueMapping.getMethodReturnValue();
- outMetaData.setJavaTypeName(javaTypeName);
- }
- }
- }
-
- setupXOPAttachmentParameter(wsdlOperation, outMetaData);
- }
-
- if (hasReturnMapping)
- {
- opMetaData.setReturnParameter(outMetaData);
- }
- else
- {
- opMetaData.addParameter(outMetaData);
- outMetaData.setMode(ParameterMode.OUT);
- wsdlPosition++;
- }
-
- return wsdlPosition;
- }
-
- private void buildParameterMetaDataDoc(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
- TypeMappingImpl typeMapping)
- {
- log.trace("buildParameterMetaDataDoc: " + opMetaData.getQName());
-
- WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
- if (bindingOperation == null)
- throw new WSException("Could not locate binding operation for:" +
bindingOperation);
-
- List<WrappedParameter> wrappedParameters = new
ArrayList<WrappedParameter>();
- List<WrappedParameter> wrappedResponseParameters = new
ArrayList<WrappedParameter>();
-
- int wsdlPosition = 0;
- // WS-I BP 1.0 allows document/literal bare to have zero message parts
- if (wsdlOperation.getInputs().length > 0)
- {
- wsdlPosition = processDocElement(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping, wrappedParameters, wrappedResponseParameters);
- wsdlPosition = processBindingParameters(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
- }
- else
- {
- // Set the default to bare in case there isn't an input object, revisit
this
- opMetaData.getEndpointMetaData().setParameterStyle(ParameterStyle.BARE);
- }
-
- if (wsdlOperation.getOutputs().length > 0)
- {
- wsdlPosition = processOutputDocElement(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, wrappedResponseParameters, wsdlPosition);
- wsdlPosition = processBindingOutputParameters(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
- }
- }
-
- /**
- * Build default action according to the pattern described in
- *
http://www.w3.org/Submission/2004/SUBM-ws-addressing-20040810/
- * Section 3.3.2 'Default Action Pattern'<br>
- * [target namespace]/[port type name]/[input|output name]
- *
- * @param wsdlOperation
- * @return action value
- */
- private String buildWsaActionValue(WSDLInterfaceOperation wsdlOperation)
- {
- WSDLProperty wsaAction =
wsdlOperation.getProperty(Constants.WSDL_ATTRIBUTE_WSA_ACTION.toString());
- String actionValue = null;
-
- if (null == wsaAction)
- {
-
- String tns = wsdlOperation.getQName().getNamespaceURI();
- String portTypeName = wsdlOperation.getQName().getLocalPart();
- WSDLProperty messageName =
wsdlOperation.getProperty("http://www.jboss.org/jbossws/messagename/...;
-
- actionValue = new String(tns + "/" + portTypeName + "/" +
messageName.getValue());
- }
- else
- {
- actionValue = wsaAction.getValue();
- }
-
- return actionValue;
- }
-
- protected void buildFaultMetaData(OperationMetaData opMetaData, WSDLInterfaceOperation
wsdlOperation)
- {
- TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
-
- WSDLInterface wsdlInterface = wsdlOperation.getWsdlInterface();
- for (WSDLInterfaceOperationOutfault outFault : wsdlOperation.getOutfaults())
- {
- QName ref = outFault.getRef();
-
- WSDLInterfaceFault wsdlFault = wsdlInterface.getFault(new
NCName(ref.getLocalPart()));
- QName xmlName = wsdlFault.getElement();
- QName xmlType = wsdlFault.getXmlType();
- String javaTypeName = null;
-
- if (xmlType == null)
- {
- log.warn("Cannot obtain fault type for element: " + xmlName);
- xmlType = xmlName;
- }
-
- TypeMappingMetaData tmMetaData =
typesMetaData.getTypeMappingByXMLType(xmlType);
- if (tmMetaData != null)
- javaTypeName = tmMetaData.getJavaTypeName();
-
- if (javaTypeName == null)
- {
- log.warn("Cannot obtain java type mapping for: " + xmlType);
- javaTypeName = new UnqualifiedFaultException(xmlType).getClass().getName();
- }
-
- FaultMetaData faultMetaData = new FaultMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
- opMetaData.addFault(faultMetaData);
- }
- }
-
- protected void processEndpointMetaDataExtensions(EndpointMetaData epMetaData,
WSDLDefinitions wsdlDefinitions)
- {
- for (WSDLInterface wsdlInterface : wsdlDefinitions.getInterfaces())
- {
- WSDLProperty eventSourceProp =
wsdlInterface.getProperty(Constants.WSDL_PROPERTY_EVENTSOURCE);
- if (eventSourceProp != null && epMetaData instanceof
ServerEndpointMetaData)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String eventSourceNS = wsdlInterface.getQName().getNamespaceURI() +
"/" + wsdlInterface.getQName().getLocalPart();
- Object notificationSchema = null; // todo: resolve schema from operation
message
-
- EventingEpMetaExt ext = new
EventingEpMetaExt(EventingConstants.NS_EVENTING);
- ext.setEventSourceNS(eventSourceNS);
- ext.setNotificationSchema(notificationSchema);
-
- sepMetaData.addExtension(ext);
- sepMetaData.setManagedEndpointBean(EventingEndpoint.class.getName());
- }
- }
- }
-
- /** Process operation meta data extensions. */
- protected void processOpMetaExtensions(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation)
- {
-
- String tns = wsdlOperation.getQName().getNamespaceURI();
- String portTypeName = wsdlOperation.getQName().getLocalPart();
-
- AddressingProperties ADDR = new AddressingPropertiesImpl();
- AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
-
- // inbound action
- WSDLProperty wsaInAction =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_ACTION_IN);
- if (wsaInAction != null)
- {
- addrExt.setInboundAction(wsaInAction.getValue());
- }
- else
- {
- WSDLProperty messageName =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN);
- addrExt.setInboundAction(tns + "/" + portTypeName + "/" +
messageName);
- }
-
- // outbound action
- WSDLProperty wsaOutAction =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_ACTION_OUT);
- if (wsaOutAction != null)
- {
- addrExt.setOutboundAction(wsaOutAction.getValue());
- }
- else
- {
- WSDLProperty messageName =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT);
- addrExt.setOutboundAction(tns + "/" + portTypeName + "/" +
messageName);
- }
-
- opMetaData.addExtension(addrExt);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,968 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.builder.jaxrpc;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.rpc.encoding.TypeMappingRegistry;
+import javax.xml.ws.addressing.AddressingProperties;
+
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.FaultMetaData;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.umdm.ServerEndpointMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.TypeMappingMetaData;
+import org.jboss.ws.common.umdm.TypesMetaData;
+import org.jboss.ws.common.umdm.WrappedParameter;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
+import org.jboss.ws.core.jaxrpc.UnqualifiedFaultException;
+import org.jboss.ws.core.jaxrpc.Use;
+import org.jboss.ws.core.metadata.builder.MetaDataBuilder;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ExceptionMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.MethodParamPartsMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.VariableMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.WsdlMessageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.WsdlReturnValueMapping;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceFault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutfault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLMIMEPart;
+import org.jboss.ws.core.metadata.wsdl.WSDLProperty;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCPart;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCSignatureItem;
+import org.jboss.ws.core.metadata.wsdl.WSDLSOAPHeader;
+import org.jboss.ws.core.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.extras.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.extras.eventing.deployment.EventingEndpoint;
+import org.jboss.ws.extras.eventing.metadata.EventingEpMetaExt;
+import org.jboss.ws.extras.xop.jaxrpc.XOPScanner;
+
+/**
+ * A meta data builder that is based on webservices.xml.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @authoer <a href="mailto:jason.greene@jboss.org">Jason T.
Greene</a>
+ * @since 19-Oct-2005
+ */
+public abstract class JAXRPCMetaDataBuilder extends MetaDataBuilder
+{
+ // provide logging
+ final Logger log = Logger.getLogger(JAXRPCMetaDataBuilder.class);
+
+ protected QName lookupSchemaType(WSDLInterfaceOperation operation, QName element)
+ {
+ WSDLDefinitions wsdlDefinitions =
operation.getWsdlInterface().getWsdlDefinitions();
+ WSDLTypes wsdlTypes = wsdlDefinitions.getWsdlTypes();
+ return wsdlTypes.getXMLType(element);
+ }
+
+ protected void setupTypesMetaData(ServiceMetaData serviceMetaData)
+ {
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+ JavaWsdlMapping javaWsdlMapping = serviceMetaData.getJavaWsdlMapping();
+ TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
+
+ // Copy the schema locations to the types meta data
+ if (wsdlDefinitions != null)
+ {
+ WSDLTypes wsdlTypes = wsdlDefinitions.getWsdlTypes();
+ typesMetaData.setSchemaModel(WSDLUtils.getSchemaModel(wsdlTypes));
+ }
+
+ // Copy the type mappings to the types meta data
+ if (javaWsdlMapping != null)
+ {
+ for (JavaXmlTypeMapping xmlTypeMapping :
javaWsdlMapping.getJavaXmlTypeMappings())
+ {
+ String javaTypeName = xmlTypeMapping.getJavaType();
+ String qnameScope = xmlTypeMapping.getQnameScope();
+
+ QName xmlType = xmlTypeMapping.getRootTypeQName();
+ QName anonymousXMLType = xmlTypeMapping.getAnonymousTypeQName();
+ if (xmlType == null && anonymousXMLType != null)
+ xmlType = anonymousXMLType;
+
+ String nsURI = xmlType.getNamespaceURI();
+ if (Constants.NS_SCHEMA_XSD.equals(nsURI) == false &&
Constants.URI_SOAP11_ENC.equals(nsURI) == false)
+ {
+ TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
+ tmMetaData.setQNameScope(qnameScope);
+ typesMetaData.addTypeMapping(tmMetaData);
+ }
+ }
+
+ for (ExceptionMapping exceptionMapping :
javaWsdlMapping.getExceptionMappings())
+ {
+ QName xmlType = exceptionMapping.getWsdlMessage();
+ String javaTypeName = exceptionMapping.getExceptionType();
+ TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
+ typesMetaData.addTypeMapping(tmMetaData);
+ }
+ }
+ }
+
+ protected void setupOperationsFromWSDL(EndpointMetaData epMetaData, WSDLEndpoint
wsdlEndpoint, ServiceEndpointInterfaceMapping seiMapping)
+ {
+ WSDLDefinitions wsdlDefinitions =
wsdlEndpoint.getInterface().getWsdlDefinitions();
+
+ // For every WSDL interface operation build the OperationMetaData
+ WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
+ for (WSDLInterfaceOperation wsdlOperation : wsdlInterface.getOperations())
+ {
+ String opName = wsdlOperation.getName().toString();
+ QName opQName = wsdlOperation.getQName();
+
+ // Set java method name
+ String javaName = opName.substring(0, 1).toLowerCase() + opName.substring(1);
+ ServiceEndpointMethodMapping seiMethodMapping = null;
+ if (seiMapping != null)
+ {
+
epMetaData.setServiceEndpointInterfaceName(seiMapping.getServiceEndpointInterface());
+
+ seiMethodMapping =
seiMapping.getServiceEndpointMethodMappingByWsdlOperation(opName);
+ if (seiMethodMapping == null)
+ throw new WSException("Cannot obtain method mapping for: " +
opName);
+
+ javaName = seiMethodMapping.getJavaMethodName();
+ }
+
+ OperationMetaData opMetaData = new OperationMetaData(epMetaData, opQName,
javaName);
+ epMetaData.addOperation(opMetaData);
+
+ // Set the operation style
+ String style = wsdlOperation.getStyle();
+ epMetaData.setStyle((Constants.URI_STYLE_IRI.equals(style) ? Style.DOCUMENT :
Style.RPC));
+
+ // Set the operation MEP
+ if (Constants.WSDL20_PATTERN_IN_ONLY.equals(wsdlOperation.getPattern()))
+ opMetaData.setOneWay(true);
+
+ // Set the operation SOAPAction
+ WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName());
+ WSDLBindingOperation wsdlBindingOperation =
wsdlBinding.getOperationByRef(opQName);
+ if (wsdlBindingOperation != null)
+ opMetaData.setSOAPAction(wsdlBindingOperation.getSOAPAction());
+
+ // Get the type mapping for the encoding style
+ String encStyle = epMetaData.getEncodingStyle().toURI();
+ TypeMappingRegistry tmRegistry = new TypeMappingRegistryImpl();
+ TypeMappingImpl typeMapping =
(TypeMappingImpl)tmRegistry.getTypeMapping(encStyle);
+
+ // Build the parameter meta data
+ if (opMetaData.getStyle() == Style.RPC)
+ {
+ buildParameterMetaDataRpc(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping);
+ }
+ else
+ {
+ buildParameterMetaDataDoc(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping);
+ }
+
+ // Build operation faults
+ buildFaultMetaData(opMetaData, wsdlOperation);
+
+ // process further operation extensions
+ processOpMetaExtensions(opMetaData, wsdlOperation);
+ }
+ }
+
+ private ParameterMetaData buildInputParameter(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
TypeMappingImpl typeMapping, String partName, QName xmlName, QName xmlType, int pos)
+ {
+ WSDLRPCSignatureItem item = wsdlOperation.getRpcSignatureitem(partName);
+ if (item != null)
+ pos = item.getPosition();
+
+ String javaTypeName = typeMapping.getJavaTypeName(xmlType);
+ if (seiMethodMapping != null)
+ {
+ MethodParamPartsMapping paramMapping =
seiMethodMapping.getMethodParamPartsMappingByPartName(partName);
+ if (paramMapping == null)
+ throw new WSException("Cannot obtain method parameter mapping for
message part '" + partName + "' in wsdl operation: "
+ + seiMethodMapping.getWsdlOperation());
+
+ javaTypeName = paramMapping.getParamType();
+ pos = paramMapping.getParamPosition();
+ }
+
+ JavaWsdlMapping javaWsdlMapping =
opMetaData.getEndpointMetaData().getServiceMetaData().getJavaWsdlMapping();
+ if (javaTypeName == null && javaWsdlMapping != null)
+ {
+ String packageName =
javaWsdlMapping.getPackageNameForNamespaceURI(xmlType.getNamespaceURI());
+ if (packageName != null)
+ {
+ javaTypeName = packageName + "." + xmlType.getLocalPart();
+ log.warn("Guess java type from package mapping: [xmlType=" +
xmlType + ",javaType=" + javaTypeName + "]");
+ }
+ }
+
+ if (javaTypeName == null)
+ throw new WSException("Cannot obtain java type mapping for: " +
xmlType);
+
+ ParameterMetaData inMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
+ inMetaData.setPartName(partName);
+ inMetaData.setIndex(pos);
+ opMetaData.addParameter(inMetaData);
+
+ TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
+ // In arrays of user types, wscompile does not generate a mapping in
jaxrpc-mapping.xml
+ if (typesMetaData.getTypeMappingByXMLType(xmlType) == null)
+ {
+ String nsURI = xmlType.getNamespaceURI();
+ if (Constants.NS_SCHEMA_XSD.equals(nsURI) == false &&
Constants.URI_SOAP11_ENC.equals(nsURI) == false)
+ {
+ TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
+ typesMetaData.addTypeMapping(tmMetaData);
+ }
+ }
+
+ return inMetaData;
+ }
+
+ private ParameterMetaData buildOutputParameter(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping, int
pos, String partName, QName xmlName, QName xmlType, TypeMappingImpl typeMapping)
+ {
+ // Default is first listed output
+ boolean hasReturnMapping = opMetaData.getReturnParameter() == null;
+
+ WSDLRPCSignatureItem item = wsdlOperation.getRpcSignatureitem(partName);
+ if (item != null)
+ {
+ hasReturnMapping = item.getDirection() == Direction.RETURN;
+ pos = item.getPosition();
+ }
+
+ String javaTypeName = typeMapping.getJavaTypeName(xmlType);
+ if (seiMethodMapping != null)
+ {
+ MethodParamPartsMapping paramMapping =
seiMethodMapping.getMethodParamPartsMappingByPartName(partName);
+ if (paramMapping != null)
+ {
+ javaTypeName = paramMapping.getParamType();
+ pos = paramMapping.getParamPosition();
+ hasReturnMapping = false;
+ }
+ else
+ {
+ WsdlReturnValueMapping returnMapping =
seiMethodMapping.getWsdlReturnValueMapping();
+ String mappingPart = returnMapping.getWsdlMessagePartName();
+ if (returnMapping != null && mappingPart != null &&
partName.equals(mappingPart));
+ {
+ javaTypeName = returnMapping.getMethodReturnValue();
+ hasReturnMapping = true;
+ }
+ }
+ }
+
+ JavaWsdlMapping javaWsdlMapping =
opMetaData.getEndpointMetaData().getServiceMetaData().getJavaWsdlMapping();
+ if (javaTypeName == null && javaWsdlMapping != null)
+ {
+ String packageName =
javaWsdlMapping.getPackageNameForNamespaceURI(xmlType.getNamespaceURI());
+ if (packageName != null)
+ {
+ javaTypeName = packageName + "." + xmlType.getLocalPart();
+ log.warn("Guess java type from package mapping: [xmlType=" +
xmlType + ",javaType=" + javaTypeName + "]");
+ }
+ }
+
+ if (javaTypeName == null)
+ throw new WSException("Cannot obtain java type mapping for: " +
xmlType);
+
+ ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
+ outMetaData.setPartName(partName);
+
+ if (hasReturnMapping)
+ {
+ opMetaData.setReturnParameter(outMetaData);
+ }
+ else
+ {
+ outMetaData.setIndex(pos);
+ outMetaData.setMode(ParameterMode.OUT);
+ opMetaData.addParameter(outMetaData);
+ }
+
+ TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
+ // In arrays of user types, wscompile does not generate a mapping in
jaxrpc-mapping.xml
+ if (typesMetaData.getTypeMappingByXMLType(xmlType) == null)
+ {
+ String nsURI = xmlType.getNamespaceURI();
+ if (Constants.NS_SCHEMA_XSD.equals(nsURI) == false &&
Constants.URI_SOAP11_ENC.equals(nsURI) == false)
+ {
+ TypeMappingMetaData tmMetaData = new TypeMappingMetaData(typesMetaData,
xmlType, javaTypeName);
+ typesMetaData.addTypeMapping(tmMetaData);
+ }
+ }
+
+ return outMetaData;
+ }
+
+ private int processBindingParameters(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
TypeMappingImpl typeMapping, WSDLBindingOperation bindingOperation, int wsdlPosition)
+ {
+ WSDLBindingOperationInput bindingInput = bindingOperation.getInputs()[0];
+ for (WSDLSOAPHeader header : bindingInput.getSoapHeaders())
+ {
+ QName xmlName = header.getElement();
+ QName xmlType = lookupSchemaType(wsdlOperation, xmlName);
+ String partName = header.getPartName();
+
+ ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++);
+ pmd.setInHeader(true);
+ }
+
+ for (WSDLMIMEPart mimePart : bindingInput.getMimeParts())
+ {
+ String partName = mimePart.getPartName();
+ QName xmlName = new QName(partName);
+ QName xmlType = mimePart.getXmlType();
+
+ ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++);
+ pmd.setSwA(true);
+ pmd.setMimeTypes(mimePart.getMimeTypes());
+ }
+
+ return wsdlPosition;
+ }
+
+ private int processBindingOutputParameters(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
TypeMappingImpl typeMapping, WSDLBindingOperation bindingOperation, int wsdlPosition)
+ {
+ WSDLBindingOperationOutput bindingOutput = bindingOperation.getOutputs()[0];
+ for (WSDLSOAPHeader header : bindingOutput.getSoapHeaders())
+ {
+ String partName = header.getPartName();
+ QName xmlName = header.getElement();
+
+ ParameterMetaData outMetaData = opMetaData.getParameter(xmlName);
+ if (outMetaData != null)
+ {
+ outMetaData.setMode(ParameterMode.INOUT);
+ }
+ else
+ {
+ QName xmlType = lookupSchemaType(wsdlOperation, xmlName);
+
+ ParameterMetaData pmd = buildOutputParameter(opMetaData, wsdlOperation,
seiMethodMapping, wsdlPosition, partName, xmlName, xmlType, typeMapping);
+ pmd.setInHeader(true);
+
+ if (opMetaData.getReturnParameter() != pmd)
+ wsdlPosition++;
+ }
+ }
+
+ for (WSDLMIMEPart mimePart : bindingOutput.getMimeParts())
+ {
+ String partName = mimePart.getPartName();
+ QName xmlName = new QName(partName);
+
+ ParameterMetaData outMetaData = opMetaData.getParameter(xmlName);
+ if (outMetaData != null)
+ {
+ outMetaData.setMode(ParameterMode.INOUT);
+ }
+ else
+ {
+ QName xmlType = mimePart.getXmlType();
+
+ ParameterMetaData pmd = buildOutputParameter(opMetaData, wsdlOperation,
seiMethodMapping, wsdlPosition, partName, xmlName, xmlType, typeMapping);
+ pmd.setSwA(true);
+ pmd.setMimeTypes(mimePart.getMimeTypes());
+
+ if (opMetaData.getReturnParameter() != pmd)
+ wsdlPosition++;
+ }
+ }
+
+ return wsdlPosition;
+ }
+
+ /* SOAP-ENC:Array
+ *
+ * FIXME: This hack should be removed as soon as we can reliably get the
+ * soapenc:arrayType from wsdl + schema.
+ */
+ private void setupSOAPArrayParameter(ParameterMetaData paramMetaData)
+ {
+ Use use = paramMetaData.getOperationMetaData().getUse();
+ String xmlTypeLocalPart = paramMetaData.getXmlType().getLocalPart();
+ if (use == Use.ENCODED && xmlTypeLocalPart.indexOf("ArrayOf")
>= 0)
+ {
+ paramMetaData.setSOAPArrayParam(true);
+ try
+ {
+ String javaTypeName = paramMetaData.getJavaTypeName();
+ // This approach determins the array component type from the javaTypeName.
+ // It will not work for user defined types, nor will the array dimension be
+ // initialized properly. Ideally the array parameter meta data should be
initialized
+ // from the XSModel or wherever it is defined in WSDL.
+ Class javaType = JavaUtils.loadJavaType(javaTypeName);
+ Class compJavaType = javaType.getComponentType();
+
+ if (xmlTypeLocalPart.indexOf("ArrayOfArrayOf") >= 0)
+ compJavaType = compJavaType.getComponentType();
+
+ QName compXMLType = new LiteralTypeMapping().getXMLType(compJavaType);
+ paramMetaData.setSOAPArrayCompType(compXMLType);
+ }
+ catch (ClassNotFoundException e)
+ {
+ // ignore that user defined types cannot be loaded yet
+ }
+ }
+ }
+
+ private void setupXOPAttachmentParameter(WSDLInterfaceOperation operation,
ParameterMetaData paramMetaData)
+ {
+ QName xmlType = paramMetaData.getXmlType();
+
+ // An XOP parameter is detected if it is a complex type that derives from
xsd:base64Binary
+ WSDLTypes wsdlTypes =
operation.getWsdlInterface().getWsdlDefinitions().getWsdlTypes();
+ JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlTypes);
+ String localPart = xmlType.getLocalPart() != null ? xmlType.getLocalPart() :
"";
+ String ns = xmlType.getNamespaceURI() != null ? xmlType.getNamespaceURI() :
"";
+ XSTypeDefinition xsType = schemaModel.getTypeDefinition(localPart, ns);
+ XOPScanner scanner = new XOPScanner();
+ if(scanner.findXOPTypeDef(xsType)!=null |
(localPart.equals("base64Binary")&&ns.equals(Constants.NS_SCHEMA_XSD)))
+ {
+ // FIXME: read the xmime:contentType from the element declaration
+ // See SchemaUtils#findXOPTypeDef(XSTypeDefinition typeDef) for details
+
+ /*
+ FIXME: the classloader is not set yet
+ paramMetaData.setXopContentType(
+ MimeUtils.resolveMimeType(paramMetaData.getJavaType())
+ );
+ */
+
+ paramMetaData.setXOP(true);
+
+ }
+ }
+
+ /*
+ * Perhaps the JAX-RPC mapping model should be hash based. For now we optimize just
this case.
+ */
+ private Map<String, String> createVariableMappingMap(VariableMapping[]
mappings)
+ {
+ HashMap<String, String> map = new HashMap<String, String>();
+ if (mappings != null)
+ for (VariableMapping mapping : mappings)
+ map.put(mapping.getXmlElementName(), mapping.getJavaVariableName());
+
+ return map;
+ }
+
+ private void buildParameterMetaDataRpc(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
+ TypeMappingImpl typeMapping)
+ {
+ log.trace("buildParameterMetaDataRpc: " + opMetaData.getQName());
+
+ WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
+ if (bindingOperation == null)
+ throw new WSException("Could not locate binding operation for:" +
opMetaData.getQName());
+
+ // RPC has one input
+ WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
+ int wsdlPosition = 0;
+ for (WSDLRPCPart part : input.getChildParts())
+ {
+ QName xmlType = part.getType();
+ String partName = part.getName();
+ QName xmlName = new QName(partName);
+
+ ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++);
+
+ setupXOPAttachmentParameter(wsdlOperation, pmd);
+ setupSOAPArrayParameter(pmd);
+ }
+
+ wsdlPosition = processBindingParameters(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
+
+ WSDLInterfaceOperationOutput[] outputs = wsdlOperation.getOutputs();
+ if (outputs.length > 0)
+ {
+ WSDLInterfaceOperationOutput output = outputs[0];
+ for (WSDLRPCPart part : output.getChildParts())
+ {
+ String partName = part.getName();
+
+ ParameterMetaData outMetaData = opMetaData.getParameter(new
QName(partName));
+ if (outMetaData != null)
+ {
+ outMetaData.setMode(ParameterMode.INOUT);
+ }
+ else
+ {
+ QName xmlName = new QName(partName);
+ QName xmlType = part.getType();
+
+ ParameterMetaData pmd = buildOutputParameter(opMetaData, wsdlOperation,
seiMethodMapping, wsdlPosition, partName, xmlName, xmlType, typeMapping);
+ if (opMetaData.getReturnParameter() != pmd)
+ wsdlPosition++;
+
+ setupXOPAttachmentParameter(wsdlOperation, pmd);
+ setupSOAPArrayParameter(pmd);
+ }
+ }
+
+ processBindingOutputParameters(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping, bindingOperation, wsdlPosition);
+ }
+ else if (wsdlOperation.getPattern() != Constants.WSDL20_PATTERN_IN_ONLY)
+ {
+ throw new WSException("RPC style was missing an output, and was not an
IN-ONLY MEP.");
+ }
+ }
+
+ private int processDocElement(OperationMetaData operation, WSDLInterfaceOperation
wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping,
List<WrappedParameter> wrappedParameters, List<WrappedParameter>
wrappedResponseParameters)
+ {
+ WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
+ int wsdlPosition;
+
+ QName xmlName = input.getElement();
+ QName xmlType = input.getXMLType();
+ String javaTypeName = typeMapping.getJavaTypeName(xmlType);
+
+ TypesMetaData typesMetaData =
operation.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
+ TypeMappingMetaData typeMetaData = typesMetaData.getTypeMappingByXMLType(xmlType);
+ if (typeMetaData != null)
+ javaTypeName = typeMetaData.getJavaTypeName();
+
+ if (javaTypeName == null)
+ throw new WSException("Cannot obtain java type mapping for: " +
xmlType);
+
+ // Check if we need to wrap the parameters
+ boolean isWrapped = isWrapped(seiMethodMapping, javaTypeName);
+ operation.getEndpointMetaData().setParameterStyle(isWrapped ?
ParameterStyle.WRAPPED : ParameterStyle.BARE);
+
+ ParameterMetaData inMetaData = new ParameterMetaData(operation, xmlName, xmlType,
javaTypeName);
+ operation.addParameter(inMetaData);
+
+
+ // Set the variable names
+ if (inMetaData.getOperationMetaData().isDocumentWrapped())
+ {
+ if (seiMethodMapping == null)
+ throw new IllegalArgumentException("Cannot wrap parameters without SEI
method mapping");
+
+ ServiceEndpointInterfaceMapping seiMapping =
seiMethodMapping.getServiceEndpointInterfaceMapping();
+ JavaXmlTypeMapping javaXmlTypeMapping =
seiMapping.getJavaWsdlMapping().getTypeMappingForQName(xmlType);
+ if (javaXmlTypeMapping == null)
+ throw new WSException("Cannot obtain java/xml type mapping for: " +
xmlType);
+
+
+ Map<String, String> variableMap =
createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
+ for (MethodParamPartsMapping partMapping :
seiMethodMapping.getMethodParamPartsMappings())
+ {
+ WsdlMessageMapping wsdlMessageMapping = partMapping.getWsdlMessageMapping();
+ if (wsdlMessageMapping == null)
+ throw new IllegalArgumentException("wsdl-message-message mapping
required for document/literal wrapped");
+
+ String elementName = wsdlMessageMapping.getWsdlMessagePartName();
+ String variable =
variableMap.get(wsdlMessageMapping.getWsdlMessagePartName());
+ if (variable == null)
+ throw new IllegalArgumentException("Could not determine variable name
for element: " + elementName);
+
+ WrappedParameter wrapped = new WrappedParameter(new QName(elementName),
partMapping.getParamType(), variable,
+ partMapping.getParamPosition());
+
+
+ String parameterMode = wsdlMessageMapping.getParameterMode();
+ if (parameterMode == null || parameterMode.length() < 2)
+ throw new IllegalArgumentException("Invalid parameter mode for
element: " + elementName);
+
+ if (! "OUT".equals(parameterMode))
+ wrappedParameters.add(wrapped);
+ if (! "IN".equals(parameterMode))
+ wrappedResponseParameters.add(wrapped);
+ }
+ inMetaData.setWrappedParameters(wrappedParameters);
+ wsdlPosition = wrappedParameters.size();
+ }
+ else
+ {
+ if (seiMethodMapping != null)
+ {
+ MethodParamPartsMapping part =
seiMethodMapping.getMethodParamPartsMappingByPartName(input.getPartName());
+ if (part != null)
+ {
+ inMetaData.setJavaTypeName(part.getParamType());
+ inMetaData.setIndex(part.getParamPosition());
+ }
+ }
+
+ setupXOPAttachmentParameter(wsdlOperation, inMetaData);
+ wsdlPosition = 1;
+ }
+
+ return wsdlPosition;
+ }
+
+ private boolean isWrapped(ServiceEndpointMethodMapping seiMethodMapping, String
javaTypeName)
+ {
+ boolean isWrapParameters = (seiMethodMapping != null ?
seiMethodMapping.isWrappedElement() : false);
+ log.trace("isWrapParameters based on wrapped-element: " +
isWrapParameters);
+ if (isWrapParameters == false && seiMethodMapping != null)
+ {
+
+ MethodParamPartsMapping[] partsMappings =
seiMethodMapping.getMethodParamPartsMappings();
+ if (partsMappings.length > 0)
+ {
+ boolean matchingPartFound = false;
+ for (MethodParamPartsMapping partsMapping : partsMappings)
+ {
+ String paramTypeName = partsMapping.getParamType();
+ if (paramTypeName.equals(javaTypeName))
+ {
+ matchingPartFound = true;
+ break;
+ }
+ else
+ {
+ // Check assignability,
+ // JavaUtils.isAssignableFrom("org.w3c.dom.Element",
+ // "javax.xml.soap.SOAPElement")
+ try
+ {
+ Class paramType = JavaUtils.loadJavaType(paramTypeName);
+ Class javaType = JavaUtils.loadJavaType(javaTypeName);
+
+ // If it is assignable the explict mapping takes presedence
+ // and we don't wrap
+ if (JavaUtils.isAssignableFrom(javaType, paramType))
+ {
+ // javaTypeName = paramTypeName;
+ matchingPartFound = true;
+ break;
+ }
+ }
+ catch (ClassNotFoundException e)
+ {
+ // Ignore. For simple types this should work, others should
+ // be lexically equal
+ // if it is not wrapped.
+ }
+ }
+ }
+ // Do we really want to continue to handle invalid mappings?
+ isWrapParameters = (matchingPartFound == false);
+ log.trace("isWrapParameters based on matching parts: " +
isWrapParameters);
+ }
+ }
+ return isWrapParameters;
+ }
+
+ private int processOutputDocElement(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation,
+ ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping,
List<WrappedParameter> wrappedResponseParameters,
+ int wsdlPosition)
+ {
+ WSDLInterfaceOperationOutput opOutput = wsdlOperation.getOutputs()[0];
+ QName xmlName = opOutput.getElement();
+ QName xmlType = opOutput.getXMLType();
+
+ String javaTypeName = typeMapping.getJavaTypeName(xmlType);
+
+ TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
+ if (typesMetaData.getTypeMappingByXMLType(xmlType) != null)
+ javaTypeName =
typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName();
+
+ if (javaTypeName == null)
+ throw new WSException("Cannot obtain java/xml type mapping for: " +
xmlType);
+
+ ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
+
+ boolean hasReturnMapping = true;
+ if (opMetaData.isDocumentWrapped())
+ {
+ if (seiMethodMapping == null)
+ throw new IllegalArgumentException("Cannot wrap parameters without SEI
method mapping");
+
+ WsdlReturnValueMapping returnValueMapping =
seiMethodMapping.getWsdlReturnValueMapping();
+ if (returnValueMapping != null)
+ {
+ ServiceEndpointInterfaceMapping seiMapping =
seiMethodMapping.getServiceEndpointInterfaceMapping();
+ JavaWsdlMapping javaWsdlMapping = seiMapping.getJavaWsdlMapping();
+ JavaXmlTypeMapping javaXmlTypeMapping =
javaWsdlMapping.getTypeMappingForQName(xmlType);
+ if (javaXmlTypeMapping == null)
+ throw new WSException("Cannot obtain java/xml type mapping for:
" + xmlType);
+
+ Map<String, String> map =
createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
+ String elementName = returnValueMapping.getWsdlMessagePartName();
+ String variable = map.get(elementName);
+ if (variable == null)
+ throw new IllegalArgumentException("Could not determine variable name
for element: " + elementName);
+
+ String wrappedType = returnValueMapping.getMethodReturnValue();
+ QName element = new QName(elementName);
+ WrappedParameter wrappedParameter = new WrappedParameter(element,
wrappedType, variable, WrappedParameter.RETURN);
+ wrappedResponseParameters.add(0, wrappedParameter);
+ }
+
+ outMetaData.setWrappedParameters(wrappedResponseParameters);
+ }
+ else
+ {
+ if (seiMethodMapping != null)
+ {
+ MethodParamPartsMapping part =
seiMethodMapping.getMethodParamPartsMappingByPartName(opOutput.getPartName());
+ String mode = null;
+ if (part != null)
+ {
+ WsdlMessageMapping wsdlMessageMapping = part.getWsdlMessageMapping();
+ mode = wsdlMessageMapping.getParameterMode();
+ }
+ if ("INOUT".equals(mode))
+ {
+ ParameterMetaData inMetaData = opMetaData.getParameter(xmlName);
+ if (inMetaData != null)
+ {
+ inMetaData.setMode(ParameterMode.INOUT);
+ return wsdlPosition;
+ }
+
+ throw new WSException("Could not update IN parameter to be INOUT, as
indicated in the mapping: " + opOutput.getPartName());
+ }
+ // It's potentialy possible that an input parameter could exist with the
same part name
+ else if ("OUT".equals(mode))
+ {
+ hasReturnMapping = false;
+ javaTypeName = part.getParamType();
+ outMetaData.setIndex(part.getParamPosition());
+ outMetaData.setJavaTypeName(javaTypeName);
+ }
+ else
+ {
+ WsdlReturnValueMapping returnValueMapping =
seiMethodMapping.getWsdlReturnValueMapping();
+ if (returnValueMapping != null)
+ {
+ javaTypeName = returnValueMapping.getMethodReturnValue();
+ outMetaData.setJavaTypeName(javaTypeName);
+ }
+ }
+ }
+
+ setupXOPAttachmentParameter(wsdlOperation, outMetaData);
+ }
+
+ if (hasReturnMapping)
+ {
+ opMetaData.setReturnParameter(outMetaData);
+ }
+ else
+ {
+ opMetaData.addParameter(outMetaData);
+ outMetaData.setMode(ParameterMode.OUT);
+ wsdlPosition++;
+ }
+
+ return wsdlPosition;
+ }
+
+ private void buildParameterMetaDataDoc(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
+ TypeMappingImpl typeMapping)
+ {
+ log.trace("buildParameterMetaDataDoc: " + opMetaData.getQName());
+
+ WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
+ if (bindingOperation == null)
+ throw new WSException("Could not locate binding operation for:" +
bindingOperation);
+
+ List<WrappedParameter> wrappedParameters = new
ArrayList<WrappedParameter>();
+ List<WrappedParameter> wrappedResponseParameters = new
ArrayList<WrappedParameter>();
+
+ int wsdlPosition = 0;
+ // WS-I BP 1.0 allows document/literal bare to have zero message parts
+ if (wsdlOperation.getInputs().length > 0)
+ {
+ wsdlPosition = processDocElement(opMetaData, wsdlOperation, seiMethodMapping,
typeMapping, wrappedParameters, wrappedResponseParameters);
+ wsdlPosition = processBindingParameters(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
+ }
+ else
+ {
+ // Set the default to bare in case there isn't an input object, revisit
this
+ opMetaData.getEndpointMetaData().setParameterStyle(ParameterStyle.BARE);
+ }
+
+ if (wsdlOperation.getOutputs().length > 0)
+ {
+ wsdlPosition = processOutputDocElement(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, wrappedResponseParameters, wsdlPosition);
+ wsdlPosition = processBindingOutputParameters(opMetaData, wsdlOperation,
seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
+ }
+ }
+
+ /**
+ * Build default action according to the pattern described in
+ *
http://www.w3.org/Submission/2004/SUBM-ws-addressing-20040810/
+ * Section 3.3.2 'Default Action Pattern'<br>
+ * [target namespace]/[port type name]/[input|output name]
+ *
+ * @param wsdlOperation
+ * @return action value
+ */
+ private String buildWsaActionValue(WSDLInterfaceOperation wsdlOperation)
+ {
+ WSDLProperty wsaAction =
wsdlOperation.getProperty(Constants.WSDL_ATTRIBUTE_WSA_ACTION.toString());
+ String actionValue = null;
+
+ if (null == wsaAction)
+ {
+
+ String tns = wsdlOperation.getQName().getNamespaceURI();
+ String portTypeName = wsdlOperation.getQName().getLocalPart();
+ WSDLProperty messageName =
wsdlOperation.getProperty("http://www.jboss.org/jbossws/messagename/...;
+
+ actionValue = new String(tns + "/" + portTypeName + "/" +
messageName.getValue());
+ }
+ else
+ {
+ actionValue = wsaAction.getValue();
+ }
+
+ return actionValue;
+ }
+
+ protected void buildFaultMetaData(OperationMetaData opMetaData, WSDLInterfaceOperation
wsdlOperation)
+ {
+ TypesMetaData typesMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
+
+ WSDLInterface wsdlInterface = wsdlOperation.getWsdlInterface();
+ for (WSDLInterfaceOperationOutfault outFault : wsdlOperation.getOutfaults())
+ {
+ QName ref = outFault.getRef();
+
+ WSDLInterfaceFault wsdlFault = wsdlInterface.getFault(new
NCName(ref.getLocalPart()));
+ QName xmlName = wsdlFault.getElement();
+ QName xmlType = wsdlFault.getXmlType();
+ String javaTypeName = null;
+
+ if (xmlType == null)
+ {
+ log.warn("Cannot obtain fault type for element: " + xmlName);
+ xmlType = xmlName;
+ }
+
+ TypeMappingMetaData tmMetaData =
typesMetaData.getTypeMappingByXMLType(xmlType);
+ if (tmMetaData != null)
+ javaTypeName = tmMetaData.getJavaTypeName();
+
+ if (javaTypeName == null)
+ {
+ log.warn("Cannot obtain java type mapping for: " + xmlType);
+ javaTypeName = new UnqualifiedFaultException(xmlType).getClass().getName();
+ }
+
+ FaultMetaData faultMetaData = new FaultMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
+ opMetaData.addFault(faultMetaData);
+ }
+ }
+
+ protected void processEndpointMetaDataExtensions(EndpointMetaData epMetaData,
WSDLDefinitions wsdlDefinitions)
+ {
+ for (WSDLInterface wsdlInterface : wsdlDefinitions.getInterfaces())
+ {
+ WSDLProperty eventSourceProp =
wsdlInterface.getProperty(Constants.WSDL_PROPERTY_EVENTSOURCE);
+ if (eventSourceProp != null && epMetaData instanceof
ServerEndpointMetaData)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String eventSourceNS = wsdlInterface.getQName().getNamespaceURI() +
"/" + wsdlInterface.getQName().getLocalPart();
+ Object notificationSchema = null; // todo: resolve schema from operation
message
+
+ EventingEpMetaExt ext = new
EventingEpMetaExt(EventingConstants.NS_EVENTING);
+ ext.setEventSourceNS(eventSourceNS);
+ ext.setNotificationSchema(notificationSchema);
+
+ sepMetaData.addExtension(ext);
+ sepMetaData.setManagedEndpointBean(EventingEndpoint.class.getName());
+ }
+ }
+ }
+
+ /** Process operation meta data extensions. */
+ protected void processOpMetaExtensions(OperationMetaData opMetaData,
WSDLInterfaceOperation wsdlOperation)
+ {
+
+ String tns = wsdlOperation.getQName().getNamespaceURI();
+ String portTypeName = wsdlOperation.getQName().getLocalPart();
+
+ AddressingProperties ADDR = new AddressingPropertiesImpl();
+ AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
+
+ // inbound action
+ WSDLProperty wsaInAction =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_ACTION_IN);
+ if (wsaInAction != null)
+ {
+ addrExt.setInboundAction(wsaInAction.getValue());
+ }
+ else
+ {
+ WSDLProperty messageName =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN);
+ addrExt.setInboundAction(tns + "/" + portTypeName + "/" +
messageName);
+ }
+
+ // outbound action
+ WSDLProperty wsaOutAction =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_ACTION_OUT);
+ if (wsaOutAction != null)
+ {
+ addrExt.setOutboundAction(wsaOutAction.getValue());
+ }
+ else
+ {
+ WSDLProperty messageName =
wsdlOperation.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT);
+ addrExt.setOutboundAction(tns + "/" + portTypeName + "/" +
messageName);
+ }
+
+ opMetaData.addExtension(addrExt);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,270 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-// $Id$
-package org.jboss.ws.metadata.builder.jaxrpc;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
-import
org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
-import org.jboss.ws.metadata.jsr109.PortComponentMetaData;
-import org.jboss.ws.metadata.jsr109.WebserviceDescriptionMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-
-/**
- * A server side meta data builder that is based on webservices.xml.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2005
- */
-public class JAXRPCServerMetaDataBuilder extends JAXRPCMetaDataBuilder
-{
- // provide logging
- final Logger log = Logger.getLogger(JAXRPCServerMetaDataBuilder.class);
-
- /**
- * Build from webservices.xml
- */
- public UnifiedMetaData buildMetaData(JAXRPCDeployment udi)
- {
- log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
- try
- {
- // For every webservice-description build the ServiceMetaData
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- wsMetaData.setDeploymentName(udi.getCanonicalName());
- wsMetaData.setClassLoader(udi.classLoader);
-
- WebserviceDescriptionMetaData[] wsDescriptionArr =
udi.getWebservicesMetaData().getWebserviceDescriptions();
- for (WebserviceDescriptionMetaData wsdMetaData : wsDescriptionArr)
- {
- ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, null);
-
serviceMetaData.setWebserviceDescriptionName(wsdMetaData.getWebserviceDescriptionName());
- wsMetaData.addService(serviceMetaData);
-
- // Unmarshall the WSDL
- serviceMetaData.setWsdlFile(wsdMetaData.getWsdlFile());
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
-
- // Unmarshall the jaxrpc-mapping.xml
- serviceMetaData.setJaxrpcMappingFile(wsdMetaData.getJaxrpcMappingFile());
- JavaWsdlMapping javaWsdlMapping = serviceMetaData.getJavaWsdlMapping();
- if (javaWsdlMapping == null)
- throw new WSException("jaxrpc-mapping-file not configured from
webservices.xml");
-
- // Build type mapping meta data
- setupTypesMetaData(serviceMetaData);
-
- // Assign the WS-Security configuration,
- WSSecurityConfiguration securityConfiguration =
getWsSecurityConfiguration(udi);
- serviceMetaData.setSecurityConfiguration(securityConfiguration);
-
- // For every port-component build the EndpointMetaData
- PortComponentMetaData[] pcMetaDataArr = wsdMetaData.getPortComponents();
- for (PortComponentMetaData pcMetaData : pcMetaDataArr)
- {
- QName portName = pcMetaData.getWsdlPort();
-
- // JBWS-722
- // <wsdl-port> in webservices.xml should be qualified
- if (portName.getNamespaceURI().length() == 0)
- {
- String nsURI = wsdlDefinitions.getTargetNamespace();
- portName = new QName(nsURI, portName.getLocalPart());
- log.warn("Adding wsdl targetNamespace to: " + portName);
- pcMetaData.setWsdlPort(portName);
- }
-
- WSDLEndpoint wsdlEndpoint = getWsdlEndpoint(wsdlDefinitions, portName);
- if (wsdlEndpoint == null)
- throw new WSException("Cannot find port in wsdl: " +
portName);
-
- // set service name
- serviceMetaData.setServiceName(wsdlEndpoint.getWsdlService().getQName());
- QName interfaceQName = wsdlEndpoint.getInterface().getQName();
-
- ServerEndpointMetaData sepMetaData = new
ServerEndpointMetaData(serviceMetaData, portName, interfaceQName, Type.JAXRPC);
- sepMetaData.setPortComponentName(pcMetaData.getPortComponentName());
- String linkName = pcMetaData.getEjbLink() != null ?
pcMetaData.getEjbLink() : pcMetaData.getServletLink();
- sepMetaData.setLinkName(linkName);
- serviceMetaData.addEndpoint(sepMetaData);
-
- initEndpointEncodingStyle(sepMetaData);
-
- initEndpointAddress(udi, sepMetaData, linkName);
-
- if (udi.metaData instanceof UnifiedApplicationMetaData)
- {
- UnifiedApplicationMetaData apMetaData =
(UnifiedApplicationMetaData)udi.metaData;
- wsMetaData.setSecurityDomain(apMetaData.getSecurityDomain());
-
- // Copy the wsdl publish location from jboss.xml
- String wsdName = serviceMetaData.getWebserviceDescriptionName();
- String wsdlPublishLocation =
apMetaData.getWsdlPublishLocationByName(wsdName);
- serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);
-
- // Copy <port-component> meta data
- UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)apMetaData.getBeanByEjbName(linkName);
- if (beanMetaData == null)
- throw new WSException("Cannot obtain UnifiedBeanMetaData for:
" + linkName);
-
- String configName = apMetaData.getConfigName();
- if (configName != null)
- sepMetaData.setConfigName(configName);
-
- String configFile = apMetaData.getConfigFile();
- if (configFile != null)
- sepMetaData.setConfigFile(configFile);
-
- UnifiedEjbPortComponentMetaData bpcMetaData =
beanMetaData.getPortComponent();
- if (bpcMetaData != null)
- {
- if (bpcMetaData.getAuthMethod() != null)
- {
- String authMethod = bpcMetaData.getAuthMethod();
- sepMetaData.setAuthMethod(authMethod);
- }
- if (bpcMetaData.getTransportGuarantee() != null)
- {
- String transportGuarantee = bpcMetaData.getTransportGuarantee();
- sepMetaData.setTransportGuarantee(transportGuarantee);
- }
-
- sepMetaData.setURLPattern(bpcMetaData.getURLPattern());
- }
- }
- else if (udi.metaData instanceof UnifiedWebMetaData)
- {
- UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
- wsMetaData.setSecurityDomain(webMetaData.getSecurityDomain());
-
- String targetBean = webMetaData.getServletClassNames().get(linkName);
- sepMetaData.setServiceEndpointImplName(targetBean);
-
- // Copy the wsdl publish location from jboss-web.xml
- String wsdName = serviceMetaData.getWebserviceDescriptionName();
- String wsdlPublishLocation =
webMetaData.getWsdlPublishLocationByName(wsdName);
- serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);
-
- String configName = webMetaData.getConfigName();
- if (configName != null)
- sepMetaData.setConfigName(configName);
-
- String configFile = webMetaData.getConfigFile();
- if (configFile != null)
- sepMetaData.setConfigFile(configFile);
-
- initTransportGuaranteeJSE(udi, sepMetaData, linkName);
- }
-
- // init service endpoint id
- ObjectName sepID = getServiceEndpointID(udi, sepMetaData);
- sepMetaData.setServiceEndpointID(sepID);
-
- replaceAddressLocation(sepMetaData);
-
- String seiName = pcMetaData.getServiceEndpointInterface();
- sepMetaData.setServiceEndpointInterfaceName(seiName);
-
- ServiceEndpointInterfaceMapping seiMapping =
javaWsdlMapping.getServiceEndpointInterfaceMapping(seiName);
- if (seiMapping == null)
- log.warn("Cannot obtain SEI mapping for: " + seiName);
-
- // process endpoint meta extension
- processEndpointMetaDataExtensions(sepMetaData, wsdlDefinitions);
-
- // Setup the endpoint operations
- setupOperationsFromWSDL(sepMetaData, wsdlEndpoint, seiMapping);
-
- // Add pre handlers
- WSEndpointConfigJAXRPC jaxrpcConfig =
(WSEndpointConfigJAXRPC)sepMetaData.getEndpointConfig();
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.PRE));
-
- // Setup the endpoint handlers
- for (UnifiedHandlerMetaData uhmd : pcMetaData.getHandlers())
- {
- Set<String> portNames = uhmd.getPortNames();
- if (portNames.size() == 0 ||
portNames.contains(portName.getLocalPart()))
- {
- sepMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(sepMetaData,
HandlerType.ENDPOINT));
- }
- }
-
- // Add post handlers
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.POST));
- }
- }
-
- log.debug("END buildMetaData: " + wsMetaData);
- return wsMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-
- private WSDLEndpoint getWsdlEndpoint(WSDLDefinitions wsdlDefinitions, QName portName)
- {
- WSDLEndpoint wsdlEndpoint = null;
- for (WSDLService wsdlService : wsdlDefinitions.getServices())
- {
- WSDLEndpoint auxEndpoint = wsdlService.getEndpoint(portName);
- if (auxEndpoint != null)
- {
- wsdlEndpoint = auxEndpoint;
- break;
- }
- }
- return wsdlEndpoint;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,270 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+// $Id$
+package org.jboss.ws.core.metadata.builder.jaxrpc;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.ServerEndpointMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.common.umdm.EndpointMetaData.Type;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
+import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedEjbPortComponentMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData;
+import
org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.core.metadata.jsr109.PortComponentMetaData;
+import org.jboss.ws.core.metadata.jsr109.WebserviceDescriptionMetaData;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+/**
+ * A server side meta data builder that is based on webservices.xml.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2005
+ */
+public class JAXRPCServerMetaDataBuilder extends JAXRPCMetaDataBuilder
+{
+ // provide logging
+ final Logger log = Logger.getLogger(JAXRPCServerMetaDataBuilder.class);
+
+ /**
+ * Build from webservices.xml
+ */
+ public UnifiedMetaData buildMetaData(JAXRPCDeployment udi)
+ {
+ log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
+ try
+ {
+ // For every webservice-description build the ServiceMetaData
+ UnifiedMetaData wsMetaData = new UnifiedMetaData();
+ wsMetaData.setDeploymentName(udi.getCanonicalName());
+ wsMetaData.setClassLoader(udi.classLoader);
+
+ WebserviceDescriptionMetaData[] wsDescriptionArr =
udi.getWebservicesMetaData().getWebserviceDescriptions();
+ for (WebserviceDescriptionMetaData wsdMetaData : wsDescriptionArr)
+ {
+ ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, null);
+
serviceMetaData.setWebserviceDescriptionName(wsdMetaData.getWebserviceDescriptionName());
+ wsMetaData.addService(serviceMetaData);
+
+ // Unmarshall the WSDL
+ serviceMetaData.setWsdlFile(wsdMetaData.getWsdlFile());
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+
+ // Unmarshall the jaxrpc-mapping.xml
+ serviceMetaData.setJaxrpcMappingFile(wsdMetaData.getJaxrpcMappingFile());
+ JavaWsdlMapping javaWsdlMapping = serviceMetaData.getJavaWsdlMapping();
+ if (javaWsdlMapping == null)
+ throw new WSException("jaxrpc-mapping-file not configured from
webservices.xml");
+
+ // Build type mapping meta data
+ setupTypesMetaData(serviceMetaData);
+
+ // Assign the WS-Security configuration,
+ WSSecurityConfiguration securityConfiguration =
getWsSecurityConfiguration(udi);
+ serviceMetaData.setSecurityConfiguration(securityConfiguration);
+
+ // For every port-component build the EndpointMetaData
+ PortComponentMetaData[] pcMetaDataArr = wsdMetaData.getPortComponents();
+ for (PortComponentMetaData pcMetaData : pcMetaDataArr)
+ {
+ QName portName = pcMetaData.getWsdlPort();
+
+ // JBWS-722
+ // <wsdl-port> in webservices.xml should be qualified
+ if (portName.getNamespaceURI().length() == 0)
+ {
+ String nsURI = wsdlDefinitions.getTargetNamespace();
+ portName = new QName(nsURI, portName.getLocalPart());
+ log.warn("Adding wsdl targetNamespace to: " + portName);
+ pcMetaData.setWsdlPort(portName);
+ }
+
+ WSDLEndpoint wsdlEndpoint = getWsdlEndpoint(wsdlDefinitions, portName);
+ if (wsdlEndpoint == null)
+ throw new WSException("Cannot find port in wsdl: " +
portName);
+
+ // set service name
+ serviceMetaData.setServiceName(wsdlEndpoint.getWsdlService().getQName());
+ QName interfaceQName = wsdlEndpoint.getInterface().getQName();
+
+ ServerEndpointMetaData sepMetaData = new
ServerEndpointMetaData(serviceMetaData, portName, interfaceQName, Type.JAXRPC);
+ sepMetaData.setPortComponentName(pcMetaData.getPortComponentName());
+ String linkName = pcMetaData.getEjbLink() != null ?
pcMetaData.getEjbLink() : pcMetaData.getServletLink();
+ sepMetaData.setLinkName(linkName);
+ serviceMetaData.addEndpoint(sepMetaData);
+
+ initEndpointEncodingStyle(sepMetaData);
+
+ initEndpointAddress(udi, sepMetaData, linkName);
+
+ if (udi.metaData instanceof UnifiedApplicationMetaData)
+ {
+ UnifiedApplicationMetaData apMetaData =
(UnifiedApplicationMetaData)udi.metaData;
+ wsMetaData.setSecurityDomain(apMetaData.getSecurityDomain());
+
+ // Copy the wsdl publish location from jboss.xml
+ String wsdName = serviceMetaData.getWebserviceDescriptionName();
+ String wsdlPublishLocation =
apMetaData.getWsdlPublishLocationByName(wsdName);
+ serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);
+
+ // Copy <port-component> meta data
+ UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)apMetaData.getBeanByEjbName(linkName);
+ if (beanMetaData == null)
+ throw new WSException("Cannot obtain UnifiedBeanMetaData for:
" + linkName);
+
+ String configName = apMetaData.getConfigName();
+ if (configName != null)
+ sepMetaData.setConfigName(configName);
+
+ String configFile = apMetaData.getConfigFile();
+ if (configFile != null)
+ sepMetaData.setConfigFile(configFile);
+
+ UnifiedEjbPortComponentMetaData bpcMetaData =
beanMetaData.getPortComponent();
+ if (bpcMetaData != null)
+ {
+ if (bpcMetaData.getAuthMethod() != null)
+ {
+ String authMethod = bpcMetaData.getAuthMethod();
+ sepMetaData.setAuthMethod(authMethod);
+ }
+ if (bpcMetaData.getTransportGuarantee() != null)
+ {
+ String transportGuarantee = bpcMetaData.getTransportGuarantee();
+ sepMetaData.setTransportGuarantee(transportGuarantee);
+ }
+
+ sepMetaData.setURLPattern(bpcMetaData.getURLPattern());
+ }
+ }
+ else if (udi.metaData instanceof UnifiedWebMetaData)
+ {
+ UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
+ wsMetaData.setSecurityDomain(webMetaData.getSecurityDomain());
+
+ String targetBean = webMetaData.getServletClassNames().get(linkName);
+ sepMetaData.setServiceEndpointImplName(targetBean);
+
+ // Copy the wsdl publish location from jboss-web.xml
+ String wsdName = serviceMetaData.getWebserviceDescriptionName();
+ String wsdlPublishLocation =
webMetaData.getWsdlPublishLocationByName(wsdName);
+ serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);
+
+ String configName = webMetaData.getConfigName();
+ if (configName != null)
+ sepMetaData.setConfigName(configName);
+
+ String configFile = webMetaData.getConfigFile();
+ if (configFile != null)
+ sepMetaData.setConfigFile(configFile);
+
+ initTransportGuaranteeJSE(udi, sepMetaData, linkName);
+ }
+
+ // init service endpoint id
+ ObjectName sepID = getServiceEndpointID(udi, sepMetaData);
+ sepMetaData.setServiceEndpointID(sepID);
+
+ replaceAddressLocation(sepMetaData);
+
+ String seiName = pcMetaData.getServiceEndpointInterface();
+ sepMetaData.setServiceEndpointInterfaceName(seiName);
+
+ ServiceEndpointInterfaceMapping seiMapping =
javaWsdlMapping.getServiceEndpointInterfaceMapping(seiName);
+ if (seiMapping == null)
+ log.warn("Cannot obtain SEI mapping for: " + seiName);
+
+ // process endpoint meta extension
+ processEndpointMetaDataExtensions(sepMetaData, wsdlDefinitions);
+
+ // Setup the endpoint operations
+ setupOperationsFromWSDL(sepMetaData, wsdlEndpoint, seiMapping);
+
+ // Add pre handlers
+ WSEndpointConfigJAXRPC jaxrpcConfig =
(WSEndpointConfigJAXRPC)sepMetaData.getEndpointConfig();
+ sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.PRE));
+
+ // Setup the endpoint handlers
+ for (UnifiedHandlerMetaData uhmd : pcMetaData.getHandlers())
+ {
+ Set<String> portNames = uhmd.getPortNames();
+ if (portNames.size() == 0 ||
portNames.contains(portName.getLocalPart()))
+ {
+ sepMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(sepMetaData,
HandlerType.ENDPOINT));
+ }
+ }
+
+ // Add post handlers
+ sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.POST));
+ }
+ }
+
+ log.debug("END buildMetaData: " + wsMetaData);
+ return wsMetaData;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
+ }
+ }
+
+ private WSDLEndpoint getWsdlEndpoint(WSDLDefinitions wsdlDefinitions, QName portName)
+ {
+ WSDLEndpoint wsdlEndpoint = null;
+ for (WSDLService wsdlService : wsdlDefinitions.getServices())
+ {
+ WSDLEndpoint auxEndpoint = wsdlService.getEndpoint(portName);
+ if (auxEndpoint != null)
+ {
+ wsdlEndpoint = auxEndpoint;
+ break;
+ }
+ }
+ return wsdlEndpoint;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,89 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import javax.jws.HandlerChain;
-import javax.jws.soap.SOAPBinding;
-import javax.xml.ws.BindingType;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.config.jaxws.WSClientConfigJAXWS;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * A client side meta data builder that is based on JSR-181 annotations
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 9-Aug-2006
- */
-public class JAXWSClientEndpointMetaDataBuilder extends JAXWSWebServiceMetaDataBuilder
-{
- // provide logging
- private final Logger log =
Logger.getLogger(JAXWSClientEndpointMetaDataBuilder.class);
-
- public void rebuildEndpointMetaData(EndpointMetaData epMetaData, Class<?>
wsClass)
- {
- log.debug("START: rebuildMetaData");
-
- // Clear the java types, etc.
- resetMetaDataBuilder(epMetaData.getClassLoader());
-
- // Nuke parameterStyle
- epMetaData.setParameterStyle(null);
-
- // Process an optional @BindingType annotation
- if (wsClass.isAnnotationPresent(BindingType.class))
- processBindingType(epMetaData, wsClass);
-
- // Process @SOAPBinding
- if (wsClass.isAnnotationPresent(SOAPBinding.class))
- processSOAPBinding(epMetaData, wsClass);
-
- // Clear handlers
- epMetaData.clearHandlers();
-
- // Add pre handlers
- WSClientConfigJAXWS jaxwsConfig =
(WSClientConfigJAXWS)epMetaData.getEndpointConfig();
- epMetaData.addHandlers(jaxwsConfig.getHandlers(epMetaData, HandlerType.PRE));
-
- // Process an optional @HandlerChain annotation
- if (wsClass.isAnnotationPresent(HandlerChain.class))
- processHandlerChain(epMetaData, wsClass);
-
- // Add post handlers
- epMetaData.addHandlers(jaxwsConfig.getHandlers(epMetaData, HandlerType.POST));
-
- // Process @WebMethod
- processWebMethods(epMetaData, wsClass);
-
- // Initialize types
- createJAXBContext(epMetaData);
- populateXmlTypes(epMetaData);
-
- // Eager initialization
- epMetaData.eagerInitialize();
-
- log.debug("END: rebuildMetaData\n" + epMetaData.getServiceMetaData());
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,89 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+// $Id$
+package org.jboss.ws.core.metadata.builder.jaxws;
+
+import javax.jws.HandlerChain;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.BindingType;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.config.jaxws.WSClientConfigJAXWS;
+
+/**
+ * A client side meta data builder that is based on JSR-181 annotations
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 9-Aug-2006
+ */
+public class JAXWSClientEndpointMetaDataBuilder extends JAXWSWebServiceMetaDataBuilder
+{
+ // provide logging
+ private final Logger log =
Logger.getLogger(JAXWSClientEndpointMetaDataBuilder.class);
+
+ public void rebuildEndpointMetaData(EndpointMetaData epMetaData, Class<?>
wsClass)
+ {
+ log.debug("START: rebuildMetaData");
+
+ // Clear the java types, etc.
+ resetMetaDataBuilder(epMetaData.getClassLoader());
+
+ // Nuke parameterStyle
+ epMetaData.setParameterStyle(null);
+
+ // Process an optional @BindingType annotation
+ if (wsClass.isAnnotationPresent(BindingType.class))
+ processBindingType(epMetaData, wsClass);
+
+ // Process @SOAPBinding
+ if (wsClass.isAnnotationPresent(SOAPBinding.class))
+ processSOAPBinding(epMetaData, wsClass);
+
+ // Clear handlers
+ epMetaData.clearHandlers();
+
+ // Add pre handlers
+ WSClientConfigJAXWS jaxwsConfig =
(WSClientConfigJAXWS)epMetaData.getEndpointConfig();
+ epMetaData.addHandlers(jaxwsConfig.getHandlers(epMetaData, HandlerType.PRE));
+
+ // Process an optional @HandlerChain annotation
+ if (wsClass.isAnnotationPresent(HandlerChain.class))
+ processHandlerChain(epMetaData, wsClass);
+
+ // Add post handlers
+ epMetaData.addHandlers(jaxwsConfig.getHandlers(epMetaData, HandlerType.POST));
+
+ // Process @WebMethod
+ processWebMethods(epMetaData, wsClass);
+
+ // Initialize types
+ createJAXBContext(epMetaData);
+ populateXmlTypes(epMetaData);
+
+ // Eager initialization
+ epMetaData.eagerInitialize();
+
+ log.debug("END: rebuildMetaData\n" + epMetaData.getServiceMetaData());
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,173 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.builder.jaxws;
-
-//$Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-
-/**
- * A client side meta data builder.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2005
- */
-public class JAXWSClientMetaDataBuilder extends JAXWSMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSClientMetaDataBuilder.class);
-
- /** Build from WSDL and jaxrpc-mapping.xml
- */
- public ServiceMetaData buildMetaData(QName serviceName, URL wsdlURL, ClassLoader
loader)
- {
- if (wsdlURL == null)
- throw new IllegalArgumentException("Invalid wsdlURL: " + wsdlURL);
-
- log.debug("START buildMetaData: [service=" + serviceName +
"]");
- try
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
-
- ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
- wsMetaData.addService(serviceMetaData);
-
- serviceMetaData.setWsdlFile(wsdlURL.toExternalForm());
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
-
- buildMetaDataInternal(serviceMetaData, wsdlDefinitions);
-
- // Read the WSDL and initialize the schema model
- // This should only be needed for debuging purposes of the UMDM
- JBossXSModel schemaModel =
WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
- serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
-
- log.debug("END buildMetaData: " + wsMetaData);
- return serviceMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-
- private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions
wsdlDefinitions) throws IOException
- {
- QName serviceName = serviceMetaData.getServiceName();
-
- // Get the WSDL service
- WSDLService wsdlService = null;
- if (serviceName == null)
- {
- if (wsdlDefinitions.getServices().length != 1)
- throw new IllegalArgumentException("Expected a single service
element");
-
- wsdlService = wsdlDefinitions.getServices()[0];
- serviceMetaData.setServiceName(wsdlService.getQName());
- }
- else
- {
- wsdlService = wsdlDefinitions.getService(new
NCName(serviceName.getLocalPart()));
- }
- if (wsdlService == null)
- throw new IllegalArgumentException("Cannot obtain wsdl service: " +
serviceName);
-
- // Build endpoint meta data
- for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
- {
- QName portName = wsdlEndpoint.getQName();
- QName interfaceQName = wsdlEndpoint.getInterface().getQName();
- ClientEndpointMetaData epMetaData = new ClientEndpointMetaData(serviceMetaData,
portName, interfaceQName, Type.JAXWS);
- epMetaData.setEndpointAddress(wsdlEndpoint.getAddress());
- serviceMetaData.addEndpoint(epMetaData);
-
- // Init the endpoint binding
- initEndpointBinding(wsdlEndpoint, epMetaData);
-
- // Init the service encoding style
- initEndpointEncodingStyle(epMetaData);
-
- setupOperationsFromWSDL(epMetaData, wsdlEndpoint);
- }
- }
-
- protected void setupOperationsFromWSDL(EndpointMetaData epMetaData, WSDLEndpoint
wsdlEndpoint)
- {
- WSDLDefinitions wsdlDefinitions =
wsdlEndpoint.getInterface().getWsdlDefinitions();
-
- // For every WSDL interface operation build the OperationMetaData
- WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
- for (WSDLInterfaceOperation wsdlOperation : wsdlInterface.getOperations())
- {
- String opName = wsdlOperation.getName().toString();
- QName opQName = wsdlOperation.getQName();
-
- // Set java method name
- String javaName = opName.substring(0, 1).toLowerCase() + opName.substring(1);
-
- OperationMetaData opMetaData = new OperationMetaData(epMetaData, opQName,
javaName);
- epMetaData.addOperation(opMetaData);
-
- // Set the operation style
- String style = wsdlOperation.getStyle();
- epMetaData.setStyle((Constants.URI_STYLE_IRI.equals(style) ? Style.DOCUMENT :
Style.RPC));
-
- // Set the operation MEP
- if (Constants.WSDL20_PATTERN_IN_ONLY.equals(wsdlOperation.getPattern()))
- opMetaData.setOneWay(true);
-
- // Set the operation SOAPAction
- WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName());
- WSDLBindingOperation wsdlBindingOperation =
wsdlBinding.getOperationByRef(opQName);
- if (wsdlBindingOperation != null)
- opMetaData.setSOAPAction(wsdlBindingOperation.getSOAPAction());
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,173 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.builder.jaxws;
+
+//$Id$
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.ClientEndpointMetaData;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.common.umdm.EndpointMetaData.Type;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+
+/**
+ * A client side meta data builder.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2005
+ */
+public class JAXWSClientMetaDataBuilder extends JAXWSMetaDataBuilder
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(JAXWSClientMetaDataBuilder.class);
+
+ /** Build from WSDL and jaxrpc-mapping.xml
+ */
+ public ServiceMetaData buildMetaData(QName serviceName, URL wsdlURL, ClassLoader
loader)
+ {
+ if (wsdlURL == null)
+ throw new IllegalArgumentException("Invalid wsdlURL: " + wsdlURL);
+
+ log.debug("START buildMetaData: [service=" + serviceName +
"]");
+ try
+ {
+ UnifiedMetaData wsMetaData = new UnifiedMetaData();
+
+ ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
+ wsMetaData.addService(serviceMetaData);
+
+ serviceMetaData.setWsdlFile(wsdlURL.toExternalForm());
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+
+ buildMetaDataInternal(serviceMetaData, wsdlDefinitions);
+
+ // Read the WSDL and initialize the schema model
+ // This should only be needed for debuging purposes of the UMDM
+ JBossXSModel schemaModel =
WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
+ serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
+
+ log.debug("END buildMetaData: " + wsMetaData);
+ return serviceMetaData;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
+ }
+ }
+
+ private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions
wsdlDefinitions) throws IOException
+ {
+ QName serviceName = serviceMetaData.getServiceName();
+
+ // Get the WSDL service
+ WSDLService wsdlService = null;
+ if (serviceName == null)
+ {
+ if (wsdlDefinitions.getServices().length != 1)
+ throw new IllegalArgumentException("Expected a single service
element");
+
+ wsdlService = wsdlDefinitions.getServices()[0];
+ serviceMetaData.setServiceName(wsdlService.getQName());
+ }
+ else
+ {
+ wsdlService = wsdlDefinitions.getService(new
NCName(serviceName.getLocalPart()));
+ }
+ if (wsdlService == null)
+ throw new IllegalArgumentException("Cannot obtain wsdl service: " +
serviceName);
+
+ // Build endpoint meta data
+ for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
+ {
+ QName portName = wsdlEndpoint.getQName();
+ QName interfaceQName = wsdlEndpoint.getInterface().getQName();
+ ClientEndpointMetaData epMetaData = new ClientEndpointMetaData(serviceMetaData,
portName, interfaceQName, Type.JAXWS);
+ epMetaData.setEndpointAddress(wsdlEndpoint.getAddress());
+ serviceMetaData.addEndpoint(epMetaData);
+
+ // Init the endpoint binding
+ initEndpointBinding(wsdlEndpoint, epMetaData);
+
+ // Init the service encoding style
+ initEndpointEncodingStyle(epMetaData);
+
+ setupOperationsFromWSDL(epMetaData, wsdlEndpoint);
+ }
+ }
+
+ protected void setupOperationsFromWSDL(EndpointMetaData epMetaData, WSDLEndpoint
wsdlEndpoint)
+ {
+ WSDLDefinitions wsdlDefinitions =
wsdlEndpoint.getInterface().getWsdlDefinitions();
+
+ // For every WSDL interface operation build the OperationMetaData
+ WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
+ for (WSDLInterfaceOperation wsdlOperation : wsdlInterface.getOperations())
+ {
+ String opName = wsdlOperation.getName().toString();
+ QName opQName = wsdlOperation.getQName();
+
+ // Set java method name
+ String javaName = opName.substring(0, 1).toLowerCase() + opName.substring(1);
+
+ OperationMetaData opMetaData = new OperationMetaData(epMetaData, opQName,
javaName);
+ epMetaData.addOperation(opMetaData);
+
+ // Set the operation style
+ String style = wsdlOperation.getStyle();
+ epMetaData.setStyle((Constants.URI_STYLE_IRI.equals(style) ? Style.DOCUMENT :
Style.RPC));
+
+ // Set the operation MEP
+ if (Constants.WSDL20_PATTERN_IN_ONLY.equals(wsdlOperation.getPattern()))
+ opMetaData.setOneWay(true);
+
+ // Set the operation SOAPAction
+ WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName());
+ WSDLBindingOperation wsdlBindingOperation =
wsdlBinding.getOperationByRef(opQName);
+ if (wsdlBindingOperation != null)
+ opMetaData.setSOAPAction(wsdlBindingOperation.getSOAPAction());
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,141 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.builder.jaxws;
-
-import javax.xml.ws.BindingType;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.PortComponent;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * Builds ServiceEndpointMetaData for a JAX-WS endpoint.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public abstract class JAXWSEndpointMetaDataBuilder extends JAXWSMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSEndpointMetaDataBuilder.class);
-
- public abstract ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName);
-
- protected void processBindingType(EndpointMetaData epMetaData, Class<?>
wsClass)
- {
- BindingType anBindingType = (BindingType)wsClass.getAnnotation(BindingType.class);
- String uri = anBindingType.value();
- if (uri.length() > 0)
- {
- epMetaData.setBindingId(uri);
- }
- }
-
- protected void processPortComponent(UnifiedDeploymentInfo udi, Class<?> wsClass,
String linkName, ServerEndpointMetaData sepMetaData)
- {
- PortComponent anPortComponent =
(PortComponent)wsClass.getAnnotation(PortComponent.class);
- if (anPortComponent != null)
- {
- // setup config name
- if (anPortComponent.configName().length() > 0)
- {
- String configName = anPortComponent.configName();
- sepMetaData.setConfigName(configName);
- }
-
- // setup config file
- if (anPortComponent.configFile().length() > 0)
- {
- String configFile = anPortComponent.configFile();
- sepMetaData.setConfigFile(configFile);
- }
-
- boolean isJSEEndpoint = udi.type == DeploymentType.JAXWS_JSE;
-
- // context-root
- if (anPortComponent.contextRoot().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.contextRoot is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String contextRoot = anPortComponent.contextRoot();
- if (contextRoot.startsWith("/") == false)
- contextRoot = "/" + contextRoot;
-
- sepMetaData.setContextRoot(contextRoot);
- }
- }
-
- // url-pattern
- if (anPortComponent.urlPattern().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.urlPattern is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String urlPattern = anPortComponent.urlPattern();
- sepMetaData.setURLPattern(urlPattern);
- }
- }
-
- // auth-method
- if (anPortComponent.authMethod().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.authMethod is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String authMethod = anPortComponent.authMethod();
- sepMetaData.setAuthMethod(authMethod);
- }
- }
-
- // transport-guarantee
- if (anPortComponent.transportGuarantee().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.transportGuarantee is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String transportGuarantee = anPortComponent.transportGuarantee();
- sepMetaData.setTransportGuarantee(transportGuarantee);
- }
- }
-
- // virtual hosts
- String[] virtualHosts = anPortComponent.virtualHosts();
- if (virtualHosts != null & virtualHosts.length > 0)
- {
- sepMetaData.setVirtualHosts(virtualHosts);
- }
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,141 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.builder.jaxws;
+
+import javax.xml.ws.BindingType;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.ServerEndpointMetaData;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+
+/**
+ * Builds ServiceEndpointMetaData for a JAX-WS endpoint.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public abstract class JAXWSEndpointMetaDataBuilder extends JAXWSMetaDataBuilder
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(JAXWSEndpointMetaDataBuilder.class);
+
+ public abstract ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName);
+
+ protected void processBindingType(EndpointMetaData epMetaData, Class<?>
wsClass)
+ {
+ BindingType anBindingType = (BindingType)wsClass.getAnnotation(BindingType.class);
+ String uri = anBindingType.value();
+ if (uri.length() > 0)
+ {
+ epMetaData.setBindingId(uri);
+ }
+ }
+
+ protected void processPortComponent(UnifiedDeploymentInfo udi, Class<?> wsClass,
String linkName, ServerEndpointMetaData sepMetaData)
+ {
+ PortComponent anPortComponent =
(PortComponent)wsClass.getAnnotation(PortComponent.class);
+ if (anPortComponent != null)
+ {
+ // setup config name
+ if (anPortComponent.configName().length() > 0)
+ {
+ String configName = anPortComponent.configName();
+ sepMetaData.setConfigName(configName);
+ }
+
+ // setup config file
+ if (anPortComponent.configFile().length() > 0)
+ {
+ String configFile = anPortComponent.configFile();
+ sepMetaData.setConfigFile(configFile);
+ }
+
+ boolean isJSEEndpoint = udi.type == DeploymentType.JAXWS_JSE;
+
+ // context-root
+ if (anPortComponent.contextRoot().length() > 0)
+ {
+ if (isJSEEndpoint)
+ log.warn("(a)PortComponent.contextRoot is only valid on EJB
endpoints");
+
+ if (isJSEEndpoint == false)
+ {
+ String contextRoot = anPortComponent.contextRoot();
+ if (contextRoot.startsWith("/") == false)
+ contextRoot = "/" + contextRoot;
+
+ sepMetaData.setContextRoot(contextRoot);
+ }
+ }
+
+ // url-pattern
+ if (anPortComponent.urlPattern().length() > 0)
+ {
+ if (isJSEEndpoint)
+ log.warn("(a)PortComponent.urlPattern is only valid on EJB
endpoints");
+
+ if (isJSEEndpoint == false)
+ {
+ String urlPattern = anPortComponent.urlPattern();
+ sepMetaData.setURLPattern(urlPattern);
+ }
+ }
+
+ // auth-method
+ if (anPortComponent.authMethod().length() > 0)
+ {
+ if (isJSEEndpoint)
+ log.warn("(a)PortComponent.authMethod is only valid on EJB
endpoints");
+
+ if (isJSEEndpoint == false)
+ {
+ String authMethod = anPortComponent.authMethod();
+ sepMetaData.setAuthMethod(authMethod);
+ }
+ }
+
+ // transport-guarantee
+ if (anPortComponent.transportGuarantee().length() > 0)
+ {
+ if (isJSEEndpoint)
+ log.warn("(a)PortComponent.transportGuarantee is only valid on EJB
endpoints");
+
+ if (isJSEEndpoint == false)
+ {
+ String transportGuarantee = anPortComponent.transportGuarantee();
+ sepMetaData.setTransportGuarantee(transportGuarantee);
+ }
+ }
+
+ // virtual hosts
+ String[] virtualHosts = anPortComponent.virtualHosts();
+ if (virtualHosts != null & virtualHosts.length > 0)
+ {
+ sepMetaData.setVirtualHosts(virtualHosts);
+ }
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,34 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.builder.jaxws;
-
-import org.jboss.ws.metadata.builder.MetaDataBuilder;
-
-/**
- * Abstract class that represents a JAX-WS metadata builder.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class JAXWSMetaDataBuilder extends MetaDataBuilder
-{
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.builder.jaxws;
+
+import org.jboss.ws.core.metadata.builder.MetaDataBuilder;
+
+/**
+ * Abstract class that represents a JAX-WS metadata builder.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class JAXWSMetaDataBuilder extends MetaDataBuilder
+{
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,89 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import java.util.Iterator;
-
-import javax.jws.WebService;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.core.server.JAXWSDeployment;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * A server side meta data builder that is based on JSR-181 annotations
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 19-May-2005
- */
-public class JAXWSMetaDataBuilderEJB21 extends JAXWSServerMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderEJB21.class);
-
- /** Build from annotations
- */
- public UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi)
- {
- log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
- try
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- wsMetaData.setDeploymentName(udi.getCanonicalName());
- wsMetaData.setClassLoader(udi.classLoader);
-
- if (udi.classLoader == null)
- throw new WSException("Deployment class loader not initialized");
-
- // For every bean
- UnifiedApplicationMetaData appMetaData =
(UnifiedApplicationMetaData)udi.metaData;
- Iterator it = appMetaData.getEnterpriseBeans();
- while (it.hasNext())
- {
- UnifiedBeanMetaData beanMetaData = (UnifiedBeanMetaData)it.next();
-
- String ejbName = beanMetaData.getEjbName();
- String ejbClassName = beanMetaData.getEjbClass();
- Class beanClass = udi.classLoader.loadClass(ejbClassName);
- setupEndpoint(wsMetaData, udi, beanClass, ejbName);
- }
-
- log.debug("END buildMetaData: " + wsMetaData);
- return wsMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,89 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+// $Id$
+package org.jboss.ws.core.metadata.builder.jaxws;
+
+import java.util.Iterator;
+
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.ServerEndpointMetaData;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+/**
+ * A server side meta data builder that is based on JSR-181 annotations
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 19-May-2005
+ */
+public class JAXWSMetaDataBuilderEJB21 extends JAXWSServerMetaDataBuilder
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderEJB21.class);
+
+ /** Build from annotations
+ */
+ public UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi)
+ {
+ log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
+ try
+ {
+ UnifiedMetaData wsMetaData = new UnifiedMetaData();
+ wsMetaData.setDeploymentName(udi.getCanonicalName());
+ wsMetaData.setClassLoader(udi.classLoader);
+
+ if (udi.classLoader == null)
+ throw new WSException("Deployment class loader not initialized");
+
+ // For every bean
+ UnifiedApplicationMetaData appMetaData =
(UnifiedApplicationMetaData)udi.metaData;
+ Iterator it = appMetaData.getEnterpriseBeans();
+ while (it.hasNext())
+ {
+ UnifiedBeanMetaData beanMetaData = (UnifiedBeanMetaData)it.next();
+
+ String ejbName = beanMetaData.getEjbName();
+ String ejbClassName = beanMetaData.getEjbClass();
+ Class beanClass = udi.classLoader.loadClass(ejbClassName);
+ setupEndpoint(wsMetaData, udi, beanClass, ejbName);
+ }
+
+ log.debug("END buildMetaData: " + wsMetaData);
+ return wsMetaData;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,105 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import java.util.Iterator;
-
-import javax.jws.WebService;
-
-import org.jboss.annotation.security.SecurityDomain;
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.core.server.JAXWSDeployment;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * A server side meta data builder that is based on JSR-181 annotations
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 19-May-2005
- */
-public class JAXWSMetaDataBuilderEJB3 extends JAXWSServerMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderEJB3.class);
-
- protected Class annotatedClass;
-
- /** Build from webservices.xml
- */
- public UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi)
- {
- log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
- try
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- wsMetaData.setDeploymentName(udi.getCanonicalName());
- wsMetaData.setClassLoader(udi.classLoader);
-
- if (udi.classLoader == null)
- throw new WSException("Deployment class loader not initialized");
-
- // The container objects below provide access to all of the ejb metadata
- UnifiedApplicationMetaData appMetaData =
(UnifiedApplicationMetaData)udi.metaData;
- Iterator<UnifiedBeanMetaData> it = appMetaData.getEnterpriseBeans();
- while (it.hasNext())
- {
- UnifiedBeanMetaData beanMetaData = it.next();
- String ejbClassName = beanMetaData.getEjbClass();
- Class<?> beanClass = udi.classLoader.loadClass(ejbClassName);
- if (beanClass.isAnnotationPresent(WebService.class))
- {
- String ejbLink = beanMetaData.getEjbName();
- setupEndpoint(wsMetaData, udi, beanClass, ejbLink);
-
- // setup the security domain
- if (beanClass.isAnnotationPresent(SecurityDomain.class))
- {
- SecurityDomain anSecurityDomain =
(SecurityDomain)beanClass.getAnnotation(SecurityDomain.class);
- String lastDomain = wsMetaData.getSecurityDomain();
- String securityDomain = anSecurityDomain.value();
- if (lastDomain != null && lastDomain.equals(securityDomain) ==
false)
- throw new IllegalStateException("Multiple security domains not
supported: " + securityDomain);
-
- wsMetaData.setSecurityDomain(securityDomain);
- }
- }
- }
-
- log.debug("END buildMetaData: " + wsMetaData);
- return wsMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+// $Id$
+package org.jboss.ws.core.metadata.builder.jaxws;
+
+import java.util.Iterator;
+
+import javax.jws.WebService;
+
+import org.jboss.annotation.security.SecurityDomain;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+/**
+ * A server side meta data builder that is based on JSR-181 annotations
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 19-May-2005
+ */
+public class JAXWSMetaDataBuilderEJB3 extends JAXWSServerMetaDataBuilder
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderEJB3.class);
+
+ protected Class annotatedClass;
+
+ /** Build from webservices.xml
+ */
+ public UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi)
+ {
+ log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
+ try
+ {
+ UnifiedMetaData wsMetaData = new UnifiedMetaData();
+ wsMetaData.setDeploymentName(udi.getCanonicalName());
+ wsMetaData.setClassLoader(udi.classLoader);
+
+ if (udi.classLoader == null)
+ throw new WSException("Deployment class loader not initialized");
+
+ // The container objects below provide access to all of the ejb metadata
+ UnifiedApplicationMetaData appMetaData =
(UnifiedApplicationMetaData)udi.metaData;
+ Iterator<UnifiedBeanMetaData> it = appMetaData.getEnterpriseBeans();
+ while (it.hasNext())
+ {
+ UnifiedBeanMetaData beanMetaData = it.next();
+ String ejbClassName = beanMetaData.getEjbClass();
+ Class<?> beanClass = udi.classLoader.loadClass(ejbClassName);
+ if (beanClass.isAnnotationPresent(WebService.class))
+ {
+ String ejbLink = beanMetaData.getEjbName();
+ setupEndpoint(wsMetaData, udi, beanClass, ejbLink);
+
+ // setup the security domain
+ if (beanClass.isAnnotationPresent(SecurityDomain.class))
+ {
+ SecurityDomain anSecurityDomain =
(SecurityDomain)beanClass.getAnnotation(SecurityDomain.class);
+ String lastDomain = wsMetaData.getSecurityDomain();
+ String securityDomain = anSecurityDomain.value();
+ if (lastDomain != null && lastDomain.equals(securityDomain) ==
false)
+ throw new IllegalStateException("Multiple security domains not
supported: " + securityDomain);
+
+ wsMetaData.setSecurityDomain(securityDomain);
+ }
+ }
+ }
+
+ log.debug("END buildMetaData: " + wsMetaData);
+ return wsMetaData;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * A server side meta data builder that is based on JSR-181 annotations
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 23-Jul-2005
- */
-public class JAXWSMetaDataBuilderJSE extends JAXWSServerMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderJSE.class);
-
- /** Build from annotations
- */
- public UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi)
- {
- log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
- try
- {
- UnifiedMetaData wsMetaData = new UnifiedMetaData();
- wsMetaData.setDeploymentName(udi.getCanonicalName());
- wsMetaData.setClassLoader(udi.classLoader);
-
- if (udi.classLoader == null)
- throw new WSException("Deployment class loader not initialized");
-
- // For every bean
- UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
- Map<String, String> servletClassMap = webMetaData.getServletClassNames();
- for (String servletName : servletClassMap.keySet())
- {
- String servletClassName = servletClassMap.get(servletName);
- try
- {
- Class beanClass = udi.classLoader.loadClass(servletClassName);
- setupEndpoint(wsMetaData, udi, beanClass, servletName);
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load service endpoint class: " +
servletClassName);
- }
- }
-
- log.debug("END buildMetaData: " + wsMetaData);
- return wsMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+// $Id$
+package org.jboss.ws.core.metadata.builder.jaxws;
+
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+/**
+ * A server side meta data builder that is based on JSR-181 annotations
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 23-Jul-2005
+ */
+public class JAXWSMetaDataBuilderJSE extends JAXWSServerMetaDataBuilder
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderJSE.class);
+
+ /** Build from annotations
+ */
+ public UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi)
+ {
+ log.debug("START buildMetaData: [name=" + udi.getCanonicalName() +
"]");
+ try
+ {
+ UnifiedMetaData wsMetaData = new UnifiedMetaData();
+ wsMetaData.setDeploymentName(udi.getCanonicalName());
+ wsMetaData.setClassLoader(udi.classLoader);
+
+ if (udi.classLoader == null)
+ throw new WSException("Deployment class loader not initialized");
+
+ // For every bean
+ UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
+ Map<String, String> servletClassMap = webMetaData.getServletClassNames();
+ for (String servletName : servletClassMap.keySet())
+ {
+ String servletClassName = servletClassMap.get(servletName);
+ try
+ {
+ Class beanClass = udi.classLoader.loadClass(servletClassName);
+ setupEndpoint(wsMetaData, udi, beanClass, servletName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load service endpoint class: " +
servletClassName);
+ }
+ }
+
+ log.debug("END buildMetaData: " + wsMetaData);
+ return wsMetaData;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,169 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.ws.Provider;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceProvider;
-import javax.xml.ws.Service.Mode;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.builder.MetaDataBuilder;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-
-/**
- * A server side meta data builder that is based on JSR-181 annotations
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 23-Jul-2005
- */
-public class JAXWSProviderMetaDataBuilder extends JAXWSEndpointMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSProviderMetaDataBuilder.class);
-
- /** Build from annotations
- */
-
- @Override
- public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
- {
- // 5.3 Conformance (Provider implementation): A Provider based service endpoint
implementation MUST
- // implement a typed Provider interface.
- if (JavaUtils.isAssignableFrom(Provider.class, sepClass) == false)
- throw new WebServiceException("Endpoint implementation does not implement
javax.xml.ws.Provider: " + sepClass.getName());
-
- // 5.4 Conformance (WebServiceProvider annotation): A Provider based service
endpoint implementation
- // MUST carry a WebServiceProvider annotation
- WebServiceProvider anWebServiceProvider =
(WebServiceProvider)sepClass.getAnnotation(WebServiceProvider.class);
- if (anWebServiceProvider == null)
- throw new WebServiceException("Cannot obtain @WebServiceProvider annotation
from: " + sepClass.getName());
-
- // 7.3 Conformance (WebServiceProvider and WebService): A class annotated with the
WebServiceProvider
- // annotation MUST NOT carry a WebService annotation
- if (sepClass.isAnnotationPresent(WebService.class))
- throw new WebServiceException("Provider cannot carry @WebService
annotation: " + sepClass.getName());
-
- WSDLUtils wsdlUtils = WSDLUtils.getInstance();
-
- String name = wsdlUtils.getJustClassName(sepClass);
-
- String serviceName = anWebServiceProvider.serviceName();
- if (serviceName.length() == 0)
- serviceName = name + "Service";
-
- String targetNS = anWebServiceProvider.targetNamespace();
- if (targetNS.length() == 0)
- targetNS = wsdlUtils.getTypeNamespace(sepClass);
-
- String portName = anWebServiceProvider.portName();
- if (portName.length() == 0)
- portName = name + "Port";
-
- ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new
QName(targetNS, serviceName));
- wsMetaData.addService(serviceMetaData);
-
- // Setup the ServerEndpointMetaData
- QName portQName = new QName(targetNS, portName);
- QName portTypeQName = new QName(targetNS, name);
- ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData,
portQName, portTypeQName, Type.JAXWS);
- sepMetaData.setLinkName(linkName);
-
- sepMetaData.setStyle(Style.DOCUMENT);
- sepMetaData.setParameterStyle(ParameterStyle.BARE);
-
- sepMetaData.setServiceEndpointImplName(sepClass.getName());
- sepMetaData.setServiceEndpointInterfaceName(sepClass.getName());
-
- ServiceMode anServiceMode = sepClass.getAnnotation(ServiceMode.class);
- if (anServiceMode != null)
- sepMetaData.setServiceMode(anServiceMode.value());
- else sepMetaData.setServiceMode(Mode.PAYLOAD);
-
- serviceMetaData.addEndpoint(sepMetaData);
-
- // Process invoke method
- processInvokeMethod(sepMetaData);
-
- // Process WSDL
- String wsdlLocation = anWebServiceProvider.wsdlLocation();
- if (wsdlLocation != null)
- serviceMetaData.setWsdlFile(wsdlLocation);
-
- // Set the endpoint address
- processPortComponent(udi, sepClass, linkName, sepMetaData);
-
- // Init the endpoint address
- MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
-
- // A provider may not have a WSDL file
- if (sepMetaData.getServiceMetaData().getWsdlFile() != null)
- MetaDataBuilder.replaceAddressLocation(sepMetaData);
-
- // init service endpoint id
- ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
- sepMetaData.setServiceEndpointID(sepID);
-
- return sepMetaData;
- }
-
- private void processInvokeMethod(ServerEndpointMetaData epMetaData)
- {
- String javaName = "invoke";
- String targetNS = epMetaData.getQName().getNamespaceURI();
- OperationMetaData opMetaData = new OperationMetaData(epMetaData, new
QName(targetNS, javaName), javaName);
- epMetaData.addOperation(opMetaData);
-
- Mode serviceMode = epMetaData.getServiceMode();
- Class paramType = (serviceMode == Mode.MESSAGE ? SOAPMessage.class :
Source.class);
-
- // Setup invoke param
- QName xmlName = new QName("invokeParam");
- QName xmlType = Constants.TYPE_LITERAL_ANYTYPE;
- ParameterMetaData pmd = new ParameterMetaData(opMetaData, xmlName, xmlType,
paramType.getName());
- opMetaData.addParameter(pmd);
-
- // Setup invoke return
- xmlName = new QName("invokeReturn");
- ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
paramType.getName());
- opMetaData.setReturnParameter(retMetaData);
- }
-}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,169 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+// $Id$
+package org.jboss.ws.core.metadata.builder.jaxws;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.Source;
+import javax.xml.ws.Provider;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.Service.Mode;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.umdm.ServerEndpointMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.common.umdm.EndpointMetaData.Type;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.builder.MetaDataBuilder;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+/**
+ * A server side meta data builder that is based on JSR-181 annotations
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 23-Jul-2005
+ */
+public class JAXWSProviderMetaDataBuilder extends JAXWSEndpointMetaDataBuilder
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(JAXWSProviderMetaDataBuilder.class);
+
+ /** Build from annotations
+ */
+
+ @Override
+ public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
+ {
+ // 5.3 Conformance (Provider implementation): A Provider based service endpoint
implementation MUST
+ // implement a typed Provider interface.
+ if (JavaUtils.isAssignableFrom(Provider.class, sepClass) == false)
+ throw new WebServiceException("Endpoint implementation does not implement
javax.xml.ws.Provider: " + sepClass.getName());
+
+ // 5.4 Conformance (WebServiceProvider annotation): A Provider based service
endpoint implementation
+ // MUST carry a WebServiceProvider annotation
+ WebServiceProvider anWebServiceProvider =
(WebServiceProvider)sepClass.getAnnotation(WebServiceProvider.class);
+ if (anWebServiceProvider == null)
+ throw new WebServiceException("Cannot obtain @WebServiceProvider annotation
from: " + sepClass.getName());
+
+ // 7.3 Conformance (WebServiceProvider and WebService): A class annotated with the
WebServiceProvider
+ // annotation MUST NOT carry a WebService annotation
+ if (sepClass.isAnnotationPresent(WebService.class))
+ throw new WebServiceException("Provider cannot carry @WebService
annotation: " + sepClass.getName());
+
+ WSDLUtils wsdlUtils = WSDLUtils.getInstance();
+
+ String name = wsdlUtils.getJustClassName(sepClass);
+
+ String serviceName = anWebServiceProvider.serviceName();
+ if (serviceName.length() == 0)
+ serviceName = name + "Service";
+
+ String targetNS = anWebServiceProvider.targetNamespace();
+ if (targetNS.length() == 0)
+ targetNS = wsdlUtils.getTypeNamespace(sepClass);
+
+ String portName = anWebServiceProvider.portName();
+ if (portName.length() == 0)
+ portName = name + "Port";
+
+ ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new
QName(targetNS, serviceName));
+ wsMetaData.addService(serviceMetaData);
+
+ // Setup the ServerEndpointMetaData
+ QName portQName = new QName(targetNS, portName);
+ QName portTypeQName = new QName(targetNS, name);
+ ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData,
portQName, portTypeQName, Type.JAXWS);
+ sepMetaData.setLinkName(linkName);
+
+ sepMetaData.setStyle(Style.DOCUMENT);
+ sepMetaData.setParameterStyle(ParameterStyle.BARE);
+
+ sepMetaData.setServiceEndpointImplName(sepClass.getName());
+ sepMetaData.setServiceEndpointInterfaceName(sepClass.getName());
+
+ ServiceMode anServiceMode = sepClass.getAnnotation(ServiceMode.class);
+ if (anServiceMode != null)
+ sepMetaData.setServiceMode(anServiceMode.value());
+ else sepMetaData.setServiceMode(Mode.PAYLOAD);
+
+ serviceMetaData.addEndpoint(sepMetaData);
+
+ // Process invoke method
+ processInvokeMethod(sepMetaData);
+
+ // Process WSDL
+ String wsdlLocation = anWebServiceProvider.wsdlLocation();
+ if (wsdlLocation != null)
+ serviceMetaData.setWsdlFile(wsdlLocation);
+
+ // Set the endpoint address
+ processPortComponent(udi, sepClass, linkName, sepMetaData);
+
+ // Init the endpoint address
+ MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
+
+ // A provider may not have a WSDL file
+ if (sepMetaData.getServiceMetaData().getWsdlFile() != null)
+ MetaDataBuilder.replaceAddressLocation(sepMetaData);
+
+ // init service endpoint id
+ ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
+ sepMetaData.setServiceEndpointID(sepID);
+
+ return sepMetaData;
+ }
+
+ private void processInvokeMethod(ServerEndpointMetaData epMetaData)
+ {
+ String javaName = "invoke";
+ String targetNS = epMetaData.getQName().getNamespaceURI();
+ OperationMetaData opMetaData = new OperationMetaData(epMetaData, new
QName(targetNS, javaName), javaName);
+ epMetaData.addOperation(opMetaData);
+
+ Mode serviceMode = epMetaData.getServiceMode();
+ Class paramType = (serviceMode == Mode.MESSAGE ? SOAPMessage.class :
Source.class);
+
+ // Setup invoke param
+ QName xmlName = new QName("invokeParam");
+ QName xmlType = Constants.TYPE_LITERAL_ANYTYPE;
+ ParameterMetaData pmd = new ParameterMetaData(opMetaData, xmlName, xmlType,
paramType.getName());
+ opMetaData.addParameter(pmd);
+
+ // Setup invoke return
+ xmlName = new QName("invokeReturn");
+ ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
paramType.getName());
+ opMetaData.setReturnParameter(retMetaData);
+ }
+}
\ No newline at end of file
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.builder.jaxws;
-
-// $Id$
-
-import javax.jws.WebService;
-import javax.xml.ws.WebServiceProvider;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.JAXWSDeployment;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/** An abstract annotation meta data builder.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 27-Jun-2006
- */
-public abstract class JAXWSServerMetaDataBuilder extends JAXWSMetaDataBuilder
-{
- public abstract UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi);
-
- protected JAXWSEndpointMetaDataBuilder getEndpointBuilder(Class<?> bean)
- {
- if (bean.isAnnotationPresent(WebServiceProvider.class))
- return new JAXWSProviderMetaDataBuilder();
-
- if (bean.isAnnotationPresent(WebService.class))
- return new JAXWSWebServiceMetaDataBuilder();
-
- return null;
- }
-
- protected void setupEndpoint(UnifiedMetaData umd, UnifiedDeploymentInfo udi,
Class<?> beanClass, String beanName)
- throws SecurityException, ClassNotFoundException, NoSuchMethodException
- {
- JAXWSEndpointMetaDataBuilder builder = getEndpointBuilder(beanClass);
- if (builder != null)
- builder.buildEndpoint(umd, udi, beanClass, beanName);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.builder.jaxws;
+
+// $Id$
+
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+/** An abstract annotation meta data builder.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 27-Jun-2006
+ */
+public abstract class JAXWSServerMetaDataBuilder extends JAXWSMetaDataBuilder
+{
+ public abstract UnifiedMetaData buildMetaData(UnifiedDeploymentInfo udi);
+
+ protected JAXWSEndpointMetaDataBuilder getEndpointBuilder(Class<?> bean)
+ {
+ if (bean.isAnnotationPresent(WebServiceProvider.class))
+ return new JAXWSProviderMetaDataBuilder();
+
+ if (bean.isAnnotationPresent(WebService.class))
+ return new JAXWSWebServiceMetaDataBuilder();
+
+ return null;
+ }
+
+ protected void setupEndpoint(UnifiedMetaData umd, UnifiedDeploymentInfo udi,
Class<?> beanClass, String beanName)
+ throws SecurityException, ClassNotFoundException, NoSuchMethodException
+ {
+ JAXWSEndpointMetaDataBuilder builder = getEndpointBuilder(beanClass);
+ if (builder != null)
+ builder.buildEndpoint(umd, udi, beanClass, beanName);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,1037 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.builder.jaxws;
-
-// $Id$
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Writer;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import javax.jws.HandlerChain;
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPMessageHandlers;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.management.ObjectName;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.ws.BindingType;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-import javax.xml.ws.WebFault;
-import javax.xml.ws.addressing.AddressingProperties;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.utils.HolderUtils;
-import org.jboss.ws.common.utils.IOUtils;
-import org.jboss.ws.common.utils.JBossWSEntityResolver;
-import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.core.jaxws.WrapperGenerator;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.extras.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.metadata.acessor.JAXBAccessor;
-import org.jboss.ws.metadata.builder.MetaDataBuilder;
-import org.jboss.ws.metadata.config.jaxws.WSEndpointConfigJAXWS;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainsMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
-import org.jboss.ws.metadata.umdm.TypesMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.WSDLWriter;
-import org.jboss.ws.metadata.wsdl.WSDLWriter.ResolvedWriter;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
-import org.jboss.ws.tools.jaxws.WSDLGenerator;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-import com.sun.xml.bind.api.JAXBRIContext;
-import com.sun.xml.bind.api.TypeReference;
-
-/** An abstract annotation meta data builder.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @since 15-Oct-2005
- */
-@SuppressWarnings("deprecation")
-public class JAXWSWebServiceMetaDataBuilder extends JAXWSEndpointMetaDataBuilder
-{
- private static class EndpointResult
- {
- private Class<?> klass;
- private ServerEndpointMetaData semd;
- private ServiceMetaData smd;
- private String wsdlLocation;
- }
-
- // provide logging
- private static final Logger log =
Logger.getLogger(JAXWSWebServiceMetaDataBuilder.class);
- private List<Class> javaTypes = new ArrayList<Class>();
- private JAXBRIContext jaxbCtx;
- private List<TypeReference> typeRefs = new ArrayList<TypeReference>();
-
- private WrapperGenerator wrapperGenerator;
-
- public JAXWSWebServiceMetaDataBuilder()
- {
- }
-
- private void addFault(OperationMetaData omd, Class<?> exception)
- {
- if (omd.isOneWay())
- throw new IllegalStateException("JSR-181 4.3.1 - A JSR-181 processor is
REQUIRED to report an error if an operation marked "
- + "@Oneway has a return value, declares any checked exceptions or has
any INOUT or OUT parameters.");
-
- WebFault annotation = exception.getAnnotation(WebFault.class);
-
- String name;
- String namespace;
- String faultBeanName = null;
-
- // Only the element name is effected by @WebFault, the type uses the same
convention
- QName xmlType = new QName(omd.getQName().getNamespaceURI(),
exception.getSimpleName());
-
- /*
- * If @WebFault is present, and the exception contains getFaultInfo, the
- * return value should be used. Otherwise we need to generate the bean.
- */
- boolean generate = true;
- if (annotation != null)
- {
- name = annotation.name();
- namespace = annotation.targetNamespace();
- if (namespace.length() == 0)
- namespace = omd.getQName().getNamespaceURI();
-
- Class<?> faultBean = getFaultInfo(exception);
- if (faultBean != null)
- {
- generate = false;
- faultBeanName = faultBean.getName();
- }
- }
- else
- {
- name = xmlType.getLocalPart();
- namespace = xmlType.getNamespaceURI();
- }
-
- if (faultBeanName == null)
- faultBeanName =
JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) +
".jaxws." + exception.getSimpleName() + "Bean";
-
- QName xmlName = new QName(namespace, name);
-
- FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlType, exception.getName());
- fmd.setFaultBeanName(faultBeanName);
-
- if (generate)
- wrapperGenerator.generate(fmd);
-
- javaTypes.add(fmd.getFaultBean());
- typeRefs.add(new TypeReference(fmd.getXmlName(), fmd.getFaultBean()));
-
- omd.addFault(fmd);
- }
-
- private String convertToVariable(String localName)
- {
- return JAXBRIContext.mangleNameToVariableName(localName);
- }
-
- private String[] convertTypeArguments(Class rawType, Type type)
- {
- if (!Collection.class.isAssignableFrom(rawType) &&
!Map.class.isAssignableFrom(rawType))
- return null;
-
- if (!(type instanceof ParameterizedType))
- return null;
-
- ParameterizedType paramType = (ParameterizedType)type;
- Type[] arguments = paramType.getActualTypeArguments();
- String[] ret = new String[arguments.length];
- for (int i = 0; i < arguments.length; i++)
- ret[i] = JavaUtils.erasure(arguments[i]).getName();
-
- return ret;
- }
-
- private ParameterMetaData createRequestWrapper(OperationMetaData operation, Method
method)
- {
- String requestWrapperType = null;
- QName xmlName = operation.getQName();
- QName xmlType = xmlName;
- if (method.isAnnotationPresent(RequestWrapper.class))
- {
- RequestWrapper anReqWrapper = method.getAnnotation(RequestWrapper.class);
-
- String localName = anReqWrapper.localName().length() > 0 ?
anReqWrapper.localName() : xmlName.getLocalPart();
- String targetNamespace = anReqWrapper.targetNamespace().length() > 0 ?
anReqWrapper.targetNamespace() : xmlName.getNamespaceURI();
- xmlName = new QName(targetNamespace, localName);
-
- if (anReqWrapper.className().length() > 0)
- requestWrapperType = anReqWrapper.className();
- }
-
- // Conformance 3.18, the default value must be the same as the method name
- if (requestWrapperType == null)
- {
- String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) +
".jaxws";
- requestWrapperType = packageName + "." +
JavaUtils.capitalize(method.getName());
- }
-
- // JAX-WS p.37 pg.1, the annotation only affects the element name, not the type
name
- ParameterMetaData wrapperParameter = new ParameterMetaData(operation, xmlName,
xmlType, requestWrapperType);
- wrapperParameter.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
- operation.addParameter(wrapperParameter);
-
- return wrapperParameter;
- }
-
- private ParameterMetaData createResponseWrapper(OperationMetaData operation, Method
method)
- {
- QName operationQName = operation.getQName();
- QName xmlName = new QName(operationQName.getNamespaceURI(),
operationQName.getLocalPart() + "Response");
- QName xmlType = xmlName;
-
- String responseWrapperType = null;
- if (method.isAnnotationPresent(ResponseWrapper.class))
- {
- ResponseWrapper anResWrapper = method.getAnnotation(ResponseWrapper.class);
-
- String localName = anResWrapper.localName().length() > 0 ?
anResWrapper.localName() : xmlName.getLocalPart();
- String targetNamespace = anResWrapper.targetNamespace().length() > 0 ?
anResWrapper.targetNamespace() : xmlName.getNamespaceURI();
- xmlName = new QName(targetNamespace, localName);
-
- if (anResWrapper.className().length() > 0)
- responseWrapperType = anResWrapper.className();
- }
-
- if (responseWrapperType == null)
- {
- String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) +
".jaxws";
- responseWrapperType = packageName + "." +
JavaUtils.capitalize(method.getName()) + "Response";
- }
-
- ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType,
responseWrapperType);
- retMetaData.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
- operation.setReturnParameter(retMetaData);
-
- return retMetaData;
- }
-
- private Class<?> getFaultInfo(Class<?> exception)
- {
- try
- {
- Method method = exception.getMethod("getFaultInfo");
- Class<?> returnType = method.getReturnType();
- if (returnType == void.class)
- return null;
-
- return returnType;
- }
- catch (SecurityException e)
- {
- throw new WSException("Unexpected security exception: " +
e.getMessage(), e);
- }
- catch (NoSuchMethodException e)
- {
- return null;
- }
- }
-
- private ParameterMode getParameterMode(WebParam anWebParam, Class javaType)
- {
- if (anWebParam != null)
- {
- if (anWebParam.mode() == WebParam.Mode.INOUT)
- return ParameterMode.INOUT;
- if (anWebParam.mode() == WebParam.Mode.OUT)
- return ParameterMode.OUT;
- }
-
- return HolderUtils.isHolderType(javaType) ? ParameterMode.INOUT :
ParameterMode.IN;
- }
-
- private WebParam getWebParamAnnotation(Method method, int pos)
- {
- for (Annotation annotation : method.getParameterAnnotations()[pos])
- if (annotation instanceof WebParam)
- return (WebParam)annotation;
-
- return null;
- }
-
- private QName getWebParamName(OperationMetaData opMetaData, int index, Class javaType,
WebParam webParam)
- {
- String namespace = null;
- String name = null;
- boolean header = false;
-
- if (webParam != null)
- {
- if (webParam.targetNamespace().length() > 0)
- namespace = webParam.targetNamespace();
-
- if (webParam.name().length() > 0)
- name = webParam.name();
-
- header = webParam.header();
- }
-
- // Bare and headers must be qualified
- if (namespace == null && (opMetaData.isDocumentBare() || header))
- namespace = opMetaData.getQName().getNamespaceURI();
-
- // RPC body parts must have no namespace
- else if (opMetaData.isRPCLiteral() && !header)
- namespace = null;
-
- // Bare uses the operation name as the default, everything else is generated
- if (name == null)
- name = opMetaData.isDocumentBare() && !header ?
opMetaData.getQName().getLocalPart() : "arg" + index;
-
- return (namespace != null) ? new QName(namespace, name) : new QName(name);
- }
-
- private QName getWebResultName(OperationMetaData opMetaData, Class javaType, WebResult
anWebResult)
- {
- String name = null;
- String namespace = null;
- boolean header = false;
-
- if (anWebResult != null)
- {
- if (anWebResult.targetNamespace().length() > 0)
- namespace = anWebResult.targetNamespace();
-
- if (anWebResult.name().length() > 0)
- name = anWebResult.name();
-
- header = anWebResult.header();
- }
-
- // Bare and headers must be qualified
- if (namespace == null && (opMetaData.isDocumentBare() || header))
- namespace = opMetaData.getQName().getNamespaceURI();
-
- // RPC body parts must have no namespace
- else if (opMetaData.isRPCLiteral() && !header)
- namespace = null;
-
- // Bare uses the operation name as the default, everything else is generated
- if (name == null)
- name = opMetaData.isDocumentBare() && !header ?
opMetaData.getResponseName().getLocalPart() : "return";
-
- return (namespace != null) ? new QName(namespace, name) : new QName(name);
- }
-
- private void populateXmlType(FaultMetaData faultMetaData)
- {
- EndpointMetaData epMetaData =
faultMetaData.getOperationMetaData().getEndpointMetaData();
- TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
-
- QName xmlType = faultMetaData.getXmlType();
- String faultBeanName = faultMetaData.getFaultBeanName();
-
- types.addTypeMapping(new TypeMappingMetaData(types, xmlType, faultBeanName));
- }
-
- private void populateXmlType(ParameterMetaData paramMetaData)
- {
- EndpointMetaData epMetaData =
paramMetaData.getOperationMetaData().getEndpointMetaData();
- TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
-
- QName xmlName = paramMetaData.getXmlName();
- QName xmlType = paramMetaData.getXmlType();
- Class javaType = paramMetaData.getJavaType();
- String javaName = paramMetaData.getJavaTypeName();
-
- if (xmlType == null)
- {
- try
- {
- xmlType = jaxbCtx.getTypeName(new TypeReference(xmlName, javaType));
- }
- catch (IllegalArgumentException e)
- {
- throw new IllegalStateException("Cannot obtain xml type for:
[xmlName=" + xmlName + ",javaName=" + javaName + "]");
- }
-
- /* Anonymous type.
- *
- * Currently the design of our stack is based on the
- * notion of their always being a unique type. In order to lookup the
- * appropriate (de)serializer you must have a type. So we use a fake
- * name. This is an illegal NCName, so it shouldn't collide.
- */
- if (xmlType == null)
- xmlType = new QName(xmlName.getNamespaceURI(), ">" +
xmlName.getLocalPart());
-
- paramMetaData.setXmlType(xmlType);
- }
-
- types.addTypeMapping(new TypeMappingMetaData(types, xmlType, javaName));
- }
-
- /**
- * Process operation meta data extensions.
- */
- private void processMetaExtensions(EndpointMetaData epMetaData, OperationMetaData
opMetaData)
- {
- // Until there is a addressing annotion we fallback to implicit action asosciation
- // TODO: figure out a way to assign message name instead of IN and OUT
- String tns = epMetaData.getQName().getNamespaceURI();
- String portTypeName = epMetaData.getQName().getLocalPart();
-
- AddressingProperties ADDR = new AddressingPropertiesImpl();
- AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
- addrExt.setInboundAction(tns + "/" + portTypeName + "/IN");
-
- if (!opMetaData.isOneWay())
- addrExt.setOutboundAction(tns + "/" + portTypeName +
"/OUT");
-
- opMetaData.addExtension(addrExt);
- }
-
- private void processWebMethod(EndpointMetaData epMetaData, Method method)
- {
- String javaName = method.getName();
-
- // skip asnyc methods, they dont need meta data representation
- if (method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
- return;
-
- // reflection defaults
- String soapAction = "";
- String operationName = method.getName();
-
- // annotation values that override defaults
- if (method.isAnnotationPresent(WebMethod.class))
- {
- WebMethod anWebMethod = method.getAnnotation(WebMethod.class);
- soapAction = anWebMethod.action();
- if (anWebMethod.operationName().length() > 0)
- {
- operationName = anWebMethod.operationName();
- }
- }
-
- String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
- OperationMetaData opMetaData = new OperationMetaData(epMetaData, new
QName(targetNS, operationName), javaName);
- opMetaData.setOneWay(method.isAnnotationPresent(Oneway.class));
- opMetaData.setSOAPAction(soapAction);
- epMetaData.addOperation(opMetaData);
-
- // Build parameter meta data
- Class[] parameterTypes = method.getParameterTypes();
- Type[] genericTypes = method.getGenericParameterTypes();
- Annotation[][] parameterAnnotations = method.getParameterAnnotations();
- ParameterMetaData wrapperParameter = null, wrapperOutputParameter = null;
- List<WrappedParameter> wrappedParameters = null, wrappedOutputParameters =
null;
-
- // Force paramter style to wrapped
- if (method.isAnnotationPresent(RequestWrapper.class) ||
method.isAnnotationPresent(ResponseWrapper.class))
- {
- epMetaData.setParameterStyle(ParameterStyle.WRAPPED);
- }
-
- if (opMetaData.isDocumentWrapped())
- {
- wrapperParameter = createRequestWrapper(opMetaData, method);
- wrappedParameters = new
ArrayList<WrappedParameter>(parameterTypes.length);
- wrapperParameter.setWrappedParameters(wrappedParameters);
-
- if (!opMetaData.isOneWay())
- {
- wrapperOutputParameter = createResponseWrapper(opMetaData, method);
- wrappedOutputParameters = new
ArrayList<WrappedParameter>(parameterTypes.length + 1);
- wrapperOutputParameter.setWrappedParameters(wrappedOutputParameters);
- }
- }
-
- for (int i = 0; i < parameterTypes.length; i++)
- {
- Class javaType = parameterTypes[i];
- Type genericType = genericTypes[i];
- String javaTypeName = javaType.getName();
- WebParam anWebParam = getWebParamAnnotation(method, i);
- boolean isHeader = anWebParam != null && anWebParam.header();
- boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
- ParameterMode mode = getParameterMode(anWebParam, javaType);
-
- // Assert one-way
- if (opMetaData.isOneWay() && mode != ParameterMode.IN)
- throw new IllegalArgumentException("A one-way operation can not have
output parameters [" + "method = " + method.getName() + ", parameter =
" + i + "]");
-
- if (HolderUtils.isHolderType(javaType))
- {
- genericType = HolderUtils.getGenericValueType(genericType);
- javaType = JavaUtils.erasure(genericType);
- javaTypeName = javaType.getName();
- }
-
- if (isWrapped)
- {
- QName wrappedElementName = getWebParamName(opMetaData, i, javaType,
anWebParam);
- String variable = convertToVariable(wrappedElementName.getLocalPart());
-
- WrappedParameter wrappedParameter = new WrappedParameter(wrappedElementName,
javaTypeName, variable, i);
- wrappedParameter.setTypeArguments(convertTypeArguments(javaType,
genericType));
-
- if (mode != ParameterMode.OUT)
- wrappedParameters.add(wrappedParameter);
- if (mode != ParameterMode.IN)
- {
- wrappedOutputParameters.add(wrappedParameter);
- wrappedParameter.setHolder(true);
- }
- }
- else
- {
- QName xmlName = getWebParamName(opMetaData, i, javaType, anWebParam);
-
- ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName,
javaTypeName);
- paramMetaData.setInHeader(isHeader);
- paramMetaData.setIndex(i);
- paramMetaData.setMode(mode);
-
- opMetaData.addParameter(paramMetaData);
- javaTypes.add(javaType);
- typeRefs.add(new TypeReference(xmlName, genericType,
parameterAnnotations[i]));
- }
- }
-
- // Build result meta data
- Class returnType = method.getReturnType();
- Type genericReturnType = method.getGenericReturnType();
- String returnTypeName = returnType.getName();
- if ((returnType == void.class) == false)
- {
- if (opMetaData.isOneWay())
- throw new IllegalArgumentException("[JSR-181 2.5.1] The method
'" + method.getName() + "' can not have a return value if it is marked
OneWay");
-
- WebResult anWebResult = method.getAnnotation(WebResult.class);
- boolean isHeader = anWebResult != null && anWebResult.header();
- boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
- QName xmlName = getWebResultName(opMetaData, returnType, anWebResult);
-
- if (isWrapped)
- {
- WrappedParameter wrapped = new WrappedParameter(xmlName, returnTypeName,
convertToVariable(xmlName.getLocalPart()), -1);
- wrapped.setTypeArguments(convertTypeArguments(returnType,
genericReturnType));
-
- // insert at the beginning just for prettiness
- wrappedOutputParameters.add(0, wrapped);
- }
- else
- {
- ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName,
returnTypeName);
- retMetaData.setInHeader(isHeader);
- opMetaData.setReturnParameter(retMetaData);
-
- javaTypes.add(returnType);
- typeRefs.add(new TypeReference(xmlName, genericReturnType,
method.getAnnotations()));
- }
- }
-
- // Generate wrapper beans
- if (opMetaData.isDocumentWrapped())
- {
- wrapperGenerator.generate(wrapperParameter);
- Class wrapperClass = wrapperParameter.getJavaType();
- javaTypes.add(wrapperClass);
- // In case there is no @XmlRootElement
- typeRefs.add(new TypeReference(wrapperParameter.getXmlName(), wrapperClass));
- if (!opMetaData.isOneWay())
- {
- wrapperGenerator.generate(wrapperOutputParameter);
- wrapperClass = wrapperOutputParameter.getJavaType();
- javaTypes.add(wrapperClass);
- // In case there is no @XmlRootElement
- typeRefs.add(new TypeReference(wrapperOutputParameter.getXmlName(),
wrapperClass));
- }
- }
-
- // Add faults
- for (Class exClass : method.getExceptionTypes())
- if (!RemoteException.class.isAssignableFrom(exClass))
- addFault(opMetaData, exClass);
-
- // process op meta data extension
- processMetaExtensions(epMetaData, opMetaData);
- }
-
- private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?>
sepClass, ClassLoader loader) throws ClassNotFoundException
- {
- WebService anWebService = sepClass.getAnnotation(WebService.class);
- if (anWebService == null)
- throw new WSException("Cannot obtain @WebService annotation from: " +
sepClass.getName());
-
- Class<?> seiClass = null;
- String seiName = null;
- WSDLUtils wsdlUtils = WSDLUtils.getInstance();
-
- String name = anWebService.name();
- if (name.length() == 0)
- name = WSDLUtils.getJustClassName(sepClass);
-
- String serviceName = anWebService.serviceName();
- if (serviceName.length() == 0)
- serviceName = name + "Service";
-
- String serviceNS = anWebService.targetNamespace();
- if (serviceNS.length() == 0)
- serviceNS = wsdlUtils.getTypeNamespace(sepClass);
-
- String portName = anWebService.portName();
- if (portName.length() == 0)
- portName = name + "Port";
-
- String wsdlLocation = anWebService.wsdlLocation();
- String interfaceNS = serviceNS;
-
- if (anWebService.endpointInterface().length() > 0)
- {
- seiName = anWebService.endpointInterface();
- seiClass = loader.loadClass(seiName);
- anWebService = seiClass.getAnnotation(WebService.class);
-
- if (anWebService == null)
- throw new WSException("Interface does not have a @WebService annotation:
" + seiName);
-
- name = anWebService.name();
- if (name.length() == 0)
- name = WSDLUtils.getJustClassName(seiClass);
-
- interfaceNS = anWebService.targetNamespace();
- if (interfaceNS.length() == 0)
- interfaceNS = wsdlUtils.getTypeNamespace(seiClass);
-
- // The spec states that WSDL location should be allowed on an SEI, although it
- // makes far more sense on the implementation bean, so we ALWAYS override the
SEI
- // when wsdlLocation is defined on the bean
-
- if (wsdlLocation.length() == 0)
- wsdlLocation = anWebService.wsdlLocation();
- }
-
- // Setup the ServerEndpointMetaData
- QName portQName = new QName(serviceNS, portName);
- QName portTypeQName = new QName(interfaceNS, name);
-
- EndpointResult result = new EndpointResult();
- result.smd = new ServiceMetaData(wsMetaData, new QName(serviceNS, serviceName));
- result.semd = new ServerEndpointMetaData(result.smd, portQName, portTypeQName,
EndpointMetaData.Type.JAXWS);
- result.klass = (seiClass != null ? seiClass : sepClass);
- result.wsdlLocation = wsdlLocation;
-
- result.smd.addEndpoint(result.semd);
- wsMetaData.addService(result.smd);
-
- return result;
- }
-
- protected void createJAXBContext(EndpointMetaData epMetaData)
- {
- try
- {
- String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
- log.debug("JAXBContext [types=" + javaTypes + ",tns=" +
targetNS + "]");
- jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs,
targetNS, false);
- }
- catch (JAXBException ex)
- {
- throw new IllegalStateException("Cannot build JAXB context", ex);
- }
- }
-
- protected void populateXmlTypes(EndpointMetaData epMetaData)
- {
- for (OperationMetaData operation : epMetaData.getOperations())
- {
- // parameters
- for (ParameterMetaData paramMetaData : operation.getParameters())
- {
- populateXmlType(paramMetaData);
- }
-
- // return value
- ParameterMetaData returnParameter = operation.getReturnParameter();
- if (returnParameter != null)
- populateXmlType(returnParameter);
-
- // faults
- for (FaultMetaData faultMetaData : operation.getFaults())
- {
- populateXmlType(faultMetaData);
- }
- }
- }
-
- /**
- * Process an optional @HandlerChain annotation
- *
- * Location of the handler chain file. The location supports 2 formats.
- *
- * 1. An absolute java.net.URL in externalForm.
- * (ex:
http://myhandlers.foo.com/handlerfile1.xml)
- *
- * 2. A relative path from the source file or class file.
- * (ex: bar/handlerfile1.xml)
- */
- protected void processHandlerChain(EndpointMetaData epMetaData, Class<?>
wsClass)
- {
- if (wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
- throw new WSException("Cannot combine @HandlerChain with
@SOAPMessageHandlers");
-
- HandlerChain anHandlerChain =
(HandlerChain)wsClass.getAnnotation(HandlerChain.class);
-
- URL fileURL = null;
- String filename = anHandlerChain.file();
-
- // Try the filename as URL
- try
- {
- fileURL = new URL(filename);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try the filename as File
- if (fileURL == null)
- {
- try
- {
- File file = new File(filename);
- if (file.exists())
- fileURL = file.toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- // Try the filename as Resource
- if (fileURL == null)
- {
- fileURL = epMetaData.getClassLoader().getResource(filename);
- }
-
- // Try the filename relative to class
- if (fileURL == null)
- {
- String packagePath = wsClass.getPackage().getName().replace('.',
'/');
- fileURL = epMetaData.getClassLoader().getResource(packagePath + "/" +
filename);
- }
-
- if (fileURL == null)
- throw new WSException("Cannot resolve handler file '" + filename +
"' on " + wsClass.getName());
-
- try
- {
- HandlerChainsMetaData handlerChainsMetaData = null;
- InputStream is = fileURL.openStream();
- try
- {
- Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setValidation(true);
- unmarshaller.setSchemaValidation(true);
- unmarshaller.setEntityResolver(new JBossWSEntityResolver());
- ObjectModelFactory factory = new HandlerChainFactory();
- handlerChainsMetaData = (HandlerChainsMetaData)unmarshaller.unmarshal(is,
factory, null);
- }
- finally
- {
- is.close();
- }
-
- // Setup the endpoint handlers
- for (HandlerChainMetaData handlerChainMetaData :
handlerChainsMetaData.getHandlerChains())
- {
- for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
- {
- epMetaData.addHandler(uhmd.getHandlerMetaDataJAXWS(epMetaData,
HandlerType.ENDPOINT));
- }
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot process handler chain: " + filename,
ex);
- }
- }
-
- protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData,
String wsdlLocation, EndpointMetaData epMetaData)
- {
- if (wsdlLocation.length() > 0)
- {
- serviceMetaData.setWsdlFile(wsdlLocation);
- }
- else
- {
- try
- {
- String serviceName = serviceMetaData.getServiceName().getLocalPart();
-
- WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
- WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
-
- // Ensure that types are only in the interface qname
-
wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getInterfaceQName().getNamespaceURI());
-
- final File tmpdir = IOUtils.createTempDirectory();
- File wsdlTmpFile = File.createTempFile(serviceName, ".wsdl",
tmpdir);
- wsdlTmpFile.deleteOnExit();
-
- Writer writer = IOUtils.getCharsetFileWriter(wsdlTmpFile,
Constants.DEFAULT_XML_CHARSET);
- wsdlDefinitions.write(writer, Constants.DEFAULT_XML_CHARSET, new
WSDLWriter.WriterResolver()
- {
- public ResolvedWriter resolve(String suggestedFile) throws IOException
- {
- File newTmpFile = File.createTempFile(suggestedFile, ".wsdl",
tmpdir);
- newTmpFile.deleteOnExit();
- WSDLWriter.ResolvedWriter resolvedWriter = new
WSDLWriter.ResolvedWriter();
- resolvedWriter.actualFile = newTmpFile.getName();
- resolvedWriter.charset = Constants.DEFAULT_XML_CHARSET;
- resolvedWriter.writer = IOUtils.getCharsetFileWriter(newTmpFile,
Constants.DEFAULT_XML_CHARSET);
- return resolvedWriter;
- }
- });
- writer.close();
-
- serviceMetaData.setWsdlFile(wsdlTmpFile.toURL().toExternalForm());
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (IOException e)
- {
- throw new WSException("Cannot write generated wsdl", e);
- }
- }
- }
-
- protected void processSOAPBinding(EndpointMetaData epMetaData, Class<?>
wsClass)
- {
- SOAPBinding anSoapBinding = (SOAPBinding)wsClass.getAnnotation(SOAPBinding.class);
-
- SOAPBinding.Style attrStyle = anSoapBinding.style();
- Style style = (attrStyle == SOAPBinding.Style.RPC ? Style.RPC : Style.DOCUMENT);
- epMetaData.setStyle(style);
-
- SOAPBinding.Use attrUse = anSoapBinding.use();
- if (attrUse == SOAPBinding.Use.ENCODED)
- throw new WSException("SOAP encoding is not supported for JSR-181
deployments");
-
- epMetaData.setEncodingStyle(Use.LITERAL);
-
- ParameterStyle paramStyle = anSoapBinding.parameterStyle();
- epMetaData.setParameterStyle(paramStyle);
- }
-
- // If the implementation bean does not implement a service endpoint interface and
- // there are no @WebMethod annotations in the implementation bean (excluding
- // @WebMethod annotations used to exclude inherited @WebMethods), all public
- // methods other than those inherited from java.lang.Object will be exposed as Web
- // Service operations, subject to the inheritance rules specified in Common
- // Annotations for the Java Platform [12], section 2.1.
- protected void processWebMethods(EndpointMetaData epMetaData, Class wsClass)
- {
- epMetaData.clearOperations();
-
- // Process @WebMethod annotations
- int webMethodCount = 0;
- for (Method method : wsClass.getMethods())
- {
- WebMethod annotation = method.getAnnotation(WebMethod.class);
- boolean exclude = annotation != null && annotation.exclude();
- if (!exclude && (annotation != null || wsClass.isInterface()))
- {
- processWebMethod(epMetaData, method);
- webMethodCount++;
- }
- }
-
- // @WebService should expose all inherited methods if @WebMethod is never
specified
- if (webMethodCount == 0 && !wsClass.isInterface())
- {
- for (Method method : wsClass.getMethods())
- {
- WebMethod annotation = method.getAnnotation(WebMethod.class);
- boolean exclude = annotation != null && annotation.exclude();
- if (!exclude && method.getDeclaringClass() != Object.class)
- {
- processWebMethod(epMetaData, method);
- webMethodCount++;
- }
- }
- }
-
- if (webMethodCount == 0)
- throw new WSException("No exposable methods found");
- }
-
- protected void resetMetaDataBuilder(ClassLoader loader)
- {
- wrapperGenerator = new DynamicWrapperGenerator(loader);
- javaTypes.clear();
- typeRefs.clear();
- jaxbCtx = null;
- }
-
- public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
- {
- try
- {
- EndpointResult result = processWebService(wsMetaData, sepClass,
udi.classLoader);
-
- // Clear the java types, etc.
- resetMetaDataBuilder(udi.classLoader);
-
- ServerEndpointMetaData sepMetaData = result.semd;
- ServiceMetaData serviceMetaData = result.smd;
- Class<?> wsClass = result.klass;
- sepMetaData.setLinkName(linkName);
-
- // Assign the WS-Security configuration,
- WSSecurityConfiguration securityConfiguration =
MetaDataBuilder.getWsSecurityConfiguration(udi);
- serviceMetaData.setSecurityConfiguration(securityConfiguration);
-
- sepMetaData.setServiceEndpointImplName(sepClass.getName());
- sepMetaData.setServiceEndpointInterfaceName(wsClass.getName());
-
- // Process an optional @SOAPBinding annotation
- if (wsClass.isAnnotationPresent(SOAPBinding.class))
- processSOAPBinding(sepMetaData, wsClass);
-
- // Process an optional @BindingType annotation
- if (wsClass.isAnnotationPresent(BindingType.class))
- processBindingType(sepMetaData, wsClass);
-
- // Init the transport guarantee
- initTransportGuaranteeJSE(udi, sepMetaData, linkName);
-
- // Process web methods
- processWebMethods(sepMetaData, wsClass);
-
- // Initialize types
- createJAXBContext(sepMetaData);
- populateXmlTypes(sepMetaData);
-
- // Process or generate WSDL
- processOrGenerateWSDL(wsClass, serviceMetaData, result.wsdlLocation,
sepMetaData);
-
- // Read the generated WSDL and initialize the schema model
- // FIXME - This should be removed
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
- JBossXSModel schemaModel =
WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
- serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
-
- // Set the endpoint address
- processPortComponent(udi, wsClass, linkName, sepMetaData);
-
- // Init the endpoint address
- MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
-
- // replace the SOAP address
- MetaDataBuilder.replaceAddressLocation(sepMetaData);
-
- // Process an optional @SOAPMessageHandlers annotation
- if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) ||
wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
- log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no
replacement.");
-
- // Add pre handlers
- WSEndpointConfigJAXWS jaxrpcConfig =
(WSEndpointConfigJAXWS)sepMetaData.getEndpointConfig();
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.PRE));
-
- // Process an optional @HandlerChain annotation
- if (sepClass.isAnnotationPresent(HandlerChain.class))
- processHandlerChain(sepMetaData, sepClass);
- else if (wsClass.isAnnotationPresent(HandlerChain.class))
- processHandlerChain(sepMetaData, wsClass);
-
- // Add post handlers
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.POST));
-
- // init service endpoint id
- ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
- sepMetaData.setServiceEndpointID(sepID);
-
- return sepMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,1037 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.builder.jaxws;
+
+// $Id$
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Writer;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import javax.jws.HandlerChain;
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPMessageHandlers;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.management.ObjectName;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.WebFault;
+import javax.xml.ws.addressing.AddressingProperties;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.FaultMetaData;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.umdm.ServerEndpointMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.common.umdm.TypeMappingMetaData;
+import org.jboss.ws.common.umdm.TypesMetaData;
+import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.common.umdm.WrappedParameter;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.common.utils.HolderUtils;
+import org.jboss.ws.common.utils.IOUtils;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Use;
+import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
+import org.jboss.ws.core.jaxws.WrapperGenerator;
+import org.jboss.ws.core.metadata.acessor.JAXBAccessor;
+import org.jboss.ws.core.metadata.builder.MetaDataBuilder;
+import org.jboss.ws.core.metadata.config.jaxws.WSEndpointConfigJAXWS;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainFactory;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainsMetaData;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.WSDLWriter;
+import org.jboss.ws.core.metadata.wsdl.WSDLWriter.ResolvedWriter;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.extras.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
+import org.jboss.ws.tools.jaxws.WSDLGenerator;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+import com.sun.xml.bind.api.JAXBRIContext;
+import com.sun.xml.bind.api.TypeReference;
+
+/** An abstract annotation meta data builder.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 15-Oct-2005
+ */
+@SuppressWarnings("deprecation")
+public class JAXWSWebServiceMetaDataBuilder extends JAXWSEndpointMetaDataBuilder
+{
+ private static class EndpointResult
+ {
+ private Class<?> klass;
+ private ServerEndpointMetaData semd;
+ private ServiceMetaData smd;
+ private String wsdlLocation;
+ }
+
+ // provide logging
+ private static final Logger log =
Logger.getLogger(JAXWSWebServiceMetaDataBuilder.class);
+ private List<Class> javaTypes = new ArrayList<Class>();
+ private JAXBRIContext jaxbCtx;
+ private List<TypeReference> typeRefs = new ArrayList<TypeReference>();
+
+ private WrapperGenerator wrapperGenerator;
+
+ public JAXWSWebServiceMetaDataBuilder()
+ {
+ }
+
+ private void addFault(OperationMetaData omd, Class<?> exception)
+ {
+ if (omd.isOneWay())
+ throw new IllegalStateException("JSR-181 4.3.1 - A JSR-181 processor is
REQUIRED to report an error if an operation marked "
+ + "@Oneway has a return value, declares any checked exceptions or has
any INOUT or OUT parameters.");
+
+ WebFault annotation = exception.getAnnotation(WebFault.class);
+
+ String name;
+ String namespace;
+ String faultBeanName = null;
+
+ // Only the element name is effected by @WebFault, the type uses the same
convention
+ QName xmlType = new QName(omd.getQName().getNamespaceURI(),
exception.getSimpleName());
+
+ /*
+ * If @WebFault is present, and the exception contains getFaultInfo, the
+ * return value should be used. Otherwise we need to generate the bean.
+ */
+ boolean generate = true;
+ if (annotation != null)
+ {
+ name = annotation.name();
+ namespace = annotation.targetNamespace();
+ if (namespace.length() == 0)
+ namespace = omd.getQName().getNamespaceURI();
+
+ Class<?> faultBean = getFaultInfo(exception);
+ if (faultBean != null)
+ {
+ generate = false;
+ faultBeanName = faultBean.getName();
+ }
+ }
+ else
+ {
+ name = xmlType.getLocalPart();
+ namespace = xmlType.getNamespaceURI();
+ }
+
+ if (faultBeanName == null)
+ faultBeanName =
JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) +
".jaxws." + exception.getSimpleName() + "Bean";
+
+ QName xmlName = new QName(namespace, name);
+
+ FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlType, exception.getName());
+ fmd.setFaultBeanName(faultBeanName);
+
+ if (generate)
+ wrapperGenerator.generate(fmd);
+
+ javaTypes.add(fmd.getFaultBean());
+ typeRefs.add(new TypeReference(fmd.getXmlName(), fmd.getFaultBean()));
+
+ omd.addFault(fmd);
+ }
+
+ private String convertToVariable(String localName)
+ {
+ return JAXBRIContext.mangleNameToVariableName(localName);
+ }
+
+ private String[] convertTypeArguments(Class rawType, Type type)
+ {
+ if (!Collection.class.isAssignableFrom(rawType) &&
!Map.class.isAssignableFrom(rawType))
+ return null;
+
+ if (!(type instanceof ParameterizedType))
+ return null;
+
+ ParameterizedType paramType = (ParameterizedType)type;
+ Type[] arguments = paramType.getActualTypeArguments();
+ String[] ret = new String[arguments.length];
+ for (int i = 0; i < arguments.length; i++)
+ ret[i] = JavaUtils.erasure(arguments[i]).getName();
+
+ return ret;
+ }
+
+ private ParameterMetaData createRequestWrapper(OperationMetaData operation, Method
method)
+ {
+ String requestWrapperType = null;
+ QName xmlName = operation.getQName();
+ QName xmlType = xmlName;
+ if (method.isAnnotationPresent(RequestWrapper.class))
+ {
+ RequestWrapper anReqWrapper = method.getAnnotation(RequestWrapper.class);
+
+ String localName = anReqWrapper.localName().length() > 0 ?
anReqWrapper.localName() : xmlName.getLocalPart();
+ String targetNamespace = anReqWrapper.targetNamespace().length() > 0 ?
anReqWrapper.targetNamespace() : xmlName.getNamespaceURI();
+ xmlName = new QName(targetNamespace, localName);
+
+ if (anReqWrapper.className().length() > 0)
+ requestWrapperType = anReqWrapper.className();
+ }
+
+ // Conformance 3.18, the default value must be the same as the method name
+ if (requestWrapperType == null)
+ {
+ String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) +
".jaxws";
+ requestWrapperType = packageName + "." +
JavaUtils.capitalize(method.getName());
+ }
+
+ // JAX-WS p.37 pg.1, the annotation only affects the element name, not the type
name
+ ParameterMetaData wrapperParameter = new ParameterMetaData(operation, xmlName,
xmlType, requestWrapperType);
+ wrapperParameter.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
+ operation.addParameter(wrapperParameter);
+
+ return wrapperParameter;
+ }
+
+ private ParameterMetaData createResponseWrapper(OperationMetaData operation, Method
method)
+ {
+ QName operationQName = operation.getQName();
+ QName xmlName = new QName(operationQName.getNamespaceURI(),
operationQName.getLocalPart() + "Response");
+ QName xmlType = xmlName;
+
+ String responseWrapperType = null;
+ if (method.isAnnotationPresent(ResponseWrapper.class))
+ {
+ ResponseWrapper anResWrapper = method.getAnnotation(ResponseWrapper.class);
+
+ String localName = anResWrapper.localName().length() > 0 ?
anResWrapper.localName() : xmlName.getLocalPart();
+ String targetNamespace = anResWrapper.targetNamespace().length() > 0 ?
anResWrapper.targetNamespace() : xmlName.getNamespaceURI();
+ xmlName = new QName(targetNamespace, localName);
+
+ if (anResWrapper.className().length() > 0)
+ responseWrapperType = anResWrapper.className();
+ }
+
+ if (responseWrapperType == null)
+ {
+ String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) +
".jaxws";
+ responseWrapperType = packageName + "." +
JavaUtils.capitalize(method.getName()) + "Response";
+ }
+
+ ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType,
responseWrapperType);
+ retMetaData.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
+ operation.setReturnParameter(retMetaData);
+
+ return retMetaData;
+ }
+
+ private Class<?> getFaultInfo(Class<?> exception)
+ {
+ try
+ {
+ Method method = exception.getMethod("getFaultInfo");
+ Class<?> returnType = method.getReturnType();
+ if (returnType == void.class)
+ return null;
+
+ return returnType;
+ }
+ catch (SecurityException e)
+ {
+ throw new WSException("Unexpected security exception: " +
e.getMessage(), e);
+ }
+ catch (NoSuchMethodException e)
+ {
+ return null;
+ }
+ }
+
+ private ParameterMode getParameterMode(WebParam anWebParam, Class javaType)
+ {
+ if (anWebParam != null)
+ {
+ if (anWebParam.mode() == WebParam.Mode.INOUT)
+ return ParameterMode.INOUT;
+ if (anWebParam.mode() == WebParam.Mode.OUT)
+ return ParameterMode.OUT;
+ }
+
+ return HolderUtils.isHolderType(javaType) ? ParameterMode.INOUT :
ParameterMode.IN;
+ }
+
+ private WebParam getWebParamAnnotation(Method method, int pos)
+ {
+ for (Annotation annotation : method.getParameterAnnotations()[pos])
+ if (annotation instanceof WebParam)
+ return (WebParam)annotation;
+
+ return null;
+ }
+
+ private QName getWebParamName(OperationMetaData opMetaData, int index, Class javaType,
WebParam webParam)
+ {
+ String namespace = null;
+ String name = null;
+ boolean header = false;
+
+ if (webParam != null)
+ {
+ if (webParam.targetNamespace().length() > 0)
+ namespace = webParam.targetNamespace();
+
+ if (webParam.name().length() > 0)
+ name = webParam.name();
+
+ header = webParam.header();
+ }
+
+ // Bare and headers must be qualified
+ if (namespace == null && (opMetaData.isDocumentBare() || header))
+ namespace = opMetaData.getQName().getNamespaceURI();
+
+ // RPC body parts must have no namespace
+ else if (opMetaData.isRPCLiteral() && !header)
+ namespace = null;
+
+ // Bare uses the operation name as the default, everything else is generated
+ if (name == null)
+ name = opMetaData.isDocumentBare() && !header ?
opMetaData.getQName().getLocalPart() : "arg" + index;
+
+ return (namespace != null) ? new QName(namespace, name) : new QName(name);
+ }
+
+ private QName getWebResultName(OperationMetaData opMetaData, Class javaType, WebResult
anWebResult)
+ {
+ String name = null;
+ String namespace = null;
+ boolean header = false;
+
+ if (anWebResult != null)
+ {
+ if (anWebResult.targetNamespace().length() > 0)
+ namespace = anWebResult.targetNamespace();
+
+ if (anWebResult.name().length() > 0)
+ name = anWebResult.name();
+
+ header = anWebResult.header();
+ }
+
+ // Bare and headers must be qualified
+ if (namespace == null && (opMetaData.isDocumentBare() || header))
+ namespace = opMetaData.getQName().getNamespaceURI();
+
+ // RPC body parts must have no namespace
+ else if (opMetaData.isRPCLiteral() && !header)
+ namespace = null;
+
+ // Bare uses the operation name as the default, everything else is generated
+ if (name == null)
+ name = opMetaData.isDocumentBare() && !header ?
opMetaData.getResponseName().getLocalPart() : "return";
+
+ return (namespace != null) ? new QName(namespace, name) : new QName(name);
+ }
+
+ private void populateXmlType(FaultMetaData faultMetaData)
+ {
+ EndpointMetaData epMetaData =
faultMetaData.getOperationMetaData().getEndpointMetaData();
+ TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
+
+ QName xmlType = faultMetaData.getXmlType();
+ String faultBeanName = faultMetaData.getFaultBeanName();
+
+ types.addTypeMapping(new TypeMappingMetaData(types, xmlType, faultBeanName));
+ }
+
+ private void populateXmlType(ParameterMetaData paramMetaData)
+ {
+ EndpointMetaData epMetaData =
paramMetaData.getOperationMetaData().getEndpointMetaData();
+ TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
+
+ QName xmlName = paramMetaData.getXmlName();
+ QName xmlType = paramMetaData.getXmlType();
+ Class javaType = paramMetaData.getJavaType();
+ String javaName = paramMetaData.getJavaTypeName();
+
+ if (xmlType == null)
+ {
+ try
+ {
+ xmlType = jaxbCtx.getTypeName(new TypeReference(xmlName, javaType));
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new IllegalStateException("Cannot obtain xml type for:
[xmlName=" + xmlName + ",javaName=" + javaName + "]");
+ }
+
+ /* Anonymous type.
+ *
+ * Currently the design of our stack is based on the
+ * notion of their always being a unique type. In order to lookup the
+ * appropriate (de)serializer you must have a type. So we use a fake
+ * name. This is an illegal NCName, so it shouldn't collide.
+ */
+ if (xmlType == null)
+ xmlType = new QName(xmlName.getNamespaceURI(), ">" +
xmlName.getLocalPart());
+
+ paramMetaData.setXmlType(xmlType);
+ }
+
+ types.addTypeMapping(new TypeMappingMetaData(types, xmlType, javaName));
+ }
+
+ /**
+ * Process operation meta data extensions.
+ */
+ private void processMetaExtensions(EndpointMetaData epMetaData, OperationMetaData
opMetaData)
+ {
+ // Until there is a addressing annotion we fallback to implicit action asosciation
+ // TODO: figure out a way to assign message name instead of IN and OUT
+ String tns = epMetaData.getQName().getNamespaceURI();
+ String portTypeName = epMetaData.getQName().getLocalPart();
+
+ AddressingProperties ADDR = new AddressingPropertiesImpl();
+ AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
+ addrExt.setInboundAction(tns + "/" + portTypeName + "/IN");
+
+ if (!opMetaData.isOneWay())
+ addrExt.setOutboundAction(tns + "/" + portTypeName +
"/OUT");
+
+ opMetaData.addExtension(addrExt);
+ }
+
+ private void processWebMethod(EndpointMetaData epMetaData, Method method)
+ {
+ String javaName = method.getName();
+
+ // skip asnyc methods, they dont need meta data representation
+ if (method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
+ return;
+
+ // reflection defaults
+ String soapAction = "";
+ String operationName = method.getName();
+
+ // annotation values that override defaults
+ if (method.isAnnotationPresent(WebMethod.class))
+ {
+ WebMethod anWebMethod = method.getAnnotation(WebMethod.class);
+ soapAction = anWebMethod.action();
+ if (anWebMethod.operationName().length() > 0)
+ {
+ operationName = anWebMethod.operationName();
+ }
+ }
+
+ String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
+ OperationMetaData opMetaData = new OperationMetaData(epMetaData, new
QName(targetNS, operationName), javaName);
+ opMetaData.setOneWay(method.isAnnotationPresent(Oneway.class));
+ opMetaData.setSOAPAction(soapAction);
+ epMetaData.addOperation(opMetaData);
+
+ // Build parameter meta data
+ Class[] parameterTypes = method.getParameterTypes();
+ Type[] genericTypes = method.getGenericParameterTypes();
+ Annotation[][] parameterAnnotations = method.getParameterAnnotations();
+ ParameterMetaData wrapperParameter = null, wrapperOutputParameter = null;
+ List<WrappedParameter> wrappedParameters = null, wrappedOutputParameters =
null;
+
+ // Force paramter style to wrapped
+ if (method.isAnnotationPresent(RequestWrapper.class) ||
method.isAnnotationPresent(ResponseWrapper.class))
+ {
+ epMetaData.setParameterStyle(ParameterStyle.WRAPPED);
+ }
+
+ if (opMetaData.isDocumentWrapped())
+ {
+ wrapperParameter = createRequestWrapper(opMetaData, method);
+ wrappedParameters = new
ArrayList<WrappedParameter>(parameterTypes.length);
+ wrapperParameter.setWrappedParameters(wrappedParameters);
+
+ if (!opMetaData.isOneWay())
+ {
+ wrapperOutputParameter = createResponseWrapper(opMetaData, method);
+ wrappedOutputParameters = new
ArrayList<WrappedParameter>(parameterTypes.length + 1);
+ wrapperOutputParameter.setWrappedParameters(wrappedOutputParameters);
+ }
+ }
+
+ for (int i = 0; i < parameterTypes.length; i++)
+ {
+ Class javaType = parameterTypes[i];
+ Type genericType = genericTypes[i];
+ String javaTypeName = javaType.getName();
+ WebParam anWebParam = getWebParamAnnotation(method, i);
+ boolean isHeader = anWebParam != null && anWebParam.header();
+ boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
+ ParameterMode mode = getParameterMode(anWebParam, javaType);
+
+ // Assert one-way
+ if (opMetaData.isOneWay() && mode != ParameterMode.IN)
+ throw new IllegalArgumentException("A one-way operation can not have
output parameters [" + "method = " + method.getName() + ", parameter =
" + i + "]");
+
+ if (HolderUtils.isHolderType(javaType))
+ {
+ genericType = HolderUtils.getGenericValueType(genericType);
+ javaType = JavaUtils.erasure(genericType);
+ javaTypeName = javaType.getName();
+ }
+
+ if (isWrapped)
+ {
+ QName wrappedElementName = getWebParamName(opMetaData, i, javaType,
anWebParam);
+ String variable = convertToVariable(wrappedElementName.getLocalPart());
+
+ WrappedParameter wrappedParameter = new WrappedParameter(wrappedElementName,
javaTypeName, variable, i);
+ wrappedParameter.setTypeArguments(convertTypeArguments(javaType,
genericType));
+
+ if (mode != ParameterMode.OUT)
+ wrappedParameters.add(wrappedParameter);
+ if (mode != ParameterMode.IN)
+ {
+ wrappedOutputParameters.add(wrappedParameter);
+ wrappedParameter.setHolder(true);
+ }
+ }
+ else
+ {
+ QName xmlName = getWebParamName(opMetaData, i, javaType, anWebParam);
+
+ ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName,
javaTypeName);
+ paramMetaData.setInHeader(isHeader);
+ paramMetaData.setIndex(i);
+ paramMetaData.setMode(mode);
+
+ opMetaData.addParameter(paramMetaData);
+ javaTypes.add(javaType);
+ typeRefs.add(new TypeReference(xmlName, genericType,
parameterAnnotations[i]));
+ }
+ }
+
+ // Build result meta data
+ Class returnType = method.getReturnType();
+ Type genericReturnType = method.getGenericReturnType();
+ String returnTypeName = returnType.getName();
+ if ((returnType == void.class) == false)
+ {
+ if (opMetaData.isOneWay())
+ throw new IllegalArgumentException("[JSR-181 2.5.1] The method
'" + method.getName() + "' can not have a return value if it is marked
OneWay");
+
+ WebResult anWebResult = method.getAnnotation(WebResult.class);
+ boolean isHeader = anWebResult != null && anWebResult.header();
+ boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
+ QName xmlName = getWebResultName(opMetaData, returnType, anWebResult);
+
+ if (isWrapped)
+ {
+ WrappedParameter wrapped = new WrappedParameter(xmlName, returnTypeName,
convertToVariable(xmlName.getLocalPart()), -1);
+ wrapped.setTypeArguments(convertTypeArguments(returnType,
genericReturnType));
+
+ // insert at the beginning just for prettiness
+ wrappedOutputParameters.add(0, wrapped);
+ }
+ else
+ {
+ ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName,
returnTypeName);
+ retMetaData.setInHeader(isHeader);
+ opMetaData.setReturnParameter(retMetaData);
+
+ javaTypes.add(returnType);
+ typeRefs.add(new TypeReference(xmlName, genericReturnType,
method.getAnnotations()));
+ }
+ }
+
+ // Generate wrapper beans
+ if (opMetaData.isDocumentWrapped())
+ {
+ wrapperGenerator.generate(wrapperParameter);
+ Class wrapperClass = wrapperParameter.getJavaType();
+ javaTypes.add(wrapperClass);
+ // In case there is no @XmlRootElement
+ typeRefs.add(new TypeReference(wrapperParameter.getXmlName(), wrapperClass));
+ if (!opMetaData.isOneWay())
+ {
+ wrapperGenerator.generate(wrapperOutputParameter);
+ wrapperClass = wrapperOutputParameter.getJavaType();
+ javaTypes.add(wrapperClass);
+ // In case there is no @XmlRootElement
+ typeRefs.add(new TypeReference(wrapperOutputParameter.getXmlName(),
wrapperClass));
+ }
+ }
+
+ // Add faults
+ for (Class exClass : method.getExceptionTypes())
+ if (!RemoteException.class.isAssignableFrom(exClass))
+ addFault(opMetaData, exClass);
+
+ // process op meta data extension
+ processMetaExtensions(epMetaData, opMetaData);
+ }
+
+ private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?>
sepClass, ClassLoader loader) throws ClassNotFoundException
+ {
+ WebService anWebService = sepClass.getAnnotation(WebService.class);
+ if (anWebService == null)
+ throw new WSException("Cannot obtain @WebService annotation from: " +
sepClass.getName());
+
+ Class<?> seiClass = null;
+ String seiName = null;
+ WSDLUtils wsdlUtils = WSDLUtils.getInstance();
+
+ String name = anWebService.name();
+ if (name.length() == 0)
+ name = WSDLUtils.getJustClassName(sepClass);
+
+ String serviceName = anWebService.serviceName();
+ if (serviceName.length() == 0)
+ serviceName = name + "Service";
+
+ String serviceNS = anWebService.targetNamespace();
+ if (serviceNS.length() == 0)
+ serviceNS = wsdlUtils.getTypeNamespace(sepClass);
+
+ String portName = anWebService.portName();
+ if (portName.length() == 0)
+ portName = name + "Port";
+
+ String wsdlLocation = anWebService.wsdlLocation();
+ String interfaceNS = serviceNS;
+
+ if (anWebService.endpointInterface().length() > 0)
+ {
+ seiName = anWebService.endpointInterface();
+ seiClass = loader.loadClass(seiName);
+ anWebService = seiClass.getAnnotation(WebService.class);
+
+ if (anWebService == null)
+ throw new WSException("Interface does not have a @WebService annotation:
" + seiName);
+
+ name = anWebService.name();
+ if (name.length() == 0)
+ name = WSDLUtils.getJustClassName(seiClass);
+
+ interfaceNS = anWebService.targetNamespace();
+ if (interfaceNS.length() == 0)
+ interfaceNS = wsdlUtils.getTypeNamespace(seiClass);
+
+ // The spec states that WSDL location should be allowed on an SEI, although it
+ // makes far more sense on the implementation bean, so we ALWAYS override the
SEI
+ // when wsdlLocation is defined on the bean
+
+ if (wsdlLocation.length() == 0)
+ wsdlLocation = anWebService.wsdlLocation();
+ }
+
+ // Setup the ServerEndpointMetaData
+ QName portQName = new QName(serviceNS, portName);
+ QName portTypeQName = new QName(interfaceNS, name);
+
+ EndpointResult result = new EndpointResult();
+ result.smd = new ServiceMetaData(wsMetaData, new QName(serviceNS, serviceName));
+ result.semd = new ServerEndpointMetaData(result.smd, portQName, portTypeQName,
EndpointMetaData.Type.JAXWS);
+ result.klass = (seiClass != null ? seiClass : sepClass);
+ result.wsdlLocation = wsdlLocation;
+
+ result.smd.addEndpoint(result.semd);
+ wsMetaData.addService(result.smd);
+
+ return result;
+ }
+
+ protected void createJAXBContext(EndpointMetaData epMetaData)
+ {
+ try
+ {
+ String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
+ log.debug("JAXBContext [types=" + javaTypes + ",tns=" +
targetNS + "]");
+ jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs,
targetNS, false);
+ }
+ catch (JAXBException ex)
+ {
+ throw new IllegalStateException("Cannot build JAXB context", ex);
+ }
+ }
+
+ protected void populateXmlTypes(EndpointMetaData epMetaData)
+ {
+ for (OperationMetaData operation : epMetaData.getOperations())
+ {
+ // parameters
+ for (ParameterMetaData paramMetaData : operation.getParameters())
+ {
+ populateXmlType(paramMetaData);
+ }
+
+ // return value
+ ParameterMetaData returnParameter = operation.getReturnParameter();
+ if (returnParameter != null)
+ populateXmlType(returnParameter);
+
+ // faults
+ for (FaultMetaData faultMetaData : operation.getFaults())
+ {
+ populateXmlType(faultMetaData);
+ }
+ }
+ }
+
+ /**
+ * Process an optional @HandlerChain annotation
+ *
+ * Location of the handler chain file. The location supports 2 formats.
+ *
+ * 1. An absolute java.net.URL in externalForm.
+ * (ex:
http://myhandlers.foo.com/handlerfile1.xml)
+ *
+ * 2. A relative path from the source file or class file.
+ * (ex: bar/handlerfile1.xml)
+ */
+ protected void processHandlerChain(EndpointMetaData epMetaData, Class<?>
wsClass)
+ {
+ if (wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
+ throw new WSException("Cannot combine @HandlerChain with
@SOAPMessageHandlers");
+
+ HandlerChain anHandlerChain =
(HandlerChain)wsClass.getAnnotation(HandlerChain.class);
+
+ URL fileURL = null;
+ String filename = anHandlerChain.file();
+
+ // Try the filename as URL
+ try
+ {
+ fileURL = new URL(filename);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try the filename as File
+ if (fileURL == null)
+ {
+ try
+ {
+ File file = new File(filename);
+ if (file.exists())
+ fileURL = file.toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ // Try the filename as Resource
+ if (fileURL == null)
+ {
+ fileURL = epMetaData.getClassLoader().getResource(filename);
+ }
+
+ // Try the filename relative to class
+ if (fileURL == null)
+ {
+ String packagePath = wsClass.getPackage().getName().replace('.',
'/');
+ fileURL = epMetaData.getClassLoader().getResource(packagePath + "/" +
filename);
+ }
+
+ if (fileURL == null)
+ throw new WSException("Cannot resolve handler file '" + filename +
"' on " + wsClass.getName());
+
+ try
+ {
+ HandlerChainsMetaData handlerChainsMetaData = null;
+ InputStream is = fileURL.openStream();
+ try
+ {
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setValidation(true);
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setEntityResolver(new JBossWSEntityResolver());
+ ObjectModelFactory factory = new HandlerChainFactory();
+ handlerChainsMetaData = (HandlerChainsMetaData)unmarshaller.unmarshal(is,
factory, null);
+ }
+ finally
+ {
+ is.close();
+ }
+
+ // Setup the endpoint handlers
+ for (HandlerChainMetaData handlerChainMetaData :
handlerChainsMetaData.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
+ {
+ epMetaData.addHandler(uhmd.getHandlerMetaDataJAXWS(epMetaData,
HandlerType.ENDPOINT));
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot process handler chain: " + filename,
ex);
+ }
+ }
+
+ protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData,
String wsdlLocation, EndpointMetaData epMetaData)
+ {
+ if (wsdlLocation.length() > 0)
+ {
+ serviceMetaData.setWsdlFile(wsdlLocation);
+ }
+ else
+ {
+ try
+ {
+ String serviceName = serviceMetaData.getServiceName().getLocalPart();
+
+ WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
+ WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
+
+ // Ensure that types are only in the interface qname
+
wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getInterfaceQName().getNamespaceURI());
+
+ final File tmpdir = IOUtils.createTempDirectory();
+ File wsdlTmpFile = File.createTempFile(serviceName, ".wsdl",
tmpdir);
+ wsdlTmpFile.deleteOnExit();
+
+ Writer writer = IOUtils.getCharsetFileWriter(wsdlTmpFile,
Constants.DEFAULT_XML_CHARSET);
+ wsdlDefinitions.write(writer, Constants.DEFAULT_XML_CHARSET, new
WSDLWriter.WriterResolver()
+ {
+ public ResolvedWriter resolve(String suggestedFile) throws IOException
+ {
+ File newTmpFile = File.createTempFile(suggestedFile, ".wsdl",
tmpdir);
+ newTmpFile.deleteOnExit();
+ WSDLWriter.ResolvedWriter resolvedWriter = new
WSDLWriter.ResolvedWriter();
+ resolvedWriter.actualFile = newTmpFile.getName();
+ resolvedWriter.charset = Constants.DEFAULT_XML_CHARSET;
+ resolvedWriter.writer = IOUtils.getCharsetFileWriter(newTmpFile,
Constants.DEFAULT_XML_CHARSET);
+ return resolvedWriter;
+ }
+ });
+ writer.close();
+
+ serviceMetaData.setWsdlFile(wsdlTmpFile.toURL().toExternalForm());
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Cannot write generated wsdl", e);
+ }
+ }
+ }
+
+ protected void processSOAPBinding(EndpointMetaData epMetaData, Class<?>
wsClass)
+ {
+ SOAPBinding anSoapBinding = (SOAPBinding)wsClass.getAnnotation(SOAPBinding.class);
+
+ SOAPBinding.Style attrStyle = anSoapBinding.style();
+ Style style = (attrStyle == SOAPBinding.Style.RPC ? Style.RPC : Style.DOCUMENT);
+ epMetaData.setStyle(style);
+
+ SOAPBinding.Use attrUse = anSoapBinding.use();
+ if (attrUse == SOAPBinding.Use.ENCODED)
+ throw new WSException("SOAP encoding is not supported for JSR-181
deployments");
+
+ epMetaData.setEncodingStyle(Use.LITERAL);
+
+ ParameterStyle paramStyle = anSoapBinding.parameterStyle();
+ epMetaData.setParameterStyle(paramStyle);
+ }
+
+ // If the implementation bean does not implement a service endpoint interface and
+ // there are no @WebMethod annotations in the implementation bean (excluding
+ // @WebMethod annotations used to exclude inherited @WebMethods), all public
+ // methods other than those inherited from java.lang.Object will be exposed as Web
+ // Service operations, subject to the inheritance rules specified in Common
+ // Annotations for the Java Platform [12], section 2.1.
+ protected void processWebMethods(EndpointMetaData epMetaData, Class wsClass)
+ {
+ epMetaData.clearOperations();
+
+ // Process @WebMethod annotations
+ int webMethodCount = 0;
+ for (Method method : wsClass.getMethods())
+ {
+ WebMethod annotation = method.getAnnotation(WebMethod.class);
+ boolean exclude = annotation != null && annotation.exclude();
+ if (!exclude && (annotation != null || wsClass.isInterface()))
+ {
+ processWebMethod(epMetaData, method);
+ webMethodCount++;
+ }
+ }
+
+ // @WebService should expose all inherited methods if @WebMethod is never
specified
+ if (webMethodCount == 0 && !wsClass.isInterface())
+ {
+ for (Method method : wsClass.getMethods())
+ {
+ WebMethod annotation = method.getAnnotation(WebMethod.class);
+ boolean exclude = annotation != null && annotation.exclude();
+ if (!exclude && method.getDeclaringClass() != Object.class)
+ {
+ processWebMethod(epMetaData, method);
+ webMethodCount++;
+ }
+ }
+ }
+
+ if (webMethodCount == 0)
+ throw new WSException("No exposable methods found");
+ }
+
+ protected void resetMetaDataBuilder(ClassLoader loader)
+ {
+ wrapperGenerator = new DynamicWrapperGenerator(loader);
+ javaTypes.clear();
+ typeRefs.clear();
+ jaxbCtx = null;
+ }
+
+ public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData,
UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
+ {
+ try
+ {
+ EndpointResult result = processWebService(wsMetaData, sepClass,
udi.classLoader);
+
+ // Clear the java types, etc.
+ resetMetaDataBuilder(udi.classLoader);
+
+ ServerEndpointMetaData sepMetaData = result.semd;
+ ServiceMetaData serviceMetaData = result.smd;
+ Class<?> wsClass = result.klass;
+ sepMetaData.setLinkName(linkName);
+
+ // Assign the WS-Security configuration,
+ WSSecurityConfiguration securityConfiguration =
MetaDataBuilder.getWsSecurityConfiguration(udi);
+ serviceMetaData.setSecurityConfiguration(securityConfiguration);
+
+ sepMetaData.setServiceEndpointImplName(sepClass.getName());
+ sepMetaData.setServiceEndpointInterfaceName(wsClass.getName());
+
+ // Process an optional @SOAPBinding annotation
+ if (wsClass.isAnnotationPresent(SOAPBinding.class))
+ processSOAPBinding(sepMetaData, wsClass);
+
+ // Process an optional @BindingType annotation
+ if (wsClass.isAnnotationPresent(BindingType.class))
+ processBindingType(sepMetaData, wsClass);
+
+ // Init the transport guarantee
+ initTransportGuaranteeJSE(udi, sepMetaData, linkName);
+
+ // Process web methods
+ processWebMethods(sepMetaData, wsClass);
+
+ // Initialize types
+ createJAXBContext(sepMetaData);
+ populateXmlTypes(sepMetaData);
+
+ // Process or generate WSDL
+ processOrGenerateWSDL(wsClass, serviceMetaData, result.wsdlLocation,
sepMetaData);
+
+ // Read the generated WSDL and initialize the schema model
+ // FIXME - This should be removed
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+ JBossXSModel schemaModel =
WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
+ serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
+
+ // Set the endpoint address
+ processPortComponent(udi, wsClass, linkName, sepMetaData);
+
+ // Init the endpoint address
+ MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
+
+ // replace the SOAP address
+ MetaDataBuilder.replaceAddressLocation(sepMetaData);
+
+ // Process an optional @SOAPMessageHandlers annotation
+ if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) ||
wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
+ log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no
replacement.");
+
+ // Add pre handlers
+ WSEndpointConfigJAXWS jaxrpcConfig =
(WSEndpointConfigJAXWS)sepMetaData.getEndpointConfig();
+ sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.PRE));
+
+ // Process an optional @HandlerChain annotation
+ if (sepClass.isAnnotationPresent(HandlerChain.class))
+ processHandlerChain(sepMetaData, sepClass);
+ else if (wsClass.isAnnotationPresent(HandlerChain.class))
+ processHandlerChain(sepMetaData, wsClass);
+
+ // Add post handlers
+ sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.POST));
+
+ // init service endpoint id
+ ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
+ sepMetaData.setServiceEndpointID(sepID);
+
+ return sepMetaData;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSCommonConfig.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSCommonConfig.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config;
+
+//$Id$
+
+import java.util.List;
+
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * A common configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public abstract class WSCommonConfig
+{
+ private String configName;
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ }
+
+ public abstract List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type);
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.util.xml.JBossErrorHandler;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.jboss.ws.core.metadata.config.jaxrpc.WSConfigFactoryJAXRPC;
+import org.jboss.ws.core.metadata.config.jaxws.WSConfigFactoryJAXWS;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * A factory for the JBossWS endpoint/client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSConfigFactory
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(WSConfigFactory.class);
+
+ private static String URN_JAXRPC_CONFIG = "urn:jboss:jaxrpc-config:2.0";
+ private static String URN_JAXWS_CONFIG = "urn:jboss:jaxws-config:2.0";
+
+ // Hide constructor
+ private WSConfigFactory()
+ {
+ }
+
+ /** Create a new instance of the factory
+ */
+ public static WSConfigFactory newInstance()
+ {
+ return new WSConfigFactory();
+ }
+
+ public Object parseWithSchemaBinding(URL configURL) throws IOException,
JBossXBException
+ {
+ log.debug("parse: " + configURL);
+
+ String configSchema = "schema/jaxrpc-config_2_0.xsd";
+ URL xsdURL =
Thread.currentThread().getContextClassLoader().getResource(configSchema);
+ if (xsdURL == null)
+ throw new WSException("Cannot find: " + configSchema);
+
+ InputStream xsd = xsdURL.openStream();
+ SchemaBinding schemaBinding = XsdBinder.bind(xsd, "UTF-8");
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setValidation(true);
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setEntityResolver(new JBossWSEntityResolver());
+ Object wsConfig = unmarshaller.unmarshal(configURL.openStream(), schemaBinding);
+ return wsConfig;
+ }
+
+ // Below is ObjectModelFactory stuff, which should be removed when
parseWithSchemaBinding works.
+
+ public Object parseWithObjectModelFactory(URL configURL) throws IOException,
JBossXBException
+ {
+ log.debug("parse: " + configURL);
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setValidation(true);
+ unmarshaller.setSchemaValidation(true);
+
+ Object wsConfig;
+ String nsURI = getNamespaceURI(configURL);
+ if (URN_JAXRPC_CONFIG.equals(nsURI))
+ {
+ wsConfig = unmarshaller.unmarshal(configURL.openStream(), new
WSConfigFactoryJAXRPC(), null);
+ }
+ else if (URN_JAXWS_CONFIG.equals(nsURI))
+ {
+ wsConfig = unmarshaller.unmarshal(configURL.openStream(), new
WSConfigFactoryJAXWS(), null);
+ }
+ else
+ {
+ throw new WSException("Invalid config namespace: " + nsURI);
+ }
+
+ return wsConfig;
+ }
+
+ private String getNamespaceURI(URL configURL)
+ {
+ try
+ {
+ Element root = DOMUtils.parse(configURL.openStream());
+ return root.getNamespaceURI();
+ }
+ catch (IOException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxrpc;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSClientConfigJAXRPC extends WSCommonConfigJAXRPC
-{
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxrpc;
+
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSClientConfigJAXRPC extends WSCommonConfigJAXRPC
+{
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfigJAXRPC extends WSCommonConfig
-{
- private HandlerChainMetaData preHandlerChain;
- private HandlerChainMetaData postHandlerChain;
-
- public HandlerChainMetaData getPostHandlerChain()
- {
- return postHandlerChain;
- }
-
- public void setPostHandlerChain(HandlerChainMetaData postHandlerChain)
- {
- this.postHandlerChain = postHandlerChain;
- }
-
- public HandlerChainMetaData getPreHandlerChain()
- {
- return preHandlerChain;
- }
-
- public void setPreHandlerChain(HandlerChainMetaData preHandlerChain)
- {
- this.preHandlerChain = preHandlerChain;
- }
-
- @Override
- public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type)
- {
- List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-
- HandlerChainMetaData handlerChain;
- if (type == HandlerType.PRE)
- handlerChain = getPreHandlerChain();
- else if (type == HandlerType.POST)
- handlerChain = getPostHandlerChain();
- else
- throw new IllegalArgumentException("Invalid handler type: " + type);
-
- if (handlerChain != null)
- {
- for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
- {
- handlers.add(uhmd.getHandlerMetaDataJAXRPC(epMetaData, type));
- }
- }
-
- return handlers;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxrpc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.config.WSCommonConfig;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
+
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public abstract class WSCommonConfigJAXRPC extends WSCommonConfig
+{
+ private HandlerChainMetaData preHandlerChain;
+ private HandlerChainMetaData postHandlerChain;
+
+ public HandlerChainMetaData getPostHandlerChain()
+ {
+ return postHandlerChain;
+ }
+
+ public void setPostHandlerChain(HandlerChainMetaData postHandlerChain)
+ {
+ this.postHandlerChain = postHandlerChain;
+ }
+
+ public HandlerChainMetaData getPreHandlerChain()
+ {
+ return preHandlerChain;
+ }
+
+ public void setPreHandlerChain(HandlerChainMetaData preHandlerChain)
+ {
+ this.preHandlerChain = preHandlerChain;
+ }
+
+ @Override
+ public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type)
+ {
+ List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
+
+ HandlerChainMetaData handlerChain;
+ if (type == HandlerType.PRE)
+ handlerChain = getPreHandlerChain();
+ else if (type == HandlerType.POST)
+ handlerChain = getPostHandlerChain();
+ else
+ throw new IllegalArgumentException("Invalid handler type: " + type);
+
+ if (handlerChain != null)
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
+ {
+ handlers.add(uhmd.getHandlerMetaDataJAXRPC(epMetaData, type));
+ }
+ }
+
+ return handlers;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,162 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxrpc;
-
-//$Id$
-
-import java.util.List;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactoryJAXRPC implements ObjectModelFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactoryJAXRPC.class);
-
- public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName, Attributes attrs)
- {
- return new WSConfigRootJAXRPC();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSConfigRootJAXRPC wsConfig, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSConfig newChild: " + localName);
- if ("endpoint-config".equals(localName))
- {
- WSEndpointConfigJAXRPC wsEndpointConfig = new WSEndpointConfigJAXRPC();
- wsConfig.getEndpointConfig().add(wsEndpointConfig);
- return wsEndpointConfig;
- }
- if ("client-config".equals(localName))
- {
- WSClientConfigJAXRPC wsClientConfig = new WSClientConfigJAXRPC();
- wsConfig.getClientConfig().add(wsClientConfig);
- return wsClientConfig;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + "
localName=" + localName + " value=" + value);
-
- if (localName.equals("config-name"))
- wsCommonConfig.setConfigName(value);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSCommonConfig newChild: " + localName);
-
- if ("pre-handler-chain".equals(localName))
- {
- HandlerChainMetaData preHandlerChain = new HandlerChainMetaData(null);
- wsCommonConfig.setPreHandlerChain(preHandlerChain);
- return preHandlerChain;
- }
- if ("post-handler-chain".equals(localName))
- {
- HandlerChainMetaData postHandlerChain = new HandlerChainMetaData(null);
- wsCommonConfig.setPostHandlerChain(postHandlerChain);
- return postHandlerChain;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainMetaData handlerChainMetaData, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSHandlerChainConfig newChild: " + localName);
- if ("handler".equals(localName))
- {
- UnifiedHandlerMetaData handler = new
UnifiedHandlerMetaData(handlerChainMetaData);
- List<UnifiedHandlerMetaData> handlers =
handlerChainMetaData.getHandlers();
- handlers.add(handler);
- return handler;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("handler-name"))
- handler.setHandlerName(value);
- else if (localName.equals("handler-class"))
- handler.setHandlerClass(value);
- else if (localName.equals("soap-header"))
- handler.addSoapHeader(navigator.resolveQName(value));
- else if (localName.equals("soap-role"))
- handler.addSoapRole(value);
- else if (localName.equals("port-name"))
- handler.addPortName(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("param-name"))
- param.setParamName(value);
- else if (localName.equals("param-value"))
- param.setParamValue(value);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,162 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxrpc;
+
+//$Id$
+
+import java.util.List;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A factory for the JBossWS endpoint/client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSConfigFactoryJAXRPC implements ObjectModelFactory
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(WSConfigFactoryJAXRPC.class);
+
+ public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName, Attributes attrs)
+ {
+ return new WSConfigRootJAXRPC();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName)
+ {
+ return root;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSConfigRootJAXRPC wsConfig, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSConfig newChild: " + localName);
+ if ("endpoint-config".equals(localName))
+ {
+ WSEndpointConfigJAXRPC wsEndpointConfig = new WSEndpointConfigJAXRPC();
+ wsConfig.getEndpointConfig().add(wsEndpointConfig);
+ return wsEndpointConfig;
+ }
+ if ("client-config".equals(localName))
+ {
+ WSClientConfigJAXRPC wsClientConfig = new WSClientConfigJAXRPC();
+ wsConfig.getClientConfig().add(wsClientConfig);
+ return wsClientConfig;
+ }
+ return null;
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + "
localName=" + localName + " value=" + value);
+
+ if (localName.equals("config-name"))
+ wsCommonConfig.setConfigName(value);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSCommonConfig newChild: " + localName);
+
+ if ("pre-handler-chain".equals(localName))
+ {
+ HandlerChainMetaData preHandlerChain = new HandlerChainMetaData(null);
+ wsCommonConfig.setPreHandlerChain(preHandlerChain);
+ return preHandlerChain;
+ }
+ if ("post-handler-chain".equals(localName))
+ {
+ HandlerChainMetaData postHandlerChain = new HandlerChainMetaData(null);
+ wsCommonConfig.setPostHandlerChain(postHandlerChain);
+ return postHandlerChain;
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(HandlerChainMetaData handlerChainMetaData, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSHandlerChainConfig newChild: " + localName);
+ if ("handler".equals(localName))
+ {
+ UnifiedHandlerMetaData handler = new
UnifiedHandlerMetaData(handlerChainMetaData);
+ List<UnifiedHandlerMetaData> handlers =
handlerChainMetaData.getHandlers();
+ handlers.add(handler);
+ return handler;
+ }
+ return null;
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
+
+ if (localName.equals("handler-name"))
+ handler.setHandlerName(value);
+ else if (localName.equals("handler-class"))
+ handler.setHandlerClass(value);
+ else if (localName.equals("soap-header"))
+ handler.addSoapHeader(navigator.resolveQName(value));
+ else if (localName.equals("soap-role"))
+ handler.addSoapRole(value);
+ else if (localName.equals("port-name"))
+ handler.addPortName(value);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
+
+ if (localName.equals("param-name"))
+ param.setParamName(value);
+ else if (localName.equals("param-value"))
+ param.setParamValue(value);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * A JBossWS configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigRootJAXRPC
-{
- private List<WSClientConfigJAXRPC> clientConfigList = new
ArrayList<WSClientConfigJAXRPC>();
- private List<WSEndpointConfigJAXRPC> endpointConfigList = new
ArrayList<WSEndpointConfigJAXRPC>();
-
- public List<WSClientConfigJAXRPC> getClientConfig()
- {
- return clientConfigList;
- }
-
- public void setClientConfig(List<WSClientConfigJAXRPC> clientConfig)
- {
- this.clientConfigList = clientConfig;
- }
-
- public List<WSEndpointConfigJAXRPC> getEndpointConfig()
- {
- return endpointConfigList;
- }
-
- public void setEndpointConfig(List<WSEndpointConfigJAXRPC> endpointConfig)
- {
- this.endpointConfigList = endpointConfig;
- }
-
- public WSClientConfigJAXRPC getClientConfigByName(String configName)
- {
- WSClientConfigJAXRPC config = null;
- for(WSClientConfigJAXRPC aux : clientConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && clientConfigList.size() == 1)
- config = clientConfigList.get(0);
-
- return config;
- }
-
- public WSEndpointConfigJAXRPC getEndpointConfigByName(String configName)
- {
- WSEndpointConfigJAXRPC config = null;
- for(WSEndpointConfigJAXRPC aux : endpointConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && endpointConfigList.size() == 1)
- config = endpointConfigList.get(0);
-
- return config;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxrpc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * A JBossWS configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSConfigRootJAXRPC
+{
+ private List<WSClientConfigJAXRPC> clientConfigList = new
ArrayList<WSClientConfigJAXRPC>();
+ private List<WSEndpointConfigJAXRPC> endpointConfigList = new
ArrayList<WSEndpointConfigJAXRPC>();
+
+ public List<WSClientConfigJAXRPC> getClientConfig()
+ {
+ return clientConfigList;
+ }
+
+ public void setClientConfig(List<WSClientConfigJAXRPC> clientConfig)
+ {
+ this.clientConfigList = clientConfig;
+ }
+
+ public List<WSEndpointConfigJAXRPC> getEndpointConfig()
+ {
+ return endpointConfigList;
+ }
+
+ public void setEndpointConfig(List<WSEndpointConfigJAXRPC> endpointConfig)
+ {
+ this.endpointConfigList = endpointConfig;
+ }
+
+ public WSClientConfigJAXRPC getClientConfigByName(String configName)
+ {
+ WSClientConfigJAXRPC config = null;
+ for(WSClientConfigJAXRPC aux : clientConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && clientConfigList.size() == 1)
+ config = clientConfigList.get(0);
+
+ return config;
+ }
+
+ public WSEndpointConfigJAXRPC getEndpointConfigByName(String configName)
+ {
+ WSEndpointConfigJAXRPC config = null;
+ for(WSEndpointConfigJAXRPC aux : endpointConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && endpointConfigList.size() == 1)
+ config = endpointConfigList.get(0);
+
+ return config;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-
-// $Id$
-
-/**
- * A JBossWS endpoint configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSEndpointConfigJAXRPC extends WSCommonConfigJAXRPC
-{
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxrpc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
+
+
+// $Id$
+
+/**
+ * A JBossWS endpoint configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSEndpointConfigJAXRPC extends WSCommonConfigJAXRPC
+{
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws
(from rev 1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSClientConfigJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxws;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSClientConfigJAXWS extends WSCommonConfigJAXWS
-{
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSClientConfigJAXWS.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxws;
+
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSClientConfigJAXWS extends WSCommonConfigJAXWS
+{
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSCommonConfigJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfigJAXWS extends WSCommonConfig
-{
- private WSHandlerChainsConfigJAXWS preHandlerChains;
- private WSHandlerChainsConfigJAXWS postHandlerChains;
-
- public WSHandlerChainsConfigJAXWS getPostHandlerChains()
- {
- return postHandlerChains;
- }
-
- public void setPostHandlerChains(WSHandlerChainsConfigJAXWS postHandlerChain)
- {
- this.postHandlerChains = postHandlerChain;
- }
-
- public WSHandlerChainsConfigJAXWS getPreHandlerChains()
- {
- return preHandlerChains;
- }
-
- public void setPreHandlerChains(WSHandlerChainsConfigJAXWS preHandlerChains)
- {
- this.preHandlerChains = preHandlerChains;
- }
-
- public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type)
- {
- List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-
- WSHandlerChainsConfigJAXWS handlerChains;
- if (type == HandlerType.PRE)
- handlerChains = getPreHandlerChains();
- else if (type == HandlerType.POST)
- handlerChains = getPostHandlerChains();
- else throw new IllegalArgumentException("Invalid handler type: " +
type);
-
- if (handlerChains != null)
- {
- for (HandlerChainMetaData handlerChainMetaData :
handlerChains.getHandlerChains())
- {
- for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
- {
- handlers.add(uhmd.getHandlerMetaDataJAXWS(epMetaData, type));
- }
- }
- }
-
- return handlers;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSCommonConfigJAXWS.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxws;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.config.WSCommonConfig;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public abstract class WSCommonConfigJAXWS extends WSCommonConfig
+{
+ private WSHandlerChainsConfigJAXWS preHandlerChains;
+ private WSHandlerChainsConfigJAXWS postHandlerChains;
+
+ public WSHandlerChainsConfigJAXWS getPostHandlerChains()
+ {
+ return postHandlerChains;
+ }
+
+ public void setPostHandlerChains(WSHandlerChainsConfigJAXWS postHandlerChain)
+ {
+ this.postHandlerChains = postHandlerChain;
+ }
+
+ public WSHandlerChainsConfigJAXWS getPreHandlerChains()
+ {
+ return preHandlerChains;
+ }
+
+ public void setPreHandlerChains(WSHandlerChainsConfigJAXWS preHandlerChains)
+ {
+ this.preHandlerChains = preHandlerChains;
+ }
+
+ public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type)
+ {
+ List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
+
+ WSHandlerChainsConfigJAXWS handlerChains;
+ if (type == HandlerType.PRE)
+ handlerChains = getPreHandlerChains();
+ else if (type == HandlerType.POST)
+ handlerChains = getPostHandlerChains();
+ else throw new IllegalArgumentException("Invalid handler type: " +
type);
+
+ if (handlerChains != null)
+ {
+ for (HandlerChainMetaData handlerChainMetaData :
handlerChains.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
+ {
+ handlers.add(uhmd.getHandlerMetaDataJAXWS(epMetaData, type));
+ }
+ }
+ }
+
+ return handlers;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigFactoryJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxws;
-
-//$Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactoryJAXWS extends HandlerChainFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactoryJAXWS.class);
-
- public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName, Attributes attrs)
- {
- return new WSConfigRootJAXWS();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSConfigRootJAXWS wsConfig, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSConfig newChild: " + localName);
- if ("endpoint-config".equals(localName))
- {
- WSEndpointConfigJAXWS wsEndpointConfig = new WSEndpointConfigJAXWS();
- wsConfig.getEndpointConfig().add(wsEndpointConfig);
- return wsEndpointConfig;
- }
- if ("client-config".equals(localName))
- {
- WSClientConfigJAXWS wsClientConfig = new WSClientConfigJAXWS();
- wsConfig.getClientConfig().add(wsClientConfig);
- return wsClientConfig;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + "
localName=" + localName + " value=" + value);
-
- if (localName.equals("config-name"))
- wsCommonConfig.setConfigName(value);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSCommonConfig newChild: " + localName);
-
- if ("pre-handler-chains".equals(localName))
- {
- WSHandlerChainsConfigJAXWS preHandlerChains = new WSHandlerChainsConfigJAXWS();
- wsCommonConfig.setPreHandlerChains(preHandlerChains);
- return preHandlerChains;
- }
- if ("post-handler-chains".equals(localName))
- {
- WSHandlerChainsConfigJAXWS postHandlerChains = new
WSHandlerChainsConfigJAXWS();
- wsCommonConfig.setPostHandlerChains(postHandlerChains);
- return postHandlerChains;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSHandlerChainsConfigJAXWS wsHandlerChains,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSHandlerChainsConfig newChild: " + localName);
-
- if ("handler-chain".equals(localName))
- {
- HandlerChainMetaData handlerChain = new HandlerChainMetaData(null);
- wsHandlerChains.getHandlerChains().add(handlerChain);
- return handlerChain;
- }
- return null;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigFactoryJAXWS.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxws;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainFactory;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A factory for the JBossWS endpoint/client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSConfigFactoryJAXWS extends HandlerChainFactory
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(WSConfigFactoryJAXWS.class);
+
+ public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName, Attributes attrs)
+ {
+ return new WSConfigRootJAXWS();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName)
+ {
+ return root;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSConfigRootJAXWS wsConfig, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSConfig newChild: " + localName);
+ if ("endpoint-config".equals(localName))
+ {
+ WSEndpointConfigJAXWS wsEndpointConfig = new WSEndpointConfigJAXWS();
+ wsConfig.getEndpointConfig().add(wsEndpointConfig);
+ return wsEndpointConfig;
+ }
+ if ("client-config".equals(localName))
+ {
+ WSClientConfigJAXWS wsClientConfig = new WSClientConfigJAXWS();
+ wsConfig.getClientConfig().add(wsClientConfig);
+ return wsClientConfig;
+ }
+ return null;
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + "
localName=" + localName + " value=" + value);
+
+ if (localName.equals("config-name"))
+ wsCommonConfig.setConfigName(value);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSCommonConfig newChild: " + localName);
+
+ if ("pre-handler-chains".equals(localName))
+ {
+ WSHandlerChainsConfigJAXWS preHandlerChains = new WSHandlerChainsConfigJAXWS();
+ wsCommonConfig.setPreHandlerChains(preHandlerChains);
+ return preHandlerChains;
+ }
+ if ("post-handler-chains".equals(localName))
+ {
+ WSHandlerChainsConfigJAXWS postHandlerChains = new
WSHandlerChainsConfigJAXWS();
+ wsCommonConfig.setPostHandlerChains(postHandlerChains);
+ return postHandlerChains;
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSHandlerChainsConfigJAXWS wsHandlerChains,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSHandlerChainsConfig newChild: " + localName);
+
+ if ("handler-chain".equals(localName))
+ {
+ HandlerChainMetaData handlerChain = new HandlerChainMetaData(null);
+ wsHandlerChains.getHandlerChains().add(handlerChain);
+ return handlerChain;
+ }
+ return null;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigRootJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * A JBossWS configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigRootJAXWS
-{
- private List<WSClientConfigJAXWS> clientConfigList = new
ArrayList<WSClientConfigJAXWS>();
- private List<WSEndpointConfigJAXWS> endpointConfigList = new
ArrayList<WSEndpointConfigJAXWS>();
-
- public List<WSClientConfigJAXWS> getClientConfig()
- {
- return clientConfigList;
- }
-
- public void setClientConfig(List<WSClientConfigJAXWS> clientConfig)
- {
- this.clientConfigList = clientConfig;
- }
-
- public List<WSEndpointConfigJAXWS> getEndpointConfig()
- {
- return endpointConfigList;
- }
-
- public void setEndpointConfig(List<WSEndpointConfigJAXWS> endpointConfig)
- {
- this.endpointConfigList = endpointConfig;
- }
-
- public WSClientConfigJAXWS getClientConfigByName(String configName)
- {
- WSClientConfigJAXWS config = null;
- for(WSClientConfigJAXWS aux : clientConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && clientConfigList.size() == 1)
- config = clientConfigList.get(0);
-
- return config;
- }
-
- public WSEndpointConfigJAXWS getEndpointConfigByName(String configName)
- {
- WSEndpointConfigJAXWS config = null;
- for(WSEndpointConfigJAXWS aux : endpointConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && endpointConfigList.size() == 1)
- config = endpointConfigList.get(0);
-
- return config;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigRootJAXWS.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxws;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * A JBossWS configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSConfigRootJAXWS
+{
+ private List<WSClientConfigJAXWS> clientConfigList = new
ArrayList<WSClientConfigJAXWS>();
+ private List<WSEndpointConfigJAXWS> endpointConfigList = new
ArrayList<WSEndpointConfigJAXWS>();
+
+ public List<WSClientConfigJAXWS> getClientConfig()
+ {
+ return clientConfigList;
+ }
+
+ public void setClientConfig(List<WSClientConfigJAXWS> clientConfig)
+ {
+ this.clientConfigList = clientConfig;
+ }
+
+ public List<WSEndpointConfigJAXWS> getEndpointConfig()
+ {
+ return endpointConfigList;
+ }
+
+ public void setEndpointConfig(List<WSEndpointConfigJAXWS> endpointConfig)
+ {
+ this.endpointConfigList = endpointConfig;
+ }
+
+ public WSClientConfigJAXWS getClientConfigByName(String configName)
+ {
+ WSClientConfigJAXWS config = null;
+ for(WSClientConfigJAXWS aux : clientConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && clientConfigList.size() == 1)
+ config = clientConfigList.get(0);
+
+ return config;
+ }
+
+ public WSEndpointConfigJAXWS getEndpointConfigByName(String configName)
+ {
+ WSEndpointConfigJAXWS config = null;
+ for(WSEndpointConfigJAXWS aux : endpointConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && endpointConfigList.size() == 1)
+ config = endpointConfigList.get(0);
+
+ return config;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-// $Id$
-
-/**
- * A JBossWS endpoint configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSEndpointConfigJAXWS extends WSCommonConfigJAXWS
-{
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxws;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
+
+// $Id$
+
+/**
+ * A JBossWS endpoint configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSEndpointConfigJAXWS extends WSCommonConfigJAXWS
+{
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-
-/**
- * A JBossWS handler chains configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSHandlerChainsConfigJAXWS
-{
- private List<HandlerChainMetaData> chains = new
ArrayList<HandlerChainMetaData>();
-
- public WSHandlerChainsConfigJAXWS()
- {
- }
-
- public List<HandlerChainMetaData> getHandlerChains()
- {
- return chains;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.config.jaxws;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
+
+
+/**
+ * A JBossWS handler chains configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSHandlerChainsConfigJAXWS
+{
+ private List<HandlerChainMetaData> chains = new
ArrayList<HandlerChainMetaData>();
+
+ public WSHandlerChainsConfigJAXWS()
+ {
+ }
+
+ public List<HandlerChainMetaData> getHandlerChains()
+ {
+ return chains;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee (from rev
1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedApplicationMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedApplicationMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedApplicationMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,131 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.j2ee;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * The container independent top level meta data from the jboss.xml and ejb-jar.xml
descriptor.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedApplicationMetaData
-{
- /** ArrayList<BeanMetaData> for the ejbs */
- private List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
- /** The optional JBossWS config-name */
- private String configName;
- /** The optional JBossWS config-file */
- private String configFile;
- /** The web context root to use for web services */
- private String webServiceContextRoot;
- /** The security-domain value assigned to the application */
- private String securityDomain;
- /** A HashMap<String, String> for webservice description publish locations */
- private PublishLocationAdapter publishLocationAdapter;
-
- public UnifiedBeanMetaData getBeanByEjbName(String ejbName)
- {
- for (UnifiedBeanMetaData beanMetaData : beans)
- {
- if (beanMetaData.getEjbName().equals(ejbName))
- {
- return beanMetaData;
- }
- }
- return null;
- }
-
- public Iterator<UnifiedBeanMetaData> getEnterpriseBeans()
- {
- return beans.iterator();
- }
-
- public void setEnterpriseBeans(List<UnifiedBeanMetaData> beans)
- {
- this.beans = beans;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
-
- public String getWebServiceContextRoot()
- {
- return webServiceContextRoot;
- }
-
- public void setWebServiceContextRoot(String contextRoot)
- {
- this.webServiceContextRoot = contextRoot;
- }
-
- public String getSecurityDomain()
- {
- return securityDomain;
- }
-
- public void setSecurityDomain(String securityDomain)
- {
- this.securityDomain = securityDomain;
- }
-
- public void setPublishLocationAdapter(PublishLocationAdapter publishLocationAdapter)
- {
- this.publishLocationAdapter = publishLocationAdapter;
- }
-
- public String getWsdlPublishLocationByName(String name)
- {
- String publishLocation = null;
- if (publishLocationAdapter != null)
- publishLocation = publishLocationAdapter.getWsdlPublishLocationByName(name);
- return publishLocation;
-
- }
-
- public interface PublishLocationAdapter
- {
- String getWsdlPublishLocationByName(String name);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedApplicationMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedApplicationMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedApplicationMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedApplicationMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.j2ee;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * The container independent top level meta data from the jboss.xml and ejb-jar.xml
descriptor.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedApplicationMetaData
+{
+ /** ArrayList<BeanMetaData> for the ejbs */
+ private List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ /** The optional JBossWS config-name */
+ private String configName;
+ /** The optional JBossWS config-file */
+ private String configFile;
+ /** The web context root to use for web services */
+ private String webServiceContextRoot;
+ /** The security-domain value assigned to the application */
+ private String securityDomain;
+ /** A HashMap<String, String> for webservice description publish locations */
+ private PublishLocationAdapter publishLocationAdapter;
+
+ public UnifiedBeanMetaData getBeanByEjbName(String ejbName)
+ {
+ for (UnifiedBeanMetaData beanMetaData : beans)
+ {
+ if (beanMetaData.getEjbName().equals(ejbName))
+ {
+ return beanMetaData;
+ }
+ }
+ return null;
+ }
+
+ public Iterator<UnifiedBeanMetaData> getEnterpriseBeans()
+ {
+ return beans.iterator();
+ }
+
+ public void setEnterpriseBeans(List<UnifiedBeanMetaData> beans)
+ {
+ this.beans = beans;
+ }
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ }
+
+ public String getConfigFile()
+ {
+ return configFile;
+ }
+
+ public void setConfigFile(String configFile)
+ {
+ this.configFile = configFile;
+ }
+
+ public String getWebServiceContextRoot()
+ {
+ return webServiceContextRoot;
+ }
+
+ public void setWebServiceContextRoot(String contextRoot)
+ {
+ this.webServiceContextRoot = contextRoot;
+ }
+
+ public String getSecurityDomain()
+ {
+ return securityDomain;
+ }
+
+ public void setSecurityDomain(String securityDomain)
+ {
+ this.securityDomain = securityDomain;
+ }
+
+ public void setPublishLocationAdapter(PublishLocationAdapter publishLocationAdapter)
+ {
+ this.publishLocationAdapter = publishLocationAdapter;
+ }
+
+ public String getWsdlPublishLocationByName(String name)
+ {
+ String publishLocation = null;
+ if (publishLocationAdapter != null)
+ publishLocation = publishLocationAdapter.getWsdlPublishLocationByName(name);
+ return publishLocation;
+
+ }
+
+ public interface PublishLocationAdapter
+ {
+ String getWsdlPublishLocationByName(String name);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedBeanMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedBeanMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedBeanMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.j2ee;
-
-//$Id$
-
-/**
- * The container independent common meta data class for the entity, message-driven and
session beans.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedBeanMetaData
-{
- /** The ejb-name element specifies an enterprise bean's name. */
- private String ejbName;
- /** The ejb-class element contains the fully-qualified name of the enterprise
bean's class. */
- private String ejbClass;
- /** The home element contains the fully-qualified name of the enterprise
- bean's home interface. */
- private String homeClass;
- /** The local-home element contains the fully-qualified name of the
- enterprise bean's local home interface. */
- private String localHomeClass;
- /** The service-endpoint element contains the fully-qualified name of the beans
service endpoint interface (SEI) */
- protected String seiName;
- /** The JNDI name under with the home interface should be bound */
- private String jndiName;
- /** The JNDI name under with the local home interface should be bound */
- private String localJndiName;
- /** The jboss port-component binding for a ejb webservice */
- protected UnifiedEjbPortComponentMetaData portComponent;
-
- public String getEjbName()
- {
- return ejbName;
- }
-
- public void setEjbName(String ejbName)
- {
- this.ejbName = ejbName;
- }
-
- public String getEjbClass()
- {
- return ejbClass;
- }
-
- public void setEjbClass(String ejbClass)
- {
- this.ejbClass = ejbClass;
- }
-
- public UnifiedEjbPortComponentMetaData getPortComponent()
- {
- return portComponent;
- }
-
- public void setPortComponent(UnifiedEjbPortComponentMetaData portComponent)
- {
- this.portComponent = portComponent;
- }
-
- public String getServiceEndpoint()
- {
- return seiName;
- }
-
- public void setServiceEndpoint(String seiName)
- {
- this.seiName = seiName;
- }
-
- public String getContainerObjectNameJndiName()
- {
- return getHome() != null ? getJndiName() : getLocalJndiName();
- }
-
- public String getHome()
- {
- return homeClass;
- }
-
- public void setHome(String homeClass)
- {
- this.homeClass = homeClass;
- }
-
- public String getJndiName()
- {
- return jndiName;
- }
-
- public void setJndiName(String jndiName)
- {
- this.jndiName = jndiName;
- }
-
- public String getLocalHome()
- {
- return localHomeClass;
- }
-
- public void setLocalHome(String localHomeClass)
- {
- this.localHomeClass = localHomeClass;
- }
-
- public String getLocalJndiName()
- {
- return localJndiName;
- }
-
- public void setLocalJndiName(String localJndiName)
- {
- this.localJndiName = localJndiName;
- }
-
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedBeanMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedBeanMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedBeanMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedBeanMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.j2ee;
+
+//$Id$
+
+/**
+ * The container independent common meta data class for the entity, message-driven and
session beans.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedBeanMetaData
+{
+ /** The ejb-name element specifies an enterprise bean's name. */
+ private String ejbName;
+ /** The ejb-class element contains the fully-qualified name of the enterprise
bean's class. */
+ private String ejbClass;
+ /** The home element contains the fully-qualified name of the enterprise
+ bean's home interface. */
+ private String homeClass;
+ /** The local-home element contains the fully-qualified name of the
+ enterprise bean's local home interface. */
+ private String localHomeClass;
+ /** The service-endpoint element contains the fully-qualified name of the beans
service endpoint interface (SEI) */
+ protected String seiName;
+ /** The JNDI name under with the home interface should be bound */
+ private String jndiName;
+ /** The JNDI name under with the local home interface should be bound */
+ private String localJndiName;
+ /** The jboss port-component binding for a ejb webservice */
+ protected UnifiedEjbPortComponentMetaData portComponent;
+
+ public String getEjbName()
+ {
+ return ejbName;
+ }
+
+ public void setEjbName(String ejbName)
+ {
+ this.ejbName = ejbName;
+ }
+
+ public String getEjbClass()
+ {
+ return ejbClass;
+ }
+
+ public void setEjbClass(String ejbClass)
+ {
+ this.ejbClass = ejbClass;
+ }
+
+ public UnifiedEjbPortComponentMetaData getPortComponent()
+ {
+ return portComponent;
+ }
+
+ public void setPortComponent(UnifiedEjbPortComponentMetaData portComponent)
+ {
+ this.portComponent = portComponent;
+ }
+
+ public String getServiceEndpoint()
+ {
+ return seiName;
+ }
+
+ public void setServiceEndpoint(String seiName)
+ {
+ this.seiName = seiName;
+ }
+
+ public String getContainerObjectNameJndiName()
+ {
+ return getHome() != null ? getJndiName() : getLocalJndiName();
+ }
+
+ public String getHome()
+ {
+ return homeClass;
+ }
+
+ public void setHome(String homeClass)
+ {
+ this.homeClass = homeClass;
+ }
+
+ public String getJndiName()
+ {
+ return jndiName;
+ }
+
+ public void setJndiName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+
+ public String getLocalHome()
+ {
+ return localHomeClass;
+ }
+
+ public void setLocalHome(String localHomeClass)
+ {
+ this.localHomeClass = localHomeClass;
+ }
+
+ public String getLocalJndiName()
+ {
+ return localJndiName;
+ }
+
+ public void setLocalJndiName(String localJndiName)
+ {
+ this.localJndiName = localJndiName;
+ }
+
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.j2ee;
-
-
-//$Id$
-
-
-/**
- * The container independent metadata for session/port-component element from jboss.xml
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedEjbPortComponentMetaData
-{
- private String portComponentName;
- private String portComponentURI;
- private String authMethod;
- private String transportGuarantee;
-
- public String getPortComponentName()
- {
- return portComponentName;
- }
-
- public void setPortComponentName(String portComponentName)
- {
- this.portComponentName = portComponentName;
- }
-
- public String getPortComponentURI()
- {
- return portComponentURI;
- }
-
- public void setPortComponentURI(String portComponentURI)
- {
- this.portComponentURI = portComponentURI;
- }
-
- public String getURLPattern()
- {
- String pattern = "/*";
- if (portComponentURI != null)
- {
- return portComponentURI;
- }
- return pattern;
- }
-
- public String getAuthMethod()
- {
- return authMethod;
- }
-
- public void setAuthMethod(String authMethod)
- {
- this.authMethod = authMethod;
- }
-
- public String getTransportGuarantee()
- {
- return transportGuarantee;
- }
-
- public void setTransportGuarantee(String transportGuarantee)
- {
- this.transportGuarantee = transportGuarantee;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.j2ee;
+
+
+//$Id$
+
+
+/**
+ * The container independent metadata for session/port-component element from jboss.xml
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedEjbPortComponentMetaData
+{
+ private String portComponentName;
+ private String portComponentURI;
+ private String authMethod;
+ private String transportGuarantee;
+
+ public String getPortComponentName()
+ {
+ return portComponentName;
+ }
+
+ public void setPortComponentName(String portComponentName)
+ {
+ this.portComponentName = portComponentName;
+ }
+
+ public String getPortComponentURI()
+ {
+ return portComponentURI;
+ }
+
+ public void setPortComponentURI(String portComponentURI)
+ {
+ this.portComponentURI = portComponentURI;
+ }
+
+ public String getURLPattern()
+ {
+ String pattern = "/*";
+ if (portComponentURI != null)
+ {
+ return portComponentURI;
+ }
+ return pattern;
+ }
+
+ public String getAuthMethod()
+ {
+ return authMethod;
+ }
+
+ public void setAuthMethod(String authMethod)
+ {
+ this.authMethod = authMethod;
+ }
+
+ public String getTransportGuarantee()
+ {
+ return transportGuarantee;
+ }
+
+ public void setTransportGuarantee(String transportGuarantee)
+ {
+ this.transportGuarantee = transportGuarantee;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedHandlerMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,183 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.j2ee;
-
-//$Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
-import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * The container independent metdata data for a handler element
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedHandlerMetaData implements Serializable
-{
- private static final long serialVersionUID = -3019416564080333900L;
-
- private HandlerChainMetaData chainConfig;
-
- // The required <handler-name> element
- private String handlerName;
- // The required <handler-class> element
- private String handlerClass;
- // The optional <init-param> elements
- private ArrayList<HandlerInitParam> initParams = new
ArrayList<HandlerInitParam>();
- // The optional <soap-header> elements
- private Set<QName> soapHeaders = new HashSet<QName>();
- // The optional <soap-role> elements
- private Set<String> soapRoles = new HashSet<String>();
- // The optional <port-name> elements
- private Set<String> portNames = new HashSet<String>();
-
- public UnifiedHandlerMetaData(HandlerChainMetaData handlerChainMetaData)
- {
- this.chainConfig = handlerChainMetaData;
- }
-
- public void setHandlerName(String value)
- {
- this.handlerName = value;
- }
-
- public String getHandlerName()
- {
- return handlerName;
- }
-
- public void setHandlerClass(String handlerClass)
- {
- this.handlerClass = handlerClass;
- }
-
- public String getHandlerClass()
- {
- return handlerClass;
- }
-
- public void addInitParam(HandlerInitParam param)
- {
- initParams.add(param);
- }
-
- public List<HandlerInitParam> getInitParams()
- {
- return initParams;
- }
-
- public void addSoapRole(String value)
- {
- soapRoles.add(value);
- }
-
- public Set<String> getSoapRoles()
- {
- return soapRoles;
- }
-
- public void addSoapHeader(QName qName)
- {
- soapHeaders.add(qName);
- }
-
- public Set<QName> getSoapHeaders()
- {
- return soapHeaders;
- }
-
- public String getProtocolBindings()
- {
- return (chainConfig != null ? chainConfig.getProtocolBindings() : null);
- }
-
- public QName getServiceNamePattern()
- {
- return (chainConfig != null ? chainConfig.getServiceNamePattern() : null);
- }
-
- public QName getPortNamePattern()
- {
- return (chainConfig != null ? chainConfig.getPortNamePattern() : null);
- }
-
- public void addPortName(String portName)
- {
- portNames.add(portName);
- }
-
- public Set<String> getPortNames()
- {
- return portNames;
- }
-
- public HandlerMetaDataJAXRPC getHandlerMetaDataJAXRPC (EndpointMetaData epMetaData,
HandlerType type)
- {
- HandlerMetaDataJAXRPC hmd = new HandlerMetaDataJAXRPC(epMetaData, type);
- hmd.setHandlerName(getHandlerName());
- hmd.setHandlerClassName(getHandlerClass());
- hmd.seiInitParams(getInitParams());
- hmd.setSoapHeaders(getSoapHeaders());
- hmd.setSoapRoles(getSoapRoles());
- hmd.setPortNames(getPortNames());
- return hmd;
- }
-
- public HandlerMetaDataJAXWS getHandlerMetaDataJAXWS (EndpointMetaData epMetaData,
HandlerType type)
- {
- HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(epMetaData, type);
- hmd.setHandlerName(getHandlerName());
- hmd.setHandlerClassName(getHandlerClass());
- hmd.seiInitParams(getInitParams());
- hmd.setProtocolBindings(getProtocolBindings());
- hmd.setServiceNamePattern(getServiceNamePattern());
- hmd.setPortNamePattern(getPortNamePattern());
- return hmd;
- }
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer("\nUnifiedHandlerMetaData:");
- buffer.append("\n name=" + getHandlerName());
- buffer.append("\n class=" + getHandlerClass());
- buffer.append("\n params=" + getInitParams());
- buffer.append("\n headers=" + getSoapHeaders());
- buffer.append("\n roles=" + getSoapRoles());
- buffer.append("\n protocols=" + getProtocolBindings());
- buffer.append("\n services=" + getServiceNamePattern());
- buffer.append("\n ports=" + (getPortNamePattern() != null ?
getPortNamePattern() : portNames));
- return buffer.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedHandlerMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,183 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.j2ee;
+
+//$Id$
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.common.umdm.HandlerMetaDataJAXWS;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
+
+/**
+ * The container independent metdata data for a handler element
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedHandlerMetaData implements Serializable
+{
+ private static final long serialVersionUID = -3019416564080333900L;
+
+ private HandlerChainMetaData chainConfig;
+
+ // The required <handler-name> element
+ private String handlerName;
+ // The required <handler-class> element
+ private String handlerClass;
+ // The optional <init-param> elements
+ private ArrayList<HandlerInitParam> initParams = new
ArrayList<HandlerInitParam>();
+ // The optional <soap-header> elements
+ private Set<QName> soapHeaders = new HashSet<QName>();
+ // The optional <soap-role> elements
+ private Set<String> soapRoles = new HashSet<String>();
+ // The optional <port-name> elements
+ private Set<String> portNames = new HashSet<String>();
+
+ public UnifiedHandlerMetaData(HandlerChainMetaData handlerChainMetaData)
+ {
+ this.chainConfig = handlerChainMetaData;
+ }
+
+ public void setHandlerName(String value)
+ {
+ this.handlerName = value;
+ }
+
+ public String getHandlerName()
+ {
+ return handlerName;
+ }
+
+ public void setHandlerClass(String handlerClass)
+ {
+ this.handlerClass = handlerClass;
+ }
+
+ public String getHandlerClass()
+ {
+ return handlerClass;
+ }
+
+ public void addInitParam(HandlerInitParam param)
+ {
+ initParams.add(param);
+ }
+
+ public List<HandlerInitParam> getInitParams()
+ {
+ return initParams;
+ }
+
+ public void addSoapRole(String value)
+ {
+ soapRoles.add(value);
+ }
+
+ public Set<String> getSoapRoles()
+ {
+ return soapRoles;
+ }
+
+ public void addSoapHeader(QName qName)
+ {
+ soapHeaders.add(qName);
+ }
+
+ public Set<QName> getSoapHeaders()
+ {
+ return soapHeaders;
+ }
+
+ public String getProtocolBindings()
+ {
+ return (chainConfig != null ? chainConfig.getProtocolBindings() : null);
+ }
+
+ public QName getServiceNamePattern()
+ {
+ return (chainConfig != null ? chainConfig.getServiceNamePattern() : null);
+ }
+
+ public QName getPortNamePattern()
+ {
+ return (chainConfig != null ? chainConfig.getPortNamePattern() : null);
+ }
+
+ public void addPortName(String portName)
+ {
+ portNames.add(portName);
+ }
+
+ public Set<String> getPortNames()
+ {
+ return portNames;
+ }
+
+ public HandlerMetaDataJAXRPC getHandlerMetaDataJAXRPC (EndpointMetaData epMetaData,
HandlerType type)
+ {
+ HandlerMetaDataJAXRPC hmd = new HandlerMetaDataJAXRPC(epMetaData, type);
+ hmd.setHandlerName(getHandlerName());
+ hmd.setHandlerClassName(getHandlerClass());
+ hmd.seiInitParams(getInitParams());
+ hmd.setSoapHeaders(getSoapHeaders());
+ hmd.setSoapRoles(getSoapRoles());
+ hmd.setPortNames(getPortNames());
+ return hmd;
+ }
+
+ public HandlerMetaDataJAXWS getHandlerMetaDataJAXWS (EndpointMetaData epMetaData,
HandlerType type)
+ {
+ HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(epMetaData, type);
+ hmd.setHandlerName(getHandlerName());
+ hmd.setHandlerClassName(getHandlerClass());
+ hmd.seiInitParams(getInitParams());
+ hmd.setProtocolBindings(getProtocolBindings());
+ hmd.setServiceNamePattern(getServiceNamePattern());
+ hmd.setPortNamePattern(getPortNamePattern());
+ return hmd;
+ }
+
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer("\nUnifiedHandlerMetaData:");
+ buffer.append("\n name=" + getHandlerName());
+ buffer.append("\n class=" + getHandlerClass());
+ buffer.append("\n params=" + getInitParams());
+ buffer.append("\n headers=" + getSoapHeaders());
+ buffer.append("\n roles=" + getSoapRoles());
+ buffer.append("\n protocols=" + getProtocolBindings());
+ buffer.append("\n services=" + getServiceNamePattern());
+ buffer.append("\n ports=" + (getPortNamePattern() != null ?
getPortNamePattern() : portNames));
+ return buffer.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedMessageDrivenMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedMessageDrivenMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedMessageDrivenMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.j2ee;
-
-
-// $Id$
-
-
-/**
- * The container independent metadata of a message driven bean.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedMessageDrivenMetaData extends UnifiedBeanMetaData
-{
- private String destinationJndiName;
-
- public String getDestinationJndiName()
- {
- return destinationJndiName;
- }
-
- public void setDestinationJndiName(String destinationJndiName)
- {
- this.destinationJndiName = destinationJndiName;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedMessageDrivenMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedMessageDrivenMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedMessageDrivenMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedMessageDrivenMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.j2ee;
+
+
+// $Id$
+
+
+/**
+ * The container independent metadata of a message driven bean.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedMessageDrivenMetaData extends UnifiedBeanMetaData
+{
+ private String destinationJndiName;
+
+ public String getDestinationJndiName()
+ {
+ return destinationJndiName;
+ }
+
+ public void setDestinationJndiName(String destinationJndiName)
+ {
+ this.destinationJndiName = destinationJndiName;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedPortComponentRefMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedPortComponentRefMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedPortComponentRefMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.j2ee;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-//$Id$
-
-/**
- * The container independent metdata data from handler init params
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedPortComponentRefMetaData implements Serializable
-{
- private static final long serialVersionUID = -7030007637678646740L;
-
- // The required <service-endpoint-interface> element
- private String serviceEndpointInterface;
- // The optional <port-component-link> element
- private String portComponentLink;
-
- /** Arbitrary proxy properties given by <call-property> */
- private Properties callProperties;
-
- public String getPortComponentLink()
- {
- return portComponentLink;
- }
-
- public void setPortComponentLink(String portComponentLink)
- {
- this.portComponentLink = portComponentLink;
- }
-
- public String getServiceEndpointInterface()
- {
- return serviceEndpointInterface;
- }
-
- public void setServiceEndpointInterface(String serviceEndpointInterface)
- {
- this.serviceEndpointInterface = serviceEndpointInterface;
- }
-
- public Properties getCallProperties()
- {
- return callProperties;
- }
-
- public void setCallProperties(Properties callProperties)
- {
- this.callProperties = callProperties;
- }
-
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedPortComponentRefMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedPortComponentRefMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedPortComponentRefMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedPortComponentRefMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.j2ee;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+//$Id$
+
+/**
+ * The container independent metdata data from handler init params
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedPortComponentRefMetaData implements Serializable
+{
+ private static final long serialVersionUID = -7030007637678646740L;
+
+ // The required <service-endpoint-interface> element
+ private String serviceEndpointInterface;
+ // The optional <port-component-link> element
+ private String portComponentLink;
+
+ /** Arbitrary proxy properties given by <call-property> */
+ private Properties callProperties;
+
+ public String getPortComponentLink()
+ {
+ return portComponentLink;
+ }
+
+ public void setPortComponentLink(String portComponentLink)
+ {
+ this.portComponentLink = portComponentLink;
+ }
+
+ public String getServiceEndpointInterface()
+ {
+ return serviceEndpointInterface;
+ }
+
+ public void setServiceEndpointInterface(String serviceEndpointInterface)
+ {
+ this.serviceEndpointInterface = serviceEndpointInterface;
+ }
+
+ public Properties getCallProperties()
+ {
+ return callProperties;
+ }
+
+ public void setCallProperties(Properties callProperties)
+ {
+ this.callProperties = callProperties;
+ }
+
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedServiceRefMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedServiceRefMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedServiceRefMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,258 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.j2ee;
-
-//$Id$
-
-import java.io.Serializable;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * The container independent metdata data from service-ref element in web.xml,
ejb-jar.xml, and
- * application-client.xml.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedServiceRefMetaData implements Serializable
-{
- private static final long serialVersionUID = 122554634182144069L;
-
- // The required <service-ref-name> element
- private String serviceRefName;
- // The required <service-interface> element
- private String serviceInterface;
- // The optional <wsdl-file> element
- private String wsdlFile;
- // The optional <jaxrpc-mapping-file> element
- private String jaxrpcMappingFile;
- // The optional <service-qname> element
- private QName serviceQName;
- // The LinkedHashMap<String, UnifiedPortComponentRefMetaData> for
<port-component-ref> elements
- private Map<String, UnifiedPortComponentRefMetaData> portComponentRefs = new
LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
- // The optional <handler> elements
- private List<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
-
- // The optional JBossWS config-name
- private String configName;
- // The optional JBossWS config-file
- private String configFile;
- /** The URL of the actual WSDL to use, <wsdl-override> */
- private URL wsdlOverride;
- /** Arbitrary proxy properties given by <call-property> */
- private Properties callProperties;
-
- // The wsdl definition, if we have one
- private Object wsdlDefinition;
- // The java/wsdl mapping, if we have one
- private Object javaWsdlMapping;
-
- //The ClassLoader to load additional resources
- private transient URLClassLoader resourceCL;
-
- /** Set the resource classloader that can load the wsdl file
- * On the client side this is set expicitly after unmarshalling.
- */
- public void setResourceCL(URLClassLoader resourceCL)
- {
- if (resourceCL == null)
- throw new IllegalArgumentException("ResourceClassLoader cannot be
null");
-
- this.resourceCL = resourceCL;
- }
-
- public URLClassLoader getResourceCL()
- {
- if (resourceCL == null)
- resourceCL = new URLClassLoader(new URL[] {},
Thread.currentThread().getContextClassLoader());
-
- return resourceCL;
- }
-
- public String getJaxrpcMappingFile()
- {
- return jaxrpcMappingFile;
- }
-
- public void setJaxrpcMappingFile(String jaxrpcMappingFile)
- {
- this.jaxrpcMappingFile = jaxrpcMappingFile;
- }
-
- public URL getJavaWsdlMappingURL()
- {
- URL mappingURL = null;
- if (jaxrpcMappingFile != null)
- {
- mappingURL = getResourceCL().findResource(jaxrpcMappingFile);
- if (mappingURL == null)
- throw new IllegalStateException("Cannot find resource: " +
jaxrpcMappingFile);
- }
- return mappingURL;
- }
-
- public Object getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public void setJavaWsdlMapping(Object javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public UnifiedPortComponentRefMetaData[] getPortComponentRefs()
- {
- UnifiedPortComponentRefMetaData[] array = new
UnifiedPortComponentRefMetaData[portComponentRefs.size()];
- portComponentRefs.values().toArray(array);
- return array;
- }
-
- public void setPortComponentRefs(LinkedHashMap<String,
UnifiedPortComponentRefMetaData> portComponentRefs)
- {
- this.portComponentRefs = portComponentRefs;
- }
-
- public UnifiedHandlerMetaData[] getHandlers()
- {
- UnifiedHandlerMetaData[] array = new UnifiedHandlerMetaData[handlers.size()];
- handlers.toArray(array);
- return array;
- }
-
- public void setHandlers(ArrayList<UnifiedHandlerMetaData> handlers)
- {
- this.handlers = handlers;
- }
-
- public String getServiceInterface()
- {
- return serviceInterface;
- }
-
- public void setServiceInterface(String serviceInterface)
- {
- this.serviceInterface = serviceInterface;
- }
-
- public QName getServiceQName()
- {
- return serviceQName;
- }
-
- public void setServiceQName(QName serviceQName)
- {
- this.serviceQName = serviceQName;
- }
-
- public String getServiceRefName()
- {
- return serviceRefName;
- }
-
- public void setServiceRefName(String serviceRefName)
- {
- this.serviceRefName = serviceRefName;
- }
-
- public String getWsdlFile()
- {
- return wsdlFile;
- }
-
- public void setWsdlFile(String wsdlFile)
- {
- this.wsdlFile = wsdlFile;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public URL getWsdlOverride()
- {
- return wsdlOverride;
- }
-
-
- public void setWsdlOverride(URL wsdlOverride)
- {
- this.wsdlOverride = wsdlOverride;
- }
-
- public URL getWsdlURL()
- {
- URL wsdlURL = wsdlOverride;
- if (wsdlURL == null && wsdlFile != null)
- {
- wsdlURL = getResourceCL().findResource(wsdlFile);
- if (wsdlURL == null)
- throw new IllegalStateException("Cannot find resource: " +
wsdlFile);
- }
- return wsdlURL;
- }
-
- public Properties getCallProperties()
- {
- return callProperties;
- }
-
- public void setCallProperties(Properties callProperties)
- {
- this.callProperties = callProperties;
- }
-
- public Object getWsdlDefinition()
- {
- return wsdlDefinition;
- }
-
- public void setWsdlDefinition(Object wsdlDefinition)
- {
- this.wsdlDefinition = wsdlDefinition;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedServiceRefMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedServiceRefMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedServiceRefMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedServiceRefMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,258 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.j2ee;
+
+//$Id$
+
+import java.io.Serializable;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * The container independent metdata data from service-ref element in web.xml,
ejb-jar.xml, and
+ * application-client.xml.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedServiceRefMetaData implements Serializable
+{
+ private static final long serialVersionUID = 122554634182144069L;
+
+ // The required <service-ref-name> element
+ private String serviceRefName;
+ // The required <service-interface> element
+ private String serviceInterface;
+ // The optional <wsdl-file> element
+ private String wsdlFile;
+ // The optional <jaxrpc-mapping-file> element
+ private String jaxrpcMappingFile;
+ // The optional <service-qname> element
+ private QName serviceQName;
+ // The LinkedHashMap<String, UnifiedPortComponentRefMetaData> for
<port-component-ref> elements
+ private Map<String, UnifiedPortComponentRefMetaData> portComponentRefs = new
LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
+ // The optional <handler> elements
+ private List<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
+
+ // The optional JBossWS config-name
+ private String configName;
+ // The optional JBossWS config-file
+ private String configFile;
+ /** The URL of the actual WSDL to use, <wsdl-override> */
+ private URL wsdlOverride;
+ /** Arbitrary proxy properties given by <call-property> */
+ private Properties callProperties;
+
+ // The wsdl definition, if we have one
+ private Object wsdlDefinition;
+ // The java/wsdl mapping, if we have one
+ private Object javaWsdlMapping;
+
+ //The ClassLoader to load additional resources
+ private transient URLClassLoader resourceCL;
+
+ /** Set the resource classloader that can load the wsdl file
+ * On the client side this is set expicitly after unmarshalling.
+ */
+ public void setResourceCL(URLClassLoader resourceCL)
+ {
+ if (resourceCL == null)
+ throw new IllegalArgumentException("ResourceClassLoader cannot be
null");
+
+ this.resourceCL = resourceCL;
+ }
+
+ public URLClassLoader getResourceCL()
+ {
+ if (resourceCL == null)
+ resourceCL = new URLClassLoader(new URL[] {},
Thread.currentThread().getContextClassLoader());
+
+ return resourceCL;
+ }
+
+ public String getJaxrpcMappingFile()
+ {
+ return jaxrpcMappingFile;
+ }
+
+ public void setJaxrpcMappingFile(String jaxrpcMappingFile)
+ {
+ this.jaxrpcMappingFile = jaxrpcMappingFile;
+ }
+
+ public URL getJavaWsdlMappingURL()
+ {
+ URL mappingURL = null;
+ if (jaxrpcMappingFile != null)
+ {
+ mappingURL = getResourceCL().findResource(jaxrpcMappingFile);
+ if (mappingURL == null)
+ throw new IllegalStateException("Cannot find resource: " +
jaxrpcMappingFile);
+ }
+ return mappingURL;
+ }
+
+ public Object getJavaWsdlMapping()
+ {
+ return javaWsdlMapping;
+ }
+
+ public void setJavaWsdlMapping(Object javaWsdlMapping)
+ {
+ this.javaWsdlMapping = javaWsdlMapping;
+ }
+
+ public UnifiedPortComponentRefMetaData[] getPortComponentRefs()
+ {
+ UnifiedPortComponentRefMetaData[] array = new
UnifiedPortComponentRefMetaData[portComponentRefs.size()];
+ portComponentRefs.values().toArray(array);
+ return array;
+ }
+
+ public void setPortComponentRefs(LinkedHashMap<String,
UnifiedPortComponentRefMetaData> portComponentRefs)
+ {
+ this.portComponentRefs = portComponentRefs;
+ }
+
+ public UnifiedHandlerMetaData[] getHandlers()
+ {
+ UnifiedHandlerMetaData[] array = new UnifiedHandlerMetaData[handlers.size()];
+ handlers.toArray(array);
+ return array;
+ }
+
+ public void setHandlers(ArrayList<UnifiedHandlerMetaData> handlers)
+ {
+ this.handlers = handlers;
+ }
+
+ public String getServiceInterface()
+ {
+ return serviceInterface;
+ }
+
+ public void setServiceInterface(String serviceInterface)
+ {
+ this.serviceInterface = serviceInterface;
+ }
+
+ public QName getServiceQName()
+ {
+ return serviceQName;
+ }
+
+ public void setServiceQName(QName serviceQName)
+ {
+ this.serviceQName = serviceQName;
+ }
+
+ public String getServiceRefName()
+ {
+ return serviceRefName;
+ }
+
+ public void setServiceRefName(String serviceRefName)
+ {
+ this.serviceRefName = serviceRefName;
+ }
+
+ public String getWsdlFile()
+ {
+ return wsdlFile;
+ }
+
+ public void setWsdlFile(String wsdlFile)
+ {
+ this.wsdlFile = wsdlFile;
+ }
+
+ public String getConfigFile()
+ {
+ return configFile;
+ }
+
+ public void setConfigFile(String configFile)
+ {
+ this.configFile = configFile;
+ }
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ }
+
+ public URL getWsdlOverride()
+ {
+ return wsdlOverride;
+ }
+
+
+ public void setWsdlOverride(URL wsdlOverride)
+ {
+ this.wsdlOverride = wsdlOverride;
+ }
+
+ public URL getWsdlURL()
+ {
+ URL wsdlURL = wsdlOverride;
+ if (wsdlURL == null && wsdlFile != null)
+ {
+ wsdlURL = getResourceCL().findResource(wsdlFile);
+ if (wsdlURL == null)
+ throw new IllegalStateException("Cannot find resource: " +
wsdlFile);
+ }
+ return wsdlURL;
+ }
+
+ public Properties getCallProperties()
+ {
+ return callProperties;
+ }
+
+ public void setCallProperties(Properties callProperties)
+ {
+ this.callProperties = callProperties;
+ }
+
+ public Object getWsdlDefinition()
+ {
+ return wsdlDefinition;
+ }
+
+ public void setWsdlDefinition(Object wsdlDefinition)
+ {
+ this.wsdlDefinition = wsdlDefinition;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedSessionMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedSessionMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedSessionMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.j2ee;
-
-
-// $Id$
-
-
-/**
- * The container independent metadata of a message driven bean.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedSessionMetaData extends UnifiedBeanMetaData
-{
-
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedSessionMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedSessionMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedSessionMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedSessionMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.j2ee;
+
+
+// $Id$
+
+
+/**
+ * The container independent metadata of a message driven bean.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedSessionMetaData extends UnifiedBeanMetaData
+{
+
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,143 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.j2ee;
-
-//$Id$
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * The container independent representation of the web.xml and jboss-web.xml deployment
descriptors
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedWebMetaData
-{
- /** The war context root as specified at the jboss-web.xml descriptor level. */
- private String contextRoot;
- /** The servlet-mapping <servlet-name, url-pattern> */
- private Map<String, String> servletMappings = new HashMap<String,
String>();
- /** The servlet <servlet-name, servlet-class> */
- private Map<String, String> servletClassNames = new HashMap<String,
String>();
- /** The optional JBossWS config-name */
- private String configName;
- /** The optional JBossWS config-file */
- private String configFile;
- /** The security-domain value assigned to the application */
- private String securityDomain;
- /** A HashMap<String, String> for webservice description publish locations */
- private PublishLocationAdapter publishLocationAdapter;
- /** web.xml security-constraints */
- private List<UnifiedWebSecurityMetaData> securityMetaData;
-
- public String getContextRoot()
- {
- return contextRoot;
- }
-
- public void setContextRoot(String contextRoot)
- {
- this.contextRoot = contextRoot;
- }
-
- public Map<String, String> getServletMappings()
- {
- return servletMappings;
- }
-
- public void setServletMappings(Map<String, String> servletMappings)
- {
- this.servletMappings = servletMappings;
- }
-
- public Map<String, String> getServletClassNames()
- {
- return servletClassNames;
- }
-
- public void setServletClassNames(Map<String, String> servletClassNames)
- {
- this.servletClassNames = servletClassNames;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
-
- public String getSecurityDomain()
- {
- return securityDomain;
- }
-
- public void setSecurityDomain(String securityDomain)
- {
- this.securityDomain = securityDomain;
- }
-
- public List<UnifiedWebSecurityMetaData> getSecurityMetaData()
- {
- return securityMetaData;
- }
-
- public void setSecurityMetaData(List<UnifiedWebSecurityMetaData>
securityMetaData)
- {
- this.securityMetaData = securityMetaData;
- }
-
- public void setPublishLocationAdapter(PublishLocationAdapter publishLocationAdapter)
- {
- this.publishLocationAdapter = publishLocationAdapter;
- }
-
- public String getWsdlPublishLocationByName(String name)
- {
- String publishLocation = null;
- if (publishLocationAdapter != null)
- publishLocation = publishLocationAdapter.getWsdlPublishLocationByName(name);
- return publishLocation;
-
- }
-
- public interface PublishLocationAdapter
- {
- String getWsdlPublishLocationByName(String name);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,143 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.j2ee;
+
+//$Id$
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The container independent representation of the web.xml and jboss-web.xml deployment
descriptors
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedWebMetaData
+{
+ /** The war context root as specified at the jboss-web.xml descriptor level. */
+ private String contextRoot;
+ /** The servlet-mapping <servlet-name, url-pattern> */
+ private Map<String, String> servletMappings = new HashMap<String,
String>();
+ /** The servlet <servlet-name, servlet-class> */
+ private Map<String, String> servletClassNames = new HashMap<String,
String>();
+ /** The optional JBossWS config-name */
+ private String configName;
+ /** The optional JBossWS config-file */
+ private String configFile;
+ /** The security-domain value assigned to the application */
+ private String securityDomain;
+ /** A HashMap<String, String> for webservice description publish locations */
+ private PublishLocationAdapter publishLocationAdapter;
+ /** web.xml security-constraints */
+ private List<UnifiedWebSecurityMetaData> securityMetaData;
+
+ public String getContextRoot()
+ {
+ return contextRoot;
+ }
+
+ public void setContextRoot(String contextRoot)
+ {
+ this.contextRoot = contextRoot;
+ }
+
+ public Map<String, String> getServletMappings()
+ {
+ return servletMappings;
+ }
+
+ public void setServletMappings(Map<String, String> servletMappings)
+ {
+ this.servletMappings = servletMappings;
+ }
+
+ public Map<String, String> getServletClassNames()
+ {
+ return servletClassNames;
+ }
+
+ public void setServletClassNames(Map<String, String> servletClassNames)
+ {
+ this.servletClassNames = servletClassNames;
+ }
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ }
+
+ public String getConfigFile()
+ {
+ return configFile;
+ }
+
+ public void setConfigFile(String configFile)
+ {
+ this.configFile = configFile;
+ }
+
+ public String getSecurityDomain()
+ {
+ return securityDomain;
+ }
+
+ public void setSecurityDomain(String securityDomain)
+ {
+ this.securityDomain = securityDomain;
+ }
+
+ public List<UnifiedWebSecurityMetaData> getSecurityMetaData()
+ {
+ return securityMetaData;
+ }
+
+ public void setSecurityMetaData(List<UnifiedWebSecurityMetaData>
securityMetaData)
+ {
+ this.securityMetaData = securityMetaData;
+ }
+
+ public void setPublishLocationAdapter(PublishLocationAdapter publishLocationAdapter)
+ {
+ this.publishLocationAdapter = publishLocationAdapter;
+ }
+
+ public String getWsdlPublishLocationByName(String name)
+ {
+ String publishLocation = null;
+ if (publishLocationAdapter != null)
+ publishLocation = publishLocationAdapter.getWsdlPublishLocationByName(name);
+ return publishLocation;
+
+ }
+
+ public interface PublishLocationAdapter
+ {
+ String getWsdlPublishLocationByName(String name);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebSecurityMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebSecurityMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebSecurityMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,95 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.j2ee;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-
-/**
- *
- * @author darran.lofthouse(a)jboss.com
- * @since Oct 22, 2006
- */
-public class UnifiedWebSecurityMetaData
-{
-
- /** The optional security-constraint/user-data-constraint/transport-guarantee */
- private String transportGuarantee;
-
- /**
- * The HashMap for the security-constraint/web-resource-collection
- * elements.
- */
- private HashMap<String, UnifiedWebResourceCollection> webResources = new
HashMap<String, UnifiedWebResourceCollection>();
-
- public UnifiedWebResourceCollection addWebResource(final String name)
- {
- UnifiedWebResourceCollection wrc = new UnifiedWebResourceCollection(name);
- webResources.put(name, wrc);
-
- return wrc;
- }
-
- public Collection<UnifiedWebResourceCollection> getWebResources()
- {
- return webResources.values();
- }
-
- public String getTransportGuarantee()
- {
- return transportGuarantee;
- }
-
- public void setTransportGuarantee(String transportGuarantee)
- {
- this.transportGuarantee = transportGuarantee;
- }
-
- public static class UnifiedWebResourceCollection
- {
- private String name;
- /** The required url-pattern element(s) */
- private HashSet<String> urlPatterns = new HashSet<String>();
-
- public UnifiedWebResourceCollection(final String name)
- {
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void addPattern(String pattern)
- {
- urlPatterns.add(pattern);
- }
-
- public HashSet<String> getUrlPatterns()
- {
- return urlPatterns;
- }
- }
-
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebSecurityMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebSecurityMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/j2ee/UnifiedWebSecurityMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebSecurityMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.j2ee;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since Oct 22, 2006
+ */
+public class UnifiedWebSecurityMetaData
+{
+
+ /** The optional security-constraint/user-data-constraint/transport-guarantee */
+ private String transportGuarantee;
+
+ /**
+ * The HashMap for the security-constraint/web-resource-collection
+ * elements.
+ */
+ private HashMap<String, UnifiedWebResourceCollection> webResources = new
HashMap<String, UnifiedWebResourceCollection>();
+
+ public UnifiedWebResourceCollection addWebResource(final String name)
+ {
+ UnifiedWebResourceCollection wrc = new UnifiedWebResourceCollection(name);
+ webResources.put(name, wrc);
+
+ return wrc;
+ }
+
+ public Collection<UnifiedWebResourceCollection> getWebResources()
+ {
+ return webResources.values();
+ }
+
+ public String getTransportGuarantee()
+ {
+ return transportGuarantee;
+ }
+
+ public void setTransportGuarantee(String transportGuarantee)
+ {
+ this.transportGuarantee = transportGuarantee;
+ }
+
+ public static class UnifiedWebResourceCollection
+ {
+ private String name;
+ /** The required url-pattern element(s) */
+ private HashSet<String> urlPatterns = new HashSet<String>();
+
+ public UnifiedWebResourceCollection(final String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void addPattern(String pattern)
+ {
+ urlPatterns.add(pattern);
+ }
+
+ public HashSet<String> getUrlPatterns()
+ {
+ return urlPatterns;
+ }
+ }
+
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ExceptionMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ExceptionMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,113 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-/**
- * XML mapping of the java-wsdl-mapping/exception-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class ExceptionMapping implements Serializable
-{
- private static final long serialVersionUID = 2964098233936811614L;
-
- // The parent <java-wsdl-mapping> element
- private JavaWsdlMapping javaWsdlMapping;
-
- // The required <exception-type> element
- private String exceptionType;
- // The required <wsdl-message> element
- private QName wsdlMessage;
- // The optional <constructor-parameter-order> element
- private ArrayList constructorParameterOrder = new ArrayList();
-
- public ExceptionMapping(JavaWsdlMapping javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public String getExceptionType()
- {
- return exceptionType;
- }
-
- public void setExceptionType(String exceptionType)
- {
- this.exceptionType = exceptionType;
- }
-
- public QName getWsdlMessage()
- {
- return wsdlMessage;
- }
-
- public void setWsdlMessage(QName wsdlMessage)
- {
- this.wsdlMessage = wsdlMessage;
- }
-
- public String[] getConstructorParameterOrder()
- {
- String[] arr = new String[constructorParameterOrder.size()];
- constructorParameterOrder.toArray(arr);
- return arr;
- }
-
- public void addConstructorParameter(String elementName)
- {
- constructorParameterOrder.add(elementName);
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- sb.append("<exception-mapping>");
-
sb.append("<exception-type>").append(exceptionType).append("</exception-type>");
- sb.append("<wsdl-message
xmlns:exMsgNS='").append(wsdlMessage.getNamespaceURI()).append("'>");
-
sb.append("exMsgNS").append(":").append(wsdlMessage.getLocalPart());
- sb.append("</wsdl-message>");
-
- if (constructorParameterOrder.size() > 0)
- {
- sb.append("<constructor-parameter-order>");
- for (Iterator i = constructorParameterOrder.iterator(); i.hasNext();)
-
sb.append("<element-name>").append(i.next()).append("</element-name>");
- sb.append("</constructor-parameter-order>");
- }
- sb.append("</exception-mapping>");
- return sb.toString();
- }
-}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ExceptionMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ExceptionMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,113 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+// $Id$
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+/**
+ * XML mapping of the java-wsdl-mapping/exception-mapping element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class ExceptionMapping implements Serializable
+{
+ private static final long serialVersionUID = 2964098233936811614L;
+
+ // The parent <java-wsdl-mapping> element
+ private JavaWsdlMapping javaWsdlMapping;
+
+ // The required <exception-type> element
+ private String exceptionType;
+ // The required <wsdl-message> element
+ private QName wsdlMessage;
+ // The optional <constructor-parameter-order> element
+ private ArrayList constructorParameterOrder = new ArrayList();
+
+ public ExceptionMapping(JavaWsdlMapping javaWsdlMapping)
+ {
+ this.javaWsdlMapping = javaWsdlMapping;
+ }
+
+ public JavaWsdlMapping getJavaWsdlMapping()
+ {
+ return javaWsdlMapping;
+ }
+
+ public String getExceptionType()
+ {
+ return exceptionType;
+ }
+
+ public void setExceptionType(String exceptionType)
+ {
+ this.exceptionType = exceptionType;
+ }
+
+ public QName getWsdlMessage()
+ {
+ return wsdlMessage;
+ }
+
+ public void setWsdlMessage(QName wsdlMessage)
+ {
+ this.wsdlMessage = wsdlMessage;
+ }
+
+ public String[] getConstructorParameterOrder()
+ {
+ String[] arr = new String[constructorParameterOrder.size()];
+ constructorParameterOrder.toArray(arr);
+ return arr;
+ }
+
+ public void addConstructorParameter(String elementName)
+ {
+ constructorParameterOrder.add(elementName);
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<exception-mapping>");
+
sb.append("<exception-type>").append(exceptionType).append("</exception-type>");
+ sb.append("<wsdl-message
xmlns:exMsgNS='").append(wsdlMessage.getNamespaceURI()).append("'>");
+
sb.append("exMsgNS").append(":").append(wsdlMessage.getLocalPart());
+ sb.append("</wsdl-message>");
+
+ if (constructorParameterOrder.size() > 0)
+ {
+ sb.append("<constructor-parameter-order>");
+ for (Iterator i = constructorParameterOrder.iterator(); i.hasNext();)
+
sb.append("<element-name>").append(i.next()).append("</element-name>");
+ sb.append("</constructor-parameter-order>");
+ }
+ sb.append("</exception-mapping>");
+ return sb.toString();
+ }
+}
\ No newline at end of file
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,317 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-
-import javax.xml.namespace.QName;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * XML mapping of the java-wsdl-mapping root element in jaxrpc-mapping.xml
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class JavaWsdlMapping implements Serializable
-{
- private static final long serialVersionUID = -142671631068024054L;
-
- // provide logging
- private static Logger log = Logger.getLogger(JavaWsdlMapping.class);
-
- // One or more <package-mapping> elements
- private List packageMappings = new ArrayList();
- // Zero or more <java-xml-type-mapping> elements
- private List javaXmlTypeMappings = new ArrayList();
- // Zero or more <exception-mapping> elements
- private List exceptionMappings = new ArrayList();
- // Zero or more <service-interface-mapping> elements
- private List serviceInterfaceMappings = new ArrayList();
- // Zero or more <service-endpoint-interface-mapping> elements
- private List serviceEndpointInterfaceMappings = new ArrayList();
-
- public PackageMapping[] getPackageMappings()
- {
- PackageMapping[] arr = new PackageMapping[packageMappings.size()];
- packageMappings.toArray(arr);
- return arr;
- }
-
- public JavaXmlTypeMapping[] getJavaXmlTypeMappings()
- {
- JavaXmlTypeMapping[] arr = new JavaXmlTypeMapping[javaXmlTypeMappings.size()];
- javaXmlTypeMappings.toArray(arr);
- return arr;
- }
-
- public ExceptionMapping[] getExceptionMappings()
- {
- ExceptionMapping[] arr = new ExceptionMapping[exceptionMappings.size()];
- exceptionMappings.toArray(arr);
- return arr;
- }
-
- public ServiceInterfaceMapping[] getServiceInterfaceMappings()
- {
- ServiceInterfaceMapping[] arr = new
ServiceInterfaceMapping[serviceInterfaceMappings.size()];
- serviceInterfaceMappings.toArray(arr);
- return arr;
- }
-
- public ServiceEndpointInterfaceMapping[] getServiceEndpointInterfaceMappings()
- {
- ServiceEndpointInterfaceMapping[] arr = new
ServiceEndpointInterfaceMapping[serviceEndpointInterfaceMappings.size()];
- serviceEndpointInterfaceMappings.toArray(arr);
- return arr;
- }
-
- // convenience methods
********************************************************************
-
- /** Get the package string for a given URI
- */
- public String getPackageNameForNamespaceURI(String nsURI)
- {
- String packageStr = null;
- for (int i = 0; packageStr == null && i < packageMappings.size(); i++)
- {
- PackageMapping mapping = (PackageMapping)packageMappings.get(i);
- if (mapping.getNamespaceURI().equals(nsURI))
- packageStr = mapping.getPackageType();
- }
- return packageStr;
- }
-
- /** Get the type mapping fo a given root-type-qname
- */
- public JavaXmlTypeMapping getTypeMappingForQName(QName xmlType)
- {
- JavaXmlTypeMapping typeMapping = null;
-
- if (xmlType != null)
- {
- // Check the <root-type-qname>
- Iterator it = javaXmlTypeMappings.iterator();
- while (typeMapping == null && it.hasNext())
- {
- JavaXmlTypeMapping mapping = (JavaXmlTypeMapping)it.next();
- if (xmlType.equals(mapping.getRootTypeQName()))
- typeMapping = mapping;
- }
-
- // Check the <anonymous-type-qname>
- it = javaXmlTypeMappings.iterator();
- while (typeMapping == null && it.hasNext())
- {
- JavaXmlTypeMapping mapping = (JavaXmlTypeMapping)it.next();
- QName anonymousQName = mapping.getAnonymousTypeQName();
- if (anonymousQName != null)
- {
- if (xmlType.getNamespaceURI().equals(anonymousQName.getNamespaceURI()))
- {
- String localPart = xmlType.getLocalPart();
- if (anonymousQName.getLocalPart().equals(localPart))
- typeMapping = mapping;
- if (anonymousQName.getLocalPart().equals(">" +
localPart))
- typeMapping = mapping;
- }
- }
- }
-
- if (typeMapping == null)
- log.warn("Cannot find jaxrpc-mapping for type: " + xmlType);
- }
-
- return typeMapping;
- }
-
- /** Get the exception mapping fo a given wsdl message
- */
- public ExceptionMapping getExceptionMappingForMessageQName(QName wsdlMessage)
- {
- ExceptionMapping exMapping = null;
-
- if (wsdlMessage != null)
- {
- Iterator it = exceptionMappings.iterator();
- while (it.hasNext())
- {
- ExceptionMapping mapping = (ExceptionMapping)it.next();
- if (wsdlMessage.equals(mapping.getWsdlMessage()))
- exMapping = mapping;
- }
- }
-
- return exMapping;
- }
-
- /** Get the exception mapping fo a given exception type
- */
- public ExceptionMapping getExceptionMappingForExceptionType(String javaType)
- {
- ExceptionMapping exMapping = null;
-
- if (javaType != null)
- {
- Iterator it = exceptionMappings.iterator();
- while (it.hasNext())
- {
- ExceptionMapping mapping = (ExceptionMapping)it.next();
- if (javaType.equals(mapping.getExceptionType()))
- exMapping = mapping;
- }
- }
-
- return exMapping;
- }
-
- /** Get the port type qname for a given service endpoint infterface
- */
- public QName getPortTypeQNameForServiceEndpointInterface(String seiName)
- {
- QName portTypeQName = null;
-
- ServiceEndpointInterfaceMapping[] seiMappings =
getServiceEndpointInterfaceMappings();
- for (int i = 0; i < seiMappings.length; i++)
- {
- ServiceEndpointInterfaceMapping aux = seiMappings[i];
- if (aux.getServiceEndpointInterface().equals(seiName))
- portTypeQName = aux.getWsdlPortType();
- }
-
- return portTypeQName;
- }
-
- /** Get the service endpoint infterfacemapping for a given port type qname
- */
- public ServiceEndpointInterfaceMapping
getServiceEndpointInterfaceMappingByPortType(QName portType)
- {
- ServiceEndpointInterfaceMapping seiMapping = null;
-
- ServiceEndpointInterfaceMapping[] seiMappings =
getServiceEndpointInterfaceMappings();
- for (int i = 0; seiMapping == null && i < seiMappings.length; i++)
- {
- ServiceEndpointInterfaceMapping aux = seiMappings[i];
- if (aux.getWsdlPortType().equals(portType))
- seiMapping = aux;
- }
-
- return seiMapping;
- }
-
- /** Get the service endpoint infterface mapping for a service endpoint infterface
- */
- public ServiceEndpointInterfaceMapping getServiceEndpointInterfaceMapping(String
seiName)
- {
- ServiceEndpointInterfaceMapping seiMapping = null;
-
- ServiceEndpointInterfaceMapping[] seiMappings =
getServiceEndpointInterfaceMappings();
- for (int i = 0; seiMapping == null && i < seiMappings.length; i++)
- {
- ServiceEndpointInterfaceMapping aux = seiMappings[i];
- if (aux.getServiceEndpointInterface().equals(seiName))
- seiMapping = aux;
- }
-
- return seiMapping;
- }
-
- /**
- * Serialize the model as a String (Should return the mapping file)
- *
- * @return
- */
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- //Append Standard Namespace Header
- sb.append("<java-wsdl-mapping version='1.1'
").append("xmlns='http://java.sun.com/xml/ns/j2ee' ");
-
sb.append("xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance&...
");
-
sb.append("xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee ");
-
sb.append("http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_...;
-
- Iterator piter = packageMappings.iterator();
- while (piter != null && piter.hasNext())
- sb.append(((PackageMapping)piter.next()).serialize());
-
- Iterator jxiter = javaXmlTypeMappings.iterator();
- while (jxiter.hasNext())
- sb.append(((JavaXmlTypeMapping)jxiter.next()).serialize());
-
- for (Iterator i = exceptionMappings.iterator(); i.hasNext();)
- sb.append(((ExceptionMapping)i.next()).serialize());
-
- // A <service-interface-mapping> is followed by 1 or many
<service-endpoint-interface-mapping> elements
- int lenSIM = serviceInterfaceMappings.size();
- for (int i = 0; i < lenSIM; i++)
- {
- ServiceInterfaceMapping sim =
(ServiceInterfaceMapping)serviceInterfaceMappings.get(i);
- sb.append(sim.serialize());
- ServiceEndpointInterfaceMapping seim =
(ServiceEndpointInterfaceMapping)serviceEndpointInterfaceMappings.get(i);
- sb.append(seim.serialize());
- }
-
- int lenSEI = serviceEndpointInterfaceMappings.size();
- for (int i = lenSIM; i < lenSEI; i++)
- {
- ServiceEndpointInterfaceMapping seim =
(ServiceEndpointInterfaceMapping)serviceEndpointInterfaceMappings.get(i);
- sb.append(seim.serialize());
- }
-
- sb.append("</java-wsdl-mapping>");
-
- return sb.toString();
- }
-
- // factory methods
********************************************************************
-
- public void addPackageMapping(PackageMapping packageMapping)
- {
- packageMappings.add(packageMapping);
- }
-
- public void addJavaXmlTypeMappings(JavaXmlTypeMapping typeMapping)
- {
- javaXmlTypeMappings.add(typeMapping);
- }
-
- public void addExceptionMappings(ExceptionMapping exceptionMapping)
- {
- exceptionMappings.add(exceptionMapping);
- }
-
- public void addServiceInterfaceMappings(ServiceInterfaceMapping
serviceInterfaceMapping)
- {
- serviceInterfaceMappings.add(serviceInterfaceMapping);
- }
-
- public void addServiceEndpointInterfaceMappings(ServiceEndpointInterfaceMapping
serviceEndpointInterfaceMapping)
- {
- serviceEndpointInterfaceMappings.add(serviceEndpointInterfaceMapping);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,317 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+
+import javax.xml.namespace.QName;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * XML mapping of the java-wsdl-mapping root element in jaxrpc-mapping.xml
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class JavaWsdlMapping implements Serializable
+{
+ private static final long serialVersionUID = -142671631068024054L;
+
+ // provide logging
+ private static Logger log = Logger.getLogger(JavaWsdlMapping.class);
+
+ // One or more <package-mapping> elements
+ private List packageMappings = new ArrayList();
+ // Zero or more <java-xml-type-mapping> elements
+ private List javaXmlTypeMappings = new ArrayList();
+ // Zero or more <exception-mapping> elements
+ private List exceptionMappings = new ArrayList();
+ // Zero or more <service-interface-mapping> elements
+ private List serviceInterfaceMappings = new ArrayList();
+ // Zero or more <service-endpoint-interface-mapping> elements
+ private List serviceEndpointInterfaceMappings = new ArrayList();
+
+ public PackageMapping[] getPackageMappings()
+ {
+ PackageMapping[] arr = new PackageMapping[packageMappings.size()];
+ packageMappings.toArray(arr);
+ return arr;
+ }
+
+ public JavaXmlTypeMapping[] getJavaXmlTypeMappings()
+ {
+ JavaXmlTypeMapping[] arr = new JavaXmlTypeMapping[javaXmlTypeMappings.size()];
+ javaXmlTypeMappings.toArray(arr);
+ return arr;
+ }
+
+ public ExceptionMapping[] getExceptionMappings()
+ {
+ ExceptionMapping[] arr = new ExceptionMapping[exceptionMappings.size()];
+ exceptionMappings.toArray(arr);
+ return arr;
+ }
+
+ public ServiceInterfaceMapping[] getServiceInterfaceMappings()
+ {
+ ServiceInterfaceMapping[] arr = new
ServiceInterfaceMapping[serviceInterfaceMappings.size()];
+ serviceInterfaceMappings.toArray(arr);
+ return arr;
+ }
+
+ public ServiceEndpointInterfaceMapping[] getServiceEndpointInterfaceMappings()
+ {
+ ServiceEndpointInterfaceMapping[] arr = new
ServiceEndpointInterfaceMapping[serviceEndpointInterfaceMappings.size()];
+ serviceEndpointInterfaceMappings.toArray(arr);
+ return arr;
+ }
+
+ // convenience methods
********************************************************************
+
+ /** Get the package string for a given URI
+ */
+ public String getPackageNameForNamespaceURI(String nsURI)
+ {
+ String packageStr = null;
+ for (int i = 0; packageStr == null && i < packageMappings.size(); i++)
+ {
+ PackageMapping mapping = (PackageMapping)packageMappings.get(i);
+ if (mapping.getNamespaceURI().equals(nsURI))
+ packageStr = mapping.getPackageType();
+ }
+ return packageStr;
+ }
+
+ /** Get the type mapping fo a given root-type-qname
+ */
+ public JavaXmlTypeMapping getTypeMappingForQName(QName xmlType)
+ {
+ JavaXmlTypeMapping typeMapping = null;
+
+ if (xmlType != null)
+ {
+ // Check the <root-type-qname>
+ Iterator it = javaXmlTypeMappings.iterator();
+ while (typeMapping == null && it.hasNext())
+ {
+ JavaXmlTypeMapping mapping = (JavaXmlTypeMapping)it.next();
+ if (xmlType.equals(mapping.getRootTypeQName()))
+ typeMapping = mapping;
+ }
+
+ // Check the <anonymous-type-qname>
+ it = javaXmlTypeMappings.iterator();
+ while (typeMapping == null && it.hasNext())
+ {
+ JavaXmlTypeMapping mapping = (JavaXmlTypeMapping)it.next();
+ QName anonymousQName = mapping.getAnonymousTypeQName();
+ if (anonymousQName != null)
+ {
+ if (xmlType.getNamespaceURI().equals(anonymousQName.getNamespaceURI()))
+ {
+ String localPart = xmlType.getLocalPart();
+ if (anonymousQName.getLocalPart().equals(localPart))
+ typeMapping = mapping;
+ if (anonymousQName.getLocalPart().equals(">" +
localPart))
+ typeMapping = mapping;
+ }
+ }
+ }
+
+ if (typeMapping == null)
+ log.warn("Cannot find jaxrpc-mapping for type: " + xmlType);
+ }
+
+ return typeMapping;
+ }
+
+ /** Get the exception mapping fo a given wsdl message
+ */
+ public ExceptionMapping getExceptionMappingForMessageQName(QName wsdlMessage)
+ {
+ ExceptionMapping exMapping = null;
+
+ if (wsdlMessage != null)
+ {
+ Iterator it = exceptionMappings.iterator();
+ while (it.hasNext())
+ {
+ ExceptionMapping mapping = (ExceptionMapping)it.next();
+ if (wsdlMessage.equals(mapping.getWsdlMessage()))
+ exMapping = mapping;
+ }
+ }
+
+ return exMapping;
+ }
+
+ /** Get the exception mapping fo a given exception type
+ */
+ public ExceptionMapping getExceptionMappingForExceptionType(String javaType)
+ {
+ ExceptionMapping exMapping = null;
+
+ if (javaType != null)
+ {
+ Iterator it = exceptionMappings.iterator();
+ while (it.hasNext())
+ {
+ ExceptionMapping mapping = (ExceptionMapping)it.next();
+ if (javaType.equals(mapping.getExceptionType()))
+ exMapping = mapping;
+ }
+ }
+
+ return exMapping;
+ }
+
+ /** Get the port type qname for a given service endpoint infterface
+ */
+ public QName getPortTypeQNameForServiceEndpointInterface(String seiName)
+ {
+ QName portTypeQName = null;
+
+ ServiceEndpointInterfaceMapping[] seiMappings =
getServiceEndpointInterfaceMappings();
+ for (int i = 0; i < seiMappings.length; i++)
+ {
+ ServiceEndpointInterfaceMapping aux = seiMappings[i];
+ if (aux.getServiceEndpointInterface().equals(seiName))
+ portTypeQName = aux.getWsdlPortType();
+ }
+
+ return portTypeQName;
+ }
+
+ /** Get the service endpoint infterfacemapping for a given port type qname
+ */
+ public ServiceEndpointInterfaceMapping
getServiceEndpointInterfaceMappingByPortType(QName portType)
+ {
+ ServiceEndpointInterfaceMapping seiMapping = null;
+
+ ServiceEndpointInterfaceMapping[] seiMappings =
getServiceEndpointInterfaceMappings();
+ for (int i = 0; seiMapping == null && i < seiMappings.length; i++)
+ {
+ ServiceEndpointInterfaceMapping aux = seiMappings[i];
+ if (aux.getWsdlPortType().equals(portType))
+ seiMapping = aux;
+ }
+
+ return seiMapping;
+ }
+
+ /** Get the service endpoint infterface mapping for a service endpoint infterface
+ */
+ public ServiceEndpointInterfaceMapping getServiceEndpointInterfaceMapping(String
seiName)
+ {
+ ServiceEndpointInterfaceMapping seiMapping = null;
+
+ ServiceEndpointInterfaceMapping[] seiMappings =
getServiceEndpointInterfaceMappings();
+ for (int i = 0; seiMapping == null && i < seiMappings.length; i++)
+ {
+ ServiceEndpointInterfaceMapping aux = seiMappings[i];
+ if (aux.getServiceEndpointInterface().equals(seiName))
+ seiMapping = aux;
+ }
+
+ return seiMapping;
+ }
+
+ /**
+ * Serialize the model as a String (Should return the mapping file)
+ *
+ * @return
+ */
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+ //Append Standard Namespace Header
+ sb.append("<java-wsdl-mapping version='1.1'
").append("xmlns='http://java.sun.com/xml/ns/j2ee' ");
+
sb.append("xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance&...
");
+
sb.append("xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee ");
+
sb.append("http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_...;
+
+ Iterator piter = packageMappings.iterator();
+ while (piter != null && piter.hasNext())
+ sb.append(((PackageMapping)piter.next()).serialize());
+
+ Iterator jxiter = javaXmlTypeMappings.iterator();
+ while (jxiter.hasNext())
+ sb.append(((JavaXmlTypeMapping)jxiter.next()).serialize());
+
+ for (Iterator i = exceptionMappings.iterator(); i.hasNext();)
+ sb.append(((ExceptionMapping)i.next()).serialize());
+
+ // A <service-interface-mapping> is followed by 1 or many
<service-endpoint-interface-mapping> elements
+ int lenSIM = serviceInterfaceMappings.size();
+ for (int i = 0; i < lenSIM; i++)
+ {
+ ServiceInterfaceMapping sim =
(ServiceInterfaceMapping)serviceInterfaceMappings.get(i);
+ sb.append(sim.serialize());
+ ServiceEndpointInterfaceMapping seim =
(ServiceEndpointInterfaceMapping)serviceEndpointInterfaceMappings.get(i);
+ sb.append(seim.serialize());
+ }
+
+ int lenSEI = serviceEndpointInterfaceMappings.size();
+ for (int i = lenSIM; i < lenSEI; i++)
+ {
+ ServiceEndpointInterfaceMapping seim =
(ServiceEndpointInterfaceMapping)serviceEndpointInterfaceMappings.get(i);
+ sb.append(seim.serialize());
+ }
+
+ sb.append("</java-wsdl-mapping>");
+
+ return sb.toString();
+ }
+
+ // factory methods
********************************************************************
+
+ public void addPackageMapping(PackageMapping packageMapping)
+ {
+ packageMappings.add(packageMapping);
+ }
+
+ public void addJavaXmlTypeMappings(JavaXmlTypeMapping typeMapping)
+ {
+ javaXmlTypeMappings.add(typeMapping);
+ }
+
+ public void addExceptionMappings(ExceptionMapping exceptionMapping)
+ {
+ exceptionMappings.add(exceptionMapping);
+ }
+
+ public void addServiceInterfaceMappings(ServiceInterfaceMapping
serviceInterfaceMapping)
+ {
+ serviceInterfaceMappings.add(serviceInterfaceMapping);
+ }
+
+ public void addServiceEndpointInterfaceMappings(ServiceEndpointInterfaceMapping
serviceEndpointInterfaceMapping)
+ {
+ serviceEndpointInterfaceMappings.add(serviceEndpointInterfaceMapping);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,578 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A JBossXB factory for {@link org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping}
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class JavaWsdlMappingFactory implements ObjectModelFactory
-{
- // provide logging
- private static Logger log = Logger.getLogger(JavaWsdlMappingFactory.class);
-
- // Hide constructor
- private JavaWsdlMappingFactory()
- {
- }
-
- /**
- * Create a new instance of a jaxrpc-mapping factory
- */
- public static JavaWsdlMappingFactory newInstance()
- {
- return new JavaWsdlMappingFactory();
- }
-
- /**
- * Factory method for JavaWsdlMapping
- */
- public JavaWsdlMapping parse(URL jaxrpcMappingFile) throws IOException
- {
- if (jaxrpcMappingFile == null)
- {
- throw new IllegalArgumentException("URL cannot be null");
- }
-
- // setup the XML binding Unmarshaller
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- InputStream is = jaxrpcMappingFile.openStream();
- try
- {
- JavaWsdlMapping javaWsdlMapping = (JavaWsdlMapping)unmarshaller.unmarshal(is,
this, null);
- return javaWsdlMapping;
- }
- catch (JBossXBException e)
- {
- IOException ioex = new IOException("Cannot parse: " +
jaxrpcMappingFile);
- Throwable cause = e.getCause();
- if (cause != null)
- ioex.initCause(cause);
- throw ioex;
- }
- finally
- {
- is.close();
- }
- }
-
- /**
- * This method is called on the factory by the object model builder when the parsing
starts.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- return new JavaWsdlMapping();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(JavaWsdlMapping javaWsdlMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("package-mapping".equals(localName))
- {
- return new PackageMapping(javaWsdlMapping);
- }
- if ("java-xml-type-mapping".equals(localName))
- {
- return new JavaXmlTypeMapping(javaWsdlMapping);
- }
- if ("exception-mapping".equals(localName))
- {
- return new ExceptionMapping(javaWsdlMapping);
- }
- if ("service-interface-mapping".equals(localName))
- {
- return new ServiceInterfaceMapping(javaWsdlMapping);
- }
- if ("service-endpoint-interface-mapping".equals(localName))
- {
- return new ServiceEndpointInterfaceMapping(javaWsdlMapping);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaWsdlMapping javaWsdlMapping, PackageMapping packageMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
packageMapping + "]");
- javaWsdlMapping.addPackageMapping(packageMapping);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaWsdlMapping javaWsdlMapping, JavaXmlTypeMapping typeMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
typeMapping + "]");
- javaWsdlMapping.addJavaXmlTypeMappings(typeMapping);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaWsdlMapping javaWsdlMapping, ExceptionMapping
exceptionMapping, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
exceptionMapping + "]");
- javaWsdlMapping.addExceptionMappings(exceptionMapping);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaWsdlMapping javaWsdlMapping, ServiceInterfaceMapping
siMapping, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
siMapping + "]");
- javaWsdlMapping.addServiceInterfaceMappings(siMapping);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaWsdlMapping javaWsdlMapping, ServiceEndpointInterfaceMapping
seiMapping, UnmarshallingContext navigator, String namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
seiMapping + "]");
- javaWsdlMapping.addServiceEndpointInterfaceMappings(seiMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(PackageMapping packageMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + packageMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("package-type".equals(localName))
- {
- packageMapping.setPackageType(value);
- }
- else if ("namespaceURI".equals(localName))
- {
- packageMapping.setNamespaceURI(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(JavaXmlTypeMapping typeMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("variable-mapping".equals(localName))
- {
- return new VariableMapping(typeMapping);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(JavaXmlTypeMapping typeMapping, VariableMapping variableMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + typeMapping + ",child=" +
variableMapping + "]");
- typeMapping.addVariableMapping(variableMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(JavaXmlTypeMapping typeMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + typeMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("java-type".equals(localName))
- {
- typeMapping.setJavaType(value);
- }
- else if ("root-type-qname".equals(localName))
- {
- QName qname = navigator.resolveQName(value);
- typeMapping.setRootTypeQName(qname);
- }
- else if ("anonymous-type-qname".equals(localName))
- {
- QName qname = null;
- try
- {
- // <anonymous-type-qname
xmlns:typeNS="http://org.jboss.ws/anonymous/types">typeNS:>root</anonymous-type-qname>
- qname = navigator.resolveQName(value);
- }
- catch (Exception e)
- {
- // ignore unresolved qname
- }
-
- if (qname == null)
- {
- //
<
anonymous-type-qname>http://example.com/stockquote/schemas:>Get...
- int index = value.lastIndexOf(':');
- if (index > 0)
- {
- String nsURI = value.substring(0, index);
- String localPart = value.substring(index + 1);
- qname = new QName(nsURI, localPart);
- }
- }
-
- if (qname == null)
- throw new IllegalArgumentException("Invalid anonymous qname: " +
value);
-
- typeMapping.setAnonymousTypeQName(qname);
- }
- else if ("qname-scope".equals(localName))
- {
- typeMapping.setQNameScope(value);
- }
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(ExceptionMapping exceptionMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + exceptionMapping + ",localName="
+ localName + ",value=" + value + "]");
- if ("exception-type".equals(localName))
- {
- exceptionMapping.setExceptionType(value);
- }
- else if ("wsdl-message".equals(localName))
- {
- exceptionMapping.setWsdlMessage(navigator.resolveQName(value));
- }
- else if ("constructor-parameter-order".equals(localName))
- {
- exceptionMapping.addConstructorParameter(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(ServiceInterfaceMapping siMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("port-mapping".equals(localName))
- {
- return new PortMapping(siMapping);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(ServiceInterfaceMapping siMapping, PortMapping portMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + siMapping + ",child=" +
portMapping + "]");
- siMapping.addPortMapping(portMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(ServiceInterfaceMapping siMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + siMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("service-interface".equals(localName))
- {
- siMapping.setServiceInterface(value);
- }
- else if ("wsdl-service-name".equals(localName))
- {
- siMapping.setWsdlServiceName(navigator.resolveQName(value));
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(ServiceEndpointInterfaceMapping seiMapping,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("service-endpoint-method-mapping".equals(localName))
- {
- return new ServiceEndpointMethodMapping(seiMapping);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(ServiceEndpointInterfaceMapping seiMapping,
ServiceEndpointMethodMapping seiMethodMapping, UnmarshallingContext navigator, String
namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + seiMapping + ",child=" +
seiMapping + "]");
- seiMapping.addServiceEndpointMethodMapping(seiMethodMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(ServiceEndpointInterfaceMapping seiMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + seiMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("service-endpoint-interface".equals(localName))
- {
- seiMapping.setServiceEndpointInterface(value);
- }
- else if ("wsdl-port-type".equals(localName))
- {
- seiMapping.setWsdlPortType(navigator.resolveQName(value));
- }
- else if ("wsdl-binding".equals(localName))
- {
- seiMapping.setWsdlBinding(navigator.resolveQName(value));
- }
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(VariableMapping variableMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + variableMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("java-variable-name".equals(localName))
- {
- variableMapping.setJavaVariableName(value);
- }
- else if ("data-member".equals(localName))
- {
- variableMapping.setDataMember(true);
- }
- else if ("xml-attribute-name".equals(localName))
- {
- variableMapping.setXmlAttributeName(value);
- }
- else if ("xml-element-name".equals(localName))
- {
- variableMapping.setXmlElementName(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(VariableMapping variableMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("data-member".equals(localName))
- {
- variableMapping.setDataMember(true);
- }
- else if ("xml-wildcard".equals(localName))
- {
- variableMapping.setXmlWildcard(true);
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(PortMapping portMapping, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + portMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("port-name".equals(localName))
- {
- portMapping.setPortName(value);
- }
- else if ("java-port-name".equals(localName))
- {
- portMapping.setJavaPortName(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(ServiceEndpointMethodMapping methodMapping,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("method-param-parts-mapping".equals(localName))
- {
- return new MethodParamPartsMapping(methodMapping);
- }
- if ("wsdl-return-value-mapping".equals(localName))
- {
- return new WsdlReturnValueMapping(methodMapping);
- }
- if ("wrapped-element".equals(localName))
- {
- methodMapping.setWrappedElement(true);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(ServiceEndpointMethodMapping methodMapping,
MethodParamPartsMapping partsMapping, UnmarshallingContext navigator, String
namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + methodMapping + ",child=" +
partsMapping + "]");
- methodMapping.addMethodParamPartsMapping(partsMapping);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(ServiceEndpointMethodMapping methodMapping,
WsdlReturnValueMapping returnValueMapping, UnmarshallingContext navigator, String
namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + methodMapping + ",child=" +
returnValueMapping + "]");
- methodMapping.setWsdlReturnValueMapping(returnValueMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(ServiceEndpointMethodMapping methodMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + methodMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("java-method-name".equals(localName))
- {
- methodMapping.setJavaMethodName(value);
- }
- else if ("wsdl-operation".equals(localName))
- {
- methodMapping.setWsdlOperation(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(MethodParamPartsMapping partsMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("wsdl-message-mapping".equals(localName))
- {
- return new WsdlMessageMapping(partsMapping);
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(MethodParamPartsMapping partsMapping, WsdlMessageMapping
msgMapping, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + partsMapping + ",child=" +
msgMapping + "]");
- partsMapping.setWsdlMessageMapping(msgMapping);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(MethodParamPartsMapping partsMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + partsMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("param-position".equals(localName))
- {
- partsMapping.setParamPosition(new Integer(value).intValue());
- }
- else if ("param-type".equals(localName))
- {
- partsMapping.setParamType(value);
- }
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(WsdlReturnValueMapping retValueMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + retValueMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("method-return-value".equals(localName))
- {
- retValueMapping.setMethodReturnValue(value);
- }
- else if ("wsdl-message".equals(localName))
- {
- retValueMapping.setWsdlMessage(navigator.resolveQName(value));
- }
- else if ("wsdl-message-part-name".equals(localName))
- {
- retValueMapping.setWsdlMessagePartName(value);
- }
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(WsdlMessageMapping msgMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + msgMapping + ",localName=" +
localName + ",value=" + value + "]");
- if ("wsdl-message".equals(localName))
- {
- msgMapping.setWsdlMessage(navigator.resolveQName(value));
- }
- else if ("wsdl-message-part-name".equals(localName))
- {
- msgMapping.setWsdlMessagePartName(value);
- }
- else if ("parameter-mode".equals(localName))
- {
- msgMapping.setParameterMode(value);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WsdlMessageMapping msgMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("soap-header".equals(localName))
- {
- msgMapping.setSoapHeader(true);
- }
- return null;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,578 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A JBossXB factory for {@link
org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping}
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class JavaWsdlMappingFactory implements ObjectModelFactory
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(JavaWsdlMappingFactory.class);
+
+ // Hide constructor
+ private JavaWsdlMappingFactory()
+ {
+ }
+
+ /**
+ * Create a new instance of a jaxrpc-mapping factory
+ */
+ public static JavaWsdlMappingFactory newInstance()
+ {
+ return new JavaWsdlMappingFactory();
+ }
+
+ /**
+ * Factory method for JavaWsdlMapping
+ */
+ public JavaWsdlMapping parse(URL jaxrpcMappingFile) throws IOException
+ {
+ if (jaxrpcMappingFile == null)
+ {
+ throw new IllegalArgumentException("URL cannot be null");
+ }
+
+ // setup the XML binding Unmarshaller
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ InputStream is = jaxrpcMappingFile.openStream();
+ try
+ {
+ JavaWsdlMapping javaWsdlMapping = (JavaWsdlMapping)unmarshaller.unmarshal(is,
this, null);
+ return javaWsdlMapping;
+ }
+ catch (JBossXBException e)
+ {
+ IOException ioex = new IOException("Cannot parse: " +
jaxrpcMappingFile);
+ Throwable cause = e.getCause();
+ if (cause != null)
+ ioex.initCause(cause);
+ throw ioex;
+ }
+ finally
+ {
+ is.close();
+ }
+ }
+
+ /**
+ * This method is called on the factory by the object model builder when the parsing
starts.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ return new JavaWsdlMapping();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
+ {
+ return root;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(JavaWsdlMapping javaWsdlMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("package-mapping".equals(localName))
+ {
+ return new PackageMapping(javaWsdlMapping);
+ }
+ if ("java-xml-type-mapping".equals(localName))
+ {
+ return new JavaXmlTypeMapping(javaWsdlMapping);
+ }
+ if ("exception-mapping".equals(localName))
+ {
+ return new ExceptionMapping(javaWsdlMapping);
+ }
+ if ("service-interface-mapping".equals(localName))
+ {
+ return new ServiceInterfaceMapping(javaWsdlMapping);
+ }
+ if ("service-endpoint-interface-mapping".equals(localName))
+ {
+ return new ServiceEndpointInterfaceMapping(javaWsdlMapping);
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(JavaWsdlMapping javaWsdlMapping, PackageMapping packageMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
packageMapping + "]");
+ javaWsdlMapping.addPackageMapping(packageMapping);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(JavaWsdlMapping javaWsdlMapping, JavaXmlTypeMapping typeMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
typeMapping + "]");
+ javaWsdlMapping.addJavaXmlTypeMappings(typeMapping);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(JavaWsdlMapping javaWsdlMapping, ExceptionMapping
exceptionMapping, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
exceptionMapping + "]");
+ javaWsdlMapping.addExceptionMappings(exceptionMapping);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(JavaWsdlMapping javaWsdlMapping, ServiceInterfaceMapping
siMapping, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
siMapping + "]");
+ javaWsdlMapping.addServiceInterfaceMappings(siMapping);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(JavaWsdlMapping javaWsdlMapping, ServiceEndpointInterfaceMapping
seiMapping, UnmarshallingContext navigator, String namespaceURI,
+ String localName)
+ {
+ log.trace("addChild: [obj=" + javaWsdlMapping + ",child=" +
seiMapping + "]");
+ javaWsdlMapping.addServiceEndpointInterfaceMappings(seiMapping);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(PackageMapping packageMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + packageMapping + ",localName=" +
localName + ",value=" + value + "]");
+ if ("package-type".equals(localName))
+ {
+ packageMapping.setPackageType(value);
+ }
+ else if ("namespaceURI".equals(localName))
+ {
+ packageMapping.setNamespaceURI(value);
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(JavaXmlTypeMapping typeMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("variable-mapping".equals(localName))
+ {
+ return new VariableMapping(typeMapping);
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(JavaXmlTypeMapping typeMapping, VariableMapping variableMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + typeMapping + ",child=" +
variableMapping + "]");
+ typeMapping.addVariableMapping(variableMapping);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(JavaXmlTypeMapping typeMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + typeMapping + ",localName=" +
localName + ",value=" + value + "]");
+ if ("java-type".equals(localName))
+ {
+ typeMapping.setJavaType(value);
+ }
+ else if ("root-type-qname".equals(localName))
+ {
+ QName qname = navigator.resolveQName(value);
+ typeMapping.setRootTypeQName(qname);
+ }
+ else if ("anonymous-type-qname".equals(localName))
+ {
+ QName qname = null;
+ try
+ {
+ // <anonymous-type-qname
xmlns:typeNS="http://org.jboss.ws/anonymous/types">typeNS:>root</anonymous-type-qname>
+ qname = navigator.resolveQName(value);
+ }
+ catch (Exception e)
+ {
+ // ignore unresolved qname
+ }
+
+ if (qname == null)
+ {
+ //
<
anonymous-type-qname>http://example.com/stockquote/schemas:>Get...
+ int index = value.lastIndexOf(':');
+ if (index > 0)
+ {
+ String nsURI = value.substring(0, index);
+ String localPart = value.substring(index + 1);
+ qname = new QName(nsURI, localPart);
+ }
+ }
+
+ if (qname == null)
+ throw new IllegalArgumentException("Invalid anonymous qname: " +
value);
+
+ typeMapping.setAnonymousTypeQName(qname);
+ }
+ else if ("qname-scope".equals(localName))
+ {
+ typeMapping.setQNameScope(value);
+ }
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(ExceptionMapping exceptionMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + exceptionMapping + ",localName="
+ localName + ",value=" + value + "]");
+ if ("exception-type".equals(localName))
+ {
+ exceptionMapping.setExceptionType(value);
+ }
+ else if ("wsdl-message".equals(localName))
+ {
+ exceptionMapping.setWsdlMessage(navigator.resolveQName(value));
+ }
+ else if ("constructor-parameter-order".equals(localName))
+ {
+ exceptionMapping.addConstructorParameter(value);
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(ServiceInterfaceMapping siMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("port-mapping".equals(localName))
+ {
+ return new PortMapping(siMapping);
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(ServiceInterfaceMapping siMapping, PortMapping portMapping,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + siMapping + ",child=" +
portMapping + "]");
+ siMapping.addPortMapping(portMapping);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(ServiceInterfaceMapping siMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + siMapping + ",localName=" +
localName + ",value=" + value + "]");
+ if ("service-interface".equals(localName))
+ {
+ siMapping.setServiceInterface(value);
+ }
+ else if ("wsdl-service-name".equals(localName))
+ {
+ siMapping.setWsdlServiceName(navigator.resolveQName(value));
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(ServiceEndpointInterfaceMapping seiMapping,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("service-endpoint-method-mapping".equals(localName))
+ {
+ return new ServiceEndpointMethodMapping(seiMapping);
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(ServiceEndpointInterfaceMapping seiMapping,
ServiceEndpointMethodMapping seiMethodMapping, UnmarshallingContext navigator, String
namespaceURI,
+ String localName)
+ {
+ log.trace("addChild: [obj=" + seiMapping + ",child=" +
seiMapping + "]");
+ seiMapping.addServiceEndpointMethodMapping(seiMethodMapping);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(ServiceEndpointInterfaceMapping seiMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + seiMapping + ",localName=" +
localName + ",value=" + value + "]");
+ if ("service-endpoint-interface".equals(localName))
+ {
+ seiMapping.setServiceEndpointInterface(value);
+ }
+ else if ("wsdl-port-type".equals(localName))
+ {
+ seiMapping.setWsdlPortType(navigator.resolveQName(value));
+ }
+ else if ("wsdl-binding".equals(localName))
+ {
+ seiMapping.setWsdlBinding(navigator.resolveQName(value));
+ }
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(VariableMapping variableMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + variableMapping + ",localName=" +
localName + ",value=" + value + "]");
+ if ("java-variable-name".equals(localName))
+ {
+ variableMapping.setJavaVariableName(value);
+ }
+ else if ("data-member".equals(localName))
+ {
+ variableMapping.setDataMember(true);
+ }
+ else if ("xml-attribute-name".equals(localName))
+ {
+ variableMapping.setXmlAttributeName(value);
+ }
+ else if ("xml-element-name".equals(localName))
+ {
+ variableMapping.setXmlElementName(value);
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(VariableMapping variableMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("data-member".equals(localName))
+ {
+ variableMapping.setDataMember(true);
+ }
+ else if ("xml-wildcard".equals(localName))
+ {
+ variableMapping.setXmlWildcard(true);
+ }
+ return null;
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(PortMapping portMapping, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + portMapping + ",localName=" +
localName + ",value=" + value + "]");
+ if ("port-name".equals(localName))
+ {
+ portMapping.setPortName(value);
+ }
+ else if ("java-port-name".equals(localName))
+ {
+ portMapping.setJavaPortName(value);
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(ServiceEndpointMethodMapping methodMapping,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("method-param-parts-mapping".equals(localName))
+ {
+ return new MethodParamPartsMapping(methodMapping);
+ }
+ if ("wsdl-return-value-mapping".equals(localName))
+ {
+ return new WsdlReturnValueMapping(methodMapping);
+ }
+ if ("wrapped-element".equals(localName))
+ {
+ methodMapping.setWrappedElement(true);
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(ServiceEndpointMethodMapping methodMapping,
MethodParamPartsMapping partsMapping, UnmarshallingContext navigator, String
namespaceURI,
+ String localName)
+ {
+ log.trace("addChild: [obj=" + methodMapping + ",child=" +
partsMapping + "]");
+ methodMapping.addMethodParamPartsMapping(partsMapping);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(ServiceEndpointMethodMapping methodMapping,
WsdlReturnValueMapping returnValueMapping, UnmarshallingContext navigator, String
namespaceURI,
+ String localName)
+ {
+ log.trace("addChild: [obj=" + methodMapping + ",child=" +
returnValueMapping + "]");
+ methodMapping.setWsdlReturnValueMapping(returnValueMapping);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(ServiceEndpointMethodMapping methodMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + methodMapping + ",localName=" +
localName + ",value=" + value + "]");
+ if ("java-method-name".equals(localName))
+ {
+ methodMapping.setJavaMethodName(value);
+ }
+ else if ("wsdl-operation".equals(localName))
+ {
+ methodMapping.setWsdlOperation(value);
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(MethodParamPartsMapping partsMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("wsdl-message-mapping".equals(localName))
+ {
+ return new WsdlMessageMapping(partsMapping);
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(MethodParamPartsMapping partsMapping, WsdlMessageMapping
msgMapping, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + partsMapping + ",child=" +
msgMapping + "]");
+ partsMapping.setWsdlMessageMapping(msgMapping);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(MethodParamPartsMapping partsMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + partsMapping + ",localName=" +
localName + ",value=" + value + "]");
+ if ("param-position".equals(localName))
+ {
+ partsMapping.setParamPosition(new Integer(value).intValue());
+ }
+ else if ("param-type".equals(localName))
+ {
+ partsMapping.setParamType(value);
+ }
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(WsdlReturnValueMapping retValueMapping, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + retValueMapping + ",localName=" +
localName + ",value=" + value + "]");
+ if ("method-return-value".equals(localName))
+ {
+ retValueMapping.setMethodReturnValue(value);
+ }
+ else if ("wsdl-message".equals(localName))
+ {
+ retValueMapping.setWsdlMessage(navigator.resolveQName(value));
+ }
+ else if ("wsdl-message-part-name".equals(localName))
+ {
+ retValueMapping.setWsdlMessagePartName(value);
+ }
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(WsdlMessageMapping msgMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + msgMapping + ",localName=" +
localName + ",value=" + value + "]");
+ if ("wsdl-message".equals(localName))
+ {
+ msgMapping.setWsdlMessage(navigator.resolveQName(value));
+ }
+ else if ("wsdl-message-part-name".equals(localName))
+ {
+ msgMapping.setWsdlMessagePartName(value);
+ }
+ else if ("parameter-mode".equals(localName))
+ {
+ msgMapping.setParameterMode(value);
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WsdlMessageMapping msgMapping, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("soap-header".equals(localName))
+ {
+ msgMapping.setSoapHeader(true);
+ }
+ return null;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaXmlTypeMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaXmlTypeMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaXmlTypeMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,158 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-
-/**
- * XML mapping of the java-wsdl-mapping/java-xml-type-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class JavaXmlTypeMapping implements Serializable
-{
- private static final long serialVersionUID = -7671078579082015103L;
-
- // The parent <java-wsdl-mapping> element
- private JavaWsdlMapping javaWsdlMapping;
-
- /** The required <java-type> element
- * The java-type element is the fully qualified class name of a Java class.
- */
- private String javaType;
- // The choice <root-type-qname> element
- private QName rootTypeQName;
- // The choice <anonymous-type-qname> element
- private QName anonymousTypeQName;
-
- /** The required <qname-scope> element
- * The qname-scope elements scopes the reference of a QName to the WSDL element type
it applies to.
- * The value of qname-scope may be simpleType, complexType, or element
- */
- private String qnameScope;
-
- // Zero or more <variable-mapping> elements
- private ArrayList variableMappings = new ArrayList();
-
- public JavaXmlTypeMapping(JavaWsdlMapping javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public String getJavaType()
- {
- return javaType;
- }
-
- public void setJavaType(String javaType)
- {
- this.javaType = javaType;
- }
-
- public String getQnameScope()
- {
- return qnameScope;
- }
-
- public void setQNameScope(String qnameScope)
- {
- this.qnameScope = qnameScope;
- }
-
- public QName getRootTypeQName()
- {
- return rootTypeQName;
- }
-
- public void setRootTypeQName(QName rootTypeQName)
- {
- this.rootTypeQName = rootTypeQName;
- }
-
- public QName getAnonymousTypeQName()
- {
- return anonymousTypeQName;
- }
-
- public void setAnonymousTypeQName(QName anonymousTypeQName)
- {
- this.anonymousTypeQName = anonymousTypeQName;
- }
-
- public VariableMapping[] getVariableMappings()
- {
- VariableMapping[] arr = new VariableMapping[variableMappings.size()];
- variableMappings.toArray(arr);
- return arr;
- }
-
- public void addVariableMapping(VariableMapping variableMapping)
- {
- variableMappings.add(variableMapping);
- }
-
- public String toString()
- {
- return "[qname=" + rootTypeQName + ",javaType=" + javaType +
",scope=" + qnameScope + "]";
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- sb.append("<java-xml-type-mapping>");
-
sb.append("<java-type>").append(javaType).append("</java-type>");
-
- if (rootTypeQName != null)
- {
- sb.append("<root-type-qname
xmlns:typeNS='").append(rootTypeQName.getNamespaceURI()).append("'>");
-
sb.append(rootTypeQName.getPrefix()).append(":").append(rootTypeQName.getLocalPart());
- sb.append("</root-type-qname>");
- }
-
- if (anonymousTypeQName != null)
- {
- sb.append("<anonymous-type-qname
xmlns:typeNS='").append(anonymousTypeQName.getNamespaceURI()).append("'>");
-
sb.append(anonymousTypeQName.getPrefix()).append(":").append(anonymousTypeQName.getLocalPart());
- sb.append("</anonymous-type-qname>");
- }
-
-
sb.append("<qname-scope>").append(qnameScope).append("</qname-scope>");
-
- int len = variableMappings.size();
- for(int i = 0 ; i < len ; i ++)
- sb.append(((VariableMapping)variableMappings.get(i)).serialize());
-
- sb.append("</java-xml-type-mapping>");
- return sb.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaXmlTypeMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaXmlTypeMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaXmlTypeMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/JavaXmlTypeMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,158 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+
+/**
+ * XML mapping of the java-wsdl-mapping/java-xml-type-mapping element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class JavaXmlTypeMapping implements Serializable
+{
+ private static final long serialVersionUID = -7671078579082015103L;
+
+ // The parent <java-wsdl-mapping> element
+ private JavaWsdlMapping javaWsdlMapping;
+
+ /** The required <java-type> element
+ * The java-type element is the fully qualified class name of a Java class.
+ */
+ private String javaType;
+ // The choice <root-type-qname> element
+ private QName rootTypeQName;
+ // The choice <anonymous-type-qname> element
+ private QName anonymousTypeQName;
+
+ /** The required <qname-scope> element
+ * The qname-scope elements scopes the reference of a QName to the WSDL element type
it applies to.
+ * The value of qname-scope may be simpleType, complexType, or element
+ */
+ private String qnameScope;
+
+ // Zero or more <variable-mapping> elements
+ private ArrayList variableMappings = new ArrayList();
+
+ public JavaXmlTypeMapping(JavaWsdlMapping javaWsdlMapping)
+ {
+ this.javaWsdlMapping = javaWsdlMapping;
+ }
+
+ public JavaWsdlMapping getJavaWsdlMapping()
+ {
+ return javaWsdlMapping;
+ }
+
+ public String getJavaType()
+ {
+ return javaType;
+ }
+
+ public void setJavaType(String javaType)
+ {
+ this.javaType = javaType;
+ }
+
+ public String getQnameScope()
+ {
+ return qnameScope;
+ }
+
+ public void setQNameScope(String qnameScope)
+ {
+ this.qnameScope = qnameScope;
+ }
+
+ public QName getRootTypeQName()
+ {
+ return rootTypeQName;
+ }
+
+ public void setRootTypeQName(QName rootTypeQName)
+ {
+ this.rootTypeQName = rootTypeQName;
+ }
+
+ public QName getAnonymousTypeQName()
+ {
+ return anonymousTypeQName;
+ }
+
+ public void setAnonymousTypeQName(QName anonymousTypeQName)
+ {
+ this.anonymousTypeQName = anonymousTypeQName;
+ }
+
+ public VariableMapping[] getVariableMappings()
+ {
+ VariableMapping[] arr = new VariableMapping[variableMappings.size()];
+ variableMappings.toArray(arr);
+ return arr;
+ }
+
+ public void addVariableMapping(VariableMapping variableMapping)
+ {
+ variableMappings.add(variableMapping);
+ }
+
+ public String toString()
+ {
+ return "[qname=" + rootTypeQName + ",javaType=" + javaType +
",scope=" + qnameScope + "]";
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<java-xml-type-mapping>");
+
sb.append("<java-type>").append(javaType).append("</java-type>");
+
+ if (rootTypeQName != null)
+ {
+ sb.append("<root-type-qname
xmlns:typeNS='").append(rootTypeQName.getNamespaceURI()).append("'>");
+
sb.append(rootTypeQName.getPrefix()).append(":").append(rootTypeQName.getLocalPart());
+ sb.append("</root-type-qname>");
+ }
+
+ if (anonymousTypeQName != null)
+ {
+ sb.append("<anonymous-type-qname
xmlns:typeNS='").append(anonymousTypeQName.getNamespaceURI()).append("'>");
+
sb.append(anonymousTypeQName.getPrefix()).append(":").append(anonymousTypeQName.getLocalPart());
+ sb.append("</anonymous-type-qname>");
+ }
+
+
sb.append("<qname-scope>").append(qnameScope).append("</qname-scope>");
+
+ int len = variableMappings.size();
+ for(int i = 0 ; i < len ; i ++)
+ sb.append(((VariableMapping)variableMappings.get(i)).serialize());
+
+ sb.append("</java-xml-type-mapping>");
+ return sb.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/MethodParamPartsMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/MethodParamPartsMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,100 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * XML mapping of the
java-wsdl-mapping/service-endpoint-interface-mapping/service-endpoint-method-mapping/method-param-parts-mapping
element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class MethodParamPartsMapping implements Serializable
-{
- private static final long serialVersionUID = -1351920471783503813L;
-
- // The parent <service-endpoint-method-mapping> element
- private ServiceEndpointMethodMapping serviceEndpointMethodMapping;
-
- // The required <param-position> element
- private int paramPosition;
- // The required <param-type> element
- private String paramType;
- // The required <wsdl-message-mapping> element
- private WsdlMessageMapping wsdlMessageMapping;
-
- public MethodParamPartsMapping(ServiceEndpointMethodMapping
serviceEndpointMethodMapping)
- {
- this.serviceEndpointMethodMapping = serviceEndpointMethodMapping;
- }
-
- public ServiceEndpointMethodMapping getServiceEndpointMethodMapping()
- {
- return serviceEndpointMethodMapping;
- }
-
- public int getParamPosition()
- {
- return paramPosition;
- }
-
- public void setParamPosition(int paramPosition)
- {
- this.paramPosition = paramPosition;
- }
-
- public String getParamType()
- {
- return paramType;
- }
-
- public void setParamType(String paramType)
- {
- this.paramType = paramType;
- }
-
- public WsdlMessageMapping getWsdlMessageMapping()
- {
- return wsdlMessageMapping;
- }
-
- public void setWsdlMessageMapping(WsdlMessageMapping wsdlMessageMapping)
- {
- this.wsdlMessageMapping = wsdlMessageMapping;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<method-param-parts-mapping><param-position>").append(paramPosition).append("</param-position>");
-
sb.append("<param-type>").append(paramType).append("</param-type>");
- if(wsdlMessageMapping == null)
- throw new IllegalStateException("wsdlMessageMapping is null");
- sb.append(wsdlMessageMapping.serialize());
-
- sb.append("</method-param-parts-mapping>");
- return sb.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/MethodParamPartsMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/MethodParamPartsMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,100 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+import java.io.Serializable;
+
+// $Id$
+
+/**
+ * XML mapping of the
java-wsdl-mapping/service-endpoint-interface-mapping/service-endpoint-method-mapping/method-param-parts-mapping
element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class MethodParamPartsMapping implements Serializable
+{
+ private static final long serialVersionUID = -1351920471783503813L;
+
+ // The parent <service-endpoint-method-mapping> element
+ private ServiceEndpointMethodMapping serviceEndpointMethodMapping;
+
+ // The required <param-position> element
+ private int paramPosition;
+ // The required <param-type> element
+ private String paramType;
+ // The required <wsdl-message-mapping> element
+ private WsdlMessageMapping wsdlMessageMapping;
+
+ public MethodParamPartsMapping(ServiceEndpointMethodMapping
serviceEndpointMethodMapping)
+ {
+ this.serviceEndpointMethodMapping = serviceEndpointMethodMapping;
+ }
+
+ public ServiceEndpointMethodMapping getServiceEndpointMethodMapping()
+ {
+ return serviceEndpointMethodMapping;
+ }
+
+ public int getParamPosition()
+ {
+ return paramPosition;
+ }
+
+ public void setParamPosition(int paramPosition)
+ {
+ this.paramPosition = paramPosition;
+ }
+
+ public String getParamType()
+ {
+ return paramType;
+ }
+
+ public void setParamType(String paramType)
+ {
+ this.paramType = paramType;
+ }
+
+ public WsdlMessageMapping getWsdlMessageMapping()
+ {
+ return wsdlMessageMapping;
+ }
+
+ public void setWsdlMessageMapping(WsdlMessageMapping wsdlMessageMapping)
+ {
+ this.wsdlMessageMapping = wsdlMessageMapping;
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+
sb.append("<method-param-parts-mapping><param-position>").append(paramPosition).append("</param-position>");
+
sb.append("<param-type>").append(paramType).append("</param-type>");
+ if(wsdlMessageMapping == null)
+ throw new IllegalStateException("wsdlMessageMapping is null");
+ sb.append(wsdlMessageMapping.serialize());
+
+ sb.append("</method-param-parts-mapping>");
+ return sb.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PackageMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PackageMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PackageMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,88 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * XML mapping of the java-wsdl-mapping/package-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class PackageMapping implements Serializable
-{
- private static final long serialVersionUID = 8105452343429986503L;
-
- // The parent <java-wsdl-mapping> element
- private JavaWsdlMapping javaWsdlMapping;
-
- // The required <package-type> element
- private String packageType;
- // The required <namespaceURI> element
- private String namespaceURI;
-
- public PackageMapping(JavaWsdlMapping javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public String getNamespaceURI()
- {
- return namespaceURI;
- }
-
- public void setNamespaceURI(String namespaceURI)
- {
- this.namespaceURI = namespaceURI;
- }
-
- public String getPackageType()
- {
- return packageType;
- }
-
- public void setPackageType(String packageType)
- {
- this.packageType = packageType;
- }
-
- public String toString()
- {
- return "[namespaceURI=" + namespaceURI + ",packageType=" +
packageType + "]";
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<package-mapping>").append("<package-type>").append(packageType).append("</package-type>");
-
sb.append("<namespaceURI>").append(namespaceURI).append("</namespaceURI>").append("</package-mapping>");
- return sb.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PackageMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PackageMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PackageMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PackageMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,88 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+import java.io.Serializable;
+
+// $Id$
+
+/**
+ * XML mapping of the java-wsdl-mapping/package-mapping element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class PackageMapping implements Serializable
+{
+ private static final long serialVersionUID = 8105452343429986503L;
+
+ // The parent <java-wsdl-mapping> element
+ private JavaWsdlMapping javaWsdlMapping;
+
+ // The required <package-type> element
+ private String packageType;
+ // The required <namespaceURI> element
+ private String namespaceURI;
+
+ public PackageMapping(JavaWsdlMapping javaWsdlMapping)
+ {
+ this.javaWsdlMapping = javaWsdlMapping;
+ }
+
+ public JavaWsdlMapping getJavaWsdlMapping()
+ {
+ return javaWsdlMapping;
+ }
+
+ public String getNamespaceURI()
+ {
+ return namespaceURI;
+ }
+
+ public void setNamespaceURI(String namespaceURI)
+ {
+ this.namespaceURI = namespaceURI;
+ }
+
+ public String getPackageType()
+ {
+ return packageType;
+ }
+
+ public void setPackageType(String packageType)
+ {
+ this.packageType = packageType;
+ }
+
+ public String toString()
+ {
+ return "[namespaceURI=" + namespaceURI + ",packageType=" +
packageType + "]";
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+
sb.append("<package-mapping>").append("<package-type>").append(packageType).append("</package-type>");
+
sb.append("<namespaceURI>").append(namespaceURI).append("</namespaceURI>").append("</package-mapping>");
+ return sb.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PortMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PortMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PortMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,84 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * XML mapping of the java-wsdl-mapping/service-interface-mapping/port-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class PortMapping implements Serializable
-{
- private static final long serialVersionUID = 8229257516720800393L;
-
- // The parent <service-interface-mapping> element
- private ServiceInterfaceMapping serviceInterfaceMapping;
-
- // The required <port-name> element
- private String portName;
- // The required <java-port-name> element
- private String javaPortName;
-
- public PortMapping(ServiceInterfaceMapping serviceInterfaceMapping)
- {
- this.serviceInterfaceMapping = serviceInterfaceMapping;
- }
-
- public ServiceInterfaceMapping getServiceInterfaceMapping()
- {
- return serviceInterfaceMapping;
- }
-
- public String getJavaPortName()
- {
- return javaPortName;
- }
-
- public void setJavaPortName(String javaPortName)
- {
- this.javaPortName = javaPortName;
- }
-
- public String getPortName()
- {
- return portName;
- }
-
- public void setPortName(String portName)
- {
- this.portName = portName;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<port-mapping><port-name>").append(portName).append("</port-name><java-port-name>");
-
sb.append(javaPortName).append("</java-port-name></port-mapping>");
- return sb.toString();
- }
-}
-
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PortMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PortMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/PortMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/PortMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,84 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+import java.io.Serializable;
+
+// $Id$
+
+/**
+ * XML mapping of the java-wsdl-mapping/service-interface-mapping/port-mapping element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class PortMapping implements Serializable
+{
+ private static final long serialVersionUID = 8229257516720800393L;
+
+ // The parent <service-interface-mapping> element
+ private ServiceInterfaceMapping serviceInterfaceMapping;
+
+ // The required <port-name> element
+ private String portName;
+ // The required <java-port-name> element
+ private String javaPortName;
+
+ public PortMapping(ServiceInterfaceMapping serviceInterfaceMapping)
+ {
+ this.serviceInterfaceMapping = serviceInterfaceMapping;
+ }
+
+ public ServiceInterfaceMapping getServiceInterfaceMapping()
+ {
+ return serviceInterfaceMapping;
+ }
+
+ public String getJavaPortName()
+ {
+ return javaPortName;
+ }
+
+ public void setJavaPortName(String javaPortName)
+ {
+ this.javaPortName = javaPortName;
+ }
+
+ public String getPortName()
+ {
+ return portName;
+ }
+
+ public void setPortName(String portName)
+ {
+ this.portName = portName;
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+
sb.append("<port-mapping><port-name>").append(portName).append("</port-name><java-port-name>");
+
sb.append(javaPortName).append("</java-port-name></port-mapping>");
+ return sb.toString();
+ }
+}
+
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,140 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * XML mapping of the java-wsdl-mapping/service-endpoint-interface-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class ServiceEndpointInterfaceMapping implements Serializable
-{
- private static final long serialVersionUID = 3336973427288868587L;
-
- // The parent <java-wsdl-mapping> element
- private JavaWsdlMapping javaWsdlMapping;
-
- // The required <service-endpoint-interface> element
- private String serviceEndpointInterface;
- // The required <wsdl-port-type> element
- private QName wsdlPortType;
- // The required <wsdl-binding> element
- private QName wsdlBinding;
- // Zero or more <service-endpoint-method-mapping> elements
- private List serviceEndpointMethodMappings = new ArrayList();
-
- public ServiceEndpointInterfaceMapping(JavaWsdlMapping javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public String getServiceEndpointInterface()
- {
- return serviceEndpointInterface;
- }
-
- public void setServiceEndpointInterface(String serviceEndpointInterface)
- {
- this.serviceEndpointInterface = serviceEndpointInterface;
- }
-
- public QName getWsdlPortType()
- {
- return wsdlPortType;
- }
-
- public void setWsdlPortType(QName wsdlPortType)
- {
- this.wsdlPortType = wsdlPortType;
- }
-
- public QName getWsdlBinding()
- {
- return wsdlBinding;
- }
-
- public void setWsdlBinding(QName wsdlBinding)
- {
- this.wsdlBinding = wsdlBinding;
- }
-
- public ServiceEndpointMethodMapping[] getServiceEndpointMethodMappings()
- {
- ServiceEndpointMethodMapping[] arr = new
ServiceEndpointMethodMapping[serviceEndpointMethodMappings.size()];
- serviceEndpointMethodMappings.toArray(arr);
- return arr;
- }
-
- public void addServiceEndpointMethodMapping(ServiceEndpointMethodMapping
serviceEndpointMethodMapping)
- {
- serviceEndpointMethodMappings.add(serviceEndpointMethodMapping);
- }
-
- public ServiceEndpointMethodMapping
getServiceEndpointMethodMappingByWsdlOperation(String wsdlOperation)
- {
- ServiceEndpointMethodMapping semMapping = null;
-
- Iterator it = serviceEndpointMethodMappings.iterator();
- while (it.hasNext())
- {
- ServiceEndpointMethodMapping aux = (ServiceEndpointMethodMapping)it.next();
- if (aux.getWsdlOperation().equals(wsdlOperation))
- semMapping = aux;
- }
- return semMapping;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<service-endpoint-interface-mapping><service-endpoint-interface>");
-
sb.append(this.serviceEndpointInterface).append("</service-endpoint-interface>");
- sb.append("<wsdl-port-type
xmlns:").append(wsdlPortType.getPrefix()).append("='");
-
sb.append(wsdlPortType.getNamespaceURI()).append("'>").append(wsdlPortType.getPrefix());
-
sb.append(":").append(wsdlPortType.getLocalPart()).append("</wsdl-port-type>");
-
- sb.append("<wsdl-binding
xmlns:").append(wsdlBinding.getPrefix()).append("='");
-
sb.append(wsdlBinding.getNamespaceURI()).append("'>").append(wsdlBinding.getPrefix());
-
sb.append(":").append(wsdlBinding.getLocalPart()).append("</wsdl-binding>");
-
- Iterator iter = serviceEndpointMethodMappings.iterator();
- while(iter != null && iter.hasNext())
- sb.append(((ServiceEndpointMethodMapping)iter.next()).serialize());
- sb.append("</service-endpoint-interface-mapping>");
- return sb.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,140 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * XML mapping of the java-wsdl-mapping/service-endpoint-interface-mapping element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class ServiceEndpointInterfaceMapping implements Serializable
+{
+ private static final long serialVersionUID = 3336973427288868587L;
+
+ // The parent <java-wsdl-mapping> element
+ private JavaWsdlMapping javaWsdlMapping;
+
+ // The required <service-endpoint-interface> element
+ private String serviceEndpointInterface;
+ // The required <wsdl-port-type> element
+ private QName wsdlPortType;
+ // The required <wsdl-binding> element
+ private QName wsdlBinding;
+ // Zero or more <service-endpoint-method-mapping> elements
+ private List serviceEndpointMethodMappings = new ArrayList();
+
+ public ServiceEndpointInterfaceMapping(JavaWsdlMapping javaWsdlMapping)
+ {
+ this.javaWsdlMapping = javaWsdlMapping;
+ }
+
+ public JavaWsdlMapping getJavaWsdlMapping()
+ {
+ return javaWsdlMapping;
+ }
+
+ public String getServiceEndpointInterface()
+ {
+ return serviceEndpointInterface;
+ }
+
+ public void setServiceEndpointInterface(String serviceEndpointInterface)
+ {
+ this.serviceEndpointInterface = serviceEndpointInterface;
+ }
+
+ public QName getWsdlPortType()
+ {
+ return wsdlPortType;
+ }
+
+ public void setWsdlPortType(QName wsdlPortType)
+ {
+ this.wsdlPortType = wsdlPortType;
+ }
+
+ public QName getWsdlBinding()
+ {
+ return wsdlBinding;
+ }
+
+ public void setWsdlBinding(QName wsdlBinding)
+ {
+ this.wsdlBinding = wsdlBinding;
+ }
+
+ public ServiceEndpointMethodMapping[] getServiceEndpointMethodMappings()
+ {
+ ServiceEndpointMethodMapping[] arr = new
ServiceEndpointMethodMapping[serviceEndpointMethodMappings.size()];
+ serviceEndpointMethodMappings.toArray(arr);
+ return arr;
+ }
+
+ public void addServiceEndpointMethodMapping(ServiceEndpointMethodMapping
serviceEndpointMethodMapping)
+ {
+ serviceEndpointMethodMappings.add(serviceEndpointMethodMapping);
+ }
+
+ public ServiceEndpointMethodMapping
getServiceEndpointMethodMappingByWsdlOperation(String wsdlOperation)
+ {
+ ServiceEndpointMethodMapping semMapping = null;
+
+ Iterator it = serviceEndpointMethodMappings.iterator();
+ while (it.hasNext())
+ {
+ ServiceEndpointMethodMapping aux = (ServiceEndpointMethodMapping)it.next();
+ if (aux.getWsdlOperation().equals(wsdlOperation))
+ semMapping = aux;
+ }
+ return semMapping;
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+
sb.append("<service-endpoint-interface-mapping><service-endpoint-interface>");
+
sb.append(this.serviceEndpointInterface).append("</service-endpoint-interface>");
+ sb.append("<wsdl-port-type
xmlns:").append(wsdlPortType.getPrefix()).append("='");
+
sb.append(wsdlPortType.getNamespaceURI()).append("'>").append(wsdlPortType.getPrefix());
+
sb.append(":").append(wsdlPortType.getLocalPart()).append("</wsdl-port-type>");
+
+ sb.append("<wsdl-binding
xmlns:").append(wsdlBinding.getPrefix()).append("='");
+
sb.append(wsdlBinding.getNamespaceURI()).append("'>").append(wsdlBinding.getPrefix());
+
sb.append(":").append(wsdlBinding.getLocalPart()).append("</wsdl-binding>");
+
+ Iterator iter = serviceEndpointMethodMappings.iterator();
+ while(iter != null && iter.hasNext())
+ sb.append(((ServiceEndpointMethodMapping)iter.next()).serialize());
+ sb.append("</service-endpoint-interface-mapping>");
+ return sb.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,156 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * XML mapping of the
java-wsdl-mapping/service-endpoint-interface-mapping/service-endpoint-method-mapping
element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class ServiceEndpointMethodMapping implements Serializable
-{
- private static final long serialVersionUID = 7857267872017006227L;
-
- // The parent <service-endpoint-interface-mapping> element
- private ServiceEndpointInterfaceMapping serviceEndpointInterfaceMapping;
-
- // The required <java-method-name> element
- private String javaMethodName;
- // The required <wsdl-operation> element
- private String wsdlOperation;
- // The optional <wrapped-element> element
- private boolean wrappedElement;
- // Zero or more <method-param-parts-mapping> elements
- private List methodParamPartsMappings = new ArrayList();
- // The optional <wsdl-return-value-mapping> element
- private WsdlReturnValueMapping wsdlReturnValueMapping;
-
- public ServiceEndpointMethodMapping(ServiceEndpointInterfaceMapping
serviceEndpointInterfaceMapping)
- {
- this.serviceEndpointInterfaceMapping = serviceEndpointInterfaceMapping;
- }
-
- public ServiceEndpointInterfaceMapping getServiceEndpointInterfaceMapping()
- {
- return serviceEndpointInterfaceMapping;
- }
-
- public String getJavaMethodName()
- {
- return javaMethodName;
- }
-
- public void setJavaMethodName(String javaMethodName)
- {
- this.javaMethodName = javaMethodName;
- }
-
- public MethodParamPartsMapping[] getMethodParamPartsMappings()
- {
- MethodParamPartsMapping[] arr = new
MethodParamPartsMapping[methodParamPartsMappings.size()];
- methodParamPartsMappings.toArray(arr);
- return arr;
- }
-
- public MethodParamPartsMapping getMethodParamPartsMappingByPartName(String partName)
- {
- MethodParamPartsMapping paramMapping = null;
- for (int i = 0; paramMapping == null && i <
methodParamPartsMappings.size(); i++)
- {
- MethodParamPartsMapping aux =
(MethodParamPartsMapping)methodParamPartsMappings.get(i);
- if (aux.getWsdlMessageMapping().getWsdlMessagePartName().equals(partName))
- paramMapping = aux;
- }
- return paramMapping;
- }
-
- public MethodParamPartsMapping getMethodParamPartsMappingByPosition(int pos)
- {
- MethodParamPartsMapping paramMapping = null;
- for (int i = 0; paramMapping == null && i <
methodParamPartsMappings.size(); i++)
- {
- MethodParamPartsMapping aux =
(MethodParamPartsMapping)methodParamPartsMappings.get(i);
- if (aux.getParamPosition() == pos)
- paramMapping = aux;
- }
- return paramMapping;
- }
-
- public void addMethodParamPartsMapping(MethodParamPartsMapping
methodParamPartsMapping)
- {
- methodParamPartsMappings.add(methodParamPartsMapping);
- }
-
- public boolean isWrappedElement()
- {
- return wrappedElement;
- }
-
- public void setWrappedElement(boolean wrappedElement)
- {
- this.wrappedElement = wrappedElement;
- }
-
- public String getWsdlOperation()
- {
- return wsdlOperation;
- }
-
- public void setWsdlOperation(String wsdlOperation)
- {
- this.wsdlOperation = wsdlOperation;
- }
-
- public WsdlReturnValueMapping getWsdlReturnValueMapping()
- {
- return wsdlReturnValueMapping;
- }
-
- public void setWsdlReturnValueMapping(WsdlReturnValueMapping wsdlReturnValueMapping)
- {
- this.wsdlReturnValueMapping = wsdlReturnValueMapping;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<service-endpoint-method-mapping><java-method-name>").append(javaMethodName).append("</java-method-name>");
-
sb.append("<wsdl-operation>").append(wsdlOperation).append("</wsdl-operation>");
- if (wrappedElement)
- sb.append("<wrapped-element/>");
- Iterator iter = methodParamPartsMappings.iterator();
- while (iter != null && iter.hasNext())
- sb.append(((MethodParamPartsMapping)iter.next()).serialize());
- if (wsdlReturnValueMapping != null)
- sb.append(wsdlReturnValueMapping.serialize());
- sb.append("</service-endpoint-method-mapping>");
- return sb.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceEndpointMethodMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+// $Id$
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * XML mapping of the
java-wsdl-mapping/service-endpoint-interface-mapping/service-endpoint-method-mapping
element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class ServiceEndpointMethodMapping implements Serializable
+{
+ private static final long serialVersionUID = 7857267872017006227L;
+
+ // The parent <service-endpoint-interface-mapping> element
+ private ServiceEndpointInterfaceMapping serviceEndpointInterfaceMapping;
+
+ // The required <java-method-name> element
+ private String javaMethodName;
+ // The required <wsdl-operation> element
+ private String wsdlOperation;
+ // The optional <wrapped-element> element
+ private boolean wrappedElement;
+ // Zero or more <method-param-parts-mapping> elements
+ private List methodParamPartsMappings = new ArrayList();
+ // The optional <wsdl-return-value-mapping> element
+ private WsdlReturnValueMapping wsdlReturnValueMapping;
+
+ public ServiceEndpointMethodMapping(ServiceEndpointInterfaceMapping
serviceEndpointInterfaceMapping)
+ {
+ this.serviceEndpointInterfaceMapping = serviceEndpointInterfaceMapping;
+ }
+
+ public ServiceEndpointInterfaceMapping getServiceEndpointInterfaceMapping()
+ {
+ return serviceEndpointInterfaceMapping;
+ }
+
+ public String getJavaMethodName()
+ {
+ return javaMethodName;
+ }
+
+ public void setJavaMethodName(String javaMethodName)
+ {
+ this.javaMethodName = javaMethodName;
+ }
+
+ public MethodParamPartsMapping[] getMethodParamPartsMappings()
+ {
+ MethodParamPartsMapping[] arr = new
MethodParamPartsMapping[methodParamPartsMappings.size()];
+ methodParamPartsMappings.toArray(arr);
+ return arr;
+ }
+
+ public MethodParamPartsMapping getMethodParamPartsMappingByPartName(String partName)
+ {
+ MethodParamPartsMapping paramMapping = null;
+ for (int i = 0; paramMapping == null && i <
methodParamPartsMappings.size(); i++)
+ {
+ MethodParamPartsMapping aux =
(MethodParamPartsMapping)methodParamPartsMappings.get(i);
+ if (aux.getWsdlMessageMapping().getWsdlMessagePartName().equals(partName))
+ paramMapping = aux;
+ }
+ return paramMapping;
+ }
+
+ public MethodParamPartsMapping getMethodParamPartsMappingByPosition(int pos)
+ {
+ MethodParamPartsMapping paramMapping = null;
+ for (int i = 0; paramMapping == null && i <
methodParamPartsMappings.size(); i++)
+ {
+ MethodParamPartsMapping aux =
(MethodParamPartsMapping)methodParamPartsMappings.get(i);
+ if (aux.getParamPosition() == pos)
+ paramMapping = aux;
+ }
+ return paramMapping;
+ }
+
+ public void addMethodParamPartsMapping(MethodParamPartsMapping
methodParamPartsMapping)
+ {
+ methodParamPartsMappings.add(methodParamPartsMapping);
+ }
+
+ public boolean isWrappedElement()
+ {
+ return wrappedElement;
+ }
+
+ public void setWrappedElement(boolean wrappedElement)
+ {
+ this.wrappedElement = wrappedElement;
+ }
+
+ public String getWsdlOperation()
+ {
+ return wsdlOperation;
+ }
+
+ public void setWsdlOperation(String wsdlOperation)
+ {
+ this.wsdlOperation = wsdlOperation;
+ }
+
+ public WsdlReturnValueMapping getWsdlReturnValueMapping()
+ {
+ return wsdlReturnValueMapping;
+ }
+
+ public void setWsdlReturnValueMapping(WsdlReturnValueMapping wsdlReturnValueMapping)
+ {
+ this.wsdlReturnValueMapping = wsdlReturnValueMapping;
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+
sb.append("<service-endpoint-method-mapping><java-method-name>").append(javaMethodName).append("</java-method-name>");
+
sb.append("<wsdl-operation>").append(wsdlOperation).append("</wsdl-operation>");
+ if (wrappedElement)
+ sb.append("<wrapped-element/>");
+ Iterator iter = methodParamPartsMappings.iterator();
+ while (iter != null && iter.hasNext())
+ sb.append(((MethodParamPartsMapping)iter.next()).serialize());
+ if (wsdlReturnValueMapping != null)
+ sb.append(wsdlReturnValueMapping.serialize());
+ sb.append("</service-endpoint-method-mapping>");
+ return sb.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceInterfaceMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceInterfaceMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceInterfaceMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,111 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * XML mapping of the java-wsdl-mapping/service-interface-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class ServiceInterfaceMapping implements Serializable
-{
- private static final long serialVersionUID = -447051823681281236L;
-
- // The parent <java-wsdl-mapping> element
- private JavaWsdlMapping javaWsdlMapping;
-
- // The required <service-interface> element
- private String serviceInterface;
- // The required <wsdl-service-name> element
- private QName wsdlServiceName;
- // Zero or more <port-mapping> elements
- private List portMappings = new ArrayList();
-
- public ServiceInterfaceMapping(JavaWsdlMapping javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public JavaWsdlMapping getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public String getServiceInterface()
- {
- return serviceInterface;
- }
-
- public void setServiceInterface(String serviceInterface)
- {
- this.serviceInterface = serviceInterface;
- }
-
- public QName getWsdlServiceName()
- {
- return wsdlServiceName;
- }
-
- public void setWsdlServiceName(QName wsdlServiceName)
- {
- this.wsdlServiceName = wsdlServiceName;
- }
-
- public PortMapping[] getPortMappings()
- {
- PortMapping[] arr = new PortMapping[portMappings.size()];
- portMappings.toArray(arr);
- return arr;
- }
-
- public void addPortMapping(PortMapping portMapping)
- {
- portMappings.add(portMapping);
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- sb.append("<service-interface-mapping>");
-
sb.append("<service-interface>").append(serviceInterface).append("</service-interface>");
- sb.append("<wsdl-service-name
xmlns:").append(wsdlServiceName.getPrefix()).append("='");
- sb.append(wsdlServiceName.getNamespaceURI()).append("'>");
-
sb.append(wsdlServiceName.getPrefix()).append(":").append(wsdlServiceName.getLocalPart());
- sb.append("</wsdl-service-name>");
-
- Iterator iter = portMappings.iterator();
- while(iter != null && iter.hasNext())
- sb.append(((PortMapping)iter.next()).serialize());
- sb.append("</service-interface-mapping>");
- return sb.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceInterfaceMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceInterfaceMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ServiceInterfaceMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/ServiceInterfaceMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,111 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * XML mapping of the java-wsdl-mapping/service-interface-mapping element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class ServiceInterfaceMapping implements Serializable
+{
+ private static final long serialVersionUID = -447051823681281236L;
+
+ // The parent <java-wsdl-mapping> element
+ private JavaWsdlMapping javaWsdlMapping;
+
+ // The required <service-interface> element
+ private String serviceInterface;
+ // The required <wsdl-service-name> element
+ private QName wsdlServiceName;
+ // Zero or more <port-mapping> elements
+ private List portMappings = new ArrayList();
+
+ public ServiceInterfaceMapping(JavaWsdlMapping javaWsdlMapping)
+ {
+ this.javaWsdlMapping = javaWsdlMapping;
+ }
+
+ public JavaWsdlMapping getJavaWsdlMapping()
+ {
+ return javaWsdlMapping;
+ }
+
+ public String getServiceInterface()
+ {
+ return serviceInterface;
+ }
+
+ public void setServiceInterface(String serviceInterface)
+ {
+ this.serviceInterface = serviceInterface;
+ }
+
+ public QName getWsdlServiceName()
+ {
+ return wsdlServiceName;
+ }
+
+ public void setWsdlServiceName(QName wsdlServiceName)
+ {
+ this.wsdlServiceName = wsdlServiceName;
+ }
+
+ public PortMapping[] getPortMappings()
+ {
+ PortMapping[] arr = new PortMapping[portMappings.size()];
+ portMappings.toArray(arr);
+ return arr;
+ }
+
+ public void addPortMapping(PortMapping portMapping)
+ {
+ portMappings.add(portMapping);
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<service-interface-mapping>");
+
sb.append("<service-interface>").append(serviceInterface).append("</service-interface>");
+ sb.append("<wsdl-service-name
xmlns:").append(wsdlServiceName.getPrefix()).append("='");
+ sb.append(wsdlServiceName.getNamespaceURI()).append("'>");
+
sb.append(wsdlServiceName.getPrefix()).append(":").append(wsdlServiceName.getLocalPart());
+ sb.append("</wsdl-service-name>");
+
+ Iterator iter = portMappings.iterator();
+ while(iter != null && iter.hasNext())
+ sb.append(((PortMapping)iter.next()).serialize());
+ sb.append("</service-interface-mapping>");
+ return sb.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/VariableMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/VariableMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/VariableMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,134 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * XML mapping of the java-wsdl-mapping/java-xml-type-mapping/varaible-mapping element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class VariableMapping implements Serializable
-{
- private static final long serialVersionUID = 4168728468137337167L;
-
- // The parent <java-wsdl-mapping> element
- private JavaXmlTypeMapping typeMapping;
-
- // The required <java-variable-name> element
- private String javaVariableName;
- // The optional <data-member> element
- private boolean dataMember;
- // The choice [<xml-attribute-name> | <xml-element-name> |
<xml-wildcard>]
- private String xmlAttributeName;
- private String xmlElementName;
- private boolean xmlWildcard;
-
- public VariableMapping(JavaXmlTypeMapping typeMapping)
- {
- this.typeMapping = typeMapping;
- }
-
- public JavaXmlTypeMapping getTypeMapping()
- {
- return typeMapping;
- }
-
- public boolean isDataMember()
- {
- return dataMember;
- }
-
- public void setDataMember(boolean dataMember)
- {
- this.dataMember = dataMember;
- }
-
- public String getJavaVariableName()
- {
- return javaVariableName;
- }
-
- public void setJavaVariableName(String javaVariableName)
- {
- this.javaVariableName = javaVariableName;
- }
-
- public String getXmlAttributeName()
- {
- return xmlAttributeName;
- }
-
- public void setXmlAttributeName(String xmlAttributeName)
- {
- this.xmlAttributeName = xmlAttributeName;
- }
-
- public String getXmlElementName()
- {
- return xmlElementName;
- }
-
- public void setXmlElementName(String xmlElementName)
- {
- this.xmlElementName = xmlElementName;
- }
-
- public boolean getXmlWildcard()
- {
- return xmlWildcard;
- }
-
- public void setXmlWildcard(boolean xmlWildcard)
- {
- this.xmlWildcard = xmlWildcard;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- sb.append("<variable-mapping>");
-
sb.append("<java-variable-name>").append(javaVariableName).append("</java-variable-name>");
- if(dataMember)
- {
- sb.append("<data-member/>");
- }
- if (xmlElementName != null)
- {
-
sb.append("<xml-element-name>").append(xmlElementName).append("</xml-element-name>");
- }
- else if (xmlAttributeName != null)
- {
-
sb.append("<xml-attribute-name>").append(xmlAttributeName).append("</xml-attribute-name>");
- }
- else if (xmlWildcard)
- {
- sb.append("<xml-wildcard/>");
- }
- sb.append("</variable-mapping>");
- return sb.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/VariableMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/VariableMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/VariableMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/VariableMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,134 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+import java.io.Serializable;
+
+// $Id$
+
+/**
+ * XML mapping of the java-wsdl-mapping/java-xml-type-mapping/varaible-mapping element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class VariableMapping implements Serializable
+{
+ private static final long serialVersionUID = 4168728468137337167L;
+
+ // The parent <java-wsdl-mapping> element
+ private JavaXmlTypeMapping typeMapping;
+
+ // The required <java-variable-name> element
+ private String javaVariableName;
+ // The optional <data-member> element
+ private boolean dataMember;
+ // The choice [<xml-attribute-name> | <xml-element-name> |
<xml-wildcard>]
+ private String xmlAttributeName;
+ private String xmlElementName;
+ private boolean xmlWildcard;
+
+ public VariableMapping(JavaXmlTypeMapping typeMapping)
+ {
+ this.typeMapping = typeMapping;
+ }
+
+ public JavaXmlTypeMapping getTypeMapping()
+ {
+ return typeMapping;
+ }
+
+ public boolean isDataMember()
+ {
+ return dataMember;
+ }
+
+ public void setDataMember(boolean dataMember)
+ {
+ this.dataMember = dataMember;
+ }
+
+ public String getJavaVariableName()
+ {
+ return javaVariableName;
+ }
+
+ public void setJavaVariableName(String javaVariableName)
+ {
+ this.javaVariableName = javaVariableName;
+ }
+
+ public String getXmlAttributeName()
+ {
+ return xmlAttributeName;
+ }
+
+ public void setXmlAttributeName(String xmlAttributeName)
+ {
+ this.xmlAttributeName = xmlAttributeName;
+ }
+
+ public String getXmlElementName()
+ {
+ return xmlElementName;
+ }
+
+ public void setXmlElementName(String xmlElementName)
+ {
+ this.xmlElementName = xmlElementName;
+ }
+
+ public boolean getXmlWildcard()
+ {
+ return xmlWildcard;
+ }
+
+ public void setXmlWildcard(boolean xmlWildcard)
+ {
+ this.xmlWildcard = xmlWildcard;
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<variable-mapping>");
+
sb.append("<java-variable-name>").append(javaVariableName).append("</java-variable-name>");
+ if(dataMember)
+ {
+ sb.append("<data-member/>");
+ }
+ if (xmlElementName != null)
+ {
+
sb.append("<xml-element-name>").append(xmlElementName).append("</xml-element-name>");
+ }
+ else if (xmlAttributeName != null)
+ {
+
sb.append("<xml-attribute-name>").append(xmlAttributeName).append("</xml-attribute-name>");
+ }
+ else if (xmlWildcard)
+ {
+ sb.append("<xml-wildcard/>");
+ }
+ sb.append("</variable-mapping>");
+ return sb.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlMessageMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlMessageMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,116 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-// $Id$
-
-/**
- * Created by IntelliJ IDEA.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class WsdlMessageMapping implements Serializable
-{
- private static final long serialVersionUID = -3212852147033081838L;
-
- // The parent <method-param-parts-mapping> element
- private MethodParamPartsMapping methodParamPartsMapping;
- // The required <wsdl-message> element
- private QName wsdlMessage;
- // The required <wsdl-message-part-name> element
- private String wsdlMessagePartName;
- // The required <parameter-mode> element
- private String parameterMode;
- // The optional <soap-header> element
- private boolean soapHeader;
-
- public WsdlMessageMapping(MethodParamPartsMapping methodParamPartsMapping)
- {
- this.methodParamPartsMapping = methodParamPartsMapping;
- }
-
- public MethodParamPartsMapping getMethodParamPartsMapping()
- {
- return methodParamPartsMapping;
- }
-
- public String getParameterMode()
- {
- return parameterMode;
- }
-
- public void setParameterMode(String parameterMode)
- {
- if ("IN".equals(parameterMode) == false &&
"OUT".equals(parameterMode) == false &&
"INOUT".equals(parameterMode) == false)
- throw new IllegalArgumentException("Invalid parameter mode: " +
parameterMode);
- this.parameterMode = parameterMode;
- }
-
- public boolean isSoapHeader()
- {
- return soapHeader;
- }
-
- public void setSoapHeader(boolean soapHeader)
- {
- this.soapHeader = soapHeader;
- }
-
- public QName getWsdlMessage()
- {
- return wsdlMessage;
- }
-
- public void setWsdlMessage(QName wsdlMessage)
- {
- this.wsdlMessage = wsdlMessage;
- }
-
- public String getWsdlMessagePartName()
- {
- return wsdlMessagePartName;
- }
-
- public void setWsdlMessagePartName(String wsdlMessagePartName)
- {
- this.wsdlMessagePartName = wsdlMessagePartName;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
- sb.append(" <wsdl-message-mapping> <wsdl-message xmlns:");
-
sb.append(wsdlMessage.getPrefix()).append("='").append(wsdlMessage.getNamespaceURI()).append("'>");
-
sb.append(wsdlMessage.getPrefix()).append(":").append(wsdlMessage.getLocalPart()).append("</wsdl-message>");
-
sb.append("<wsdl-message-part-name>").append(wsdlMessagePartName).append("</wsdl-message-part-name>");
-
sb.append("<parameter-mode>").append(parameterMode).append("</parameter-mode>");
- if (soapHeader)
- sb.append("<soap-header/>");
- sb.append("</wsdl-message-mapping>");
- return sb.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlMessageMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlMessageMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,116 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+// $Id$
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class WsdlMessageMapping implements Serializable
+{
+ private static final long serialVersionUID = -3212852147033081838L;
+
+ // The parent <method-param-parts-mapping> element
+ private MethodParamPartsMapping methodParamPartsMapping;
+ // The required <wsdl-message> element
+ private QName wsdlMessage;
+ // The required <wsdl-message-part-name> element
+ private String wsdlMessagePartName;
+ // The required <parameter-mode> element
+ private String parameterMode;
+ // The optional <soap-header> element
+ private boolean soapHeader;
+
+ public WsdlMessageMapping(MethodParamPartsMapping methodParamPartsMapping)
+ {
+ this.methodParamPartsMapping = methodParamPartsMapping;
+ }
+
+ public MethodParamPartsMapping getMethodParamPartsMapping()
+ {
+ return methodParamPartsMapping;
+ }
+
+ public String getParameterMode()
+ {
+ return parameterMode;
+ }
+
+ public void setParameterMode(String parameterMode)
+ {
+ if ("IN".equals(parameterMode) == false &&
"OUT".equals(parameterMode) == false &&
"INOUT".equals(parameterMode) == false)
+ throw new IllegalArgumentException("Invalid parameter mode: " +
parameterMode);
+ this.parameterMode = parameterMode;
+ }
+
+ public boolean isSoapHeader()
+ {
+ return soapHeader;
+ }
+
+ public void setSoapHeader(boolean soapHeader)
+ {
+ this.soapHeader = soapHeader;
+ }
+
+ public QName getWsdlMessage()
+ {
+ return wsdlMessage;
+ }
+
+ public void setWsdlMessage(QName wsdlMessage)
+ {
+ this.wsdlMessage = wsdlMessage;
+ }
+
+ public String getWsdlMessagePartName()
+ {
+ return wsdlMessagePartName;
+ }
+
+ public void setWsdlMessagePartName(String wsdlMessagePartName)
+ {
+ this.wsdlMessagePartName = wsdlMessagePartName;
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append(" <wsdl-message-mapping> <wsdl-message xmlns:");
+
sb.append(wsdlMessage.getPrefix()).append("='").append(wsdlMessage.getNamespaceURI()).append("'>");
+
sb.append(wsdlMessage.getPrefix()).append(":").append(wsdlMessage.getLocalPart()).append("</wsdl-message>");
+
sb.append("<wsdl-message-part-name>").append(wsdlMessagePartName).append("</wsdl-message-part-name>");
+
sb.append("<parameter-mode>").append(parameterMode).append("</parameter-mode>");
+ if (soapHeader)
+ sb.append("<soap-header/>");
+ sb.append("</wsdl-message-mapping>");
+ return sb.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlReturnValueMapping.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlReturnValueMapping.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlReturnValueMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,101 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jaxrpcmapping;
-
-// $Id$
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-/**
- * XML mapping of the
java-wsdl-mapping/service-endpoint-interface-mapping/service-endpoint-method-mapping/wsdl-return-value-mapping
element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-May-2004
- */
-public class WsdlReturnValueMapping implements Serializable
-{
- private static final long serialVersionUID = -6910106650463959774L;
-
- // The parent <service-endpoint-method-mapping> element
- private ServiceEndpointMethodMapping serviceEndpointMethodMapping;
-
- // The required <method-return-value> element
- private String methodReturnValue;
- // The required <wsdl-message> element
- private QName wsdlMessage;
- // The optional <wsdl-message> element
- private String wsdlMessagePartName;
-
- public WsdlReturnValueMapping(ServiceEndpointMethodMapping
serviceEndpointMethodMapping)
- {
- this.serviceEndpointMethodMapping = serviceEndpointMethodMapping;
- }
-
- public ServiceEndpointMethodMapping getServiceEndpointMethodMapping()
- {
- return serviceEndpointMethodMapping;
- }
-
- public String getMethodReturnValue()
- {
- return methodReturnValue;
- }
-
- public void setMethodReturnValue(String methodReturnValue)
- {
- this.methodReturnValue = methodReturnValue;
- }
-
- public QName getWsdlMessage()
- {
- return wsdlMessage;
- }
-
- public void setWsdlMessage(QName wsdlMessage)
- {
- this.wsdlMessage = wsdlMessage;
- }
-
- public String getWsdlMessagePartName()
- {
- return wsdlMessagePartName;
- }
-
- public void setWsdlMessagePartName(String wsdlMessagePartName)
- {
- this.wsdlMessagePartName = wsdlMessagePartName;
- }
-
- public String serialize()
- {
- StringBuffer sb = new StringBuffer();
-
sb.append("<wsdl-return-value-mapping><method-return-value>").append(methodReturnValue).append("</method-return-value>");
- sb.append("<wsdl-message
xmlns:").append(wsdlMessage.getPrefix()).append("='").append(wsdlMessage.getNamespaceURI());
-
sb.append("'>").append(wsdlMessage.getPrefix()).append(":").append(wsdlMessage.getLocalPart()).append("</wsdl-message>");
-
sb.append("<wsdl-message-part-name>").append(wsdlMessagePartName).append("</wsdl-message-part-name>");
- sb.append("</wsdl-return-value-mapping>");
-
- return sb.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlReturnValueMapping.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlReturnValueMapping.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlReturnValueMapping.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jaxrpcmapping/WsdlReturnValueMapping.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,101 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jaxrpcmapping;
+
+// $Id$
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+/**
+ * XML mapping of the
java-wsdl-mapping/service-endpoint-interface-mapping/service-endpoint-method-mapping/wsdl-return-value-mapping
element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-May-2004
+ */
+public class WsdlReturnValueMapping implements Serializable
+{
+ private static final long serialVersionUID = -6910106650463959774L;
+
+ // The parent <service-endpoint-method-mapping> element
+ private ServiceEndpointMethodMapping serviceEndpointMethodMapping;
+
+ // The required <method-return-value> element
+ private String methodReturnValue;
+ // The required <wsdl-message> element
+ private QName wsdlMessage;
+ // The optional <wsdl-message> element
+ private String wsdlMessagePartName;
+
+ public WsdlReturnValueMapping(ServiceEndpointMethodMapping
serviceEndpointMethodMapping)
+ {
+ this.serviceEndpointMethodMapping = serviceEndpointMethodMapping;
+ }
+
+ public ServiceEndpointMethodMapping getServiceEndpointMethodMapping()
+ {
+ return serviceEndpointMethodMapping;
+ }
+
+ public String getMethodReturnValue()
+ {
+ return methodReturnValue;
+ }
+
+ public void setMethodReturnValue(String methodReturnValue)
+ {
+ this.methodReturnValue = methodReturnValue;
+ }
+
+ public QName getWsdlMessage()
+ {
+ return wsdlMessage;
+ }
+
+ public void setWsdlMessage(QName wsdlMessage)
+ {
+ this.wsdlMessage = wsdlMessage;
+ }
+
+ public String getWsdlMessagePartName()
+ {
+ return wsdlMessagePartName;
+ }
+
+ public void setWsdlMessagePartName(String wsdlMessagePartName)
+ {
+ this.wsdlMessagePartName = wsdlMessagePartName;
+ }
+
+ public String serialize()
+ {
+ StringBuffer sb = new StringBuffer();
+
sb.append("<wsdl-return-value-mapping><method-return-value>").append(methodReturnValue).append("</method-return-value>");
+ sb.append("<wsdl-message
xmlns:").append(wsdlMessage.getPrefix()).append("='").append(wsdlMessage.getNamespaceURI());
+
sb.append("'>").append(wsdlMessage.getPrefix()).append(":").append(wsdlMessage.getLocalPart()).append("</wsdl-message>");
+
sb.append("<wsdl-message-part-name>").append(wsdlMessagePartName).append("</wsdl-message-part-name>");
+ sb.append("</wsdl-return-value-mapping>");
+
+ return sb.toString();
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109 (from rev
1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/PortComponentMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/PortComponentMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/PortComponentMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,194 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-// $Id$
-package org.jboss.ws.metadata.jsr109;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-
-/**
- * XML Binding and ws4ee meta-data element for
- * <code>webservices/webservice-description/port-component</code>
- * <p/>
- * A port component is the equivalent of an ordinary Axis service (and
- * as such it constitutes the building blocks for jaxrpc services).
- * <p/>
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-April-2004
- */
-public class PortComponentMetaData
-{
- /**
- * The index of the webservice-description in webservices.xml
- */
- public static final String PARAMETER_WEBSERVICE_ID = "webserviceID";
-
- // provide logging
- private static final Logger log = Logger.getLogger(PortComponentMetaData.class);
-
- // The parent <webservice-description> element
- private WebserviceDescriptionMetaData webserviceDescription;
-
- /** The required <port-component-name> element
- * This name bears no relationship to the WSDL port name.
- * This name must be unique amongst all port component names in a module.
- */
- private String portComponentName;
- // The required <wsdl-port> element
- private QName wsdlPort;
- // The required <service-endpoint-interface> element
- private String serviceEndpointInterface;
- // The required <ejb-link> or <servlet-link> in the
<service-impl-bean> element
- private String ejbLink;
- private String servletLink;
- // The optional <handler> elements
- private List<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
-
- // The HTTP context root
- private String contextRoot;
-
- /** Construct a new PortComponentMetaData for a given WebserviceDescriptionMetaData
- */
- public PortComponentMetaData(WebserviceDescriptionMetaData webserviceDescription)
- {
- this.webserviceDescription = webserviceDescription;
- }
-
- public WebserviceDescriptionMetaData getWebserviceDescription()
- {
- return webserviceDescription;
- }
-
- public String getPortComponentName()
- {
- return portComponentName;
- }
-
- public void setPortComponentName(String portComponentName)
- {
- this.portComponentName = portComponentName;
- }
-
- public QName getWsdlPort()
- {
- return wsdlPort;
- }
-
- public void setWsdlPort(QName wsdlPort)
- {
- if (wsdlPort.getNamespaceURI().length() == 0)
- log.warn("<wsdl-port> element in webservices.xml not namespace
qualified: " + wsdlPort);
-
- this.wsdlPort = wsdlPort;
- }
-
- public String getEjbLink()
- {
- return ejbLink;
- }
-
- public void setEjbLink(String ejbLink)
- {
- this.ejbLink = ejbLink;
- }
-
- public String getServletLink()
- {
- return servletLink;
- }
-
- public void setServletLink(String servletLink)
- {
- this.servletLink = servletLink;
- }
-
- public String getServiceEndpointInterface()
- {
- return serviceEndpointInterface;
- }
-
- public void setServiceEndpointInterface(String serviceEndpointInterface)
- {
- this.serviceEndpointInterface = serviceEndpointInterface;
- }
-
- public void addHandler(UnifiedHandlerMetaData handler)
- {
- handlers.add(handler);
- }
-
- public UnifiedHandlerMetaData[] getHandlers()
- {
- UnifiedHandlerMetaData[] array = new UnifiedHandlerMetaData[handlers.size()];
- handlers.toArray(array);
- return array;
- }
-
- public String getContextRoot()
- {
- return contextRoot;
- }
-
- public void setContextRoot(String contextRoot)
- {
- this.contextRoot = contextRoot;
- }
-
- /**
- * Serialize as a String
- *
- * @return
- */
- public String serialize()
- {
- StringBuilder builder = new StringBuilder("<port-component>
<port-component-name>");
- builder.append(portComponentName +
"</port-component-name><wsdl-port>impl:");
- builder.append(wsdlPort.getLocalPart() +
"</wsdl-port><service-endpoint-interface>");
- builder.append(serviceEndpointInterface);
- builder.append("</service-endpoint-interface>");
- builder.append("<service-impl-bean>");
- if (ejbLink != null)
- {
- builder.append("<ejb-link>");
- builder.append(ejbLink);
- builder.append("</ejb-link>");
-
- }
- else
- {
- builder.append("<servlet-link>");
- builder.append(servletLink);
- builder.append("</servlet-link>");
- }
- builder.append("</service-impl-bean>");
- builder.append("</port-component>");
- return builder.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/PortComponentMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/PortComponentMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/PortComponentMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/PortComponentMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,194 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+// $Id$
+package org.jboss.ws.core.metadata.jsr109;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+
+/**
+ * XML Binding and ws4ee meta-data element for
+ * <code>webservices/webservice-description/port-component</code>
+ * <p/>
+ * A port component is the equivalent of an ordinary Axis service (and
+ * as such it constitutes the building blocks for jaxrpc services).
+ * <p/>
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-April-2004
+ */
+public class PortComponentMetaData
+{
+ /**
+ * The index of the webservice-description in webservices.xml
+ */
+ public static final String PARAMETER_WEBSERVICE_ID = "webserviceID";
+
+ // provide logging
+ private static final Logger log = Logger.getLogger(PortComponentMetaData.class);
+
+ // The parent <webservice-description> element
+ private WebserviceDescriptionMetaData webserviceDescription;
+
+ /** The required <port-component-name> element
+ * This name bears no relationship to the WSDL port name.
+ * This name must be unique amongst all port component names in a module.
+ */
+ private String portComponentName;
+ // The required <wsdl-port> element
+ private QName wsdlPort;
+ // The required <service-endpoint-interface> element
+ private String serviceEndpointInterface;
+ // The required <ejb-link> or <servlet-link> in the
<service-impl-bean> element
+ private String ejbLink;
+ private String servletLink;
+ // The optional <handler> elements
+ private List<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
+
+ // The HTTP context root
+ private String contextRoot;
+
+ /** Construct a new PortComponentMetaData for a given WebserviceDescriptionMetaData
+ */
+ public PortComponentMetaData(WebserviceDescriptionMetaData webserviceDescription)
+ {
+ this.webserviceDescription = webserviceDescription;
+ }
+
+ public WebserviceDescriptionMetaData getWebserviceDescription()
+ {
+ return webserviceDescription;
+ }
+
+ public String getPortComponentName()
+ {
+ return portComponentName;
+ }
+
+ public void setPortComponentName(String portComponentName)
+ {
+ this.portComponentName = portComponentName;
+ }
+
+ public QName getWsdlPort()
+ {
+ return wsdlPort;
+ }
+
+ public void setWsdlPort(QName wsdlPort)
+ {
+ if (wsdlPort.getNamespaceURI().length() == 0)
+ log.warn("<wsdl-port> element in webservices.xml not namespace
qualified: " + wsdlPort);
+
+ this.wsdlPort = wsdlPort;
+ }
+
+ public String getEjbLink()
+ {
+ return ejbLink;
+ }
+
+ public void setEjbLink(String ejbLink)
+ {
+ this.ejbLink = ejbLink;
+ }
+
+ public String getServletLink()
+ {
+ return servletLink;
+ }
+
+ public void setServletLink(String servletLink)
+ {
+ this.servletLink = servletLink;
+ }
+
+ public String getServiceEndpointInterface()
+ {
+ return serviceEndpointInterface;
+ }
+
+ public void setServiceEndpointInterface(String serviceEndpointInterface)
+ {
+ this.serviceEndpointInterface = serviceEndpointInterface;
+ }
+
+ public void addHandler(UnifiedHandlerMetaData handler)
+ {
+ handlers.add(handler);
+ }
+
+ public UnifiedHandlerMetaData[] getHandlers()
+ {
+ UnifiedHandlerMetaData[] array = new UnifiedHandlerMetaData[handlers.size()];
+ handlers.toArray(array);
+ return array;
+ }
+
+ public String getContextRoot()
+ {
+ return contextRoot;
+ }
+
+ public void setContextRoot(String contextRoot)
+ {
+ this.contextRoot = contextRoot;
+ }
+
+ /**
+ * Serialize as a String
+ *
+ * @return
+ */
+ public String serialize()
+ {
+ StringBuilder builder = new StringBuilder("<port-component>
<port-component-name>");
+ builder.append(portComponentName +
"</port-component-name><wsdl-port>impl:");
+ builder.append(wsdlPort.getLocalPart() +
"</wsdl-port><service-endpoint-interface>");
+ builder.append(serviceEndpointInterface);
+ builder.append("</service-endpoint-interface>");
+ builder.append("<service-impl-bean>");
+ if (ejbLink != null)
+ {
+ builder.append("<ejb-link>");
+ builder.append(ejbLink);
+ builder.append("</ejb-link>");
+
+ }
+ else
+ {
+ builder.append("<servlet-link>");
+ builder.append(servletLink);
+ builder.append("</servlet-link>");
+ }
+ builder.append("</service-impl-bean>");
+ builder.append("</port-component>");
+ return builder.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebserviceDescriptionMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebserviceDescriptionMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebserviceDescriptionMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,176 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.jsr109;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-
-/**
- * XML Binding element for <code>webservices/webservice-description</code>
- *
- * @author Thomas.Diesler(a)jboss.org
- * @version $Revision$
- * @since 15-April-2004
- */
-public class WebserviceDescriptionMetaData
-{
- // provide logging
- private static final Logger log =
Logger.getLogger(WebserviceDescriptionMetaData.class);
-
- // The parent <webservices> element
- private WebservicesMetaData webservices;
-
- // The required <webservice-description-name> element
- private String webserviceDescriptionName;
- // The required <wsdl-file> element
- private String wsdlFile;
- // The required <jaxrpc-mapping-file> element
- private String jaxrpcMappingFile;
- // The required <port-component> elements
- private ArrayList<PortComponentMetaData> portComponents = new
ArrayList<PortComponentMetaData>();
-
- public WebserviceDescriptionMetaData(WebservicesMetaData webservices)
- {
- this.webservices = webservices;
- }
-
- public WebservicesMetaData getWebservices()
- {
- return webservices;
- }
-
- public void addPortComponent(PortComponentMetaData portComponent)
- {
- portComponents.add(portComponent);
- }
-
- public PortComponentMetaData[] getPortComponents()
- {
- PortComponentMetaData[] array = new PortComponentMetaData[portComponents.size()];
- portComponents.toArray(array);
- return array;
- }
-
- /**
- * Get the QNames of the port components to be declared
- * in the namespaces
- *
- * @return
- */
- public Collection getPortComponentQNames()
- {
- //TODO:Check if there is just one QName that drives all portcomponents
- //or each port component can have a distinct QName (namespace/prefix)
- //Maintain uniqueness of the QName
- Map map = new HashMap();
- Iterator iter = portComponents.iterator();
- while (iter != null && iter.hasNext())
- {
- PortComponentMetaData pcm = (PortComponentMetaData)iter.next();
- QName qname = pcm.getWsdlPort();
- map.put(qname.getPrefix(), qname);
- }
- return map.values();
- }
-
- /**
- * Lookup a PortComponentMetaData by wsdl-port local part
- *
- * @param name - the wsdl-port local part
- * @return PortComponentMetaData if found, null otherwise
- */
- public PortComponentMetaData getPortComponentByWsdlPort(String name)
- {
- ArrayList pcNames = new ArrayList();
- Iterator it = portComponents.iterator();
- while (it.hasNext())
- {
- PortComponentMetaData pc = (PortComponentMetaData)it.next();
- String wsdlPortName = pc.getWsdlPort().getLocalPart();
- if (wsdlPortName.equals(name))
- {
- return pc;
- }
- pcNames.add(wsdlPortName);
- }
-
- log.error("Cannot get port component name '" + name + "', we
have: " + pcNames);
- return null;
- }
-
- public String getWebserviceDescriptionName()
- {
- return webserviceDescriptionName;
- }
-
- public void setWebserviceDescriptionName(String webserviceDescriptionName)
- {
- this.webserviceDescriptionName = webserviceDescriptionName;
- }
-
- public String getWsdlFile()
- {
- return wsdlFile;
- }
-
- public void setWsdlFile(String wsdlFile)
- {
- this.wsdlFile = wsdlFile;
- }
-
- public String getJaxrpcMappingFile()
- {
- return jaxrpcMappingFile;
- }
-
- public void setJaxrpcMappingFile(String jaxrpcMappingFile)
- {
- this.jaxrpcMappingFile = jaxrpcMappingFile;
- }
-
- /**
- * Serialize as a String
- *
- * @return
- */
- public String serialize()
- {
- StringBuilder buffer = new StringBuilder("<webservice-description>
<webservice-description-name>");
- buffer.append(this.webserviceDescriptionName);
- buffer.append("</webservice-description-name>");
- buffer.append("<wsdl-file>" + wsdlFile +
"</wsdl-file>");
- buffer.append("<jaxrpc-mapping-file>" + jaxrpcMappingFile +
"</jaxrpc-mapping-file>");
- for (PortComponentMetaData pm : portComponents)
- buffer.append(pm.serialize());
- buffer.append("</webservice-description>");
- return buffer.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebserviceDescriptionMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebserviceDescriptionMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebserviceDescriptionMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebserviceDescriptionMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,176 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.jsr109;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+
+/**
+ * XML Binding element for <code>webservices/webservice-description</code>
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @version $Revision$
+ * @since 15-April-2004
+ */
+public class WebserviceDescriptionMetaData
+{
+ // provide logging
+ private static final Logger log =
Logger.getLogger(WebserviceDescriptionMetaData.class);
+
+ // The parent <webservices> element
+ private WebservicesMetaData webservices;
+
+ // The required <webservice-description-name> element
+ private String webserviceDescriptionName;
+ // The required <wsdl-file> element
+ private String wsdlFile;
+ // The required <jaxrpc-mapping-file> element
+ private String jaxrpcMappingFile;
+ // The required <port-component> elements
+ private ArrayList<PortComponentMetaData> portComponents = new
ArrayList<PortComponentMetaData>();
+
+ public WebserviceDescriptionMetaData(WebservicesMetaData webservices)
+ {
+ this.webservices = webservices;
+ }
+
+ public WebservicesMetaData getWebservices()
+ {
+ return webservices;
+ }
+
+ public void addPortComponent(PortComponentMetaData portComponent)
+ {
+ portComponents.add(portComponent);
+ }
+
+ public PortComponentMetaData[] getPortComponents()
+ {
+ PortComponentMetaData[] array = new PortComponentMetaData[portComponents.size()];
+ portComponents.toArray(array);
+ return array;
+ }
+
+ /**
+ * Get the QNames of the port components to be declared
+ * in the namespaces
+ *
+ * @return
+ */
+ public Collection getPortComponentQNames()
+ {
+ //TODO:Check if there is just one QName that drives all portcomponents
+ //or each port component can have a distinct QName (namespace/prefix)
+ //Maintain uniqueness of the QName
+ Map map = new HashMap();
+ Iterator iter = portComponents.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ PortComponentMetaData pcm = (PortComponentMetaData)iter.next();
+ QName qname = pcm.getWsdlPort();
+ map.put(qname.getPrefix(), qname);
+ }
+ return map.values();
+ }
+
+ /**
+ * Lookup a PortComponentMetaData by wsdl-port local part
+ *
+ * @param name - the wsdl-port local part
+ * @return PortComponentMetaData if found, null otherwise
+ */
+ public PortComponentMetaData getPortComponentByWsdlPort(String name)
+ {
+ ArrayList pcNames = new ArrayList();
+ Iterator it = portComponents.iterator();
+ while (it.hasNext())
+ {
+ PortComponentMetaData pc = (PortComponentMetaData)it.next();
+ String wsdlPortName = pc.getWsdlPort().getLocalPart();
+ if (wsdlPortName.equals(name))
+ {
+ return pc;
+ }
+ pcNames.add(wsdlPortName);
+ }
+
+ log.error("Cannot get port component name '" + name + "', we
have: " + pcNames);
+ return null;
+ }
+
+ public String getWebserviceDescriptionName()
+ {
+ return webserviceDescriptionName;
+ }
+
+ public void setWebserviceDescriptionName(String webserviceDescriptionName)
+ {
+ this.webserviceDescriptionName = webserviceDescriptionName;
+ }
+
+ public String getWsdlFile()
+ {
+ return wsdlFile;
+ }
+
+ public void setWsdlFile(String wsdlFile)
+ {
+ this.wsdlFile = wsdlFile;
+ }
+
+ public String getJaxrpcMappingFile()
+ {
+ return jaxrpcMappingFile;
+ }
+
+ public void setJaxrpcMappingFile(String jaxrpcMappingFile)
+ {
+ this.jaxrpcMappingFile = jaxrpcMappingFile;
+ }
+
+ /**
+ * Serialize as a String
+ *
+ * @return
+ */
+ public String serialize()
+ {
+ StringBuilder buffer = new StringBuilder("<webservice-description>
<webservice-description-name>");
+ buffer.append(this.webserviceDescriptionName);
+ buffer.append("</webservice-description-name>");
+ buffer.append("<wsdl-file>" + wsdlFile +
"</wsdl-file>");
+ buffer.append("<jaxrpc-mapping-file>" + jaxrpcMappingFile +
"</jaxrpc-mapping-file>");
+ for (PortComponentMetaData pm : portComponents)
+ buffer.append(pm.serialize());
+ buffer.append("</webservice-description>");
+ return buffer.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,214 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.jsr109;
-
-// $Id$
-
-import java.net.URL;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A JBossXB factory for {@link WebservicesMetaData}
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Apr-2004
- */
-public class WebservicesFactory implements ObjectModelFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WebservicesFactory.class);
-
- // The URL to the webservices.xml descriptor
- private URL descriptorURL;
-
- public WebservicesFactory(URL descriptorURL)
- {
- this.descriptorURL = descriptorURL;
- }
-
- /**
- * This method is called on the factory by the object model builder when the parsing
starts.
- *
- * @return the root of the object model.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- WebservicesMetaData webservicesMetaData = new WebservicesMetaData(descriptorURL);
- return webservicesMetaData;
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WebservicesMetaData webservices, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("webservice-description".equals(localName))
- return new WebserviceDescriptionMetaData(webservices);
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WebservicesMetaData webservices, WebserviceDescriptionMetaData
webserviceDescription, UnmarshallingContext navigator, String namespaceURI,
- String localName)
- {
- webservices.addWebserviceDescription(webserviceDescription);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WebserviceDescriptionMetaData webserviceDescription,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("port-component".equals(localName))
- return new PortComponentMetaData(webserviceDescription);
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WebserviceDescriptionMetaData webserviceDescription,
PortComponentMetaData portComponent, UnmarshallingContext navigator, String namespaceURI,
- String localName)
- {
- webserviceDescription.addPortComponent(portComponent);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(PortComponentMetaData portComponent, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("handler".equals(localName))
- return new UnifiedHandlerMetaData(null);
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(PortComponentMetaData portComponent, UnifiedHandlerMetaData
handler, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- portComponent.addHandler(handler);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- if ("init-param".equals(localName))
- return new HandlerInitParam();
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(UnifiedHandlerMetaData handler, HandlerInitParam param,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handler.addInitParam(param);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(WebserviceDescriptionMetaData webserviceDescription,
UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("WebserviceDescriptionMetaData setValue: nuri=" +
namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("webservice-description-name"))
- webserviceDescription.setWebserviceDescriptionName(value);
- else if (localName.equals("wsdl-file"))
- webserviceDescription.setWsdlFile(value);
- else if (localName.equals("jaxrpc-mapping-file"))
- webserviceDescription.setJaxrpcMappingFile(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(PortComponentMetaData portComponent, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("PortComponentMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("port-component-name"))
- portComponent.setPortComponentName(value);
- else if (localName.equals("wsdl-port"))
- portComponent.setWsdlPort(navigator.resolveQName(value));
- else if (localName.equals("service-endpoint-interface"))
- portComponent.setServiceEndpointInterface(value);
- else if (localName.equals("ejb-link"))
- portComponent.setEjbLink(value);
- else if (localName.equals("servlet-link"))
- portComponent.setServletLink(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("handler-name"))
- handler.setHandlerName(value);
- else if (localName.equals("handler-class"))
- handler.setHandlerClass(value);
- else if (localName.equals("soap-header"))
- handler.addSoapHeader(navigator.resolveQName(value));
- else if (localName.equals("soap-role"))
- handler.addSoapRole(value);
- else if (localName.equals("port-name"))
- handler.addPortName(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("param-name"))
- param.setParamName(value);
- else if (localName.equals("param-value"))
- param.setParamValue(value);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,214 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.jsr109;
+
+// $Id$
+
+import java.net.URL;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A JBossXB factory for {@link WebservicesMetaData}
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-Apr-2004
+ */
+public class WebservicesFactory implements ObjectModelFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WebservicesFactory.class);
+
+ // The URL to the webservices.xml descriptor
+ private URL descriptorURL;
+
+ public WebservicesFactory(URL descriptorURL)
+ {
+ this.descriptorURL = descriptorURL;
+ }
+
+ /**
+ * This method is called on the factory by the object model builder when the parsing
starts.
+ *
+ * @return the root of the object model.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ WebservicesMetaData webservicesMetaData = new WebservicesMetaData(descriptorURL);
+ return webservicesMetaData;
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
+ {
+ return root;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WebservicesMetaData webservices, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("webservice-description".equals(localName))
+ return new WebserviceDescriptionMetaData(webservices);
+ else return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(WebservicesMetaData webservices, WebserviceDescriptionMetaData
webserviceDescription, UnmarshallingContext navigator, String namespaceURI,
+ String localName)
+ {
+ webservices.addWebserviceDescription(webserviceDescription);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WebserviceDescriptionMetaData webserviceDescription,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("port-component".equals(localName))
+ return new PortComponentMetaData(webserviceDescription);
+ else return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(WebserviceDescriptionMetaData webserviceDescription,
PortComponentMetaData portComponent, UnmarshallingContext navigator, String namespaceURI,
+ String localName)
+ {
+ webserviceDescription.addPortComponent(portComponent);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(PortComponentMetaData portComponent, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("handler".equals(localName))
+ return new UnifiedHandlerMetaData(null);
+ else return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(PortComponentMetaData portComponent, UnifiedHandlerMetaData
handler, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ portComponent.addHandler(handler);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("init-param".equals(localName))
+ return new HandlerInitParam();
+ else return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(UnifiedHandlerMetaData handler, HandlerInitParam param,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ handler.addInitParam(param);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(WebserviceDescriptionMetaData webserviceDescription,
UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("WebserviceDescriptionMetaData setValue: nuri=" +
namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("webservice-description-name"))
+ webserviceDescription.setWebserviceDescriptionName(value);
+ else if (localName.equals("wsdl-file"))
+ webserviceDescription.setWsdlFile(value);
+ else if (localName.equals("jaxrpc-mapping-file"))
+ webserviceDescription.setJaxrpcMappingFile(value);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(PortComponentMetaData portComponent, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("PortComponentMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
+
+ if (localName.equals("port-component-name"))
+ portComponent.setPortComponentName(value);
+ else if (localName.equals("wsdl-port"))
+ portComponent.setWsdlPort(navigator.resolveQName(value));
+ else if (localName.equals("service-endpoint-interface"))
+ portComponent.setServiceEndpointInterface(value);
+ else if (localName.equals("ejb-link"))
+ portComponent.setEjbLink(value);
+ else if (localName.equals("servlet-link"))
+ portComponent.setServletLink(value);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
+
+ if (localName.equals("handler-name"))
+ handler.setHandlerName(value);
+ else if (localName.equals("handler-class"))
+ handler.setHandlerClass(value);
+ else if (localName.equals("soap-header"))
+ handler.addSoapHeader(navigator.resolveQName(value));
+ else if (localName.equals("soap-role"))
+ handler.addSoapRole(value);
+ else if (localName.equals("port-name"))
+ handler.addPortName(value);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
+
+ if (localName.equals("param-name"))
+ param.setParamName(value);
+ else if (localName.equals("param-value"))
+ param.setParamValue(value);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,109 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-// $Id$
-package org.jboss.ws.metadata.jsr109;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.common.Constants;
-
-// $Id$
-
-/**
- * XML Binding root element for <code>webservices.xml</code>
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-April-2004
- */
-public class WebservicesMetaData
-{
- // The required <webservice-description> elements
- private ArrayList<WebserviceDescriptionMetaData> webserviceDescriptions = new
ArrayList<WebserviceDescriptionMetaData>();
-
- // The URL to the webservices.xml descriptor
- private URL descriptorURL;
-
- public WebservicesMetaData()
- {
- }
-
- public WebservicesMetaData(URL descriptorURL)
- {
- this.descriptorURL = descriptorURL;
- }
-
- public URL getDescriptorURL()
- {
- return descriptorURL;
- }
-
- public void addWebserviceDescription(WebserviceDescriptionMetaData
webserviceDescription)
- {
- webserviceDescriptions.add(webserviceDescription);
- }
-
- public WebserviceDescriptionMetaData[] getWebserviceDescriptions()
- {
- WebserviceDescriptionMetaData[] array = new
WebserviceDescriptionMetaData[webserviceDescriptions.size()];
- webserviceDescriptions.toArray(array);
- return array;
- }
-
- //Serialize as a String
- public String serialize()
- {
- StringBuilder buffer = new StringBuilder();
- //Construct the webservices.xml definitions
- List qnames = new ArrayList();
- Iterator iter = webserviceDescriptions.iterator();
- while (iter != null && iter.hasNext())
- {
- WebserviceDescriptionMetaData wmd = (WebserviceDescriptionMetaData)iter.next();
- qnames.addAll(wmd.getPortComponentQNames());
- }
- createHeader(buffer, qnames);
- for (WebserviceDescriptionMetaData wm : webserviceDescriptions)
- buffer.append(wm.serialize());
- buffer.append("</webservices>");
- return buffer.toString();
- }
-
- private void createHeader(StringBuilder buf, List qnames)
- {
- buf.append("<webservices
xmlns='http://java.sun.com/xml/ns/j2ee'");
- buf.append(" xmlns:xsi='" + Constants.NS_SCHEMA_XSI +
"'");
- //Lets append the port type namespaces
- Iterator iter = qnames.iterator();
- while (iter != null && iter.hasNext())
- {
- QName qn = (QName)iter.next();
- buf.append("
xmlns:").append(qn.getPrefix()).append("='").append(qn.getNamespaceURI()).append("'");
- }
- buf.append("
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'");
- buf.append(" version='1.1' >");
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr109/WebservicesMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+// $Id$
+package org.jboss.ws.core.metadata.jsr109;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.Constants;
+
+// $Id$
+
+/**
+ * XML Binding root element for <code>webservices.xml</code>
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-April-2004
+ */
+public class WebservicesMetaData
+{
+ // The required <webservice-description> elements
+ private ArrayList<WebserviceDescriptionMetaData> webserviceDescriptions = new
ArrayList<WebserviceDescriptionMetaData>();
+
+ // The URL to the webservices.xml descriptor
+ private URL descriptorURL;
+
+ public WebservicesMetaData()
+ {
+ }
+
+ public WebservicesMetaData(URL descriptorURL)
+ {
+ this.descriptorURL = descriptorURL;
+ }
+
+ public URL getDescriptorURL()
+ {
+ return descriptorURL;
+ }
+
+ public void addWebserviceDescription(WebserviceDescriptionMetaData
webserviceDescription)
+ {
+ webserviceDescriptions.add(webserviceDescription);
+ }
+
+ public WebserviceDescriptionMetaData[] getWebserviceDescriptions()
+ {
+ WebserviceDescriptionMetaData[] array = new
WebserviceDescriptionMetaData[webserviceDescriptions.size()];
+ webserviceDescriptions.toArray(array);
+ return array;
+ }
+
+ //Serialize as a String
+ public String serialize()
+ {
+ StringBuilder buffer = new StringBuilder();
+ //Construct the webservices.xml definitions
+ List qnames = new ArrayList();
+ Iterator iter = webserviceDescriptions.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ WebserviceDescriptionMetaData wmd = (WebserviceDescriptionMetaData)iter.next();
+ qnames.addAll(wmd.getPortComponentQNames());
+ }
+ createHeader(buffer, qnames);
+ for (WebserviceDescriptionMetaData wm : webserviceDescriptions)
+ buffer.append(wm.serialize());
+ buffer.append("</webservices>");
+ return buffer.toString();
+ }
+
+ private void createHeader(StringBuilder buf, List qnames)
+ {
+ buf.append("<webservices
xmlns='http://java.sun.com/xml/ns/j2ee'");
+ buf.append(" xmlns:xsi='" + Constants.NS_SCHEMA_XSI +
"'");
+ //Lets append the port type namespaces
+ Iterator iter = qnames.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ QName qn = (QName)iter.next();
+ buf.append("
xmlns:").append(qn.getPrefix()).append("='").append(qn.getNamespaceURI()).append("'");
+ }
+ buf.append("
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'");
+ buf.append(" version='1.1' >");
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181 (from rev
1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,164 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jsr181;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A JBossXB factory for jsr181 the HandlerChain annotation
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Oct-2005
- */
-public class HandlerChainFactory implements ObjectModelFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(HandlerChainFactory.class);
-
- public HandlerChainFactory()
- {
- }
-
- /**
- * This method is called on the factory by the object model builder when the parsing
starts.
- *
- * @return the root of the object model.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- HandlerChainsMetaData handlerConfigMetaData = new
HandlerChainsMetaData(HandlerType.ENDPOINT);
- return handlerConfigMetaData;
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainsMetaData handlerConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("handler-chain".equals(localName))
- return new HandlerChainMetaData(handlerConfig);
- else
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(HandlerChainsMetaData handlerConfig, HandlerChainMetaData
handlerChain, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handlerConfig.addHandlerChain(handlerChain);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainMetaData chainConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("handler".equals(localName))
- return new UnifiedHandlerMetaData(chainConfig);
- else
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(HandlerChainMetaData handlerConfig, UnifiedHandlerMetaData
handler, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handlerConfig.addHandler(handler);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- if ("init-param".equals(localName))
- return new HandlerInitParam();
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(UnifiedHandlerMetaData handler, HandlerInitParam param,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handler.addInitParam(param);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(HandlerChainMetaData handlerChain, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("HandlerChainMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("protocol-bindings"))
- handlerChain.setProtocolBindings(value);
- else if (localName.equals("service-name-pattern"))
- handlerChain.setServiceNamePattern(navigator.resolveQName(value));
- else if (localName.equals("port-name-pattern"))
- handlerChain.setPortNamePattern(navigator.resolveQName(value));
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("handler-name"))
- handler.setHandlerName(value);
- else if (localName.equals("handler-class"))
- handler.setHandlerClass(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("param-name"))
- param.setParamName(value);
- else if (localName.equals("param-value"))
- param.setParamValue(value);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,164 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jsr181;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A JBossXB factory for jsr181 the HandlerChain annotation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Oct-2005
+ */
+public class HandlerChainFactory implements ObjectModelFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(HandlerChainFactory.class);
+
+ public HandlerChainFactory()
+ {
+ }
+
+ /**
+ * This method is called on the factory by the object model builder when the parsing
starts.
+ *
+ * @return the root of the object model.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ HandlerChainsMetaData handlerConfigMetaData = new
HandlerChainsMetaData(HandlerType.ENDPOINT);
+ return handlerConfigMetaData;
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
+ {
+ return root;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(HandlerChainsMetaData handlerConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("handler-chain".equals(localName))
+ return new HandlerChainMetaData(handlerConfig);
+ else
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(HandlerChainsMetaData handlerConfig, HandlerChainMetaData
handlerChain, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ handlerConfig.addHandlerChain(handlerChain);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(HandlerChainMetaData chainConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("handler".equals(localName))
+ return new UnifiedHandlerMetaData(chainConfig);
+ else
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(HandlerChainMetaData handlerConfig, UnifiedHandlerMetaData
handler, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ handlerConfig.addHandler(handler);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("init-param".equals(localName))
+ return new HandlerInitParam();
+ else return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(UnifiedHandlerMetaData handler, HandlerInitParam param,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ handler.addInitParam(param);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(HandlerChainMetaData handlerChain, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("HandlerChainMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
+
+ if (localName.equals("protocol-bindings"))
+ handlerChain.setProtocolBindings(value);
+ else if (localName.equals("service-name-pattern"))
+ handlerChain.setServiceNamePattern(navigator.resolveQName(value));
+ else if (localName.equals("port-name-pattern"))
+ handlerChain.setPortNamePattern(navigator.resolveQName(value));
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
+
+ if (localName.equals("handler-name"))
+ handler.setHandlerName(value);
+ else if (localName.equals("handler-class"))
+ handler.setHandlerClass(value);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML
content.
+ */
+ public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
+
+ if (localName.equals("param-name"))
+ param.setParamName(value);
+ else if (localName.equals("param-value"))
+ param.setParamValue(value);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,104 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.jsr181;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * XML Binding element for handler-config/handler-chain elements
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Oct-2005
- */
-public class HandlerChainMetaData
-{
- // provide logging
- private static final Logger log = Logger.getLogger(HandlerChainMetaData.class);
-
- // The parent element
- private HandlerChainsMetaData handlerChainsMetaData;
-
- private String protocolBindings;
- private QName serviceNamePattern;
- private QName portNamePattern;
- private ArrayList<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
-
- public HandlerChainMetaData(HandlerChainsMetaData handlerConfig)
- {
- this.handlerChainsMetaData = handlerConfig;
- }
-
- public HandlerChainsMetaData getHandlerChainsMetaData()
- {
- return handlerChainsMetaData;
- }
-
- public void addHandler(UnifiedHandlerMetaData handlerMetaData)
- {
- handlers.add(handlerMetaData);
- }
-
- public List<UnifiedHandlerMetaData> getHandlers()
- {
- return handlers;
- }
-
- public QName getPortNamePattern()
- {
- return portNamePattern;
- }
-
- public void setPortNamePattern(QName portNamePattern)
- {
- this.portNamePattern = portNamePattern;
- }
-
- public String getProtocolBindings()
- {
- return protocolBindings;
- }
-
- public void setProtocolBindings(String protocolBindings)
- {
- this.protocolBindings = protocolBindings;
- }
-
- public QName getServiceNamePattern()
- {
- return serviceNamePattern;
- }
-
- public void setServiceNamePattern(QName serviceNamePattern)
- {
- this.serviceNamePattern = serviceNamePattern;
- }
-
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,104 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.jsr181;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+
+/**
+ * XML Binding element for handler-config/handler-chain elements
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Oct-2005
+ */
+public class HandlerChainMetaData
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(HandlerChainMetaData.class);
+
+ // The parent element
+ private HandlerChainsMetaData handlerChainsMetaData;
+
+ private String protocolBindings;
+ private QName serviceNamePattern;
+ private QName portNamePattern;
+ private ArrayList<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
+
+ public HandlerChainMetaData(HandlerChainsMetaData handlerConfig)
+ {
+ this.handlerChainsMetaData = handlerConfig;
+ }
+
+ public HandlerChainsMetaData getHandlerChainsMetaData()
+ {
+ return handlerChainsMetaData;
+ }
+
+ public void addHandler(UnifiedHandlerMetaData handlerMetaData)
+ {
+ handlers.add(handlerMetaData);
+ }
+
+ public List<UnifiedHandlerMetaData> getHandlers()
+ {
+ return handlers;
+ }
+
+ public QName getPortNamePattern()
+ {
+ return portNamePattern;
+ }
+
+ public void setPortNamePattern(QName portNamePattern)
+ {
+ this.portNamePattern = portNamePattern;
+ }
+
+ public String getProtocolBindings()
+ {
+ return protocolBindings;
+ }
+
+ public void setProtocolBindings(String protocolBindings)
+ {
+ this.protocolBindings = protocolBindings;
+ }
+
+ public QName getServiceNamePattern()
+ {
+ return serviceNamePattern;
+ }
+
+ public void setServiceNamePattern(QName serviceNamePattern)
+ {
+ this.serviceNamePattern = serviceNamePattern;
+ }
+
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainsMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainsMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,66 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-// $Id$
-package org.jboss.ws.metadata.jsr181;
-
-//$Id$
-
-import java.util.ArrayList;
-
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * XML Binding root element for JSR-181 HandlerChain
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Oct-2005
- */
-public class HandlerChainsMetaData
-{
- // The required handler type
- private HandlerType handlerType;
- // The required <handler-chain> elements
- private ArrayList<HandlerChainMetaData> handlerChains = new
ArrayList<HandlerChainMetaData>();
-
- public HandlerChainsMetaData(HandlerType handlerType)
- {
- this.handlerType = handlerType;
- }
-
- public HandlerType getHandlerType()
- {
- return handlerType;
- }
-
-
- public void addHandlerChain(HandlerChainMetaData handlerChain)
- {
- handlerChains.add(handlerChain);
- }
-
- public HandlerChainMetaData[] getHandlerChains()
- {
- HandlerChainMetaData[] array = new HandlerChainMetaData[handlerChains.size()];
- handlerChains.toArray(array);
- return array;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainsMetaData.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/jsr181/HandlerChainsMetaData.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainsMetaData.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+// $Id$
+package org.jboss.ws.core.metadata.jsr181;
+
+//$Id$
+
+import java.util.ArrayList;
+
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * XML Binding root element for JSR-181 HandlerChain
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Oct-2005
+ */
+public class HandlerChainsMetaData
+{
+ // The required handler type
+ private HandlerType handlerType;
+ // The required <handler-chain> elements
+ private ArrayList<HandlerChainMetaData> handlerChains = new
ArrayList<HandlerChainMetaData>();
+
+ public HandlerChainsMetaData(HandlerType handlerType)
+ {
+ this.handlerType = handlerType;
+ }
+
+ public HandlerType getHandlerType()
+ {
+ return handlerType;
+ }
+
+
+ public void addHandlerChain(HandlerChainMetaData handlerChain)
+ {
+ handlerChains.add(handlerChain);
+ }
+
+ public HandlerChainMetaData[] getHandlerChains()
+ {
+ HandlerChainMetaData[] array = new HandlerChainMetaData[handlerChains.size()];
+ handlerChains.toArray(array);
+ return array;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/DOMTypes.java (from
rev 1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/DOMTypes.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.util.NotImplementedException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * A DOM Element based schema representation. Care should be taken to ensure
+ * thread safety.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class DOMTypes extends WSDLTypes
+{
+ /*
+ * Perhaps we should consider moving this to JDOM, or some other DOM
+ * framework that supports concurrent readers. For now callers must
+ * synchronize properly.
+ *
+ * Also could use a cached StAX pool.
+ */
+ private Element element;
+
+ public DOMTypes(Document doc)
+ {
+ this.element = doc.createElementNS(null, "types");
+ }
+
+ public Element getElement()
+ {
+ return element;
+ }
+
+ public QName getXMLType(QName name)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/Extendable.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/Extendable.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,86 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+
+/**
+ * An abstract base class of a WSDL extendable element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public abstract class Extendable implements Serializable
+{
+ // provide logging
+ private Logger log = Logger.getLogger(getClass());
+
+ private Map features = new LinkedHashMap();
+ private Map properties = new LinkedHashMap();
+
+ public WSDLFeature[] getFeatures()
+ {
+ WSDLFeature[] arr = new WSDLFeature[features.size()];
+ new ArrayList(features.values()).toArray(arr);
+ return arr;
+ }
+
+ public void addFeature(WSDLFeature feature)
+ {
+ log.trace("addFeature: " + feature);
+ String uri = feature.getURI();
+ features.put(uri, feature);
+ }
+
+ public WSDLFeature getFeature(String uri)
+ {
+ WSDLFeature feature = (WSDLFeature)features.get(uri);
+ return feature;
+ }
+
+ public WSDLProperty[] getProperties()
+ {
+ WSDLProperty[] arr = new WSDLProperty[properties.size()];
+ new ArrayList(properties.values()).toArray(arr);
+ return arr;
+ }
+
+ public void addProperty(WSDLProperty property)
+ {
+ log.trace("addProperty: " + property);
+ String uri = property.getURI();
+ properties.put(uri, property);
+ }
+
+ public WSDLProperty getProperty(String uri)
+ {
+ WSDLProperty property = (WSDLProperty)properties.get(uri);
+ return property;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/NCName.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/NCName.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,76 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+// $Id$
+
+
+/**
+ * The value space of the wsdls:NCName type is the subset of the value space of the
wsdls:Token type
+ * consisting of tokens that do not contain the space (#x20) and ':' characters.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class NCName implements Serializable
+{
+ private static final long serialVersionUID = -4997456323552864649L;
+
+ private String name;
+
+ public NCName(QName qname)
+ {
+ this(qname != null ? qname.getLocalPart() : null);
+ }
+
+ public NCName(String name)
+ {
+ if (name == null || name.indexOf(':') >= 0 || name.indexOf(' ')
>= 0)
+ throw new IllegalArgumentException("Illegal NCName: " + name);
+
+ this.name = name;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof NCName)
+ return name.equals(((NCName)obj).name);
+ if (obj instanceof String)
+ return name.equals(((String)obj));
+
+ return false;
+ }
+
+ public int hashCode()
+ {
+ return name.hashCode();
+ }
+
+ public String toString()
+ {
+ return name;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL11DefinitionFactory.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11DefinitionFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11DefinitionFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL11DefinitionFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,100 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+
+import com.ibm.wsdl.xml.WSDLReaderImpl;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLLocator;
+import javax.wsdl.xml.WSDLReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * A factory that creates a WSDL-1.1 <code>Definition</code> from an URL.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-April-2004
+ */
+public class WSDL11DefinitionFactory
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(WSDL11DefinitionFactory.class);
+
+ // This feature is set by default in wsdl4j, it means the object structore contains
the imported arguments
+ public static final String FEATURE_IMPORT_DOCUMENTS =
"javax.wsdl.importDocuments";
+ // Set this feature for additional debugging output
+ public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
+
+ // The WSDLReader that is used by this factory
+ private WSDLReader wsdlReader;
+
+ // Hide constructor
+ private WSDL11DefinitionFactory() throws WSDLException
+ {
+ WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+ wsdlReader = wsdlFactory.newWSDLReader();
+ wsdlReader.setFeature(WSDL11DefinitionFactory.FEATURE_VERBOSE, false);
+ }
+
+ /** Create a new instance of a wsdl factory */
+ public static WSDL11DefinitionFactory newInstance() throws WSDLException
+ {
+ return new WSDL11DefinitionFactory();
+ }
+
+ /** Set a feature on the underlying reader */
+ public void setFeature(String name, boolean value) throws IllegalArgumentException
+ {
+ wsdlReader.setFeature(name, value);
+ }
+
+ /**
+ * Read the wsdl document from the given URL
+ */
+ public Definition parse(URL wsdlLocation) throws WSDLException
+ {
+ if (wsdlLocation == null)
+ throw new IllegalArgumentException("URL cannot be null");
+
+ log.trace("parse: " + wsdlLocation.toExternalForm());
+
+ EntityResolver entityResolver = new JBossWSEntityResolver();
+
+ // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
+ ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
+
+ Definition wsdlDefinition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver,
wsdlLocation));
+ return wsdlDefinition;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL11Reader.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Reader.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Reader.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL11Reader.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,1197 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.wsdl.Binding;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Fault;
+import javax.wsdl.Import;
+import javax.wsdl.Input;
+import javax.wsdl.Message;
+import javax.wsdl.Operation;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.Types;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.wsdl.extensions.mime.MIMEContent;
+import javax.wsdl.extensions.mime.MIMEMultipartRelated;
+import javax.wsdl.extensions.mime.MIMEPart;
+import javax.wsdl.extensions.schema.Schema;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.extensions.soap.SOAPBinding;
+import javax.wsdl.extensions.soap.SOAPBody;
+import javax.wsdl.extensions.soap.SOAPHeader;
+import javax.wsdl.extensions.soap.SOAPOperation;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.tools.JavaToXSD;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * A helper that translates a WSDL-1.1 object graph into a WSDL-2.0 object graph.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @since 10-Oct-2004
+ */
+public class WSDL11Reader
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDL11Reader.class);
+
+ private static QName SOAP12_BINDING = new QName(Constants.NS_SOAP12,
"binding");
+ private static QName SOAP12_BODY = new QName(Constants.NS_SOAP12, "body");
+ private static QName SOAP12_OPERATION = new QName(Constants.NS_SOAP12,
"operation");
+ private static QName SOAP12_ADDRESS = new QName(Constants.NS_SOAP12,
"address");
+
+ private WSDLDefinitions destWsdl;
+
+ // Maps wsdl message parts to their corresponding element names
+ private Map<String, QName> messagePartToElementMap = new HashMap<String,
QName>();
+
+ // Map of <ns,URL> for schemalocation keyed by namespace
+ private Map<String, URL> schemaLocationsMap = new HashMap<String, URL>();
+
+ private LinkedHashMap<QName, Binding> allBindings;
+ private LinkedHashMap<QName, Binding> portTypeBindings;
+
+ // Temporary files used by this reader.
+ private List<File> tempFiles = new ArrayList<File>();
+
+ /**
+ * Takes a WSDL11 Definition element and converts into
+ * our object graph that has been developed for WSDL20
+ *
+ * @param srcWsdl The src WSDL11 definition
+ * @param wsdlLoc The source location, if null we cannot process imports or includes
+ */
+ public WSDLDefinitions processDefinition(Definition srcWsdl, URL wsdlLoc) throws
IOException
+ {
+ log.trace("processDefinition: " + wsdlLoc);
+
+ destWsdl = new WSDLDefinitions();
+ destWsdl.setWsdlTypes(new XSModelTypes());
+ destWsdl.setWsdlOneOneDefinition(srcWsdl);
+ destWsdl.setWsdlNamespace(Constants.NS_WSDL11);
+
+ processNamespaces(srcWsdl);
+ processTypes(srcWsdl, wsdlLoc);
+ processServices(srcWsdl);
+
+ if (getAllDefinedBindings(srcWsdl).size() != destWsdl.getBindings().length)
+ processUnreachableBindings(srcWsdl);
+
+ cleanupTemporaryFiles();
+
+ return destWsdl;
+ }
+
+ private void cleanupTemporaryFiles()
+ {
+ for (File current : tempFiles)
+ {
+ current.delete();
+ }
+ }
+
+ // process all bindings not within service separetly
+ private void processUnreachableBindings(Definition srcWsdl)
+ {
+ log.trace("processUnreachableBindings");
+
+ Iterator it = getAllDefinedBindings(srcWsdl).values().iterator();
+ while (it.hasNext())
+ {
+ Binding srcBinding = (Binding)it.next();
+ QName srcQName = srcBinding.getQName();
+
+ WSDLBinding destBinding = destWsdl.getBinding(new NCName(srcQName));
+ if (destBinding == null)
+ {
+ processBinding(srcWsdl, srcBinding);
+ }
+ }
+ }
+
+ private void processNamespaces(Definition srcWsdl)
+ {
+ String targetNS = srcWsdl.getTargetNamespace();
+ destWsdl.setTargetNamespace(targetNS);
+
+ // Copy wsdl namespaces
+ Map nsMap = srcWsdl.getNamespaces();
+ Iterator iter = nsMap.entrySet().iterator();
+ while (iter.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)iter.next();
+ String prefix = (String)entry.getKey();
+ String nsURI = (String)entry.getValue();
+ destWsdl.registerNamespaceURI(nsURI, prefix);
+ }
+ }
+
+ private void processTypes(Definition srcWsdl, URL wsdlLoc) throws IOException
+ {
+ log.trace("BEGIN processTypes: " + wsdlLoc);
+
+ WSDLTypes destTypes = destWsdl.getWsdlTypes();
+
+ Types srcTypes = srcWsdl.getTypes();
+ if (srcTypes != null && srcTypes.getExtensibilityElements().size() > 0)
+ {
+ List extElements = srcTypes.getExtensibilityElements();
+ int len = extElements.size();
+
+ for (int i = 0; i < len; i++)
+ {
+ ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(i);
+
+ Element domElement;
+ if (extElement instanceof Schema)
+ {
+ domElement = ((Schema)extElement).getElement();
+ }
+ else if (extElement instanceof UnknownExtensibilityElement)
+ {
+ domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ }
+ else
+ {
+ throw new WSException("Unsupported extensibility element: " +
extElement);
+ }
+
+ Element domElementClone = (Element)domElement.cloneNode(true);
+ copyParentNamespaceDeclarations(domElementClone, domElement);
+
+ String localname = domElementClone.getLocalName();
+ try
+ {
+ if ("import".equals(localname))
+ {
+ processSchemaImport(destTypes, wsdlLoc, domElementClone);
+ }
+ else if ("schema".equals(localname))
+ {
+ processSchemaInclude(destTypes, wsdlLoc, domElementClone);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsuported schema element:
" + localname);
+ }
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Cannot extract schema definition", e);
+ }
+ }
+
+ if (len > 0)
+ {
+ JavaToXSD jxsd = new JavaToXSD();
+ JBossXSModel xsmodel = jxsd.parseSchema(schemaLocationsMap);
+ WSDLUtils.addSchemaModel(destTypes, destWsdl.getTargetNamespace(), xsmodel);
+ }
+ }
+ else
+ {
+ log.trace("Empty wsdl types element, processing imports");
+ Iterator it = srcWsdl.getImports().values().iterator();
+ while (it.hasNext())
+ {
+ List<Import> srcImports = (List<Import>)it.next();
+ for (Import srcImport : srcImports)
+ {
+ Definition impDefinition = srcImport.getDefinition();
+ String impLoc = impDefinition.getDocumentBaseURI();
+ processTypes(impDefinition, new URL(impLoc));
+ }
+ }
+ }
+
+ log.trace("END processTypes: " + wsdlLoc + "\n" + destTypes);
+ }
+
+ private void copyParentNamespaceDeclarations(Element destElement, Element srcElement)
+ {
+ Node parent = srcElement.getParentNode();
+ while (parent != null)
+ {
+ if (parent.hasAttributes())
+ {
+ NamedNodeMap attributes = parent.getAttributes();
+ for (int i = 0; i < attributes.getLength(); i++)
+ {
+ Attr attr = (Attr)attributes.item(i);
+ String name = attr.getName();
+ String value = attr.getValue();
+ if (name.startsWith("xmlns:") &&
destElement.hasAttribute(name) == false)
+ destElement.setAttribute(name, value);
+ }
+ }
+ parent = parent.getParentNode();
+ }
+ }
+
+ private void processSchemaImport(WSDLTypes types, URL wsdlLoc, Element importEl)
throws IOException
+ {
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process import, parent location
not set");
+
+ log.trace("processSchemaImport: " + wsdlLoc);
+
+ String location = getOptionalAttribute(importEl, "schemaLocation");
+ if (location == null)
+ throw new IllegalArgumentException("schemaLocation is null for
xsd:import");
+
+ URL locationURL = getLocationURL(wsdlLoc, location);
+ Element rootElement = DOMUtils.parse(locationURL.openStream());
+ URL newloc = processSchemaInclude(types, locationURL, rootElement);
+ if (newloc != null)
+ importEl.setAttribute("schemaLocation", newloc.toExternalForm());
+ }
+
+ private URL processSchemaInclude(WSDLTypes types, URL wsdlLoc, Element schemaEl)
throws IOException
+ {
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process iclude, parent location
not set");
+
+ File tmpFile = null;
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process include, parent location
not set");
+
+ log.trace("processSchemaInclude: " + wsdlLoc);
+
+ String schemaPrefix = schemaEl.getPrefix();
+
+ String importTag = (schemaPrefix == null) ? "import" : schemaPrefix +
":import";
+ Element importElement =
schemaEl.getOwnerDocument().createElementNS(Constants.NS_SCHEMA_XSD, importTag);
+ importElement.setAttribute("namespace", Constants.URI_SOAP11_ENC);
+ schemaEl.insertBefore(importElement, DOMUtils.getFirstChildElement(schemaEl));
+
+ // Handle schema includes
+ Iterator it = DOMUtils.getChildElements(schemaEl, new
QName(Constants.NS_SCHEMA_XSD, "include"));
+ while (it.hasNext())
+ {
+ Element includeEl = (Element)it.next();
+ String location = getOptionalAttribute(includeEl, "schemaLocation");
+ if (location == null)
+ throw new IllegalArgumentException("schemaLocation is null for
xsd:include");
+
+ URL locationURL = getLocationURL(wsdlLoc, location);
+ Element rootElement = DOMUtils.parse(locationURL.openStream());
+ URL newloc = processSchemaInclude(types, locationURL, rootElement);
+ if (newloc != null)
+ includeEl.setAttribute("schemaLocation", newloc.toExternalForm());
+ }
+
+ String targetNS = getOptionalAttribute(schemaEl, "targetNamespace");
+ if (targetNS != null)
+ {
+ log.trace("processSchemaInclude: [targetNS=" + targetNS +
",parentURL=" + wsdlLoc + "]");
+
+ tmpFile = SchemaUtils.getSchemaTempFile(targetNS);
+ tempFiles.add(tmpFile);
+
+ FileWriter fwrite = new FileWriter(tmpFile);
+ new DOMWriter(fwrite).setPrettyprint(true).print(schemaEl);
+ fwrite.close();
+
+ schemaLocationsMap.put(targetNS, tmpFile.toURL());
+ }
+
+ // schema elements that have no target namespace are skipped
+ //
+ // <xsd:schema>
+ // <xsd:import
namespace="http://org.jboss.webservice/example/types"
schemaLocation="Hello.xsd"/>
+ // <xsd:import
namespace="http://org.jboss.webservice/example/types/arrays/org/jboss/test/webservice/admindevel"
schemaLocation="subdir/HelloArr.xsd"/>
+ // </xsd:schema>
+ if (targetNS == null)
+ {
+ log.trace("Schema element without target namespace in: " + wsdlLoc);
+ }
+
+ handleSchemaImports(schemaEl, wsdlLoc);
+
+ return tmpFile != null ? tmpFile.toURL() : null;
+ }
+
+ private void handleSchemaImports(Element schemaEl, URL wsdlLoc) throws
MalformedURLException
+ {
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process import, parent location
not set");
+
+ Iterator it = DOMUtils.getChildElements(schemaEl, new
QName(Constants.NS_SCHEMA_XSD, "import"));
+ while (it.hasNext())
+ {
+ Element includeEl = (Element)it.next();
+ String schemaLocation = getOptionalAttribute(includeEl,
"schemaLocation");
+ String namespace = getOptionalAttribute(includeEl, "namespace");
+
+ log.trace("handleSchemaImport: [namespace=" + namespace +
",schemaLocation=" + schemaLocation + "]");
+
+ // Skip, let the entity resolver resolve these
+ if (namespace != null && schemaLocation != null)
+ {
+ URL currLoc = getLocationURL(wsdlLoc, schemaLocation);
+ schemaLocationsMap.put(namespace, currLoc);
+ }
+ else
+ {
+ log.trace("Skip schema import: [namespace=" + namespace +
",schemaLocation=" + schemaLocation + "]");
+ }
+ }
+ }
+
+ private URL getLocationURL(URL parentURL, String location) throws
MalformedURLException
+ {
+ log.trace("getLocationURL: [location=" + location + ",parent="
+ parentURL + "]");
+
+ URL locationURL = null;
+ try
+ {
+ locationURL = new URL(location);
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore malformed URL
+ }
+
+ if (locationURL == null)
+ {
+ String parentProtocol = parentURL.getProtocol();
+ if (parentProtocol.equals("file") &&
!location.startsWith("/"))
+ {
+ String path = parentURL.toExternalForm();
+ path = path.substring(0, path.lastIndexOf("/"));
+ locationURL = new URL(path + "/" + location);
+ }
+ else if (parentProtocol.startsWith("http") &&
location.startsWith("/"))
+ {
+ String path = parentProtocol + "://" + parentURL.getHost() +
":" + parentURL.getPort();
+ locationURL = new URL(path + location);
+ }
+ else if (parentProtocol.equals("jar") &&
!location.startsWith("/"))
+ {
+ String path = parentURL.toExternalForm();
+ path = path.substring(0, path.lastIndexOf("/"));
+ locationURL = new URL(path + "/" + location);
+ }
+ else
+ {
+ throw new WSException("Unsupported schemaLocation: " + location);
+ }
+ }
+
+ log.trace("Modified schemaLocation: " + locationURL);
+ return locationURL;
+ }
+
+ private void processPortType(Definition srcWsdl, PortType srcPortType)
+ {
+ log.trace("processPortType: " + srcPortType.getQName());
+
+ QName qname = srcPortType.getQName();
+ NCName ncName = new NCName(qname);
+ if (destWsdl.getInterface(ncName) == null)
+ {
+ WSDLInterface destInterface = new WSDLInterface(destWsdl);
+ destInterface.setName(ncName);
+ destInterface.setQName(qname);
+
+ // eventing extensions
+ QName eventSourceProp =
(QName)srcPortType.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSE_EVENTSOURCE);
+ if (eventSourceProp != null &&
eventSourceProp.getLocalPart().equals(Boolean.TRUE.toString()))
+ {
+ destInterface.addProperty(new
WSDLProperty(Constants.WSDL_PROPERTY_EVENTSOURCE, eventSourceProp.getLocalPart()));
+ }
+
+ destWsdl.addInterface(destInterface);
+
+ processPortTypeOperations(srcWsdl, destInterface, srcPortType);
+ }
+ }
+
+ private void processPortTypeOperations(Definition srcWsdl, WSDLInterface
destInterface, PortType srcPortType)
+ {
+ Iterator itOperations = srcPortType.getOperations().iterator();
+ while (itOperations.hasNext())
+ {
+ Operation srcOperation = (Operation)itOperations.next();
+
+ WSDLInterfaceOperation destOperation = new
WSDLInterfaceOperation(destInterface);
+ destOperation.setName(new NCName(srcOperation.getName()));
+ destOperation.setStyle(getOperationStyle(srcWsdl, srcPortType, srcOperation));
+
+ processOperationInput(srcWsdl, srcOperation, destOperation, srcPortType);
+ processOperationOutput(srcWsdl, srcOperation, destOperation, srcPortType);
+ processOperationFaults(srcOperation, destOperation, destInterface);
+
+ destInterface.addOperation(destOperation);
+ }
+ }
+
+ private void processOperationInput(Definition srcWsdl, Operation srcOperation,
WSDLInterfaceOperation destOperation, PortType srcPortType)
+ {
+ Input srcInput = srcOperation.getInput();
+ if (srcInput != null)
+ {
+ Message srcMessage = srcInput.getMessage();
+ log.trace("processOperationInput: " + srcMessage.getQName());
+
+ QName wsaAction =
(QName)srcInput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
+ if (wsaAction != null)
+ destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_IN,
wsaAction.getLocalPart()));
+
+ List<String> paramOrder = (List<String>)
srcOperation.getParameterOrdering();
+ if (paramOrder != null)
+ {
+ for (String name : paramOrder)
+ {
+ if (srcMessage.getPart(name) != null)
+ destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name));
+ }
+ }
+
+ WSDLInterfaceOperationInput rpcInput = new
WSDLInterfaceOperationInput(destOperation);
+ for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(paramOrder))
+ {
+ if (Constants.URI_STYLE_IRI == destOperation.getStyle())
+ {
+ WSDLInterfaceOperationInput destInput = new
WSDLInterfaceOperationInput(destOperation);
+ QName elementName = messagePartToElementName(srcWsdl, srcPortType,
srcOperation, srcMessage, srcPart);
+ destInput.setElement(elementName);
+
+ //Lets remember the Message name
+ destInput.setMessageName(srcMessage.getQName());
+ destOperation.addProperty(new
WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN,
srcMessage.getQName().getLocalPart()));
+
+ destInput.setPartName(srcPart.getName());
+
+ destOperation.addInput(destInput);
+ }
+ else
+ {
+ // If we don't have a type then we aren't a valid RPC parameter
+ // This could happen on a header element, in which case the
+ // binding will pick it up
+ QName xmlType = srcPart.getTypeName();
+ if (xmlType != null)
+ rpcInput.addChildPart(new WSDLRPCPart(srcPart.getName(),
destWsdl.registerQName(xmlType)));
+ else
+ messagePartToElementName(srcWsdl, srcPortType, srcOperation,
srcMessage, srcPart);
+ }
+ }
+ if (Constants.URI_STYLE_RPC == destOperation.getStyle())
+ {
+ // This is really a place holder, but also the actual value used in
+ // WSDL 2.0 RPC bindings
+ rpcInput.setElement(destOperation.getQName());
+ rpcInput.setMessageName(srcMessage.getQName());
+ destOperation.addInput(rpcInput);
+ }
+ }
+ }
+
+ private void processOperationOutput(Definition srcWsdl, Operation srcOperation,
WSDLInterfaceOperation destOperation, PortType srcPortType)
+ {
+ Output srcOutput = srcOperation.getOutput();
+ if (srcOutput == null)
+ {
+ destOperation.setPattern(Constants.WSDL20_PATTERN_IN_ONLY);
+ return;
+ }
+
+ Message srcMessage = srcOutput.getMessage();
+ log.trace("processOperationOutput: " + srcMessage.getQName());
+
+ destOperation.setPattern(Constants.WSDL20_PATTERN_IN_OUT);
+ QName wsaAction = (QName)
srcOutput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
+ if (wsaAction != null)
+ destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_OUT,
wsaAction.getLocalPart()));
+
+ List<String> paramOrder = (List<String>)
srcOperation.getParameterOrdering();
+ if (paramOrder != null)
+ {
+ for (String name : paramOrder)
+ {
+ if (srcMessage.getPart(name) != null)
+ {
+ WSDLRPCSignatureItem item = destOperation.getRpcSignatureitem(name);
+ if (item != null)
+ item.setDirection(Direction.INOUT);
+ else
+ destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name,
Direction.OUT));
+ }
+ }
+ }
+
+ WSDLInterfaceOperationOutput rpcOutput = new
WSDLInterfaceOperationOutput(destOperation);
+ for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(null))
+ {
+ if (Constants.URI_STYLE_IRI == destOperation.getStyle())
+ {
+ WSDLInterfaceOperationOutput destOutput = new
WSDLInterfaceOperationOutput(destOperation);
+
+ QName elementName = messagePartToElementName(srcWsdl, srcPortType,
srcOperation, srcMessage, srcPart);
+ destOutput.setElement(elementName);
+
+ // Lets remember the Message name
+ destOutput.setMessageName(srcMessage.getQName());
+ destOperation.addProperty(new
WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT, srcMessage.getQName()
+ .getLocalPart()));
+
+ // Remember the original part name
+ destOutput.setPartName(srcPart.getName());
+
+ destOperation.addOutput(destOutput);
+ }
+ else
+ {
+ // If we don't have a type then we aren't a valid RPC parameter
+ // This could happen on a header element, in which case the
+ // binding will pick it up
+ QName xmlType = srcPart.getTypeName();
+ if (xmlType != null)
+ rpcOutput.addChildPart(new WSDLRPCPart(srcPart.getName(),
destWsdl.registerQName(xmlType)));
+ else
+ messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage,
srcPart);
+ }
+ }
+
+ if (Constants.URI_STYLE_RPC == destOperation.getStyle())
+ {
+ // This is really a place holder, but also the actual value used in
+ // WSDL 2.0 RPC bindings
+ QName name = destOperation.getQName();
+ rpcOutput.setElement(new QName(name.getNamespaceURI(), name.getLocalPart() +
"Response"));
+ rpcOutput.setMessageName(srcMessage.getQName());
+ destOperation.addOutput(rpcOutput);
+ }
+ }
+
+ private void processOperationFaults(Operation srcOperation, WSDLInterfaceOperation
destOperation, WSDLInterface destInterface)
+ {
+
+ Map faults = srcOperation.getFaults();
+ Iterator itFaults = faults.values().iterator();
+ while (itFaults.hasNext())
+ {
+ Fault srcFault = (Fault)itFaults.next();
+ processOperationFault(destOperation, destInterface, srcFault);
+ }
+ }
+
+ private void processOperationFault(WSDLInterfaceOperation destOperation, WSDLInterface
destInterface, Fault srcFault)
+ {
+ String faultName = srcFault.getName();
+ log.trace("processOperationFault: " + faultName);
+
+ WSDLInterfaceFault destFault = new WSDLInterfaceFault(destInterface);
+ NCName ncName = new NCName(faultName);
+ destFault.setName(ncName);
+
+ Message message = srcFault.getMessage();
+ QName messageName = message.getQName();
+
+ Map partsMap = message.getParts();
+ if (partsMap.size() != 1)
+ throw new WSException("Unsupported number of fault parts in message "
+ messageName);
+
+ Part part = (Part)partsMap.values().iterator().next();
+ QName xmlName = part.getElementName();
+
+ if (xmlName != null)
+ {
+ destFault.setElement(xmlName);
+ }
+ else
+ {
+ destFault.setElement(messageName);
+ log.warn("Unsupported fault message part in message: " +
messageName);
+ }
+
+ WSDLInterfaceFault prevFault = destInterface.getFault(ncName);
+ if (prevFault != null && prevFault.getName().equals(ncName) == false)
+ throw new WSException("Fault name must be unique: " + faultName);
+
+ // Add the fault to the interface
+ destInterface.addFault(destFault);
+
+ // Add the fault refererence to the operation
+ WSDLInterfaceOperationOutfault opOutFault = new
WSDLInterfaceOperationOutfault(destOperation);
+ opOutFault.setRef(new QName(destWsdl.getTargetNamespace(), faultName));
+ destOperation.addOutfault(opOutFault);
+ }
+
+ /** Translate the message part name into an XML element name.
+ */
+ private QName messagePartToElementName(Definition srcWsdl, PortType srcPortType,
Operation srcOperation, Message srcMessage, Part srcPart)
+ {
+ // <part name="param" element="tns:SomeType" />
+ QName xmlName = srcPart.getElementName();
+
+ // <part name="param" type="xsd:string" />
+ if (xmlName == null)
+ xmlName = new QName(srcPart.getName());
+
+ xmlName = destWsdl.registerQName(xmlName);
+ String key = srcMessage.getQName() + "->" + srcPart.getName();
+ messagePartToElementMap.put(key, xmlName);
+
+ return xmlName;
+ }
+
+ private BindingOperation getBindingOperation(Definition srcWsdl, PortType srcPortType,
Operation srcOperation)
+ {
+ Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
+
+ if (srcBinding == null)
+ throw new WSException("Cannot find binding for: " +
srcPortType.getQName());
+
+ String srcOperationName = srcOperation.getName();
+ BindingOperation srcBindingOperation =
srcBinding.getBindingOperation(srcOperationName, null, null);
+ if (srcBindingOperation == null)
+ throw new WSException("Cannot find binding operation for: " +
srcOperationName);
+ return srcBindingOperation;
+ }
+
+ private String getOperationStyle(Definition srcWsdl, PortType srcPortType, Operation
srcOperation)
+ {
+ Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
+ BindingOperation srcBindingOperation = getBindingOperation(srcWsdl, srcPortType,
srcOperation);
+
+ String operationStyle = null;
+ List<ExtensibilityElement> extList =
srcBindingOperation.getExtensibilityElements();
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPOperation)
+ {
+ SOAPOperation soapOp = (SOAPOperation)extElement;
+ operationStyle = soapOp.getStyle();
+ }
+ else if (SOAP12_OPERATION.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ operationStyle = getOptionalAttribute(domElement, "style");
+ }
+ }
+
+ if (operationStyle == null)
+ {
+ for (ExtensibilityElement extElement : (List<ExtensibilityElement>)
srcBinding.getExtensibilityElements())
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPBinding)
+ {
+ SOAPBinding soapBinding = (SOAPBinding) extElement;
+ operationStyle = soapBinding.getStyle();
+ }
+ else if (SOAP12_BINDING.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)
extElement).getElement();
+ operationStyle = getOptionalAttribute(domElement, "style");
+ }
+ }
+ }
+
+ return ("rpc".equals(operationStyle)) ? Constants.URI_STYLE_RPC :
Constants.URI_STYLE_IRI;
+ }
+
+ private void processBinding(Definition srcWsdl, Binding srcBinding)
+ {
+ QName srcBindingQName = srcBinding.getQName();
+ log.trace("processBinding: " + srcBindingQName);
+
+ NCName ncName = new NCName(srcBindingQName);
+ if (destWsdl.getBinding(ncName) == null)
+ {
+ PortType srcPortType = srcBinding.getPortType();
+ if (srcPortType == null)
+ throw new WSException("Cannot find port type for binding: " +
ncName);
+
+ processPortType(srcWsdl, srcPortType);
+
+ WSDLBinding destBinding = new WSDLBinding(destWsdl);
+ destBinding.setQName(srcBindingQName);
+ destBinding.setName(ncName);
+ destBinding.setInterfaceName(srcPortType.getQName());
+
+ String bindingStyle = Style.getDefaultStyle().toString();
+ List<ExtensibilityElement> extList =
srcBinding.getExtensibilityElements();
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPBinding)
+ {
+ destBinding.setType(Constants.NS_SOAP11);
+ SOAPBinding soapBinding = (SOAPBinding)extElement;
+ bindingStyle = soapBinding.getStyle();
+ }
+ else if (SOAP12_BINDING.equals(elementType))
+ {
+ destBinding.setType(Constants.NS_SOAP12);
+ Element domElement =
((UnknownExtensibilityElement)extElement).getElement();
+ bindingStyle = getOptionalAttribute(domElement, "style");
+ }
+ }
+ destWsdl.addBinding(destBinding);
+ processBindingOperations(destBinding, srcBinding, bindingStyle);
+ }
+ }
+
+ private Map<QName, Binding> getPortTypeBindings(Definition srcWsdl)
+ {
+ getAllDefinedBindings(srcWsdl);
+ return portTypeBindings;
+ }
+
+ private Map<QName, Binding> getAllDefinedBindings(Definition srcWsdl)
+ {
+ if (allBindings != null)
+ return allBindings;
+
+ allBindings = new LinkedHashMap<QName, Binding>();
+ portTypeBindings = new LinkedHashMap<QName, Binding>();
+ Map srcBindings = srcWsdl.getBindings();
+ Iterator itBinding = srcBindings.values().iterator();
+ while (itBinding.hasNext())
+ {
+ Binding srcBinding = (Binding)itBinding.next();
+ allBindings.put(srcBinding.getQName(), srcBinding);
+ portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
+ }
+
+ // Bindings not available when pulled in through <wsdl:import>
+ //
http://sourceforge.net/tracker/index.php?func=detail&aid=1240323&...
+ Iterator itService = srcWsdl.getServices().values().iterator();
+ while (itService.hasNext())
+ {
+ Service srcService = (Service)itService.next();
+ Iterator itPort = srcService.getPorts().values().iterator();
+ while (itPort.hasNext())
+ {
+ Port srcPort = (Port)itPort.next();
+ Binding srcBinding = srcPort.getBinding();
+ allBindings.put(srcBinding.getQName(), srcBinding);
+ portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
+ }
+ }
+
+ return allBindings;
+ }
+
+ private void processBindingOperations(WSDLBinding destBinding, Binding srcBinding,
String bindingStyle)
+ {
+ Iterator it = srcBinding.getBindingOperations().iterator();
+ while (it.hasNext())
+ {
+ BindingOperation srcBindingOperation = (BindingOperation)it.next();
+ processBindingOperation(destBinding, bindingStyle, srcBindingOperation);
+ }
+ }
+
+ private void processBindingOperation(WSDLBinding destBinding, String bindingStyle,
BindingOperation srcBindingOperation)
+ {
+ String srcBindingName = srcBindingOperation.getName();
+ log.trace("processBindingOperation: " + srcBindingName);
+
+ WSDLInterface destInterface = destBinding.getInterface();
+ String namespaceURI = destInterface.getQName().getNamespaceURI();
+
+ WSDLBindingOperation destBindingOperation = new WSDLBindingOperation(destBinding);
+ QName refQName = new QName(namespaceURI, srcBindingName);
+ destBindingOperation.setRef(refQName);
+ destBinding.addOperation(destBindingOperation);
+
+ String opName = srcBindingName;
+ WSDLInterfaceOperation destIntfOperation = destInterface.getOperation(new
NCName(opName));
+
+ // Process soap:operation@soapAction, soap:operation@style
+ List<ExtensibilityElement> extList =
srcBindingOperation.getExtensibilityElements();
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPOperation)
+ {
+ SOAPOperation soapOp = (SOAPOperation)extElement;
+ destBindingOperation.setSOAPAction(soapOp.getSoapActionURI());
+ }
+ else if (SOAP12_OPERATION.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ destBindingOperation.setSOAPAction(getOptionalAttribute(domElement,
"soapAction"));
+ }
+ }
+
+ BindingInput srcBindingInput = srcBindingOperation.getBindingInput();
+ if (srcBindingInput != null)
+ {
+ processBindingInput(destBindingOperation, destIntfOperation,
srcBindingOperation, srcBindingInput);
+ }
+
+ BindingOutput srcBindingOutput = srcBindingOperation.getBindingOutput();
+ if (srcBindingOutput != null)
+ {
+ processBindingOutput(destBindingOperation, destIntfOperation,
srcBindingOperation, srcBindingOutput);
+ }
+ }
+
+ interface ReferenceCallback
+ {
+ void removeReference(QName element);
+ void removeRPCPart(String partName);
+ QName getXmlType(String partName);
+ }
+
+ private void processBindingInput(WSDLBindingOperation destBindingOperation, final
WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation,
BindingInput srcBindingInput)
+ {
+ log.trace("processBindingInput");
+
+ QName soap11Body = new QName(Constants.NS_SOAP11, "body");
+ List<ExtensibilityElement> extList =
srcBindingInput.getExtensibilityElements();
+ WSDLBindingOperationInput input = new
WSDLBindingOperationInput(destBindingOperation);
+ destBindingOperation.addInput(input);
+
+ ReferenceCallback cb = new ReferenceCallback()
+ {
+ public QName getXmlType(String partName)
+ {
+ return
srcBindingOperation.getOperation().getInput().getMessage().getPart(partName).getTypeName();
+ }
+
+ public void removeReference(QName element)
+ {
+ WSDLInterfaceOperationInput destIntfInput =
destIntfOperation.getInput(element);
+ if (destIntfInput == null)
+ destIntfOperation.removeInput(element);
+ }
+
+ public void removeRPCPart(String partName)
+ {
+ WSDLInterfaceOperationInput operationInput =
destIntfOperation.getInput(destIntfOperation.getQName());
+ operationInput.removeChildPart(partName);
+ }
+ };
+
+ processBindingReference(destBindingOperation, destIntfOperation, soap11Body,
extList, input, cb);
+ }
+
+ private void processBindingOutput(WSDLBindingOperation destBindingOperation, final
WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation,
BindingOutput srcBindingOutput)
+ {
+ log.trace("processBindingInput");
+
+ QName soap11Body = new QName(Constants.NS_SOAP11, "body");
+ List<ExtensibilityElement> extList =
srcBindingOutput.getExtensibilityElements();
+ WSDLBindingOperationOutput output = new
WSDLBindingOperationOutput(destBindingOperation);
+ destBindingOperation.addOutput(output);
+
+ ReferenceCallback cb = new ReferenceCallback()
+ {
+ public QName getXmlType(String partName)
+ {
+ return
srcBindingOperation.getOperation().getOutput().getMessage().getPart(partName).getTypeName();
+ }
+
+ public void removeReference(QName element)
+ {
+ WSDLInterfaceOperationOutput destIntfOutput =
destIntfOperation.getOutput(element);
+ if (destIntfOutput == null)
+ destIntfOperation.removeInput(element);
+ }
+
+ public void removeRPCPart(String partName)
+ {
+ QName name = destIntfOperation.getQName();
+ WSDLInterfaceOperationOutput operationOutput =
destIntfOperation.getOutput(new QName(name.getNamespaceURI(), name.getLocalPart() +
"Response"));
+ operationOutput.removeChildPart(partName);
+ }
+ };
+
+ processBindingReference(destBindingOperation, destIntfOperation, soap11Body,
extList, output, cb);
+ }
+
+
+ private void processBindingReference(WSDLBindingOperation destBindingOperation,
WSDLInterfaceOperation destIntfOperation,
+ QName soap11Body, List<ExtensibilityElement> extList,
WSDLBindingMessageReference reference, ReferenceCallback callback)
+ {
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (soap11Body.equals(elementType) || SOAP12_BODY.equals(elementType))
+ {
+ processEncodingStyle(extElement, destBindingOperation);
+ }
+ else if (extElement instanceof SOAPHeader)
+ {
+ SOAPHeader header = (SOAPHeader)extElement;
+ QName messageQName = header.getMessage();
+ String partName = header.getPart();
+
+ String key = messageQName + "->" + partName;
+ QName elementName = (QName)messagePartToElementMap.get(key);
+ if (elementName == null)
+ throw new WSException("Could not determine element name from header:
" + partName);
+
+ reference.addSoapHeader(new WSDLSOAPHeader(elementName, partName));
+ if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
+ {
+ callback.removeReference(elementName);
+ }
+ else
+ {
+ // Just in case
+ callback.removeRPCPart(partName);
+ }
+ }
+ else if (extElement instanceof MIMEMultipartRelated)
+ {
+ MIMEMultipartRelated related = (MIMEMultipartRelated)extElement;
+ Iterator i = related.getMIMEParts().iterator();
+ while (i.hasNext())
+ {
+ MIMEPart part = (MIMEPart)i.next();
+ Iterator j = part.getExtensibilityElements().iterator();
+ String name = null;
+ String types = null;
+
+ while (j.hasNext())
+ {
+ ExtensibilityElement inner = (ExtensibilityElement)j.next();
+ if (inner instanceof MIMEContent)
+ {
+ MIMEContent content = (MIMEContent)inner;
+ name = content.getPart();
+ if (types == null)
+ {
+ types = content.getType();
+ }
+ else
+ {
+ types += "," + content.getType();
+ }
+ }
+ }
+
+ // Found content types in this part
+ if (name != null)
+ {
+ QName xmlType = callback.getXmlType(name);
+ reference.addMimePart(new WSDLMIMEPart(name, xmlType, types));
+ if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
+ {
+ // A mime part must be defined as <part type="">
+ callback.removeReference(new QName(name));
+ }
+ else
+ {
+ callback.removeRPCPart(name);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ private void processEncodingStyle(ExtensibilityElement extElement,
WSDLBindingOperation destBindingOperation)
+ {
+ log.trace("processEncodingStyle");
+
+ String encStyle = null;
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPBody)
+ {
+ SOAPBody body = (SOAPBody)extElement;
+ List encStyleList = body.getEncodingStyles();
+ if (encStyleList != null)
+ {
+ if (encStyleList.size() > 1)
+ log.warn("Multiple encoding styles not supported: " +
encStyleList);
+
+ if (encStyleList.size() > 0)
+ {
+ encStyle = (String)encStyleList.get(0);
+ }
+ }
+ }
+ else if (SOAP12_BODY.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ encStyle = getOptionalAttribute(domElement, "encodingStyle");
+ }
+
+ if (encStyle != null)
+ {
+ String setStyle = destBindingOperation.getEncodingStyle();
+ if (encStyle.equals(setStyle) == false)
+ log.warn("Encoding style '" + encStyle + "' not
supported for: " + destBindingOperation.getRef());
+
+ destBindingOperation.setEncodingStyle(encStyle);
+ }
+ }
+
+ private void processServices(Definition srcWsdl)
+ {
+ log.trace("BEGIN processServices: " + srcWsdl.getDocumentBaseURI());
+
+ // Each definition needs a clear binding cache
+ allBindings = null;
+
+ if (srcWsdl.getServices().size() > 0)
+ {
+ Iterator it = srcWsdl.getServices().values().iterator();
+ while (it.hasNext())
+ {
+ Service srcService = (Service)it.next();
+ QName qname = srcService.getQName();
+ WSDLService destService = new WSDLService(destWsdl);
+ destService.setName(new NCName(qname));
+ destService.setQName(qname);
+ destWsdl.addService(destService);
+ processPorts(srcWsdl, destService, srcService);
+ }
+ }
+ else
+ {
+ log.trace("Empty wsdl services, processing imports");
+ Iterator it = srcWsdl.getImports().values().iterator();
+ while (it.hasNext())
+ {
+ List<Import> srcImports = (List<Import>)it.next();
+ for (Import srcImport : srcImports)
+ {
+ Definition importDefinition = srcImport.getDefinition();
+ processServices(importDefinition);
+ }
+ }
+
+ // The binding cache must be clear after imports, so that undefined bindings can
be located
+ allBindings = null;
+ }
+
+ log.trace("END processServices: " + srcWsdl.getDocumentBaseURI());
+ }
+
+ private void processPorts(Definition srcWsdl, WSDLService destService, Service
srcService)
+ {
+ Iterator it = srcService.getPorts().values().iterator();
+ while (it.hasNext())
+ {
+ Port srcPort = (Port)it.next();
+ processPort(srcWsdl, destService, srcPort);
+ }
+ }
+
+ private void processPort(Definition srcWsdl, WSDLService destService, Port srcPort)
+ {
+ log.trace("processPort: " + srcPort.getName());
+
+ Binding srcBinding = srcPort.getBinding();
+
+ WSDLEndpoint destEndpoint = new WSDLEndpoint(destService);
+ destEndpoint.setName(new NCName(srcPort.getName()));
+ destEndpoint.setBinding(srcBinding.getQName());
+ destEndpoint.setQName(new QName(srcWsdl.getTargetNamespace(), srcPort.getName()));
+ destEndpoint.setAddress(getSOAPAddress(srcPort));
+ destService.addEndpoint(destEndpoint);
+
+ processBinding(srcWsdl, srcBinding);
+ }
+
+ /** Get the endpoint address from the ports extensible element
+ */
+ private String getSOAPAddress(Port srcPort)
+ {
+ String soapAddress = "dummy";
+
+ Iterator it = srcPort.getExtensibilityElements().iterator();
+ while (it.hasNext())
+ {
+ ExtensibilityElement extElement = (ExtensibilityElement)it.next();
+ QName elementType = extElement.getElementType();
+
+ if (extElement instanceof SOAPAddress)
+ {
+ SOAPAddress addr = (SOAPAddress)extElement;
+ soapAddress = addr.getLocationURI();
+ break;
+ }
+ else if (SOAP12_ADDRESS.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ soapAddress = getOptionalAttribute(domElement, "location");
+ break;
+ }
+ else if ("address".equals(elementType.getLocalPart()))
+ {
+ log.warn("Unprocessed extension element: " + elementType);
+ }
+ }
+
+ if (soapAddress == null)
+ throw new WSException("Cannot obtain SOAP address");
+
+ return soapAddress;
+ }
+
+ private String getOptionalAttribute(Element domElement, String attrName)
+ {
+ String attrValue = domElement.getAttribute(attrName);
+ return (attrValue.length() > 0 ? attrValue : null);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL11Writer.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Writer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Writer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL11Writer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,519 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+import org.w3c.dom.Element;
+
+/**
+ * A WSDL Writer that writes a WSDL 1.1 file. It works off
+ * of the WSDL20 Object Graph.
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ */
+public class WSDL11Writer extends WSDLWriter
+{
+ //Used Internally
+ private String wsdlStyle = Constants.RPC_LITERAL;
+
+ // Used to prevent duplicates
+ private HashSet<String> writtenFaultMessages = new HashSet<String>();
+
+ /** Use WSDLDefinitions.writeWSDL instead. */
+ public WSDL11Writer(WSDLDefinitions wsdl)
+ {
+ super(wsdl);
+ }
+
+ public void write(Writer writer) throws IOException
+ {
+ write(writer, null);
+ }
+
+
+ public void write(Writer writer, String charset) throws IOException
+ {
+ write(writer, charset, null);
+ }
+
+ public void write(Writer writer, String charset, WriterResolver resolver) throws
IOException
+ {
+ // Write out the wsdl-1.1 represention (only path to obtain is from WSDL11Reader)
+ if (wsdl.getWsdlOneOneDefinition() != null)
+ {
+ Definition wsdlDefinition = wsdl.getWsdlOneOneDefinition();
+ try
+ {
+ WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+ javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
+ wsdlWriter.writeWSDL(wsdlDefinition, writer);
+ }
+ catch (WSDLException e)
+ {
+ this.logException(e);
+ throw new IOException(e.toString());
+ }
+ }
+ else
+ {
+ StringBuilder buffer = new StringBuilder();
+
+ //Detect the WSDL Style early
+ wsdlStyle = utils.getWSDLStyle(wsdl);
+
+ StringBuilder importBuffer = new StringBuilder();
+ for (WSDLImport wsdlImport : wsdl.getImports())
+ {
+ if (resolver == null)
+ continue;
+
+ ResolvedWriter resolved = resolver.resolve(wsdlImport.getLocation());
+ if (resolved == null)
+ continue;
+
+ String namespace = wsdlImport.getNamespace();
+ importBuffer.append("<import namespace='" + namespace +
"' location='" + resolved.actualFile + "'/>");
+ if (resolved != null)
+ {
+ StringBuilder builder = new StringBuilder();
+
+ appendDefinitions(builder, namespace);
+ appendBody(builder, namespace);
+ writeBuilder(builder, resolved.writer, resolved.charset);
+ resolved.writer.close();
+ }
+ }
+
+ appendDefinitions(buffer, wsdl.getTargetNamespace());
+ if (importBuffer.length() > 0)
+ buffer.append(importBuffer);
+
+ appendBody(buffer, wsdl.getTargetNamespace());
+ writeBuilder(buffer, writer, charset);
+ }
+ }
+
+ private void writeBuilder(StringBuilder builder, Writer writer, String charset) throws
IOException
+ {
+ Element element = DOMUtils.parse(builder.toString());
+
+ if (charset != null)
+ writer.write("<?xml version=\"1.0\" encoding=\"" +
charset + "\"?>\n");
+ new DOMWriter(writer).setPrettyprint(true).print(element);
+ }
+
+ protected void appendBody(StringBuilder builder, String namespace)
+ {
+ writtenFaultMessages.clear();
+
+ appendTypes(builder, namespace);
+ appendMessages(builder, namespace);
+ appendInterfaces(builder, namespace);
+ appendBindings(builder, namespace);
+ appendServices(builder, namespace);
+ builder.append("</definitions>");
+ }
+
+ protected void appendMessages(StringBuilder buffer, String namespace)
+ {
+ WSDLInterface[] interfaces = wsdl.getInterfaces();
+ int len = interfaces != null ? interfaces.length : 0;
+ for (int i = 0; i < len; i++)
+ {
+ WSDLInterface intf = interfaces[i];
+ if (! namespace.equals(intf.getQName().getNamespaceURI()))
+ continue;
+
+ WSDLInterfaceOperation[] operations = intf.getSortedOperations();
+ int lenOps = operations.length;
+ for (int j = 0; j < lenOps; j++)
+ {
+ appendMessage(buffer, operations[j]);
+ appendMessagesForExceptions(buffer, operations[j]);
+ }
+ }
+ }
+
+ private void appendMessage(StringBuilder buffer, WSDLInterfaceOperation operation)
+ {
+ String opname = operation.getName().toString();
+ //Determine the style of the wsdl
+ if (Constants.URI_STYLE_RPC.equals(operation.getStyle()) == false)
+ wsdlStyle = Constants.DOCUMENT_LITERAL; //Not RPC/Literal
+
+ String interfaceName = operation.getWsdlInterface().getName().toString();
+ buffer.append("<message name='" + interfaceName + "_" +
opname + "' >");
+ for (WSDLInterfaceOperationInput input : operation.getInputs())
+ appendMessageParts(buffer, input);
+ buffer.append("</message>");
+
+ if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
+ {
+ buffer.append("<message name='" + interfaceName + "_"
+ opname + "Response' >");
+ WSDLInterfaceOperationOutput[] outputs = operation.getOutputs();
+ for (WSDLInterfaceOperationOutput output : outputs)
+ appendMessageParts(buffer, output);
+ buffer.append("</message>");
+ }
+ }
+
+ private void appendMessagesForExceptions(StringBuilder buffer, WSDLInterfaceOperation
operation)
+ {
+ //Get the outfaults
+ WSDLInterfaceOperationOutfault[] faults = operation.getOutfaults();
+ int len = faults != null ? faults.length : 0;
+
+ for (int i = 0; i < len; i++)
+ {
+ WSDLInterfaceOperationOutfault fault = faults[i];
+ String exceptionName = fault.getRef().getLocalPart();
+ if (writtenFaultMessages.contains(exceptionName))
+ continue;
+
+ WSDLInterfaceFault interfaceFault = operation.getWsdlInterface().getFault(new
NCName(exceptionName));
+ QName xmlName = interfaceFault.getElement();
+
+ buffer.append("<message name='" + exceptionName + "'
>");
+ String prefix = wsdl.getPrefix(xmlName.getNamespaceURI());
+ String xmlNameStr = prefix + ":" + xmlName.getLocalPart();
+ buffer.append("<part name='" + exceptionName + "'
element='" + xmlNameStr + "' />");
+ buffer.append("</message>");
+
+ writtenFaultMessages.add(exceptionName);
+ }
+ }
+
+ private String getReferenceString(QName name)
+ {
+ String namespaceURI = name.getNamespaceURI();
+ String prefix = wsdl.getPrefix(namespaceURI);
+ if (prefix == null)
+ throw new WSException("Prefix not bound for namespace: " +
namespaceURI);
+
+ return prefix + ":" + name.getLocalPart();
+ }
+
+ private void appendMessageParts(StringBuilder buffer, WSDLInterfaceMessageReference
reference)
+ {
+ if (wsdlStyle.equals(Constants.RPC_LITERAL))
+ {
+ for (WSDLRPCPart part : reference.getChildParts())
+ {
+ buffer.append("<part name='" +
part.getName()).append('\'');
+ buffer.append(" type='" + getReferenceString(part.getType()) +
"'/>");
+ }
+ }
+ else
+ {
+ QName element = reference.getElement();
+ // Null represents empty message
+ if (element != null)
+ {
+ buffer.append("<part name='" + reference.getPartName() +
'\'');
+ buffer.append(" element='" + getReferenceString(element) +
"'/>");
+ }
+ }
+
+ WSDLBindingMessageReference bindingReference = getBindingReference(reference);
+ if (bindingReference == null)
+ return;
+
+ for (WSDLSOAPHeader header : bindingReference.getSoapHeaders())
+ {
+ if (header.isIncludeInSignature());
+ {
+ QName element = header.getElement();
+ buffer.append("<part name='" + header.getPartName() +
'\'');
+ buffer.append(" element='" + getReferenceString(element) +
"'/>");
+ }
+ }
+ }
+
+ private WSDLBindingMessageReference getBindingReference(WSDLInterfaceMessageReference
reference)
+ {
+ WSDLInterfaceOperation operation = reference.getWsdlOperation();
+ WSDLInterface wsdlInterface = operation.getWsdlInterface();
+ WSDLBinding binding =
wsdlInterface.getWsdlDefinitions().getBindingByInterfaceName(wsdlInterface.getQName());
+ WSDLBindingOperation bindingOperation =
binding.getOperationByRef(operation.getQName());
+ WSDLBindingMessageReference[] bindingReferences;
+
+ if (reference instanceof WSDLInterfaceOperationInput)
+ bindingReferences = bindingOperation.getInputs();
+ else
+ bindingReferences = bindingOperation.getOutputs();
+
+ if (bindingReferences.length > 1)
+ throw new IllegalArgumentException("WSDl 1.1 only supports In-Only, and
In-Out MEPS, more than reference input found");
+
+ if (bindingReferences.length == 1)
+ return bindingReferences[0];
+
+ return null;
+ }
+
+ protected void appendInterfaces(StringBuilder buffer, String namespace)
+ {
+ WSDLInterface[] intfs = wsdl.getInterfaces();
+ for (int i = 0; i < intfs.length; i++)
+ {
+ WSDLInterface intf = intfs[i];
+ if (!namespace.equals(intf.getQName().getNamespaceURI()))
+ continue;
+
+ buffer.append("<portType name='" + intf.getName() +
"'>");
+ appendPortOperations(buffer, intf);
+ buffer.append("</portType>");
+ }
+ }
+
+ private String getParameterOrder(WSDLInterfaceOperation operation)
+ {
+ StringBuilder builder = new StringBuilder();
+ for (WSDLRPCSignatureItem item : operation.getRpcSignatureItems())
+ {
+ if (item.getDirection() != Direction.RETURN)
+ {
+ if (builder.length() > 0)
+ builder.append(' ');
+ builder.append(item.getName());
+ }
+ }
+
+ return builder.toString();
+ }
+
+ protected void appendPortOperations(StringBuilder buffer, WSDLInterface intf)
+ {
+ String prefix = wsdl.getPrefix(intf.getQName().getNamespaceURI());
+ WSDLInterfaceOperation[] operations = intf.getSortedOperations();
+ for (int i = 0; i < operations.length; i++)
+ {
+ WSDLInterfaceOperation operation = operations[i];
+ buffer.append("<operation name='" +
operation.getName().toString() + "'");
+
+ String parameterOrder = getParameterOrder(operation);
+ if (parameterOrder.length() > 0)
+ buffer.append("
parameterOrder='").append(parameterOrder).append("'");
+ buffer.append(">");
+
+ String opname = operation.getName().toString();
+ String interfaceName = operation.getWsdlInterface().getName().toString();
+ String msgEl = prefix + ":" + interfaceName + "_" + opname;
+
+ buffer.append("<input message='" + msgEl +
"'>").append("</input>");
+
+ if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
+ {
+ buffer.append("<output message='" + msgEl +
"Response'>");
+ buffer.append("</output>");
+ }
+
+ //Append the Faults
+ for (WSDLInterfaceOperationOutfault fault : operation.getOutfaults())
+ {
+ QName element = fault.getRef();
+ buffer.append("<fault message='" +
utils.getFormattedString(element));
+ buffer.append("' name='" + element.getLocalPart() +
"'/>");
+ }
+
+ buffer.append("</operation>");
+ }
+ }
+
+ protected void appendBindings(StringBuilder buffer, String namespace)
+ {
+ WSDLBinding[] bindings = wsdl.getBindings();
+ for (int i = 0; i < bindings.length; i++)
+ {
+ WSDLBinding binding = bindings[i];
+ if (!namespace.equals(binding.getQName().getNamespaceURI()))
+ continue;
+ buffer.append("<binding name='" + binding.getName() +
"' type='" + getQNameRef(binding.getInterfaceName()) +
"'>");
+ //TODO:Need to derive the WSDLStyle from the Style attribute of
InterfaceOperation
+ if (wsdlStyle == null)
+ throw new IllegalArgumentException("WSDL Style is null (should be rpc or
document");
+ String style = "rpc";
+ if (wsdlStyle.equals(Constants.DOCUMENT_LITERAL))
+ style = "document";
+ buffer.append("<" + soapPrefix + ":binding
transport='http://schemas.xmlsoap.org/soap/http' style='" + style +
"'/>");
+ appendBindingOperations(buffer, binding);
+ buffer.append("</binding>");
+ }
+ }
+
+ protected void appendBindingOperations(StringBuilder buffer, WSDLBinding binding)
+ {
+ WSDLBindingOperation[] operations = binding.getOperations();
+ Arrays.sort(operations);
+
+ for (int i = 0; i < operations.length; i++)
+ {
+ WSDLBindingOperation operation = operations[i];
+ String interfaceName =
operation.getWsdlBinding().getInterfaceName().getLocalPart();
+
+ WSDLInterface wsdlInterface = wsdl.getInterface(new NCName(interfaceName));
+ if (wsdlInterface == null)
+ throw new WSException("WSDL Interface should not be null");
+ WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new
NCName(operation.getRef().getLocalPart()));
+
+ buffer.append("<operation name='" +
interfaceOperation.getName() + "'>");
+ String soapAction = (operation.getSOAPAction() != null ?
operation.getSOAPAction() : "");
+ buffer.append("<" + soapPrefix + ":operation
soapAction=\"" + soapAction + "\"/>");
+
+ WSDLBindingOperationInput[] inputs = operation.getInputs();
+ if (inputs.length != 1)
+ throw new WSException("WSDl 1.1 only supports In-Only, and In-Out
MEPS.");
+
+ buffer.append("<input>");
+ appendSOAPBinding(buffer, wsdlInterface, operation, inputs);
+ buffer.append("</input>");
+
+ if (!
Constants.WSDL20_PATTERN_IN_ONLY.equals(getBindingOperationPattern(operation)))
+ {
+ buffer.append("<output>");
+ WSDLBindingOperationOutput[] outputs = operation.getOutputs();
+ appendSOAPBinding(buffer, wsdlInterface, operation, outputs);
+ buffer.append("</output>");
+ }
+
+ //Append faults
+ WSDLInterfaceOperationOutfault[] faults = interfaceOperation.getOutfaults();
+ if (faults != null)
+ {
+ for (WSDLInterfaceOperationOutfault fault : faults)
+ {
+ String n = "name='" + fault.getRef().getLocalPart() +
"'";
+ buffer.append("<fault " + n + ">");
+ buffer.append("<" + soapPrefix + ":fault " + n +
" use='literal' />");
+ buffer.append("</fault>");
+ }
+ buffer.append("</operation>");
+ }
+ }
+ }
+
+ private void appendSOAPBinding(StringBuilder buffer, WSDLInterface wsdlInterface,
WSDLBindingOperation operation, WSDLBindingMessageReference[] inputs)
+ {
+ String tns = wsdl.getTargetNamespace();
+ WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new
NCName(operation.getRef().getLocalPart()));
+ WSDLInterfaceMessageReference reference = (inputs instanceof
WSDLBindingOperationInput[]) ? interfaceOperation.getInputs()[0]
+ : interfaceOperation.getOutputs()[0];
+
+ StringBuilder bodyParts = new StringBuilder();
+ if (Constants.DOCUMENT_LITERAL == wsdlStyle)
+ {
+ bodyParts.append(reference.getPartName());
+ }
+ else
+ {
+ for (WSDLRPCPart part : reference.getChildParts())
+ {
+ if (bodyParts.length() > 0)
+ bodyParts.append(" ");
+ bodyParts.append(part.getName());
+ }
+ }
+
+ StringBuilder soapHeader = new StringBuilder();
+ for (WSDLSOAPHeader header : inputs[0].getSoapHeaders())
+ {
+ if (header.isIncludeInSignature())
+ {
+ String messageName = wsdlInterface.getName() + "_" +
operation.getRef().getLocalPart();
+ if (reference instanceof WSDLInterfaceOperationOutput)
+ messageName += "Response";
+ soapHeader.append("<").append(soapPrefix).append(":header
use='literal' message='tns:").append(messageName);
+ soapHeader.append("'
part='").append(header.getElement().getLocalPart()).append("'/>");
+ }
+ }
+
+ buffer.append("<" + soapPrefix + ":body
use='literal'");
+ if (wsdlStyle != Constants.DOCUMENT_LITERAL)
+ buffer.append(" namespace='" + tns + "'");
+ if (soapHeader.length() > 0)
+ {
+ buffer.append("
parts='").append(bodyParts).append("'/>");
+ buffer.append(soapHeader);
+ }
+ else
+ {
+ buffer.append("/>");
+ }
+ }
+
+ private String getBindingOperationPattern(WSDLBindingOperation operation)
+ {
+ WSDLBinding binding = operation.getWsdlBinding();
+ String pattern = binding.getInterface().getOperation(new
NCName(operation.getRef().getLocalPart())).getPattern();
+
+ return pattern;
+ }
+
+ protected void appendServices(StringBuilder buffer, String namespace)
+ {
+ WSDLService[] services = wsdl.getServices();
+ int len = services.length;
+ for (int i = 0; i < len; i++)
+ {
+
+ WSDLService service = services[i];
+ if (!namespace.equals(service.getQName().getNamespaceURI()))
+ continue;
+ buffer.append("<service name='" + service.getName() +
"'>");
+ WSDLEndpoint[] endpoints = service.getEndpoints();
+ int lenend = endpoints.length;
+ for (int j = 0; j < lenend; j++)
+ {
+ WSDLEndpoint endpoint = endpoints[j];
+ appendServicePort(buffer, endpoint);
+ }
+
+ buffer.append("</service>");
+ }
+ }
+
+ protected void appendServicePort(StringBuilder buffer, WSDLEndpoint endpoint)
+ {
+ String name = endpoint.getName().toString();
+ QName endpointBinding = endpoint.getBinding();
+ String prefix = endpointBinding.getPrefix();
+ prefix = wsdl.getPrefix(endpointBinding.getNamespaceURI());
+ String ebname = prefix + ":" + endpointBinding.getLocalPart();
+ buffer.append("<port name='" + name + "'
binding='" + ebname + "'>");
+ buffer.append("<" + soapPrefix + ":address location='" +
endpoint.getAddress() + "'/>");
+ buffer.append("</port>");
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL20Reader.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL20Reader.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL20Reader.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL20Reader.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,557 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+
+import javax.wsdl.xml.WSDLLocator;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+
+/**
+ * A factory that creates a WSDL <code>Definition</code> from an URL.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDL20Reader implements ObjectModelFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDL20Reader.class);
+
+ private WSDLLocator locator = null;
+
+ public WSDLDefinitions readWSDL(WSDLLocator wsdlLocator) throws WSDLException,
IOException
+ {
+ locator = wsdlLocator;
+
+ String wsdlURI = wsdlLocator.getBaseURI();
+ InputSource inputSource = wsdlLocator.getBaseInputSource();
+ if (inputSource == null)
+ throw new WSException("Cannot obtain WSDL input source for: " +
wsdlURI);
+
+ InputStream is = inputSource.getByteStream();
+ try
+ {
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setNamespaceAware(true);
+ unmarshaller.setValidation(true);
+
+ WSDLDefinitions wsdl = new WSDLDefinitions();
+ wsdl.setWsdlNamespace(Constants.NS_WSDL20);
+
+ unmarshaller.unmarshal(is, this, wsdl);
+ return wsdl;
+ }
+ catch (RuntimeException re)
+ {
+ throw re;
+ }
+ catch (Exception e)
+ {
+ throw new WSDLException("Cannot unmarshal: " + wsdlURI, e);
+ }
+ finally
+ {
+ is.close();
+ }
+ }
+
+ public void setFeature(String name, boolean value)
+ {
+ }
+
+ /**
+ * This method is called by the object model factory and returns the root of the
object graph.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ /**
+ * WSDL2.0 Assertions (
http://www.w3.org/TR/wsdl20-primer)
+ * The value of the WSDL target namespace MUST be an absolute URI.
+ */
+ WSDLDefinitions wsdl = null;
+
+ StringBuilder buf = null;
+
+ if (root instanceof WSDLDefinitions)
+ {
+ wsdl = (WSDLDefinitions)root;
+
+ String targetNamespace = attrs.getValue("targetNamespace");
+ boolean abs = (targetNamespace.startsWith("http"));
+ if (targetNamespace == null || abs == false)
+ throw new RuntimeException("WSDL 2.0 Assertion: targetNamespace must be
an absolute uri");
+
+ wsdl.setWsdlNamespace(Constants.NS_WSDL20);
+ wsdl.setTargetNamespace(targetNamespace);
+
+ Iterator uris = navigator.getNamespaceURIs();
+ while (uris.hasNext())
+ {
+ String namespace = (String)uris.next();
+ String prefix = navigator.getNamespaceContext().getPrefix(namespace);
+ if (prefix.length() > 0)
+ wsdl.registerNamespaceURI(namespace, prefix);
+ }
+ return wsdl;
+ }
+ else if (root instanceof WSDLTypes)
+ {
+ wsdl = ((WSDLTypes)root).getWsdlDefinitions();
+ if ("import".equalsIgnoreCase(localName))
+ {
+ importTypes(wsdl, attrs);
+ return null;
+ }
+ if ("schema".equalsIgnoreCase(localName))
+ {
+ //Included Schema - wsdl 2.0
+ //We will start writing whatever the parser has obtained
+ buf = new StringBuilder("<schema ");
+ Iterator uris = navigator.getNamespaceURIs();
+ String targetNS = attrs.getValue("targetNamespace");
+ buf.append(" targetNamespace='" + targetNS +
"'");
+ while (uris.hasNext())
+ {
+ String namespace = (String)uris.next();
+ Iterator iter = navigator.getNamespaceContext().getPrefixes(namespace);
+ if (namespace.equals(Constants.NS_WSDL20))
+ continue;
+ if (iter == null)
+ buf.append(" xmlns='" + namespace + "'");
+ else
+ {
+ while (iter.hasNext())
+ {
+ String prefix = (String)iter.next();
+ if (prefix.length() == 0)
+ buf.append(" xmlns='" + namespace +
"'");
+ else buf.append(" xmlns:" + prefix + "='" +
namespace + "'");
+ }
+ }
+ }
+ buf.append(">");
+ return buf;
+ }
+ }
+ else if (root instanceof StringBuilder)
+ {
+ return newChild((StringBuilder)root, navigator, namespaceURI, localName,
attrs);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Invalid root for namespace: " +
namespaceURI);
+ }
+
+ return null;
+ }
+
+ /**
+ * This method is called by the object model factory and returns the root of the
object graph.
+ */
+ public Object newChild(WSDLTypes types, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ /**
+ * WSDL2.0 Assertions (
http://www.w3.org/TR/wsdl20-primer)
+ * The value of the WSDL target namespace MUST be an absolute URI.
+ */
+ WSDLDefinitions wsdl = types.getWsdlDefinitions();
+
+ StringBuilder buf = null;
+ if ("import".equalsIgnoreCase(localName))
+ {
+ importTypes(wsdl, attrs);
+ return null;
+ }
+ if ("schema".equalsIgnoreCase(localName))
+ {
+ //Included Schema - wsdl 2.0
+ //We will start writing whatever the parser has obtained
+ buf = new StringBuilder("<schema ");
+ Iterator uris = navigator.getNamespaceURIs();
+ String targetNS = attrs.getValue("targetNamespace");
+ buf.append(" targetNamespace='" + targetNS + "'");
+ while (uris.hasNext())
+ {
+ String namespace = (String)uris.next();
+ Iterator iter = navigator.getNamespaceContext().getPrefixes(namespace);
+ if (namespace.equals(Constants.NS_WSDL20))
+ continue;
+ if (iter == null)
+ buf.append(" xmlns='" + namespace + "'");
+ else
+ {
+ while (iter.hasNext())
+ {
+ String prefix = (String)iter.next();
+ if (prefix.length() == 0)
+ buf.append(" xmlns='" + namespace +
"'");
+ else buf.append(" xmlns:" + prefix + "='" +
namespace + "'");
+ }
+ }
+ }
+ buf.append(">");
+ return buf;
+ }
+
+ return null;
+ }
+
+ /**
+ * The JBossXB has completed the parsing of the WSDL 2.0 document
+ * @param root
+ * @param ctx
+ * @param uri
+ * @param name
+ * @return
+ */
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
+ {
+ return root;
+ }
+
+ /**
+ * Used in the parsing of the included XML Schema in WSDL 2.0
+ * @param buf
+ * @param navigator
+ * @param namespaceURI
+ * @param localName
+ * @param attrs
+ * @return
+ */
+ public Object newChild(StringBuilder buf, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ int len = attrs.getLength();
+ buf.append("<" + localName);
+ for (int i = 0; i < len; i++)
+ {
+ String val = attrs.getValue(i);
+ String attrname = attrs.getLocalName(i);
+ buf.append(" " + attrname + "='" + val +
"'");
+ }
+ buf.append(">");
+ return buf;
+ }
+
+ /**
+ * Used in the parsing of the included XML Schema in WSDL 2.0
+ * We have reached the end of an xml element.
+ * @param buf
+ * @param navigator
+ * @param namespaceURI
+ * @param localName
+ * @return
+ */
+ public Object addChild(StringBuilder buf, StringBuilder buf1, UnmarshallingContext
navigator, String namespaceURI, String localName) throws WSDLException
+ {
+ buf.append("</" + localName + ">");
+ return buf;
+
+ }
+
+ /**
+ * Used in the parsing of the included XML Schema in WSDL 2.0
+ * We have parsed the schema completely. Write it into a file and update WSDLTypes
(schemaLocation)
+ * @param types
+ * @param buf
+ * @param navigator
+ * @param namespaceURI
+ * @param localName
+ * @return
+ * @throws WSDLException
+ */
+ public Object addChild(WSDLTypes types, StringBuilder buf, UnmarshallingContext
navigator, String namespaceURI, String localName) throws WSDLException
+ {
+ buf.append("</schema>");
+ String targetNS = types.getWsdlDefinitions().getTargetNamespace();
+ try
+ {
+ File file = SchemaUtils.getSchemaTempFile(targetNS);
+ file.deleteOnExit();
+ FileWriter fwrite = new FileWriter(file);
+ fwrite.write(buf.toString());
+ fwrite.flush();
+ fwrite.close();
+ }
+ catch (IOException e)
+ {
+ String msg = "Cannot extract schema definition for target namespace: "
+ targetNS;
+ log.error(msg, e);
+ throw new WSException(msg);
+ }
+ return types;
+ }
+
+ /**
+ * Parsing the WSDL 2.0 document
+ * @param wsdl20
+ * @param navigator
+ * @param namespaceURI
+ * @param localName
+ * @param attrs
+ * @return
+ * @throws WSDLException
+ */
+ public Object newChild(WSDLDefinitions wsdl20, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs) throws WSDLException
+ {
+ /**
+ * WSDL 20 Assertions
+ * Each interface must be given a name that is unique within the set of interfaces
defined in this WSDL target NS
+ * Interface names are tokens that must not contain a space or colon
(":")
+ */
+ String defaultNamespace = wsdl20.getWsdlNamespace();
+ if (Constants.NS_WSDL20.equals(defaultNamespace))
+ {
+ if ("types".equals(localName))
+ {
+ WSDLTypes wsdlTypes = new XSModelTypes();
+ wsdl20.setWsdlTypes(wsdlTypes);
+ return wsdlTypes;
+ }
+ else if ("interface".equals(localName))
+ {
+ WSDLInterface wsdlInterface = new WSDLInterface(wsdl20);
+ String name = attrs.getValue("name");
+ if (name == null)
+ throw new RuntimeException("Interface name should not be
null");
+ if (name.indexOf(" ") > -1 || name.indexOf(":") >
-1)
+ throw new RuntimeException("WSDL 2.0 Assertion:Interface names are
tokens " + "that must not contain a space or colon");
+
+ NCName ncname = new NCName(name);
+ if (wsdl20.getInterface(ncname) != null)
+ throw new RuntimeException("WSDL 2.0 Assertion:Each interface must be
given a name that is "
+ + "unique within the set of interfaces defined in this WSDL
target namespace");
+
+ wsdlInterface.setName(ncname);
+ wsdl20.addInterface(wsdlInterface);
+
+ return wsdlInterface;
+ }
+ else if ("binding".equals(localName))
+ {
+ /**
+ * WSDL 2.0 Assertion: Each name must be unique among all bindings in this
WSDL target namespace
+ */
+ String name = attrs.getValue("name");
+ NCName ncname = new NCName(name);
+ if (wsdl20.getBinding(ncname) != null)
+ throw new RuntimeException("WSDL 2.0 Assertion:Each name must be
unique among " + "all bindings in this WSDL target namespace");
+ WSDLBinding wsdlBinding = new WSDLBinding(wsdl20);
+ wsdlBinding.setName(ncname);
+ wsdl20.addBinding(wsdlBinding);
+
+ return wsdlBinding;
+ }
+ else if ("service".equals(localName))
+ {
+ WSDLService wsdlService = new WSDLService(wsdl20);
+ wsdlService.setName(new NCName(attrs.getValue("name")));
+ wsdl20.addService(wsdlService);
+
wsdlService.setInterfaceName(navigator.resolveQName(attrs.getValue("interface")));
+ return wsdlService;
+ }
+ else log.warn("Unrecogized child element: " + localName);
+ }
+ else throw new WSDLException("Invalid default namespace: " +
defaultNamespace);
+
+ return null;
+ }
+
+ /**
+ * Parsing the WSDL 2.0 document
+ * @param wsdlInterface
+ * @param navigator
+ * @param namespaceURI
+ * @param localName
+ * @param attrs
+ * @return
+ */
+ public Object newChild(WSDLInterface wsdlInterface, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
+ {
+ /**
+ * WSDL .0 Assertion: Operation names must also be unique within an interface
+ */
+ if ("operation".equals(localName))
+ {
+ String name = attrs.getValue("name");
+ if (name == null)
+ throw new RuntimeException("Operation name must not be null");
+ NCName ncname = new NCName(name);
+ if (wsdlInterface.containsInterfaceOperation(ncname))
+ throw new RuntimeException("WSDL 2.0 Assertion:Each operation must be
given a name that is "
+ + "unique within an interface defined in this WSDL target
namespace");
+ WSDLInterfaceOperation wsdlOperation = new
WSDLInterfaceOperation(wsdlInterface);
+ wsdlOperation.setName(ncname);
+ wsdlInterface.addOperation(wsdlOperation);
+ return wsdlOperation;
+ }
+
+ log.warn("Unrecogized child element: " + localName);
+ return null;
+ }
+
+ /**
+ * Parsing the WSDL 2.0 document
+ * @param wsdlOperation
+ * @param navigator
+ * @param namespaceURI
+ * @param localName
+ * @param attrs
+ * @return
+ */
+ public Object newChild(WSDLInterfaceOperation wsdlOperation, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("input".equals(localName))
+ {
+ WSDLInterfaceOperationInput wsdlInterfaceOperationInput = new
WSDLInterfaceOperationInput(wsdlOperation);
+
wsdlInterfaceOperationInput.setElement(navigator.resolveQName(attrs.getValue("element")));
+ wsdlInterfaceOperationInput.setMessageLabel(new
NCName(attrs.getValue("messageLabel")));
+ wsdlOperation.addInput(wsdlInterfaceOperationInput);
+ return wsdlInterfaceOperationInput;
+ }
+ else if ("output".equals(localName))
+ {
+ WSDLInterfaceOperationOutput output = new
WSDLInterfaceOperationOutput(wsdlOperation);
+ output.setElement(navigator.resolveQName(attrs.getValue("element")));
+ output.setMessageLabel(new NCName(attrs.getValue("messageLabel")));
+ wsdlOperation.addOutput(output);
+ return output;
+ }
+ else if ("outfault".equals(localName))
+ {
+ WSDLInterfaceOperationOutfault fault = new
WSDLInterfaceOperationOutfault(wsdlOperation);
+ String messageLabel = attrs.getValue("messageLabel");
+ fault.setRef(navigator.resolveQName(attrs.getValue("ref")));
+ if (messageLabel != null)
+ fault.setMessageLabel(new NCName(messageLabel));
+ wsdlOperation.addOutfault(fault);
+ return wsdlOperation;
+ }
+
+ log.warn("Unrecogized child element: " + localName);
+ return null;
+ }
+
+ /**
+ * Parsing the WSDL 2.0 document
+ * @param wsdlBinding
+ * @param navigator
+ * @param namespaceURI
+ * @param localName
+ * @param attrs
+ * @return
+ */
+ public Object newChild(WSDLBinding wsdlBinding, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ if ("operation".equals(localName))
+ {
+ WSDLBindingOperation wsdlBindingOperation = new
WSDLBindingOperation(wsdlBinding);
+
wsdlBindingOperation.setRef(navigator.resolveQName(attrs.getValue("ref")));
+ wsdlBinding.addOperation(wsdlBindingOperation);
+ return wsdlBindingOperation;
+ }
+
+ log.warn("Unrecogized child element: " + localName);
+ return null;
+ }
+
+ /**
+ * Parsing the WSDL 2.0 document
+ * @param wsdlBindingOperation
+ * @param navigator
+ * @param namespaceURI
+ * @param localName
+ * @param attrs
+ * @return
+ */
+ public Object newChild(WSDLBindingOperation wsdlBindingOperation, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("input".equals(localName))
+ {
+ WSDLBindingOperationInput wsdlBindingOperationInput = new
WSDLBindingOperationInput(wsdlBindingOperation);
+ wsdlBindingOperationInput.setMessageLabel(new
NCName(attrs.getValue("messageLabel")));
+ wsdlBindingOperation.addInput(wsdlBindingOperationInput);
+ return wsdlBindingOperationInput;
+ }
+ if ("output".equals(localName))
+ {
+ WSDLBindingOperationOutput wsdlBindingOperationOutput = new
WSDLBindingOperationOutput(wsdlBindingOperation);
+ wsdlBindingOperationOutput.setMessageLabel(new
NCName(attrs.getValue("messageLabel")));
+ wsdlBindingOperation.addOutput(wsdlBindingOperationOutput);
+ return wsdlBindingOperationOutput;
+ }
+
+ log.warn("Unrecogized child element: " + localName);
+ return null;
+ }
+
+ /**
+ * Parsing the WSDL 2.0 document
+ * @param wsdlService
+ * @param navigator
+ * @param namespaceURI
+ * @param localName
+ * @param attrs
+ * @return
+ */
+ public Object newChild(WSDLService wsdlService, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ if ("endpoint".equals(localName))
+ {
+ WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(wsdlService);
+ wsdlEndpoint.setName(new NCName(attrs.getValue("name")));
+
wsdlEndpoint.setBinding(navigator.resolveQName(attrs.getValue("binding")));
+ wsdlService.addEndpoint(wsdlEndpoint);
+ return wsdlEndpoint;
+ }
+
+ log.warn("Unrecogized child element: " + localName);
+ return null;
+ }
+
+ /**
+ * Method that deals with importing schema
+ * @param wsdl
+ * @param attrs
+ */
+ private void importTypes(WSDLDefinitions wsdl, Attributes attrs)
+ {
+ // [TODO]
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL20Writer.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL20Writer.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL20Writer.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDL20Writer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,200 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+
+/**
+ * A WSDL writer that writes out a WSDL-2.0 compliant wsdl.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDL20Writer extends WSDLWriter
+{
+ // provide logging
+ protected static final Logger log = Logger.getLogger(WSDL20Writer.class);
+
+ protected WSDLUtils utils = WSDLUtils.getInstance();
+
+ /** Use WSDLDefinitions.writeWSDL instead. */
+ public WSDL20Writer(WSDLDefinitions wsdl)
+ {
+ super(wsdl);
+ }
+
+
+ protected void appendInterfaces(StringBuilder buffer, String namespace)
+ {
+ WSDLInterface[] interfaces = wsdl.getInterfaces();
+ for (int i = 0; i < interfaces.length; i++)
+ {
+ WSDLInterface intf = interfaces[i];
+ buffer.append("<interface name='" + intf.getName() +
"'>");
+ appendInterfaceFaults(buffer, intf);
+ appendInterfaceOperations(buffer, intf);
+ buffer.append("</interface>");
+ }
+ }
+
+ private void appendInterfaceFaults(StringBuilder buffer, WSDLInterface intf)
+ {
+ WSDLInterfaceFault[] faults = intf.getFaults();
+ for (int i = 0; i < faults.length; i++)
+ {
+ WSDLInterfaceFault fault = faults[i];
+ buffer.append("<fault name='" + fault.getName() +
"'");
+ buffer.append(" element='" + getQNameRef(fault.getElement()) +
"'>");
+ if (fault.getDocumentation() != null)
+ {
+ buffer.append(fault.getDocumentation());
+ }
+ buffer.append("</fault>");
+ }
+ }
+
+ private void appendInterfaceOperations(StringBuilder buffer, WSDLInterface intf)
+ {
+ WSDLInterfaceOperation[] operations = intf.getOperations();
+ for (int i = 0; i < operations.length; i++)
+ {
+ WSDLInterfaceOperation operation = operations[i];
+ buffer.append("<operation name='" + operation.getName() +
"'>");
+
+ WSDLInterfaceOperationInput[] inputs = operation.getInputs();
+ for (int j = 0; j < inputs.length; j++)
+ {
+ WSDLInterfaceOperationInput ip = inputs[j];
+ buffer.append("<input element='" +
getQNameRef(ip.getElement()) + "'");
+ if (ip.getMessageLabel() != null)
+ {
+ buffer.append(" messageLabel='" + ip.getMessageLabel() +
"'");
+ }
+ buffer.append(">");
+ appendProperties(buffer, ip.getProperties());
+ buffer.append("</input>");
+ }
+
+ WSDLInterfaceOperationOutput[] outputs = operation.getOutputs();
+ for (int j = 0; j < outputs.length; j++)
+ {
+ WSDLInterfaceOperationOutput op = outputs[j];
+ buffer.append("<output element='" +
getQNameRef(op.getElement()) + "'");
+ if (op.getMessageLabel() != null)
+ {
+ buffer.append(" messageLabel='" + op.getMessageLabel() +
"'");
+ }
+ buffer.append(">");
+ appendProperties(buffer, op.getProperties());
+ buffer.append("</output>");
+ }
+
+ WSDLInterfaceOperationOutfault[] outfaults = operation.getOutfaults();
+ for (int j = 0; j < outfaults.length; j++)
+ {
+ WSDLInterfaceOperationOutfault outfault = outfaults[j];
+ buffer.append("<outfault ref='" +
getQNameRef(outfault.getRef()) + "'>");
+ if (outfault.getMessageLabel() != null)
+ {
+ buffer.append(" messageLabel='" + outfault.getMessageLabel()
+ "'");
+ }
+ buffer.append("</outfault>");
+ }
+ buffer.append("</operation>");
+ }
+ }
+
+ private void appendProperties(StringBuilder buffer, WSDLProperty[] wsdlProperties)
+ {
+ for (int i = 0; i < wsdlProperties.length; i++)
+ {
+ WSDLProperty wsdlProperty = wsdlProperties[i];
+ String uri = wsdlProperty.getURI();
+ String value = wsdlProperty.getValue();
+ buffer.append("<property uri='" + uri + "'>" +
(value != null ? "<value>" + value + "</value>" :
"") + "</property>");
+ }
+ }
+
+ protected void appendBindings(StringBuilder buffer, String namespace)
+ {
+ WSDLBinding[] bindings = wsdl.getBindings();
+ for (int i = 0; i < bindings.length; i++)
+ {
+ WSDLBinding binding = bindings[i];
+ buffer.append("<binding name='" + binding.getName() +
"'");
+ if (binding.getInterfaceName() != null)
+ {
+ buffer.append(" interface='" +
getQNameRef(binding.getInterfaceName()) + "'");
+ }
+ buffer.append(">");
+ appendBindingOperations(buffer, binding);
+ buffer.append("</binding>");
+ }
+ }
+
+ protected void appendBindingOperations(StringBuilder buffer, WSDLBinding binding)
+ {
+ WSDLBindingOperation[] operations = binding.getOperations();
+ for (int i = 0; i < operations.length; i++)
+ {
+ WSDLBindingOperation operation = operations[i];
+ buffer.append("<operation ref='" +
getQNameRef(operation.getRef()) + "'>");
+ buffer.append("</operation>");
+ }
+ }
+
+ protected void appendServices(StringBuilder buffer, String namespace)
+ {
+ WSDLService[] services = wsdl.getServices();
+ for (int i = 0; i < services.length; i++)
+ {
+ WSDLService service = services[i];
+ buffer.append("<service name='" + service.getName() +
"'");
+ if (service.getInterfaceName() != null)
+ {
+ buffer.append(" interface='" +
getQNameRef(service.getInterfaceName()) + "'");
+ }
+ buffer.append(">");
+
+ WSDLEndpoint[] endpoints = service.getEndpoints();
+ for (int j = 0; j < endpoints.length; j++)
+ {
+ WSDLEndpoint endpoint = endpoints[j];
+ buffer.append("<endpoint name='" + endpoint.getName() +
"'");
+ if (endpoint.getBinding() != null)
+ {
+ buffer.append(" binding='" +
getQNameRef(endpoint.getBinding()) + "'");
+ }
+ if (endpoint.getAddress() != null)
+ {
+ buffer.append(" address='" + endpoint.getAddress() +
"'");
+ }
+ buffer.append("></endpoint>");
+ }
+
+ buffer.append("</service>");
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBinding.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBinding.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,185 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.Serializable;
+import java.util.ArrayList;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+
+/**
+ * A Binding component describes a concrete message format and transmission protocol
which may be used
+ * to define an endpoint (see 2.14 Endpoint [p.62] ). That is, a Binding component
defines the
+ * implementation details necessary to accessing the service.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLBinding implements Serializable
+{
+ private static final long serialVersionUID = -7699953670233209811L;
+
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDLBinding.class);
+
+ // The parent WSDL definitions element.
+ private WSDLDefinitions wsdlDefinitions;
+
+ /** The REQUIRED name attribute information item together with the targetNamespace
attribute information item
+ * of the definitions element information item forms the QName of the binding.*/
+ private NCName name;
+
+ /** Derived QName identifier.
+ */
+ private QName qname;
+
+ /** The OPTIONAL interface attribute information item refers, by QName, to an
Interface component. */
+ private QName interfaceName;
+
+ /** The REQUIRED type attribute information item identifies the kind of binding
details contained in the Binding
+ * component. See wsdl20-bindings for valid values. */
+ private String type;
+
+ /** The set of Binding Fault components corresponding to the fault element
+ * information items in [children], if any.*/
+ private ArrayList<WSDLBindingFault> faults = new
ArrayList<WSDLBindingFault>();
+
+ /** The set of Binding Operation components corresponding to the operation element
+ * information items in [children], if any.*/
+ private ArrayList<WSDLBindingOperation> operations = new
ArrayList<WSDLBindingOperation>();
+
+ public WSDLBinding(WSDLDefinitions wsdlDefinitions)
+ {
+ log.trace("new WSDLBinding");
+ this.wsdlDefinitions = wsdlDefinitions;
+ }
+
+ public WSDLDefinitions getWsdlDefinitions()
+ {
+ return wsdlDefinitions;
+ }
+
+ public NCName getName()
+ {
+ return name;
+ }
+
+ public void setName(NCName name)
+ {
+ log.trace("setName: " + name);
+ this.name = name;
+ }
+
+ public QName getQName()
+ {
+ if (qname == null)
+ {
+ String tnsURI = wsdlDefinitions.getTargetNamespace();
+ qname = new QName(tnsURI, name.toString());
+ }
+ return qname;
+ }
+
+
+ public void setQName(QName qname)
+ {
+ log.trace("setQName: " + qname);
+ this.qname = qname;
+ }
+
+ public QName getInterfaceName()
+ {
+ return interfaceName;
+ }
+
+ public void setInterfaceName(QName interfaceName)
+ {
+ log.trace("setInterfaceName: " + name);
+ this.interfaceName = interfaceName;
+ }
+
+ public WSDLInterface getInterface()
+ {
+ WSDLInterface wsdlInterface = wsdlDefinitions.getInterface(new
NCName(interfaceName.getLocalPart()));
+ if (wsdlInterface == null)
+ throw new WSException("Cannot get interface for name: " +
interfaceName);
+ return wsdlInterface;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public WSDLBindingFault[] getFaults()
+ {
+ WSDLBindingFault[] arr = new WSDLBindingFault[faults.size()];
+ faults.toArray(arr);
+ return arr;
+ }
+
+ public void addFault(WSDLBindingFault fault)
+ {
+ faults.add(fault);
+ }
+
+ public WSDLBindingOperation[] getOperations()
+ {
+ WSDLBindingOperation[] arr = new WSDLBindingOperation[operations.size()];
+ operations.toArray(arr);
+ return arr;
+ }
+
+ public WSDLBindingOperation getOperationByRef(QName qname)
+ {
+ WSDLBindingOperation wsdlBindingOperation = null;
+ for (WSDLBindingOperation aux : operations)
+ {
+ if (aux.getRef().equals(qname))
+ {
+ if (wsdlBindingOperation != null)
+ log.warn("Multiple binding operations reference: " + qname);
+ wsdlBindingOperation = aux;
+ }
+ }
+
+ if (wsdlBindingOperation == null)
+ log.warn("Cannot obtain binding operation for ref: " + qname);
+
+ return wsdlBindingOperation;
+ }
+
+ public void addOperation(WSDLBindingOperation operation)
+ {
+ operations.add(operation);
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingFault.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingFault.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingFault.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingFault.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+/**
+ * A Binding Fault component describes a concrete binding of a particular fault within an
interface to a
+ * particular concrete message format. A particular fault of an interface is uniquely
identified by the target
+ * namespace of the interface and the name of the fault within that interface.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLBindingFault implements Serializable
+{
+ private static final long serialVersionUID = 6306975072558524200L;
+
+ // The parent WSDL binding
+ private WSDLBinding wsdlBinding;
+
+ /** An REQUIRED Interface Fault component in the {faults} property of the Interface
+ * component identified by the {interface} property of the parent Binding component.
This is the
+ * Interface Fault component for which binding information is being specified.*/
+ private QName ref;
+
+ public WSDLBindingFault(WSDLBinding wsdlBinding)
+ {
+ this.wsdlBinding = wsdlBinding;
+ }
+
+ public WSDLBinding getWsdlBinding()
+ {
+ return wsdlBinding;
+ }
+
+ public QName getRef()
+ {
+ return ref;
+ }
+
+ public void setRef(QName ref)
+ {
+ this.ref = ref;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingMessageReference.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingMessageReference.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * A Binding Message Reference component describes a concrete binding of a
+ * particular message participating in an operation to a particular concrete
+ * message format.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public abstract class WSDLBindingMessageReference
+{
+ // The parent WSDL binding operation
+ private WSDLBindingOperation wsdlBindingOperation;
+ private NCName messageLabel;
+ private List<WSDLSOAPHeader> soapHeaders = new
ArrayList<WSDLSOAPHeader>();
+ private List<WSDLMIMEPart> mimeParts = new ArrayList<WSDLMIMEPart>();
+
+ public WSDLBindingMessageReference(WSDLBindingOperation wsdlBindingOperation)
+ {
+ this.wsdlBindingOperation = wsdlBindingOperation;
+ }
+
+ public WSDLBindingOperation getWsdlBindingOperation()
+ {
+ return wsdlBindingOperation;
+ }
+
+ /**
+ * Gets the property that identifies the role that the message for which
+ * binding details are being specified. The role is part of the {message
+ * exchange pattern} of the Interface Operation component being bound by the
+ * containing Binding Operation component.
+ */
+ public NCName getMessageLabel()
+ {
+ return messageLabel;
+ }
+
+ /**
+ * Sets the property that identifies the role that the message for which
+ * binding details are being specified. The role is part of the {message
+ * exchange pattern} of the Interface Operation component being bound by the
+ * containing Binding Operation component.
+ */
+ public void setMessageLabel(NCName messageLabel)
+ {
+ this.messageLabel = messageLabel;
+ }
+
+ /**
+ * Gets the list of SOAP headers associated with this message reference.
+ *
+ * @return a list of soap headers
+ */
+ public List<WSDLSOAPHeader> getSoapHeaders()
+ {
+ return soapHeaders;
+ }
+
+ /**
+ * Sets the list of SOAP headers associated with this message reference.
+ *
+ * @param soapHeaders The soapHeaders to set.
+ */
+ public void setSoapHeaders(List<WSDLSOAPHeader> soapHeaders)
+ {
+ this.soapHeaders = soapHeaders;
+ }
+
+ /**
+ * Adds a SOAP header to the SOAP header list that is associated with this
+ * message reference.
+ *
+ * @param soapHeader the SOAP header to add
+ */
+ public void addSoapHeader(WSDLSOAPHeader soapHeader)
+ {
+ this.soapHeaders.add(soapHeader);
+ }
+
+ /**
+ * Adds a MIME part to this message reference. This is only used for WSDL 1.1.
+ *
+ * @param mimePart the mime part to add
+ */
+ public void addMimePart(WSDLMIMEPart mimePart)
+ {
+ this.mimeParts.add(mimePart);
+ }
+
+ /**
+ * Returns a list of mime parts on this message
+ *
+ * @return
+ */
+ public Collection<WSDLMIMEPart> getMimeParts()
+ {
+ return mimeParts;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingOperation.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperation.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingOperation.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,146 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.Constants;
+
+/**
+ * The Binding Operation component describes the concrete message format(s) and protocol
interaction(s)
+ * associated with a particular interface operation for a given endpoint. A particular
operation of an interface
+ * is uniquely identified by the target namespace of the interface and the name of the
operation within that
+ * interface.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLBindingOperation implements Comparable, Serializable
+{
+ private static final long serialVersionUID = -1986624862746844610L;
+
+ // The parent WSDL binding
+ private WSDLBinding wsdlBinding;
+
+ /** An Interface Operation component in the {operations} property of the Interface
component
+ * identified by the {interface} property of the parent Binding component.
+ * This is the Interface Operation component for which binding information is being
specified.*/
+ private QName ref;
+
+ /** WSDL-1.1, style attribute from the soap:binding element */
+ private String encodingStyle = Constants.URI_LITERAL_ENC;
+ /** WSDL-1.1, soapAction attribute from the soap:operation element */
+ private String soapAction;
+
+ /** A OPTIONAL set of Binding Message Reference components */
+ private List<WSDLBindingOperationInput> inputs = new
ArrayList<WSDLBindingOperationInput>();
+ /** A OPTIONAL set of Binding Message Reference components */
+ private List<WSDLBindingOperationOutput> outputs = new
ArrayList<WSDLBindingOperationOutput>();
+
+ public WSDLBindingOperation(WSDLBinding wsdlBinding)
+ {
+ this.wsdlBinding = wsdlBinding;
+ }
+
+ public WSDLBinding getWsdlBinding()
+ {
+ return wsdlBinding;
+ }
+
+ public QName getRef()
+ {
+ return ref;
+ }
+
+ public void setRef(QName ref)
+ {
+ this.ref = ref;
+ }
+
+ public String getEncodingStyle()
+ {
+ return encodingStyle;
+ }
+
+ public void setEncodingStyle(String encodingStyle)
+ {
+ this.encodingStyle = encodingStyle;
+ }
+
+
+ public String getSOAPAction()
+ {
+ return soapAction;
+ }
+
+ public void setSOAPAction(String soapAction)
+ {
+ this.soapAction = soapAction;
+ }
+
+ public WSDLBindingOperationInput[] getInputs()
+ {
+ WSDLBindingOperationInput[] arr = new WSDLBindingOperationInput[inputs.size()];
+ inputs.toArray(arr);
+ return arr;
+ }
+
+ public void addInput(WSDLBindingOperationInput input)
+ {
+ inputs.add(input);
+ }
+
+ public WSDLBindingOperationOutput[] getOutputs()
+ {
+ WSDLBindingOperationOutput[] arr = new WSDLBindingOperationOutput[outputs.size()];
+ outputs.toArray(arr);
+ return arr;
+ }
+
+ public void addOutput(WSDLBindingOperationOutput output)
+ {
+ outputs.add(output);
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(T)
+ */
+ public int compareTo(Object obj)
+ {
+ int c = -1;
+ if (obj instanceof WSDLBindingOperation)
+ {
+ WSDLBindingOperation w = (WSDLBindingOperation)obj;
+ String oname = w.getRef().getLocalPart();
+ String myname = ref.getLocalPart();
+ c = myname.compareTo(oname);
+ }
+ return c;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingOperationInput.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationInput.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationInput.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingOperationInput.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.Serializable;
+
+// $Id$
+
+/**
+ * A Binding Message Reference component describes a concrete binding of a particular
message
+ * participating in an operation to a particular concrete message format.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 10-Oct-2004
+ */
+public class WSDLBindingOperationInput extends WSDLBindingMessageReference implements
Serializable
+{
+ private static final long serialVersionUID = -3945310906418557565L;
+
+ public WSDLBindingOperationInput(WSDLBindingOperation wsdlBindingOperation)
+ {
+ super(wsdlBindingOperation);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingOperationOutput.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationOutput.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingOperationOutput.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLBindingOperationOutput.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.Serializable;
+
+// $Id$
+
+/**
+ * A Binding Message Reference component describes a concrete binding of a particular
message
+ * participating in an operation to a particular concrete message format.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 10-Oct-2004
+ */
+public class WSDLBindingOperationOutput extends WSDLBindingMessageReference implements
Serializable
+{
+ private static final long serialVersionUID = -999199387765793475L;
+
+ public WSDLBindingOperationOutput(WSDLBindingOperation wsdlBindingOperation)
+ {
+ super(wsdlBindingOperation);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLDefinitions.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLDefinitions.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,326 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.wsdl.Definition;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.core.metadata.wsdl.WSDLWriter.WriterResolver;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.w3c.dom.Document;
+
+/**
+ * The top level Definitions component is just a container for two categories of
components;
+ * WSDL components and type system components. WSDL components are interfaces, bindings
and services.
+ *
+ * Type system components describe the constraints on a message�s content.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLDefinitions implements Serializable
+{
+ private static final long serialVersionUID = 1643422922694990226L;
+
+ // provide logging
+ private final Logger log = Logger.getLogger(WSDLDefinitions.class);
+
+ /** The REQUIRED targetNamespace attribute information item defines the namespace
affiliation of top-level
+ * components defined in this definitions element information item. Interfaces,
Bindings and Services
+ * are top-level components. */
+ private String targetNamespace;
+ /** The REQUIRED wsdl namespace. For WSDL-2.0 it is
http://www.w3.org/2003/11/wsdl,
+ * for WSDL-1.1 it is
http://schemas.xmlsoap.org/wsdl/ */
+ private String wsdlNamespace;
+ /** Zero or more import element information items */
+ private List<WSDLImport> imports = new ArrayList<WSDLImport>();
+ /** Zero or more include element information items */
+ private List<WSDLInclude> includes = new ArrayList<WSDLInclude>();
+ /** Types element information item */
+ private WSDLTypes types;
+ /** Zero or more interface element information items */
+ private Map<NCName, WSDLInterface> interfaces = new LinkedHashMap<NCName,
WSDLInterface>();
+ /** Zero or more binding element information items */
+ private Map<NCName, WSDLBinding> bindings = new LinkedHashMap<NCName,
WSDLBinding>();
+ /** Zero or more service element information items */
+ private Map<NCName, WSDLService> services = new LinkedHashMap<NCName,
WSDLService>();
+
+ // Zero or more namespace definitions
+ // [TODO] What is this doing here?
+ private NamespaceRegistry namespaces = new NamespaceRegistry();
+
+ // The original wsdl4j definition if we have wsdl-1.1
+ private Definition wsdlOneOneDefinition;
+ // The WSDL document
+ private Document wsdlDocument;
+
+ public WSDLDefinitions() {}
+
+ /** Set the wsdl4j definition if we have wsdl-1.1 */
+ public void setWsdlOneOneDefinition(Definition wsdlDefinition)
+ {
+ this.wsdlOneOneDefinition = wsdlDefinition;
+ }
+
+ /**
+ * Get the wsdl4j definition if we have wsdl-1.1.
+ *
+ * Note: This object is NOT THREAD-SAFE
+ */
+ public Definition getWsdlOneOneDefinition()
+ {
+ return wsdlOneOneDefinition;
+ }
+
+ public Document getWsdlDocument()
+ {
+ return wsdlDocument;
+ }
+
+ public void setWsdlDocument(Document wsdlDocument)
+ {
+ this.wsdlDocument = wsdlDocument;
+ }
+
+ /** Register the given namespaceURI/prefix combination */
+ public String registerNamespaceURI(String nsURI, String prefix)
+ {
+ String pre = namespaces.getPrefix(nsURI);
+ if (pre == null || pre == "")
+ {
+ pre = namespaces.registerURI(nsURI, prefix);
+ log.trace("registerNamespaceURI: " + pre + "=" + nsURI);
+ }
+ return pre;
+ }
+
+ /** Register a QName and return a QName that is guarantied to have a prefix */
+ public QName registerQName(QName qname)
+ {
+ return namespaces.registerQName(qname);
+ }
+
+ /** Get the prefix for a given namespaceURI */
+ public String getPrefix(String namespaceURI)
+ {
+ return namespaces.getPrefix(namespaceURI);
+ }
+
+ /** Get the namespaceURI for a given prefix */
+ public String getNamespaceURI(String prefix)
+ {
+ return namespaces.getNamespaceURI(prefix);
+ }
+
+ /** Get the prefix for the target namespace */
+ public String getTargetPrefix()
+ {
+ return namespaces.getPrefix(targetNamespace);
+ }
+
+ /** Get an iterator for registered namespace URIs */
+ public Iterator getRegisteredNamespaceURIs()
+ {
+ return namespaces.getRegisteredURIs();
+ }
+
+ /** Get an iterator for registered prefixs */
+ public Iterator getRegisteredPrefix()
+ {
+ return namespaces.getRegisteredPrefixes();
+ }
+
+ public String getTargetNamespace()
+ {
+ return targetNamespace;
+ }
+
+ public void setTargetNamespace(String namespaceURI)
+ {
+ if(namespaceURI == null)
+ throw new IllegalArgumentException("Illegal Null
Argument:namespaceURI");
+
+ log.trace("setTargetNamespace: " + namespaceURI);
+ this.targetNamespace = namespaceURI;
+ }
+
+ public String getWsdlNamespace()
+ {
+ return wsdlNamespace;
+ }
+
+ public void setWsdlNamespace(String namespaceURI)
+ {
+ if (Constants.NS_WSDL11.equals(namespaceURI) == false &&
Constants.NS_WSDL20.equals(namespaceURI) == false)
+ throw new IllegalArgumentException("Invalid default namespace: " +
namespaceURI);
+
+ this.wsdlNamespace = namespaceURI;
+ }
+
+ public WSDLImport[] getImports()
+ {
+ WSDLImport[] arr = new WSDLImport[imports.size()];
+ imports.toArray(arr);
+ return arr;
+ }
+
+ public void addImport(WSDLImport anImport)
+ {
+ imports.add(anImport);
+ }
+
+ public WSDLInclude[] getIncludes()
+ {
+ WSDLInclude[] arr = new WSDLInclude[includes.size()];
+ includes.toArray(arr);
+ return arr;
+ }
+
+ public void addInclude(WSDLInclude include)
+ {
+ includes.add(include);
+ }
+
+ public WSDLTypes getWsdlTypes()
+ {
+ return types;
+ }
+
+ public void setWsdlTypes(WSDLTypes types)
+ {
+ this.types = types;
+ this.types.setWSDLDefintiions(this);
+ }
+
+ public WSDLInterface getInterface(NCName ncName)
+ {
+ return interfaces.get(ncName);
+ }
+
+ public WSDLInterface[] getInterfaces()
+ {
+ WSDLInterface[] arr = new WSDLInterface[interfaces.size()];
+ new ArrayList<WSDLInterface>(interfaces.values()).toArray(arr);
+ return arr;
+ }
+
+ public void addInterface(WSDLInterface wsdlInterface)
+ {
+ interfaces.put(wsdlInterface.getName(), wsdlInterface);
+ }
+
+ public WSDLBinding[] getBindings()
+ {
+ WSDLBinding[] arr = new WSDLBinding[bindings.size()];
+ new ArrayList<WSDLBinding>(bindings.values()).toArray(arr);
+ return arr;
+ }
+
+ public WSDLBinding getBinding(NCName ncName)
+ {
+ return bindings.get(ncName);
+ }
+
+ public WSDLBinding getBindingByInterfaceName(QName qname)
+ {
+ WSDLBinding wsdlBinding = null;
+ for (WSDLBinding aux : bindings.values())
+ {
+ if (aux.getInterfaceName().equals(qname))
+ {
+ if (wsdlBinding != null)
+ log.warn("Multiple WSDL bindings referrence the same interface:
" + qname);
+
+ wsdlBinding = aux;
+ }
+ }
+ return wsdlBinding;
+ }
+
+ public void addBinding(WSDLBinding binding)
+ {
+ bindings.put(binding.getName(), binding);
+ }
+
+ public WSDLService[] getServices()
+ {
+ WSDLService[] arr = new WSDLService[services.size()];
+ new ArrayList<WSDLService>(services.values()).toArray(arr);
+ return arr;
+ }
+
+ public void addService(WSDLService service)
+ {
+ services.put(service.getName(), service);
+ }
+
+ public WSDLService getService(NCName name)
+ {
+ return services.get(name);
+ }
+
+ /** Unregister the given namespaceURI/prefix combination */
+ public void unRegisterNamespaceURI(String namespaceURI, String prefix)
+ {
+ String pre = namespaces.getPrefix(namespaceURI);
+ if(pre != null && pre.equals(prefix))
+ namespaces.removePrefixMapping(prefix);
+ }
+
+ /** Write the wsdl definition to the given writer, clients should not care about the
wsdl version. */
+ public void write(Writer writer, String charset) throws IOException
+ {
+ write(writer, charset, null);
+ }
+
+ public void write(Writer writer, String charset, WriterResolver resolver) throws
IOException
+ {
+ if (Constants.NS_WSDL11.equals(wsdlNamespace))
+ {
+ WSDL11Writer wsdl11Writer = new WSDL11Writer(this);
+ wsdl11Writer.write(writer, charset, resolver);
+ }
+ else if (Constants.NS_WSDL20.equals(wsdlNamespace))
+ {
+ WSDL20Writer wsdl20Writer = new WSDL20Writer(this);
+ wsdl20Writer.write(writer);
+ }
+ else
+ {
+ throw new WSException("Unsupported wsdl version: " + wsdlNamespace);
+ }
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLDefinitionsFactory.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitionsFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitionsFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLDefinitionsFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,212 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.ConnectException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.bind.JAXBContext;
+import javax.xml.parsers.DocumentBuilder;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.EntityResolver;
+
+import com.ibm.wsdl.xml.WSDLReaderImpl;
+
+/**
+ * A factory that creates a <code>WSDLDefinitions</code> object from an URL.
+ *
+ * This implementations deals with different WSDL versions so that clients of this
+ * factory do need to know about WSDL version specifics. The Java object view of the
+ * WSDL document (WSDLDefinitions) is modeled on WSDL-2.0
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLDefinitionsFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
+
+ // This feature is set by default in wsdl4j, it means the object structure contains
the imported arguments
+ public static final String FEATURE_IMPORT_DOCUMENTS =
"javax.wsdl.importDocuments";
+ // Set this feature for additional debugging output
+ public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
+
+ // The WSDL reader features
+ private Map features = new HashMap();
+
+ // Hide constructor
+ private WSDLDefinitionsFactory()
+ {
+ }
+
+ /**
+ * Create a new instance of a wsdl factory
+ */
+ public static WSDLDefinitionsFactory newInstance()
+ {
+ return new WSDLDefinitionsFactory();
+ }
+
+ /**
+ * Set a feature on the underlying reader
+ */
+ public void setFeature(String name, boolean value) throws IllegalArgumentException
+ {
+ features.put(name, new Boolean(value));
+ }
+
+ /**
+ * Read the wsdl document from the given URL
+ */
+ public WSDLDefinitions parse(URL wsdlLocation) throws WSDLException
+ {
+ if (wsdlLocation == null)
+ throw new IllegalArgumentException("URL cannot be null");
+
+ log.debug("parse: " + wsdlLocation.toExternalForm());
+
+ EntityResolver entityResolver = new JBossWSEntityResolver();
+ WSDLDefinitions wsdlDefinitions = null;
+ try
+ {
+ Document wsdlDoc = getDocument(wsdlLocation);
+ String defaultNamespace = getDefaultNamespace(wsdlDoc);
+ if (Constants.NS_WSDL20.equals(defaultNamespace))
+ {
+ WSDL20Reader wsdlReader = new WSDL20Reader();
+
+ // Setup reader features
+ Iterator it = features.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ String key = (String)entry.getKey();
+ Boolean flag = (Boolean)entry.getValue();
+ wsdlReader.setFeature(key, flag.booleanValue());
+ }
+
+ wsdlDefinitions = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver,
wsdlLocation));
+ wsdlDefinitions.setWsdlDocument(wsdlDoc);
+ }
+ else if (Constants.NS_WSDL11.equals(defaultNamespace))
+ {
+ WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+ WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose", false);
+
+ // Setup reader features
+ Iterator it = features.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ String key = (String)entry.getKey();
+ Boolean flag = (Boolean)entry.getValue();
+ wsdlReader.setFeature(key, flag.booleanValue());
+ }
+
+ // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
+ ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
+
+ Definition definition = wsdlReader.readWSDL(new
WSDLLocatorImpl(entityResolver, wsdlLocation));
+ wsdlDefinitions = new WSDL11Reader().processDefinition(definition,
wsdlLocation);
+ wsdlDefinitions.setWsdlDocument(wsdlDoc);
+ }
+ else
+ throw new WSDLException("Invalid default namespace: " +
defaultNamespace);
+
+ if (log.isTraceEnabled())
+ {
+ StringWriter stwr = new StringWriter();
+ WSDL20Writer wsdl20Writer = new WSDL20Writer(wsdlDefinitions);
+ wsdl20Writer.write(stwr);
+ log.trace("\n" + stwr.toString());
+ }
+ }
+ catch (WSDLException e)
+ {
+ throw e;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSDLException(e);
+ }
+
+ return wsdlDefinitions;
+ }
+
+ /** Get the WSDL document.
+ */
+ private Document getDocument(URL wsdlLocation) throws WSDLException
+ {
+ try
+ {
+ InputStream wsdlInputStream = wsdlLocation.openStream();
+ try
+ {
+ DocumentBuilder builder = DOMUtils.getDocumentBuilder();
+ return builder.parse(wsdlInputStream);
+ }
+ finally
+ {
+ wsdlInputStream.close();
+ }
+ }
+ catch (ConnectException ex)
+ {
+ throw new WSDLException("Cannot connect to: " + wsdlLocation);
+ }
+ catch (Exception ex)
+ {
+ throw new WSDLException("Cannot parse wsdlLocation: " + wsdlLocation,
ex);
+ }
+ }
+
+ /** Get the default namespace for the given WSDL
+ */
+ private String getDefaultNamespace(Document wsdlDoc) throws WSDLException
+ {
+ Element root = wsdlDoc.getDocumentElement();
+ String defaultNamespace = root.getNamespaceURI();
+ return defaultNamespace;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLDocumentation.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDocumentation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDocumentation.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLDocumentation.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.Serializable;
+
+/**
+ * Represents a WSDL Document element that can be embedded in other WSDL elements
+ * such as Fault
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ */
+public class WSDLDocumentation implements Serializable
+{
+ private static final long serialVersionUID = -5931204963635014975L;
+
+ protected String documentContent = "";
+
+ public WSDLDocumentation(String str)
+ {
+ this.documentContent = str;
+ }
+
+ public String getContent()
+ {
+ return this.documentContent;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLEndpoint.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLEndpoint.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,166 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+
+/**
+ * An Endpoint component defines the particulars of a specific endpoint at which a given
service is available.
+ * Endpoint components are local to a given Service component; they cannot be referred to
by QName.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLEndpoint extends Extendable
+{
+ private static final long serialVersionUID = 4991302339046047865L;
+
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDLEndpoint.class);
+
+ // The parent service
+ private WSDLService wsdlService;
+
+ /** The REQUIRED name attribute information item together with the targetNamespace
attribute information item
+ * of the definitions element information item forms the QName of the endpoint. */
+ private NCName name;
+
+ /** Derived QName identifier.
+ */
+ private QName qname;
+
+ /** The REQUIRED binding attribute information item refers, by QName, to a Binding
component */
+ private QName binding;
+
+ /** The OPTIONAL address attribute information item specifies the address of the
endpoint. */
+ private String address;
+
+ public WSDLEndpoint(WSDLService wsdlService)
+ {
+ log.trace("new WSDLEndpoint");
+ this.wsdlService = wsdlService;
+ }
+
+ public WSDLService getWsdlService()
+ {
+ return wsdlService;
+ }
+
+ /** Get the WSDLInteraface associated to this endpoint
+ *
+ * @return A WSDLInterface or null
+ */
+ public WSDLInterface getInterface()
+ {
+ WSDLInterface wsdlInterface = null;
+
+ WSDLDefinitions wsdlDefinitions = wsdlService.getWsdlDefinitions();
+ if (wsdlService.getInterfaceName() != null)
+ {
+ QName qname = wsdlService.getInterfaceName();
+ wsdlInterface = wsdlDefinitions.getInterface(new NCName(qname));
+ }
+ else
+ {
+ WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(new NCName(binding));
+ if (wsdlBinding == null)
+ throw new WSException("Cannot obtain the binding: " + binding);
+
+ if (wsdlBinding.getInterfaceName() != null)
+ {
+ QName qname = wsdlBinding.getInterfaceName();
+ wsdlInterface = wsdlDefinitions.getInterface(new NCName(qname));
+ }
+ }
+
+ if (wsdlInterface == null)
+ throw new WSException("Cannot obtain the interface associated with this
endpoint: " + name);
+
+ return wsdlInterface;
+ }
+
+ /** Get the WSDLInterafceOperation for the given opName
+ *
+ * @param opName the operation name
+ * @return A WSDLOperation or null
+ */
+ public WSDLInterfaceOperation getInterfaceOperation(NCName opName)
+ {
+ WSDLInterface wsdlInterface = getInterface();
+ WSDLInterfaceOperation wsdlInterfaceOperation =
wsdlInterface.getWSDLInterfaceOperation(opName);
+ return wsdlInterfaceOperation;
+ }
+
+ public NCName getName()
+ {
+ return name;
+ }
+
+ public void setName(NCName name)
+ {
+ log.trace("setName: " + name);
+ this.name = name;
+ }
+
+ public QName getQName()
+ {
+ if (qname == null)
+ {
+ String tnsURI = wsdlService.getWsdlDefinitions().getTargetNamespace();
+ qname = new QName(tnsURI, name.toString());
+ }
+ return qname;
+ }
+
+
+ public void setQName(QName qname)
+ {
+ log.trace("setQName: " + qname);
+ this.qname = qname;
+ }
+
+ public QName getBinding()
+ {
+ return binding;
+ }
+
+ public void setBinding(QName binding)
+ {
+ log.trace("setBinding: " + binding);
+ this.binding = binding;
+ }
+
+ public String getAddress()
+ {
+ return address;
+ }
+
+ public void setAddress(String address)
+ {
+ this.address = address;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLException.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLException.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLException.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLException.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,93 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+/**
+ * An exception that may occur during WSDL processing.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLException extends RuntimeException
+{
+ /**
+ * Constructs a new exception with <code>null</code> as its detail
message.
+ * The cause is not initialized, and may subsequently be initialized by a
+ * call to {@link #initCause}.
+ */
+ public WSDLException()
+ {
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message. The
+ * cause is not initialized, and may subsequently be initialized by
+ * a call to {@link #initCause}.
+ *
+ * @param message the detail message. The detail message is saved for
+ * later retrieval by the {@link #getMessage()} method.
+ */
+ public WSDLException(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the specified cause and a detail
+ * message of <tt>(cause==null ? null : cause.toString())</tt> (which
+ * typically contains the class and detail message of <tt>cause</tt>).
+ * This constructor is useful for exceptions that are little more than
+ * wrappers for other throwables (for example, {@link
+ * java.security.PrivilegedActionException}).
+ *
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A <tt>null</tt> value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.4
+ */
+ public WSDLException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and
+ * cause. <p>Note that the detail message associated with
+ * <code>cause</code> is <i>not</i> automatically incorporated
in
+ * this exception's detail message.
+ *
+ * @param message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A <tt>null</tt> value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.4
+ */
+ public WSDLException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLFeature.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLFeature.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,84 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.Serializable;
+
+// $Id$
+
+/**
+ * A feature component describes an abstract piece of functionality typically associated
with the exchange of
+ * messages between communicating parties. Although WSDL poses no constraints on the
potential scope of
+ * such features, examples might include "reliability", "security",
"correlation", and "routing". The presence
+ * of a feature component in a WSDL description indicates that the service supports the
feature and may
+ * require a requester agent that interacts with the service to use that feature. Each
Feature is identified by its
+ * URI.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLFeature implements Serializable
+{
+ private static final long serialVersionUID = 8096857958254222743L;
+
+ /** A REQUIRED uri attribute information item */
+ private String uri;
+ /** An OPTIONAL required attribute information item */
+ private boolean required;
+
+ public WSDLFeature(String uri)
+ {
+ if (uri == null)
+ throw new IllegalArgumentException("Illegal feature URI: " + uri);
+
+ this.uri = uri;
+ }
+
+ public WSDLFeature(String uri, boolean required)
+ {
+ if (uri == null)
+ throw new IllegalArgumentException("Illegal feature URI: " + uri);
+
+ this.uri = uri;
+ this.required = required;
+ }
+
+ public String getURI()
+ {
+ return uri;
+ }
+
+ public boolean isRequired()
+ {
+ return required;
+ }
+
+ public void setRequired(boolean required)
+ {
+ this.required = required;
+ }
+
+ public String toString()
+ {
+ return uri;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLImport.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLImport.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,90 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.Serializable;
+
+
+// $Id$
+
+/**
+ * The WSDL import element information item, like the include element information item
(see 4.1 Including Descriptions [p.73] )
+ * also allows for the separation of the different components of a WSDL description into
independent descriptions,
+ * but in this case with different target namespaces, which can be imported as needed.
This technique helps writing
+ * clearer WSDL descriptions by separating the definitions according to their level of
abstraction, and maximizes reusability.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLImport implements Serializable
+{
+ private static final long serialVersionUID = -2641009286158029207L;
+
+ // The parent WSDL definitions
+ private WSDLDefinitions wsdlDefinitions;
+
+ /** The REQUIRED namespace attribute information item is of type xs:anyURI . Its
actual value indicates that the
+ * containing WSDL document MAY contain qualified references to WSDL definitions in
that namespace
+ * (via one or more prefixes declared with namespace declarations in the normal way).
This value MUST
+ * NOT match the actual value of the enclosing WSDL document targetNamespace
attribute
+ * information item. If the import statement results in the import of a WSDL document
then the actual value
+ * of the namespace attribute information item MUST be identical to the actual value
of the imported
+ * WSDL document's targetNamespace attribute information item. */
+ private String namespace;
+
+ /** The OPTIONAL location attribute information item is of type xs:anyURI . Its actual
value is the location of
+ * some information about the namespace identified by the namespace attribute
information item.
+ * The location attribute information item is optional. This allows WSDL components to
be constructed
+ * from information other than serialized XML 1.0. It also allows the development of
WSDL processors that
+ * have a priori (i.e., built-in) knowledge of certain namespaces. */
+ private String location;
+
+ public WSDLImport(WSDLDefinitions wsdlDefinitions)
+ {
+ this.wsdlDefinitions = wsdlDefinitions;
+ }
+
+ public WSDLDefinitions getWsdlDefinitions()
+ {
+ return wsdlDefinitions;
+ }
+
+ public String getNamespace()
+ {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace)
+ {
+ this.namespace = namespace;
+ }
+
+ public String getLocation()
+ {
+ return location;
+ }
+
+ public void setLocation(String location)
+ {
+ this.location = location;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInclude.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInclude.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInclude.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInclude.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.Serializable;
+
+
+// $Id$
+
+
+/**
+ * The WSDL include element information item allows for the separation of different
components of a
+ * service definition, belonging the same target namespace, into independent WSDL
documents which can be
+ * merged as needed.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLInclude implements Serializable
+{
+ private static final long serialVersionUID = 1210980063899094649L;
+
+ // The parent WSDL definitions
+ private WSDLDefinitions wsdlDefinitions;
+
+ /** A location attribute information item is of type xs:anyURI . Its actual value is
the location of some
+ * information about the namespace identified by the targetNamespace attribute
information item of the
+ * containing definitions element information item.*/
+ private String location;
+
+ public WSDLInclude(WSDLDefinitions wsdlDefinitions)
+ {
+ this.wsdlDefinitions = wsdlDefinitions;
+ }
+
+ public WSDLDefinitions getWsdlDefinitions()
+ {
+ return wsdlDefinitions;
+ }
+
+ public String getLocation()
+ {
+ return location;
+ }
+
+ public void setLocation(String location)
+ {
+ this.location = location;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterface.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterface.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterface.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterface.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,194 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+
+/**
+ * An Interface component describes sequences of messages that a service sends and/or
receives. It does this
+ * by grouping related messages into operations. An operation is a sequence of input and
output messages,
+ * and an interface is a set of operations. Thus, an interface defines the design of the
application.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLInterface extends Extendable
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDLInterface.class);
+
+ private static final long serialVersionUID = 2453454924501233964L;
+
+ // The parent WSDL definitions element.
+ private WSDLDefinitions wsdlDefinitions;
+
+ /** The REQUIRED name attribute information item together with the targetNamespace
attribute information item
+ * of the [parent] definitions element information item forms the QName of the
interface.
+ */
+ private NCName name;
+
+ /** Derived QName identifier.
+ */
+ private QName qname;
+
+ /** The OPTIONAL extends attribute information item lists the interfaces that this
interface derives from.
+ */
+ private QName[] extendList;
+
+ /** The OPTIONAL styleDefault attribute information item indicates the default style
used to construct the
+ * {element} properties of {message references} of all operations contained within the
[owner] interface
+ */
+ private String styleDefault;
+
+ /** Zero or more operation element information items */
+ private Map operations = new LinkedHashMap();
+ /** Zero or more fault element information items */
+ private Map faults = new LinkedHashMap();
+
+ /** Construct a WSDL interface for a given WSDL definition */
+ public WSDLInterface(WSDLDefinitions wsdlDefinitions)
+ {
+ log.trace("new WSDLInterface");
+ this.wsdlDefinitions = wsdlDefinitions;
+ }
+
+ /** Get a WSDLOperation for a given name
+ *
+ * @param name The name of the operation
+ * @return A WSDLOperation or null
+ */
+ public WSDLInterfaceOperation getWSDLInterfaceOperation(NCName name)
+ {
+ return (WSDLInterfaceOperation)operations.get(name);
+ }
+
+ public WSDLDefinitions getWsdlDefinitions()
+ {
+ return wsdlDefinitions;
+ }
+
+ public NCName getName()
+ {
+ return name;
+ }
+
+ public void setName(NCName name)
+ {
+ log.trace("setName: " + name);
+ this.name = name;
+ }
+
+ public QName getQName()
+ {
+ if (qname == null)
+ {
+ String tnsURI = wsdlDefinitions.getTargetNamespace();
+ qname = new QName(tnsURI, name.toString());
+ }
+ return qname;
+ }
+
+
+ public void setQName(QName qname)
+ {
+ log.trace("setQName: " + qname);
+ this.qname = qname;
+ }
+
+ public QName[] getExtendList()
+ {
+ return extendList;
+ }
+
+ public void setExtendList(QName[] extendList)
+ {
+ this.extendList = extendList;
+ }
+
+ public String getStyleDefault()
+ {
+ return styleDefault;
+ }
+
+ public void setStyleDefault(String styleDefault)
+ {
+ this.styleDefault = styleDefault;
+ }
+
+ public WSDLInterfaceOperation[] getOperations()
+ {
+ WSDLInterfaceOperation[] arr = new WSDLInterfaceOperation[operations.size()];
+ new ArrayList(operations.values()).toArray(arr);
+ return arr;
+ }
+
+ public WSDLInterfaceOperation[] getSortedOperations()
+ {
+ WSDLInterfaceOperation[] arr = new WSDLInterfaceOperation[operations.size()];
+ new ArrayList(operations.values()).toArray(arr);
+ Arrays.sort(arr);
+ return arr;
+ }
+
+ public WSDLInterfaceOperation getOperation(NCName opName)
+ {
+ WSDLInterfaceOperation operation = (WSDLInterfaceOperation)operations.get(opName);
+ return operation;
+ }
+
+ public void addOperation(WSDLInterfaceOperation operation)
+ {
+ operations.put(operation.getName(), operation);
+ }
+
+ public WSDLInterfaceFault[] getFaults()
+ {
+ WSDLInterfaceFault[] arr = new WSDLInterfaceFault[faults.size()];
+ new ArrayList(faults.values()).toArray(arr);
+ return arr;
+ }
+
+ public WSDLInterfaceFault getFault(NCName fName)
+ {
+ WSDLInterfaceFault fault = (WSDLInterfaceFault)faults.get(fName);
+ return fault;
+ }
+
+ public void addFault(WSDLInterfaceFault fault)
+ {
+ faults.put(fault.getName(), fault);
+ }
+
+ public boolean containsInterfaceOperation(NCName name)
+ {
+ return operations.containsKey(name);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceFault.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceFault.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceFault.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceFault.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,106 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.WSException;
+
+/**
+ * An Interface Fault component describes a fault that MAY occur during invocation of an
operation of the
+ * interface. The Interface Fault component declares an abstract fault by naming it and
indicating the
+ * contents of the fault message. When and how the fault message flows is indicated by
the Interface
+ * Operation component 2.4 Interface Operation [p.22] .
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLInterfaceFault implements Serializable
+{
+ private static final long serialVersionUID = 7820459380133521551L;
+
+ // The parent interface.
+ private WSDLInterface wsdlInterface;
+
+ /** The REQUIRED name attribute information item identifies a given fault element
information item inside a given
+ * interface element information item.
+ */
+ private NCName name;
+ /** The OPTIONAL element attribute information item refers, by QName, to an element
declaration component.
+ */
+ private QName element;
+
+ protected WSDLDocumentation documentationElement = null;
+
+ public WSDLInterfaceFault(WSDLInterface wsdlInterface)
+ {
+ this.wsdlInterface = wsdlInterface;
+ }
+
+ public WSDLInterface getWsdlInterface()
+ {
+ return wsdlInterface;
+ }
+
+ public NCName getName()
+ {
+ return name;
+ }
+
+ public void setName(NCName name)
+ {
+ this.name = name;
+ }
+
+ public QName getElement()
+ {
+ return element;
+ }
+
+ public void setElement(QName element)
+ {
+ this.element = element;
+ }
+
+ public WSDLDocumentation getDocumentation()
+ {
+ return this.documentationElement;
+ }
+
+ public void setDocumentation(WSDLDocumentation doc)
+ {
+ this.documentationElement = doc;
+ }
+
+ /** Get the xmlType for this interface fault.
+ */
+ public QName getXmlType()
+ {
+ WSDLDefinitions wsdlDefinitions = wsdlInterface.getWsdlDefinitions();
+ WSDLTypes wsdlTypes = wsdlDefinitions.getWsdlTypes();
+ return wsdlTypes.getXMLType(element);
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceMessageReference.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceMessageReference.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,246 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id: WSDLInterfaceOperationPart.java 275 2006-05-04 21:36:29Z
+// jason.greene(a)jboss.com $
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+
+/**
+ * A Message Reference component associates a defined type with a message
+ * exchanged in an operation. By default, the type system is based upon the XML
+ * Infoset
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @since 10-Oct-2004
+ */
+public abstract class WSDLInterfaceMessageReference extends Extendable implements
Comparable
+{
+ // provide logging
+ protected Logger log = Logger.getLogger(getClass());
+
+ // The parent interface operation
+ private WSDLInterfaceOperation wsdlOperation;
+
+ /**
+ * The OPTIONAL messageLabel attribute information item identifies the role
+ * of this message in the message exchange pattern of the given operation
+ * element information item.
+ */
+ private NCName messageLabel;
+
+ /**
+ * The OPTIONAL element attribute information item is the element declaration
+ * from the {element declarations} property resolved by the value of the
+ * element attribute information item, otherwise empty.
+ */
+ private QName element;
+
+ /**
+ * Used mainly for WSDL 1.1 compatibility, indicates rpc parts.
+ * Although, this could be used to represent WSDL 2.0 RPC style.
+ */
+ private LinkedHashMap<String, WSDLRPCPart> childParts = new
LinkedHashMap<String, WSDLRPCPart>();
+
+ /**
+ * Used for WSDL 1.1
+ */
+ private String partName;
+
+ /**
+ * Used for WSDL 1.1
+ */
+ private QName messageName;
+
+ public WSDLInterfaceMessageReference(WSDLInterfaceOperation wsdlOperation)
+ {
+ log.trace("New part for wsdlOperation: " + wsdlOperation.getName());
+ this.wsdlOperation = wsdlOperation;
+ }
+
+ public WSDLInterfaceOperation getWsdlOperation()
+ {
+ return wsdlOperation;
+ }
+
+ public NCName getMessageLabel()
+ {
+ return messageLabel;
+ }
+
+ public void setMessageLabel(NCName messageLabel)
+ {
+ log.trace("setMessageLabel: " + messageLabel);
+ this.messageLabel = messageLabel;
+ }
+
+ public QName getElement()
+ {
+ return element;
+ }
+
+ public void setElement(QName element)
+ {
+ log.trace("setElement: " + element);
+ this.element = element;
+ }
+
+ /**
+ * Get the xmlType for this operation part.
+ */
+ public QName getXMLType()
+ {
+ QName xmlType = null;
+
+ // First try to read it from the schema
+ WSDLDefinitions wsdlDefinitions =
wsdlOperation.getWsdlInterface().getWsdlDefinitions();
+ WSDLTypes wsdlTypes = wsdlDefinitions.getWsdlTypes();
+ xmlType = wsdlTypes.getXMLType(element);
+
+ // Fall back to the property
+ if (xmlType == null)
+ {
+ WSDLProperty property = getProperty(Constants.WSDL_PROPERTY_RPC_XMLTYPE);
+ if (property != null)
+ {
+ String qnameRef = property.getValue();
+ int colIndex = qnameRef.indexOf(':');
+ String prefix = qnameRef.substring(0, colIndex);
+ String localPart = qnameRef.substring(colIndex + 1);
+ String nsURI = wsdlDefinitions.getNamespaceURI(prefix);
+ xmlType = new QName(nsURI, localPart, prefix);
+ }
+ }
+
+ if (xmlType == null)
+ throw new WSException("Cannot obtain xmlType for element: " +
element);
+
+ return xmlType;
+ }
+
+ /**
+ * Gets the child parts associated with this message reference. This is only
+ * used for RPC style, and currently only supported by WSDL 1.1.
+ *
+ * @return the list of rpc parts that make up the message
+ */
+ public Collection<WSDLRPCPart> getChildParts()
+ {
+ return childParts.values();
+ }
+
+ /**
+ * Gets the child part associated with this message reference by part name.
+ * This is only used for RPC style, and currently only supported by WSDL 1.1.
+ *
+ * @param name the part name
+ * @return the part or null if not found
+ */
+ public WSDLRPCPart getChildPart(String name)
+ {
+ return childParts.get(name);
+ }
+
+ /**
+ * Adds a child part to this mesage reference. This is only used for RPC
+ * style, and currently only supported by WSDL 1.1.
+ *
+ * @param childPart the list of rpc parts that make up the message
+ */
+ public void addChildPart(WSDLRPCPart childPart)
+ {
+ this.childParts.put(childPart.getName(), childPart);
+ }
+
+ /**
+ * Removes a speficied child part. This is This is only used for RPC
+ * style, and currently only supported by WSDL 1.1.
+ *
+ * @param name the name of the part
+ */
+ public void removeChildPart(String name)
+ {
+ this.childParts.remove(name);
+ }
+
+ /**
+ * Gets the WSDL 1.1 part name.
+ *
+ * @return the part name
+ */
+ public String getPartName()
+ {
+ return partName;
+ }
+
+ /**
+ * Sets the WSDL 1.1 message name.
+ *
+ * @param messageName The part name
+ */
+ public void setMessageName(QName messageName)
+ {
+ this.messageName = messageName;
+ }
+
+ /**
+ * Gets the WSDL 1.1 message name.
+ *
+ * @return the message name
+ */
+ public QName getMessageName()
+ {
+ return messageName;
+ }
+
+ /**
+ * Sets the WSDL 1.1 part name.
+ *
+ * @param partName The part name
+ */
+ public void setPartName(String partName)
+ {
+ this.partName = partName;
+ }
+
+ public int compareTo(Object o)
+ {
+ int c = -1;
+ if (o instanceof WSDLInterfaceMessageReference)
+ {
+ WSDLInterfaceMessageReference w = (WSDLInterfaceMessageReference) o;
+ String oname = w.getElement().getLocalPart();
+ String myname = getElement().getLocalPart();
+ c = myname.compareTo(oname);
+ }
+ return c;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperation.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperation.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,284 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+
+// $Id$
+
+/**
+ * An Interface Operation component describes an operation that a given interface
supports. An operation is
+ * an interaction with the service consisting of a set (ordinary and fault) messages
exchanged between the
+ * service and the other roles involved in the interaction, in particular the service
requester. The sequencing
+ * and cardinality of the messages involved in a particular interaction is governed by
the message exchange
+ * pattern used by the operation (see {message exchange pattern} property).
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLInterfaceOperation extends Extendable implements Comparable
+{
+ private static final long serialVersionUID = -5014918078197942626L;
+
+ // The parent interface
+ private WSDLInterface wsdlInterface;
+
+ /** The REQUIRED name attribute information item identifies a given operation element
information item inside a
+ * given interface element information item.
+ */
+ private NCName name;
+
+ /** The OPTIONAL pattern attribute information item identifies the message exchange
pattern a given operation uses.
+ */
+ private String pattern;
+
+ /** The OPTIONAL style attribute information item indicates the rules that were used
to construct the {element}
+ * properties of the Message Reference components which are members of the {message
references}
+ * property of the [owner] operation.
+ */
+ private String style = Constants.URI_STYLE_RPC;
+
+ /** The OPTIONAL safe attribute information item indicates whether the operation is
safe or not.
+ */
+ private boolean safe;
+
+ /** Zero or more input element information items */
+ private Map<QName, WSDLInterfaceOperationInput> inputs = new
LinkedHashMap<QName, WSDLInterfaceOperationInput>();
+ /** Zero or more output element information items */
+ private Map<QName, WSDLInterfaceOperationOutput> outputs = new
LinkedHashMap<QName, WSDLInterfaceOperationOutput>();
+ /** Zero or more infault element information items */
+ private ArrayList<WSDLInterfaceOperationInfault> infaults = new
ArrayList<WSDLInterfaceOperationInfault>();
+ /** Zero or more outfault element information items */
+ private ArrayList<WSDLInterfaceOperationOutfault> outfaults = new
ArrayList<WSDLInterfaceOperationOutfault>();
+ /** Zero or more signature items */
+ private LinkedHashMap<String, WSDLRPCSignatureItem> rpcSignatureItems = new
LinkedHashMap<String, WSDLRPCSignatureItem>();
+
+ public WSDLInterfaceOperation(WSDLInterface wsdlInterface)
+ {
+ this.wsdlInterface = wsdlInterface;
+ }
+
+ public WSDLInterface getWsdlInterface()
+ {
+ return wsdlInterface;
+ }
+
+ public NCName getName()
+ {
+ return name;
+ }
+
+ public void setName(NCName name)
+ {
+ this.name = name;
+ }
+
+ public QName getQName()
+ {
+ String nsURI = wsdlInterface.getQName().getNamespaceURI();
+ return new QName(nsURI, name.toString());
+ }
+
+ public String getPattern()
+ {
+ return pattern;
+ }
+
+ public void setPattern(String pattern)
+ {
+ this.pattern = pattern;
+ }
+
+ public String getStyle()
+ {
+ return style;
+ }
+
+ public void setStyle(String style)
+ {
+ this.style = style;
+ }
+
+ public boolean isSafe()
+ {
+ return safe;
+ }
+
+ public void setSafe(boolean safe)
+ {
+ this.safe = safe;
+ }
+
+ public WSDLInterfaceOperationInput[] getInputs()
+ {
+ WSDLInterfaceOperationInput[] arr = new
WSDLInterfaceOperationInput[inputs.size()];
+ new ArrayList<WSDLInterfaceOperationInput>(inputs.values()).toArray(arr);
+ return arr;
+ }
+
+ public void addInput(WSDLInterfaceOperationInput input)
+ {
+ QName xmlName = input.getElement();
+ if (inputs.get(xmlName) != null)
+ throw new WSException("Attempt to map multiple operation inputs to: "
+ xmlName);
+ inputs.put(xmlName, input);
+ }
+
+ public WSDLInterfaceOperationInput getInput(QName qname)
+ {
+ WSDLInterfaceOperationInput opInput =
(WSDLInterfaceOperationInput)inputs.get(qname);
+ return opInput;
+ }
+
+ public void removeInput(QName element)
+ {
+ inputs.remove(element);
+ }
+
+ public WSDLInterfaceOperationInput getInputByPartName(String partName)
+ {
+ WSDLInterfaceOperationInput opInput = null;
+ for (WSDLInterfaceOperationInput auxInput : inputs.values())
+ {
+ WSDLProperty property =
auxInput.getProperty(Constants.WSDL_PROPERTY_PART_NAME);
+ if (property != null && property.getValue().equals(partName))
+ opInput = auxInput;
+ }
+ return opInput;
+ }
+
+ public WSDLInterfaceOperationOutput[] getOutputs()
+ {
+ WSDLInterfaceOperationOutput[] arr = new
WSDLInterfaceOperationOutput[outputs.size()];
+ new ArrayList<WSDLInterfaceOperationOutput>(outputs.values()).toArray(arr);
+ return arr;
+ }
+
+ public void addOutput(WSDLInterfaceOperationOutput output)
+ {
+ QName xmlName = output.getElement();
+ if (outputs.get(xmlName) != null)
+ throw new WSException("Attempt to map multiple operation outputs to: "
+ xmlName);
+ outputs.put(xmlName, output);
+ }
+
+ public WSDLInterfaceOperationOutput getOutput(QName qname)
+ {
+ WSDLInterfaceOperationOutput opOutput =
(WSDLInterfaceOperationOutput)outputs.get(qname);
+ return opOutput;
+ }
+
+ public WSDLInterfaceOperationOutput getOutputByPartName(String partName)
+ {
+ WSDLInterfaceOperationOutput opOutput = null;
+ for (WSDLInterfaceOperationOutput auxOutput : outputs.values())
+ {
+ WSDLProperty property =
auxOutput.getProperty(Constants.WSDL_PROPERTY_PART_NAME);
+ if (property != null && property.getValue().equals(partName))
+ opOutput = auxOutput;
+ }
+ return opOutput;
+ }
+
+ public WSDLInterfaceOperationInfault[] getInfaults()
+ {
+ WSDLInterfaceOperationInfault[] arr = new
WSDLInterfaceOperationInfault[infaults.size()];
+ infaults.toArray(arr);
+ return arr;
+ }
+
+ public void addInfault(WSDLInterfaceOperationInfault infault)
+ {
+ infaults.add(infault);
+ }
+
+ public WSDLInterfaceOperationOutfault[] getOutfaults()
+ {
+ WSDLInterfaceOperationOutfault[] arr = new
WSDLInterfaceOperationOutfault[outfaults.size()];
+ outfaults.toArray(arr);
+ return arr;
+ }
+
+ public void addOutfault(WSDLInterfaceOperationOutfault outfault)
+ {
+ outfaults.add(outfault);
+ }
+
+ public Collection<WSDLRPCSignatureItem> getRpcSignatureItems()
+ {
+ return rpcSignatureItems.values();
+ }
+
+
+ public void addRpcSignatureItem(WSDLRPCSignatureItem item)
+ {
+ if (item.getDirection() != Direction.RETURN)
+ item.setPosition(rpcSignatureItems.size());
+ rpcSignatureItems.put(item.getName(), item);
+ }
+
+ public WSDLRPCSignatureItem getRpcSignatureitem(String name)
+ {
+ return rpcSignatureItems.get(name);
+ }
+
+ /**
+ * Attempts to locate a binding operation for this interface operation.
+ *
+ * @return the binding operation, or null if not found;
+ */
+ public WSDLBindingOperation getBindingOperation()
+ {
+ WSDLInterface wsdlInterface = getWsdlInterface();
+ WSDLBinding binding =
wsdlInterface.getWsdlDefinitions().getBindingByInterfaceName(wsdlInterface.getQName());
+ if (binding == null)
+ return null;
+
+ WSDLBindingOperation bindingOperation = binding.getOperationByRef(getQName());
+ if (bindingOperation == null)
+ return null;
+
+ return bindingOperation;
+ }
+
+ public int compareTo(Object o)
+ {
+ int c = -1;
+ if (o instanceof WSDLInterfaceOperation)
+ {
+ WSDLInterfaceOperation w = (WSDLInterfaceOperation)o;
+ String oname = w.getName().toString();
+ String myname = name.toString();
+ c = myname.compareTo(oname);
+ }
+ return c;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationInfault.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationInfault.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,83 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+/**
+ * A Fault Reference component associates a defined type, specified by an Interface Fault
component, to a
+ * fault message exchanged in an operation.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLInterfaceOperationInfault extends Extendable
+{
+ private static final long serialVersionUID = 1124693747462594773L;
+
+ // The parent interface operation
+ private WSDLInterfaceOperation wsdlInterfaceOperation;
+
+ /** A REQUIRED reference to an Interface Fault component in the {faults} property of
the parent
+ * Interface Operation component's parent Interface component. Identifying the
Interface Fault
+ * component therefore indirectly defines the actual content or payload of the fault
message.
+ */
+ private QName ref;
+
+ /** An OPTIONAL identifier of the message this fault relates to among those defined in
the {message exchange
+ * pattern} property of the Interface Operation component it is contained within. The
value of this
+ * property MUST match the name of a placeholder message defined by the message
exchange pattern.
+ */
+ private NCName messageLabel;
+
+ public WSDLInterfaceOperationInfault(WSDLInterfaceOperation wsdlInterfaceOperation)
+ {
+ this.wsdlInterfaceOperation = wsdlInterfaceOperation;
+ }
+
+ public WSDLInterfaceOperation getWsdlInterfaceOperation()
+ {
+ return wsdlInterfaceOperation;
+ }
+
+ public QName getRef()
+ {
+ return ref;
+ }
+
+ public void setRef(QName ref)
+ {
+ this.ref = ref;
+ }
+
+ public NCName getMessageLabel()
+ {
+ return messageLabel;
+ }
+
+ public void setMessageLabel(NCName messageLabel)
+ {
+ this.messageLabel = messageLabel;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationInput.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInput.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInput.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationInput.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+/**
+ * A Message Reference component associates a defined type with a message exchanged in an
operation. By
+ * default, the type system is based upon the XML Infoset
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLInterfaceOperationInput extends WSDLInterfaceMessageReference
+{
+ private static final long serialVersionUID = -4691488323709300920L;
+
+ public WSDLInterfaceOperationInput(WSDLInterfaceOperation wsdlOperation)
+ {
+ super(wsdlOperation);
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationOutfault.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutfault.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationOutfault.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,83 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+/**
+ * A Fault Reference component associates a defined type, specified by an Interface Fault
component, to a
+ * fault message exchanged in an operation.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLInterfaceOperationOutfault extends Extendable
+{
+ private static final long serialVersionUID = 1365062002410904728L;
+
+ // The parent interface operation
+ private WSDLInterfaceOperation wsdlInterfaceOperation;
+
+ /** A REQUIRED reference to an Interface Fault component in the {faults} property of
the parent
+ * Interface Operation component's parent Interface component. Identifying the
Interface Fault
+ * component therefore indirectly defines the actual content or payload of the fault
message.
+ */
+ private QName ref;
+
+ /** An OPTIONAL identifier of the message this fault relates to among those defined in
the {message exchange
+ * pattern} property of the Interface Operation component it is contained within. The
value of this
+ * property MUST match the name of a placeholder message defined by the message
exchange pattern.
+ */
+ private NCName messageLabel;
+
+ public WSDLInterfaceOperationOutfault(WSDLInterfaceOperation wsdlInterfaceOperation)
+ {
+ this.wsdlInterfaceOperation = wsdlInterfaceOperation;
+ }
+
+ public WSDLInterfaceOperation getWsdlInterfaceOperation()
+ {
+ return wsdlInterfaceOperation;
+ }
+
+ public QName getRef()
+ {
+ return ref;
+ }
+
+ public void setRef(QName ref)
+ {
+ this.ref = ref;
+ }
+
+ public NCName getMessageLabel()
+ {
+ return messageLabel;
+ }
+
+ public void setMessageLabel(NCName messageLabel)
+ {
+ this.messageLabel = messageLabel;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationOutput.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutput.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationOutput.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLInterfaceOperationOutput.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+/**
+ * A Message Reference component associates a defined type with a message exchanged in an
operation. By
+ * default, the type system is based upon the XML Infoset
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLInterfaceOperationOutput extends WSDLInterfaceMessageReference
+{
+ private static final long serialVersionUID = 5096501821825901473L;
+
+ public WSDLInterfaceOperationOutput(WSDLInterfaceOperation wsdlOperation)
+ {
+ super(wsdlOperation);
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLLocatorImpl.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLLocatorImpl.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLLocatorImpl.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLLocatorImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,159 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.wsdl.xml.WSDLLocator;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+
+/* A WSDLLocator that can handle wsdl imports
+ */
+class WSDLLocatorImpl implements WSDLLocator
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
+
+ private EntityResolver entityResolver;
+ private URL wsdlURL;
+ private String latestImportURI;
+
+ public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlFile)
+ {
+ if (wsdlFile == null)
+ throw new IllegalArgumentException("WSDL file argument cannot be
null");
+
+ this.entityResolver = entityResolver;
+ this.wsdlURL = wsdlFile;
+ }
+
+ public InputSource getBaseInputSource()
+ {
+ log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
+ try
+ {
+ InputStream is = wsdlURL.openStream();
+ if (is == null)
+ throw new IllegalArgumentException("Cannot obtain wsdl from [" +
wsdlURL + "]");
+
+ return new InputSource(is);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Cannot access wsdl from [" + wsdlURL +
"], " + e.getMessage());
+ }
+ }
+
+ public String getBaseURI()
+ {
+ return wsdlURL.toExternalForm();
+ }
+
+ public InputSource getImportInputSource(String parent, String resource)
+ {
+ log.trace("getImportInputSource [parent=" + parent +
",resource=" + resource + "]");
+
+ URL parentURL = null;
+ try
+ {
+ parentURL = new URL(parent);
+ }
+ catch (MalformedURLException e)
+ {
+ log.error("Not a valid URL: " + parent);
+ return null;
+ }
+
+ String wsdlImport = null;
+ String external = parentURL.toExternalForm();
+
+ // An external URL
+ if (resource.startsWith("http://") ||
resource.startsWith("https://"))
+ {
+ wsdlImport = resource;
+ }
+
+ // Absolute path
+ else if (resource.startsWith("/"))
+ {
+ String beforePath = external.substring(0,
external.indexOf(parentURL.getPath()));
+ wsdlImport = beforePath + resource;
+ }
+
+ // A relative path
+ else
+ {
+ String parentDir = external.substring(0, external.lastIndexOf("/"));
+
+ // remove references to current dir
+ while (resource.startsWith("./"))
+ resource = resource.substring(2);
+
+ // remove references to parentdir
+ while (resource.startsWith("../"))
+ {
+ parentDir = parentDir.substring(0, parentDir.lastIndexOf("/"));
+ resource = resource.substring(3);
+ }
+
+ wsdlImport = parentDir + "/" + resource;
+ }
+
+ try
+ {
+ log.trace("Trying to resolve: " + wsdlImport);
+ InputSource inputSource = entityResolver.resolveEntity(wsdlImport, wsdlImport);
+ if (inputSource != null)
+ {
+ latestImportURI = wsdlImport;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot resolve imported resource:
" + wsdlImport);
+ }
+
+ return inputSource;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Cannot access imported wsdl [" + wsdlImport +
"], " + e.getMessage());
+ }
+ }
+
+ public String getLatestImportURI()
+ {
+ return latestImportURI;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLMIMEPart.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLMIMEPart.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLMIMEPart.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLMIMEPart.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Represents a WSDL 1.1 MIME Multipart attachment.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WSDLMIMEPart implements Serializable
+{
+ private static final long serialVersionUID = -3102495235178249853L;
+
+ private final String partName;
+ private final QName xmlType;
+ private final String mimeTypes;
+
+ public WSDLMIMEPart(String partName, QName xmlType, String mimeTypes)
+ {
+ this.mimeTypes = mimeTypes;
+ this.partName = partName;
+ this.xmlType = xmlType;
+ }
+
+ /**
+ * Returns the xml type of this attachment. Typically xsd:hexBinary
+ *
+ * @return the name of the header schema element
+ */
+ public QName getXmlType()
+ {
+ return xmlType;
+ }
+
+ /**
+ * Returns the name of the WSDL 1.1 part, if the output is WSDL 1.1
+ *
+ * @return the name of the part
+ */
+ public String getPartName()
+ {
+ return partName;
+ }
+
+ /**
+ * Returns a comma seperated list of allowed mime types.
+ *
+ * @return the mime types
+ */
+ public String getMimeTypes()
+ {
+ return mimeTypes;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLProperty.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLProperty.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,117 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+// $Id$
+
+
+/**
+ * A "property" in the Features and Properties architecture represents a named
runtime value which affects
+ * the behaviour of some aspect of a Web service interaction, much like an environment
variable. For
+ * example, a reliable messaging SOAP module may specify a property to control the number
of retries in the
+ * case of network failure. WSDL documents may specify the value constraints for these
properties by
+ * referring to a Schema type, or by specifying a particular value. Properties, and hence
property values, can
+ * be shared amongst features/bindings/modules, and are named with URIs precisely to
allow this type of
+ * sharing.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLProperty implements Serializable
+{
+ private static final long serialVersionUID = -7528676719881753461L;
+
+ /** A REQUIRED uri attribute information item */
+ private String uri;
+ /** An OPTIONAL required attribute information item */
+ private boolean required;
+ /** The OPTIONAL value of the property, an ordered list of child information items,
as
+ * specified by the [children] property of element information items */
+ private String value;
+ /** A OPTIONAL type definition constraining the value of the property, or the token
+ * #value if the {value} property is not empty.*/
+ private QName constraint;
+
+ public WSDLProperty(String uri, String value)
+ {
+ if (uri == null)
+ throw new IllegalArgumentException("Illegal property URI: " + uri);
+
+ this.uri = uri;
+ this.value = value;
+ }
+
+ public WSDLProperty(String uri, boolean required, String value, QName constraint)
+ {
+ if (uri == null)
+ throw new IllegalArgumentException("Illegal property URI: " + uri);
+
+ this.uri = uri;
+ this.required = required;
+ this.value = value;
+ this.constraint = constraint;
+ }
+
+ public String getURI()
+ {
+ return uri;
+ }
+
+ public boolean isRequired()
+ {
+ return required;
+ }
+
+ public void setRequired(boolean required)
+ {
+ this.required = required;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+ public QName getConstraint()
+ {
+ return constraint;
+ }
+
+ public void setConstraint(QName constraint)
+ {
+ this.constraint = constraint;
+ }
+
+ public String toString()
+ {
+ return "[" + uri + "=" + value + "]";
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLRPCPart.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCPart.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCPart.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLRPCPart.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.wsdl;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Represents a child part of a RPC style message reference. This is currently
+ * only used for WSDL 1.1 compatibility.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WSDLRPCPart
+{
+ private final String name;
+ private final QName type;
+
+ public WSDLRPCPart(String name, QName type)
+ {
+ this.name = name;
+ this.type = type;
+ }
+
+ /**
+ * Gets the XML local name of this part.
+ *
+ * @return the XML local name
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Gets the XML type of this part.
+ *
+ * @return the XML type
+ */
+ public QName getType()
+ {
+ return type;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLRPCSignatureItem.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCSignatureItem.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLRPCSignatureItem.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLRPCSignatureItem.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+
+/**
+ * Represents an individual item of a wrpc:signature
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WSDLRPCSignatureItem
+{
+ public enum Direction {IN, OUT, INOUT, RETURN};
+
+ private Direction direction;
+ private final String name;
+ private int position;
+
+ public WSDLRPCSignatureItem(String name)
+ {
+ this.name = name;
+ this.direction = Direction.IN;
+ }
+
+ public WSDLRPCSignatureItem(String name, Direction direction)
+ {
+ this.direction = direction;
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Direction getDirection()
+ {
+ return direction;
+ }
+
+ public void setDirection(Direction direction)
+ {
+ this.direction = direction;
+ }
+
+ public void setPosition(int position)
+ {
+ this.position = position;
+ }
+
+ public int getPosition()
+ {
+ return position;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLSOAPHeader.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLSOAPHeader.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLSOAPHeader.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLSOAPHeader.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Represents a WSDL 2.0 SOAP Header Block. The presence of the SOAP Header
+ * Block component indicates that the service supports headers and MAY require a
+ * web service consumer/client to use the header. It may appear up to one time
+ * in the message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WSDLSOAPHeader implements Serializable
+{
+ private static final long serialVersionUID = -3102495235178249853L;
+
+ private final QName element;
+ private final String partName;
+ private boolean required = false;
+ private boolean mustUnderstand = false;
+ private boolean includeInSignature = false;
+
+ public WSDLSOAPHeader(QName element, String partName)
+ {
+ this.element = element;
+ this.partName = partName;
+ }
+
+ /**
+ * Returns the name of the header schema element that describes the header's
+ * contents.
+ *
+ * @return the name of the header schema element
+ */
+ public QName getElement()
+ {
+ return element;
+ }
+
+ /**
+ * Returns the name of the WSDL 1.1 part, if the output is WSDL 1.1
+ *
+ * @return the name of the part
+ */
+ public String getPartName()
+ {
+ return partName;
+ }
+
+ /**
+ * Indicates whether the resulting SOAP header has a mustUnderstand attribute
+ * set to true.
+ *
+ * @return the value of the SOAP mustUnderstand attribute
+ */
+ public boolean isMustUnderstand()
+ {
+ return mustUnderstand;
+ }
+
+ /**
+ * Specifies whether the resulting SOAP Header has a mustUnderstand attribute
+ * set to true.
+ *
+ * @param mustUnderstand the value of the SOAP mustUnderstand attribute
+ */
+ public void setMustUnderstand(boolean mustUnderstand)
+ {
+ this.mustUnderstand = mustUnderstand;
+ }
+
+ /**
+ * Indicates whether the resulting SOAP header must be present in the
+ * message.
+ *
+ * @return true if the header must be present, otherwise false
+ */
+ public boolean isRequired()
+ {
+ return required;
+ }
+
+ /**
+ * Specifies whether the resulting SOAP header is required to be present on
+ * the message.
+ *
+ * @param required true if the header must be present, otherwise false
+ */
+ public void setRequired(boolean required)
+ {
+ this.required = required;
+ }
+
+ /**
+ * Indicates the resulting WSDL should include this header as part of the
+ * interface message. This is currently only valid for WSDL 1.1, as WSDL 2.0
+ * does not have an equivalent way to specify this. This serves as a hint to
+ * binding tools that the header should be mapped to a Java parameter.
+ *
+ * @return whether the header should be part of the interface message
+ */
+ public boolean isIncludeInSignature()
+ {
+ return includeInSignature;
+ }
+
+ /**
+ * Speficies the resulting WSDL should include this header as part of the
+ * interface message. This is currently only valid for WSDL 1.1, as WSDL 2.0
+ * does not have an equivalent way to specify this. This serves as a hint to
+ * binding tools that the header should be mapped to a Java parameter.
+ *
+ * @param includeInSignature whether the header should be part of the
+ * interface message
+ */
+ public void setIncludeInSignature(boolean includeInSignature)
+ {
+ this.includeInSignature = includeInSignature;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLService.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLService.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,139 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A Service component describes a set of endpoints (see 2.14 Endpoint [p.62] ) at which
a particular
+ * deployed implementation of the service is provided. The endpoints thus are in effect
alternate places at
+ * which the service is provided.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLService extends Extendable
+{
+ private static final long serialVersionUID = 1274166611190648479L;
+
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDLService.class);
+
+ // The parent WSDL definitions element.
+ private WSDLDefinitions wsdlDefinitions;
+
+ /** The REQUIRED name attribute information item together with the targetNamespace
attribute information item
+ * of the definitions element information item forms the QName of the service.*/
+ private NCName name;
+
+ /** Derived QName identifier.
+ */
+ private QName qname;
+
+ /** The interface attribute information item identifies the interface that the service
is an instance of. */
+ private QName interfaceName;
+
+ /** One or more endpoint element information items */
+ private ArrayList<WSDLEndpoint> endpoints = new
ArrayList<WSDLEndpoint>();
+
+ public WSDLService(WSDLDefinitions wsdlDefinitions)
+ {
+ log.trace("new WSDLService");
+ this.wsdlDefinitions = wsdlDefinitions;
+ }
+
+ public WSDLDefinitions getWsdlDefinitions()
+ {
+ return wsdlDefinitions;
+ }
+
+ public NCName getName()
+ {
+ return name;
+ }
+
+ public void setName(NCName name)
+ {
+ log.trace("setName: " + name);
+ this.name = name;
+ }
+
+ public QName getQName()
+ {
+ if (qname == null)
+ {
+ String tnsURI = wsdlDefinitions.getTargetNamespace();
+ qname = new QName(tnsURI, name.toString());
+ }
+ return qname;
+ }
+
+
+ public void setQName(QName qname)
+ {
+ log.trace("setQName: " + qname);
+ this.qname = qname;
+ }
+
+ public QName getInterfaceName()
+ {
+ return interfaceName;
+ }
+
+ public void setInterfaceName(QName interfaceName)
+ {
+ this.interfaceName = interfaceName;
+ }
+
+ public WSDLEndpoint[] getEndpoints()
+ {
+ WSDLEndpoint[] arr = new WSDLEndpoint[endpoints.size()];
+ endpoints.toArray(arr);
+ return arr;
+ }
+
+ public void addEndpoint(WSDLEndpoint endpoint)
+ {
+ endpoints.add(endpoint);
+ }
+
+ /** Get an endpoint for the given name
+ */
+ public WSDLEndpoint getEndpoint(QName portName)
+ {
+ Iterator it = endpoints.iterator();
+ while (it.hasNext())
+ {
+ WSDLEndpoint wsdlEndpoint = (WSDLEndpoint)it.next();
+ if (portName.equals(wsdlEndpoint.getQName()))
+ return wsdlEndpoint;
+ }
+ return null;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLTypes.java (from
rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLTypes.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,76 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+//$Id$
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+
+/**
+ * WSDL types.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public abstract class WSDLTypes implements Serializable
+{
+ private static final long serialVersionUID = 7919937323521372194L;
+
+ // provide logging
+ static private final Logger log = Logger.getLogger(WSDLTypes.class);
+
+ private WSDLDefinitions wsdlDefinitions;
+ private String namespace;
+
+ public abstract QName getXMLType(QName name);
+
+ public WSDLDefinitions getWsdlDefinitions()
+ {
+ return wsdlDefinitions;
+ }
+
+ void setWSDLDefintiions(WSDLDefinitions parent)
+ {
+ wsdlDefinitions = parent;
+ }
+
+ /**
+ * Gets the namespace associate with this types declaration. Currently this is used to
filter
+ * which WSDL file receives this types definition. Null means all files.
+ *
+ * @return the namespace associated with this type definition
+ */
+ public String getNamespace()
+ {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace)
+ {
+ this.namespace = namespace;
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLUtils.java (from
rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLUtils.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,889 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.EmptyStackException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+import java.util.StringTokenizer;
+
+import javax.ejb.SessionBean;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.holders.BigDecimalHolder;
+import javax.xml.rpc.holders.BigIntegerHolder;
+import javax.xml.rpc.holders.BooleanHolder;
+import javax.xml.rpc.holders.BooleanWrapperHolder;
+import javax.xml.rpc.holders.ByteArrayHolder;
+import javax.xml.rpc.holders.ByteHolder;
+import javax.xml.rpc.holders.ByteWrapperHolder;
+import javax.xml.rpc.holders.CalendarHolder;
+import javax.xml.rpc.holders.DoubleHolder;
+import javax.xml.rpc.holders.DoubleWrapperHolder;
+import javax.xml.rpc.holders.FloatHolder;
+import javax.xml.rpc.holders.FloatWrapperHolder;
+import javax.xml.rpc.holders.Holder;
+import javax.xml.rpc.holders.IntHolder;
+import javax.xml.rpc.holders.IntegerWrapperHolder;
+import javax.xml.rpc.holders.LongHolder;
+import javax.xml.rpc.holders.LongWrapperHolder;
+import javax.xml.rpc.holders.ObjectHolder;
+import javax.xml.rpc.holders.QNameHolder;
+import javax.xml.rpc.holders.ShortHolder;
+import javax.xml.rpc.holders.ShortWrapperHolder;
+import javax.xml.rpc.holders.StringHolder;
+
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSModel;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.utils.HolderUtils;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.xb.binding.Util;
+
+/**
+ * Singleton utils class used for Java2WSDL and WSDL2Java operations
+ *
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Nov 3, 2004
+ */
+
+public class WSDLUtils
+{
+ private String newline = "\n";
+ private static WSDLUtils instance = new WSDLUtils();
+
+ private List wrapperlist = null;
+ private List primlist = null;
+
+ private final Map primitiveMap = new HashMap();
+
+ private final static Map<String,Class> schemaBasicTypes = new
HashMap<String,Class>();
+
+ private final static Map<Class,Class> holderTypes = new
HashMap<Class,Class>();
+ private final static Map<Class,Class> reverseHolderTypes = new
HashMap<Class,Class>();
+
+ // Skip these methods when generating wsdl operations
+ private List<String> ignoredMethods;
+
+ static
+ {
+ schemaBasicTypes.put("anyURI", java.net.URI.class);
+ schemaBasicTypes.put("boolean", Boolean.TYPE);
+ schemaBasicTypes.put("byte", Byte.TYPE);
+ schemaBasicTypes.put("decimal", java.math.BigDecimal.class);
+ schemaBasicTypes.put("double", Double.TYPE);
+ schemaBasicTypes.put("dateTime", Calendar.class);
+ schemaBasicTypes.put("float", Float.TYPE);
+ schemaBasicTypes.put("int", Integer.TYPE);
+ schemaBasicTypes.put("integer", BigInteger.class);
+ schemaBasicTypes.put("long", Long.TYPE);
+ schemaBasicTypes.put("QName", QName.class);
+ schemaBasicTypes.put("short", Short.TYPE);
+ schemaBasicTypes.put("String", String.class);
+ }
+
+ static
+ {
+ holderTypes.put(BigDecimal.class,BigDecimalHolder.class);
+ holderTypes.put(BigInteger.class,BigIntegerHolder.class);
+ holderTypes.put(boolean.class,BooleanHolder.class);
+ holderTypes.put(Boolean.class,BooleanWrapperHolder.class);
+ holderTypes.put(byte.class,ByteHolder.class);
+ holderTypes.put(Byte.class,ByteWrapperHolder.class);
+ holderTypes.put(Byte[].class,ByteArrayHolder.class);
+ holderTypes.put(Calendar.class,CalendarHolder.class);
+ holderTypes.put(double.class,DoubleHolder.class);
+ holderTypes.put(Double.class,DoubleWrapperHolder.class);
+ holderTypes.put(float.class, FloatHolder.class);
+ holderTypes.put(Float.class, FloatWrapperHolder.class);
+ holderTypes.put(int.class,IntHolder.class);
+ holderTypes.put(Integer.class,IntegerWrapperHolder.class);
+ holderTypes.put(long.class,LongHolder.class);
+ holderTypes.put(Long.class,LongWrapperHolder.class);
+ holderTypes.put(Object.class,ObjectHolder.class);
+ holderTypes.put(QName.class,QNameHolder.class);
+ holderTypes.put(short.class,ShortHolder.class);
+ holderTypes.put(Short.class,ShortWrapperHolder.class);
+ holderTypes.put(String.class,StringHolder.class);
+ }
+
+ static
+ {
+ reverseHolderTypes.put(BigDecimalHolder.class , BigDecimal.class);
+ reverseHolderTypes.put(BigIntegerHolder.class , BigInteger.class);
+ reverseHolderTypes.put(BooleanHolder.class , boolean.class);
+ reverseHolderTypes.put(BooleanWrapperHolder.class, Boolean.class);
+ reverseHolderTypes.put(ByteArrayHolder.class, Byte[].class);
+ reverseHolderTypes.put(ByteHolder.class, byte.class);
+ reverseHolderTypes.put(ByteWrapperHolder.class,Byte.class );
+ reverseHolderTypes.put(CalendarHolder.class,Calendar.class);
+ reverseHolderTypes.put(DoubleHolder.class,double.class );
+ reverseHolderTypes.put(DoubleWrapperHolder.class,Double.class);
+ reverseHolderTypes.put(FloatHolder.class,float.class);
+ reverseHolderTypes.put(FloatWrapperHolder.class, Float.class);
+ reverseHolderTypes.put(IntHolder.class,int.class );
+ reverseHolderTypes.put(IntegerWrapperHolder.class,Integer.class );
+ reverseHolderTypes.put(LongHolder.class, long.class);
+ reverseHolderTypes.put(LongWrapperHolder.class,Long.class);
+ reverseHolderTypes.put(ObjectHolder.class,Object.class);
+ reverseHolderTypes.put(QNameHolder.class,QName.class);
+ reverseHolderTypes.put(ShortHolder.class,short.class);
+ reverseHolderTypes.put(ShortWrapperHolder.class,Short.class);
+ reverseHolderTypes.put(StringHolder.class,String.class);
+ }
+
+
+ /**
+ * Singleton - Only way to get an instance
+ * @return
+ */
+ public static WSDLUtils getInstance()
+ {
+ return instance;
+ }
+
+ private WSDLUtils()
+ {
+ wrapperlist = new ArrayList();
+ primlist = new ArrayList();
+ populatePrimList();
+ populateWrapperList();
+ createPrimitiveMap();
+ }
+
+ /**
+ * Check if it is of Primitive Type
+ * @param str
+ * @return
+ */
+ public boolean isPrimitive(String str)
+ {
+ return primlist.contains(str);
+ }
+
+ /**
+ * Check if it is of Wrapper Type
+ * @param str
+ * @return
+ */
+ public boolean isWrapper(String str)
+ {
+ return wrapperlist.contains(str);
+ }
+
+ /**
+ * For the given complex type, check if its base type is the regular xsd type
(xsd:anyType)
+ * which can be ignored
+ * @param baseType
+ * @param t ComplexTypeDefinition
+ * @return true:ignorable, false-otherwise(user defined base type)
+ */
+ public boolean isBaseTypeIgnorable(XSTypeDefinition baseType, XSComplexTypeDefinition
t)
+ {
+ boolean bool = false;
+
+ //Check baseType is xsd:anyType
+ if (baseType != null)
+ {
+ if (baseType.getNamespace() == Constants.NS_SCHEMA_XSD &&
+ baseType.getName().equals("anyType"))
+ bool = true; //Ignore this baseType
+ }
+ if (XSComplexTypeDefinition.CONTENTTYPE_SIMPLE == t.getContentType())
+ {
+ bool = true; //ComplexType has a simplecontent
+ }
+
+ return bool;
+
+ }
+
+
+ /**
+ * Check if the class is a Java standard class
+ * @param cls
+ * @return true if class belongs to java.* or javax.* package
+ */
+ public boolean checkIgnoreClass(Class cls)
+ {
+ if(cls == null)
+ throw new IllegalArgumentException("Illegal null argument:cls");
+ //if (cls.isArray()) cls = cls.getComponentType();
+ if (!cls.isArray())
+ {
+ String pkgname = cls.getPackage() != null ? cls.getPackage().getName() : null;
+ if (pkgname != null && pkgname.startsWith("java")) return
true;
+
+ if (ParameterWrapping.WrapperType.class.isAssignableFrom(cls))
+ return true;
+
+ }
+ return false;
+ }
+
+
+ /** Check if this method should be ignored
+ */
+ public boolean checkIgnoreMethod(Method method)
+ {
+ String methodname = method.getName();
+ if (ignoredMethods == null)
+ {
+ ignoredMethods = new ArrayList<String>();
+ Method[] objMethods = Object.class.getMethods();
+ for (int i = 0; i < objMethods.length; i++)
+ {
+ ignoredMethods.add(objMethods[i].getName());
+ }
+ //Add the SessionBean Methods to the ignore list
+ Method[] sbMethods = SessionBean.class.getMethods();
+ for (int i = 0; i < sbMethods.length; i++)
+ {
+ ignoredMethods.add(sbMethods[i].getName());
+ }
+ }
+
+ boolean ignoreMethod = ignoredMethods.contains(methodname);
+
+ // FIXME: This code is a duplicate, it should read from the UMDM
+ if (method.getDeclaringClass().isAnnotationPresent(WebService.class) &&
method.isAnnotationPresent(WebMethod.class) == false)
+ ignoreMethod = true;
+
+ return ignoreMethod;
+ }
+
+
+ /**
+ * Chop "PortType" at the end of the String
+ * @param name
+ * @return
+ */
+ public String chopPortType(String name)
+ {
+ int index = name.lastIndexOf("PortType");
+ if (index > 0) return name.substring(0, index);
+
+ return name;
+ }
+
+ /**
+ * Chop chopstr at the end of the String
+ * @param name
+ * @param chopstr the string that is the key Eg: Fault
+ * @return
+ */
+ public String chop(String name, String chopstr)
+ {
+ int index = name.lastIndexOf(chopstr);
+ if (index > 0) return name.substring(0, index);
+
+ return name;
+ }
+
+ /**
+ * Given a packageName, start creating the package structure
+ * @param packageName
+ */
+ public File createPackage(String path, String packageName)
+ {
+ if(packageName == null )
+ throw new IllegalArgumentException("Illegal Null Argument:
packageName");
+ if(path == null)
+ throw new IllegalArgumentException("Illegal Null Argument: path");
+ String pac = packageName.replace('.', '/');
+ File dir = new File(path + "/" + pac);
+ dir.mkdirs();
+ return dir;
+ }
+
+ /**
+ * Create a file on the disk
+ * @param loc Location where the file has to be created
+ * @param fname File Name to which '.java' will be appended
+ * @return
+ * @throws IOException Problem creating the file
+ */
+ public File createPhysicalFile(File loc, String fname)
+ throws IOException
+ {
+ if(loc == null )
+ throw new IllegalArgumentException("Illegal Null Argument: loc");
+ if(fname == null)
+ throw new IllegalArgumentException("Illegal Null Argument: fname");
+ File sei = new File(loc.getAbsolutePath() + "/" + fname +
".java");
+ //Delete the sei if already exists
+ if (sei.exists()) sei.delete();
+ boolean boolCreate = sei.createNewFile();
+ if (!boolCreate)
+ throw new WSException("SEI " + fname + ".java cannot be
created");
+ return sei;
+ }
+
+
+ /**
+ * Create the basic template of a class
+ * @param pkgname Package Name
+ * @param fname File Name to which '.java' will be appended
+ * @param type XSDType to obtain base class info (if Complex Type)
+ * @param importList Strings representing imports
+ * @return
+ */
+ public StringBuilder createClassBasicStructure(String pkgname,
+ String fname,
+ XSTypeDefinition type,
+ List importList, String baseName)
+ {
+ StringBuilder buf = new StringBuilder();
+ writeJbossHeader(buf);
+ buf.append(newline);
+ buf.append("package " + pkgname + ";");
+ buf.append(newline);
+ buf.append(newline);
+ if (importList != null)
+ {
+ Iterator iter = importList.iterator();
+ while (iter.hasNext())
+ {
+ buf.append("import " + (String)iter.next() + ";");
+ buf.append(newline);
+ }
+ }
+ buf.append(newline);
+ XSTypeDefinition baseType = null;
+ if (type instanceof XSComplexTypeDefinition)
+ {
+ XSComplexTypeDefinition t = (XSComplexTypeDefinition)type;
+
+ baseType = t.getBaseType();
+ //Check baseType is xsd:anyType
+ if (baseType != null)
+ {
+ if (baseType.getNamespace() == Constants.NS_SCHEMA_XSD &&
+ baseType.getName().equals("anyType"))
+ baseType = null; //Ignore this baseType
+ }
+ if (XSComplexTypeDefinition.CONTENTTYPE_SIMPLE == t.getContentType())
+ {
+ baseType = null; //ComplexType has a simplecontent
+ }
+ }
+
+ buf.append("public class " + fname);
+ if(baseName == null && baseType != null)
+ baseName = baseType.getName();
+ if(baseName != null)
+ buf.append(" extends " + baseName);
+ buf.append(newline);
+ buf.append("{");
+ buf.append(newline);
+
+ return buf;
+ }
+
+ /**
+ * Checks whether there exists a public field with the given name
+ * @param javaType Class Object
+ * @param name Field name to check
+ * @return true - if public field exists, false-otherwise
+ */
+ public boolean doesPublicFieldExist( Class javaType, String name)
+ {
+ Field fld = null;
+ try
+ {
+ fld = javaType.getField(name);
+ }
+ catch (SecurityException e)
+ {
+ throw e;
+ }
+ catch (NoSuchFieldException e)
+ {
+ return false;
+ }
+ int mod = fld.getModifiers();
+ if ((mod == Modifier.PUBLIC))
+ return true;
+ return false;
+ }
+
+
+ /**
+ * Ensure that the first alphabet is uppercase
+ * @param fname
+ * @return
+ */
+ public String firstLetterUpperCase(String fname)
+ {
+ if (fname == "" || fname == null)
+ throw new WSException("String passed is null");
+ //Ensure that the first character is uppercase
+ if (Character.isLowerCase(fname.charAt(0)))
+ {
+ char[] chars = fname.toCharArray();
+ char f = Character.toUpperCase(chars[0]);
+ chars[0] = f;
+ fname = new String(chars);
+ }
+ return fname;
+ }
+
+ /**
+ * Get the dimension of an array
+ * @param arr
+ * @return dimension of an array
+ */
+ public int getArrayDimension(Class arr)
+ {
+ if(arr == null || arr.isArray() == false)
+ throw new IllegalArgumentException("Illegal null or array arg:arr");
+ int counter = 0;
+ while(arr.isArray()) {
+ counter += 1;
+ arr = arr.getComponentType();
+ }
+ return counter;
+ }
+
+ /**
+ * Return the Jaxrpc holder that
+ * represents the class
+ * @param cls
+ * @return Jaxrpc Holder object if exists
+ */
+ public Class getHolder(Class cls)
+ {
+ return holderTypes.get(cls);
+ }
+
+ /**
+ * Return the Java class that is represented by
+ * the Jaxrpc holder
+ * @param cls The jaxrpc holder type
+ * @return Jaxrpc Holder object if exists
+ */
+ public Class getJavaTypeForHolder(Class cls)
+ {
+ if(Holder.class.isAssignableFrom(cls))
+ return HolderUtils.getValueType(cls);
+ else
+ return cls;
+ //return reverseHolderTypes.get(cls);
+ }
+
+
+ /**
+ * An input of "HelloObjArray" is converted into arrayOfHelloObj
+ * Applied in the input part for WSDL 1.1 Messages
+ * @param arrayStr
+ * @return
+ */
+
+ public String getMessagePartForArray(Class javaType)
+ {
+ StringBuilder sb = new StringBuilder();
+ while (javaType.isArray())
+ {
+ sb.append("arrayOf");
+ javaType = javaType.getComponentType();
+ }
+
+ sb.append(getJustClassName(javaType));
+ return sb.toString();
+ }
+
+ /**
+ * Given a class, strip out the package name
+ *
+ * @param cls
+ * @return just the classname
+ */
+
+ public static String getJustClassName(Class cls)
+ {
+ if (cls == null) return null;
+ if (cls.isArray())
+ {
+ Class c = cls.getComponentType();
+ return getJustClassName(c.getName());
+ }
+
+ return getJustClassName(cls.getName());
+ }
+
+ /**
+ * Given a FQN of a class, strip out the package name
+ *
+ * @param classname
+ * @return just the classname
+ */
+ public static String getJustClassName(String classname)
+ {
+ int index = classname.lastIndexOf(".");
+ if (index < 0)
+ index = 0;
+ else
+ index = index + 1;
+ return classname.substring(index);
+ }
+
+ /**
+ * From the list of fields defined by this class (not superclasses)
+ * get the fields that are relevant (public)
+ */
+ public Field[] getPublicFields(Class cls)
+ {
+ ArrayList list = new ArrayList();
+
+ Field[] fld = cls.getDeclaredFields();
+ for (int i = 0; i < fld.length; i++)
+ {
+ Field field = fld[i];
+ int mod = field.getModifiers();
+ if ((mod == Modifier.PUBLIC))
+ list.add(field);
+ }//end for
+
+ Field[] retarr = new Field[list.size()];
+ list.toArray(retarr);
+
+ return retarr;
+ }
+
+ /**
+ * From the list of fields defined by this class (not superclasses)
+ * get the fields that are relevant (public/protected)
+ *
+ * @param methods
+ * @return
+ */
+ public Method[] getPublicProtectedMethods(Method[] methods)
+ {
+ ArrayList list = new ArrayList();
+ int len = methods.length;
+
+ for (int i = 0; i < len; i++)
+ {
+ Method method = methods[i];
+ int mod = method.getModifiers();
+ if ((mod == Modifier.PUBLIC || mod == Modifier.PROTECTED))
+ list.add(method);
+ }//end for
+
+ Method[] retarr = new Method[list.size()];
+ list.toArray(retarr);
+ return retarr;
+ }
+
+ /**
+ * Given the XMLType, we will check if it is of basic schema
+ * types that are mapped to Java primitives and wrappers
+ * Jaxrpc 1.1 Section 5.3
+ * @param xmlType
+ * @return
+ */
+ public Class getJavaType(QName xmlType)
+ {
+ if (xmlType == null) return null;
+ String localPart = xmlType.getLocalPart();
+ return (Class)schemaBasicTypes.get(localPart);
+ }
+
+ /**
+ * Change the first character to uppercase
+ * @param str
+ * @return
+ */
+ public String getMixedCase(String str)
+ {
+ if (str == null || str.length() == 0)
+ throw new IllegalArgumentException("String passed to WSDLUtils.getMixedCase
is null");
+
+ if (str.length() == 1) return str.toUpperCase();
+ char[] charr = str.toCharArray();
+ charr[0] = Character.toUpperCase(charr[0]);
+ return new String(charr);
+ }
+
+
+
+ /**
+ * Given a QName, provide a string that is prefix:localpart
+ * @param qn
+ * @return formatted string
+ */
+ public String getFormattedString(QName qn)
+ {
+ if (qn == null)
+ throw new IllegalArgumentException(" QName passed is null");
+ StringBuilder sb = new StringBuilder();
+ String prefix = qn.getPrefix();
+ String localpart = qn.getLocalPart();
+ if (prefix == null || prefix == "") prefix = Constants.PREFIX_TNS;
+ sb.append(prefix + ":");
+ sb.append(localpart);
+
+ return sb.toString();
+ }
+
+ /**
+ * Return a QName given a formatted string
+ * @param formattedStr string that is prefix:localpart
+ * @return QName
+ */
+ public QName getQName( String formattedStr)
+ {
+ QName qn = null;
+ int ind = formattedStr.lastIndexOf(":");
+ if(ind < 0)
+ throw new IllegalArgumentException("Formatted String is not of format
prefix:localpart");
+ String prefix = formattedStr.substring(0,ind);
+ String nsuri = null;
+ if(Constants.PREFIX_XSD.equals(prefix)) nsuri = Constants.NS_SCHEMA_XSD;
+ if(nsuri == null)
+ qn = new QName( formattedStr.substring(ind+1) );
+ else
+ qn = new QName( nsuri,formattedStr.substring(ind+1),prefix);
+ return qn;
+ }
+
+
+ /**
+ * Return the primitive for a wrapper equivalent (Integer -> int)
+ * @param str
+ * @return
+ */
+ public String getPrimitive(String str)
+ {
+ return (String)primitiveMap.get(str);
+ }
+
+ /**
+ * Extracts the package name from the typeNS
+ * @param typeNS
+ * @return
+ */
+ public String getPackageName(String typeNS)
+ {
+ String pkgname = Util.xmlNamespaceToJavaPackage(typeNS);
+ int len = pkgname.length();
+ return pkgname;
+ }
+
+ public String getTypeNamespace(Class javaType)
+ {
+ return getTypeNamespace(javaType.getPackage().getName());
+ }
+
+ /**
+ * Extracts the typeNS given the package name
+ * Algorithm is based on the one specified in JAWS v2.0 spec
+ * @param packageName
+ * @return the type namespace
+ */
+ public String getTypeNamespace(String packageName)
+ {
+ StringBuilder sb = new StringBuilder("http://");
+
+ //Generate tokens with '.' as delimiter
+ StringTokenizer st = new StringTokenizer(packageName,".");
+
+ //Have a LIFO queue for the tokens
+ Stack<String> stk = new Stack<String>();
+ while(st != null && st.hasMoreTokens())
+ {
+ stk.push(st.nextToken());
+ }
+
+ String next;
+ while(!stk.isEmpty() && (next=stk.pop())!=null)
+ {
+ if(sb.toString().equals("http://") == false)
sb.append(".");
+ sb.append(next);
+ }
+
+ // trailing slash
+ sb.append("/");
+
+ return sb.toString();
+ }
+
+ /**
+ * Given WSDLDefinitions, detect the wsdl style
+ *
+ * @param wsdl
+ * @return Constants.RPC_LITERAL or Constants.DOCUMENT_LITERAL
+ */
+ public String getWSDLStyle(WSDLDefinitions wsdl)
+ {
+ WSDLInterface wi = wsdl.getInterfaces()[0];
+ WSDLInterfaceOperation wio = wi.getOperations()[0];
+ String style = wio.getStyle();
+ if(style == null || style.equals(Constants.URI_STYLE_RPC) ||
"rpc".equalsIgnoreCase(style))
+ return Constants.RPC_LITERAL;
+ else
+ return Constants.DOCUMENT_LITERAL;
+ }
+
+ public static JBossXSModel getSchemaModel(WSDLTypes types)
+ {
+ if (types instanceof XSModelTypes)
+ return ((XSModelTypes) types).getSchemaModel();
+
+ throw new WSException("WSDLTypes is not an XSModelTypes");
+ }
+
+ public static void addSchemaModel(WSDLTypes types, String namespace, JBossXSModel
model)
+ {
+ if (! (types instanceof XSModelTypes))
+ throw new WSException("WSDLTypes is not an XSModelTypes");
+
+ XSModelTypes modelTypes = (XSModelTypes) types;
+ modelTypes.addSchemaModel(namespace, model);
+ }
+
+ /**
+ * Checks whether the class is a standard jaxrpc holder
+ *
+ * @param cls a Class object
+ * @return true: A Standard jaxrpc holder
+ */
+ public boolean isStandardHolder(Class cls)
+ {
+ if(Holder.class.isAssignableFrom(cls) == false)
+ return false; //Not even a holder
+ //It is a holder. Is it a standard holder?
+ if(cls.getPackage().getName().startsWith("javax.xml.rpc"))
+ return true;
+ return false;
+ }
+
+ /**
+ * Write the JBoss License Header at the top of generated class source files
+ * @param buf
+ */
+ public void writeJbossHeader(StringBuilder buf)
+ {
+ buf.append("/*").append(newline);
+ buf.append(" * JBossWS WS-Tools Generated Source").append(newline);
+ buf.append(" *").append(newline);
+ buf.append(" * Generation Date: " + new Date() + newline);
+ buf.append(" *").append(newline);
+ buf.append(" * This generated source code represents a derivative work of the
input to").append(newline);
+ buf.append(" * the generator that produced it. Consult the input for the
copyright and").append(newline);
+ buf.append(" * terms of use that apply to this source
code.").append(newline);
+ buf.append(" */").append(newline);
+ }
+
+ protected void populatePrimList()
+ {
+ primlist.add("int");
+ primlist.add("boolean");
+ primlist.add("short");
+ primlist.add("byte");
+ primlist.add("long");
+ primlist.add("float");
+ primlist.add("double");
+ }
+
+ protected void populateWrapperList()
+ {
+ wrapperlist.add("java.lang.Integer");
+ wrapperlist.add("java.lang.Boolean");
+ wrapperlist.add("java.lang.Short");
+ wrapperlist.add("java.lang.Byte");
+ wrapperlist.add("java.lang.Long");
+ wrapperlist.add("java.lang.Float");
+ wrapperlist.add("java.lang.Double");
+ wrapperlist.add("java.lang.String");
+
+ wrapperlist.add("java.math.BigInteger");
+ wrapperlist.add("java.math.BigDecimal");
+ wrapperlist.add("java.util.Calendar");
+ wrapperlist.add("javax.xml.namespace.QName");
+ }
+
+ private void createPrimitiveMap()
+ {
+ primitiveMap.put("Integer", "int");
+ primitiveMap.put("Float", "float");
+ primitiveMap.put("Long", "long");
+ primitiveMap.put("Double", "double");
+ primitiveMap.put("Short", "short");
+ primitiveMap.put("Boolean", "boolean");
+ primitiveMap.put("Byte", "byte");
+ primitiveMap.put("java.lang.Integer", "int");
+ primitiveMap.put("java.lang.Float", "float");
+ primitiveMap.put("java.lang.Long", "long");
+ primitiveMap.put("java.lang.Double", "double");
+ primitiveMap.put("java.lang.Short", "short");
+ primitiveMap.put("java.lang.Boolean", "boolean");
+ primitiveMap.put("java.lang.Byte", "byte");
+ }
+
+ public static WSDLInterfaceOperationOutput getWsdl11Output(WSDLInterfaceOperation
operation)
+ {
+ WSDLInterfaceOperationOutput[] outputs = operation.getOutputs();
+ if (outputs == null)
+ return null;
+
+ switch (outputs.length)
+ {
+ case 0: return null;
+ case 1: return outputs[0];
+ }
+
+ throw new WSException("Only Request-Only and Request-Response MEPs are
allowed");
+ }
+
+ public static WSDLInterfaceOperationInput getWsdl11Input(WSDLInterfaceOperation
operation)
+ {
+ WSDLInterfaceOperationInput[] inputs = operation.getInputs();
+ if (inputs == null)
+ return null;
+
+ switch (inputs.length)
+ {
+ case 0: return null;
+ case 1: return inputs[0];
+ }
+
+ throw new WSException("Only Request-Only and Request-Response MEPs are
allowed");
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLWriter.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLWriter.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLWriter.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/WSDLWriter.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,207 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.w3c.dom.Element;
+
+/**
+ * A helper that writes out a WSDL definition
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public abstract class WSDLWriter
+{
+ // provide logging
+ protected static final Logger log = Logger.getLogger(WSDLWriter.class);
+
+ protected WSDLDefinitions wsdl;
+ protected WSDLUtils utils = WSDLUtils.getInstance();
+
+ // The soap prefix
+ protected String soapPrefix = "soap";
+
+ /**
+ * Include or import WSDL Types
+ */
+ protected boolean includeSchemaInWSDL = true;
+
+ public static class ResolvedWriter
+ {
+ public String actualFile;
+ public String charset;
+ public Writer writer;
+ }
+
+ public static interface WriterResolver
+ {
+ public ResolvedWriter resolve(String suggestedFile) throws IOException;
+ }
+
+ /** Use WSDLDefinitions.writeWSDL instead. */
+ protected WSDLWriter(WSDLDefinitions wsdl)
+ {
+ if (wsdl == null)
+ throw new IllegalArgumentException("WSDL definitions is NULL");
+
+ this.wsdl = wsdl;
+ }
+
+ public void write(Writer writer) throws IOException
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append(Constants.XML_HEADER);
+
+ appendDefinitions(buffer, wsdl.getTargetNamespace());
+ appendTypes(buffer, wsdl.getTargetNamespace());
+ appendInterfaces(buffer, wsdl.getTargetNamespace());
+ appendBindings(buffer, wsdl.getTargetNamespace());
+ appendServices(buffer, wsdl.getTargetNamespace());
+
+ buffer.append("</definitions>");
+
+ Element element = DOMUtils.parse(buffer.toString());
+ new DOMWriter(writer).setPrettyprint(true).print(element);
+ }
+
+ protected void appendDefinitions(StringBuilder buffer, String namespace)
+ {
+ buffer.append("<definitions");
+ //Append service name as done by wscompile, if there is just one
+ WSDLService[] services = wsdl.getServices();
+ if (services != null && services.length == 1)
+ {
+ WSDLService ser = services[0];
+ buffer.append(" name='" + ser.getName() + "'");
+ }
+ buffer.append(" targetNamespace='" + namespace + "'");
+ buffer.append(" xmlns='" + wsdl.getWsdlNamespace() +
"'");
+
+ Iterator it = wsdl.getRegisteredNamespaceURIs();
+ while (it.hasNext())
+ {
+ String namespaceURI = (String)it.next();
+ String prefix = wsdl.getPrefix(namespaceURI);
+ if (prefix.length() > 0)
+ {
+ buffer.append(" xmlns:" + prefix + "='" +
namespaceURI + "'");
+ if (Constants.PREFIX_SOAP11.equals(prefix) ||
Constants.PREFIX_SOAP12.equals(prefix))
+ soapPrefix = prefix;
+ }
+ }
+ buffer.append(">");
+ }
+
+ protected void appendTypes(StringBuilder buffer, String namespace)
+ {
+ WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
+ // If the type section is bound to a particular namespace, verify it mataches,
otherwise skip
+ if (wsdlTypes.getNamespace() != null &&
!wsdlTypes.getNamespace().equals(namespace))
+ return;
+
+ if (wsdlTypes instanceof XSModelTypes)
+ {
+ buffer.append("<types>");
+ JBossXSModel xsM = WSDLUtils.getSchemaModel(wsdlTypes);
+ String schema = xsM.serialize();
+ buffer.append(schema);
+ buffer.append("</types>");
+ }
+ else if (wsdlTypes instanceof DOMTypes)
+ {
+ synchronized (wsdlTypes)
+ {
+ buffer.append(DOMWriter.printNode(((DOMTypes)wsdlTypes).getElement(),
true));
+ }
+ }
+ }
+
+ protected abstract void appendInterfaces(StringBuilder buffer, String namespace);
+
+ protected abstract void appendBindings(StringBuilder buffer, String namespace);
+
+ protected abstract void appendServices(StringBuilder buffer, String namespace);
+
+ /** Get a prefixed name of form prefix:localPart */
+ protected String getQNameRef(QName qname)
+ {
+ String retStr = qname.getLocalPart();
+
+ String prefix = qname.getPrefix();
+ String nsURI = qname.getNamespaceURI();
+ if (prefix.length() == 0 && nsURI.length() > 0)
+ {
+ qname = wsdl.registerQName(qname);
+ prefix = qname.getPrefix();
+ }
+
+ if (prefix.length() > 0)
+ retStr = prefix + ":" + retStr;
+
+ return retStr;
+ }
+
+ public WSDLDefinitions getWsdl()
+ {
+ return wsdl;
+ }
+
+ public void setWsdl(WSDLDefinitions wsdl)
+ {
+ this.wsdl = wsdl;
+ }
+
+ public boolean isIncludeTypesInWSDL()
+ {
+ return includeSchemaInWSDL;
+ }
+
+ public void logException(Exception e)
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace(e);
+ }
+ }
+
+ public void logMessage(String msg)
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace(msg);
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/XSModelTypes.java
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/XSModelTypes.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,110 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+
+/**
+ * A JBossXSModel based type definition.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class XSModelTypes extends WSDLTypes
+{
+ private static final Logger log = Logger.getLogger(XSModelTypes.class);
+
+ private JBossXSModel schemaModel;
+
+ public XSModelTypes()
+ {
+ this.schemaModel = new JBossXSModel();
+ }
+
+ /**
+ * Add a schema model for a given namespaceURI
+ * @param nsURI the namespaceURI under which the model has been generated
+ * @param schema the Schema Model that needs to be added to existing schema
+ * model in WSDLTypes
+ * <dt>Warning:</dd>
+ * <p>Passing a null nsURI will replace the internal schema model
+ * held by WSDLTypes by the model passed as an argument.</p>
+ */
+ public void addSchemaModel(String nsURI, JBossXSModel schema)
+ {
+ if(nsURI == null)
+ {
+ log.trace("nsURI passed to addSchemaModel is null. Replacing Schema
Model");
+ schemaModel = schema;
+ }
+ else
+ schemaModel.merge(schema);
+ }
+
+ /**
+ * Return the global Schema Model
+ * @return
+ */
+ public JBossXSModel getSchemaModel()
+ {
+ return schemaModel;
+ }
+
+ /** Get the xmlType from a given element xmlName
+ */
+ public QName getXMLType(QName xmlName)
+ {
+ QName xmlType = null;
+ String nsURI = xmlName.getNamespaceURI();
+ String localPart = xmlName.getLocalPart();
+ XSElementDeclaration xsel = schemaModel.getElementDeclaration(localPart, nsURI);
+ if (xsel != null)
+ {
+ XSTypeDefinition xstype = xsel.getTypeDefinition();
+ if (xstype == null)
+ throw new WSException("Cannot obtain XSTypeDefinition for: " +
xmlName);
+
+ if (xstype.getAnonymous() == false)
+ {
+ xmlType = new QName(xstype.getNamespace(), xstype.getName());
+ }
+ else
+ {
+ xmlType = new QName(xstype.getNamespace(), ">" + localPart);
+ }
+ }
+ return xmlType;
+ }
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("WSDLTypes:\n");
+ buffer.append(schemaModel != null ? schemaModel.serialize() :
"<schema/>");
+ return buffer.toString();
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema
(from rev 1564,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,259 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.xs.XSAttributeUse;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.apache.xerces.xs.XSWildcard;
-
-/**
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 21, 2005
- */
-public class JBossXSComplexTypeDefinition
- extends JBossXSTypeDefinition
- implements XSComplexTypeDefinition
-{
- private boolean isAbstract;
- private XSSimpleTypeDefinition xsSimple;
- private XSParticle xspart;
- private XSObjectList annots;
-
- private String prefix;
-
- private List<XSAttributeUse> attList = new ArrayList<XSAttributeUse>();
-
- //Content Type
- private short contentType = XSComplexTypeDefinition.CONTENTTYPE_ELEMENT;
-
- private short deriveMethod = XSConstants.DERIVATION_NONE;
-
- public JBossXSComplexTypeDefinition( )
- {
- }
-
- public JBossXSComplexTypeDefinition(String name, String namespace)
- {
- super(name, namespace);
- }
-
- public JBossXSComplexTypeDefinition(XSComplexTypeDefinition xc)
- {
- super(xc.getName(),xc.getNamespace());
- setAnonymous(xc.getAnonymous());
- xspart = xc.getParticle();
- xsSimple = xc.getSimpleType();
- deriveMethod = xc.getDerivationMethod();
- this.baseType = new JBossXSTypeDefinition(xc.getBaseType());
- }
-
- /**
- * [derivation method]: either <code>DERIVATION_EXTENSION</code>,
- * <code>DERIVATION_RESTRICTION</code>, or
<code>DERIVATION_NONE</code>
- * (see <code>XSConstants</code>).
- */
- public short getDerivationMethod()
- {
- return deriveMethod;
- }
-
- /**
- * [abstract]: a boolean. Complex types for which <code>abstract</code>
is
- * true must not be used as the type definition for the validation of
- * element information items.
- */
- public boolean getAbstract()
- {
- return isAbstract;
- }
-
- /**
- * A set of attribute uses if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAttributeUses()
- {
- JBossXSObjectList oblist = new JBossXSObjectList();
- for(XSAttributeUse xa:attList)
- {
- oblist.addItem(xa);
- }
- return oblist;
- }
-
- /**
- * An attribute wildcard if it exists, otherwise <code>null</code>.
- */
- public XSWildcard getAttributeWildcard()
- {
- return null;
- }
-
- /**
- * [content type]: one of empty (<code>CONTENTTYPE_EMPTY</code>), a
simple
- * type definition (<code>CONTENTTYPE_SIMPLE</code>), mixed (
- * <code>CONTENTTYPE_MIXED</code>), or element-only (
- * <code>CONTENTTYPE_ELEMENT</code>).
- */
- public short getContentType()
- {
- return contentType;
- }
-
- /**
- * A simple type definition corresponding to a simple content model,
- * otherwise <code>null</code>.
- */
- public XSSimpleTypeDefinition getSimpleType()
- {
- return xsSimple;
- }
-
- /**
- * A particle for a mixed or element-only content model, otherwise
- * <code>null</code>.
- */
- public XSParticle getParticle()
- {
- return xspart;
- }
-
- /**
- * [prohibited substitutions]: a subset of {extension, restriction}
- * @param restriction Extension or restriction constants (see
- * <code>XSConstants</code>).
- * @return True if <code>restriction</code> is a prohibited substitution,
- * otherwise false.
- */
- public boolean isProhibitedSubstitution(short restriction)
- {
- return false;
- }
-
- /**
- * [prohibited substitutions]: A subset of {extension, restriction} or
- * <code>DERIVATION_NONE</code> represented as a bit flag (see
- * <code>XSConstants</code>).
- */
- public short getProhibitedSubstitutions()
- {
- return 0;
- }
-
- /**
- * A set of [annotations] if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations()
- {
- return annots;
- }
-
- /**
- * Get the type
- */
- @Override
- public short getType()
- {
- return XSTypeDefinition.COMPLEX_TYPE;
- }
-
- /**
- * Return whether this type definition is a simple type or complex type.
- */
- @Override
- public short getTypeCategory()
- {
- return XSTypeDefinition.COMPLEX_TYPE;
- }
-
- public void setAbstract(boolean anAbstract)
- {
- isAbstract = anAbstract;
- }
-
- public void setDerivationMethod(short deriveMethod)
- {
- this.deriveMethod = deriveMethod;
- }
-
- /**
- * A simple type definition corresponding to a simple content model,
- * otherwise <code>null</code>.
- */
- public void setSimpleType(XSSimpleTypeDefinition xsSimple)
- {
- this.xsSimple = xsSimple;
- }
-
- /**
- * A particle for a mixed or element-only content model, otherwise
- * <code>null</code>.
- */
- public void setParticle(XSParticle xspart)
- {
- this.xspart = xspart;
- }
-
- /**
- * A set of [annotations] if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public void setAnnotations(XSObjectList annots)
- {
- this.annots = annots;
- }
-
- /**
- * @see XSComplexTypeDefinition.CONTENTTYPE_EMPTY
- * @see XSComplexTypeDefinition.CONTENTTYPE_SIMPLE
- * @see XSComplexTypeDefinition.CONTENTTYPE_MIXED
- * @see XSComplexTypeDefinition.CONTENTTYPE_ELEMENT
- *
- * @param contentType
- */
- public void setContentType(short contentType)
- {
- this.contentType = contentType;
- }
-
- //*********************************************************************
- // Custom Methods
- //*********************************************************************
- public void addXSAttributeUse(XSAttributeUse at)
- {
- attList.add(at);
- }
-
- public String toString()
- {
- return "";
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,259 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.xerces.xs.XSAttributeUse;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSParticle;
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.apache.xerces.xs.XSWildcard;
+
+/**
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 21, 2005
+ */
+public class JBossXSComplexTypeDefinition
+ extends JBossXSTypeDefinition
+ implements XSComplexTypeDefinition
+{
+ private boolean isAbstract;
+ private XSSimpleTypeDefinition xsSimple;
+ private XSParticle xspart;
+ private XSObjectList annots;
+
+ private String prefix;
+
+ private List<XSAttributeUse> attList = new ArrayList<XSAttributeUse>();
+
+ //Content Type
+ private short contentType = XSComplexTypeDefinition.CONTENTTYPE_ELEMENT;
+
+ private short deriveMethod = XSConstants.DERIVATION_NONE;
+
+ public JBossXSComplexTypeDefinition( )
+ {
+ }
+
+ public JBossXSComplexTypeDefinition(String name, String namespace)
+ {
+ super(name, namespace);
+ }
+
+ public JBossXSComplexTypeDefinition(XSComplexTypeDefinition xc)
+ {
+ super(xc.getName(),xc.getNamespace());
+ setAnonymous(xc.getAnonymous());
+ xspart = xc.getParticle();
+ xsSimple = xc.getSimpleType();
+ deriveMethod = xc.getDerivationMethod();
+ this.baseType = new JBossXSTypeDefinition(xc.getBaseType());
+ }
+
+ /**
+ * [derivation method]: either <code>DERIVATION_EXTENSION</code>,
+ * <code>DERIVATION_RESTRICTION</code>, or
<code>DERIVATION_NONE</code>
+ * (see <code>XSConstants</code>).
+ */
+ public short getDerivationMethod()
+ {
+ return deriveMethod;
+ }
+
+ /**
+ * [abstract]: a boolean. Complex types for which <code>abstract</code>
is
+ * true must not be used as the type definition for the validation of
+ * element information items.
+ */
+ public boolean getAbstract()
+ {
+ return isAbstract;
+ }
+
+ /**
+ * A set of attribute uses if it exists, otherwise an empty
+ * <code>XSObjectList</code>.
+ */
+ public XSObjectList getAttributeUses()
+ {
+ JBossXSObjectList oblist = new JBossXSObjectList();
+ for(XSAttributeUse xa:attList)
+ {
+ oblist.addItem(xa);
+ }
+ return oblist;
+ }
+
+ /**
+ * An attribute wildcard if it exists, otherwise <code>null</code>.
+ */
+ public XSWildcard getAttributeWildcard()
+ {
+ return null;
+ }
+
+ /**
+ * [content type]: one of empty (<code>CONTENTTYPE_EMPTY</code>), a
simple
+ * type definition (<code>CONTENTTYPE_SIMPLE</code>), mixed (
+ * <code>CONTENTTYPE_MIXED</code>), or element-only (
+ * <code>CONTENTTYPE_ELEMENT</code>).
+ */
+ public short getContentType()
+ {
+ return contentType;
+ }
+
+ /**
+ * A simple type definition corresponding to a simple content model,
+ * otherwise <code>null</code>.
+ */
+ public XSSimpleTypeDefinition getSimpleType()
+ {
+ return xsSimple;
+ }
+
+ /**
+ * A particle for a mixed or element-only content model, otherwise
+ * <code>null</code>.
+ */
+ public XSParticle getParticle()
+ {
+ return xspart;
+ }
+
+ /**
+ * [prohibited substitutions]: a subset of {extension, restriction}
+ * @param restriction Extension or restriction constants (see
+ * <code>XSConstants</code>).
+ * @return True if <code>restriction</code> is a prohibited substitution,
+ * otherwise false.
+ */
+ public boolean isProhibitedSubstitution(short restriction)
+ {
+ return false;
+ }
+
+ /**
+ * [prohibited substitutions]: A subset of {extension, restriction} or
+ * <code>DERIVATION_NONE</code> represented as a bit flag (see
+ * <code>XSConstants</code>).
+ */
+ public short getProhibitedSubstitutions()
+ {
+ return 0;
+ }
+
+ /**
+ * A set of [annotations] if it exists, otherwise an empty
+ * <code>XSObjectList</code>.
+ */
+ public XSObjectList getAnnotations()
+ {
+ return annots;
+ }
+
+ /**
+ * Get the type
+ */
+ @Override
+ public short getType()
+ {
+ return XSTypeDefinition.COMPLEX_TYPE;
+ }
+
+ /**
+ * Return whether this type definition is a simple type or complex type.
+ */
+ @Override
+ public short getTypeCategory()
+ {
+ return XSTypeDefinition.COMPLEX_TYPE;
+ }
+
+ public void setAbstract(boolean anAbstract)
+ {
+ isAbstract = anAbstract;
+ }
+
+ public void setDerivationMethod(short deriveMethod)
+ {
+ this.deriveMethod = deriveMethod;
+ }
+
+ /**
+ * A simple type definition corresponding to a simple content model,
+ * otherwise <code>null</code>.
+ */
+ public void setSimpleType(XSSimpleTypeDefinition xsSimple)
+ {
+ this.xsSimple = xsSimple;
+ }
+
+ /**
+ * A particle for a mixed or element-only content model, otherwise
+ * <code>null</code>.
+ */
+ public void setParticle(XSParticle xspart)
+ {
+ this.xspart = xspart;
+ }
+
+ /**
+ * A set of [annotations] if it exists, otherwise an empty
+ * <code>XSObjectList</code>.
+ */
+ public void setAnnotations(XSObjectList annots)
+ {
+ this.annots = annots;
+ }
+
+ /**
+ * @see XSComplexTypeDefinition.CONTENTTYPE_EMPTY
+ * @see XSComplexTypeDefinition.CONTENTTYPE_SIMPLE
+ * @see XSComplexTypeDefinition.CONTENTTYPE_MIXED
+ * @see XSComplexTypeDefinition.CONTENTTYPE_ELEMENT
+ *
+ * @param contentType
+ */
+ public void setContentType(short contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ //*********************************************************************
+ // Custom Methods
+ //*********************************************************************
+ public void addXSAttributeUse(XSAttributeUse at)
+ {
+ attList.add(at);
+ }
+
+ public String toString()
+ {
+ return "";
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,243 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import org.apache.xerces.xs.ShortList;
-import org.apache.xerces.xs.XSAnnotation;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSException;
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSTypeDefinition;
-
-
-/**
- * Represents an XS Element Declaration
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since May 3, 2005
- */
-public class JBossXSElementDeclaration
- extends JBossXSObject
- implements XSElementDeclaration
-{
- protected String targetNamespace = null;
- protected JBossXSTypeDefinition xstype = null;
- protected boolean nillable = false;
- private XSElementDeclaration xsed;
-
- /**
- * Sole Annotation object
- */
- protected XSAnnotation annotation = null;
-
- /**
- *
- */
- public JBossXSElementDeclaration()
- {
- super();
- }
-
- /**
- * @param name
- * @param namespace
- */
- public JBossXSElementDeclaration(String name, String namespace)
- {
- super(name, namespace);
- }
-
- /**
- * Create a new JBossXSElementDeclaration while
- * reading data from XSElementDeclaration.
- * @param xe
- */
- public JBossXSElementDeclaration(XSElementDeclaration xe)
- {
- if(xe == null)
- throw new IllegalArgumentException("Illegal Null Argument:xe");
-
- xsed = xe;
- name= xe.getName();
- namespace = xe.getNamespace();
- XSTypeDefinition xt = xe.getTypeDefinition();
- if(xt instanceof JBossXSTypeDefinition == false
- && xt instanceof XSComplexTypeDefinition)
- {
- xstype = new JBossXSComplexTypeDefinition((XSComplexTypeDefinition)xt);
- }
- else
- if(xt instanceof JBossXSTypeDefinition == false)
- {
- xstype = new JBossXSTypeDefinition(xt);
- }
- this.annotation = xe.getAnnotation();
- }
-
- public XSElementDeclaration getXSElementDeclaration()
- {
- return xsed;
- }
-
- /**
- * One of XSConstants.SCOPE_GLOBAL, XSConstants.SCOPE_LOCAL
- * or XSConstants.SCOPE_ABSENT
- */
- protected short scope = 0;
-
- protected XSComplexTypeDefinition enclosingCTDefinition;
-
- public XSTypeDefinition getTypeDefinition()
- {
- return this.xstype;
- }
-
- public void setTypeDefinition(XSTypeDefinition xst )
- {
- if(xst instanceof JBossXSTypeDefinition)
- this.xstype = (JBossXSTypeDefinition)xst ;
- else
- if(xst instanceof XSComplexTypeDefinition)
- this.xstype = new JBossXSComplexTypeDefinition((XSComplexTypeDefinition)xst);
- }
-
- /**
- * One of XSConstants.SCOPE_GLOBAL, XSConstants.SCOPE_LOCAL
- * or XSConstants.SCOPE_ABSENT
- * @return
- */
- public short getScope()
- {
- return this.scope;
- }
-
- public void setScope(short scope)
- {
- this.scope = scope;
- }
-
- public XSComplexTypeDefinition getEnclosingCTDefinition()
- {
- return this.enclosingCTDefinition;
- }
-
- public void setEnclosingCTDefinition( XSComplexTypeDefinition enclosingCTDefinition)
- {
- this.enclosingCTDefinition = enclosingCTDefinition;
- }
-
- public String getTargetNamespace()
- {
- return targetNamespace;
- }
-
- public void setTargetNamespace(String targetNamespace)
- {
- this.targetNamespace = targetNamespace;
- this.setNamespace( targetNamespace );
- }
-
- public short getConstraintType()
- {
- return 0;
- }
-
- public String getConstraintValue()
- {
- return null;
- }
-
- public Object getActualVC() throws XSException
- {
- return null;
- }
-
- public short getActualVCType() throws XSException
- {
- return 0;
- }
-
- public ShortList getItemValueTypes() throws XSException
- {
- return null;
- }
-
- public boolean getNillable()
- {
- return this.nillable;
- }
-
- public void setNillable(boolean nillable)
- {
- this.nillable = nillable;
- }
-
- public XSNamedMap getIdentityConstraints()
- {
- return null;
- }
-
- public XSElementDeclaration getSubstitutionGroupAffiliation()
- {
- return null;
- }
-
- public boolean isSubstitutionGroupExclusion(short i)
- {
- return false;
- }
-
- public short getSubstitutionGroupExclusions()
- {
- return 0;
- }
-
- public boolean isDisallowedSubstitution(short i)
- {
- return false;
- }
-
- public short getDisallowedSubstitutions()
- {
- return 0;
- }
-
- public boolean getAbstract()
- {
- return false;
- }
-
- public XSAnnotation getAnnotation()
- {
- return this.annotation;
- }
-
- /**
- * Get the type
- */
- @Override
- public short getType()
- {
- return XSConstants.ELEMENT_DECLARATION;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,243 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import org.apache.xerces.xs.ShortList;
+import org.apache.xerces.xs.XSAnnotation;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSException;
+import org.apache.xerces.xs.XSNamedMap;
+import org.apache.xerces.xs.XSTypeDefinition;
+
+
+/**
+ * Represents an XS Element Declaration
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since May 3, 2005
+ */
+public class JBossXSElementDeclaration
+ extends JBossXSObject
+ implements XSElementDeclaration
+{
+ protected String targetNamespace = null;
+ protected JBossXSTypeDefinition xstype = null;
+ protected boolean nillable = false;
+ private XSElementDeclaration xsed;
+
+ /**
+ * Sole Annotation object
+ */
+ protected XSAnnotation annotation = null;
+
+ /**
+ *
+ */
+ public JBossXSElementDeclaration()
+ {
+ super();
+ }
+
+ /**
+ * @param name
+ * @param namespace
+ */
+ public JBossXSElementDeclaration(String name, String namespace)
+ {
+ super(name, namespace);
+ }
+
+ /**
+ * Create a new JBossXSElementDeclaration while
+ * reading data from XSElementDeclaration.
+ * @param xe
+ */
+ public JBossXSElementDeclaration(XSElementDeclaration xe)
+ {
+ if(xe == null)
+ throw new IllegalArgumentException("Illegal Null Argument:xe");
+
+ xsed = xe;
+ name= xe.getName();
+ namespace = xe.getNamespace();
+ XSTypeDefinition xt = xe.getTypeDefinition();
+ if(xt instanceof JBossXSTypeDefinition == false
+ && xt instanceof XSComplexTypeDefinition)
+ {
+ xstype = new JBossXSComplexTypeDefinition((XSComplexTypeDefinition)xt);
+ }
+ else
+ if(xt instanceof JBossXSTypeDefinition == false)
+ {
+ xstype = new JBossXSTypeDefinition(xt);
+ }
+ this.annotation = xe.getAnnotation();
+ }
+
+ public XSElementDeclaration getXSElementDeclaration()
+ {
+ return xsed;
+ }
+
+ /**
+ * One of XSConstants.SCOPE_GLOBAL, XSConstants.SCOPE_LOCAL
+ * or XSConstants.SCOPE_ABSENT
+ */
+ protected short scope = 0;
+
+ protected XSComplexTypeDefinition enclosingCTDefinition;
+
+ public XSTypeDefinition getTypeDefinition()
+ {
+ return this.xstype;
+ }
+
+ public void setTypeDefinition(XSTypeDefinition xst )
+ {
+ if(xst instanceof JBossXSTypeDefinition)
+ this.xstype = (JBossXSTypeDefinition)xst ;
+ else
+ if(xst instanceof XSComplexTypeDefinition)
+ this.xstype = new JBossXSComplexTypeDefinition((XSComplexTypeDefinition)xst);
+ }
+
+ /**
+ * One of XSConstants.SCOPE_GLOBAL, XSConstants.SCOPE_LOCAL
+ * or XSConstants.SCOPE_ABSENT
+ * @return
+ */
+ public short getScope()
+ {
+ return this.scope;
+ }
+
+ public void setScope(short scope)
+ {
+ this.scope = scope;
+ }
+
+ public XSComplexTypeDefinition getEnclosingCTDefinition()
+ {
+ return this.enclosingCTDefinition;
+ }
+
+ public void setEnclosingCTDefinition( XSComplexTypeDefinition enclosingCTDefinition)
+ {
+ this.enclosingCTDefinition = enclosingCTDefinition;
+ }
+
+ public String getTargetNamespace()
+ {
+ return targetNamespace;
+ }
+
+ public void setTargetNamespace(String targetNamespace)
+ {
+ this.targetNamespace = targetNamespace;
+ this.setNamespace( targetNamespace );
+ }
+
+ public short getConstraintType()
+ {
+ return 0;
+ }
+
+ public String getConstraintValue()
+ {
+ return null;
+ }
+
+ public Object getActualVC() throws XSException
+ {
+ return null;
+ }
+
+ public short getActualVCType() throws XSException
+ {
+ return 0;
+ }
+
+ public ShortList getItemValueTypes() throws XSException
+ {
+ return null;
+ }
+
+ public boolean getNillable()
+ {
+ return this.nillable;
+ }
+
+ public void setNillable(boolean nillable)
+ {
+ this.nillable = nillable;
+ }
+
+ public XSNamedMap getIdentityConstraints()
+ {
+ return null;
+ }
+
+ public XSElementDeclaration getSubstitutionGroupAffiliation()
+ {
+ return null;
+ }
+
+ public boolean isSubstitutionGroupExclusion(short i)
+ {
+ return false;
+ }
+
+ public short getSubstitutionGroupExclusions()
+ {
+ return 0;
+ }
+
+ public boolean isDisallowedSubstitution(short i)
+ {
+ return false;
+ }
+
+ public short getDisallowedSubstitutions()
+ {
+ return 0;
+ }
+
+ public boolean getAbstract()
+ {
+ return false;
+ }
+
+ public XSAnnotation getAnnotation()
+ {
+ return this.annotation;
+ }
+
+ /**
+ * Get the type
+ */
+ @Override
+ public short getType()
+ {
+ return XSConstants.ELEMENT_DECLARATION;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,176 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.xerces.xni.XMLResourceIdentifier;
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLInputSource;
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Entity Resolver for the default Xerces Reference parser
- * @author <a href="mailto:Anil.Saldhana@jboss.org">Anil
Saldhana</a>
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-Aug-2005
- */
-public class JBossXSEntityResolver implements XMLEntityResolver
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXSEntityResolver.class);
-
- private Map<String, URL> schemaLocationByNamespace = new HashMap<String,
URL>();
-
- private EntityResolver delegate;
-
- public JBossXSEntityResolver(EntityResolver resolver, Map<String, URL>
schemaLocationByNamespace)
- {
- this.schemaLocationByNamespace = schemaLocationByNamespace;
- this.delegate = resolver;
- }
-
- /**
- * Resolves an external parsed entity. If the entity cannot be
- * resolved, this method should return null.
- *
- * @param resourceIdentifier description of the resource to be resolved
- * @throws XNIException Thrown on general error.
- * @throws IOException Thrown if resolved entity stream cannot be
- * opened or some other i/o error occurs.
- */
- public XMLInputSource resolveEntity(XMLResourceIdentifier resId) throws XNIException,
IOException
- {
- log.trace("Resolve entity: " + resId);
-
- // First try the JBossEntityResolver
- String publicId = resId.getPublicId();
- String systemId = resId.getLiteralSystemId();
- String namespace = resId.getNamespace();
- try
- {
- String publicURI = (publicId != null ? publicId : namespace);
- InputSource inputSource = delegate.resolveEntity(publicURI, systemId);
- if (inputSource != null)
- {
- XMLInputSource source = getXMLInputSource(inputSource, resId);
- return source;
- }
- }
- catch (Exception ex)
- {
- log.trace(ex);
- }
-
- try
- {
- String expandedSysId = resId.getExpandedSystemId();
- if (expandedSysId != null)
- {
- log.trace("Use ExpandedSystemId: " + expandedSysId);
- return getXMLInputSource(new URL(expandedSysId), resId);
- }
- }
- catch (IOException e)
- {
- log.trace(e);
- }
-
- try
- {
- if (systemId != null)
- {
- log.trace("Use LiteralSystemId: " + systemId);
- return getXMLInputSource(new URL(systemId), resId);
- }
- }
- catch (IOException e)
- {
- log.trace(e);
- }
-
- // in case of a DOCTYPE declaration ew refer to systemId
- String namespaceURI = resId.getNamespace() != null ? resId.getNamespace() :
resId.getLiteralSystemId();
-
- // The schema parser will obviously know this schema already
- if (Constants.NS_SCHEMA_XSD.equals(namespaceURI))
- return null;
-
- try
- {
- URL url = schemaLocationByNamespace.get(namespaceURI);
- if (url != null)
- {
- log.trace("Use SchemaLocationByNamespace: " + url);
- return getXMLInputSource(url, resId);
- }
-
- // Delegate to JBoss Entity Resolver
- XMLInputSource source = getXMLInputSource(
- delegate.resolveEntity(null, namespaceURI), resId);
- if (source != null)
- return source;
- }
- catch (SAXException e)
- {
- log.trace(e);
- }
-
- try
- {
- log.trace("Use NamespaceURI: " + namespaceURI);
- return getXMLInputSource(new URL(namespaceURI), resId);
- }
- catch (IOException e)
- {
- log.trace(e);
- }
-
- log.trace("Cannot obtain XMLInputSource for: " + resId);
- return null;
- }
-
- private XMLInputSource getXMLInputSource(URL url, XMLResourceIdentifier resId) throws
IOException
- {
- InputStream inputStream = url.openStream();
- InputSource inputSource = new InputSource(inputStream);
- return getXMLInputSource(inputSource, resId);
- }
-
- private XMLInputSource getXMLInputSource(InputSource inputSource,
XMLResourceIdentifier resId)
- {
- String encoding = inputSource.getEncoding();
- InputStream byteStream = inputSource.getByteStream();
- return new XMLInputSource(resId.getPublicId(), resId.getExpandedSystemId(),
resId.getBaseSystemId(), byteStream, encoding);
- }
-}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,176 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.xerces.xni.XMLResourceIdentifier;
+import org.apache.xerces.xni.XNIException;
+import org.apache.xerces.xni.parser.XMLEntityResolver;
+import org.apache.xerces.xni.parser.XMLInputSource;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Entity Resolver for the default Xerces Reference parser
+ * @author <a href="mailto:Anil.Saldhana@jboss.org">Anil
Saldhana</a>
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Aug-2005
+ */
+public class JBossXSEntityResolver implements XMLEntityResolver
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(JBossXSEntityResolver.class);
+
+ private Map<String, URL> schemaLocationByNamespace = new HashMap<String,
URL>();
+
+ private EntityResolver delegate;
+
+ public JBossXSEntityResolver(EntityResolver resolver, Map<String, URL>
schemaLocationByNamespace)
+ {
+ this.schemaLocationByNamespace = schemaLocationByNamespace;
+ this.delegate = resolver;
+ }
+
+ /**
+ * Resolves an external parsed entity. If the entity cannot be
+ * resolved, this method should return null.
+ *
+ * @param resourceIdentifier description of the resource to be resolved
+ * @throws XNIException Thrown on general error.
+ * @throws IOException Thrown if resolved entity stream cannot be
+ * opened or some other i/o error occurs.
+ */
+ public XMLInputSource resolveEntity(XMLResourceIdentifier resId) throws XNIException,
IOException
+ {
+ log.trace("Resolve entity: " + resId);
+
+ // First try the JBossEntityResolver
+ String publicId = resId.getPublicId();
+ String systemId = resId.getLiteralSystemId();
+ String namespace = resId.getNamespace();
+ try
+ {
+ String publicURI = (publicId != null ? publicId : namespace);
+ InputSource inputSource = delegate.resolveEntity(publicURI, systemId);
+ if (inputSource != null)
+ {
+ XMLInputSource source = getXMLInputSource(inputSource, resId);
+ return source;
+ }
+ }
+ catch (Exception ex)
+ {
+ log.trace(ex);
+ }
+
+ try
+ {
+ String expandedSysId = resId.getExpandedSystemId();
+ if (expandedSysId != null)
+ {
+ log.trace("Use ExpandedSystemId: " + expandedSysId);
+ return getXMLInputSource(new URL(expandedSysId), resId);
+ }
+ }
+ catch (IOException e)
+ {
+ log.trace(e);
+ }
+
+ try
+ {
+ if (systemId != null)
+ {
+ log.trace("Use LiteralSystemId: " + systemId);
+ return getXMLInputSource(new URL(systemId), resId);
+ }
+ }
+ catch (IOException e)
+ {
+ log.trace(e);
+ }
+
+ // in case of a DOCTYPE declaration ew refer to systemId
+ String namespaceURI = resId.getNamespace() != null ? resId.getNamespace() :
resId.getLiteralSystemId();
+
+ // The schema parser will obviously know this schema already
+ if (Constants.NS_SCHEMA_XSD.equals(namespaceURI))
+ return null;
+
+ try
+ {
+ URL url = schemaLocationByNamespace.get(namespaceURI);
+ if (url != null)
+ {
+ log.trace("Use SchemaLocationByNamespace: " + url);
+ return getXMLInputSource(url, resId);
+ }
+
+ // Delegate to JBoss Entity Resolver
+ XMLInputSource source = getXMLInputSource(
+ delegate.resolveEntity(null, namespaceURI), resId);
+ if (source != null)
+ return source;
+ }
+ catch (SAXException e)
+ {
+ log.trace(e);
+ }
+
+ try
+ {
+ log.trace("Use NamespaceURI: " + namespaceURI);
+ return getXMLInputSource(new URL(namespaceURI), resId);
+ }
+ catch (IOException e)
+ {
+ log.trace(e);
+ }
+
+ log.trace("Cannot obtain XMLInputSource for: " + resId);
+ return null;
+ }
+
+ private XMLInputSource getXMLInputSource(URL url, XMLResourceIdentifier resId) throws
IOException
+ {
+ InputStream inputStream = url.openStream();
+ InputSource inputSource = new InputSource(inputStream);
+ return getXMLInputSource(inputSource, resId);
+ }
+
+ private XMLInputSource getXMLInputSource(InputSource inputSource,
XMLResourceIdentifier resId)
+ {
+ String encoding = inputSource.getEncoding();
+ InputStream byteStream = inputSource.getByteStream();
+ return new XMLInputSource(resId.getPublicId(), resId.getExpandedSystemId(),
resId.getBaseSystemId(), byteStream, encoding);
+ }
+}
\ No newline at end of file
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSErrorHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSErrorHandler.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,116 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.parser.XMLErrorHandler;
-import org.apache.xerces.xni.parser.XMLParseException;
-import org.jboss.logging.Logger;
-/**
- * Error Handler for the Xerces schema parser default implementation
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Aug 11, 2005
- */
-public class JBossXSErrorHandler implements XMLErrorHandler
-{
- private static final Logger log = Logger.getLogger(JBossXSErrorHandler.class);
-
- /**
- * Reports a warning. Warnings are non-fatal and can be safely ignored by most
applications.
- * @param domain - The domain of the warning. The domain can be any string but is
suggested to be a valid URI. The domain can be used to conveniently specify a web site
location of the relevent specification or document pertaining to this warning.
- * @param key - The warning key. This key can be any string and is implementation
dependent.
- * @param exception - Exception.
- * @throws XNIException Thrown to signal that the parser should stop parsing the
document.
- */
- public void warning(String domain, String key, XMLParseException xexp) throws
XNIException
- {
- log.trace(getFormattedString(domain,key,xexp));
- }
-
- /**
- * Reports an error. Errors are non-fatal and usually signify that the document is
invalid with respect to its grammar(s).
- * @param domain - The domain of the warning. The domain can be any string but is
suggested to be a valid URI. The domain can be used to conveniently specify a web site
location of the relevent specification or document pertaining to this warning.
- * @param key - The warning key. This key can be any string and is implementation
dependent.
- * @param exception - Exception.
- * @throws XNIException Thrown to signal that the parser should stop parsing the
document.
- */
- public void error(String domain, String key, XMLParseException xexp) throws
XNIException
- {
- if("src-include.2.1".equals(key))
- throw new XNIException("Parser should stop:",xexp);
- log.error(getFormattedString(domain,key,xexp));
- }
-
- /**
- * Report a fatal error. Fatal errors usually occur when the document is not
well-formed
- * and signifies that the parser cannot continue normal operation.
- * @param domain - The domain of the warning. The domain can be any string but is
suggested to be a valid URI. The domain can be used to conveniently specify a web site
location of the relevent specification or document pertaining to this warning.
- * @param key - The warning key. This key can be any string and is implementation
dependent.
- * @param exception - Exception.
- * @throws XNIException Thrown to signal that the parser should stop parsing the
document.
- */
- public void fatalError(String domain, String key, XMLParseException xexp) throws
XNIException
- {
- log.fatal(getFormattedString(domain,key,xexp));
- throw new XNIException("Parser should stop:",xexp);
- }
-
- /**
- * Get the name of the schema file in question
- *
- * @param xexp
- * @return
- */
- private String getFileName(XMLParseException xexp)
- {
- String fname = xexp.getExpandedSystemId();
- if (fname != null) {
- int index = fname.lastIndexOf('/');
- if (index != -1)
- fname = fname.substring(index + 1);
- }
- else
- {
- fname = "";
- }
-
- return fname;
- }
-
- /**
- * Return a formatted string that gives as much information
- * as possible to the user
- * @param domain
- * @param key
- * @param xexp
- * @return
- */
- private String getFormattedString(String domain, String key, XMLParseException xexp)
- {
- StringBuilder buf = new StringBuilder(getFileName(xexp));
- buf.append("[domain:");
-
buf.append(domain).append("]::[key=").append(key).append("]::");
- buf.append("Message=");
- buf.append(xexp.getLocalizedMessage());
- return buf.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSErrorHandler.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSErrorHandler.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,116 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import org.apache.xerces.xni.XNIException;
+import org.apache.xerces.xni.parser.XMLErrorHandler;
+import org.apache.xerces.xni.parser.XMLParseException;
+import org.jboss.logging.Logger;
+/**
+ * Error Handler for the Xerces schema parser default implementation
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Aug 11, 2005
+ */
+public class JBossXSErrorHandler implements XMLErrorHandler
+{
+ private static final Logger log = Logger.getLogger(JBossXSErrorHandler.class);
+
+ /**
+ * Reports a warning. Warnings are non-fatal and can be safely ignored by most
applications.
+ * @param domain - The domain of the warning. The domain can be any string but is
suggested to be a valid URI. The domain can be used to conveniently specify a web site
location of the relevent specification or document pertaining to this warning.
+ * @param key - The warning key. This key can be any string and is implementation
dependent.
+ * @param exception - Exception.
+ * @throws XNIException Thrown to signal that the parser should stop parsing the
document.
+ */
+ public void warning(String domain, String key, XMLParseException xexp) throws
XNIException
+ {
+ log.trace(getFormattedString(domain,key,xexp));
+ }
+
+ /**
+ * Reports an error. Errors are non-fatal and usually signify that the document is
invalid with respect to its grammar(s).
+ * @param domain - The domain of the warning. The domain can be any string but is
suggested to be a valid URI. The domain can be used to conveniently specify a web site
location of the relevent specification or document pertaining to this warning.
+ * @param key - The warning key. This key can be any string and is implementation
dependent.
+ * @param exception - Exception.
+ * @throws XNIException Thrown to signal that the parser should stop parsing the
document.
+ */
+ public void error(String domain, String key, XMLParseException xexp) throws
XNIException
+ {
+ if("src-include.2.1".equals(key))
+ throw new XNIException("Parser should stop:",xexp);
+ log.error(getFormattedString(domain,key,xexp));
+ }
+
+ /**
+ * Report a fatal error. Fatal errors usually occur when the document is not
well-formed
+ * and signifies that the parser cannot continue normal operation.
+ * @param domain - The domain of the warning. The domain can be any string but is
suggested to be a valid URI. The domain can be used to conveniently specify a web site
location of the relevent specification or document pertaining to this warning.
+ * @param key - The warning key. This key can be any string and is implementation
dependent.
+ * @param exception - Exception.
+ * @throws XNIException Thrown to signal that the parser should stop parsing the
document.
+ */
+ public void fatalError(String domain, String key, XMLParseException xexp) throws
XNIException
+ {
+ log.fatal(getFormattedString(domain,key,xexp));
+ throw new XNIException("Parser should stop:",xexp);
+ }
+
+ /**
+ * Get the name of the schema file in question
+ *
+ * @param xexp
+ * @return
+ */
+ private String getFileName(XMLParseException xexp)
+ {
+ String fname = xexp.getExpandedSystemId();
+ if (fname != null) {
+ int index = fname.lastIndexOf('/');
+ if (index != -1)
+ fname = fname.substring(index + 1);
+ }
+ else
+ {
+ fname = "";
+ }
+
+ return fname;
+ }
+
+ /**
+ * Return a formatted string that gives as much information
+ * as possible to the user
+ * @param domain
+ * @param key
+ * @param xexp
+ * @return
+ */
+ private String getFormattedString(String domain, String key, XMLParseException xexp)
+ {
+ StringBuilder buf = new StringBuilder(getFileName(xexp));
+ buf.append("[domain:");
+
buf.append(domain).append("]::[key=").append(key).append("]::");
+ buf.append("Message=");
+ buf.append(xexp.getLocalizedMessage());
+ return buf.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModel.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModel.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,745 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Serializable;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSAnnotation;
-import org.apache.xerces.xs.XSAttributeDeclaration;
-import org.apache.xerces.xs.XSAttributeGroupDefinition;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSModel;
-import org.apache.xerces.xs.XSModelGroup;
-import org.apache.xerces.xs.XSModelGroupDefinition;
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSNamespaceItem;
-import org.apache.xerces.xs.XSNamespaceItemList;
-import org.apache.xerces.xs.XSNotationDeclaration;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTerm;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.xb.binding.NamespaceRegistry;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Represents a schema model
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-
-public class JBossXSModel implements XSModel, Cloneable
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXSModel.class);
-
- private AnonymousMapper anonymousMapper = new AnonymousMapper();
-
- private boolean qualifiedElements = false;
-
- private NamespaceRegistry namespaceRegistry = new NamespaceRegistry();
-
- protected XSNamespaceItemList nslist = null;
-
- protected HashMap<String, JBossXSNamespaceItem> nsimap = new HashMap<String,
JBossXSNamespaceItem>();
-
- public JBossXSModel()
- {
- }
-
- @Override
- public JBossXSModel clone() throws CloneNotSupportedException
- {
- return (JBossXSModel)super.clone();
- }
-
- /**
- * Convenience method. Returns a list of all namespaces that belong to
- * this schema. The value <code>null</code> is not a valid namespace
- * name, but if there are components that do not have a target namespace
- * , <code>null</code> is included in this list.
- */
- public StringList getNamespaces()
- {
- return new JBossXSStringList(nsimap.keySet());
- }
-
- /**
- * A set of namespace schema information information items (of type
- * <code>XSNamespaceItem</code>), one for each namespace name which
- * appears as the target namespace of any schema component in the schema
- * used for that assessment, and one for absent if any schema component
- * in the schema had no target namespace. For more information see
- * schema information.
- */
- public XSNamespaceItemList getNamespaceItems()
- {
-
- nslist = new JBossXSNamespaceItemList(nsimap.values());
-
- //One for the default xsd
- JBossXSNamespaceItem nsxsd = new JBossXSNamespaceItem(Constants.NS_SCHEMA_XSD,
namespaceRegistry, qualifiedElements);
- ((JBossXSNamespaceItemList)nslist).addItem(nsxsd);
- return nslist;
- }
-
- /**
- * Returns a list of top-level components, i.e. element declarations,
- * attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>. Note that
- * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
- * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
- * <code>objectType</code> to retrieve only complex types or simple
- * types, instead of all types.
- * @return A list of top-level definitions of the specified type in
- * <code>objectType</code> or an empty
<code>XSNamedMap</code> if no
- * such definitions exist.
- */
- public XSNamedMap getComponents(short objectType)
- {
- JBossXSNamedMap map = new JBossXSNamedMap();
- JBossXSStringList sl = (JBossXSStringList)getNamespaces();
- int len = sl != null ? sl.getLength() : 0;
-
- for (int i = 0; i < len; i++)
- {
- String ns = sl.item(i);
- JBossXSNamespaceItem ni = nsimap.get(ns);
- JBossXSNamedMap nm = null;
- if (ni != null)
- {
- nm = (JBossXSNamedMap)ni.getComponents(objectType);
- map.addItems(nm.toList());
- }
- }
-
- return map;
- }
-
- /**
- * Convenience method. Returns a list of top-level component declarations
- * that are defined within the specified namespace, i.e. element
- * declarations, attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>.
- * @param namespace The namespace to which the declaration belongs or
- * <code>null</code> (for components with no target namespace).
- * @return A list of top-level definitions of the specified type in
- * <code>objectType</code> and defined in the specified
- * <code>namespace</code> or an empty
<code>XSNamedMap</code>.
- */
- public XSNamedMap getComponentsByNamespace(short objectType, String namespace)
- {
- JBossXSNamedMap map = new JBossXSNamedMap();
-
- JBossXSNamespaceItem ni = nsimap.get(namespace);
- if (ni == null)
- return map;
-
- return ni.getComponents(objectType);
- }
-
- /**
- * [annotations]: a set of annotations if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations()
- {
- List lst = new ArrayList();
- JBossXSObjectList objlist = new JBossXSObjectList(lst);
- Set<String> keyset = nsimap.keySet();
- for (String ns : keyset)
- {
- XSNamespaceItem xs = nsimap.get(ns);
- objlist.addObjects(xs.getAnnotations());
- }
- return objlist;
- }
-
- /**
- * Convenience method. Returns a top-level element declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return A top-level element declaration or <code>null</code> if such a
- * declaration does not exist.
- */
- public XSElementDeclaration getElementDeclaration(String name, String namespace)
- {
- if (name == null)
- return null;
-
- if (name.startsWith(">") || name.endsWith("]"))
- return anonymousMapper.getElementDeclaration(name, namespace);
-
- JBossXSNamespaceItem ni = nsimap.get(namespace);
- if (ni == null)
- return null;
- return ni.getElementDeclaration(name);
- }
-
- /**
- * Convenience method. Returns a top-level attribute declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return A top-level attribute declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSAttributeDeclaration getAttributeDeclaration(String name, String namespace)
- {
- JBossXSNamespaceItem ni = nsimap.get(namespace);
- if (ni == null)
- return null;
- return ni.getAttributeDeclaration(name);
- }
-
- /**
- * Convenience method. Returns a top-level simple or complex type
- * definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return An <code>XSTypeDefinition</code> or
<code>null</code> if such
- * a definition does not exist.
- */
- public XSTypeDefinition getTypeDefinition(String name, String namespace)
- {
- if (name == null)
- return null;
-
- if (name.startsWith(">") || name.endsWith("]"))
- return anonymousMapper.getTypeDefinition(name, namespace);
-
- JBossXSNamespaceItem ni = nsimap.get(namespace);
- if (ni == null)
- return null;
- return ni.getTypeDefinition(name);
- }
-
- /**
- * Convenience method. Returns a top-level attribute group definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise
- * <code>null</code>.
- * @return A top-level attribute group definition or <code>null</code> if
- * such a definition does not exist.
- */
- public XSAttributeGroupDefinition getAttributeGroup(String name, String namespace)
- {
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level model group definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise
- * <code>null</code>.
- * @return A top-level model group definition or <code>null</code> if
- * such a definition does not exist.
- */
- public XSModelGroupDefinition getModelGroupDefinition(String name, String namespace)
- {
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level notation declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return A top-level notation declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSNotationDeclaration getNotationDeclaration(String name, String namespace)
- {
- return null;
- }
-
- public void addXSAnnotation(XSAnnotation xa)
- {
- String ns = xa.getNamespace();
- if (ns == null && nsimap.keySet().size() == 1)
- {
- ns = nsimap.keySet().iterator().next();
- }
- if (ns != null)
- {
- createNamespaceItemIfNotExistent(ns);
- JBossXSNamespaceItem jbnm = nsimap.get(ns);
- jbnm.addXSAnnotation(xa);
- }
- else
- {
- log.trace("Cannot assign XSAnnotation to null namespace");
- }
- }
-
- public void addXSAttributeDeclaration(XSAttributeDeclaration attr)
- {
- //Add attribute to the namespace item
- String ns = attr.getNamespace();
- JBossXSNamespaceItem jbnm = createNamespaceItemIfNotExistent(ns);
- jbnm.addXSAttributeDeclaration(attr);
- }
-
- public void addXSTypeDefinition(XSTypeDefinition xst)
- {
- //Add type to the namespace item
- String ns = xst.getNamespace();
- if (ns == null)
- throw new WSException("Illegal namespace:null");
- JBossXSNamespaceItem jbnm = createNamespaceItemIfNotExistent(ns);
- jbnm.addXSTypeDefinition(xst);
-
- anonymousMapper.rebuild();
- }
-
- public void addXSComplexTypeDefinition(XSTypeDefinition xst)
- {
- this.addXSTypeDefinition(xst);
-
- anonymousMapper.rebuild();
- }
-
- public void addXSElementDeclaration(XSElementDeclaration xsel)
- {
- //Add element to the namespace item
- String ns = xsel.getNamespace();
- JBossXSNamespaceItem jbnm = createNamespaceItemIfNotExistent(ns);
- jbnm.addXSElementDeclaration(xsel);
-
- anonymousMapper.rebuild();
- }
-
- public void addSchemaLocation(String nsURI, URL locationURL)
- {
- JBossXSNamespaceItem ni = createNamespaceItemIfNotExistent(nsURI);
- ni.addDocumentLocation(locationURL.toExternalForm());
- }
-
- public void addXSNamespaceItem(XSNamespaceItem xsitem)
- {
- ((JBossXSNamespaceItemList)nslist).addItem(xsitem);
-
- anonymousMapper.rebuild();
- }
-
- public void setXSNamespaceItemList(XSNamespaceItemList list)
- {
- this.nslist = list;
- }
-
- public void merge(JBossXSModel xsm)
- {
- JBossXSNamespaceItemList jxsm = (JBossXSNamespaceItemList)xsm.getNamespaceItems();
- int len = jxsm.getLength();
- for (int i = 0; i < len; i++)
- {
- JBossXSNamespaceItem ni = (JBossXSNamespaceItem)jxsm.item(i);
- String sns = ni.getSchemaNamespace();
- JBossXSNamespaceItem mynsi = nsimap.get(sns);
- if (mynsi != null)
- mynsi.merge(ni);
- else
- {
- //add the namespaceitem
- nsimap.put(sns, ni);
- ni.setNamespaceRegistry(namespaceRegistry);
- }
- }
-
- NamespaceRegistry xsmRegistry = xsm.getNamespaceRegistry();
- Iterator iter = xsmRegistry.getRegisteredPrefixes();
- while (iter.hasNext())
- {
- String prefix = (String)iter.next();
- String ns = xsmRegistry.getNamespaceURI(prefix);
- this.namespaceRegistry.registerURI(ns, prefix);
- }
-
- anonymousMapper.rebuild();
- }
-
- public void removeXSTypeDefinition(XSTypeDefinition xst)
- {
- String ns = xst.getNamespace();
- JBossXSNamespaceItem ni = nsimap.get(ns);
- ni.removeXSTypeDefinition(xst);
-
- anonymousMapper.rebuild();
- }
-
- /**
- * Given a namespaceuri, return the NamespaceItem that represents it
- * @param nsuri Namespace URI
- * @return JBossXSNamespaceItem
- */
- public JBossXSNamespaceItem getNamespaceItem(String nsuri)
- {
- return nsimap.get(nsuri);
- }
-
- public void writeTo(OutputStream out) throws IOException
- {
- out.write(serialize().getBytes());
- }
-
- public String serialize()
- {
- StringBuilder sb = serializeNamespaceItems();
-
- /**
- * Since the serialized string can contain multiple schema
- * definitions, we have to embed in a root element before
- * parsing for layout
- */
- sb.insert(0, "<root>");
- sb.append("</root>");
- // Layout schema
- String xsModelString = sb.toString();
-
- if (xsModelString.length() > 0)
- {
- try
- {
- Element root = DOMUtils.parse(xsModelString);
- //xsModelString = DOMWriter.printNode(root, true);
- xsModelString = this.getChildNodesSerialized(root);
- }
- catch (IOException e)
- {
- log.error("Cannot parse xsModelString: " + xsModelString, e);
- }
-
- }
-
- return xsModelString;
- }
-
- public Map<String, XSTypeDefinition> getAnonymousTypes()
- {
- return anonymousMapper.getTypes();
- }
-
- public Map<String, XSElementDeclaration> getAnonymousElements()
- {
- return anonymousMapper.getElements();
- }
-
- public boolean isQualifiedElements()
- {
- return qualifiedElements;
- }
-
- public void setQualifiedElements(boolean qualifiedElements)
- {
- this.qualifiedElements = qualifiedElements;
- for (JBossXSNamespaceItem item : nsimap.values())
- item.setQualifiedElements(qualifiedElements);
- }
-
- public NamespaceRegistry getNamespaceRegistry()
- {
- return namespaceRegistry;
- }
-
- public void eagerInitialize()
- {
- anonymousMapper.build();
- }
-
- private String registerNamespace(String ns)
- {
- String prefix = namespaceRegistry.getPrefix(ns);
-
- if (prefix != null)
- return prefix;
-
- // XML Namespace MUST ALWAYS BE the "xml" prefix
- if (Constants.NS_XML.equals(ns))
- prefix = Constants.PREFIX_XML;
-
- return namespaceRegistry.registerURI(ns, prefix);
- }
-
- private JBossXSNamespaceItem createNamespaceItemIfNotExistent(String ns)
- {
- if (ns == null)
- throw new IllegalArgumentException("Illegal null argument:ns");
-
- JBossXSNamespaceItem jbnm = nsimap.get(ns);
- if (jbnm == null)
- {
- jbnm = new JBossXSNamespaceItem(ns, namespaceRegistry, qualifiedElements);
- nsimap.put(ns, jbnm);
- registerNamespace(ns);
- }
-
- return jbnm;
- }
-
- private StringBuilder serializeNamespaceItems()
- {
- StringBuilder sb = new StringBuilder();
- //Write a schema definition for each namespaceitem that is custom
- Collection<JBossXSNamespaceItem> col = nsimap.values();
- for (JBossXSNamespaceItem i : col)
- {
- String nameS = i.getSchemaNamespace();
- if (Constants.NS_SCHEMA_XSD.equals(nameS) ||
Constants.URI_SOAP11_ENC.equals(nameS))
- continue;
-
- sb.append(i.toString());
- }
-
- return sb;
- }
-
- private String getChildNodesSerialized(Element root)
- {
- StringBuilder sb = new StringBuilder();
- Iterator iter = DOMUtils.getChildElements(root);
- while (iter != null && iter.hasNext())
- {
- Node n = (Node)iter.next();
- sb.append(DOMWriter.printNode(n, true));
- sb.append("\n");
- }
- return sb.toString();
- }
-
- private class AnonymousMapper implements Serializable
- {
- private static final long serialVersionUID = 5572350092914194023L;
-
- private HashMap<String, XSTypeDefinition> anonymousTypeMap;
-
- private HashMap<String, XSElementDeclaration> anonymousElementMap;
-
- // not really a stack, but it does contain items on the stack
- private HashSet<XSComplexTypeDefinition> stack = new
HashSet<XSComplexTypeDefinition>();
-
- /**
- * Triggers a rebuild of anonymous types only if a build has occured before.
- */
- public void rebuild()
- {
- if (anonymousTypeMap != null)
- build();
- }
-
- /**
- * Builds the anonymous type mapping. This is intended to be called lazily.
- */
- public void build()
- {
- XSModel model = JBossXSModel.this;
-
- anonymousTypeMap = new HashMap<String, XSTypeDefinition>();
-
- anonymousElementMap = new HashMap<String, XSElementDeclaration>();
-
- XSNamedMap namedMap = model.getComponents(XSConstants.TYPE_DEFINITION);
- for (int i = 0; i < namedMap.getLength(); i++)
- {
- XSTypeDefinition type = (XSTypeDefinition)namedMap.item(i);
- if (type.getTypeCategory() != XSTypeDefinition.COMPLEX_TYPE)
- continue;
-
- analyzeComplexType((XSComplexTypeDefinition)type, null,
type.getNamespace());
- }
-
- namedMap = model.getComponents(XSConstants.ELEMENT_DECLARATION);
- for (int i = 0; i < namedMap.getLength(); i++)
- {
- XSElementDeclaration element = (XSElementDeclaration)namedMap.item(i);
- analyzeElement(element, null, element.getNamespace(), null, null);
- }
- }
-
- private void analyzeElement(XSElementDeclaration element, String parentName, String
namespace, Integer minOccurs, Integer maxOccurs)
- {
- String name = element.getName();
-
- if (element.getScope() != XSConstants.SCOPE_GLOBAL)
- {
- name = parentName + ">" + name;
- anonymousElementMap.put(namespace + ":" + name, element);
- }
-
- if (maxOccurs != null && maxOccurs.intValue() > 1)
- {
- String key = namespace + ":" + name + "[" +
minOccurs.intValue() + "," + maxOccurs.intValue() + "]";
- anonymousTypeMap.put(key, createArrayWrapperComplexType(element, name,
namespace, minOccurs, maxOccurs));
- if (minOccurs.intValue() == 1)
- {
- key = namespace + ":" + name + "[" + "," +
maxOccurs.intValue() + "]";
- anonymousTypeMap.put(key, createArrayWrapperComplexType(element, name,
namespace, minOccurs, maxOccurs));
- }
- }
-
- XSTypeDefinition type = element.getTypeDefinition();
- if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
- analyzeComplexType((XSComplexTypeDefinition)type, name, namespace);
-
- if (type.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE)
- analyzeSimpleType((XSSimpleTypeDefinition)type, name, namespace);
- }
-
- private XSComplexTypeDefinition createArrayWrapperComplexType(XSElementDeclaration
element, String name, String namespace, Integer minOccurs, Integer maxOccurs)
- {
- JBossXSComplexTypeDefinition definition = new JBossXSComplexTypeDefinition(name,
namespace);
- definition.setAnonymous(true);
-
- JBossXSModelGroup group = new JBossXSModelGroup();
- group.setCompositor(XSModelGroup.COMPOSITOR_SEQUENCE);
- List<XSParticle> particles = new ArrayList<XSParticle>(1);
- JBossXSParticle particle = new JBossXSParticle();
- particle.setMaxOccurs(maxOccurs);
- particle.setMinOccurs(minOccurs);
- particle.setTerm(element);
- particles.add(particle);
- group.setParticles(particles);
-
- particle = new JBossXSParticle();
- particle.setTerm(group);
- definition.setParticle(particle);
-
- return definition;
- }
-
- private String analyzeType(XSTypeDefinition type, String parentName, String
namespace)
- {
- String name;
- if (type.getAnonymous())
- name = ">" + parentName;
- else name = type.getName();
-
- if (type.getAnonymous())
- {
- anonymousTypeMap.put(namespace + ":" + name, type);
- log.debug("Registered as anon type: {" + namespace + ":"
+ name + "} -> " + type);
- }
- return name;
- }
-
- private void analyzeSimpleType(XSSimpleTypeDefinition simpleType, String
parentName, String namespace)
- {
- analyzeType(simpleType, parentName, namespace);
- }
-
- private void analyzeComplexType(XSComplexTypeDefinition complexType, String
parentName, String namespace)
- {
- // Prevent reentrancy
- if (stack.contains(complexType))
- return;
-
- stack.add(complexType);
- String name = analyzeType(complexType, parentName, namespace);
- analyzeParticle(complexType.getParticle(), name, namespace);
- stack.remove(complexType);
- }
-
- private void analyzeParticle(XSParticle particle, String parentName, String
namespace)
- {
- // Is this right, can a particle be null?
- if (particle == null)
- return;
- XSTerm term = particle.getTerm();
-
- // Is this right, can a term be null?
- if (term == null)
- return;
- switch (term.getType())
- {
- case XSConstants.MODEL_GROUP:
- XSModelGroup group = (XSModelGroup)term;
- XSObjectList list = group.getParticles();
- for (int i = 0; i < list.getLength(); i++)
- analyzeParticle((XSParticle)list.item(i), parentName, namespace);
- break;
- case XSConstants.ELEMENT_DECLARATION:
- XSElementDeclaration decl = (XSElementDeclaration)term;
- analyzeElement(decl, parentName, namespace, new
Integer(particle.getMinOccurs()), new Integer(particle.getMaxOccurs()));
- }
- }
-
- public XSTypeDefinition getTypeDefinition(String name, String namespace)
- {
- // We lazily build this, after the first anonymous type name lookup
- if (anonymousTypeMap == null)
- build();
-
- return anonymousTypeMap.get(namespace + ":" + name);
- }
-
- public XSElementDeclaration getElementDeclaration(String name, String namespace)
- {
- // We lazily build this, after the first anonymous type name lookup
- if (anonymousElementMap == null)
- build();
-
- return anonymousElementMap.get(namespace + ":" + name);
- }
-
- public Map<String, XSElementDeclaration> getElements()
- {
- if (anonymousElementMap == null)
- build();
-
- // avoid the copy, trust the client
- return anonymousElementMap;
- }
-
- public Map<String, XSTypeDefinition> getTypes()
- {
- if (anonymousTypeMap == null)
- build();
-
- // avoid the copy, trust the client
- return anonymousTypeMap;
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModel.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModel.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,745 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.xerces.xs.StringList;
+import org.apache.xerces.xs.XSAnnotation;
+import org.apache.xerces.xs.XSAttributeDeclaration;
+import org.apache.xerces.xs.XSAttributeGroupDefinition;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSModel;
+import org.apache.xerces.xs.XSModelGroup;
+import org.apache.xerces.xs.XSModelGroupDefinition;
+import org.apache.xerces.xs.XSNamedMap;
+import org.apache.xerces.xs.XSNamespaceItem;
+import org.apache.xerces.xs.XSNamespaceItemList;
+import org.apache.xerces.xs.XSNotationDeclaration;
+import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSParticle;
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSTerm;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.xb.binding.NamespaceRegistry;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Represents a schema model
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 20, 2005
+ */
+
+public class JBossXSModel implements XSModel, Cloneable
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(JBossXSModel.class);
+
+ private AnonymousMapper anonymousMapper = new AnonymousMapper();
+
+ private boolean qualifiedElements = false;
+
+ private NamespaceRegistry namespaceRegistry = new NamespaceRegistry();
+
+ protected XSNamespaceItemList nslist = null;
+
+ protected HashMap<String, JBossXSNamespaceItem> nsimap = new HashMap<String,
JBossXSNamespaceItem>();
+
+ public JBossXSModel()
+ {
+ }
+
+ @Override
+ public JBossXSModel clone() throws CloneNotSupportedException
+ {
+ return (JBossXSModel)super.clone();
+ }
+
+ /**
+ * Convenience method. Returns a list of all namespaces that belong to
+ * this schema. The value <code>null</code> is not a valid namespace
+ * name, but if there are components that do not have a target namespace
+ * , <code>null</code> is included in this list.
+ */
+ public StringList getNamespaces()
+ {
+ return new JBossXSStringList(nsimap.keySet());
+ }
+
+ /**
+ * A set of namespace schema information information items (of type
+ * <code>XSNamespaceItem</code>), one for each namespace name which
+ * appears as the target namespace of any schema component in the schema
+ * used for that assessment, and one for absent if any schema component
+ * in the schema had no target namespace. For more information see
+ * schema information.
+ */
+ public XSNamespaceItemList getNamespaceItems()
+ {
+
+ nslist = new JBossXSNamespaceItemList(nsimap.values());
+
+ //One for the default xsd
+ JBossXSNamespaceItem nsxsd = new JBossXSNamespaceItem(Constants.NS_SCHEMA_XSD,
namespaceRegistry, qualifiedElements);
+ ((JBossXSNamespaceItemList)nslist).addItem(nsxsd);
+ return nslist;
+ }
+
+ /**
+ * Returns a list of top-level components, i.e. element declarations,
+ * attribute declarations, etc.
+ * @param objectType The type of the declaration, i.e.
+ * <code>ELEMENT_DECLARATION</code>. Note that
+ * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
+ * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
+ * <code>objectType</code> to retrieve only complex types or simple
+ * types, instead of all types.
+ * @return A list of top-level definitions of the specified type in
+ * <code>objectType</code> or an empty
<code>XSNamedMap</code> if no
+ * such definitions exist.
+ */
+ public XSNamedMap getComponents(short objectType)
+ {
+ JBossXSNamedMap map = new JBossXSNamedMap();
+ JBossXSStringList sl = (JBossXSStringList)getNamespaces();
+ int len = sl != null ? sl.getLength() : 0;
+
+ for (int i = 0; i < len; i++)
+ {
+ String ns = sl.item(i);
+ JBossXSNamespaceItem ni = nsimap.get(ns);
+ JBossXSNamedMap nm = null;
+ if (ni != null)
+ {
+ nm = (JBossXSNamedMap)ni.getComponents(objectType);
+ map.addItems(nm.toList());
+ }
+ }
+
+ return map;
+ }
+
+ /**
+ * Convenience method. Returns a list of top-level component declarations
+ * that are defined within the specified namespace, i.e. element
+ * declarations, attribute declarations, etc.
+ * @param objectType The type of the declaration, i.e.
+ * <code>ELEMENT_DECLARATION</code>.
+ * @param namespace The namespace to which the declaration belongs or
+ * <code>null</code> (for components with no target namespace).
+ * @return A list of top-level definitions of the specified type in
+ * <code>objectType</code> and defined in the specified
+ * <code>namespace</code> or an empty
<code>XSNamedMap</code>.
+ */
+ public XSNamedMap getComponentsByNamespace(short objectType, String namespace)
+ {
+ JBossXSNamedMap map = new JBossXSNamedMap();
+
+ JBossXSNamespaceItem ni = nsimap.get(namespace);
+ if (ni == null)
+ return map;
+
+ return ni.getComponents(objectType);
+ }
+
+ /**
+ * [annotations]: a set of annotations if it exists, otherwise an empty
+ * <code>XSObjectList</code>.
+ */
+ public XSObjectList getAnnotations()
+ {
+ List lst = new ArrayList();
+ JBossXSObjectList objlist = new JBossXSObjectList(lst);
+ Set<String> keyset = nsimap.keySet();
+ for (String ns : keyset)
+ {
+ XSNamespaceItem xs = nsimap.get(ns);
+ objlist.addObjects(xs.getAnnotations());
+ }
+ return objlist;
+ }
+
+ /**
+ * Convenience method. Returns a top-level element declaration.
+ * @param name The name of the declaration.
+ * @param namespace The namespace of the declaration, otherwise
+ * <code>null</code>.
+ * @return A top-level element declaration or <code>null</code> if such a
+ * declaration does not exist.
+ */
+ public XSElementDeclaration getElementDeclaration(String name, String namespace)
+ {
+ if (name == null)
+ return null;
+
+ if (name.startsWith(">") || name.endsWith("]"))
+ return anonymousMapper.getElementDeclaration(name, namespace);
+
+ JBossXSNamespaceItem ni = nsimap.get(namespace);
+ if (ni == null)
+ return null;
+ return ni.getElementDeclaration(name);
+ }
+
+ /**
+ * Convenience method. Returns a top-level attribute declaration.
+ * @param name The name of the declaration.
+ * @param namespace The namespace of the declaration, otherwise
+ * <code>null</code>.
+ * @return A top-level attribute declaration or <code>null</code> if such
+ * a declaration does not exist.
+ */
+ public XSAttributeDeclaration getAttributeDeclaration(String name, String namespace)
+ {
+ JBossXSNamespaceItem ni = nsimap.get(namespace);
+ if (ni == null)
+ return null;
+ return ni.getAttributeDeclaration(name);
+ }
+
+ /**
+ * Convenience method. Returns a top-level simple or complex type
+ * definition.
+ * @param name The name of the definition.
+ * @param namespace The namespace of the declaration, otherwise
+ * <code>null</code>.
+ * @return An <code>XSTypeDefinition</code> or
<code>null</code> if such
+ * a definition does not exist.
+ */
+ public XSTypeDefinition getTypeDefinition(String name, String namespace)
+ {
+ if (name == null)
+ return null;
+
+ if (name.startsWith(">") || name.endsWith("]"))
+ return anonymousMapper.getTypeDefinition(name, namespace);
+
+ JBossXSNamespaceItem ni = nsimap.get(namespace);
+ if (ni == null)
+ return null;
+ return ni.getTypeDefinition(name);
+ }
+
+ /**
+ * Convenience method. Returns a top-level attribute group definition.
+ * @param name The name of the definition.
+ * @param namespace The namespace of the definition, otherwise
+ * <code>null</code>.
+ * @return A top-level attribute group definition or <code>null</code> if
+ * such a definition does not exist.
+ */
+ public XSAttributeGroupDefinition getAttributeGroup(String name, String namespace)
+ {
+ return null;
+ }
+
+ /**
+ * Convenience method. Returns a top-level model group definition.
+ * @param name The name of the definition.
+ * @param namespace The namespace of the definition, otherwise
+ * <code>null</code>.
+ * @return A top-level model group definition or <code>null</code> if
+ * such a definition does not exist.
+ */
+ public XSModelGroupDefinition getModelGroupDefinition(String name, String namespace)
+ {
+ return null;
+ }
+
+ /**
+ * Convenience method. Returns a top-level notation declaration.
+ * @param name The name of the declaration.
+ * @param namespace The namespace of the declaration, otherwise
+ * <code>null</code>.
+ * @return A top-level notation declaration or <code>null</code> if such
+ * a declaration does not exist.
+ */
+ public XSNotationDeclaration getNotationDeclaration(String name, String namespace)
+ {
+ return null;
+ }
+
+ public void addXSAnnotation(XSAnnotation xa)
+ {
+ String ns = xa.getNamespace();
+ if (ns == null && nsimap.keySet().size() == 1)
+ {
+ ns = nsimap.keySet().iterator().next();
+ }
+ if (ns != null)
+ {
+ createNamespaceItemIfNotExistent(ns);
+ JBossXSNamespaceItem jbnm = nsimap.get(ns);
+ jbnm.addXSAnnotation(xa);
+ }
+ else
+ {
+ log.trace("Cannot assign XSAnnotation to null namespace");
+ }
+ }
+
+ public void addXSAttributeDeclaration(XSAttributeDeclaration attr)
+ {
+ //Add attribute to the namespace item
+ String ns = attr.getNamespace();
+ JBossXSNamespaceItem jbnm = createNamespaceItemIfNotExistent(ns);
+ jbnm.addXSAttributeDeclaration(attr);
+ }
+
+ public void addXSTypeDefinition(XSTypeDefinition xst)
+ {
+ //Add type to the namespace item
+ String ns = xst.getNamespace();
+ if (ns == null)
+ throw new WSException("Illegal namespace:null");
+ JBossXSNamespaceItem jbnm = createNamespaceItemIfNotExistent(ns);
+ jbnm.addXSTypeDefinition(xst);
+
+ anonymousMapper.rebuild();
+ }
+
+ public void addXSComplexTypeDefinition(XSTypeDefinition xst)
+ {
+ this.addXSTypeDefinition(xst);
+
+ anonymousMapper.rebuild();
+ }
+
+ public void addXSElementDeclaration(XSElementDeclaration xsel)
+ {
+ //Add element to the namespace item
+ String ns = xsel.getNamespace();
+ JBossXSNamespaceItem jbnm = createNamespaceItemIfNotExistent(ns);
+ jbnm.addXSElementDeclaration(xsel);
+
+ anonymousMapper.rebuild();
+ }
+
+ public void addSchemaLocation(String nsURI, URL locationURL)
+ {
+ JBossXSNamespaceItem ni = createNamespaceItemIfNotExistent(nsURI);
+ ni.addDocumentLocation(locationURL.toExternalForm());
+ }
+
+ public void addXSNamespaceItem(XSNamespaceItem xsitem)
+ {
+ ((JBossXSNamespaceItemList)nslist).addItem(xsitem);
+
+ anonymousMapper.rebuild();
+ }
+
+ public void setXSNamespaceItemList(XSNamespaceItemList list)
+ {
+ this.nslist = list;
+ }
+
+ public void merge(JBossXSModel xsm)
+ {
+ JBossXSNamespaceItemList jxsm = (JBossXSNamespaceItemList)xsm.getNamespaceItems();
+ int len = jxsm.getLength();
+ for (int i = 0; i < len; i++)
+ {
+ JBossXSNamespaceItem ni = (JBossXSNamespaceItem)jxsm.item(i);
+ String sns = ni.getSchemaNamespace();
+ JBossXSNamespaceItem mynsi = nsimap.get(sns);
+ if (mynsi != null)
+ mynsi.merge(ni);
+ else
+ {
+ //add the namespaceitem
+ nsimap.put(sns, ni);
+ ni.setNamespaceRegistry(namespaceRegistry);
+ }
+ }
+
+ NamespaceRegistry xsmRegistry = xsm.getNamespaceRegistry();
+ Iterator iter = xsmRegistry.getRegisteredPrefixes();
+ while (iter.hasNext())
+ {
+ String prefix = (String)iter.next();
+ String ns = xsmRegistry.getNamespaceURI(prefix);
+ this.namespaceRegistry.registerURI(ns, prefix);
+ }
+
+ anonymousMapper.rebuild();
+ }
+
+ public void removeXSTypeDefinition(XSTypeDefinition xst)
+ {
+ String ns = xst.getNamespace();
+ JBossXSNamespaceItem ni = nsimap.get(ns);
+ ni.removeXSTypeDefinition(xst);
+
+ anonymousMapper.rebuild();
+ }
+
+ /**
+ * Given a namespaceuri, return the NamespaceItem that represents it
+ * @param nsuri Namespace URI
+ * @return JBossXSNamespaceItem
+ */
+ public JBossXSNamespaceItem getNamespaceItem(String nsuri)
+ {
+ return nsimap.get(nsuri);
+ }
+
+ public void writeTo(OutputStream out) throws IOException
+ {
+ out.write(serialize().getBytes());
+ }
+
+ public String serialize()
+ {
+ StringBuilder sb = serializeNamespaceItems();
+
+ /**
+ * Since the serialized string can contain multiple schema
+ * definitions, we have to embed in a root element before
+ * parsing for layout
+ */
+ sb.insert(0, "<root>");
+ sb.append("</root>");
+ // Layout schema
+ String xsModelString = sb.toString();
+
+ if (xsModelString.length() > 0)
+ {
+ try
+ {
+ Element root = DOMUtils.parse(xsModelString);
+ //xsModelString = DOMWriter.printNode(root, true);
+ xsModelString = this.getChildNodesSerialized(root);
+ }
+ catch (IOException e)
+ {
+ log.error("Cannot parse xsModelString: " + xsModelString, e);
+ }
+
+ }
+
+ return xsModelString;
+ }
+
+ public Map<String, XSTypeDefinition> getAnonymousTypes()
+ {
+ return anonymousMapper.getTypes();
+ }
+
+ public Map<String, XSElementDeclaration> getAnonymousElements()
+ {
+ return anonymousMapper.getElements();
+ }
+
+ public boolean isQualifiedElements()
+ {
+ return qualifiedElements;
+ }
+
+ public void setQualifiedElements(boolean qualifiedElements)
+ {
+ this.qualifiedElements = qualifiedElements;
+ for (JBossXSNamespaceItem item : nsimap.values())
+ item.setQualifiedElements(qualifiedElements);
+ }
+
+ public NamespaceRegistry getNamespaceRegistry()
+ {
+ return namespaceRegistry;
+ }
+
+ public void eagerInitialize()
+ {
+ anonymousMapper.build();
+ }
+
+ private String registerNamespace(String ns)
+ {
+ String prefix = namespaceRegistry.getPrefix(ns);
+
+ if (prefix != null)
+ return prefix;
+
+ // XML Namespace MUST ALWAYS BE the "xml" prefix
+ if (Constants.NS_XML.equals(ns))
+ prefix = Constants.PREFIX_XML;
+
+ return namespaceRegistry.registerURI(ns, prefix);
+ }
+
+ private JBossXSNamespaceItem createNamespaceItemIfNotExistent(String ns)
+ {
+ if (ns == null)
+ throw new IllegalArgumentException("Illegal null argument:ns");
+
+ JBossXSNamespaceItem jbnm = nsimap.get(ns);
+ if (jbnm == null)
+ {
+ jbnm = new JBossXSNamespaceItem(ns, namespaceRegistry, qualifiedElements);
+ nsimap.put(ns, jbnm);
+ registerNamespace(ns);
+ }
+
+ return jbnm;
+ }
+
+ private StringBuilder serializeNamespaceItems()
+ {
+ StringBuilder sb = new StringBuilder();
+ //Write a schema definition for each namespaceitem that is custom
+ Collection<JBossXSNamespaceItem> col = nsimap.values();
+ for (JBossXSNamespaceItem i : col)
+ {
+ String nameS = i.getSchemaNamespace();
+ if (Constants.NS_SCHEMA_XSD.equals(nameS) ||
Constants.URI_SOAP11_ENC.equals(nameS))
+ continue;
+
+ sb.append(i.toString());
+ }
+
+ return sb;
+ }
+
+ private String getChildNodesSerialized(Element root)
+ {
+ StringBuilder sb = new StringBuilder();
+ Iterator iter = DOMUtils.getChildElements(root);
+ while (iter != null && iter.hasNext())
+ {
+ Node n = (Node)iter.next();
+ sb.append(DOMWriter.printNode(n, true));
+ sb.append("\n");
+ }
+ return sb.toString();
+ }
+
+ private class AnonymousMapper implements Serializable
+ {
+ private static final long serialVersionUID = 5572350092914194023L;
+
+ private HashMap<String, XSTypeDefinition> anonymousTypeMap;
+
+ private HashMap<String, XSElementDeclaration> anonymousElementMap;
+
+ // not really a stack, but it does contain items on the stack
+ private HashSet<XSComplexTypeDefinition> stack = new
HashSet<XSComplexTypeDefinition>();
+
+ /**
+ * Triggers a rebuild of anonymous types only if a build has occured before.
+ */
+ public void rebuild()
+ {
+ if (anonymousTypeMap != null)
+ build();
+ }
+
+ /**
+ * Builds the anonymous type mapping. This is intended to be called lazily.
+ */
+ public void build()
+ {
+ XSModel model = JBossXSModel.this;
+
+ anonymousTypeMap = new HashMap<String, XSTypeDefinition>();
+
+ anonymousElementMap = new HashMap<String, XSElementDeclaration>();
+
+ XSNamedMap namedMap = model.getComponents(XSConstants.TYPE_DEFINITION);
+ for (int i = 0; i < namedMap.getLength(); i++)
+ {
+ XSTypeDefinition type = (XSTypeDefinition)namedMap.item(i);
+ if (type.getTypeCategory() != XSTypeDefinition.COMPLEX_TYPE)
+ continue;
+
+ analyzeComplexType((XSComplexTypeDefinition)type, null,
type.getNamespace());
+ }
+
+ namedMap = model.getComponents(XSConstants.ELEMENT_DECLARATION);
+ for (int i = 0; i < namedMap.getLength(); i++)
+ {
+ XSElementDeclaration element = (XSElementDeclaration)namedMap.item(i);
+ analyzeElement(element, null, element.getNamespace(), null, null);
+ }
+ }
+
+ private void analyzeElement(XSElementDeclaration element, String parentName, String
namespace, Integer minOccurs, Integer maxOccurs)
+ {
+ String name = element.getName();
+
+ if (element.getScope() != XSConstants.SCOPE_GLOBAL)
+ {
+ name = parentName + ">" + name;
+ anonymousElementMap.put(namespace + ":" + name, element);
+ }
+
+ if (maxOccurs != null && maxOccurs.intValue() > 1)
+ {
+ String key = namespace + ":" + name + "[" +
minOccurs.intValue() + "," + maxOccurs.intValue() + "]";
+ anonymousTypeMap.put(key, createArrayWrapperComplexType(element, name,
namespace, minOccurs, maxOccurs));
+ if (minOccurs.intValue() == 1)
+ {
+ key = namespace + ":" + name + "[" + "," +
maxOccurs.intValue() + "]";
+ anonymousTypeMap.put(key, createArrayWrapperComplexType(element, name,
namespace, minOccurs, maxOccurs));
+ }
+ }
+
+ XSTypeDefinition type = element.getTypeDefinition();
+ if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
+ analyzeComplexType((XSComplexTypeDefinition)type, name, namespace);
+
+ if (type.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE)
+ analyzeSimpleType((XSSimpleTypeDefinition)type, name, namespace);
+ }
+
+ private XSComplexTypeDefinition createArrayWrapperComplexType(XSElementDeclaration
element, String name, String namespace, Integer minOccurs, Integer maxOccurs)
+ {
+ JBossXSComplexTypeDefinition definition = new JBossXSComplexTypeDefinition(name,
namespace);
+ definition.setAnonymous(true);
+
+ JBossXSModelGroup group = new JBossXSModelGroup();
+ group.setCompositor(XSModelGroup.COMPOSITOR_SEQUENCE);
+ List<XSParticle> particles = new ArrayList<XSParticle>(1);
+ JBossXSParticle particle = new JBossXSParticle();
+ particle.setMaxOccurs(maxOccurs);
+ particle.setMinOccurs(minOccurs);
+ particle.setTerm(element);
+ particles.add(particle);
+ group.setParticles(particles);
+
+ particle = new JBossXSParticle();
+ particle.setTerm(group);
+ definition.setParticle(particle);
+
+ return definition;
+ }
+
+ private String analyzeType(XSTypeDefinition type, String parentName, String
namespace)
+ {
+ String name;
+ if (type.getAnonymous())
+ name = ">" + parentName;
+ else name = type.getName();
+
+ if (type.getAnonymous())
+ {
+ anonymousTypeMap.put(namespace + ":" + name, type);
+ log.debug("Registered as anon type: {" + namespace + ":"
+ name + "} -> " + type);
+ }
+ return name;
+ }
+
+ private void analyzeSimpleType(XSSimpleTypeDefinition simpleType, String
parentName, String namespace)
+ {
+ analyzeType(simpleType, parentName, namespace);
+ }
+
+ private void analyzeComplexType(XSComplexTypeDefinition complexType, String
parentName, String namespace)
+ {
+ // Prevent reentrancy
+ if (stack.contains(complexType))
+ return;
+
+ stack.add(complexType);
+ String name = analyzeType(complexType, parentName, namespace);
+ analyzeParticle(complexType.getParticle(), name, namespace);
+ stack.remove(complexType);
+ }
+
+ private void analyzeParticle(XSParticle particle, String parentName, String
namespace)
+ {
+ // Is this right, can a particle be null?
+ if (particle == null)
+ return;
+ XSTerm term = particle.getTerm();
+
+ // Is this right, can a term be null?
+ if (term == null)
+ return;
+ switch (term.getType())
+ {
+ case XSConstants.MODEL_GROUP:
+ XSModelGroup group = (XSModelGroup)term;
+ XSObjectList list = group.getParticles();
+ for (int i = 0; i < list.getLength(); i++)
+ analyzeParticle((XSParticle)list.item(i), parentName, namespace);
+ break;
+ case XSConstants.ELEMENT_DECLARATION:
+ XSElementDeclaration decl = (XSElementDeclaration)term;
+ analyzeElement(decl, parentName, namespace, new
Integer(particle.getMinOccurs()), new Integer(particle.getMaxOccurs()));
+ }
+ }
+
+ public XSTypeDefinition getTypeDefinition(String name, String namespace)
+ {
+ // We lazily build this, after the first anonymous type name lookup
+ if (anonymousTypeMap == null)
+ build();
+
+ return anonymousTypeMap.get(namespace + ":" + name);
+ }
+
+ public XSElementDeclaration getElementDeclaration(String name, String namespace)
+ {
+ // We lazily build this, after the first anonymous type name lookup
+ if (anonymousElementMap == null)
+ build();
+
+ return anonymousElementMap.get(namespace + ":" + name);
+ }
+
+ public Map<String, XSElementDeclaration> getElements()
+ {
+ if (anonymousElementMap == null)
+ build();
+
+ // avoid the copy, trust the client
+ return anonymousElementMap;
+ }
+
+ public Map<String, XSTypeDefinition> getTypes()
+ {
+ if (anonymousTypeMap == null)
+ build();
+
+ // avoid the copy, trust the client
+ return anonymousTypeMap;
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModelGroup.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModelGroup.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,109 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.xerces.xs.XSAnnotation;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSModelGroup;
-import org.apache.xerces.xs.XSObjectList;
-
-/**
- * Implements a ModelGroup of the Xerces Schema API
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 21, 2005
- */
-public class JBossXSModelGroup extends JBossXSObject
- implements XSModelGroup
-{
- private JBossXSObjectList xsparts = new JBossXSObjectList();;
- protected short compositor = 0;
-
- /**
- * [compositor]: one of all, choice or sequence. The valid constant values
- * are:
- * <code>COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL</code>.
- */
- public short getCompositor()
- {
- return compositor;
- }
-
- /**
- * A list of [particles] if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getParticles()
- {
- return xsparts;
- }
-
- /**
- * An [annotation] if it exists, otherwise <code>null</code>.
- */
- public XSAnnotation getAnnotation()
- {
- return null;
- }
-
- public void setParticles(List p)
- {
- xsparts = new JBossXSObjectList();
- Iterator iter = p.iterator();
- while (iter.hasNext())
- {
- xsparts.addItem((JBossXSParticle)iter.next());
- }
- }
-
- public void setParticles(List p, boolean shouldSort)
- {
- xsparts = new JBossXSObjectList();
- if(shouldSort)
- setParticles(p);
- else
- {
- Iterator iter = p.iterator();
- while (iter.hasNext())
- {
- xsparts.addItem((JBossXSParticle)iter.next(), false);
- }
- }
-
- }
-
- public void setCompositor(short compositor)
- {
- this.compositor = compositor;
- }
-
- /**
- * Get the type
- */
- @Override
- public short getType()
- {
- return XSConstants.MODEL_GROUP;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModelGroup.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSModelGroup.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,109 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.xerces.xs.XSAnnotation;
+import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSModelGroup;
+import org.apache.xerces.xs.XSObjectList;
+
+/**
+ * Implements a ModelGroup of the Xerces Schema API
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 21, 2005
+ */
+public class JBossXSModelGroup extends JBossXSObject
+ implements XSModelGroup
+{
+ private JBossXSObjectList xsparts = new JBossXSObjectList();;
+ protected short compositor = 0;
+
+ /**
+ * [compositor]: one of all, choice or sequence. The valid constant values
+ * are:
+ * <code>COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL</code>.
+ */
+ public short getCompositor()
+ {
+ return compositor;
+ }
+
+ /**
+ * A list of [particles] if it exists, otherwise an empty
+ * <code>XSObjectList</code>.
+ */
+ public XSObjectList getParticles()
+ {
+ return xsparts;
+ }
+
+ /**
+ * An [annotation] if it exists, otherwise <code>null</code>.
+ */
+ public XSAnnotation getAnnotation()
+ {
+ return null;
+ }
+
+ public void setParticles(List p)
+ {
+ xsparts = new JBossXSObjectList();
+ Iterator iter = p.iterator();
+ while (iter.hasNext())
+ {
+ xsparts.addItem((JBossXSParticle)iter.next());
+ }
+ }
+
+ public void setParticles(List p, boolean shouldSort)
+ {
+ xsparts = new JBossXSObjectList();
+ if(shouldSort)
+ setParticles(p);
+ else
+ {
+ Iterator iter = p.iterator();
+ while (iter.hasNext())
+ {
+ xsparts.addItem((JBossXSParticle)iter.next(), false);
+ }
+ }
+
+ }
+
+ public void setCompositor(short compositor)
+ {
+ this.compositor = compositor;
+ }
+
+ /**
+ * Get the type
+ */
+ @Override
+ public short getType()
+ {
+ return XSConstants.MODEL_GROUP;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamedMap.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamedMap.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamedMap.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,105 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSObject;
-
-/**
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSNamedMap implements XSNamedMap
-{
- protected List<XSObject> list = new ArrayList<XSObject>();
- /**
- * The number of <code>XSObjects</code> in the
<code>XSObjectList</code>.
- * The range of valid child object indices is 0 to <code>length-1</code>
- * inclusive.
- */
- public int getLength()
- {
- return list.size();
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or
equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSObject</code> at the
<code>index</code>th
- * position in the <code>XSObjectList</code>, or
<code>null</code> if
- * the index specified is not valid.
- */
- public XSObject item(int index)
- {
- return (XSObject)list.get(index);
- }
-
- /**
- * Retrieves an <code>XSObject</code> specified by local name and
- * namespace URI.
- * <br>Per XML Namespaces, applications must use the value
<code>null</code> as the
- * <code>namespace</code> parameter for methods if they wish to specify
- * no namespace.
- * @param namespace The namespace URI of the <code>XSObject</code> to
- * retrieve, or <code>null</code> if the
<code>XSObject</code> has no
- * namespace.
- * @param localName The local name of the <code>XSObject</code> to
- * retrieve.
- * @return A <code>XSObject</code> (of any type) with the specified local
- * name and namespace URI, or <code>null</code> if they do not
- * identify any object in this map.
- */
- public XSObject itemByName(String namespace, String localName)
- {
- XSObject xso = null;
- //Since our list may contain types from xerces implementation
- for(XSObject obj: list)
- {
- if(localName.equals(obj.getName()) &&
- namespace.equals(obj.getNamespace()))
- return obj;
- }
-
- return xso;
- }
-
- public void addItem(XSObject obj)
- {
- list.add(obj);
- }
-
- public void addItems(Collection col)
- {
- list.addAll(col);
- }
-
- public List<XSObject> toList()
- {
- return list;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamedMap.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamedMap.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamedMap.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamedMap.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,105 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.xerces.xs.XSNamedMap;
+import org.apache.xerces.xs.XSObject;
+
+/**
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 20, 2005
+ */
+public class JBossXSNamedMap implements XSNamedMap
+{
+ protected List<XSObject> list = new ArrayList<XSObject>();
+ /**
+ * The number of <code>XSObjects</code> in the
<code>XSObjectList</code>.
+ * The range of valid child object indices is 0 to <code>length-1</code>
+ * inclusive.
+ */
+ public int getLength()
+ {
+ return list.size();
+ }
+
+ /**
+ * Returns the <code>index</code>th item in the collection or
+ * <code>null</code> if <code>index</code> is greater than or
equal to
+ * the number of objects in the list. The index starts at 0.
+ * @param index index into the collection.
+ * @return The <code>XSObject</code> at the
<code>index</code>th
+ * position in the <code>XSObjectList</code>, or
<code>null</code> if
+ * the index specified is not valid.
+ */
+ public XSObject item(int index)
+ {
+ return (XSObject)list.get(index);
+ }
+
+ /**
+ * Retrieves an <code>XSObject</code> specified by local name and
+ * namespace URI.
+ * <br>Per XML Namespaces, applications must use the value
<code>null</code> as the
+ * <code>namespace</code> parameter for methods if they wish to specify
+ * no namespace.
+ * @param namespace The namespace URI of the <code>XSObject</code> to
+ * retrieve, or <code>null</code> if the
<code>XSObject</code> has no
+ * namespace.
+ * @param localName The local name of the <code>XSObject</code> to
+ * retrieve.
+ * @return A <code>XSObject</code> (of any type) with the specified local
+ * name and namespace URI, or <code>null</code> if they do not
+ * identify any object in this map.
+ */
+ public XSObject itemByName(String namespace, String localName)
+ {
+ XSObject xso = null;
+ //Since our list may contain types from xerces implementation
+ for(XSObject obj: list)
+ {
+ if(localName.equals(obj.getName()) &&
+ namespace.equals(obj.getNamespace()))
+ return obj;
+ }
+
+ return xso;
+ }
+
+ public void addItem(XSObject obj)
+ {
+ list.add(obj);
+ }
+
+ public void addItems(Collection col)
+ {
+ list.addAll(col);
+ }
+
+ public List<XSObject> toList()
+ {
+ return list;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,496 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSAnnotation;
-import org.apache.xerces.xs.XSAttributeDeclaration;
-import org.apache.xerces.xs.XSAttributeGroupDefinition;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSModelGroupDefinition;
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSNamespaceItem;
-import org.apache.xerces.xs.XSNotationDeclaration;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.xb.binding.NamespaceRegistry;
-
-/**
- * Xerces Schema API Implementation
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSNamespaceItem implements XSNamespaceItem
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXSNamespaceItem.class);
-
- private String schemaNamespace = null;
- private List<String> docLocations = null;
-
- private Map<String,XSAnnotation> anns = new
HashMap<String,XSAnnotation>();
- private Map<String,XSAttributeDeclaration> attrs = new
HashMap<String,XSAttributeDeclaration>();
- private Map<String,XSElementDeclaration> elements = new
HashMap<String,XSElementDeclaration>();
- private Map<String,XSTypeDefinition> types = new
HashMap<String,XSTypeDefinition>();
-
- private boolean qualifiedElements = false;
-
- private NamespaceRegistry namespaceRegistry;
-
- public JBossXSNamespaceItem(String ns, NamespaceRegistry namespaceRegistry, boolean
qualifiedElements)
- {
- this.schemaNamespace = ns;
- this.namespaceRegistry = namespaceRegistry;
- this.qualifiedElements = qualifiedElements;
- }
-
- /**
- * [schema namespace]: A namespace name or <code>null</code> if absent.
- */
- public String getSchemaNamespace()
- {
- return schemaNamespace;
- }
-
- /**
- * [schema components]: a list of top-level components, i.e. element
- * declarations, attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>. Note that
- * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
- * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
- * <code>objectType</code> to retrieve only complex types or simple
- * types, instead of all types.
- * @return A list of top-level definition of the specified type in
- * <code>objectType</code> or an empty
<code>XSNamedMap</code> if no
- * such definitions exist.
- */
- public XSNamedMap getComponents(short objectType)
- {
- JBossXSNamedMap jbnm = new JBossXSNamedMap();
- if(objectType == XSConstants.ELEMENT_DECLARATION && elements.size() >
0)
- jbnm.addItems(elements.values());
- else
- {
- if(objectType == XSConstants.ATTRIBUTE_DECLARATION && attrs.size() >
0)
- {
- jbnm.addItems(attrs.values());
- }
- else
- if(objectType == XSConstants.TYPE_DEFINITION && types.size() > 0)
- {
- jbnm.addItems(types.values());
- }
- else
- if(objectType == XSTypeDefinition.COMPLEX_TYPE)
- {
- Collection col = types.values();
- jbnm.addItems(getTypes(col,XSTypeDefinition.COMPLEX_TYPE));
- }
- else
- if(objectType == XSTypeDefinition.SIMPLE_TYPE)
- {
- Collection col = types.values();
- jbnm.addItems(getTypes(col,XSTypeDefinition.SIMPLE_TYPE));
- }
- }
-
- return jbnm;
- }
-
- /**
- * [annotations]: a set of annotations if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations()
- {
- List lst = new ArrayList();
- lst.addAll(anns.values());
- return new JBossXSObjectList(lst);
- }
-
- /**
- * Convenience method. Returns a top-level element declaration.
- * @param name The name of the declaration.
- * @return A top-level element declaration or <code>null</code> if such a
- * declaration does not exist.
- */
- public XSElementDeclaration getElementDeclaration(String name)
- {
- JBossXSElementDeclaration jbe = null;
- //Ensure we return JBossXSElementDeclaration
- if(elements != null)
- {
- XSElementDeclaration xe = elements.get(name);
- if(xe != null && !(xe instanceof JBossXSElementDeclaration))
- jbe = new JBossXSElementDeclaration(xe);
- else
- return xe;
- }
- return jbe;
- }
-
- /**
- * Convenience method. Returns a top-level attribute declaration.
- * @param name The name of the declaration.
- * @return A top-level attribute declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSAttributeDeclaration getAttributeDeclaration(String name)
- {
- if(attrs != null) return attrs.get(name);
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level simple or complex type
- * definition.
- * @param name The name of the definition.
- * @return An <code>XSTypeDefinition</code> or
<code>null</code> if such
- * a definition does not exist.
- */
- public XSTypeDefinition getTypeDefinition(String name)
- {
- if(types != null) return types.get(name);
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level attribute group definition.
- * @param name The name of the definition.
- * @return A top-level attribute group definition or <code>null</code> if
- * such a definition does not exist.
- */
- public XSAttributeGroupDefinition getAttributeGroup(String name)
- {
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level model group definition.
- * @param name The name of the definition.
- * @return A top-level model group definition definition or
- * <code>null</code> if such a definition does not exist.
- */
- public XSModelGroupDefinition getModelGroupDefinition(String name)
- {
- return null;
- }
-
- /**
- * Convenience method. Returns a top-level notation declaration.
- * @param name The name of the declaration.
- * @return A top-level notation declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSNotationDeclaration getNotationDeclaration(String name)
- {
- return null;
- }
-
- /**
- * [document location] - a list of location URIs for the documents that
- * contributed to the <code>XSModel</code>.
- */
- public StringList getDocumentLocations()
- {
- if(docLocations == null) return new JBossXSStringList();
- JBossXSStringList strList = new JBossXSStringList(docLocations);
- return strList;
- }
-
- //Setters
-
- //Custom methods
- public void addDocumentLocation(String uri)
- {
- if(docLocations == null)
- docLocations = new ArrayList<String>();
- docLocations.add(uri);
- }
-
- public void addDocumentLocations(List<String> uri)
- {
- if(docLocations == null)
- docLocations = new ArrayList<String>();
- docLocations.addAll(uri);
- }
-
- /**
- * Add an XSAnnotation
- */
- public void addXSAnnotation(XSAnnotation xa)
- {
- if(xa == null)
- throw new IllegalArgumentException("Illegal Null Argument:xa");
- anns.put(xa.getName(),xa);
- }
-
- /**
- * Add an XSAttributeDeclaration
- */
- public void addXSAttributeDeclaration(XSAttributeDeclaration att)
- {
- if(att == null)
- throw new IllegalArgumentException("att is null");
- attrs.put(att.getName(),att);
- }
-
- /**
- * Add an XSElementDeclaration
- * @param el
- */
- public void addXSElementDeclaration(XSElementDeclaration el)
- {
- if(el == null)
- throw new IllegalArgumentException("Element is null");
- elements.put(el.getName(),el);
- }
-
- /**
- * Add an XSTypeDefinition
- * @param xsType
- */
- public void addXSTypeDefinition(XSTypeDefinition xsType)
- {
- if(xsType == null)
- throw new IllegalArgumentException("type is null");
-
- String xsTypeName = xsType.getName();
- log.trace("addXSTypeDefinition: " + xsTypeName);
-
- types.put(xsTypeName,xsType);
- }
-
-
- /**
- * Overrides the toString method
- */
- @Override
- public String toString()
- {
- /*
- * FIXME - The SOAP Encoding namespace handling should be revisited. This
- * routine should really operate purely off of the registry, instead of
- * printing constant declarations, and having to double check that the
- * registry does not contain them.
- *
- * This order is currently maintained to preserve the format of the
- * generated schema files in the test harness.
- */
- if(isEmpty()) return "";
-
- WSSchemaUtils sutils = WSSchemaUtils.getInstance(namespaceRegistry,
schemaNamespace);
-
- StringBuilder buffer = new StringBuilder();
- buffer.append( "<schema targetNamespace='" + schemaNamespace +
"'");
- buffer.append(" xmlns:" + Constants.PREFIX_SOAP11_ENC +
"='" + Constants.URI_SOAP11_ENC + "'");
- // XML Namespace can only be assigned to the XML prefix
- if (! schemaNamespace.equals(Constants.NS_XML))
- buffer.append(" xmlns:" + Constants.PREFIX_TNS + "='" +
schemaNamespace + "'");
- buffer.append(" xmlns:" + Constants.PREFIX_XSI + "='" +
Constants.NS_SCHEMA_XSI + "'");
- buffer.append(" xmlns='" + Constants.NS_SCHEMA_XSD +
"'");
-
- //Append any custom prefixes
- Iterator iter = namespaceRegistry.getRegisteredPrefixes();
- while (iter.hasNext())
- {
- String prefix = (String) iter.next();
- String ns = namespaceRegistry.getNamespaceURI(prefix);
- if (ns.equals(schemaNamespace) && ns.equals(Constants.NS_XML) == false)
- continue;
- if (ns.equals(Constants.URI_SOAP11_ENC))
- continue;
- if (ns.equals(Constants.NS_SCHEMA_XSI))
- continue;
- buffer.append(" xmlns:" + prefix + "='" + ns
+"'");
- }
-
- if (qualifiedElements)
- buffer.append(" elementFormDefault='qualified'");
-
- buffer.append(">");
-
- //Write the import namespaces
- iter = namespaceRegistry.getRegisteredURIs();
- while (iter.hasNext())
- {
- String ns = (String) iter.next();
- if (ns.equals(schemaNamespace))
- continue;
- if (ns.equals(Constants.URI_SOAP11_ENC))
- continue;
- if (ns.equals(Constants.NS_SCHEMA_XSI))
- continue;
- buffer.append("<import namespace='" + ns +
"'/>");
- }
-
- //Sort the types
- //TreeSet<String> treeset = new TreeSet<String>(types.keySet());
- TreeSet<String> treeset = new TreeSet<String>(new XSComparator());
- treeset.addAll(types.keySet());
- for(String key: treeset)
- {
- buffer.append(sutils.write(types.get(key)));
- }
-
- // Serialize the elements
- //treeset = new TreeSet<String>(elements.keySet());
- treeset = new TreeSet<String>(new XSComparator());
- treeset.addAll(elements.keySet());
- for( String key: treeset)
- {
- buffer.append(sutils.write(elements.get(key) ));
- }
- buffer.append("</schema>");
- return buffer.toString();
- }
-
- public void merge(JBossXSNamespaceItem nsi)
- {
- //Merge the attributes
- JBossXSNamedMap nmap =
(JBossXSNamedMap)nsi.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
- int len = nmap.getLength();
- for(int i=0;i<len;i++)
- {
- XSAttributeDeclaration xatt = (XSAttributeDeclaration)nmap.item(i);
- this.addXSAttributeDeclaration(xatt);
- }
-
- //Merge the types
- nmap = (JBossXSNamedMap)nsi.getComponents(XSConstants.TYPE_DEFINITION);
- len = nmap.getLength();
- for(int i=0;i<len;i++)
- {
- XSTypeDefinition xt = (XSTypeDefinition)nmap.item(i);
- this.addXSTypeDefinition(xt);
- }
-
- // Merge the elements
- nmap = (JBossXSNamedMap)nsi.getComponents(XSConstants.ELEMENT_DECLARATION);
- len = nmap.getLength();
- for(int i=0;i<len;i++)
- {
- XSElementDeclaration xe = (XSElementDeclaration)nmap.item(i);
- this.addXSElementDeclaration(xe);
- }
- }
-
- /**
- * Delete a XSTypeDefinition
- *
- * @param xst
- */
- public void removeXSTypeDefinition(XSTypeDefinition xst)
- {
- String name = xst.getName();
- types.remove(name);
- }
-
- /**
- * Delete a XSTypeDefinition
- *
- * @param xst
- */
- public void removeXSElementDeclaration(XSElementDeclaration xel)
- {
- String name = xel.getName();
- elements.remove(name);
- }
-
- public boolean isQualifiedElements()
- {
- return qualifiedElements;
- }
-
- public void setQualifiedElements(boolean qualifiedElements)
- {
- this.qualifiedElements = qualifiedElements;
- }
-
- public NamespaceRegistry getNamespaceRegistry()
- {
- return namespaceRegistry;
- }
-
- public void setNamespaceRegistry(NamespaceRegistry namespaceRegistry)
- {
- this.namespaceRegistry = namespaceRegistry;
- }
-
- //PRIVATE METHODS
- private Collection getTypes(Collection col, short objectType)
- {
- if(objectType != XSTypeDefinition.SIMPLE_TYPE && objectType !=
XSTypeDefinition.COMPLEX_TYPE)
- throw new IllegalArgumentException("objectType should be simple type or
complex type");
- Collection values = new ArrayList();
- for(Object obj : col)
- {
- if(objectType == XSTypeDefinition.COMPLEX_TYPE &&
- obj instanceof XSComplexTypeDefinition )
- values.add(obj);
- else
- if(objectType == XSTypeDefinition.SIMPLE_TYPE &&
- obj instanceof XSSimpleTypeDefinition )
- values.add(obj);
- }
- return values;
- }
-
- private boolean isEmpty()
- {
- boolean bool = true;
- if(attrs.size() > 0) return false;
- if(types.size() > 0 ) return false;
- if(elements.size()>0) return false;
- return bool;
- }
-
- private class XSComparator implements Comparator
- {
- public int compare(Object arg0, Object arg1)
- {
- String str1 = (String)arg0;
- String str2 = (String)arg1;
-
- if(Character.isUpperCase(str1.charAt(0))
- && Character.isLowerCase(str2.charAt(0)) )
- return 1;
- return str1.compareTo(str2);
- }
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,496 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.xerces.xs.StringList;
+import org.apache.xerces.xs.XSAnnotation;
+import org.apache.xerces.xs.XSAttributeDeclaration;
+import org.apache.xerces.xs.XSAttributeGroupDefinition;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSModelGroupDefinition;
+import org.apache.xerces.xs.XSNamedMap;
+import org.apache.xerces.xs.XSNamespaceItem;
+import org.apache.xerces.xs.XSNotationDeclaration;
+import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.xb.binding.NamespaceRegistry;
+
+/**
+ * Xerces Schema API Implementation
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 20, 2005
+ */
+public class JBossXSNamespaceItem implements XSNamespaceItem
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(JBossXSNamespaceItem.class);
+
+ private String schemaNamespace = null;
+ private List<String> docLocations = null;
+
+ private Map<String,XSAnnotation> anns = new
HashMap<String,XSAnnotation>();
+ private Map<String,XSAttributeDeclaration> attrs = new
HashMap<String,XSAttributeDeclaration>();
+ private Map<String,XSElementDeclaration> elements = new
HashMap<String,XSElementDeclaration>();
+ private Map<String,XSTypeDefinition> types = new
HashMap<String,XSTypeDefinition>();
+
+ private boolean qualifiedElements = false;
+
+ private NamespaceRegistry namespaceRegistry;
+
+ public JBossXSNamespaceItem(String ns, NamespaceRegistry namespaceRegistry, boolean
qualifiedElements)
+ {
+ this.schemaNamespace = ns;
+ this.namespaceRegistry = namespaceRegistry;
+ this.qualifiedElements = qualifiedElements;
+ }
+
+ /**
+ * [schema namespace]: A namespace name or <code>null</code> if absent.
+ */
+ public String getSchemaNamespace()
+ {
+ return schemaNamespace;
+ }
+
+ /**
+ * [schema components]: a list of top-level components, i.e. element
+ * declarations, attribute declarations, etc.
+ * @param objectType The type of the declaration, i.e.
+ * <code>ELEMENT_DECLARATION</code>. Note that
+ * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
+ * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
+ * <code>objectType</code> to retrieve only complex types or simple
+ * types, instead of all types.
+ * @return A list of top-level definition of the specified type in
+ * <code>objectType</code> or an empty
<code>XSNamedMap</code> if no
+ * such definitions exist.
+ */
+ public XSNamedMap getComponents(short objectType)
+ {
+ JBossXSNamedMap jbnm = new JBossXSNamedMap();
+ if(objectType == XSConstants.ELEMENT_DECLARATION && elements.size() >
0)
+ jbnm.addItems(elements.values());
+ else
+ {
+ if(objectType == XSConstants.ATTRIBUTE_DECLARATION && attrs.size() >
0)
+ {
+ jbnm.addItems(attrs.values());
+ }
+ else
+ if(objectType == XSConstants.TYPE_DEFINITION && types.size() > 0)
+ {
+ jbnm.addItems(types.values());
+ }
+ else
+ if(objectType == XSTypeDefinition.COMPLEX_TYPE)
+ {
+ Collection col = types.values();
+ jbnm.addItems(getTypes(col,XSTypeDefinition.COMPLEX_TYPE));
+ }
+ else
+ if(objectType == XSTypeDefinition.SIMPLE_TYPE)
+ {
+ Collection col = types.values();
+ jbnm.addItems(getTypes(col,XSTypeDefinition.SIMPLE_TYPE));
+ }
+ }
+
+ return jbnm;
+ }
+
+ /**
+ * [annotations]: a set of annotations if it exists, otherwise an empty
+ * <code>XSObjectList</code>.
+ */
+ public XSObjectList getAnnotations()
+ {
+ List lst = new ArrayList();
+ lst.addAll(anns.values());
+ return new JBossXSObjectList(lst);
+ }
+
+ /**
+ * Convenience method. Returns a top-level element declaration.
+ * @param name The name of the declaration.
+ * @return A top-level element declaration or <code>null</code> if such a
+ * declaration does not exist.
+ */
+ public XSElementDeclaration getElementDeclaration(String name)
+ {
+ JBossXSElementDeclaration jbe = null;
+ //Ensure we return JBossXSElementDeclaration
+ if(elements != null)
+ {
+ XSElementDeclaration xe = elements.get(name);
+ if(xe != null && !(xe instanceof JBossXSElementDeclaration))
+ jbe = new JBossXSElementDeclaration(xe);
+ else
+ return xe;
+ }
+ return jbe;
+ }
+
+ /**
+ * Convenience method. Returns a top-level attribute declaration.
+ * @param name The name of the declaration.
+ * @return A top-level attribute declaration or <code>null</code> if such
+ * a declaration does not exist.
+ */
+ public XSAttributeDeclaration getAttributeDeclaration(String name)
+ {
+ if(attrs != null) return attrs.get(name);
+ return null;
+ }
+
+ /**
+ * Convenience method. Returns a top-level simple or complex type
+ * definition.
+ * @param name The name of the definition.
+ * @return An <code>XSTypeDefinition</code> or
<code>null</code> if such
+ * a definition does not exist.
+ */
+ public XSTypeDefinition getTypeDefinition(String name)
+ {
+ if(types != null) return types.get(name);
+ return null;
+ }
+
+ /**
+ * Convenience method. Returns a top-level attribute group definition.
+ * @param name The name of the definition.
+ * @return A top-level attribute group definition or <code>null</code> if
+ * such a definition does not exist.
+ */
+ public XSAttributeGroupDefinition getAttributeGroup(String name)
+ {
+ return null;
+ }
+
+ /**
+ * Convenience method. Returns a top-level model group definition.
+ * @param name The name of the definition.
+ * @return A top-level model group definition definition or
+ * <code>null</code> if such a definition does not exist.
+ */
+ public XSModelGroupDefinition getModelGroupDefinition(String name)
+ {
+ return null;
+ }
+
+ /**
+ * Convenience method. Returns a top-level notation declaration.
+ * @param name The name of the declaration.
+ * @return A top-level notation declaration or <code>null</code> if such
+ * a declaration does not exist.
+ */
+ public XSNotationDeclaration getNotationDeclaration(String name)
+ {
+ return null;
+ }
+
+ /**
+ * [document location] - a list of location URIs for the documents that
+ * contributed to the <code>XSModel</code>.
+ */
+ public StringList getDocumentLocations()
+ {
+ if(docLocations == null) return new JBossXSStringList();
+ JBossXSStringList strList = new JBossXSStringList(docLocations);
+ return strList;
+ }
+
+ //Setters
+
+ //Custom methods
+ public void addDocumentLocation(String uri)
+ {
+ if(docLocations == null)
+ docLocations = new ArrayList<String>();
+ docLocations.add(uri);
+ }
+
+ public void addDocumentLocations(List<String> uri)
+ {
+ if(docLocations == null)
+ docLocations = new ArrayList<String>();
+ docLocations.addAll(uri);
+ }
+
+ /**
+ * Add an XSAnnotation
+ */
+ public void addXSAnnotation(XSAnnotation xa)
+ {
+ if(xa == null)
+ throw new IllegalArgumentException("Illegal Null Argument:xa");
+ anns.put(xa.getName(),xa);
+ }
+
+ /**
+ * Add an XSAttributeDeclaration
+ */
+ public void addXSAttributeDeclaration(XSAttributeDeclaration att)
+ {
+ if(att == null)
+ throw new IllegalArgumentException("att is null");
+ attrs.put(att.getName(),att);
+ }
+
+ /**
+ * Add an XSElementDeclaration
+ * @param el
+ */
+ public void addXSElementDeclaration(XSElementDeclaration el)
+ {
+ if(el == null)
+ throw new IllegalArgumentException("Element is null");
+ elements.put(el.getName(),el);
+ }
+
+ /**
+ * Add an XSTypeDefinition
+ * @param xsType
+ */
+ public void addXSTypeDefinition(XSTypeDefinition xsType)
+ {
+ if(xsType == null)
+ throw new IllegalArgumentException("type is null");
+
+ String xsTypeName = xsType.getName();
+ log.trace("addXSTypeDefinition: " + xsTypeName);
+
+ types.put(xsTypeName,xsType);
+ }
+
+
+ /**
+ * Overrides the toString method
+ */
+ @Override
+ public String toString()
+ {
+ /*
+ * FIXME - The SOAP Encoding namespace handling should be revisited. This
+ * routine should really operate purely off of the registry, instead of
+ * printing constant declarations, and having to double check that the
+ * registry does not contain them.
+ *
+ * This order is currently maintained to preserve the format of the
+ * generated schema files in the test harness.
+ */
+ if(isEmpty()) return "";
+
+ WSSchemaUtils sutils = WSSchemaUtils.getInstance(namespaceRegistry,
schemaNamespace);
+
+ StringBuilder buffer = new StringBuilder();
+ buffer.append( "<schema targetNamespace='" + schemaNamespace +
"'");
+ buffer.append(" xmlns:" + Constants.PREFIX_SOAP11_ENC +
"='" + Constants.URI_SOAP11_ENC + "'");
+ // XML Namespace can only be assigned to the XML prefix
+ if (! schemaNamespace.equals(Constants.NS_XML))
+ buffer.append(" xmlns:" + Constants.PREFIX_TNS + "='" +
schemaNamespace + "'");
+ buffer.append(" xmlns:" + Constants.PREFIX_XSI + "='" +
Constants.NS_SCHEMA_XSI + "'");
+ buffer.append(" xmlns='" + Constants.NS_SCHEMA_XSD +
"'");
+
+ //Append any custom prefixes
+ Iterator iter = namespaceRegistry.getRegisteredPrefixes();
+ while (iter.hasNext())
+ {
+ String prefix = (String) iter.next();
+ String ns = namespaceRegistry.getNamespaceURI(prefix);
+ if (ns.equals(schemaNamespace) && ns.equals(Constants.NS_XML) == false)
+ continue;
+ if (ns.equals(Constants.URI_SOAP11_ENC))
+ continue;
+ if (ns.equals(Constants.NS_SCHEMA_XSI))
+ continue;
+ buffer.append(" xmlns:" + prefix + "='" + ns
+"'");
+ }
+
+ if (qualifiedElements)
+ buffer.append(" elementFormDefault='qualified'");
+
+ buffer.append(">");
+
+ //Write the import namespaces
+ iter = namespaceRegistry.getRegisteredURIs();
+ while (iter.hasNext())
+ {
+ String ns = (String) iter.next();
+ if (ns.equals(schemaNamespace))
+ continue;
+ if (ns.equals(Constants.URI_SOAP11_ENC))
+ continue;
+ if (ns.equals(Constants.NS_SCHEMA_XSI))
+ continue;
+ buffer.append("<import namespace='" + ns +
"'/>");
+ }
+
+ //Sort the types
+ //TreeSet<String> treeset = new TreeSet<String>(types.keySet());
+ TreeSet<String> treeset = new TreeSet<String>(new XSComparator());
+ treeset.addAll(types.keySet());
+ for(String key: treeset)
+ {
+ buffer.append(sutils.write(types.get(key)));
+ }
+
+ // Serialize the elements
+ //treeset = new TreeSet<String>(elements.keySet());
+ treeset = new TreeSet<String>(new XSComparator());
+ treeset.addAll(elements.keySet());
+ for( String key: treeset)
+ {
+ buffer.append(sutils.write(elements.get(key) ));
+ }
+ buffer.append("</schema>");
+ return buffer.toString();
+ }
+
+ public void merge(JBossXSNamespaceItem nsi)
+ {
+ //Merge the attributes
+ JBossXSNamedMap nmap =
(JBossXSNamedMap)nsi.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
+ int len = nmap.getLength();
+ for(int i=0;i<len;i++)
+ {
+ XSAttributeDeclaration xatt = (XSAttributeDeclaration)nmap.item(i);
+ this.addXSAttributeDeclaration(xatt);
+ }
+
+ //Merge the types
+ nmap = (JBossXSNamedMap)nsi.getComponents(XSConstants.TYPE_DEFINITION);
+ len = nmap.getLength();
+ for(int i=0;i<len;i++)
+ {
+ XSTypeDefinition xt = (XSTypeDefinition)nmap.item(i);
+ this.addXSTypeDefinition(xt);
+ }
+
+ // Merge the elements
+ nmap = (JBossXSNamedMap)nsi.getComponents(XSConstants.ELEMENT_DECLARATION);
+ len = nmap.getLength();
+ for(int i=0;i<len;i++)
+ {
+ XSElementDeclaration xe = (XSElementDeclaration)nmap.item(i);
+ this.addXSElementDeclaration(xe);
+ }
+ }
+
+ /**
+ * Delete a XSTypeDefinition
+ *
+ * @param xst
+ */
+ public void removeXSTypeDefinition(XSTypeDefinition xst)
+ {
+ String name = xst.getName();
+ types.remove(name);
+ }
+
+ /**
+ * Delete a XSTypeDefinition
+ *
+ * @param xst
+ */
+ public void removeXSElementDeclaration(XSElementDeclaration xel)
+ {
+ String name = xel.getName();
+ elements.remove(name);
+ }
+
+ public boolean isQualifiedElements()
+ {
+ return qualifiedElements;
+ }
+
+ public void setQualifiedElements(boolean qualifiedElements)
+ {
+ this.qualifiedElements = qualifiedElements;
+ }
+
+ public NamespaceRegistry getNamespaceRegistry()
+ {
+ return namespaceRegistry;
+ }
+
+ public void setNamespaceRegistry(NamespaceRegistry namespaceRegistry)
+ {
+ this.namespaceRegistry = namespaceRegistry;
+ }
+
+ //PRIVATE METHODS
+ private Collection getTypes(Collection col, short objectType)
+ {
+ if(objectType != XSTypeDefinition.SIMPLE_TYPE && objectType !=
XSTypeDefinition.COMPLEX_TYPE)
+ throw new IllegalArgumentException("objectType should be simple type or
complex type");
+ Collection values = new ArrayList();
+ for(Object obj : col)
+ {
+ if(objectType == XSTypeDefinition.COMPLEX_TYPE &&
+ obj instanceof XSComplexTypeDefinition )
+ values.add(obj);
+ else
+ if(objectType == XSTypeDefinition.SIMPLE_TYPE &&
+ obj instanceof XSSimpleTypeDefinition )
+ values.add(obj);
+ }
+ return values;
+ }
+
+ private boolean isEmpty()
+ {
+ boolean bool = true;
+ if(attrs.size() > 0) return false;
+ if(types.size() > 0 ) return false;
+ if(elements.size()>0) return false;
+ return bool;
+ }
+
+ private class XSComparator implements Comparator
+ {
+ public int compare(Object arg0, Object arg1)
+ {
+ String str1 = (String)arg0;
+ String str2 = (String)arg1;
+
+ if(Character.isUpperCase(str1.charAt(0))
+ && Character.isLowerCase(str2.charAt(0)) )
+ return 1;
+ return str1.compareTo(str2);
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,85 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.xerces.xs.XSNamespaceItem;
-import org.apache.xerces.xs.XSNamespaceItemList;
-
-/**
- *
- *
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSNamespaceItemList implements XSNamespaceItemList
-{
- protected List xsnsList = new ArrayList();
-
- public JBossXSNamespaceItemList()
- {
- super();
- }
-
- public JBossXSNamespaceItemList(List list)
- {
- super();
- xsnsList = list;
- }
-
- public JBossXSNamespaceItemList(Collection col)
- {
- super();
- xsnsList.addAll(col);
- }
-
- /**
- * The number of <code>XSNamespaceItem</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength()
- {
- return xsnsList.size();
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or
equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSNamespaceItem</code> at the
<code>index</code>th
- * position in the <code>XSNamespaceItemList</code>, or
- * <code>null</code> if the index specified is not valid.
- */
- public XSNamespaceItem item(int index)
- {
- return (XSNamespaceItem)xsnsList.get(index);
- }
-
- public void addItem(XSNamespaceItem item)
- {
- xsnsList.add(item);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSNamespaceItemList.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,85 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.xerces.xs.XSNamespaceItem;
+import org.apache.xerces.xs.XSNamespaceItemList;
+
+/**
+ *
+ *
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 20, 2005
+ */
+public class JBossXSNamespaceItemList implements XSNamespaceItemList
+{
+ protected List xsnsList = new ArrayList();
+
+ public JBossXSNamespaceItemList()
+ {
+ super();
+ }
+
+ public JBossXSNamespaceItemList(List list)
+ {
+ super();
+ xsnsList = list;
+ }
+
+ public JBossXSNamespaceItemList(Collection col)
+ {
+ super();
+ xsnsList.addAll(col);
+ }
+
+ /**
+ * The number of <code>XSNamespaceItem</code>s in the list. The range of
+ * valid child object indices is 0 to <code>length-1</code> inclusive.
+ */
+ public int getLength()
+ {
+ return xsnsList.size();
+ }
+
+ /**
+ * Returns the <code>index</code>th item in the collection or
+ * <code>null</code> if <code>index</code> is greater than or
equal to
+ * the number of objects in the list. The index starts at 0.
+ * @param index index into the collection.
+ * @return The <code>XSNamespaceItem</code> at the
<code>index</code>th
+ * position in the <code>XSNamespaceItemList</code>, or
+ * <code>null</code> if the index specified is not valid.
+ */
+ public XSNamespaceItem item(int index)
+ {
+ return (XSNamespaceItem)xsnsList.get(index);
+ }
+
+ public void addItem(XSNamespaceItem item)
+ {
+ xsnsList.add(item);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObject.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObject.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObject.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,133 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import org.apache.xerces.xs.XSNamespaceItem;
-import org.apache.xerces.xs.XSObject;
-
-/**
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSObject implements XSObject
-{
- protected String name;
- protected String namespace;
- private String prefix;
- private XSNamespaceItem xsNSItem;
- private short type;
-
- public JBossXSObject()
- {
-
- }
-
- public JBossXSObject(String name, String namespace)
- {
- this.name = name;
- this.namespace = namespace;
- }
-
- /**
- * The <code>type</code> of this object, i.e.
- * <code>ELEMENT_DECLARATION</code>.
- */
- public short getType()
- {
- return type;
- }
-
- /**
- * The name of type <code>NCName</code>, as defined in XML Namespaces, of
- * this declaration specified in the <code>{name}</code> property of the
- * component or <code>null</code> if the definition of this component
- * does not have a <code>{name}</code> property. For anonymous types,
- * the processor must construct and expose an anonymous type name that
- * is distinct from the name of every named type and the name of every
- * other anonymous type.
- */
- public String getName()
- {
- return name;
- }
-
- public void setName(String n)
- {
- name = n;
- }
-
- /**
- * The [target namespace] of this object, or <code>null</code> if it is
- * unspecified.
- */
- public String getNamespace()
- {
- return namespace;
- }
-
- public void setNamespace(String namespace)
- {
- this.namespace = namespace;
- }
-
- /**
- * A namespace schema information item corresponding to the target
- * namespace of the component, if it is globally declared; or
- * <code>null</code> otherwise.
- */
- public XSNamespaceItem getNamespaceItem()
- {
- return xsNSItem;
- }
-
- public void setNamespaceItem(XSNamespaceItem xsNSItem)
- {
- this.xsNSItem = xsNSItem;
- }
-
- public void setType(short t)
- {
- type = t;
- }
-
- public boolean equals(Object o)
- {
- if (this == o) return true;
- if (!(o instanceof JBossXSObject)) return false;
-
- final JBossXSObject jBossXSObject = (JBossXSObject)o;
-
- if (name != null ? !name.equals(jBossXSObject.name) : jBossXSObject.name != null)
return false;
- if (namespace != null ? !namespace.equals(jBossXSObject.namespace) :
jBossXSObject.namespace != null) return false;
-
- return true;
- }
-
- public int hashCode()
- {
- int result;
- result = (name != null ? name.hashCode() : 0);
- result = 29 * result + (namespace != null ? namespace.hashCode() : 0);
- return result;
- }
-
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObject.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObject.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObject.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObject.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,133 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import org.apache.xerces.xs.XSNamespaceItem;
+import org.apache.xerces.xs.XSObject;
+
+/**
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 20, 2005
+ */
+public class JBossXSObject implements XSObject
+{
+ protected String name;
+ protected String namespace;
+ private String prefix;
+ private XSNamespaceItem xsNSItem;
+ private short type;
+
+ public JBossXSObject()
+ {
+
+ }
+
+ public JBossXSObject(String name, String namespace)
+ {
+ this.name = name;
+ this.namespace = namespace;
+ }
+
+ /**
+ * The <code>type</code> of this object, i.e.
+ * <code>ELEMENT_DECLARATION</code>.
+ */
+ public short getType()
+ {
+ return type;
+ }
+
+ /**
+ * The name of type <code>NCName</code>, as defined in XML Namespaces, of
+ * this declaration specified in the <code>{name}</code> property of the
+ * component or <code>null</code> if the definition of this component
+ * does not have a <code>{name}</code> property. For anonymous types,
+ * the processor must construct and expose an anonymous type name that
+ * is distinct from the name of every named type and the name of every
+ * other anonymous type.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String n)
+ {
+ name = n;
+ }
+
+ /**
+ * The [target namespace] of this object, or <code>null</code> if it is
+ * unspecified.
+ */
+ public String getNamespace()
+ {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace)
+ {
+ this.namespace = namespace;
+ }
+
+ /**
+ * A namespace schema information item corresponding to the target
+ * namespace of the component, if it is globally declared; or
+ * <code>null</code> otherwise.
+ */
+ public XSNamespaceItem getNamespaceItem()
+ {
+ return xsNSItem;
+ }
+
+ public void setNamespaceItem(XSNamespaceItem xsNSItem)
+ {
+ this.xsNSItem = xsNSItem;
+ }
+
+ public void setType(short t)
+ {
+ type = t;
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (!(o instanceof JBossXSObject)) return false;
+
+ final JBossXSObject jBossXSObject = (JBossXSObject)o;
+
+ if (name != null ? !name.equals(jBossXSObject.name) : jBossXSObject.name != null)
return false;
+ if (namespace != null ? !namespace.equals(jBossXSObject.namespace) :
jBossXSObject.namespace != null) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (name != null ? name.hashCode() : 0);
+ result = 29 * result + (namespace != null ? namespace.hashCode() : 0);
+ return result;
+ }
+
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObjectList.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObjectList.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObjectList.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,106 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.xerces.xs.XSObject;
-import org.apache.xerces.xs.XSObjectList;
-
-/**
- * Xerces Schema API
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSObjectList implements XSObjectList
-{
- protected List list = new ArrayList();
-
- public JBossXSObjectList()
- {
- }
-
- public JBossXSObjectList(List lst)
- {
- this.list = lst;
- }
-
-
- /**
- * The number of <code>XSObjects</code> in the list. The range of valid
- * child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength()
- {
- int len = list.size();
- return len;
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or
equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSObject</code> at the
<code>index</code>th
- * position in the <code>XSObjectList</code>, or
<code>null</code> if
- * the index specified is not valid.
- */
- public XSObject item(int index)
- {
- return (XSObject)list.get(index);
- }
-
- public void addItem(XSObject xsobj)
- {
- list.add(xsobj);
- }
-
- public void addItem(XSObject xsobj, boolean shouldSort)
- {
- if(shouldSort)
- addItem(xsobj);
- else
- list.add(xsobj);
- }
-
- //CUSTOM METHODS
- public void addObjects(XSObjectList lst)
- {
- if(lst instanceof JBossXSObjectList)
- list.addAll(((JBossXSObjectList)lst).toList());
- else
- {
- int len = lst != null ? lst.getLength() : 0 ;
- for(int i=0; i < len; i++)
- {
- list.add(lst.item(i));
- }
- }
- }
-
- public List toList()
- {
- return list;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObjectList.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObjectList.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSObjectList.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSObjectList.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,106 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.xerces.xs.XSObject;
+import org.apache.xerces.xs.XSObjectList;
+
+/**
+ * Xerces Schema API
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 20, 2005
+ */
+public class JBossXSObjectList implements XSObjectList
+{
+ protected List list = new ArrayList();
+
+ public JBossXSObjectList()
+ {
+ }
+
+ public JBossXSObjectList(List lst)
+ {
+ this.list = lst;
+ }
+
+
+ /**
+ * The number of <code>XSObjects</code> in the list. The range of valid
+ * child object indices is 0 to <code>length-1</code> inclusive.
+ */
+ public int getLength()
+ {
+ int len = list.size();
+ return len;
+ }
+
+ /**
+ * Returns the <code>index</code>th item in the collection or
+ * <code>null</code> if <code>index</code> is greater than or
equal to
+ * the number of objects in the list. The index starts at 0.
+ * @param index index into the collection.
+ * @return The <code>XSObject</code> at the
<code>index</code>th
+ * position in the <code>XSObjectList</code>, or
<code>null</code> if
+ * the index specified is not valid.
+ */
+ public XSObject item(int index)
+ {
+ return (XSObject)list.get(index);
+ }
+
+ public void addItem(XSObject xsobj)
+ {
+ list.add(xsobj);
+ }
+
+ public void addItem(XSObject xsobj, boolean shouldSort)
+ {
+ if(shouldSort)
+ addItem(xsobj);
+ else
+ list.add(xsobj);
+ }
+
+ //CUSTOM METHODS
+ public void addObjects(XSObjectList lst)
+ {
+ if(lst instanceof JBossXSObjectList)
+ list.addAll(((JBossXSObjectList)lst).toList());
+ else
+ {
+ int len = lst != null ? lst.getLength() : 0 ;
+ for(int i=0; i < len; i++)
+ {
+ list.add(lst.item(i));
+ }
+ }
+ }
+
+ public List toList()
+ {
+ return list;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSParticle.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSParticle.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,132 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSTerm;
-
-/**
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 21, 2005
- */
-public class JBossXSParticle
- extends JBossXSObject implements XSParticle, Comparable
-{
- protected int minOccurs = 0;
- protected int maxOccurs = 0;
- protected XSTerm term = null;
-
- public JBossXSParticle()
- {
- }
-
- public JBossXSParticle(String name, String namespace)
- {
- super(name, namespace);
- }
-
- /**
- * [min occurs]: determines the minimum number of terms that can occur.
- */
- public int getMinOccurs()
- {
- return minOccurs;
- }
-
- /**
- * [max occurs]: determines the maximum number of terms that can occur.
- * To query for the value of unbounded use
- * <code>maxOccursUnbounded</code>. When the value of
- * <code>maxOccursUnbounded</code> is <code>true</code>, the
value of
- * <code>maxOccurs</code> is unspecified.
- */
- public int getMaxOccurs()
- {
- return maxOccurs;
- }
-
- /**
- * [max occurs]: whether the maxOccurs value is unbounded.
- */
- public boolean getMaxOccursUnbounded()
- {
- return (maxOccurs == -1);
- }
-
- /**
- * [term]: one of a model group, a wildcard, or an element declaration.
- */
- public XSTerm getTerm()
- {
- return term;
- }
-
- /**
- * Get the type
- */
- @Override
- public short getType()
- {
- return XSConstants.PARTICLE;
- }
-
- public void setMinOccurs(int minOccurs)
- {
- this.minOccurs = minOccurs;
- }
-
- public void setMaxOccurs(int maxOccurs)
- {
- this.maxOccurs = maxOccurs;
- }
-
- public void setTerm(XSTerm term)
- {
- this.term = term;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(T)
- */
- public int compareTo(Object o)
- {
- int c = -1;
- if(o instanceof JBossXSParticle)
- {
- JBossXSParticle w = (JBossXSParticle)o;
- String oname = w.getTerm().getName();
- String termName = term.getName() ;
- if( termName != null )
- c = termName.compareTo(oname);
- //In the case of doclit, need to be careful about String_1,SimpleType_2
- if( termName != null)
- {
- char num1 = termName.charAt(termName.length()-1);
- char num2 = oname.charAt(oname.length()-1);
- if(Character.isDigit(num1) && Character.isDigit(num2))
- c = (""+num1).compareTo((""+num2));
- }
- }
- return c;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSParticle.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSParticle.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,132 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSParticle;
+import org.apache.xerces.xs.XSTerm;
+
+/**
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 21, 2005
+ */
+public class JBossXSParticle
+ extends JBossXSObject implements XSParticle, Comparable
+{
+ protected int minOccurs = 0;
+ protected int maxOccurs = 0;
+ protected XSTerm term = null;
+
+ public JBossXSParticle()
+ {
+ }
+
+ public JBossXSParticle(String name, String namespace)
+ {
+ super(name, namespace);
+ }
+
+ /**
+ * [min occurs]: determines the minimum number of terms that can occur.
+ */
+ public int getMinOccurs()
+ {
+ return minOccurs;
+ }
+
+ /**
+ * [max occurs]: determines the maximum number of terms that can occur.
+ * To query for the value of unbounded use
+ * <code>maxOccursUnbounded</code>. When the value of
+ * <code>maxOccursUnbounded</code> is <code>true</code>, the
value of
+ * <code>maxOccurs</code> is unspecified.
+ */
+ public int getMaxOccurs()
+ {
+ return maxOccurs;
+ }
+
+ /**
+ * [max occurs]: whether the maxOccurs value is unbounded.
+ */
+ public boolean getMaxOccursUnbounded()
+ {
+ return (maxOccurs == -1);
+ }
+
+ /**
+ * [term]: one of a model group, a wildcard, or an element declaration.
+ */
+ public XSTerm getTerm()
+ {
+ return term;
+ }
+
+ /**
+ * Get the type
+ */
+ @Override
+ public short getType()
+ {
+ return XSConstants.PARTICLE;
+ }
+
+ public void setMinOccurs(int minOccurs)
+ {
+ this.minOccurs = minOccurs;
+ }
+
+ public void setMaxOccurs(int maxOccurs)
+ {
+ this.maxOccurs = maxOccurs;
+ }
+
+ public void setTerm(XSTerm term)
+ {
+ this.term = term;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(T)
+ */
+ public int compareTo(Object o)
+ {
+ int c = -1;
+ if(o instanceof JBossXSParticle)
+ {
+ JBossXSParticle w = (JBossXSParticle)o;
+ String oname = w.getTerm().getName();
+ String termName = term.getName() ;
+ if( termName != null )
+ c = termName.compareTo(oname);
+ //In the case of doclit, need to be careful about String_1,SimpleType_2
+ if( termName != null)
+ {
+ char num1 = termName.charAt(termName.length()-1);
+ char num2 = oname.charAt(oname.length()-1);
+ if(Character.isDigit(num1) && Character.isDigit(num2))
+ c = (""+num1).compareTo((""+num2));
+ }
+ }
+ return c;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,194 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTypeDefinition;
-
-/**
- * XSSimpleTypeDefinition
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Aug 4, 2005
- */
-public class JBossXSSimpleTypeDefinition
-extends JBossXSTypeDefinition
-implements XSSimpleTypeDefinition
-{
- private XSSimpleTypeDefinition xsSimple = null;
-
- private List<String> enumerations = new ArrayList<String>();
-
- public JBossXSSimpleTypeDefinition()
- {
- }
-
- public JBossXSSimpleTypeDefinition(XSSimpleTypeDefinition xs)
- {
- this.xsSimple = xs;
- }
-
- public short getVariety()
- {
- return xsSimple.getVariety();
- }
-
- public XSSimpleTypeDefinition getPrimitiveType()
- {
- return xsSimple.getPrimitiveType();
- }
-
- public short getBuiltInKind()
- {
- return xsSimple.getBuiltInKind();
- }
-
- public XSSimpleTypeDefinition getItemType()
- {
- return xsSimple.getItemType();
- }
-
- public XSObjectList getMemberTypes()
- {
- return xsSimple.getMemberTypes();
- }
-
- public short getDefinedFacets()
- {
- return xsSimple.getDefinedFacets();
- }
-
- public boolean isDefinedFacet(short arg0)
- {
- return xsSimple.isDefinedFacet(arg0);
- }
-
- public short getFixedFacets()
- {
- return xsSimple.getFixedFacets();
- }
-
- public boolean isFixedFacet(short arg0)
- {
- return xsSimple.isFixedFacet(arg0);
- }
-
- public String getLexicalFacetValue(short arg0)
- {
- return xsSimple.getLexicalFacetValue(arg0);
- }
-
- public StringList getLexicalEnumeration()
- {
- if (xsSimple == null)
- return new JBossXSStringList(enumerations);
-
- return xsSimple.getLexicalEnumeration();
- }
-
- public void addLexicalEnumeration(String enumeration)
- {
- this.enumerations.add(enumeration);
- }
-
- public StringList getLexicalPattern()
- {
- return xsSimple.getLexicalPattern();
- }
-
- public short getOrdered()
- {
- return xsSimple.getOrdered();
- }
-
- public boolean getFinite()
- {
- return xsSimple.getFinite();
- }
-
- public boolean getBounded()
- {
- return xsSimple.getBounded();
- }
-
- public boolean getNumeric()
- {
- return xsSimple.getNumeric();
- }
-
- public XSObjectList getFacets()
- {
- return xsSimple.getFacets();
- }
-
- public XSObjectList getMultiValueFacets()
- {
- return xsSimple.getMultiValueFacets();
- }
-
- public XSObjectList getAnnotations()
- {
- return xsSimple.getAnnotations();
- }
-
- /**
- * Get the type
- */
- @Override
- public short getType()
- {
- return XSTypeDefinition.SIMPLE_TYPE;
- }
-
- /**
- * Return whether this type definition is a simple type or complex type.
- */
- @Override
- public short getTypeCategory()
- {
- return XSTypeDefinition.SIMPLE_TYPE;
- }
-
-
- //***************************
- //Override base class methods
- //****************************
- @Override
- public String getName()
- {
- if (xsSimple == null)
- return name;
- return xsSimple.getName();
- }
-
- @Override
- public String getNamespace()
- {
- if (xsSimple == null)
- return namespace;
- return xsSimple.getNamespace();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSSimpleTypeDefinition.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,194 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.xerces.xs.StringList;
+import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSTypeDefinition;
+
+/**
+ * XSSimpleTypeDefinition
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Aug 4, 2005
+ */
+public class JBossXSSimpleTypeDefinition
+extends JBossXSTypeDefinition
+implements XSSimpleTypeDefinition
+{
+ private XSSimpleTypeDefinition xsSimple = null;
+
+ private List<String> enumerations = new ArrayList<String>();
+
+ public JBossXSSimpleTypeDefinition()
+ {
+ }
+
+ public JBossXSSimpleTypeDefinition(XSSimpleTypeDefinition xs)
+ {
+ this.xsSimple = xs;
+ }
+
+ public short getVariety()
+ {
+ return xsSimple.getVariety();
+ }
+
+ public XSSimpleTypeDefinition getPrimitiveType()
+ {
+ return xsSimple.getPrimitiveType();
+ }
+
+ public short getBuiltInKind()
+ {
+ return xsSimple.getBuiltInKind();
+ }
+
+ public XSSimpleTypeDefinition getItemType()
+ {
+ return xsSimple.getItemType();
+ }
+
+ public XSObjectList getMemberTypes()
+ {
+ return xsSimple.getMemberTypes();
+ }
+
+ public short getDefinedFacets()
+ {
+ return xsSimple.getDefinedFacets();
+ }
+
+ public boolean isDefinedFacet(short arg0)
+ {
+ return xsSimple.isDefinedFacet(arg0);
+ }
+
+ public short getFixedFacets()
+ {
+ return xsSimple.getFixedFacets();
+ }
+
+ public boolean isFixedFacet(short arg0)
+ {
+ return xsSimple.isFixedFacet(arg0);
+ }
+
+ public String getLexicalFacetValue(short arg0)
+ {
+ return xsSimple.getLexicalFacetValue(arg0);
+ }
+
+ public StringList getLexicalEnumeration()
+ {
+ if (xsSimple == null)
+ return new JBossXSStringList(enumerations);
+
+ return xsSimple.getLexicalEnumeration();
+ }
+
+ public void addLexicalEnumeration(String enumeration)
+ {
+ this.enumerations.add(enumeration);
+ }
+
+ public StringList getLexicalPattern()
+ {
+ return xsSimple.getLexicalPattern();
+ }
+
+ public short getOrdered()
+ {
+ return xsSimple.getOrdered();
+ }
+
+ public boolean getFinite()
+ {
+ return xsSimple.getFinite();
+ }
+
+ public boolean getBounded()
+ {
+ return xsSimple.getBounded();
+ }
+
+ public boolean getNumeric()
+ {
+ return xsSimple.getNumeric();
+ }
+
+ public XSObjectList getFacets()
+ {
+ return xsSimple.getFacets();
+ }
+
+ public XSObjectList getMultiValueFacets()
+ {
+ return xsSimple.getMultiValueFacets();
+ }
+
+ public XSObjectList getAnnotations()
+ {
+ return xsSimple.getAnnotations();
+ }
+
+ /**
+ * Get the type
+ */
+ @Override
+ public short getType()
+ {
+ return XSTypeDefinition.SIMPLE_TYPE;
+ }
+
+ /**
+ * Return whether this type definition is a simple type or complex type.
+ */
+ @Override
+ public short getTypeCategory()
+ {
+ return XSTypeDefinition.SIMPLE_TYPE;
+ }
+
+
+ //***************************
+ //Override base class methods
+ //****************************
+ @Override
+ public String getName()
+ {
+ if (xsSimple == null)
+ return name;
+ return xsSimple.getName();
+ }
+
+ @Override
+ public String getNamespace()
+ {
+ if (xsSimple == null)
+ return namespace;
+ return xsSimple.getNamespace();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSStringList.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSStringList.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSStringList.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,103 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.xerces.xs.StringList;
-
-/**
- * Implements the StringList interface
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSStringList implements StringList
-{
- protected List<String> strList = new ArrayList<String>();
-
- public JBossXSStringList()
- {
- }
-
- public JBossXSStringList(List<String> alist)
- {
- this.strList = alist;
- }
-
- public JBossXSStringList(Collection<String> col)
- {
- this.strList.addAll(col);
- }
-
- /**
- * The number of <code>GenericString</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength()
- {
- return strList.size();
- }
-
- /**
- * Checks if the <code>GenericString</code> <code>item</code>
is a member
- * of this list.
- * @param item <code>GenericString</code> whose presence in this list is
- * to be tested.
- * @return True if this list contains the <code>GenericString</code>
- * <code>item</code>.
- */
- public boolean contains(String item)
- {
- return strList.contains(item);
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or
equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>GenericString</code> at the
<code>index</code>th
- * position in the <code>StringList</code>, or
<code>null</code> if
- * the index specified is not valid.
- */
- public String item(int index)
- {
- return (String)strList.get(index);
- }
-
- public List<String> toList()
- {
- return strList;
- }
-
- public void addItem(String str)
- {
- strList.add(str);
- }
-
- public String toString()
- {
- return strList.toString();
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSStringList.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSStringList.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSStringList.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSStringList.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.xerces.xs.StringList;
+
+/**
+ * Implements the StringList interface
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 20, 2005
+ */
+public class JBossXSStringList implements StringList
+{
+ protected List<String> strList = new ArrayList<String>();
+
+ public JBossXSStringList()
+ {
+ }
+
+ public JBossXSStringList(List<String> alist)
+ {
+ this.strList = alist;
+ }
+
+ public JBossXSStringList(Collection<String> col)
+ {
+ this.strList.addAll(col);
+ }
+
+ /**
+ * The number of <code>GenericString</code>s in the list. The range of
+ * valid child object indices is 0 to <code>length-1</code> inclusive.
+ */
+ public int getLength()
+ {
+ return strList.size();
+ }
+
+ /**
+ * Checks if the <code>GenericString</code> <code>item</code>
is a member
+ * of this list.
+ * @param item <code>GenericString</code> whose presence in this list is
+ * to be tested.
+ * @return True if this list contains the <code>GenericString</code>
+ * <code>item</code>.
+ */
+ public boolean contains(String item)
+ {
+ return strList.contains(item);
+ }
+
+ /**
+ * Returns the <code>index</code>th item in the collection or
+ * <code>null</code> if <code>index</code> is greater than or
equal to
+ * the number of objects in the list. The index starts at 0.
+ * @param index index into the collection.
+ * @return The <code>GenericString</code> at the
<code>index</code>th
+ * position in the <code>StringList</code>, or
<code>null</code> if
+ * the index specified is not valid.
+ */
+ public String item(int index)
+ {
+ return (String)strList.get(index);
+ }
+
+ public List<String> toList()
+ {
+ return strList;
+ }
+
+ public void addItem(String str)
+ {
+ strList.add(str);
+ }
+
+ public String toString()
+ {
+ return strList.toString();
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,176 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.common.WSException;
-
-/**
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 20, 2005
- */
-public class JBossXSTypeDefinition extends JBossXSObject implements XSTypeDefinition
-{
- private static final long serialVersionUID = -3317350531846406564L;
-
- protected boolean anonymous = false;
- protected JBossXSTypeDefinition baseType;
- protected boolean isFinal = false;
-
- public JBossXSTypeDefinition()
- {
- }
-
- public JBossXSTypeDefinition(String name, String namespace)
- {
- super(name, namespace);
- }
-
- /**
- * Create a new JBossXSTypeDefinition
- * while reading data from a XSTypeDefinition
- *
- * @param xt
- */
- public JBossXSTypeDefinition(XSTypeDefinition xt)
- {
- super(xt.getName(), xt.getNamespace());
- setAnonymous(xt.getAnonymous());
-
- XSTypeDefinition xbase = xt.getBaseType();
- if (xbase != null)
- {
- if (xbase instanceof JBossXSTypeDefinition == false &&
!("anyType".equals(xbase.getName())))
- baseType = new JBossXSTypeDefinition(xbase);
- }
-
- }
-
- /**
- * Return whether this type definition is a simple type or complex type.
- */
- public short getTypeCategory()
- {
- throw new WSException("Type unidentified");
- }
-
- /**
- * {base type definition}: either a simple type definition or a complex
- * type definition.
- */
- public XSTypeDefinition getBaseType()
- {
- return baseType;
- }
-
- /**
- * {final}. For a complex type definition it is a subset of {extension,
- * restriction}. For a simple type definition it is a subset of
- * {extension, list, restriction, union}.
- * @param restriction Extension, restriction, list, union constants
- * (defined in <code>XSConstants</code>).
- * @return True if <code>restriction</code> is in the final set,
- * otherwise false.
- */
- public boolean isFinal(short restriction)
- {
- return isFinal;
- }
-
- /**
- * For complex types the returned value is a bit combination of the subset
- * of {<code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>}
- * corresponding to <code>final</code> set of this type or
- * <code>DERIVATION_NONE</code>. For simple types the returned value is
- * a bit combination of the subset of {
- * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION,
DERIVATION_LIST</code>
- * } corresponding to <code>final</code> set of this type or
- * <code>DERIVATION_NONE</code>.
- */
- public short getFinal()
- {
- return 0;
- }
-
- /** Convenience attribute. A boolean that specifies if the type definition is
anonymous.
- */
- public boolean getAnonymous()
- {
- return anonymous;
- }
-
- public void setAnonymous(boolean anonymous)
- {
- this.anonymous = anonymous;
- }
-
- /**
- * Convenience method which checks if this type is derived from the given
- * <code>ancestorType</code>.
- * @param ancestorType An ancestor type definition.
- * @param derivationMethod A bit combination representing a subset of {
- * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION,
DERIVATION_LIST</code>
- * }.
- * @return True if this type is derived from <code>ancestorType</code>
- * using only derivation methods from the <code>derivationMethod</code>
- * .
- */
- public boolean derivedFromType(XSTypeDefinition ancestorType, short derivationMethod)
- {
- return false;
- }
-
- /**
- * Convenience method which checks if this type is derived from the given
- * ancestor type.
- * @param namespace An ancestor type namespace.
- * @param name An ancestor type name.
- * @param derivationMethod A bit combination representing a subset of {
- * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION,
DERIVATION_LIST</code>
- * }.
- * @return True if this type is derived from <code>ancestorType</code>
- * using only derivation methods from the <code>derivationMethod</code>
- * .
- */
- public boolean derivedFrom(String namespace, String name, short derivationMethod)
- {
- return false;
- }
-
- public void setBaseType(XSTypeDefinition baseT)
- {
- if (baseT instanceof JBossXSTypeDefinition)
- {
- this.baseType = (JBossXSTypeDefinition)baseT;
- }
- else
- {
- this.baseType = new JBossXSTypeDefinition(baseT);
- }
- }
-
- public void setFinal(boolean aFinal)
- {
- isFinal = aFinal;
- }
-
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,176 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.ws.common.WSException;
+
+/**
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 20, 2005
+ */
+public class JBossXSTypeDefinition extends JBossXSObject implements XSTypeDefinition
+{
+ private static final long serialVersionUID = -3317350531846406564L;
+
+ protected boolean anonymous = false;
+ protected JBossXSTypeDefinition baseType;
+ protected boolean isFinal = false;
+
+ public JBossXSTypeDefinition()
+ {
+ }
+
+ public JBossXSTypeDefinition(String name, String namespace)
+ {
+ super(name, namespace);
+ }
+
+ /**
+ * Create a new JBossXSTypeDefinition
+ * while reading data from a XSTypeDefinition
+ *
+ * @param xt
+ */
+ public JBossXSTypeDefinition(XSTypeDefinition xt)
+ {
+ super(xt.getName(), xt.getNamespace());
+ setAnonymous(xt.getAnonymous());
+
+ XSTypeDefinition xbase = xt.getBaseType();
+ if (xbase != null)
+ {
+ if (xbase instanceof JBossXSTypeDefinition == false &&
!("anyType".equals(xbase.getName())))
+ baseType = new JBossXSTypeDefinition(xbase);
+ }
+
+ }
+
+ /**
+ * Return whether this type definition is a simple type or complex type.
+ */
+ public short getTypeCategory()
+ {
+ throw new WSException("Type unidentified");
+ }
+
+ /**
+ * {base type definition}: either a simple type definition or a complex
+ * type definition.
+ */
+ public XSTypeDefinition getBaseType()
+ {
+ return baseType;
+ }
+
+ /**
+ * {final}. For a complex type definition it is a subset of {extension,
+ * restriction}. For a simple type definition it is a subset of
+ * {extension, list, restriction, union}.
+ * @param restriction Extension, restriction, list, union constants
+ * (defined in <code>XSConstants</code>).
+ * @return True if <code>restriction</code> is in the final set,
+ * otherwise false.
+ */
+ public boolean isFinal(short restriction)
+ {
+ return isFinal;
+ }
+
+ /**
+ * For complex types the returned value is a bit combination of the subset
+ * of {<code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>}
+ * corresponding to <code>final</code> set of this type or
+ * <code>DERIVATION_NONE</code>. For simple types the returned value is
+ * a bit combination of the subset of {
+ * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION,
DERIVATION_LIST</code>
+ * } corresponding to <code>final</code> set of this type or
+ * <code>DERIVATION_NONE</code>.
+ */
+ public short getFinal()
+ {
+ return 0;
+ }
+
+ /** Convenience attribute. A boolean that specifies if the type definition is
anonymous.
+ */
+ public boolean getAnonymous()
+ {
+ return anonymous;
+ }
+
+ public void setAnonymous(boolean anonymous)
+ {
+ this.anonymous = anonymous;
+ }
+
+ /**
+ * Convenience method which checks if this type is derived from the given
+ * <code>ancestorType</code>.
+ * @param ancestorType An ancestor type definition.
+ * @param derivationMethod A bit combination representing a subset of {
+ * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION,
DERIVATION_LIST</code>
+ * }.
+ * @return True if this type is derived from <code>ancestorType</code>
+ * using only derivation methods from the <code>derivationMethod</code>
+ * .
+ */
+ public boolean derivedFromType(XSTypeDefinition ancestorType, short derivationMethod)
+ {
+ return false;
+ }
+
+ /**
+ * Convenience method which checks if this type is derived from the given
+ * ancestor type.
+ * @param namespace An ancestor type namespace.
+ * @param name An ancestor type name.
+ * @param derivationMethod A bit combination representing a subset of {
+ * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION,
DERIVATION_LIST</code>
+ * }.
+ * @return True if this type is derived from <code>ancestorType</code>
+ * using only derivation methods from the <code>derivationMethod</code>
+ * .
+ */
+ public boolean derivedFrom(String namespace, String name, short derivationMethod)
+ {
+ return false;
+ }
+
+ public void setBaseType(XSTypeDefinition baseT)
+ {
+ if (baseT instanceof JBossXSTypeDefinition)
+ {
+ this.baseType = (JBossXSTypeDefinition)baseT;
+ }
+ else
+ {
+ this.baseType = new JBossXSTypeDefinition(baseT);
+ }
+ }
+
+ public void setFinal(boolean aFinal)
+ {
+ isFinal = aFinal;
+ }
+
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/WSSchemaUtils.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/WSSchemaUtils.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,775 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xmlschema;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSAnnotation;
-import org.apache.xerces.xs.XSAttributeDeclaration;
-import org.apache.xerces.xs.XSAttributeUse;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSModel;
-import org.apache.xerces.xs.XSModelGroup;
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSNamespaceItem;
-import org.apache.xerces.xs.XSNamespaceItemList;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTerm;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.xb.binding.NamespaceRegistry;
-
-/**
- * Singleton class that works on the JBoss version of XSModel
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Jun 3, 2005
- */
-
-public class WSSchemaUtils
-{
- private static final String xsNS = Constants.NS_SCHEMA_XSD;
- private static SchemaUtils utils = SchemaUtils.getInstance();
-
- private NamespaceRegistry namespaceRegistry;
-
- private String targetNamespace = null;
-
- public static WSSchemaUtils getInstance(NamespaceRegistry namespaceRegistry, String
targetNamespace)
- {
- return new WSSchemaUtils(namespaceRegistry, targetNamespace);
- }
-
- private WSSchemaUtils(NamespaceRegistry namespaceRegistry, String targetNamespace)
- {
- this.namespaceRegistry = namespaceRegistry;
- this.targetNamespace = targetNamespace;
- }
-
-
- /**
- * Checks whether given a targetNS and other regular schema namespaces,
- * the passed "checkNS" is a custom namespace
- * @param targetNS Target Namespace of the schema
- * @param checkNS Namespace that needs to be checked if its a custom namespace
- * @return true - if checkNS is a custom namespace, false - otherwise
- */
- public boolean checkCustomNamespace(String targetNS, String checkNS)
- {
- String[] nsarr = new String[] {xsNS,Constants.NS_SCHEMA_XSI };
- List<String> knownNamespaces = Arrays.asList(nsarr);
- boolean isCustom = false;
- if(xsNS.equals(targetNS))
- throw new IllegalArgumentException("targetNamespace cannot be "+xsNS
);
- if(checkNS == null)
- throw new IllegalArgumentException("checkNS is null");
- if(knownNamespaces.contains(checkNS) == false &&
- targetNS.equals(checkNS) == false)
- isCustom = true;
- return isCustom;
- }
-
- /**
- * Create a global XSElementDeclaration object
- * @param name
- * @param xstype
- * @param targetNS
- * @return
- */
-
- public JBossXSElementDeclaration createGlobalXSElementDeclaration(String name,
XSTypeDefinition xstype,
- String targetNS)
- {
- JBossXSElementDeclaration xsel = new JBossXSElementDeclaration();
- xsel.setName(name);
- xsel.setTypeDefinition(xstype);
- xsel.setTargetNamespace(targetNS);
- xsel.setNamespace(targetNS);
- xsel.setScope(XSConstants.SCOPE_GLOBAL);
- return xsel;
- }
-
- /**
- * Generate a Schema Model for a namespace
- * @return
- */
-
- public JBossXSModel createXSModel()
- {
- return new JBossXSModel();
- }
-
- public JBossXSComplexTypeDefinition createXSComplexTypeDefinition( String name,
- XSTypeDefinition baseType, List<XSParticle> xsparts, String typens)
- {
- //No complex type if particles are null
- if(xsparts == null)
- return null;
-
- JBossXSComplexTypeDefinition ct = new JBossXSComplexTypeDefinition();
- ct.setName(name);
- ct.setNamespace(typens);
- JBossXSModelGroup group = new JBossXSModelGroup();
-
- group.setCompositor(XSModelGroup.COMPOSITOR_SEQUENCE);
- group.setParticles(xsparts);
- // Plug the particle array into the modelgroup
- JBossXSParticle xspa = new JBossXSParticle(null, typens);
- xspa.setTerm(group);
- ((JBossXSComplexTypeDefinition) ct).setParticle(xspa);
-
- if (baseType != null)
- {
- ((JBossXSComplexTypeDefinition)
ct).setDerivationMethod(XSConstants.DERIVATION_EXTENSION);
- ((JBossXSComplexTypeDefinition) ct).setBaseType(baseType);
- }
-
- return ct;
- }
-
-
- /**
- * Create a local XSElementDeclaration object
- * @param name
- * @param xstype
- * @param targetNS
- * @param isNillable
- * @return
- */
-
- public JBossXSElementDeclaration createXSElementDeclaration(String name,
XSTypeDefinition xstype,boolean isNillable)
- {
- JBossXSElementDeclaration xsel = new JBossXSElementDeclaration();
- xsel.setName(name);
- xsel.setTypeDefinition(xstype);
- xsel.setNillable(isNillable);
- return xsel;
- }
-
- public JBossXSParticle createXSParticle(String targetNS, boolean isArray, XSTerm
xsterm)
- {
- JBossXSParticle xsp = new JBossXSParticle(null, targetNS);
- if (isArray)
- xsp.setMaxOccurs(-1);
- xsp.setTerm(xsterm);
- return xsp;
- }
-
-
- /**
- * Creates a XSTypeDefinition object given a QName
- *
- * @param qname
- * @return a XSTypeDefinition
- */
- public JBossXSTypeDefinition createXSTypeDefinition(QName qname)
- {
- JBossXSTypeDefinition jbxs = new JBossXSTypeDefinition();
- jbxs.setName(qname.getLocalPart());
- jbxs.setNamespace(qname.getNamespaceURI());
- return jbxs;
- }
-
-
- /**
- * Generate a complex type for a custom exception
- * @param exname
- * @param ns
- * @return
- */
-
- public XSComplexTypeDefinition getExceptionType(String exname, String ns)
- {
- JBossXSParticle xsp = new JBossXSParticle();
- /*xsp.setType(XSConstants.ELEMENT_DECLARATION);
- xsp.setMaxOccurs(-1);
- JBossXSElementDeclaration xsel =
(JBossXSElementDeclaration)createXSElementDeclaration("name",
utils.getSchemaBasicType("string"), true);
-
- xsp.setTerm(xsel); */
- XSComplexTypeDefinition ct =
- new JBossXSComplexTypeDefinition(exname, ns);
-
- ((JBossXSComplexTypeDefinition)ct).setParticle(xsp);
- return ct;
- }
-
- /**
- * Convert the read-only Xerces implementation of XSModel
- * into JBossXSModel.
- * If the input is JBossXSModel, it will be returned back.
- * @param xsmodel XSModel object
- * @return JBossXSModel (RW Model)
- */
- public JBossXSModel getJBossXSModel(XSModel xsmodel)
- {
- if(xsmodel instanceof JBossXSModel)
- return (JBossXSModel)xsmodel;
- JBossXSModel jbxs = new JBossXSModel();
- copyXSModel(xsmodel,jbxs);
- return jbxs;
- }
-
- /**
- * Checks if the XSModel is empty given a namespace
- * @param xsmodel Schema Model to check
- * @param namespace namespace to check components for
- * @return true (if empty) and false (if not empty)
- */
- public boolean isEmptySchema(JBossXSModel xsmodel, String namespace)
- {
- if(xsmodel == null) return true;
- if(namespace == null) throw new WSException("Target Namespace of xsmodel is
null");
- XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION,
namespace);
- XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION,
namespace);
-
- if (tmap != null && tmap.getLength() > 0) return false;
- if (emap != null && emap.getLength() > 0) return false;
-
- return true;
- }
-
-
- /**
- * Serialize the SchemaModel into a Writer
- * @param xsmodel Schema Model which needs to be serialized
- * @param writer a Writer to which serialization should happen
- * @throws IOException
- */
- public void serialize(XSModel xsmodel, Writer writer) throws IOException
- {
- StringBuilder buffer = new StringBuilder();
- if(xsmodel instanceof JBossXSModel)
- {
- String str = ((JBossXSModel)xsmodel).serialize();
- buffer.append(str);
- }
- else
- {
- buffer.append("<schema ");
- XSNamespaceItemList itemlist = xsmodel.getNamespaceItems();
- appendSchemaDefinitions(buffer, itemlist);
- appendTypes(buffer, xsmodel);
- appendGlobalElements(buffer, xsmodel);
- buffer.append("</schema>");
- }
- writer.write(buffer.toString());
- }
-
-
- /**
- * Serialize the SchemaModel (with no types and elements) into a Writer
- * @param xsmodel Schema Model which needs to be serialized
- * @param writer a Writer to which serialization should happen
- * @throws IOException
- */
-
- public void serializeEmptySchema(XSModel xsmodel, Writer writer) throws IOException
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("<schema ");
- XSNamespaceItemList itemlist = xsmodel.getNamespaceItems();
- appendSchemaDefinitions(buffer, itemlist);
- appendTypes(buffer, xsmodel);
- appendGlobalElements(buffer, xsmodel);
- buffer.append("</schema>");
- writer.write(buffer.toString());
- }
-
- /**
- * Return a string for the element declaration
- * @param xsel
- * @param xsp
- * @return
- */
-
- public String write(XSElementDeclaration xsel, XSParticle xsp)
- {
- XSTypeDefinition xst = xsel.getTypeDefinition();
- if(xst == null)
- throw new IllegalStateException("Type xst is null");
-
- boolean isGlobalRef = (xsel.getScope() == XSConstants.SCOPE_GLOBAL);
- boolean isAnonType = xst.getAnonymous();
-
- StringBuilder buf = new StringBuilder();
- String elname = xsel.getName();
- String prefix = null;
-
- if(isGlobalRef)
- {
- String namespace = xsel.getNamespace();
- prefix = getPrefix(namespace);
- buf.append("<element ref='" + prefix + ":" + elname +
"'");
- }
- else
- {
- String namespace = xst.getNamespace();
- String typename = xst.getName();
-
- if (! Constants.NS_SCHEMA_XSD.equals(namespace))
- {
- prefix = getPrefix(namespace);
- typename = prefix + ":" + typename;
- }
- buf.append("<element name='" + elname + "'");
-
- if(! isAnonType)
- buf.append(" type='" + typename + "' ");
- }
-
- if (xsel.getNillable())
- buf.append(" nillable='true' ");
-
- int minoccurs = xsp.getMinOccurs();
- int maxoccurs = xsp.getMaxOccurs();
- if (!(minoccurs == 0 && maxoccurs == 0) && !(minoccurs == 1
&& maxoccurs == 1))
- {
- if (xsp.getMaxOccursUnbounded())
- buf.append(" maxOccurs='unbounded' ");
- else
- buf.append(" maxOccurs='" + xsp.getMaxOccurs() +
"'");
-
- buf.append(" minOccurs='" + xsp.getMinOccurs() +
"'");
- }
-
- if(! isAnonType)
- buf.append("/>");
- else
-
buf.append(">").append(write(xst)).append("</element>");
-
- return buf.toString();
- }
-
- public String write(XSAttributeDeclaration decl)
- {
- XSTypeDefinition xst = decl.getTypeDefinition();
- if(xst == null)
- throw new IllegalStateException("Type xst is null");
-
- boolean isGlobalRef = (decl.getScope() == XSConstants.SCOPE_GLOBAL);
- boolean isAnonType = xst.getAnonymous();
-
- StringBuilder buf = new StringBuilder();
- String name = decl.getName();
- String prefix = null;
-
- if (isGlobalRef)
- {
- String namespace = decl.getNamespace();
- prefix = getPrefix(namespace);
- buf.append("<attribute ref='" + prefix + ":" + name +
"'");
- }
- else
- {
- String namespace = xst.getNamespace();
- String typename = xst.getName();
-
- if (! Constants.NS_SCHEMA_XSD.equals(namespace))
- {
- prefix = getPrefix(namespace);
- typename = prefix + ":" + typename;
- }
- buf.append("<attribute name='" + name + "'");
-
- if(! isAnonType)
- buf.append(" type='" + typename + "' ");
- }
-
- if(! isAnonType)
- buf.append("/>");
- else
-
buf.append(">").append(write(xst)).append("</attribute>");
-
- return buf.toString();
- }
-
- /**
- * Return a string for the global element declaration
- * @param xsel
- * @param xsp
- * @return
- */
- public String write(XSElementDeclaration xsel)
- {
- boolean isAnonType = false;
- if (XSConstants.SCOPE_GLOBAL != xsel.getScope())
- throw new IllegalArgumentException("Element is not a global
element");
-
- StringBuilder buf = new StringBuilder();
- String elname = xsel.getName();
- XSTypeDefinition xst = xsel.getTypeDefinition();
- isAnonType = xst.getAnonymous();
- String typename = xst.getName();
- String namespace = xst.getNamespace();
- String prefix = null;
-
- if (! Constants.NS_SCHEMA_XSD.equals(namespace))
- {
- prefix = getPrefix(namespace);
- typename = prefix + ":" + typename;
- }
-
- buf.append("<element name='" + elname + "'");
- if(!isAnonType)
- buf.append(" type='" + typename + "' ");
- else
- buf.append(">").append(write(xst));
-
- if (xsel.getNillable() &&
- xsel.getScope() != XSConstants.SCOPE_GLOBAL)
- buf.append(" nillable='true' ");
- if(!isAnonType)
- buf.append("/>");
- else
- buf.append("</element>");
-
- return buf.toString();
- }
-
- /**
- * Return a string for the xs model group
- * @param xstype
- * @return
- */
- public String write(XSModelGroup xsm)
- {
- StringBuilder buf = new StringBuilder();
- XSObjectList objlist = xsm.getParticles();
-
- int lenobj = objlist != null ? objlist.getLength() : 0;
-
- for (int i = 0; i < lenobj; i++)
- {
- XSParticle jxsp = (XSParticle)objlist.item(i);
- XSTerm xterm = jxsp.getTerm();
- short termType = xterm.getType();
- if(termType == XSConstants.ELEMENT_DECLARATION)
- {
- XSElementDeclaration xsel = (XSElementDeclaration)jxsp.getTerm();
- buf.append(this.write(xsel, jxsp));
- }
- else
- if ( termType == XSConstants.MODEL_GROUP)
- {
- XSObjectList olist = ((XSModelGroup)xterm).getParticles();
- int lobj = olist != null ? olist.getLength() : 0;
- for (int k = 0; k < lobj; k++)
- {
- XSParticle jxp = (XSParticle)olist.item(k);
- XSTerm xsterm = jxp.getTerm();
- termType = xsterm.getType();
- if(termType == XSConstants.ELEMENT_DECLARATION)
- buf.append(write((XSElementDeclaration)xsterm, jxsp));
- else
- if(termType == XSConstants.MODEL_GROUP && k > 0)
- buf.append(write((XSModelGroup)xsterm));
- }
- }
- }
- return buf.toString();
- }
-
-
- /**
- * Return a string for the xs type
- * @param xstype
- * @return
- */
- public String write(XSTypeDefinition xstype)
- {
- StringBuilder buf = new StringBuilder();
-
- //Handle Complex Type
- if (xstype instanceof XSComplexTypeDefinition)
- {
- XSComplexTypeDefinition jxstype = (XSComplexTypeDefinition)xstype;
- String jxsTypeName = jxstype.getName();
- boolean isSimple = jxstype.getContentType() ==
XSComplexTypeDefinition.CONTENTTYPE_SIMPLE;
-
- if(xstype.getAnonymous()) buf.append("<complexType>");
- else
- buf.append("<complexType name='" + jxsTypeName +
"'>");
-
- XSTypeDefinition xsbase = (XSTypeDefinition)jxstype.getBaseType();
- String baseType = null;
- if (xsbase != null && !("anyType".equals(xsbase.getName())))
- baseType = getPrefix(xsbase.getNamespace()) + ":" +
xsbase.getName();
-
- if (baseType != null)
- {
- buf.append((isSimple) ? "<simpleContent>" :
"<complexContent>");
- buf.append("<extension base='" + baseType +
"'>");
- }
-
- XSParticle xsp = jxstype.getParticle();
- if (xsp != null) appendComplexTypeDefinition(buf,jxstype);
-
- XSObjectList list = jxstype.getAttributeUses();
- for (int i = 0; i < list.getLength(); i++)
- {
- XSAttributeUse use = (XSAttributeUse) list.item(i);
- XSAttributeDeclaration decl = use.getAttrDeclaration();
- buf.append(write(decl));
- }
-
- if (baseType != null)
- {
- buf.append("</extension>");
- buf.append((isSimple) ? "</simpleContent>" :
"</complexContent>");
- }
-
- buf.append("</complexType>");
-
- }
- else if (xstype instanceof XSSimpleTypeDefinition)
- {
- XSTypeDefinition xsbase = (XSTypeDefinition)xstype.getBaseType();
- buf.append("<simpleType name='" + xstype.getName() +
"'>");
- if (xsbase != null && !"anyType".equals(xsbase.getName()))
- {
- String baseType = xsbase.getName();
- String ns = xsbase.getNamespace();
- if (! Constants.NS_SCHEMA_XSD.equals(ns))
- {
- String prefix = getPrefix(ns);
- baseType = prefix + ":" + baseType;
- }
-
- // currently only handle enumerations
- buf.append("<restriction base='" + baseType +
"'>");
- StringList list = ((XSSimpleTypeDefinition)xstype).getLexicalEnumeration();
- for (int i = 0; i < list.getLength(); i++)
- {
- String listItem = DOMWriter.normalize(list.item(i), false);
- buf.append("<enumeration value='" + listItem
+"'/>");
- }
- buf.append("</restriction>");
- }
- buf.append("</simpleType>");
- }
-
- return buf.toString();
- }
-
-// Private methods
-
- private void appendSchemaDefinitions(StringBuilder buffer, XSNamespaceItemList
itemlist)
- {
- int len = itemlist != null ? itemlist.getLength() : 0;
-
- for (int i = 0; i < len; i++)
- {
- XSNamespaceItem nsitem = (XSNamespaceItem)itemlist.item(i);
- String ns = nsitem.getSchemaNamespace();
- //Ignore the one for xsd
-
- if (Constants.NS_SCHEMA_XSD.equals(ns)) continue;
- buffer.append(utils.getSchemaDefinitions(ns));
-
- } //end for
- }
-
- private void appendComplexTypeDefinition(StringBuilder buf , XSComplexTypeDefinition
jxstype)
- {
- XSParticle xsp = jxstype.getParticle();
- XSTerm xsterm = xsp.getTerm();
- short deriveMethod = jxstype.getDerivationMethod();
-
- if (xsterm instanceof XSElementDeclaration)
- {
- // FIXME This is horribly wrong, but too much depends on this broken behavior
- buf.append("<sequence>");
-
- XSElementDeclaration xsel = (XSElementDeclaration)xsterm;
- buf.append(this.write(xsel, xsp));
- buf.append("</sequence>");
- }
- else if (xsterm instanceof XSModelGroup)
- {
- XSModelGroup jmg = (XSModelGroup)xsterm;
- XSObjectList objlist = jmg.getParticles();
- String end = null;
-
- switch (jmg.getCompositor())
- {
- case XSModelGroup.COMPOSITOR_ALL:
- buf.append("<all>");
- end = "</all>";
- break;
- case XSModelGroup.COMPOSITOR_CHOICE:
- buf.append("<choice>");
- end = "</choice>";
- break;
- default:
- case XSModelGroup.COMPOSITOR_SEQUENCE:
- buf.append("<sequence>");
- end = "</sequence>";
- break;
- }
-
- int lenobj = objlist != null ? objlist.getLength() : 0;
-
- for (int i = 0; i < lenobj; i++)
- {
- XSParticle jxsp = (XSParticle)objlist.item(i);
- XSTerm xterm = jxsp.getTerm();
- if (xterm instanceof XSElementDeclaration)
- {
- XSElementDeclaration xsel = (XSElementDeclaration)jxsp.getTerm();
- buf.append(this.write(xsel, jxsp));
- }
- else if (xterm instanceof XSModelGroup)
- {
- if(deriveMethod == XSConstants.DERIVATION_EXTENSION && i != lenobj
-1)
- continue;
-
- if (i == 0) continue;//Ignore as it provides the baseclass sequence of
elements
- XSObjectList olist = ((XSModelGroup)xterm).getParticles();
- int lobj = olist != null ? olist.getLength() : 0;
- for (int k = 0; k < lobj; k++)
- {
- XSParticle jxp = (XSParticle)olist.item(k);
- XSTerm jxpterm = jxp.getTerm();
- short termType = jxpterm.getType();
- if(termType == XSConstants.ELEMENT_DECLARATION)
- buf.append(write((XSElementDeclaration)jxpterm, jxsp));
- else
- if(termType == XSConstants.MODEL_GROUP)
- buf.append(write((XSModelGroup)jxpterm));
- }
- }
- }
-
- buf.append(end);
- }
- }
-
- private void appendTypes(StringBuilder buffer, XSModel xsmodel)
- {
- XSNamedMap xsmap = xsmodel.getComponents(XSConstants.TYPE_DEFINITION);
- int len = xsmap != null ? xsmap.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- XSTypeDefinition xstype = (XSTypeDefinition)xsmap.item(i);
- if (Constants.NS_SCHEMA_XSD.equals(xstype.getNamespace())) continue;
- buffer.append(this.write(xstype));
- }
- }
-
-
- private void appendGlobalElements(StringBuilder buffer, XSModel xsmodel)
- {
- XSNamedMap xsmap = xsmodel.getComponents(XSConstants.ELEMENT_DECLARATION);
- int len = xsmap != null ? xsmap.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- XSElementDeclaration xsel = (XSElementDeclaration)xsmap.item(i);
- if (Constants.NS_SCHEMA_XSD.equals(xsel.getNamespace())) continue;
- buffer.append(this.write(xsel));
- }
- }
-
- //Copy the Xerces implementation of XSModel into JBossXSModel
- public void copyXSModel(XSModel xsmodel, JBossXSModel jb)
- {
- if(xsmodel == null)
- throw new IllegalArgumentException("Illegal Null Argument:xsmodel");
- if(jb == null)
- throw new IllegalArgumentException("Illegal Null Argument:jb");
- //Copy all the Namespace Items
- jb.setXSNamespaceItemList(xsmodel.getNamespaceItems());
- //Copy all the elements
- XSNamedMap xsmp = xsmodel.getComponents(XSConstants.ELEMENT_DECLARATION);
- int len = xsmp != null ? xsmp.getLength() : 0;
-
- for (int i = 0; i < len; i++)
- {
- XSElementDeclaration xsel = (XSElementDeclaration)xsmp.item(i);
- jb.addXSElementDeclaration(xsel);
- }
- //Copy all the types
- xsmp = xsmodel.getComponents(XSConstants.TYPE_DEFINITION);
- len = xsmp != null ? xsmp.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- XSTypeDefinition xstype = (XSTypeDefinition)xsmp.item(i);
- if (!this.xsNS.equals(xstype.getNamespace())) jb.addXSTypeDefinition(xstype);
- }
-
- //Copy all the attributes
- xsmp = xsmodel.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
- len = xsmp != null ? xsmp.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- XSAttributeDeclaration xsattr = (XSAttributeDeclaration)xsmp.item(i);
- jb.addXSAttributeDeclaration(xsattr);
- }
-
- //copy all the global annotations
- //xsmp = xsmodel.getComponents(XSConstants.ANNOTATION);
- XSObjectList xo = xsmodel.getAnnotations();
- len = xo != null ? xo.getLength():0;
- //len = xsmp != null ? xsmp.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- //XSAnnotation xa = (XSAnnotation)xsmp.item(i);
- XSAnnotation xa = (XSAnnotation)xo.item(i);
- jb.addXSAnnotation(xa);
- }
- }
-
- private String getPrefix(String namespace)
- {
- if (namespaceRegistry == null)
- throw new IllegalArgumentException("nameespaceRegistry can not be
null!");
-
- if (namespace == null)
- throw new IllegalArgumentException("namespace can not be null");
-
- // XML Namespace can only legally be assigned the XML prefix
- if (namespace.equals(Constants.NS_XML))
- return Constants.PREFIX_XML;
- if (namespace.equals(targetNamespace))
- return Constants.PREFIX_TNS;
- if (namespace.equals(Constants.URI_SOAP11_ENC))
- return Constants.PREFIX_SOAP11_ENC;
- if (namespace.equals(Constants.NS_SCHEMA_XSI))
- return Constants.PREFIX_XSI;
-
- String prefix = namespaceRegistry.getPrefix(namespace);
-
- // Assume target namespace
- return (prefix == null) ? Constants.PREFIX_TNS : prefix;
- }
-}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/WSSchemaUtils.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xmlschema/WSSchemaUtils.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,775 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xmlschema;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xerces.xs.StringList;
+import org.apache.xerces.xs.XSAnnotation;
+import org.apache.xerces.xs.XSAttributeDeclaration;
+import org.apache.xerces.xs.XSAttributeUse;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSModel;
+import org.apache.xerces.xs.XSModelGroup;
+import org.apache.xerces.xs.XSNamedMap;
+import org.apache.xerces.xs.XSNamespaceItem;
+import org.apache.xerces.xs.XSNamespaceItemList;
+import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSParticle;
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSTerm;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.xb.binding.NamespaceRegistry;
+
+/**
+ * Singleton class that works on the JBoss version of XSModel
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Jun 3, 2005
+ */
+
+public class WSSchemaUtils
+{
+ private static final String xsNS = Constants.NS_SCHEMA_XSD;
+ private static SchemaUtils utils = SchemaUtils.getInstance();
+
+ private NamespaceRegistry namespaceRegistry;
+
+ private String targetNamespace = null;
+
+ public static WSSchemaUtils getInstance(NamespaceRegistry namespaceRegistry, String
targetNamespace)
+ {
+ return new WSSchemaUtils(namespaceRegistry, targetNamespace);
+ }
+
+ private WSSchemaUtils(NamespaceRegistry namespaceRegistry, String targetNamespace)
+ {
+ this.namespaceRegistry = namespaceRegistry;
+ this.targetNamespace = targetNamespace;
+ }
+
+
+ /**
+ * Checks whether given a targetNS and other regular schema namespaces,
+ * the passed "checkNS" is a custom namespace
+ * @param targetNS Target Namespace of the schema
+ * @param checkNS Namespace that needs to be checked if its a custom namespace
+ * @return true - if checkNS is a custom namespace, false - otherwise
+ */
+ public boolean checkCustomNamespace(String targetNS, String checkNS)
+ {
+ String[] nsarr = new String[] {xsNS,Constants.NS_SCHEMA_XSI };
+ List<String> knownNamespaces = Arrays.asList(nsarr);
+ boolean isCustom = false;
+ if(xsNS.equals(targetNS))
+ throw new IllegalArgumentException("targetNamespace cannot be "+xsNS
);
+ if(checkNS == null)
+ throw new IllegalArgumentException("checkNS is null");
+ if(knownNamespaces.contains(checkNS) == false &&
+ targetNS.equals(checkNS) == false)
+ isCustom = true;
+ return isCustom;
+ }
+
+ /**
+ * Create a global XSElementDeclaration object
+ * @param name
+ * @param xstype
+ * @param targetNS
+ * @return
+ */
+
+ public JBossXSElementDeclaration createGlobalXSElementDeclaration(String name,
XSTypeDefinition xstype,
+ String targetNS)
+ {
+ JBossXSElementDeclaration xsel = new JBossXSElementDeclaration();
+ xsel.setName(name);
+ xsel.setTypeDefinition(xstype);
+ xsel.setTargetNamespace(targetNS);
+ xsel.setNamespace(targetNS);
+ xsel.setScope(XSConstants.SCOPE_GLOBAL);
+ return xsel;
+ }
+
+ /**
+ * Generate a Schema Model for a namespace
+ * @return
+ */
+
+ public JBossXSModel createXSModel()
+ {
+ return new JBossXSModel();
+ }
+
+ public JBossXSComplexTypeDefinition createXSComplexTypeDefinition( String name,
+ XSTypeDefinition baseType, List<XSParticle> xsparts, String typens)
+ {
+ //No complex type if particles are null
+ if(xsparts == null)
+ return null;
+
+ JBossXSComplexTypeDefinition ct = new JBossXSComplexTypeDefinition();
+ ct.setName(name);
+ ct.setNamespace(typens);
+ JBossXSModelGroup group = new JBossXSModelGroup();
+
+ group.setCompositor(XSModelGroup.COMPOSITOR_SEQUENCE);
+ group.setParticles(xsparts);
+ // Plug the particle array into the modelgroup
+ JBossXSParticle xspa = new JBossXSParticle(null, typens);
+ xspa.setTerm(group);
+ ((JBossXSComplexTypeDefinition) ct).setParticle(xspa);
+
+ if (baseType != null)
+ {
+ ((JBossXSComplexTypeDefinition)
ct).setDerivationMethod(XSConstants.DERIVATION_EXTENSION);
+ ((JBossXSComplexTypeDefinition) ct).setBaseType(baseType);
+ }
+
+ return ct;
+ }
+
+
+ /**
+ * Create a local XSElementDeclaration object
+ * @param name
+ * @param xstype
+ * @param targetNS
+ * @param isNillable
+ * @return
+ */
+
+ public JBossXSElementDeclaration createXSElementDeclaration(String name,
XSTypeDefinition xstype,boolean isNillable)
+ {
+ JBossXSElementDeclaration xsel = new JBossXSElementDeclaration();
+ xsel.setName(name);
+ xsel.setTypeDefinition(xstype);
+ xsel.setNillable(isNillable);
+ return xsel;
+ }
+
+ public JBossXSParticle createXSParticle(String targetNS, boolean isArray, XSTerm
xsterm)
+ {
+ JBossXSParticle xsp = new JBossXSParticle(null, targetNS);
+ if (isArray)
+ xsp.setMaxOccurs(-1);
+ xsp.setTerm(xsterm);
+ return xsp;
+ }
+
+
+ /**
+ * Creates a XSTypeDefinition object given a QName
+ *
+ * @param qname
+ * @return a XSTypeDefinition
+ */
+ public JBossXSTypeDefinition createXSTypeDefinition(QName qname)
+ {
+ JBossXSTypeDefinition jbxs = new JBossXSTypeDefinition();
+ jbxs.setName(qname.getLocalPart());
+ jbxs.setNamespace(qname.getNamespaceURI());
+ return jbxs;
+ }
+
+
+ /**
+ * Generate a complex type for a custom exception
+ * @param exname
+ * @param ns
+ * @return
+ */
+
+ public XSComplexTypeDefinition getExceptionType(String exname, String ns)
+ {
+ JBossXSParticle xsp = new JBossXSParticle();
+ /*xsp.setType(XSConstants.ELEMENT_DECLARATION);
+ xsp.setMaxOccurs(-1);
+ JBossXSElementDeclaration xsel =
(JBossXSElementDeclaration)createXSElementDeclaration("name",
utils.getSchemaBasicType("string"), true);
+
+ xsp.setTerm(xsel); */
+ XSComplexTypeDefinition ct =
+ new JBossXSComplexTypeDefinition(exname, ns);
+
+ ((JBossXSComplexTypeDefinition)ct).setParticle(xsp);
+ return ct;
+ }
+
+ /**
+ * Convert the read-only Xerces implementation of XSModel
+ * into JBossXSModel.
+ * If the input is JBossXSModel, it will be returned back.
+ * @param xsmodel XSModel object
+ * @return JBossXSModel (RW Model)
+ */
+ public JBossXSModel getJBossXSModel(XSModel xsmodel)
+ {
+ if(xsmodel instanceof JBossXSModel)
+ return (JBossXSModel)xsmodel;
+ JBossXSModel jbxs = new JBossXSModel();
+ copyXSModel(xsmodel,jbxs);
+ return jbxs;
+ }
+
+ /**
+ * Checks if the XSModel is empty given a namespace
+ * @param xsmodel Schema Model to check
+ * @param namespace namespace to check components for
+ * @return true (if empty) and false (if not empty)
+ */
+ public boolean isEmptySchema(JBossXSModel xsmodel, String namespace)
+ {
+ if(xsmodel == null) return true;
+ if(namespace == null) throw new WSException("Target Namespace of xsmodel is
null");
+ XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION,
namespace);
+ XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION,
namespace);
+
+ if (tmap != null && tmap.getLength() > 0) return false;
+ if (emap != null && emap.getLength() > 0) return false;
+
+ return true;
+ }
+
+
+ /**
+ * Serialize the SchemaModel into a Writer
+ * @param xsmodel Schema Model which needs to be serialized
+ * @param writer a Writer to which serialization should happen
+ * @throws IOException
+ */
+ public void serialize(XSModel xsmodel, Writer writer) throws IOException
+ {
+ StringBuilder buffer = new StringBuilder();
+ if(xsmodel instanceof JBossXSModel)
+ {
+ String str = ((JBossXSModel)xsmodel).serialize();
+ buffer.append(str);
+ }
+ else
+ {
+ buffer.append("<schema ");
+ XSNamespaceItemList itemlist = xsmodel.getNamespaceItems();
+ appendSchemaDefinitions(buffer, itemlist);
+ appendTypes(buffer, xsmodel);
+ appendGlobalElements(buffer, xsmodel);
+ buffer.append("</schema>");
+ }
+ writer.write(buffer.toString());
+ }
+
+
+ /**
+ * Serialize the SchemaModel (with no types and elements) into a Writer
+ * @param xsmodel Schema Model which needs to be serialized
+ * @param writer a Writer to which serialization should happen
+ * @throws IOException
+ */
+
+ public void serializeEmptySchema(XSModel xsmodel, Writer writer) throws IOException
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("<schema ");
+ XSNamespaceItemList itemlist = xsmodel.getNamespaceItems();
+ appendSchemaDefinitions(buffer, itemlist);
+ appendTypes(buffer, xsmodel);
+ appendGlobalElements(buffer, xsmodel);
+ buffer.append("</schema>");
+ writer.write(buffer.toString());
+ }
+
+ /**
+ * Return a string for the element declaration
+ * @param xsel
+ * @param xsp
+ * @return
+ */
+
+ public String write(XSElementDeclaration xsel, XSParticle xsp)
+ {
+ XSTypeDefinition xst = xsel.getTypeDefinition();
+ if(xst == null)
+ throw new IllegalStateException("Type xst is null");
+
+ boolean isGlobalRef = (xsel.getScope() == XSConstants.SCOPE_GLOBAL);
+ boolean isAnonType = xst.getAnonymous();
+
+ StringBuilder buf = new StringBuilder();
+ String elname = xsel.getName();
+ String prefix = null;
+
+ if(isGlobalRef)
+ {
+ String namespace = xsel.getNamespace();
+ prefix = getPrefix(namespace);
+ buf.append("<element ref='" + prefix + ":" + elname +
"'");
+ }
+ else
+ {
+ String namespace = xst.getNamespace();
+ String typename = xst.getName();
+
+ if (! Constants.NS_SCHEMA_XSD.equals(namespace))
+ {
+ prefix = getPrefix(namespace);
+ typename = prefix + ":" + typename;
+ }
+ buf.append("<element name='" + elname + "'");
+
+ if(! isAnonType)
+ buf.append(" type='" + typename + "' ");
+ }
+
+ if (xsel.getNillable())
+ buf.append(" nillable='true' ");
+
+ int minoccurs = xsp.getMinOccurs();
+ int maxoccurs = xsp.getMaxOccurs();
+ if (!(minoccurs == 0 && maxoccurs == 0) && !(minoccurs == 1
&& maxoccurs == 1))
+ {
+ if (xsp.getMaxOccursUnbounded())
+ buf.append(" maxOccurs='unbounded' ");
+ else
+ buf.append(" maxOccurs='" + xsp.getMaxOccurs() +
"'");
+
+ buf.append(" minOccurs='" + xsp.getMinOccurs() +
"'");
+ }
+
+ if(! isAnonType)
+ buf.append("/>");
+ else
+
buf.append(">").append(write(xst)).append("</element>");
+
+ return buf.toString();
+ }
+
+ public String write(XSAttributeDeclaration decl)
+ {
+ XSTypeDefinition xst = decl.getTypeDefinition();
+ if(xst == null)
+ throw new IllegalStateException("Type xst is null");
+
+ boolean isGlobalRef = (decl.getScope() == XSConstants.SCOPE_GLOBAL);
+ boolean isAnonType = xst.getAnonymous();
+
+ StringBuilder buf = new StringBuilder();
+ String name = decl.getName();
+ String prefix = null;
+
+ if (isGlobalRef)
+ {
+ String namespace = decl.getNamespace();
+ prefix = getPrefix(namespace);
+ buf.append("<attribute ref='" + prefix + ":" + name +
"'");
+ }
+ else
+ {
+ String namespace = xst.getNamespace();
+ String typename = xst.getName();
+
+ if (! Constants.NS_SCHEMA_XSD.equals(namespace))
+ {
+ prefix = getPrefix(namespace);
+ typename = prefix + ":" + typename;
+ }
+ buf.append("<attribute name='" + name + "'");
+
+ if(! isAnonType)
+ buf.append(" type='" + typename + "' ");
+ }
+
+ if(! isAnonType)
+ buf.append("/>");
+ else
+
buf.append(">").append(write(xst)).append("</attribute>");
+
+ return buf.toString();
+ }
+
+ /**
+ * Return a string for the global element declaration
+ * @param xsel
+ * @param xsp
+ * @return
+ */
+ public String write(XSElementDeclaration xsel)
+ {
+ boolean isAnonType = false;
+ if (XSConstants.SCOPE_GLOBAL != xsel.getScope())
+ throw new IllegalArgumentException("Element is not a global
element");
+
+ StringBuilder buf = new StringBuilder();
+ String elname = xsel.getName();
+ XSTypeDefinition xst = xsel.getTypeDefinition();
+ isAnonType = xst.getAnonymous();
+ String typename = xst.getName();
+ String namespace = xst.getNamespace();
+ String prefix = null;
+
+ if (! Constants.NS_SCHEMA_XSD.equals(namespace))
+ {
+ prefix = getPrefix(namespace);
+ typename = prefix + ":" + typename;
+ }
+
+ buf.append("<element name='" + elname + "'");
+ if(!isAnonType)
+ buf.append(" type='" + typename + "' ");
+ else
+ buf.append(">").append(write(xst));
+
+ if (xsel.getNillable() &&
+ xsel.getScope() != XSConstants.SCOPE_GLOBAL)
+ buf.append(" nillable='true' ");
+ if(!isAnonType)
+ buf.append("/>");
+ else
+ buf.append("</element>");
+
+ return buf.toString();
+ }
+
+ /**
+ * Return a string for the xs model group
+ * @param xstype
+ * @return
+ */
+ public String write(XSModelGroup xsm)
+ {
+ StringBuilder buf = new StringBuilder();
+ XSObjectList objlist = xsm.getParticles();
+
+ int lenobj = objlist != null ? objlist.getLength() : 0;
+
+ for (int i = 0; i < lenobj; i++)
+ {
+ XSParticle jxsp = (XSParticle)objlist.item(i);
+ XSTerm xterm = jxsp.getTerm();
+ short termType = xterm.getType();
+ if(termType == XSConstants.ELEMENT_DECLARATION)
+ {
+ XSElementDeclaration xsel = (XSElementDeclaration)jxsp.getTerm();
+ buf.append(this.write(xsel, jxsp));
+ }
+ else
+ if ( termType == XSConstants.MODEL_GROUP)
+ {
+ XSObjectList olist = ((XSModelGroup)xterm).getParticles();
+ int lobj = olist != null ? olist.getLength() : 0;
+ for (int k = 0; k < lobj; k++)
+ {
+ XSParticle jxp = (XSParticle)olist.item(k);
+ XSTerm xsterm = jxp.getTerm();
+ termType = xsterm.getType();
+ if(termType == XSConstants.ELEMENT_DECLARATION)
+ buf.append(write((XSElementDeclaration)xsterm, jxsp));
+ else
+ if(termType == XSConstants.MODEL_GROUP && k > 0)
+ buf.append(write((XSModelGroup)xsterm));
+ }
+ }
+ }
+ return buf.toString();
+ }
+
+
+ /**
+ * Return a string for the xs type
+ * @param xstype
+ * @return
+ */
+ public String write(XSTypeDefinition xstype)
+ {
+ StringBuilder buf = new StringBuilder();
+
+ //Handle Complex Type
+ if (xstype instanceof XSComplexTypeDefinition)
+ {
+ XSComplexTypeDefinition jxstype = (XSComplexTypeDefinition)xstype;
+ String jxsTypeName = jxstype.getName();
+ boolean isSimple = jxstype.getContentType() ==
XSComplexTypeDefinition.CONTENTTYPE_SIMPLE;
+
+ if(xstype.getAnonymous()) buf.append("<complexType>");
+ else
+ buf.append("<complexType name='" + jxsTypeName +
"'>");
+
+ XSTypeDefinition xsbase = (XSTypeDefinition)jxstype.getBaseType();
+ String baseType = null;
+ if (xsbase != null && !("anyType".equals(xsbase.getName())))
+ baseType = getPrefix(xsbase.getNamespace()) + ":" +
xsbase.getName();
+
+ if (baseType != null)
+ {
+ buf.append((isSimple) ? "<simpleContent>" :
"<complexContent>");
+ buf.append("<extension base='" + baseType +
"'>");
+ }
+
+ XSParticle xsp = jxstype.getParticle();
+ if (xsp != null) appendComplexTypeDefinition(buf,jxstype);
+
+ XSObjectList list = jxstype.getAttributeUses();
+ for (int i = 0; i < list.getLength(); i++)
+ {
+ XSAttributeUse use = (XSAttributeUse) list.item(i);
+ XSAttributeDeclaration decl = use.getAttrDeclaration();
+ buf.append(write(decl));
+ }
+
+ if (baseType != null)
+ {
+ buf.append("</extension>");
+ buf.append((isSimple) ? "</simpleContent>" :
"</complexContent>");
+ }
+
+ buf.append("</complexType>");
+
+ }
+ else if (xstype instanceof XSSimpleTypeDefinition)
+ {
+ XSTypeDefinition xsbase = (XSTypeDefinition)xstype.getBaseType();
+ buf.append("<simpleType name='" + xstype.getName() +
"'>");
+ if (xsbase != null && !"anyType".equals(xsbase.getName()))
+ {
+ String baseType = xsbase.getName();
+ String ns = xsbase.getNamespace();
+ if (! Constants.NS_SCHEMA_XSD.equals(ns))
+ {
+ String prefix = getPrefix(ns);
+ baseType = prefix + ":" + baseType;
+ }
+
+ // currently only handle enumerations
+ buf.append("<restriction base='" + baseType +
"'>");
+ StringList list = ((XSSimpleTypeDefinition)xstype).getLexicalEnumeration();
+ for (int i = 0; i < list.getLength(); i++)
+ {
+ String listItem = DOMWriter.normalize(list.item(i), false);
+ buf.append("<enumeration value='" + listItem
+"'/>");
+ }
+ buf.append("</restriction>");
+ }
+ buf.append("</simpleType>");
+ }
+
+ return buf.toString();
+ }
+
+// Private methods
+
+ private void appendSchemaDefinitions(StringBuilder buffer, XSNamespaceItemList
itemlist)
+ {
+ int len = itemlist != null ? itemlist.getLength() : 0;
+
+ for (int i = 0; i < len; i++)
+ {
+ XSNamespaceItem nsitem = (XSNamespaceItem)itemlist.item(i);
+ String ns = nsitem.getSchemaNamespace();
+ //Ignore the one for xsd
+
+ if (Constants.NS_SCHEMA_XSD.equals(ns)) continue;
+ buffer.append(utils.getSchemaDefinitions(ns));
+
+ } //end for
+ }
+
+ private void appendComplexTypeDefinition(StringBuilder buf , XSComplexTypeDefinition
jxstype)
+ {
+ XSParticle xsp = jxstype.getParticle();
+ XSTerm xsterm = xsp.getTerm();
+ short deriveMethod = jxstype.getDerivationMethod();
+
+ if (xsterm instanceof XSElementDeclaration)
+ {
+ // FIXME This is horribly wrong, but too much depends on this broken behavior
+ buf.append("<sequence>");
+
+ XSElementDeclaration xsel = (XSElementDeclaration)xsterm;
+ buf.append(this.write(xsel, xsp));
+ buf.append("</sequence>");
+ }
+ else if (xsterm instanceof XSModelGroup)
+ {
+ XSModelGroup jmg = (XSModelGroup)xsterm;
+ XSObjectList objlist = jmg.getParticles();
+ String end = null;
+
+ switch (jmg.getCompositor())
+ {
+ case XSModelGroup.COMPOSITOR_ALL:
+ buf.append("<all>");
+ end = "</all>";
+ break;
+ case XSModelGroup.COMPOSITOR_CHOICE:
+ buf.append("<choice>");
+ end = "</choice>";
+ break;
+ default:
+ case XSModelGroup.COMPOSITOR_SEQUENCE:
+ buf.append("<sequence>");
+ end = "</sequence>";
+ break;
+ }
+
+ int lenobj = objlist != null ? objlist.getLength() : 0;
+
+ for (int i = 0; i < lenobj; i++)
+ {
+ XSParticle jxsp = (XSParticle)objlist.item(i);
+ XSTerm xterm = jxsp.getTerm();
+ if (xterm instanceof XSElementDeclaration)
+ {
+ XSElementDeclaration xsel = (XSElementDeclaration)jxsp.getTerm();
+ buf.append(this.write(xsel, jxsp));
+ }
+ else if (xterm instanceof XSModelGroup)
+ {
+ if(deriveMethod == XSConstants.DERIVATION_EXTENSION && i != lenobj
-1)
+ continue;
+
+ if (i == 0) continue;//Ignore as it provides the baseclass sequence of
elements
+ XSObjectList olist = ((XSModelGroup)xterm).getParticles();
+ int lobj = olist != null ? olist.getLength() : 0;
+ for (int k = 0; k < lobj; k++)
+ {
+ XSParticle jxp = (XSParticle)olist.item(k);
+ XSTerm jxpterm = jxp.getTerm();
+ short termType = jxpterm.getType();
+ if(termType == XSConstants.ELEMENT_DECLARATION)
+ buf.append(write((XSElementDeclaration)jxpterm, jxsp));
+ else
+ if(termType == XSConstants.MODEL_GROUP)
+ buf.append(write((XSModelGroup)jxpterm));
+ }
+ }
+ }
+
+ buf.append(end);
+ }
+ }
+
+ private void appendTypes(StringBuilder buffer, XSModel xsmodel)
+ {
+ XSNamedMap xsmap = xsmodel.getComponents(XSConstants.TYPE_DEFINITION);
+ int len = xsmap != null ? xsmap.getLength() : 0;
+ for (int i = 0; i < len; i++)
+ {
+ XSTypeDefinition xstype = (XSTypeDefinition)xsmap.item(i);
+ if (Constants.NS_SCHEMA_XSD.equals(xstype.getNamespace())) continue;
+ buffer.append(this.write(xstype));
+ }
+ }
+
+
+ private void appendGlobalElements(StringBuilder buffer, XSModel xsmodel)
+ {
+ XSNamedMap xsmap = xsmodel.getComponents(XSConstants.ELEMENT_DECLARATION);
+ int len = xsmap != null ? xsmap.getLength() : 0;
+ for (int i = 0; i < len; i++)
+ {
+ XSElementDeclaration xsel = (XSElementDeclaration)xsmap.item(i);
+ if (Constants.NS_SCHEMA_XSD.equals(xsel.getNamespace())) continue;
+ buffer.append(this.write(xsel));
+ }
+ }
+
+ //Copy the Xerces implementation of XSModel into JBossXSModel
+ public void copyXSModel(XSModel xsmodel, JBossXSModel jb)
+ {
+ if(xsmodel == null)
+ throw new IllegalArgumentException("Illegal Null Argument:xsmodel");
+ if(jb == null)
+ throw new IllegalArgumentException("Illegal Null Argument:jb");
+ //Copy all the Namespace Items
+ jb.setXSNamespaceItemList(xsmodel.getNamespaceItems());
+ //Copy all the elements
+ XSNamedMap xsmp = xsmodel.getComponents(XSConstants.ELEMENT_DECLARATION);
+ int len = xsmp != null ? xsmp.getLength() : 0;
+
+ for (int i = 0; i < len; i++)
+ {
+ XSElementDeclaration xsel = (XSElementDeclaration)xsmp.item(i);
+ jb.addXSElementDeclaration(xsel);
+ }
+ //Copy all the types
+ xsmp = xsmodel.getComponents(XSConstants.TYPE_DEFINITION);
+ len = xsmp != null ? xsmp.getLength() : 0;
+ for (int i = 0; i < len; i++)
+ {
+ XSTypeDefinition xstype = (XSTypeDefinition)xsmp.item(i);
+ if (!this.xsNS.equals(xstype.getNamespace())) jb.addXSTypeDefinition(xstype);
+ }
+
+ //Copy all the attributes
+ xsmp = xsmodel.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
+ len = xsmp != null ? xsmp.getLength() : 0;
+ for (int i = 0; i < len; i++)
+ {
+ XSAttributeDeclaration xsattr = (XSAttributeDeclaration)xsmp.item(i);
+ jb.addXSAttributeDeclaration(xsattr);
+ }
+
+ //copy all the global annotations
+ //xsmp = xsmodel.getComponents(XSConstants.ANNOTATION);
+ XSObjectList xo = xsmodel.getAnnotations();
+ len = xo != null ? xo.getLength():0;
+ //len = xsmp != null ? xsmp.getLength() : 0;
+ for (int i = 0; i < len; i++)
+ {
+ //XSAnnotation xa = (XSAnnotation)xsmp.item(i);
+ XSAnnotation xa = (XSAnnotation)xo.item(i);
+ jb.addXSAnnotation(xa);
+ }
+ }
+
+ private String getPrefix(String namespace)
+ {
+ if (namespaceRegistry == null)
+ throw new IllegalArgumentException("nameespaceRegistry can not be
null!");
+
+ if (namespace == null)
+ throw new IllegalArgumentException("namespace can not be null");
+
+ // XML Namespace can only legally be assigned the XML prefix
+ if (namespace.equals(Constants.NS_XML))
+ return Constants.PREFIX_XML;
+ if (namespace.equals(targetNamespace))
+ return Constants.PREFIX_TNS;
+ if (namespace.equals(Constants.URI_SOAP11_ENC))
+ return Constants.PREFIX_SOAP11_ENC;
+ if (namespace.equals(Constants.NS_SCHEMA_XSI))
+ return Constants.PREFIX_XSI;
+
+ String prefix = namespaceRegistry.getPrefix(namespace);
+
+ // Assume target namespace
+ return (prefix == null) ? Constants.PREFIX_TNS : prefix;
+ }
+}
\ No newline at end of file
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd (from
rev 1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/SchemaUtils.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/SchemaUtils.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,567 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.wsdl.xsd;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl;
-import org.apache.xerces.impl.xs.XMLSchemaLoader;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLErrorHandler;
-import org.apache.xerces.xs.StringList;
-import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSConstants;
-import org.apache.xerces.xs.XSElementDeclaration;
-import org.apache.xerces.xs.XSLoader;
-import org.apache.xerces.xs.XSModel;
-import org.apache.xerces.xs.XSModelGroup;
-import org.apache.xerces.xs.XSNamedMap;
-import org.apache.xerces.xs.XSObjectList;
-import org.apache.xerces.xs.XSParticle;
-import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.apache.xerces.xs.XSTerm;
-import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSSimpleTypeDefinition;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSStringList;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
-
-/**
- * Util class that deals with XML Schema
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- * @since Apr 12, 2005
- */
-public class SchemaUtils
-{
- private static SchemaUtils ourInstance = new SchemaUtils();
-
- protected static String xsNS = Constants.NS_SCHEMA_XSD;
-
- private static Map<Class, QName> toolsTypeMappingOverride = new
HashMap<Class, QName>();
-
- static
- {
- toolsTypeMappingOverride.put(byte[].class, Constants.TYPE_LITERAL_BASE64BINARY);
- }
-
- public static SchemaUtils getInstance()
- {
- return ourInstance;
- }
-
- private SchemaUtils()
- {
- }
-
- /**
- * Checks if the XS Particle is of array type
- * @param xsparticle
- * @return
- */
-
- public boolean isArrayType(XSParticle xsparticle)
- {
- //Determine if it is an arrayType
- int maxOccurs = xsparticle.getMaxOccurs();
- return xsparticle.getMaxOccursUnbounded() || maxOccurs > 1;
- }
-
- public static boolean isWrapperArrayType(XSTypeDefinition xst)
- {
- return unwrapArrayType(xst) != null;
- }
-
- public static XSElementDeclaration unwrapArrayType(XSTypeDefinition xst)
- {
- if (xst instanceof XSComplexTypeDefinition == false)
- return null;
-
- XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xst;
- if (xc.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
- return null;
-
- XSParticle xsp = xc.getParticle();
- if (xsp == null)
- return null;
-
- XSTerm xsterm = xsp.getTerm();
- if (xsterm instanceof XSModelGroup == false)
- return null;
-
- XSModelGroup xm = (XSModelGroup)xsterm;
- XSObjectList xo = xm.getParticles();
- if (xo.getLength() != 1)
- return null;
-
- XSParticle xp = (XSParticle)xo.item(0);
- XSTerm term = xp.getTerm();
- if ((xp.getMaxOccursUnbounded() || xp.getMaxOccurs() > 1) == false || term
instanceof XSElementDeclaration == false)
- return null;
-
- return (XSElementDeclaration)term;
- }
-
- /**
- * Generate a QName for a simple type
- * @param simple
- * @return
- */
- public static QName handleSimpleType(XSSimpleTypeDefinition simple)
- {
- if (simple == null)
- throw new IllegalArgumentException("XSSimpleTypeDefinition passed is
null");
-
- //Check if the type of SimpleType is a plain xsd type
- if (Constants.NS_SCHEMA_XSD.equals(simple.getNamespace()))
- return createQNameFromXSSimpleType(simple);
-
- switch (simple.getVariety())
- {
- case XSSimpleTypeDefinition.VARIETY_LIST:
- return handleSimpleType(simple.getItemType());
- case XSSimpleTypeDefinition.VARIETY_UNION:
- XSObjectList list = simple.getMemberTypes();
- if (list.getLength() > 0)
- return handleSimpleType((XSSimpleTypeDefinition)list.item(0));
- throw new WSException("Empty union type not expected");
- case XSSimpleTypeDefinition.VARIETY_ABSENT:
- throw new WSException("Absent variety is not supported in simple
types");
- }
-
- XSTypeDefinition base = simple.getBaseType();
- while (!Constants.NS_SCHEMA_XSD.equals(base.getNamespace()))
- base = base.getBaseType();
-
- if (!(base instanceof XSSimpleTypeDefinition))
- throw new WSException("Expected base type to be a simple type");
-
- return new QName(base.getNamespace(), base.getName());
- }
-
- /**
- * For the basic xsd types, patch prefix and ns uri
- * @param qname
- * @return
- */
- public QName patchXSDQName(QName qname)
- {
- if (qname == null)
- return null;
- return new QName(Constants.NS_SCHEMA_XSD, qname.getLocalPart(),
Constants.PREFIX_XSD);
- }
-
- /**
- * Given a XSTypeDefinition and the QName for the element,
- * create a XSElementDeclaration object
- * @param xmlName Name of the element
- * @param xst Type of the element
- * @return XSElementDeclaration
- */
- public XSElementDeclaration createXSElementDeclaration(QName xmlName, XSTypeDefinition
xst)
- {
- String name = xmlName.getLocalPart();
- String ns = xmlName.getNamespaceURI();
- JBossXSElementDeclaration jbel = new JBossXSElementDeclaration(name, ns);
- jbel.setTypeDefinition(xst);
- jbel.setScope(XSConstants.SCOPE_GLOBAL);
- return jbel;
- }
-
- /**
- * Create a QName given a Simple Type
- * @param xs
- * @return qname
- */
- public static QName createQNameFromXSSimpleType(XSSimpleTypeDefinition xs)
- {
- String nsuri = xs.getNamespace();
- String localpart = xs.getName();
- if (xsNS.equals(nsuri))
- return new QName(nsuri, localpart, Constants.PREFIX_XSD);
- else return new QName(nsuri, localpart);
- }
-
- /**
- * Return typemapping override for tools if any
- *
- * @param javaType
- * @return
- */
- public QName getToolsOverrideInTypeMapping(Class javaType)
- {
- return toolsTypeMappingOverride.get(javaType);
- }
-
- /**
- * Check if a global element exists
- * @param xmlName QName of the element that needs to be checked
- * @param xsmodel Schema model that is passed
- * @return
- */
- public boolean hasGlobalElement(QName xmlName, XSModel xsmodel)
- {
- if (xmlName == null)
- throw new IllegalArgumentException("xmlName is null");
- if (xsmodel == null)
- throw new IllegalArgumentException("XSModel is null");
- boolean bool = false;
- String name = xmlName.getLocalPart();
- if (name == null)
- throw new IllegalArgumentException("xmlName has a null name");
- String ns = xmlName.getNamespaceURI();
- if (ns == null)
- throw new IllegalArgumentException("xmlName has a null namespace");
- if (xsmodel.getElementDeclaration(name, ns) != null)
- bool = true;
- return bool;
- }
-
- /**
- * Check if a Complex Type exists
- * @param xmlType QName of the Complex Type that needs to be checked
- * @param xsmodel Schema model that is passed
- * @return
- */
- public boolean hasComplexTypeDefinition(QName xmlType, URL xsdLocation)
- {
- if (xsdLocation == null)
- throw new IllegalArgumentException("xsdLocation is null");
- XSModel xsmodel = parseSchema(xsdLocation);
- return this.hasComplexTypeDefinition(xmlType, xsmodel);
- }
-
- /**
- * Check if a Global Element exists
- * @param xmlType QName of the global element that needs to be checked
- * @param xsmodel Schema model that is passed
- * @return
- */
- public boolean hasGlobalElement(QName xmlName, URL xsdLocation)
- {
- if (xmlName == null)
- throw new IllegalArgumentException("xmlName is null");
- if (xsdLocation == null)
- throw new IllegalArgumentException("xsdLocation is null");
- XSModel xsmodel = parseSchema(xsdLocation);
- boolean bool = false;
- String name = xmlName.getLocalPart();
- if (name == null)
- throw new IllegalArgumentException("xmlName has a null name");
- String ns = xmlName.getNamespaceURI();
- if (ns == null)
- throw new IllegalArgumentException("xmlName has a null namespace");
- if (xsmodel.getElementDeclaration(name, ns) != null)
- bool = true;
- return bool;
- }
-
- /**
- * Check if a Complex Type exists
- * @param xmlType QName of the Complex Type that needs to be checked
- * @param xsmodel Schema model that is passed
- * @return
- */
- public boolean hasComplexTypeDefinition(QName xmlType, XSModel xsmodel)
- {
- if (xmlType == null)
- throw new IllegalArgumentException("xmlType is null");
- if (xsmodel == null)
- throw new IllegalArgumentException("XSModel is null");
- boolean bool = false;
- String name = xmlType.getLocalPart();
- if (name == null)
- throw new IllegalArgumentException("xmlName has a null name");
- String ns = xmlType.getNamespaceURI();
- if (ns == null)
- throw new IllegalArgumentException("xmlName has a null namespace");
- if (xsmodel.getTypeDefinition(name, ns) != null)
- bool = true;
- return bool;
- }
-
- /**
- * Get formatted string for the qname representing the xstype
- * @param xstype
- * @return
- */
- public String getFormattedString(XSTypeDefinition xstype)
- {
- String ns = xstype.getNamespace();
- String name = xstype.getName();
- if (!ns.equals(xsNS))
- name = getPrefix(ns) + ":" + name;
-
- return name;
- }
-
- /**
- * Get a QName for a xs type
- * @param xstype
- * @return
- */
- public QName getQName(XSTypeDefinition xstype)
- {
- String prefix = null;
- String ns = xstype.getNamespace();
- String name = xstype.getName();
- if (!ns.equals(xsNS))
- prefix = Constants.PREFIX_TNS;
- else prefix = Constants.PREFIX_XSD;
-
- return new QName(ns, name, prefix);
- }
-
- /**
- * Get a schema basic type
- * TODO: Migrate this off of the Xerces Impl
- * @param localpart
- * @return
- */
- public JBossXSTypeDefinition getSchemaBasicType(String localpart)
- {
- JBossXSTypeDefinition xt = null;
- /**
- * Special case: xs:anyType
- */
- if ("anyType".equals(localpart))
- {
- JBossXSComplexTypeDefinition ct = new JBossXSComplexTypeDefinition(localpart,
Constants.NS_SCHEMA_XSD);
- ct.setContentType(XSComplexTypeDefinition.CONTENTTYPE_EMPTY);
- xt = ct;
- }
- else
- {
- XSSimpleTypeDefinition xstype = (new
SchemaDVFactoryImpl()).getBuiltInType(localpart);
- xt = new JBossXSSimpleTypeDefinition(xstype);
-
- }
- return xt;
- }
-
- /**
- * Get an instance of XSLoader that is capable of
- * parsing schema files
- *
- * @return
- */
- public XSLoader getXSLoader()
- {
- XMLSchemaLoader xsloader = new XMLSchemaLoader();
- JBossXSErrorHandler eh = new JBossXSErrorHandler();
- xsloader.setErrorHandler(eh);
- return xsloader;
- }
-
- /**
- * Get an instance of XSLoader that is capable of
- * parsing schema files
- * @param xeh XML Error handler
- * @param xer XML Entity Resolver
- * @return
- */
- public XSLoader getXSLoader(XMLErrorHandler xeh, XMLEntityResolver xer)
- {
- XMLSchemaLoader xsloader = new XMLSchemaLoader();
- xsloader.setEntityResolver(xer);
- xsloader.setErrorHandler(xeh);
- return xsloader;
- }
-
- /**
- * Given a schema file, generate a schema model
- * @param schemaLoc java.net.URL object to the schema file
- * @return schema model
- */
- public XSModel parseSchema(URL schemaLoc)
- {
- return parseSchema(schemaLoc.toExternalForm());
- }
-
- /**
- * Given a schema file, generate a schema model
- * @param schemaLoc string representation to the location of schema
- * @return schema model
- */
- public XSModel parseSchema(String schemaLoc)
- {
- XSLoader xsloader = getXSLoader();
- XSModel xsModel = xsloader.loadURI(schemaLoc);
- if (xsModel == null)
- throw new WSException("Cannot parse schema: " + schemaLoc);
- return xsModel;
- }
-
- /**
- * Given a list of schema locations, parse and
- * provide a Xerces XSModel
- *
- * @param locations
- * @return
- */
- public XSModel parseSchema(List<String> locations)
- {
- JBossXSStringList slist = new JBossXSStringList(locations);
- XSLoader xsloader = getXSLoader();
- return xsloader.loadURIList(slist);
- }
-
- /**
- * Checks if the XSModel is empty
- * @param xsmodel
- * @return true (if empty) and false (if not empty)
- */
- public boolean isEmptySchema(XSModel xsmodel)
- {
- if (xsmodel == null)
- return true;
- String targetNS = getTargetNamespace(xsmodel);
- if (targetNS == null)
- throw new WSException("Target Namespace of xsmodel is null");
- XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION,
targetNS);
- XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION,
targetNS);
-
- if (tmap != null && tmap.getLength() > 0)
- return false;
- if (emap != null && emap.getLength() > 0)
- return false;
-
- return true;
- }
-
- /**
- * Checks if the XSModel is empty given a namespace
- * @param xsmodel Schema Model to check
- * @param namespace namespace to check components for
- * @return true (if empty) and false (if not empty)
- */
- public boolean isEmptySchema(XSModel xsmodel, String namespace)
- {
- if (xsmodel == null)
- return true;
- if (namespace == null)
- throw new WSException("Target Namespace of xsmodel is null");
- XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION,
namespace);
- XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION,
namespace);
-
- if (tmap != null && tmap.getLength() > 0)
- return false;
- if (emap != null && emap.getLength() > 0)
- return false;
-
- return true;
- }
-
- /**
- * Get the schema definitions as a String
- * @param targetNS The Target Namespace
- * @return
- */
- public static String getSchemaDefinitions(String targetNS)
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(" targetNamespace='" + targetNS + "'");
- buffer.append(" xmlns='" + Constants.NS_SCHEMA_XSD +
"'");
- buffer.append(" xmlns:" + Constants.PREFIX_SOAP11_ENC +
"='" + Constants.URI_SOAP11_ENC + "'");
- buffer.append(" xmlns:" + Constants.PREFIX_TNS + "='" +
targetNS + "'");
- //buffer.append(" xmlns:" + WSDLConstants.PREFIX_XSD + "='"
+ WSDLConstants.NS_SCHEMA_XSD + "'");
- buffer.append(" xmlns:" + Constants.PREFIX_XSI + "='" +
Constants.NS_SCHEMA_XSI + "'");
- buffer.append(">");
- return buffer.toString();
- }
-
- /** Get the temp file for a given namespace
- */
- public static File getSchemaTempFile(String targetNS) throws IOException
- {
- if (targetNS.length() == 0)
- throw new IllegalArgumentException("Invalid null target namespace");
-
- String fname = targetNS;
- if (fname.indexOf("://") > 0)
- fname = fname.substring(fname.indexOf("://") + 3);
-
- File tmpdir = null;
- try
- {
- ServerConfigFactory factory = ServerConfigFactory.getInstance();
- ServerConfig serverConfig = factory.getServerConfig();
- tmpdir = serverConfig.getServerTempDir();
- tmpdir = new File(tmpdir.getCanonicalPath() + "/jbossws");
- tmpdir.mkdirs();
- }
- catch (Throwable th)
- {
- // ignore if the server config cannot be found
- // this would be the case if we are on the client side
- }
-
- fname = fname.replace('/', '_');
- fname = fname.replace(':', '_');
- File file = File.createTempFile("JBossWS_" + fname, ".xsd",
tmpdir);
- return file;
- }
-
- /**
- * Get the TargetNamespace from the schema model
- */
- public static String getTargetNamespace(XSModel xsmodel)
- {
- if (xsmodel == null)
- throw new IllegalArgumentException("Illegal Null Argument: xsmodel");
- String targetNS = null;
- StringList slist = xsmodel.getNamespaces();
- int len = slist != null ? slist.getLength() : 0;
- for (int i = 0; i < len; i++)
- {
- String ns = slist.item(i);
- if (Constants.NS_SCHEMA_XSD.equals(ns))
- continue;
- targetNS = ns;
- break;
- }
- return targetNS;
- }
-
- private String getPrefix(String namespace)
- {
- if (Constants.URI_SOAP11_ENC.equals(namespace))
- return Constants.PREFIX_SOAP11_ENC;
- else if (Constants.NS_SOAP11_ENV.equals(namespace) ||
Constants.NS_SOAP12_ENV.equals(namespace))
- return Constants.PREFIX_ENV;
-
- // Fall back to target namespace even though this is incorrect
- return Constants.PREFIX_TNS;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/SchemaUtils.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/SchemaUtils.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,567 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.core.metadata.wsdl.xsd;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl;
+import org.apache.xerces.impl.xs.XMLSchemaLoader;
+import org.apache.xerces.xni.parser.XMLEntityResolver;
+import org.apache.xerces.xni.parser.XMLErrorHandler;
+import org.apache.xerces.xs.StringList;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSLoader;
+import org.apache.xerces.xs.XSModel;
+import org.apache.xerces.xs.XSModelGroup;
+import org.apache.xerces.xs.XSNamedMap;
+import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSParticle;
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSTerm;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSErrorHandler;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSSimpleTypeDefinition;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSStringList;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfigFactory;
+
+/**
+ * Util class that deals with XML Schema
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @since Apr 12, 2005
+ */
+public class SchemaUtils
+{
+ private static SchemaUtils ourInstance = new SchemaUtils();
+
+ protected static String xsNS = Constants.NS_SCHEMA_XSD;
+
+ private static Map<Class, QName> toolsTypeMappingOverride = new
HashMap<Class, QName>();
+
+ static
+ {
+ toolsTypeMappingOverride.put(byte[].class, Constants.TYPE_LITERAL_BASE64BINARY);
+ }
+
+ public static SchemaUtils getInstance()
+ {
+ return ourInstance;
+ }
+
+ private SchemaUtils()
+ {
+ }
+
+ /**
+ * Checks if the XS Particle is of array type
+ * @param xsparticle
+ * @return
+ */
+
+ public boolean isArrayType(XSParticle xsparticle)
+ {
+ //Determine if it is an arrayType
+ int maxOccurs = xsparticle.getMaxOccurs();
+ return xsparticle.getMaxOccursUnbounded() || maxOccurs > 1;
+ }
+
+ public static boolean isWrapperArrayType(XSTypeDefinition xst)
+ {
+ return unwrapArrayType(xst) != null;
+ }
+
+ public static XSElementDeclaration unwrapArrayType(XSTypeDefinition xst)
+ {
+ if (xst instanceof XSComplexTypeDefinition == false)
+ return null;
+
+ XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xst;
+ if (xc.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
+ return null;
+
+ XSParticle xsp = xc.getParticle();
+ if (xsp == null)
+ return null;
+
+ XSTerm xsterm = xsp.getTerm();
+ if (xsterm instanceof XSModelGroup == false)
+ return null;
+
+ XSModelGroup xm = (XSModelGroup)xsterm;
+ XSObjectList xo = xm.getParticles();
+ if (xo.getLength() != 1)
+ return null;
+
+ XSParticle xp = (XSParticle)xo.item(0);
+ XSTerm term = xp.getTerm();
+ if ((xp.getMaxOccursUnbounded() || xp.getMaxOccurs() > 1) == false || term
instanceof XSElementDeclaration == false)
+ return null;
+
+ return (XSElementDeclaration)term;
+ }
+
+ /**
+ * Generate a QName for a simple type
+ * @param simple
+ * @return
+ */
+ public static QName handleSimpleType(XSSimpleTypeDefinition simple)
+ {
+ if (simple == null)
+ throw new IllegalArgumentException("XSSimpleTypeDefinition passed is
null");
+
+ //Check if the type of SimpleType is a plain xsd type
+ if (Constants.NS_SCHEMA_XSD.equals(simple.getNamespace()))
+ return createQNameFromXSSimpleType(simple);
+
+ switch (simple.getVariety())
+ {
+ case XSSimpleTypeDefinition.VARIETY_LIST:
+ return handleSimpleType(simple.getItemType());
+ case XSSimpleTypeDefinition.VARIETY_UNION:
+ XSObjectList list = simple.getMemberTypes();
+ if (list.getLength() > 0)
+ return handleSimpleType((XSSimpleTypeDefinition)list.item(0));
+ throw new WSException("Empty union type not expected");
+ case XSSimpleTypeDefinition.VARIETY_ABSENT:
+ throw new WSException("Absent variety is not supported in simple
types");
+ }
+
+ XSTypeDefinition base = simple.getBaseType();
+ while (!Constants.NS_SCHEMA_XSD.equals(base.getNamespace()))
+ base = base.getBaseType();
+
+ if (!(base instanceof XSSimpleTypeDefinition))
+ throw new WSException("Expected base type to be a simple type");
+
+ return new QName(base.getNamespace(), base.getName());
+ }
+
+ /**
+ * For the basic xsd types, patch prefix and ns uri
+ * @param qname
+ * @return
+ */
+ public QName patchXSDQName(QName qname)
+ {
+ if (qname == null)
+ return null;
+ return new QName(Constants.NS_SCHEMA_XSD, qname.getLocalPart(),
Constants.PREFIX_XSD);
+ }
+
+ /**
+ * Given a XSTypeDefinition and the QName for the element,
+ * create a XSElementDeclaration object
+ * @param xmlName Name of the element
+ * @param xst Type of the element
+ * @return XSElementDeclaration
+ */
+ public XSElementDeclaration createXSElementDeclaration(QName xmlName, XSTypeDefinition
xst)
+ {
+ String name = xmlName.getLocalPart();
+ String ns = xmlName.getNamespaceURI();
+ JBossXSElementDeclaration jbel = new JBossXSElementDeclaration(name, ns);
+ jbel.setTypeDefinition(xst);
+ jbel.setScope(XSConstants.SCOPE_GLOBAL);
+ return jbel;
+ }
+
+ /**
+ * Create a QName given a Simple Type
+ * @param xs
+ * @return qname
+ */
+ public static QName createQNameFromXSSimpleType(XSSimpleTypeDefinition xs)
+ {
+ String nsuri = xs.getNamespace();
+ String localpart = xs.getName();
+ if (xsNS.equals(nsuri))
+ return new QName(nsuri, localpart, Constants.PREFIX_XSD);
+ else return new QName(nsuri, localpart);
+ }
+
+ /**
+ * Return typemapping override for tools if any
+ *
+ * @param javaType
+ * @return
+ */
+ public QName getToolsOverrideInTypeMapping(Class javaType)
+ {
+ return toolsTypeMappingOverride.get(javaType);
+ }
+
+ /**
+ * Check if a global element exists
+ * @param xmlName QName of the element that needs to be checked
+ * @param xsmodel Schema model that is passed
+ * @return
+ */
+ public boolean hasGlobalElement(QName xmlName, XSModel xsmodel)
+ {
+ if (xmlName == null)
+ throw new IllegalArgumentException("xmlName is null");
+ if (xsmodel == null)
+ throw new IllegalArgumentException("XSModel is null");
+ boolean bool = false;
+ String name = xmlName.getLocalPart();
+ if (name == null)
+ throw new IllegalArgumentException("xmlName has a null name");
+ String ns = xmlName.getNamespaceURI();
+ if (ns == null)
+ throw new IllegalArgumentException("xmlName has a null namespace");
+ if (xsmodel.getElementDeclaration(name, ns) != null)
+ bool = true;
+ return bool;
+ }
+
+ /**
+ * Check if a Complex Type exists
+ * @param xmlType QName of the Complex Type that needs to be checked
+ * @param xsmodel Schema model that is passed
+ * @return
+ */
+ public boolean hasComplexTypeDefinition(QName xmlType, URL xsdLocation)
+ {
+ if (xsdLocation == null)
+ throw new IllegalArgumentException("xsdLocation is null");
+ XSModel xsmodel = parseSchema(xsdLocation);
+ return this.hasComplexTypeDefinition(xmlType, xsmodel);
+ }
+
+ /**
+ * Check if a Global Element exists
+ * @param xmlType QName of the global element that needs to be checked
+ * @param xsmodel Schema model that is passed
+ * @return
+ */
+ public boolean hasGlobalElement(QName xmlName, URL xsdLocation)
+ {
+ if (xmlName == null)
+ throw new IllegalArgumentException("xmlName is null");
+ if (xsdLocation == null)
+ throw new IllegalArgumentException("xsdLocation is null");
+ XSModel xsmodel = parseSchema(xsdLocation);
+ boolean bool = false;
+ String name = xmlName.getLocalPart();
+ if (name == null)
+ throw new IllegalArgumentException("xmlName has a null name");
+ String ns = xmlName.getNamespaceURI();
+ if (ns == null)
+ throw new IllegalArgumentException("xmlName has a null namespace");
+ if (xsmodel.getElementDeclaration(name, ns) != null)
+ bool = true;
+ return bool;
+ }
+
+ /**
+ * Check if a Complex Type exists
+ * @param xmlType QName of the Complex Type that needs to be checked
+ * @param xsmodel Schema model that is passed
+ * @return
+ */
+ public boolean hasComplexTypeDefinition(QName xmlType, XSModel xsmodel)
+ {
+ if (xmlType == null)
+ throw new IllegalArgumentException("xmlType is null");
+ if (xsmodel == null)
+ throw new IllegalArgumentException("XSModel is null");
+ boolean bool = false;
+ String name = xmlType.getLocalPart();
+ if (name == null)
+ throw new IllegalArgumentException("xmlName has a null name");
+ String ns = xmlType.getNamespaceURI();
+ if (ns == null)
+ throw new IllegalArgumentException("xmlName has a null namespace");
+ if (xsmodel.getTypeDefinition(name, ns) != null)
+ bool = true;
+ return bool;
+ }
+
+ /**
+ * Get formatted string for the qname representing the xstype
+ * @param xstype
+ * @return
+ */
+ public String getFormattedString(XSTypeDefinition xstype)
+ {
+ String ns = xstype.getNamespace();
+ String name = xstype.getName();
+ if (!ns.equals(xsNS))
+ name = getPrefix(ns) + ":" + name;
+
+ return name;
+ }
+
+ /**
+ * Get a QName for a xs type
+ * @param xstype
+ * @return
+ */
+ public QName getQName(XSTypeDefinition xstype)
+ {
+ String prefix = null;
+ String ns = xstype.getNamespace();
+ String name = xstype.getName();
+ if (!ns.equals(xsNS))
+ prefix = Constants.PREFIX_TNS;
+ else prefix = Constants.PREFIX_XSD;
+
+ return new QName(ns, name, prefix);
+ }
+
+ /**
+ * Get a schema basic type
+ * TODO: Migrate this off of the Xerces Impl
+ * @param localpart
+ * @return
+ */
+ public JBossXSTypeDefinition getSchemaBasicType(String localpart)
+ {
+ JBossXSTypeDefinition xt = null;
+ /**
+ * Special case: xs:anyType
+ */
+ if ("anyType".equals(localpart))
+ {
+ JBossXSComplexTypeDefinition ct = new JBossXSComplexTypeDefinition(localpart,
Constants.NS_SCHEMA_XSD);
+ ct.setContentType(XSComplexTypeDefinition.CONTENTTYPE_EMPTY);
+ xt = ct;
+ }
+ else
+ {
+ XSSimpleTypeDefinition xstype = (new
SchemaDVFactoryImpl()).getBuiltInType(localpart);
+ xt = new JBossXSSimpleTypeDefinition(xstype);
+
+ }
+ return xt;
+ }
+
+ /**
+ * Get an instance of XSLoader that is capable of
+ * parsing schema files
+ *
+ * @return
+ */
+ public XSLoader getXSLoader()
+ {
+ XMLSchemaLoader xsloader = new XMLSchemaLoader();
+ JBossXSErrorHandler eh = new JBossXSErrorHandler();
+ xsloader.setErrorHandler(eh);
+ return xsloader;
+ }
+
+ /**
+ * Get an instance of XSLoader that is capable of
+ * parsing schema files
+ * @param xeh XML Error handler
+ * @param xer XML Entity Resolver
+ * @return
+ */
+ public XSLoader getXSLoader(XMLErrorHandler xeh, XMLEntityResolver xer)
+ {
+ XMLSchemaLoader xsloader = new XMLSchemaLoader();
+ xsloader.setEntityResolver(xer);
+ xsloader.setErrorHandler(xeh);
+ return xsloader;
+ }
+
+ /**
+ * Given a schema file, generate a schema model
+ * @param schemaLoc java.net.URL object to the schema file
+ * @return schema model
+ */
+ public XSModel parseSchema(URL schemaLoc)
+ {
+ return parseSchema(schemaLoc.toExternalForm());
+ }
+
+ /**
+ * Given a schema file, generate a schema model
+ * @param schemaLoc string representation to the location of schema
+ * @return schema model
+ */
+ public XSModel parseSchema(String schemaLoc)
+ {
+ XSLoader xsloader = getXSLoader();
+ XSModel xsModel = xsloader.loadURI(schemaLoc);
+ if (xsModel == null)
+ throw new WSException("Cannot parse schema: " + schemaLoc);
+ return xsModel;
+ }
+
+ /**
+ * Given a list of schema locations, parse and
+ * provide a Xerces XSModel
+ *
+ * @param locations
+ * @return
+ */
+ public XSModel parseSchema(List<String> locations)
+ {
+ JBossXSStringList slist = new JBossXSStringList(locations);
+ XSLoader xsloader = getXSLoader();
+ return xsloader.loadURIList(slist);
+ }
+
+ /**
+ * Checks if the XSModel is empty
+ * @param xsmodel
+ * @return true (if empty) and false (if not empty)
+ */
+ public boolean isEmptySchema(XSModel xsmodel)
+ {
+ if (xsmodel == null)
+ return true;
+ String targetNS = getTargetNamespace(xsmodel);
+ if (targetNS == null)
+ throw new WSException("Target Namespace of xsmodel is null");
+ XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION,
targetNS);
+ XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION,
targetNS);
+
+ if (tmap != null && tmap.getLength() > 0)
+ return false;
+ if (emap != null && emap.getLength() > 0)
+ return false;
+
+ return true;
+ }
+
+ /**
+ * Checks if the XSModel is empty given a namespace
+ * @param xsmodel Schema Model to check
+ * @param namespace namespace to check components for
+ * @return true (if empty) and false (if not empty)
+ */
+ public boolean isEmptySchema(XSModel xsmodel, String namespace)
+ {
+ if (xsmodel == null)
+ return true;
+ if (namespace == null)
+ throw new WSException("Target Namespace of xsmodel is null");
+ XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION,
namespace);
+ XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION,
namespace);
+
+ if (tmap != null && tmap.getLength() > 0)
+ return false;
+ if (emap != null && emap.getLength() > 0)
+ return false;
+
+ return true;
+ }
+
+ /**
+ * Get the schema definitions as a String
+ * @param targetNS The Target Namespace
+ * @return
+ */
+ public static String getSchemaDefinitions(String targetNS)
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append(" targetNamespace='" + targetNS + "'");
+ buffer.append(" xmlns='" + Constants.NS_SCHEMA_XSD +
"'");
+ buffer.append(" xmlns:" + Constants.PREFIX_SOAP11_ENC +
"='" + Constants.URI_SOAP11_ENC + "'");
+ buffer.append(" xmlns:" + Constants.PREFIX_TNS + "='" +
targetNS + "'");
+ //buffer.append(" xmlns:" + WSDLConstants.PREFIX_XSD + "='"
+ WSDLConstants.NS_SCHEMA_XSD + "'");
+ buffer.append(" xmlns:" + Constants.PREFIX_XSI + "='" +
Constants.NS_SCHEMA_XSI + "'");
+ buffer.append(">");
+ return buffer.toString();
+ }
+
+ /** Get the temp file for a given namespace
+ */
+ public static File getSchemaTempFile(String targetNS) throws IOException
+ {
+ if (targetNS.length() == 0)
+ throw new IllegalArgumentException("Invalid null target namespace");
+
+ String fname = targetNS;
+ if (fname.indexOf("://") > 0)
+ fname = fname.substring(fname.indexOf("://") + 3);
+
+ File tmpdir = null;
+ try
+ {
+ ServerConfigFactory factory = ServerConfigFactory.getInstance();
+ ServerConfig serverConfig = factory.getServerConfig();
+ tmpdir = serverConfig.getServerTempDir();
+ tmpdir = new File(tmpdir.getCanonicalPath() + "/jbossws");
+ tmpdir.mkdirs();
+ }
+ catch (Throwable th)
+ {
+ // ignore if the server config cannot be found
+ // this would be the case if we are on the client side
+ }
+
+ fname = fname.replace('/', '_');
+ fname = fname.replace(':', '_');
+ File file = File.createTempFile("JBossWS_" + fname, ".xsd",
tmpdir);
+ return file;
+ }
+
+ /**
+ * Get the TargetNamespace from the schema model
+ */
+ public static String getTargetNamespace(XSModel xsmodel)
+ {
+ if (xsmodel == null)
+ throw new IllegalArgumentException("Illegal Null Argument: xsmodel");
+ String targetNS = null;
+ StringList slist = xsmodel.getNamespaces();
+ int len = slist != null ? slist.getLength() : 0;
+ for (int i = 0; i < len; i++)
+ {
+ String ns = slist.item(i);
+ if (Constants.NS_SCHEMA_XSD.equals(ns))
+ continue;
+ targetNS = ns;
+ break;
+ }
+ return targetNS;
+ }
+
+ private String getPrefix(String namespace)
+ {
+ if (Constants.URI_SOAP11_ENC.equals(namespace))
+ return Constants.PREFIX_SOAP11_ENC;
+ else if (Constants.NS_SOAP11_ENV.equals(namespace) ||
Constants.NS_SOAP12_ENV.equals(namespace))
+ return Constants.PREFIX_ENV;
+
+ // Fall back to target namespace even though this is incorrect
+ return Constants.PREFIX_TNS;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/XSDWriter.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/XSDWriter.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,118 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsdl.xsd;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URL;
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
-
-/**
- * XML Schema File Writer
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- */
-public class XSDWriter
-{
- // provide logging
- protected static final Logger log = Logger.getLogger(XSDWriter.class);
-
- protected WSDLDefinitions wsdl = null;
-
- protected SchemaUtils schemautils = SchemaUtils.getInstance();
-
- protected WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
-
- public void writeXSD(Writer writer, XSModel xsmodel, WSDLDefinitions wsdl)
- {
- if (xsmodel == null)
- throw new IllegalArgumentException("xsmodel is NULL");
-
- this.wsdl = wsdl;
-
- if (schemautils.isEmptySchema(xsmodel)) return;
- }
-
- /**
- * Serialize the schema into a temp file
- * @param xsmodel Schema model
- * @param ns Target Namespace
- * @return URL of the temp file where the schema exists
- * @throws IOException
- */
- public URL serialize( XSModel xsmodel, String ns)
- throws IOException
- {
- if(ns == null)
- throw new IllegalArgumentException("Illegal Null Argument:ns");
- String xsdString = "";
- if(xsmodel instanceof JBossXSModel)
- {
- JBossXSModel jbxs = (JBossXSModel)xsmodel;
- xsdString = jbxs.serialize();
- }
- else
- {
- // Serialize XSD model
- StringWriter strwr = new StringWriter();
- sutils.serialize(xsmodel, strwr);
- xsdString = strwr.toString();
- }
-
- log.trace("serialize:\n" + xsdString);
-
- // Write updated xsd file
- File xsdFile = SchemaUtils.getSchemaTempFile(ns);
- FileWriter writer = new FileWriter(xsdFile);
- writer.write(xsdString);
- writer.close();
-
- return xsdFile.toURL();
- }
-
- /**
- * Serialize the schema into a output stream
- * @param xsmodel Schema model
- * @param ns Target Namespace
- * @param os OutputStream to write into
- * @throws IOException
- */
- public void serialize( XSModel xsmodel, String ns, OutputStream os)
- throws IOException
- {
- // Serialize XSD model
- StringWriter strwr = new StringWriter();
- sutils.serialize(xsmodel, strwr);
- String xsdString = strwr.toString();
- log.trace("serialize:" + xsdString);
-
- os.write(xsdString.getBytes());
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/XSDWriter.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsdl/xsd/XSDWriter.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,118 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsdl.xsd;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URL;
+
+import org.apache.xerces.xs.XSModel;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.WSSchemaUtils;
+
+/**
+ * XML Schema File Writer
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ */
+public class XSDWriter
+{
+ // provide logging
+ protected static final Logger log = Logger.getLogger(XSDWriter.class);
+
+ protected WSDLDefinitions wsdl = null;
+
+ protected SchemaUtils schemautils = SchemaUtils.getInstance();
+
+ protected WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
+
+ public void writeXSD(Writer writer, XSModel xsmodel, WSDLDefinitions wsdl)
+ {
+ if (xsmodel == null)
+ throw new IllegalArgumentException("xsmodel is NULL");
+
+ this.wsdl = wsdl;
+
+ if (schemautils.isEmptySchema(xsmodel)) return;
+ }
+
+ /**
+ * Serialize the schema into a temp file
+ * @param xsmodel Schema model
+ * @param ns Target Namespace
+ * @return URL of the temp file where the schema exists
+ * @throws IOException
+ */
+ public URL serialize( XSModel xsmodel, String ns)
+ throws IOException
+ {
+ if(ns == null)
+ throw new IllegalArgumentException("Illegal Null Argument:ns");
+ String xsdString = "";
+ if(xsmodel instanceof JBossXSModel)
+ {
+ JBossXSModel jbxs = (JBossXSModel)xsmodel;
+ xsdString = jbxs.serialize();
+ }
+ else
+ {
+ // Serialize XSD model
+ StringWriter strwr = new StringWriter();
+ sutils.serialize(xsmodel, strwr);
+ xsdString = strwr.toString();
+ }
+
+ log.trace("serialize:\n" + xsdString);
+
+ // Write updated xsd file
+ File xsdFile = SchemaUtils.getSchemaTempFile(ns);
+ FileWriter writer = new FileWriter(xsdFile);
+ writer.write(xsdString);
+ writer.close();
+
+ return xsdFile.toURL();
+ }
+
+ /**
+ * Serialize the schema into a output stream
+ * @param xsmodel Schema model
+ * @param ns Target Namespace
+ * @param os OutputStream to write into
+ * @throws IOException
+ */
+ public void serialize( XSModel xsmodel, String ns, OutputStream os)
+ throws IOException
+ {
+ // Serialize XSD model
+ StringWriter strwr = new StringWriter();
+ sutils.serialize(xsmodel, strwr);
+ String xsdString = strwr.toString();
+ log.trace("serialize:" + xsdString);
+
+ os.write(xsdString.getBytes());
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse (from rev
1564, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse)
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Config.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Config.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Config.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,95 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-
-/**
- * <code>Config</code> represents the config tag.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Config implements Serializable
-{
- private static final long serialVersionUID = 4219543242657899910L;
-
- private Timestamp timestamp;
-
- private Username username;
-
- private Sign sign;
-
- private Encrypt encrypt;
-
- private Requires requires;
-
- public Encrypt getEncrypt()
- {
- return encrypt;
- }
-
- public void setEncrypt(Encrypt encrypt)
- {
- this.encrypt = encrypt;
- }
-
- public Sign getSign()
- {
- return sign;
- }
-
- public void setSign(Sign sign)
- {
- this.sign = sign;
- }
-
- public Timestamp getTimestamp()
- {
- return timestamp;
- }
-
- public void setTimestamp(Timestamp timestamp)
- {
- this.timestamp = timestamp;
- }
-
- public Username getUsername()
- {
- return username;
- }
-
- public void setUsername(Username username)
- {
- this.username = username;
- }
-
- public Requires getRequires()
- {
- return requires;
- }
-
- public void setRequires(Requires requires)
- {
- this.requires = requires;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Config.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Config.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Config.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Config.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,95 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+
+/**
+ * <code>Config</code> represents the config tag.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class Config implements Serializable
+{
+ private static final long serialVersionUID = 4219543242657899910L;
+
+ private Timestamp timestamp;
+
+ private Username username;
+
+ private Sign sign;
+
+ private Encrypt encrypt;
+
+ private Requires requires;
+
+ public Encrypt getEncrypt()
+ {
+ return encrypt;
+ }
+
+ public void setEncrypt(Encrypt encrypt)
+ {
+ this.encrypt = encrypt;
+ }
+
+ public Sign getSign()
+ {
+ return sign;
+ }
+
+ public void setSign(Sign sign)
+ {
+ this.sign = sign;
+ }
+
+ public Timestamp getTimestamp()
+ {
+ return timestamp;
+ }
+
+ public void setTimestamp(Timestamp timestamp)
+ {
+ this.timestamp = timestamp;
+ }
+
+ public Username getUsername()
+ {
+ return username;
+ }
+
+ public void setUsername(Username username)
+ {
+ this.username = username;
+ }
+
+ public Requires getRequires()
+ {
+ return requires;
+ }
+
+ public void setRequires(Requires requires)
+ {
+ this.requires = requires;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Encrypt.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Encrypt.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,79 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-
-/**
- * <code>Encrypt</code> represents the encrypt tag, which signifies that the
- * message should be encrypted.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Encrypt extends Targetable implements Serializable
-{
- private static final long serialVersionUID = -2802677183149218760L;
-
- private String type;
-
- private String alias;
-
- private String algorithm;
-
- public Encrypt(String type, String alias, String algorithm)
- {
- this.type = type;
- this.alias = alias;
- this.algorithm = algorithm;
- }
-
- public String getAlias()
- {
- return alias;
- }
-
- public void setAlias(String alias)
- {
- this.alias = alias;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getAlgorithm()
- {
- return algorithm;
- }
-
- public void setAlgorithm(String algorithm)
- {
- this.algorithm = algorithm;
- }
-}
\ No newline at end of file
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Encrypt.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Encrypt.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,79 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+
+/**
+ * <code>Encrypt</code> represents the encrypt tag, which signifies that the
+ * message should be encrypted.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class Encrypt extends Targetable implements Serializable
+{
+ private static final long serialVersionUID = -2802677183149218760L;
+
+ private String type;
+
+ private String alias;
+
+ private String algorithm;
+
+ public Encrypt(String type, String alias, String algorithm)
+ {
+ this.type = type;
+ this.alias = alias;
+ this.algorithm = algorithm;
+ }
+
+ public String getAlias()
+ {
+ return alias;
+ }
+
+ public void setAlias(String alias)
+ {
+ this.alias = alias;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public String getAlgorithm()
+ {
+ return algorithm;
+ }
+
+ public void setAlgorithm(String algorithm)
+ {
+ this.algorithm = algorithm;
+ }
+}
\ No newline at end of file
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Operation.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Operation.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Operation.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,65 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-
-/**
- * <code>Operation</code> represents a wsdl operation. Used to declare per
- * operation configurations.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Operation implements Serializable
-{
- private static final long serialVersionUID = 4223295703633326725L;
-
- private Config config;
-
- private String name;
-
- public Operation(String name)
- {
- this.name = name;
- }
-
- public Config getConfig()
- {
- return config;
- }
-
- public void setConfig(Config config)
- {
- this.config = config;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Operation.java (from
rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Operation.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Operation.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Operation.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+
+/**
+ * <code>Operation</code> represents a wsdl operation. Used to declare per
+ * operation configurations.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class Operation implements Serializable
+{
+ private static final long serialVersionUID = 4223295703633326725L;
+
+ private Config config;
+
+ private String name;
+
+ public Operation(String name)
+ {
+ this.name = name;
+ }
+
+ public Config getConfig()
+ {
+ return config;
+ }
+
+ public void setConfig(Config config)
+ {
+ this.config = config;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Port.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Port.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Port.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,83 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-import java.util.HashMap;
-
-/**
- * <code>Port</code> represents a per wsdl port configuration for a
- * security configuration.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Port implements Serializable
-{
- private static final long serialVersionUID = 8294850341855208663L;
-
- private String name;
-
- private Config defaultConfig;
-
- private HashMap<String, Operation> operations = new HashMap<String,
Operation>();
-
- public Port(String name)
- {
- this.name = name;
- }
-
- public Config getDefaultConfig()
- {
- return defaultConfig;
- }
-
- public void setDefaultConfig(Config defaultConfig)
- {
- this.defaultConfig = defaultConfig;
- }
-
- public HashMap<String, Operation> getOperations()
- {
- return operations;
- }
-
- public void setOperations(HashMap<String, Operation> operations)
- {
- this.operations = operations;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public void addOperation(Operation operation)
- {
- operations.put(operation.getName(), operation);
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Port.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Port.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Port.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Port.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,83 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+import java.util.HashMap;
+
+/**
+ * <code>Port</code> represents a per wsdl port configuration for a
+ * security configuration.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class Port implements Serializable
+{
+ private static final long serialVersionUID = 8294850341855208663L;
+
+ private String name;
+
+ private Config defaultConfig;
+
+ private HashMap<String, Operation> operations = new HashMap<String,
Operation>();
+
+ public Port(String name)
+ {
+ this.name = name;
+ }
+
+ public Config getDefaultConfig()
+ {
+ return defaultConfig;
+ }
+
+ public void setDefaultConfig(Config defaultConfig)
+ {
+ this.defaultConfig = defaultConfig;
+ }
+
+ public HashMap<String, Operation> getOperations()
+ {
+ return operations;
+ }
+
+ public void setOperations(HashMap<String, Operation> operations)
+ {
+ this.operations = operations;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public void addOperation(Operation operation)
+ {
+ operations.put(operation.getName(), operation);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireEncryption.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireEncryption.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,34 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-/**
- * <code>Sign</code> represents the sign tag, which declares that a message
- * should be signed.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class RequireEncryption extends Targetable
-{
- private static final long serialVersionUID = 3765798680988205647L;
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireEncryption.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireEncryption.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+/**
+ * <code>Sign</code> represents the sign tag, which declares that a message
+ * should be signed.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class RequireEncryption extends Targetable
+{
+ private static final long serialVersionUID = 3765798680988205647L;
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireSignature.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireSignature.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,34 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-/**
- * <code>Sign</code> represents the sign tag, which declares that a message
- * should be signed.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class RequireSignature extends Targetable
-{
- private static final long serialVersionUID = -3854930944550152309L;
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireSignature.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireSignature.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+/**
+ * <code>Sign</code> represents the sign tag, which declares that a message
+ * should be signed.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class RequireSignature extends Targetable
+{
+ private static final long serialVersionUID = -3854930944550152309L;
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireTimestamp.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireTimestamp.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireTimestamp.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,47 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-
-
-public class RequireTimestamp implements Serializable
-{
- private static final long serialVersionUID = 278316358447518411L;
-
- private String maxAge;
-
- public RequireTimestamp(String maxAge)
- {
- this.maxAge = maxAge;
- }
-
- public String getMaxAge()
- {
- return maxAge;
- }
-
- public void setMaxAge(String maxAge)
- {
- this.maxAge = maxAge;
- }
-}
\ No newline at end of file
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireTimestamp.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireTimestamp.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/RequireTimestamp.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/RequireTimestamp.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+
+
+public class RequireTimestamp implements Serializable
+{
+ private static final long serialVersionUID = 278316358447518411L;
+
+ private String maxAge;
+
+ public RequireTimestamp(String maxAge)
+ {
+ this.maxAge = maxAge;
+ }
+
+ public String getMaxAge()
+ {
+ return maxAge;
+ }
+
+ public void setMaxAge(String maxAge)
+ {
+ this.maxAge = maxAge;
+ }
+}
\ No newline at end of file
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Requires.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Requires.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Requires.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,71 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-
-/**
- * <code>Requires</code> represents the require tag.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Requires implements Serializable
-{
- private static final long serialVersionUID = 6899913633295989845L;
-
- private RequireTimestamp requireTimestamp;
-
- private RequireSignature requireSignature;
-
- private RequireEncryption requireEncryption;
-
- public RequireEncryption getRequireEncryption()
- {
- return requireEncryption;
- }
-
- public void setRequireEncryption(RequireEncryption requireEncryption)
- {
- this.requireEncryption = requireEncryption;
- }
-
- public RequireSignature getRequireSignature()
- {
- return requireSignature;
- }
-
- public void setRequireSignature(RequireSignature requireSignature)
- {
- this.requireSignature = requireSignature;
- }
-
- public RequireTimestamp getRequireTimestamp()
- {
- return requireTimestamp;
- }
-
- public void setRequireTimestamp(RequireTimestamp requireTimestamp)
- {
- this.requireTimestamp = requireTimestamp;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Requires.java (from
rev 1565, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Requires.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Requires.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Requires.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+
+/**
+ * <code>Requires</code> represents the require tag.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class Requires implements Serializable
+{
+ private static final long serialVersionUID = 6899913633295989845L;
+
+ private RequireTimestamp requireTimestamp;
+
+ private RequireSignature requireSignature;
+
+ private RequireEncryption requireEncryption;
+
+ public RequireEncryption getRequireEncryption()
+ {
+ return requireEncryption;
+ }
+
+ public void setRequireEncryption(RequireEncryption requireEncryption)
+ {
+ this.requireEncryption = requireEncryption;
+ }
+
+ public RequireSignature getRequireSignature()
+ {
+ return requireSignature;
+ }
+
+ public void setRequireSignature(RequireSignature requireSignature)
+ {
+ this.requireSignature = requireSignature;
+ }
+
+ public RequireTimestamp getRequireTimestamp()
+ {
+ return requireTimestamp;
+ }
+
+ public void setRequireTimestamp(RequireTimestamp requireTimestamp)
+ {
+ this.requireTimestamp = requireTimestamp;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Sign.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Sign.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Sign.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,77 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-/**
- * <code>Sign</code> represents the sign tag, which declares that a message
- * should be signed.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Sign extends Targetable
-{
- private static final long serialVersionUID = -2645745357707804441L;
-
- private String type;
-
- private String alias;
-
- private boolean includeTimestamp;
-
- public Sign(String type, String alias, boolean includeTimestamp)
- {
- this.type = type;
- this.alias = alias;
- this.includeTimestamp = includeTimestamp;
- }
-
- public String getAlias()
- {
- return alias;
- }
-
- public void setAlias(String alias)
- {
- this.alias = alias;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public boolean isIncludeTimestamp()
- {
- return includeTimestamp;
- }
-
- public void setIncludeTimestamp(boolean includeTimestamp)
- {
- this.includeTimestamp = includeTimestamp;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Sign.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Sign.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Sign.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Sign.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,77 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+/**
+ * <code>Sign</code> represents the sign tag, which declares that a message
+ * should be signed.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class Sign extends Targetable
+{
+ private static final long serialVersionUID = -2645745357707804441L;
+
+ private String type;
+
+ private String alias;
+
+ private boolean includeTimestamp;
+
+ public Sign(String type, String alias, boolean includeTimestamp)
+ {
+ this.type = type;
+ this.alias = alias;
+ this.includeTimestamp = includeTimestamp;
+ }
+
+ public String getAlias()
+ {
+ return alias;
+ }
+
+ public void setAlias(String alias)
+ {
+ this.alias = alias;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public boolean isIncludeTimestamp()
+ {
+ return includeTimestamp;
+ }
+
+ public void setIncludeTimestamp(boolean includeTimestamp)
+ {
+ this.includeTimestamp = includeTimestamp;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Target.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Target.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Target.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,76 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-
-/**
- * <code>Target</code> represents the target tag.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Target implements Serializable
-{
- private static final long serialVersionUID = 5718485529854012480L;
-
- private String type;
-
- private String value;
-
- private boolean contentOnly;
-
- public Target(String type)
- {
- this.type = type;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getValue()
- {
- return value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
- public boolean isContentOnly()
- {
- return contentOnly;
- }
-
- public void setContentOnly(boolean contentOnly)
- {
- this.contentOnly = contentOnly;
- }
-}
\ No newline at end of file
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Target.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Target.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Target.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Target.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,76 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+
+/**
+ * <code>Target</code> represents the target tag.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class Target implements Serializable
+{
+ private static final long serialVersionUID = 5718485529854012480L;
+
+ private String type;
+
+ private String value;
+
+ private boolean contentOnly;
+
+ public Target(String type)
+ {
+ this.type = type;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+ public boolean isContentOnly()
+ {
+ return contentOnly;
+ }
+
+ public void setContentOnly(boolean contentOnly)
+ {
+ this.contentOnly = contentOnly;
+ }
+}
\ No newline at end of file
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Targetable.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Targetable.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Targetable.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,57 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-
-/**
- * <code>Targetable</code> is the base class for tags which support target
- * tags as child elements.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class Targetable implements Serializable
-{
- private static final long serialVersionUID = -4034435076127402668L;
-
- private ArrayList<Target> targets;
-
- public ArrayList<Target> getTargets()
- {
- return targets;
- }
-
- public void setTargets(ArrayList<Target> targets)
- {
- this.targets = targets;
- }
-
- public void addTarget(Target target)
- {
- if (targets == null)
- targets = new ArrayList<Target>();
-
- targets.add(target);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Targetable.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Targetable.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Targetable.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Targetable.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+
+/**
+ * <code>Targetable</code> is the base class for tags which support target
+ * tags as child elements.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class Targetable implements Serializable
+{
+ private static final long serialVersionUID = -4034435076127402668L;
+
+ private ArrayList<Target> targets;
+
+ public ArrayList<Target> getTargets()
+ {
+ return targets;
+ }
+
+ public void setTargets(ArrayList<Target> targets)
+ {
+ this.targets = targets;
+ }
+
+ public void addTarget(Target target)
+ {
+ if (targets == null)
+ targets = new ArrayList<Target>();
+
+ targets.add(target);
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Timestamp.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Timestamp.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Timestamp.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,47 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-
-
-public class Timestamp implements Serializable
-{
- private static final long serialVersionUID = 8273360977250180943L;
-
- private String ttl;
-
- public Timestamp(String ttl)
- {
- this.ttl = ttl;
- }
-
- public String getTtl()
- {
- return ttl;
- }
-
- public void setTtl(String ttl)
- {
- this.ttl = ttl;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Timestamp.java (from
rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Timestamp.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Timestamp.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Timestamp.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+
+
+public class Timestamp implements Serializable
+{
+ private static final long serialVersionUID = 8273360977250180943L;
+
+ private String ttl;
+
+ public Timestamp(String ttl)
+ {
+ this.ttl = ttl;
+ }
+
+ public String getTtl()
+ {
+ return ttl;
+ }
+
+ public void setTtl(String ttl)
+ {
+ this.ttl = ttl;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Username.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Username.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,30 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-
-
-public class Username implements Serializable
-{
- private static final long serialVersionUID = 8273360977250180943L;
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Username.java (from
rev 1565, branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/Username.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/Username.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,30 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+
+
+public class Username implements Serializable
+{
+ private static final long serialVersionUID = 8273360977250180943L;
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfiguration.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfiguration.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,162 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.Serializable;
-import java.net.URL;
-import java.util.HashMap;
-
-/**
- * Root configuration class, represents the "jboss-ws-security" tag.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class WSSecurityConfiguration implements Serializable
-{
- private static final long serialVersionUID = 1022564645797303076L;
-
- private Config defaultConfig;
-
- private HashMap<String, Port> ports = new HashMap<String, Port>();
-
- private String keyStoreFile;
-
- private URL keyStoreURL;
-
- private String keyStoreType;
-
- private String keyStorePassword;
-
- private String trustStoreFile;
-
- private URL trustStoreURL;
-
- private String trustStoreType;
-
- private String trustStorePassword;
-
- public Config getDefaultConfig()
- {
- return defaultConfig;
- }
-
- public void setDefaultConfig(Config defaultConfig)
- {
- this.defaultConfig = defaultConfig;
- }
-
- public HashMap<String, Port> getPorts()
- {
- return ports;
- }
-
- public void setPorts(HashMap<String, Port> ports)
- {
- this.ports = ports;
- }
-
- public String getKeyStoreFile()
- {
- return keyStoreFile;
- }
-
- public void setKeyStoreFile(String keyStoreFile)
- {
- this.keyStoreFile = keyStoreFile;
- }
-
- public URL getKeyStoreURL()
- {
- return keyStoreURL;
- }
-
- public void setKeyStoreURL(URL keyStoreURL)
- {
- this.keyStoreURL = keyStoreURL;
- }
-
- public void addPort(Port port)
- {
- this.ports.put(port.getName(), port);
- }
-
- public String getKeyStorePassword()
- {
- return keyStorePassword;
- }
-
- public void setKeyStorePassword(String keyStorePassword)
- {
- this.keyStorePassword = keyStorePassword;
- }
-
- public String getKeyStoreType()
- {
- return keyStoreType;
- }
-
- public void setKeyStoreType(String keyStoreType)
- {
- this.keyStoreType = keyStoreType;
- }
-
- public String getTrustStorePassword()
- {
- return trustStorePassword;
- }
-
- public void setTrustStorePassword(String trustStorePassword)
- {
- this.trustStorePassword = trustStorePassword;
- }
-
- public String getTrustStoreType()
- {
- return trustStoreType;
- }
-
- public void setTrustStoreType(String trustStoreType)
- {
- this.trustStoreType = trustStoreType;
- }
-
- public URL getTrustStoreURL()
- {
- return trustStoreURL;
- }
-
- public void setTrustStoreURL(URL trustStoreURL)
- {
- this.trustStoreURL = trustStoreURL;
- }
-
- public String getTrustStoreFile()
- {
- return trustStoreFile;
- }
-
- public void setTrustStoreFile(String trustStoreFile)
- {
- this.trustStoreFile = trustStoreFile;
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfiguration.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfiguration.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfiguration.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,162 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.Serializable;
+import java.net.URL;
+import java.util.HashMap;
+
+/**
+ * Root configuration class, represents the "jboss-ws-security" tag.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WSSecurityConfiguration implements Serializable
+{
+ private static final long serialVersionUID = 1022564645797303076L;
+
+ private Config defaultConfig;
+
+ private HashMap<String, Port> ports = new HashMap<String, Port>();
+
+ private String keyStoreFile;
+
+ private URL keyStoreURL;
+
+ private String keyStoreType;
+
+ private String keyStorePassword;
+
+ private String trustStoreFile;
+
+ private URL trustStoreURL;
+
+ private String trustStoreType;
+
+ private String trustStorePassword;
+
+ public Config getDefaultConfig()
+ {
+ return defaultConfig;
+ }
+
+ public void setDefaultConfig(Config defaultConfig)
+ {
+ this.defaultConfig = defaultConfig;
+ }
+
+ public HashMap<String, Port> getPorts()
+ {
+ return ports;
+ }
+
+ public void setPorts(HashMap<String, Port> ports)
+ {
+ this.ports = ports;
+ }
+
+ public String getKeyStoreFile()
+ {
+ return keyStoreFile;
+ }
+
+ public void setKeyStoreFile(String keyStoreFile)
+ {
+ this.keyStoreFile = keyStoreFile;
+ }
+
+ public URL getKeyStoreURL()
+ {
+ return keyStoreURL;
+ }
+
+ public void setKeyStoreURL(URL keyStoreURL)
+ {
+ this.keyStoreURL = keyStoreURL;
+ }
+
+ public void addPort(Port port)
+ {
+ this.ports.put(port.getName(), port);
+ }
+
+ public String getKeyStorePassword()
+ {
+ return keyStorePassword;
+ }
+
+ public void setKeyStorePassword(String keyStorePassword)
+ {
+ this.keyStorePassword = keyStorePassword;
+ }
+
+ public String getKeyStoreType()
+ {
+ return keyStoreType;
+ }
+
+ public void setKeyStoreType(String keyStoreType)
+ {
+ this.keyStoreType = keyStoreType;
+ }
+
+ public String getTrustStorePassword()
+ {
+ return trustStorePassword;
+ }
+
+ public void setTrustStorePassword(String trustStorePassword)
+ {
+ this.trustStorePassword = trustStorePassword;
+ }
+
+ public String getTrustStoreType()
+ {
+ return trustStoreType;
+ }
+
+ public void setTrustStoreType(String trustStoreType)
+ {
+ this.trustStoreType = trustStoreType;
+ }
+
+ public URL getTrustStoreURL()
+ {
+ return trustStoreURL;
+ }
+
+ public void setTrustStoreURL(URL trustStoreURL)
+ {
+ this.trustStoreURL = trustStoreURL;
+ }
+
+ public String getTrustStoreFile()
+ {
+ return trustStoreFile;
+ }
+
+ public void setTrustStoreFile(String trustStoreFile)
+ {
+ this.trustStoreFile = trustStoreFile;
+ }
+}
Deleted:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfigurationFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-06
01:10:43 UTC (rev 1564)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -1,460 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-
-import org.jboss.logging.Logger;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A JBossXB Object Model Factory that represets a JBoss WS-Security
- * configuration. See the jboss-ws-security_1_0.xsd file for more info.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class WSSecurityConfigurationFactory implements ObjectModelFactory
-{
-
- public static String SERVER_RESOURCE_NAME = "jboss-wsse-server.xml";
-
- public static String CLIENT_RESOURCE_NAME = "jboss-wsse-client.xml";
-
- private static HashMap options = new HashMap(6);
-
- static
- {
- options.put("key-store-file", "setKeyStoreFile");
- options.put("key-store-type", "setKeyStoreType");
- options.put("key-store-password", "setKeyStorePassword");
- options.put("trust-store-file", "setTrustStoreFile");
- options.put("trust-store-type", "setTrustStoreType");
- options.put("trust-store-password", "setTrustStorePassword");
- }
-
- // provide logging
- private static final Logger log =
Logger.getLogger(WSSecurityConfigurationFactory.class);
-
- // Hide constructor
- private WSSecurityConfigurationFactory()
- {
- }
-
- /**
- * Create a new instance of a jaxrpc-mapping factory
- */
- public static WSSecurityConfigurationFactory newInstance()
- {
- return new WSSecurityConfigurationFactory();
- }
-
- /**
- * Factory method for JavaWsdlMapping
- */
- public WSSecurityConfiguration parse(URL configurationFile) throws IOException
- {
- if (configurationFile == null)
- {
- throw new IllegalArgumentException("URL cannot be null");
- }
-
- // setup the XML binding Unmarshaller
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- InputStream is = configurationFile.openStream();
- try
- {
- WSSecurityConfiguration configuration = (WSSecurityConfiguration)
unmarshaller.unmarshal(is, this, null);
- return configuration;
- }
- catch (JBossXBException e)
- {
- IOException ioex = new IOException("Cannot parse: " +
configurationFile);
- Throwable cause = e.getCause();
- if (cause != null)
- ioex.initCause(cause);
- throw ioex;
- }
- finally
- {
- is.close();
- }
- }
-
- /**
- * This method is called on the factory by the object model builder when the
- * parsing starts.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- return new WSSecurityConfiguration();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
- {
- return root;
- }
-
- public void setValue(WSSecurityConfiguration configuration, UnmarshallingContext
navigator, String namespaceURI,
- String localName, String value)
- {
- log.trace("setValue: [obj=" + configuration + ",value=" + value
+ "]");
- String method = (String) options.get(localName);
- if (method == null)
- return;
-
- // Dispatch to propper initializer
- try
- {
- WSSecurityConfiguration.class.getMethod(method, new Class[]
{String.class}).invoke(configuration, new Object[]{value});
- }
- catch (Exception e)
- {
- log.error("Could not set option: " + method + " to: " +
value, e);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSSecurityConfiguration configuration, UnmarshallingContext
navigator, String namespaceURI,
- String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("config".equals(localName))
- {
- return new Config();
- }
- if ("port".equals(localName))
- {
- return new Port(attrs.getValue("", "name"));
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WSSecurityConfiguration configuration, Config defaultConfig,
UnmarshallingContext navigator,
- String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + configuration + ",child=" +
defaultConfig + "]");
- configuration.setDefaultConfig(defaultConfig);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WSSecurityConfiguration configuration, Port port,
UnmarshallingContext navigator, String namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + configuration + ",child=" + port
+ "]");
- configuration.addPort(port);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Config config, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("sign".equals(localName))
- {
- // By default, we alwyas include a timestamp
- Boolean include = new Boolean(true);
- String timestamp = attrs.getValue("", "includeTimestamp");
- if (timestamp != null)
- include = (Boolean) SimpleTypeBindings.unmarshal(timestamp,
SimpleTypeBindings.XS_BOOLEAN_NAME, null);
-
- return new Sign(attrs.getValue("", "type"),
attrs.getValue("", "alias"), include.booleanValue());
- }
- else if ("encrypt".equals(localName))
- {
- return new Encrypt(attrs.getValue("", "type"),
attrs.getValue("", "alias"), attrs.getValue("",
"algorithm"));
- }
- else if ("timestamp".equals(localName))
- {
- return new Timestamp(attrs.getValue("", "ttl"));
- }
- else if ("requires".equals(localName))
- {
- return new Requires();
- }
- else if ("username".equals(localName))
- {
- return new Username();
- }
-
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Encrypt encrypt, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + encrypt +
"]");
- config.setEncrypt(encrypt);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Sign sign, UnmarshallingContext navigator, String
namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + sign +
"]");
- config.setSign(sign);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Timestamp timestamp, UnmarshallingContext
navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + timestamp +
"]");
- config.setTimestamp(timestamp);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Username username, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + username +
"]");
- config.setUsername(username);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Requires requires, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + requires +
"]");
- config.setRequires(requires);
- }
-
-
- private Object handleTargets(Object object, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("target".equals(localName))
- {
- Target target = new Target(attrs.getValue("", "type"));
- if ("true".equals(attrs.getValue("",
"contentOnly")))
- target.setContentOnly(true);
-
- return target;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Encrypt encrypt, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(encrypt, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Sign sign, UnmarshallingContext navigator, String namespaceURI,
String localName, Attributes attrs)
- {
- return handleTargets(sign, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Requires requires, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("signature".equals(localName))
- {
- return new RequireSignature();
- }
- else if ("encryption".equals(localName))
- {
- return new RequireEncryption();
- }
- else if ("timestamp".equals(localName))
- {
- return new RequireTimestamp(attrs.getValue("", "maxAge"));
- }
-
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(RequireSignature requireSignature, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(requireSignature, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(RequireEncryption requireEncryption, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(requireEncryption, navigator, namespaceURI, localName,
attrs);
- }
-
- public void setValue(Target target, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + target + ",value=" + value +
"]");
-
- target.setValue(value);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Encrypt encrypt, Target target, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + encrypt + ",child=" + target +
"]");
- encrypt.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Sign sign, Target target, UnmarshallingContext navigator, String
namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + sign + ",child=" + target +
"]");
- sign.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireEncryption requireEncryption,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" +
requireEncryption + "]");
- requires.setRequireEncryption(requireEncryption);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireSignature requireSignature,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" +
requireSignature + "]");
- requires.setRequireSignature(requireSignature);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireTimestamp requireTimestamp,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" +
requireTimestamp + "]");
- requires.setRequireTimestamp(requireTimestamp);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(RequireEncryption requireEncryption, Target target,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requireEncryption + ",child=" +
target + "]");
- requireEncryption.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(RequireSignature requireSignature, Target target,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requireSignature + ",child=" +
target + "]");
- requireSignature.addTarget(target);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Port port, UnmarshallingContext navigator, String namespaceURI,
String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("operation".equals(localName))
- {
- return new Operation(attrs.getValue("", "name"));
- }
- else if ("config".equals(localName))
- {
- return new Config();
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Port port, Operation operation, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + port + ",child=" + operation +
"]");
- port.addOperation(operation);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Port port, Config config, UnmarshallingContext navigator, String
namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + port + ",child=" + config +
"]");
- port.setDefaultConfig(config);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Operation operation, UnmarshallingContext navigator, String
namespaceURI, String localName,
- Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("config".equals(localName))
- {
- return new Config();
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Operation operation, Config config, UnmarshallingContext
navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + operation + ",child=" + config +
"]");
- operation.setConfig(config);
- }
-}
Copied:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfigurationFactory.java
(from rev 1565,
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java)
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -0,0 +1,460 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.metadata.wsse;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+
+import org.jboss.logging.Logger;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A JBossXB Object Model Factory that represets a JBoss WS-Security
+ * configuration. See the jboss-ws-security_1_0.xsd file for more info.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WSSecurityConfigurationFactory implements ObjectModelFactory
+{
+
+ public static String SERVER_RESOURCE_NAME = "jboss-wsse-server.xml";
+
+ public static String CLIENT_RESOURCE_NAME = "jboss-wsse-client.xml";
+
+ private static HashMap options = new HashMap(6);
+
+ static
+ {
+ options.put("key-store-file", "setKeyStoreFile");
+ options.put("key-store-type", "setKeyStoreType");
+ options.put("key-store-password", "setKeyStorePassword");
+ options.put("trust-store-file", "setTrustStoreFile");
+ options.put("trust-store-type", "setTrustStoreType");
+ options.put("trust-store-password", "setTrustStorePassword");
+ }
+
+ // provide logging
+ private static final Logger log =
Logger.getLogger(WSSecurityConfigurationFactory.class);
+
+ // Hide constructor
+ private WSSecurityConfigurationFactory()
+ {
+ }
+
+ /**
+ * Create a new instance of a jaxrpc-mapping factory
+ */
+ public static WSSecurityConfigurationFactory newInstance()
+ {
+ return new WSSecurityConfigurationFactory();
+ }
+
+ /**
+ * Factory method for JavaWsdlMapping
+ */
+ public WSSecurityConfiguration parse(URL configurationFile) throws IOException
+ {
+ if (configurationFile == null)
+ {
+ throw new IllegalArgumentException("URL cannot be null");
+ }
+
+ // setup the XML binding Unmarshaller
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ InputStream is = configurationFile.openStream();
+ try
+ {
+ WSSecurityConfiguration configuration = (WSSecurityConfiguration)
unmarshaller.unmarshal(is, this, null);
+ return configuration;
+ }
+ catch (JBossXBException e)
+ {
+ IOException ioex = new IOException("Cannot parse: " +
configurationFile);
+ Throwable cause = e.getCause();
+ if (cause != null)
+ ioex.initCause(cause);
+ throw ioex;
+ }
+ finally
+ {
+ is.close();
+ }
+ }
+
+ /**
+ * This method is called on the factory by the object model builder when the
+ * parsing starts.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ return new WSSecurityConfiguration();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
+ {
+ return root;
+ }
+
+ public void setValue(WSSecurityConfiguration configuration, UnmarshallingContext
navigator, String namespaceURI,
+ String localName, String value)
+ {
+ log.trace("setValue: [obj=" + configuration + ",value=" + value
+ "]");
+ String method = (String) options.get(localName);
+ if (method == null)
+ return;
+
+ // Dispatch to propper initializer
+ try
+ {
+ WSSecurityConfiguration.class.getMethod(method, new Class[]
{String.class}).invoke(configuration, new Object[]{value});
+ }
+ catch (Exception e)
+ {
+ log.error("Could not set option: " + method + " to: " +
value, e);
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSSecurityConfiguration configuration, UnmarshallingContext
navigator, String namespaceURI,
+ String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("config".equals(localName))
+ {
+ return new Config();
+ }
+ if ("port".equals(localName))
+ {
+ return new Port(attrs.getValue("", "name"));
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(WSSecurityConfiguration configuration, Config defaultConfig,
UnmarshallingContext navigator,
+ String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + configuration + ",child=" +
defaultConfig + "]");
+ configuration.setDefaultConfig(defaultConfig);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(WSSecurityConfiguration configuration, Port port,
UnmarshallingContext navigator, String namespaceURI,
+ String localName)
+ {
+ log.trace("addChild: [obj=" + configuration + ",child=" + port
+ "]");
+ configuration.addPort(port);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Config config, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("sign".equals(localName))
+ {
+ // By default, we alwyas include a timestamp
+ Boolean include = new Boolean(true);
+ String timestamp = attrs.getValue("", "includeTimestamp");
+ if (timestamp != null)
+ include = (Boolean) SimpleTypeBindings.unmarshal(timestamp,
SimpleTypeBindings.XS_BOOLEAN_NAME, null);
+
+ return new Sign(attrs.getValue("", "type"),
attrs.getValue("", "alias"), include.booleanValue());
+ }
+ else if ("encrypt".equals(localName))
+ {
+ return new Encrypt(attrs.getValue("", "type"),
attrs.getValue("", "alias"), attrs.getValue("",
"algorithm"));
+ }
+ else if ("timestamp".equals(localName))
+ {
+ return new Timestamp(attrs.getValue("", "ttl"));
+ }
+ else if ("requires".equals(localName))
+ {
+ return new Requires();
+ }
+ else if ("username".equals(localName))
+ {
+ return new Username();
+ }
+
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Encrypt encrypt, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + encrypt +
"]");
+ config.setEncrypt(encrypt);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Sign sign, UnmarshallingContext navigator, String
namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + sign +
"]");
+ config.setSign(sign);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Timestamp timestamp, UnmarshallingContext
navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + timestamp +
"]");
+ config.setTimestamp(timestamp);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Username username, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + username +
"]");
+ config.setUsername(username);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Requires requires, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + requires +
"]");
+ config.setRequires(requires);
+ }
+
+
+ private Object handleTargets(Object object, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("target".equals(localName))
+ {
+ Target target = new Target(attrs.getValue("", "type"));
+ if ("true".equals(attrs.getValue("",
"contentOnly")))
+ target.setContentOnly(true);
+
+ return target;
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Encrypt encrypt, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ return handleTargets(encrypt, navigator, namespaceURI, localName, attrs);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Sign sign, UnmarshallingContext navigator, String namespaceURI,
String localName, Attributes attrs)
+ {
+ return handleTargets(sign, navigator, namespaceURI, localName, attrs);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Requires requires, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("signature".equals(localName))
+ {
+ return new RequireSignature();
+ }
+ else if ("encryption".equals(localName))
+ {
+ return new RequireEncryption();
+ }
+ else if ("timestamp".equals(localName))
+ {
+ return new RequireTimestamp(attrs.getValue("", "maxAge"));
+ }
+
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(RequireSignature requireSignature, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return handleTargets(requireSignature, navigator, namespaceURI, localName, attrs);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(RequireEncryption requireEncryption, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return handleTargets(requireEncryption, navigator, namespaceURI, localName,
attrs);
+ }
+
+ public void setValue(Target target, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + target + ",value=" + value +
"]");
+
+ target.setValue(value);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Encrypt encrypt, Target target, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + encrypt + ",child=" + target +
"]");
+ encrypt.addTarget(target);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Sign sign, Target target, UnmarshallingContext navigator, String
namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + sign + ",child=" + target +
"]");
+ sign.addTarget(target);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Requires requires, RequireEncryption requireEncryption,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requires + ",child=" +
requireEncryption + "]");
+ requires.setRequireEncryption(requireEncryption);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Requires requires, RequireSignature requireSignature,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requires + ",child=" +
requireSignature + "]");
+ requires.setRequireSignature(requireSignature);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Requires requires, RequireTimestamp requireTimestamp,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requires + ",child=" +
requireTimestamp + "]");
+ requires.setRequireTimestamp(requireTimestamp);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(RequireEncryption requireEncryption, Target target,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requireEncryption + ",child=" +
target + "]");
+ requireEncryption.addTarget(target);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(RequireSignature requireSignature, Target target,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requireSignature + ",child=" +
target + "]");
+ requireSignature.addTarget(target);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Port port, UnmarshallingContext navigator, String namespaceURI,
String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("operation".equals(localName))
+ {
+ return new Operation(attrs.getValue("", "name"));
+ }
+ else if ("config".equals(localName))
+ {
+ return new Config();
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Port port, Operation operation, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + port + ",child=" + operation +
"]");
+ port.addOperation(operation);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Port port, Config config, UnmarshallingContext navigator, String
namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + port + ",child=" + config +
"]");
+ port.setDefaultConfig(config);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Operation operation, UnmarshallingContext navigator, String
namespaceURI, String localName,
+ Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("config".equals(localName))
+ {
+ return new Config();
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Operation operation, Config config, UnmarshallingContext
navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + operation + ",child=" + config +
"]");
+ operation.setConfig(config);
+ }
+}
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -52,12 +52,12 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.core.binding.EndpointInvocation;
+import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
import org.jboss.ws.core.jaxws.core.BindingProviderImpl;
import org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.jaxrpc.handler.HandlerDelegateJAXRPC;
/** An implementation handles invocations on the endpoint
*
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,11 +32,11 @@
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.common.umdm.ServiceMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
+import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCDeployment;
+import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCServerMetaDataBuilder;
+import org.jboss.ws.core.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3;
+import org.jboss.ws.core.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCServerMetaDataBuilder;
-import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3;
-import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE;
/**
* The POJO deployer for web service endpoints. This Deployer is already decoupled from
the target
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -27,11 +27,11 @@
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedSessionMetaData;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
/**
* This object registered with the EndpointManager service.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -35,9 +35,9 @@
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.binding.EndpointInvocation;
+import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.jaxrpc.ServletEndpointContextImpl;
/**
* Handles invocations on JSE endpoints.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -66,13 +66,13 @@
import org.jboss.ws.common.utils.ThreadLocalAssociation;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.MessageContextPropertyHelper;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.SOAPConnectionImpl;
import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
-import org.jboss.ws.jaxrpc.handler.MessageContextJAXRPC;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
/**
* A service that manages JBossWS endpoints.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -47,7 +47,7 @@
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.IOUtils;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -44,9 +44,9 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.utils.IOUtils;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.ws.core.soap.attachment.MultipartRelatedDecoder;
-import org.jboss.ws.jaxrpc.Style;
/**
* MessageFactory implementation
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -38,7 +38,7 @@
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Style;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -46,8 +46,8 @@
import org.jboss.remoting.transport.http.HTTPMetadataConstants;
import org.jboss.ws.core.binding.soap.SOAPMessageMarshaller;
import org.jboss.ws.core.binding.soap.SOAPMessageUnMarshaller;
+import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.extras.xop.XOPContext;
-import org.jboss.ws.jaxrpc.StubExt;
/**
* SOAPConnection implementation
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -37,12 +37,12 @@
import org.jboss.ws.core.binding.DeserializerSupport;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.SerializerSupport;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.encoding.DeserializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.encoding.NullValueSerializer;
+import org.jboss.ws.core.jaxrpc.encoding.SerializerFactoryBase;
import org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource;
import org.jboss.ws.extras.xop.XOPContext;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
-import org.jboss.ws.jaxrpc.encoding.NullValueSerializer;
-import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
import org.w3c.dom.*;
import javax.xml.namespace.QName;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -38,7 +38,7 @@
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.umdm.OperationMetaData;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Style;
/**
* Derive the operation meta data from incomming SOAP message
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/WSAddressingServerHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/WSAddressingServerHandler.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxrpc/WSAddressingServerHandler.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -36,9 +36,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
/**
* A server side handler that reads/writes the addressing properties
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WSSecurityDispatcher.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WSSecurityDispatcher.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/WSSecurityDispatcher.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -38,19 +38,19 @@
import org.jboss.ws.common.umdm.OperationMetaData;
import org.jboss.ws.common.utils.DOMWriter;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.metadata.wsse.Config;
+import org.jboss.ws.core.metadata.wsse.Encrypt;
+import org.jboss.ws.core.metadata.wsse.Operation;
+import org.jboss.ws.core.metadata.wsse.Port;
+import org.jboss.ws.core.metadata.wsse.RequireEncryption;
+import org.jboss.ws.core.metadata.wsse.RequireSignature;
+import org.jboss.ws.core.metadata.wsse.RequireTimestamp;
+import org.jboss.ws.core.metadata.wsse.Requires;
+import org.jboss.ws.core.metadata.wsse.Sign;
+import org.jboss.ws.core.metadata.wsse.Timestamp;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.metadata.wsse.Config;
-import org.jboss.ws.metadata.wsse.Encrypt;
-import org.jboss.ws.metadata.wsse.Operation;
-import org.jboss.ws.metadata.wsse.Port;
-import org.jboss.ws.metadata.wsse.RequireEncryption;
-import org.jboss.ws.metadata.wsse.RequireSignature;
-import org.jboss.ws.metadata.wsse.RequireTimestamp;
-import org.jboss.ws.metadata.wsse.Requires;
-import org.jboss.ws.metadata.wsse.Sign;
-import org.jboss.ws.metadata.wsse.Timestamp;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.w3c.dom.Element;
public class WSSecurityDispatcher
@@ -58,14 +58,14 @@
// provide logging
private static Logger log = Logger.getLogger(WSSecurityDispatcher.class);
- private static List<Target>
convertTargets(List<org.jboss.ws.metadata.wsse.Target> targets)
+ private static List<Target>
convertTargets(List<org.jboss.ws.core.metadata.wsse.Target> targets)
{
if (targets == null)
return null;
ArrayList<Target> newList = new ArrayList<Target>(targets.size());
- for (org.jboss.ws.metadata.wsse.Target target : targets)
+ for (org.jboss.ws.core.metadata.wsse.Target target : targets)
{
if ("qname".equals(target.getType()))
{
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandler.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxrpc/WSSecurityHandler.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,9 +30,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.extras.security.WSSecurityDispatcher;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
/**
* An abstract JAXRPC handler that delegates to the WSSecurityDispatcher
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandler.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/jaxws/WSSecurityHandler.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,8 +30,8 @@
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.extras.security.WSSecurityDispatcher;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
/**
* An abstract JAXWS handler that delegates to the WSSecurityDispatcher
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extras.xop;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.StubExt;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.GenericHandler;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -28,13 +28,13 @@
import org.jboss.ws.common.utils.JavaUtils;
import org.jboss.ws.common.utils.MimeUtils;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPElementImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
-import org.jboss.ws.jaxrpc.StubExt;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
import org.jboss.xb.binding.sunday.xop.XOPObject;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,10 +34,10 @@
import org.jboss.ejb3.SessionContainer;
import org.jboss.ejb3.mdb.MessagingContainer;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedSessionMetaData;
/**
* Build container independent application meta data
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -29,9 +29,9 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.metadata.WebMetaData;
import org.jboss.virtual.VirtualFile;
+import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCDeployment;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
/**
* A deployer JAXRPC JSE Endpoints
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,9 +32,9 @@
import org.jboss.ws.common.umdm.HandlerMetaData;
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.core.metadata.config.WSCommonConfig;
import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.metadata.config.WSCommonConfig;
/**
* A servlet that is installed for every web service endpoint.
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -38,13 +38,13 @@
import org.jboss.naming.Util;
import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxrpc.ServiceReferenceable;
+import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCClientDeployment;
+import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDL11DefinitionFactory;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.jaxrpc.ServiceReferenceable;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientDeployment;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.metadata.wsdl.WSDL11DefinitionFactory;
/**
* Binds a JAXRPC Service object in the client's ENC for every service-ref element in
the
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,9 +34,9 @@
import org.jboss.webservice.metadata.serviceref.PortComponentRefMetaData;
import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
/**
* Build container independent service ref meta data
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,10 +34,10 @@
import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
import org.jboss.metadata.web.Servlet;
import org.jboss.metadata.web.ServletMapping;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData.PublishLocationAdapter;
-import
org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData.PublishLocationAdapter;
+import
org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
/**
* Build container independent web meta data
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -38,11 +38,11 @@
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData;
+import
org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
-import
org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -38,12 +38,12 @@
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCDeployment;
import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
import org.jboss.ws.core.server.JAXWSDeployment;
import org.jboss.ws.core.server.KernelLocator;
import org.jboss.ws.core.server.ServiceEndpointDeployer;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
/**
* A servlet that is installed for every web service endpoint.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -37,9 +37,9 @@
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.Configuration.OperationConfig;
import org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder;
import org.w3c.dom.Element;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL11.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,10 +33,10 @@
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.umdm.ServiceMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.tools.helpers.JavaToWSDLHelper;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL20.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL20.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL20.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -27,7 +27,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
// $Id$
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -36,13 +36,13 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSStringList;
-import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSEntityResolver;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSErrorHandler;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSStringList;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.WSSchemaUtils;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.helpers.JavaToXSDHelper;
import org.jboss.ws.tools.interfaces.JavaToXSDIntf;
import org.jboss.ws.tools.interfaces.SchemaCreatorIntf;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaWriter.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaWriter.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaWriter.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,7 +32,7 @@
import org.apache.xerces.xs.StringList;
import org.apache.xerces.xs.XSSimpleTypeDefinition;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.XSDTypeToJava.VAR;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/RPCSignature.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/RPCSignature.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/RPCSignature.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -24,13 +24,13 @@
import java.util.ArrayList;
import java.util.Collection;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCPart;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCSignatureItem;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCSignatureItem.Direction;
public class RPCSignature
{
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -46,11 +46,11 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.encoding.SimpleDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SimpleSerializerFactory;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.encoding.SimpleDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.SimpleSerializerFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
/**
* Util class for the JBossWS Tools project
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -44,21 +44,21 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.metadata.wsdl.WSDLException;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLException;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceFault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutfault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCPart;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
import org.w3c.dom.Element;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,9 +33,9 @@
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.metadata.jsr109.PortComponentMetaData;
-import org.jboss.ws.metadata.jsr109.WebserviceDescriptionMetaData;
-import org.jboss.ws.metadata.jsr109.WebservicesMetaData;
+import org.jboss.ws.core.metadata.jsr109.PortComponentMetaData;
+import org.jboss.ws.core.metadata.jsr109.WebserviceDescriptionMetaData;
+import org.jboss.ws.core.metadata.jsr109.WebservicesMetaData;
import org.jboss.ws.tools.interfaces.WSDotXMLCreatorIntf;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/XSDToJava.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/XSDToJava.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/XSDToJava.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,9 +34,9 @@
import org.apache.xerces.xs.XSSimpleTypeDefinition;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2006-12-06
01:14:45 UTC (rev 1565)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -50,9 +50,9 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
/** Class that converts a XSD Type into Java class
* @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -28,12 +28,12 @@
import javax.xml.namespace.QName;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.interfaces.ServiceCreatorIntf;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -48,43 +48,43 @@
import org.jboss.ws.common.umdm.WrappedParameter;
import org.jboss.ws.common.utils.JavaUtils;
import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PortMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.WsdlMessageMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLBindingFault;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.XSModelTypes;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ExceptionMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.MethodParamPartsMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PortMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceInterfaceMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.VariableMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.WsdlMessageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.WsdlReturnValueMapping;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingFault;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceFault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutfault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLProperty;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.XSModelTypes;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.WSSchemaUtils;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.JavaToXSD;
import org.jboss.ws.tools.interfaces.JavaToXSDIntf;
import org.jboss.ws.tools.interfaces.SchemaCreatorIntf;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToXSDHelper.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToXSDHelper.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToXSDHelper.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -27,9 +27,9 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.interfaces.SchemaCreatorIntf;
import org.jboss.ws.tools.schema.SchemaTypeCreator;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -42,36 +42,36 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PortMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.WsdlMessageMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceMessageReference;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
-import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ExceptionMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.MethodParamPartsMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PortMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceInterfaceMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.VariableMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.WsdlMessageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.WsdlReturnValueMapping;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceFault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceMessageReference;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLProperty;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCPart;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.RPCSignature;
import org.jboss.ws.tools.ToolsUtils;
import org.jboss.ws.tools.WSToolsConstants;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -48,13 +48,13 @@
import org.jboss.ws.common.utils.DOMWriter;
import org.jboss.ws.common.utils.IOUtils;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
import org.jboss.ws.tools.Configuration;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.JavaWriter;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/JavaToXSDIntf.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/JavaToXSDIntf.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/JavaToXSDIntf.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -26,7 +26,7 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -26,10 +26,10 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
/**
* Defines the contract for Schema Creating agents (Java -> XSD Process)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/ServiceCreatorIntf.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/ServiceCreatorIntf.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/ServiceCreatorIntf.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -23,7 +23,7 @@
import java.io.IOException;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
/**
* Defines the contract for creation of java.xml.rpc.Service Interface
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -26,9 +26,9 @@
import java.net.URL;
import java.util.Map;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLException;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLException;
/**
* Defines the contract for WSDL To Java Converters
@@ -43,7 +43,7 @@
* Provide a WSDLFile and get back the WSDL20 Object Graph
* @param wsdlfileurl
* @return
- * @throws org.jboss.ws.metadata.wsdl.WSDLException
+ * @throws org.jboss.ws.core.metadata.wsdl.WSDLException
*/
public WSDLDefinitions convertWSDL2Java(URL wsdlfileurl)
throws WSDLException;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,7 +25,7 @@
import java.io.IOException;
import org.apache.xerces.xs.XSModel;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
/**
* Defines the contract for all Schema Types to Java Types converters
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/JAXBWSDLGenerator.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -31,8 +31,8 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.core.metadata.wsdl.DOMTypes;
import org.jboss.ws.extras.security.Util;
-import org.jboss.ws.metadata.wsdl.DOMTypes;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,27 +33,27 @@
import org.jboss.ws.common.umdm.ParameterMetaData;
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.common.umdm.ServiceMetaData;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLBindingFault;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLImport;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem;
-import org.jboss.ws.metadata.wsdl.WSDLSOAPHeader;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingFault;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLImport;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceFault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutfault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCPart;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCSignatureItem;
+import org.jboss.ws.core.metadata.wsdl.WSDLSOAPHeader;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCSignatureItem.Direction;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,15 +32,15 @@
import org.apache.xerces.xs.XSSimpleTypeDefinition;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.MethodParamPartsMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.tools.JavaWriter;
import org.jboss.ws.tools.XSDTypeToJava;
import org.jboss.ws.tools.XSDTypeToJava.VAR;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -41,8 +41,8 @@
import org.jboss.ws.common.umdm.WrappedParameter;
import org.jboss.ws.common.utils.HolderUtils;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.ToolsUtils;
import org.jboss.ws.tools.Configuration.OperationConfig;
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -39,8 +39,8 @@
import org.jboss.ws.common.umdm.FaultMetaData;
import org.jboss.ws.common.umdm.OperationMetaData;
import org.jboss.ws.common.umdm.ParameterMetaData;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.ToolsUtils;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,8 +34,8 @@
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.umdm.ServiceMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.Configuration.OperationConfig;
/**
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -53,22 +53,22 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModelGroup;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSParticle;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSSimpleTypeDefinition;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
-import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.VariableMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModelGroup;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSParticle;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSSimpleTypeDefinition;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.WSSchemaUtils;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.interfaces.SchemaCreatorIntf;
import org.jboss.xb.binding.NamespaceRegistry;
import org.jboss.xb.binding.SimpleTypeBindings;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -46,10 +46,10 @@
import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.core.binding.EndpointInvocation;
import org.jboss.ws.core.binding.UnboundHeader;
+import org.jboss.ws.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.jaxrpc.CallImpl;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
/**
* Test the SOAPBindingProvider
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -24,11 +24,11 @@
import java.io.File;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.config.WSConfigFactory;
-import org.jboss.ws.metadata.config.jaxrpc.WSConfigRootJAXRPC;
-import org.jboss.ws.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.core.metadata.config.WSConfigFactory;
+import org.jboss.ws.core.metadata.config.jaxrpc.WSConfigRootJAXRPC;
+import org.jboss.ws.core.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
+import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
/**
* Test parsing of the JBossWS config
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -35,11 +35,11 @@
import org.jboss.ws.core.binding.DeserializerSupport;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.ws.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
-import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
+import org.jboss.ws.core.jaxrpc.encoding.DeserializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.encoding.SerializerFactoryBase;
import org.jboss.xb.binding.NamespaceRegistry;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -31,7 +31,7 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -31,7 +31,7 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,7 +33,7 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,7 +33,7 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,7 +30,7 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,7 +30,7 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,8 +33,8 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
/**
* Test the JAXB marshalling of complex types
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,8 +32,8 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.tools.JavaToXSD;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,8 +33,8 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
/**
* Test the JAXB marshalling of complex types
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -31,8 +31,8 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
/**
* Test the JAXB unmarshalling of complex types
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,8 +30,8 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PackageMapping;
/**
* Test the JAXB marshalling of a SimpleUserType
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,8 +30,8 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PackageMapping;
/**
* Test the JAXB unmarshalling of a SimpleUserType
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -38,7 +38,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.jaxrpc.SOAPFaultHelperJAXRPC;
+import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
/**
* Test the SOAPFault
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -47,11 +47,11 @@
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.core.binding.EndpointInvocation;
+import org.jboss.ws.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.attachment.MimeConstants;
-import org.jboss.ws.jaxrpc.CallImpl;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
/**
* TODO
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -24,10 +24,10 @@
import java.io.File;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
/**
* Tests WSDL11Reader ability to parse WSDL Files
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -24,10 +24,10 @@
import java.io.File;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
/**
* Test the XSModel, and how it handles multiple schemas
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -31,7 +31,7 @@
import org.jboss.net.protocol.URLStreamHandlerFactory;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.wsdl.WSDL11DefinitionFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDL11DefinitionFactory;
/**
* Test a wsdl import functionality.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -27,19 +27,19 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLRPCPart;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
import org.jboss.ws.extras.eventing.EventingConstants;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
/**
* Test the unmarshalling of wsdl-1.1 into the unified wsdl structure
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,10 +25,10 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
/**
* The WSDL may contain or import XSD schema definitions.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,9 +33,9 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -24,8 +24,8 @@
import java.io.File;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Cannot handle xsd:import of xml schema
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test case to test that when a deployment contains both an endpoint and a
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test case to test that an endpoint can be accessed if there is whitespace
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -31,7 +31,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Scoped class loading domains for WS endpoints
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -26,8 +26,8 @@
import javax.servlet.http.HttpSession;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.jaxrpc.handler.MessageContextJAXRPC;
/**
*
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -37,7 +37,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* The prefix "xsi" for attribute "xsi:nil" is not bound
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,12 +25,12 @@
import java.io.FilenameFilter;
import java.net.MalformedURLException;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
import org.jboss.ws.core.server.ServerConfig;
import org.jboss.ws.core.server.ServerConfigFactory;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLService;
/**
*
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Attributes of type xsd:QName incorrectly serialized
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Deserialization of complex bean containing an array of complex beans
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,8 +25,8 @@
import java.net.URL;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* XML entity usage in wsdl contained schema
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.test.ws.jaxrpc.marshall.types.JavaBean;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test the Dynamic Invocation Interface (DII) on the Call
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE test case for an document/literal/bare style service.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE test case for an document/literal/wrapped style service.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -37,7 +37,7 @@
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.umdm.HandlerMetaData;
import org.jboss.ws.common.utils.ObjectNameFactory;
-import org.jboss.ws.jaxrpc.ServiceExt;
+import org.jboss.ws.core.jaxrpc.ServiceExt;
/**
* Test dynamic handlers
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -48,7 +48,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test user exception propagation.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -36,8 +36,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
/**
* Test bound and unbound headers
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.CallImpl;
/**
* Test the Dynamic Invocation Interface (DII) on the Call
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,9 +33,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
/**
* Test bound and unbound headers
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -56,7 +56,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test Holders
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,8 +33,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
/**
* Test the Dynamic Invocation Interface (DII) on a Call that is preconfigured from WSDL
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test the Dynamic Invocation Interface (DII) on the Call
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,8 +30,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
/**
* Test the DynamicProxy Call
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE endpoint for a document style service.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,8 +33,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
/**
* Test the Dynamic Invocation Interface (DII) on a Call that is preconfigured from WSDL
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test the Dynamic Invocation Interface (DII) on the Call
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE test case for an rpc style service.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,8 +30,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
/**
* Test the DynamicProxy Call
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -51,7 +51,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -38,8 +38,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
/**
* Test SOAP with XOP through the JAXRPC dynamic proxy layer.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE test case for onway operations.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test JSE test case for an rpc style service.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -40,7 +40,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test SOAP with Attachements (SwA) through the JAXRPC dynamic proxy layer.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -42,6 +42,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.extras.addressing.AddressingClientUtil;
import org.jboss.ws.extras.addressing.jaxrpc.WSAddressingClientHandler;
import org.jboss.ws.extras.eventing.EventSourceEndpoint;
@@ -54,9 +57,6 @@
import org.jboss.ws.extras.eventing.element.SubscribeRequest;
import org.jboss.ws.extras.eventing.element.SubscribeResponse;
import org.jboss.ws.extras.eventing.element.UnsubscribeRequest;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
-import org.jboss.ws.jaxrpc.StubExt;
/**
* Test the eventing example service.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
import org.jboss.ws.extras.security.jaxrpc.WSSecurityHandlerOutbound;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
/**
* Test WS-Security with RPC/Literal
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
import org.jboss.ws.extras.security.jaxrpc.WSSecurityHandlerOutbound;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
/**
* Test WS-Security with RPC/Literal
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
import org.jboss.ws.extras.security.jaxrpc.WSSecurityHandlerOutbound;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.ServiceImpl;
/**
* This test simulates simulates the usage of a jboss-ws-security keystore and truststore
use cases
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,9 +34,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,9 +33,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,9 +34,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -43,6 +43,11 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.jaxrpc.ServiceExt;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.extras.addressing.AddressingClientUtil;
import org.jboss.ws.extras.addressing.jaxrpc.WSAddressingClientHandler;
import org.jboss.ws.extras.eventing.EventSourceEndpoint;
@@ -54,11 +59,6 @@
import org.jboss.ws.extras.eventing.element.SubscribeRequest;
import org.jboss.ws.extras.eventing.element.SubscribeResponse;
import org.jboss.ws.extras.eventing.element.UnsubscribeRequest;
-import org.jboss.ws.jaxrpc.ServiceExt;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
/**
* @author Heiko Braun, <heiko(a)openj.net>
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -35,6 +35,9 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.extras.addressing.AddressingClientUtil;
import org.jboss.ws.extras.eventing.EventSourceEndpoint;
import org.jboss.ws.extras.eventing.EventingConstants;
@@ -44,9 +47,6 @@
import org.jboss.ws.extras.eventing.element.FilterType;
import org.jboss.ws.extras.eventing.element.SubscribeRequest;
import org.jboss.ws.extras.eventing.element.SubscribeResponse;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Eventing test case support.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,6 +32,7 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.extras.addressing.AddressingClientUtil;
import org.jboss.ws.extras.eventing.EventingConstants;
import org.jboss.ws.extras.eventing.element.DeliveryType;
@@ -42,7 +43,6 @@
import org.jboss.ws.extras.eventing.element.SubscribeRequest;
import org.jboss.ws.extras.eventing.element.SubscribeResponse;
import org.jboss.ws.extras.eventing.element.UnsubscribeRequest;
-import org.jboss.ws.jaxrpc.StubExt;
/**
* Test the eventing endpoints.
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -7,10 +7,10 @@
import org.apache.xerces.xs.XSComplexTypeDefinition;
import org.apache.xerces.xs.XSModel;
import org.apache.xerces.xs.XSTypeDefinition;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.WSSchemaUtils;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.extras.xop.jaxrpc.XOPScanner;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.xb.binding.NamespaceRegistry;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
import org.jboss.test.ws.jaxrpc.xop.shared.*;
import org.jboss.ws.common.utils.IOUtils;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.StubExt;
import javax.activation.DataHandler;
import javax.xml.rpc.Stub;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
import org.jboss.test.ws.jaxrpc.xop.shared.*;
import org.jboss.ws.common.utils.IOUtils;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.StubExt;
import javax.activation.DataHandler;
import javax.xml.rpc.Stub;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -22,9 +22,9 @@
package org.jboss.test.ws.jaxrpc.xop.shared;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.extras.xop.XOPContext;
-import org.jboss.ws.jaxrpc.StubExt;
import java.util.StringTokenizer;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,8 +34,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test JAXWS WebServiceContext
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -42,8 +42,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test JAXWS Endpoint deployment
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.CallImpl;
/**
* [JBWS-1178] Multiple virtual host and soap:address problem
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -27,12 +27,12 @@
import javax.jws.WebService;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
import org.jboss.ws.core.server.ServerConfig;
import org.jboss.ws.core.server.ServerConfigFactory;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLService;
/**
*
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,8 +32,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Investigate "Is Not A Servlet" error with multiple servlets in the web.xml
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,8 +32,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* EJB3 jmx name is incorrectly derrived
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/client/JSR181ComplexTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/client/JSR181ComplexTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/client/JSR181ComplexTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
*
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,8 +34,8 @@
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.umdm.OperationMetaData;
import org.jboss.ws.common.umdm.ParameterMetaData;
-import org.jboss.ws.jaxrpc.CallImpl;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
* Test the JSR-181 annotation: javax.jws.WebParam
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -38,9 +38,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.core.soap.NameImpl;
-import org.jboss.ws.jaxrpc.CallImpl;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
/**
* Test the JSR-181 annotation: javax.jws.webresult
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -29,8 +29,8 @@
import javax.xml.ws.Service;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
// $Id$
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -47,8 +47,8 @@
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.test.ws.jaxws.jsr181.soapbinding.SubmitBareRequest;
import org.jboss.test.ws.jaxws.jsr181.soapbinding.SubmitBareResponse;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -36,8 +36,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test a Provider<SOAPMessage>
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -36,8 +36,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test a Provider<SOAPMessage>
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,8 +34,8 @@
import org.jboss.security.SimplePrincipal;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test the JSR-181 annotation: javax.jws.WebService
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,9 +33,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test the JSR-181 annotation: javax.jws.WebService
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -24,8 +24,8 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
import javax.xml.namespace.QName;
import java.net.MalformedURLException;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,8 +32,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -33,8 +33,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -34,8 +34,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -36,9 +36,9 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.IOUtils;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.WSToolsConstants;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -31,9 +31,9 @@
import org.jboss.test.ws.tools.sei.StandardJavaTypes;
import org.jboss.test.ws.tools.validation.WSDL11Validator;
import org.jboss.test.ws.tools.validation.WSDLValidator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.WSDL20Writer;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDL20Writer;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -31,10 +31,10 @@
import org.jboss.test.ws.tools.sei.StandardJavaTypes;
import org.jboss.test.ws.tools.validation.WSDL11Validator;
import org.jboss.test.ws.tools.validation.WSDLValidator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.WSDL20Writer;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDL20Writer;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -42,12 +42,12 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.JavaToXSD;
import org.jboss.ws.tools.WSToolsConstants;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/assertions/Jaxrpc20AssertionsTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/assertions/Jaxrpc20AssertionsTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/assertions/Jaxrpc20AssertionsTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -29,7 +29,7 @@
import org.jboss.test.ws.tools.sei.assertions.AssertReturnTypeExtendRemote;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.JavaToWSDL;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/assertions/WSDL20AssertionsTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/assertions/WSDL20AssertionsTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/assertions/WSDL20AssertionsTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -24,7 +24,7 @@
import java.io.File;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,9 +30,9 @@
import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/config/globalconfig/GlobalConfigTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/config/globalconfig/GlobalConfigTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/config/globalconfig/GlobalConfigTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -29,9 +29,9 @@
import java.io.IOException;
import org.jboss.test.ws.tools.WSToolsTest;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.tools.WSTools;
import com.thoughtworks.qdox.JavaDocBuilder;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -28,8 +28,8 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.IOUtils;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.WSToolsConstants;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,10 +32,10 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.IOUtils;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.WSToolsConstants;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.common.jbossxb.simple.SimpleUserType;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.tools.JavaToXSD;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -30,8 +30,8 @@
import org.jboss.test.ws.tools.jbws_161.customexceptions.UserException;
import org.jboss.test.ws.tools.sei.Derived;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
import org.jboss.ws.tools.schema.SchemaTypeCreator;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -32,8 +32,8 @@
import org.jboss.test.ws.tools.jbws_204.wscompile.nillabletypes.NillableType;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.WSSchemaUtils;
import org.jboss.ws.tools.JavaToXSD;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -28,16 +28,16 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PortMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.WsdlMessageMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.core.metadata.jaxrpcmapping.MethodParamPartsMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PortMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceInterfaceMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.WsdlMessageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.WsdlReturnValueMapping;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -29,10 +29,10 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.metadata.jsr109.PortComponentMetaData;
-import org.jboss.ws.metadata.jsr109.WebserviceDescriptionMetaData;
-import org.jboss.ws.metadata.jsr109.WebservicesFactory;
-import org.jboss.ws.metadata.jsr109.WebservicesMetaData;
+import org.jboss.ws.core.metadata.jsr109.PortComponentMetaData;
+import org.jboss.ws.core.metadata.jsr109.WebserviceDescriptionMetaData;
+import org.jboss.ws.core.metadata.jsr109.WebservicesFactory;
+import org.jboss.ws.core.metadata.jsr109.WebservicesMetaData;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -26,19 +26,19 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.PortMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.ServiceInterfaceMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.WsdlMessageMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.core.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.MethodParamPartsMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.PortMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceEndpointMethodMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.ServiceInterfaceMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.VariableMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.WsdlMessageMapping;
+import org.jboss.ws.core.metadata.jaxrpcmapping.WsdlReturnValueMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
/**
* Validates a JAXRPC Mapping File against another
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,8 +25,8 @@
import junit.framework.TestCase;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11Validator.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11Validator.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11Validator.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -36,16 +36,16 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLProperty;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceFault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLProperty;
+import org.jboss.ws.core.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidationHelper.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,20 +25,20 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInfault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsdl.NCName;
+import org.jboss.ws.core.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationInfault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutfault;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -28,15 +28,15 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.metadata.wsdl.WSDLService;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.core.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.core.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.core.metadata.wsdl.WSDLService;
+import org.jboss.ws.core.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
/**
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -27,11 +27,11 @@
import javax.xml.namespace.QName;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.core.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.core.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -48,12 +48,12 @@
import org.apache.xerces.xs.XSWildcard;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSParticle;
-import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSEntityResolver;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.core.metadata.wsdl.xmlschema.JBossXSParticle;
+import org.jboss.ws.core.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.JavaToXSD;
import org.jboss.xb.binding.sunday.unmarshalling.LSInputAdaptor;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.tools.XSDToJava;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.tools.XSDToJava;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.tools.XSDToJava;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.tools.XSDToJava;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java 2006-12-06
01:14:45 UTC (rev 1565)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java 2006-12-06
01:24:09 UTC (rev 1566)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.tools.XSDToJava;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;