Author: thomas.diesler(a)jboss.com
Date: 2006-12-07 05:45:48 -0500 (Thu, 07 Dec 2006)
New Revision: 1599
Added:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultExceptionHelper.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/Style.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/Use.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/AttrImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/DetailImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/DocumentFragmentImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/EndpointInfo.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/NameImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/NodeListImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/PayloadBuilder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPConnectionFactoryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPDocument.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/TextImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingBuilderImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingClientUtil.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingTypeImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributeElementExtensibleImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributeExtensibleImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributedQNameImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributedURIImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/ElementExtensibleImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/MetadataImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/ReferenceParametersImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/RelationshipImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/metadata/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/soap/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpoint.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpointImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventingConstants.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventingEndpointBase.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventingService.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpoint.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpointImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/deployment/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/metadata/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Constants.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Operation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/QNameTarget.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/STRTransform.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptorFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SimplePrincipal.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Target.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Util.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WsuIdResolver.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WsuIdTarget.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointPublisher.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB21.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInterceptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/
Removed:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpoint.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpointImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingConstants.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingEndpointBase.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingService.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpoint.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpointImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/deployment/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/metadata/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossContextServlet.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServerConfigImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/jms/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/EncodedTypeMapping.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/LiteralTypeMapping.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultExceptionHelper.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SchemaGenerator.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceExt.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceProxy.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceReferenceable.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServletEndpointContextImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/StubExt.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Style.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingRegistryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedCallParameter.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedFaultException.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Use.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/handler/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/transport/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wspolicy/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/xop/
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/HelloWorldService.java
Modified:
branches/tdiesler/jbossws-1.0/.classpath
branches/tdiesler/jbossws-1.0/ant.properties.example
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/Constants.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/DeserializerSupport.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/EndpointInvocation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/SerializationContext.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAPMessageMarshaller.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAPMessageUnMarshaller.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonClient.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonContextServlet.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Deserializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64DeserializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Serializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64SerializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DeserializerFactoryBase.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/NullValueSerializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SerializerFactoryBase.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/EndpointContext.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/HandlerDelegate.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/HeaderSource.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/KernelLocator.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServerConfig.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServletHeaderSource.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/StandardEndpointServlet.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/ImageDataContentHandler.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MimeConstants.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedXOPEncoder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/RawByteArrayOutputStream.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/SimpleBoyerMoore.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/SwapableMemoryDataSource.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/XmlDataContentHandler.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/DOMUtils.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/DOMWriter.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/HolderUtils.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/IOUtils.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/JavaUtils.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/ObjectNameFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/UUIDGenerator.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/XMLPredefinedEntityReferenceResolver.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/AnnotationsMetaDataBuilder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/ServiceEndpointPublisher.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingServerHandler.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingBuilderImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpointDI.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/DeliveryType.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/EndpointReference.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/FilterType.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/MetaData.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/ReferenceParameters.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/RenewRequest.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/RenewResponse.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/StatusRequest.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/StatusResponse.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeRequest.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeResponse.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/SubscriptionEndRequest.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/UnsubscribeRequest.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/metadata/EventingEpMetaExt.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatchJob.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventDispatcher.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventSource.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Filter.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Subscription.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionError.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionTicket.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/Policy.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/PolicyAlternative.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/PolicyFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Reference.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/ReferenceList.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityProcess.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Signature.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Token.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerOutbound.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/CreateAttachmentVisitor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/DisableMTOMHandler.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/JBossXBContentAdapter.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/RestoreXOPElementVisitor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPMarshallerImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPScanner.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPUnmarshallerImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcherMBean.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSTransportSupport.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBDeserializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBDeserializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBMarshallerImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSerializer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSerializerFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/XercesXSMarshallerImpl.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/FaultMetaData.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/HandlerMetaData.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/OperationMetaData.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/TypesMetaData.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/UnifiedMetaData.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11DefinitionFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Reader.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Writer.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitionsFactory.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLWriter.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToXSD.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/ToolsUtils.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/XSDToJava.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/JBossWSTest.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPEnvelopeTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPFactoryTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/JavaUtilsTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/JavaBean.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/ValueType.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/ServerHandler.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws775/JBWS775TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/JBWS812TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/ServerHandler.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws955/JBWS955TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallDocLitTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestServiceBean.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentSAAJTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventSinkServlet.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/JSR181ComplexTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/JSR181HandlerChainTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/oneway/JSR181OneWayTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ClientHandler.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/SchemaGeneratorTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/enums/EnumTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1079/JBWS1079TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1090/JBWS1090TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1170/JBWS1170TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws818/JBWS818TestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/AnonTypesTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardArraysTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardDoubleArraysTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java
Log:
Modified: branches/tdiesler/jbossws-1.0/.classpath
===================================================================
--- branches/tdiesler/jbossws-1.0/.classpath 2006-12-07 07:57:14 UTC (rev 1598)
+++ branches/tdiesler/jbossws-1.0/.classpath 2006-12-07 10:45:48 UTC (rev 1599)
@@ -23,7 +23,6 @@
<classpathentry kind="lib"
path="thirdparty/jboss-xml-binding.jar"/>
<classpathentry kind="lib"
path="thirdparty/stax-api-1.0.jar"/>
<classpathentry kind="lib"
path="thirdparty/wstx-lgpl-2.0.6.jar"/>
- <classpathentry kind="con"
path="org.eclipse.jdt.USER_LIBRARY/jboss-4.0.5"/>
<classpathentry kind="lib" path="thirdparty/ant.jar"/>
<classpathentry kind="lib" path="thirdparty/jboss.jar"
sourcepath="/home/tdiesler/svn/jbossas/tags/JBoss_4_0_5_GA/server/src/main"/>
<classpathentry kind="lib" path="thirdparty/jboss-j2ee.jar"/>
@@ -33,5 +32,6 @@
<classpathentry kind="lib"
path="thirdparty/jboss-common.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-remoting.jar"/>
<classpathentry kind="lib" path="thirdparty/wsdl4j.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.USER_LIBRARY/jboss-4.2.x"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: branches/tdiesler/jbossws-1.0/ant.properties.example
===================================================================
--- branches/tdiesler/jbossws-1.0/ant.properties.example 2006-12-07 07:57:14 UTC (rev
1598)
+++ branches/tdiesler/jbossws-1.0/ant.properties.example 2006-12-07 10:45:48 UTC (rev
1599)
@@ -1,9 +1,9 @@
#
# A sample ant properties file
#
+# $Id$
# Required JBoss Home
-#jboss.jdk15.home=/home/tdiesler/svn/jbossas/tags/JBoss_4_0_5_GA/build/output/jboss-4.0.5.GA-ejb3
#jboss.jdk15.home=/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.CR1-ejb3
# Optional JBoss Home
Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/Constants.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/Constants.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -25,7 +25,7 @@
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
-import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.core.soap.NameImpl;
/**
* A collection of constants relevant to JBossWS
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/DeserializerSupport.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/DeserializerSupport.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/DeserializerSupport.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,7 +27,7 @@
import javax.xml.rpc.encoding.Deserializer;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.utils.XMLPredefinedEntityReferenceResolver;
+import org.jboss.ws.core.utils.XMLPredefinedEntityReferenceResolver;
/** The base class for all Deserializers.
*
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/EndpointInvocation.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/EndpointInvocation.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/EndpointInvocation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -40,13 +40,13 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.soap.SOAPContentElement;
+import org.jboss.ws.core.utils.HolderUtils;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.core.utils.MimeUtils;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.soap.SOAPContentElement;
-import org.jboss.ws.utils.HolderUtils;
-import org.jboss.ws.utils.JavaUtils;
-import org.jboss.ws.utils.MimeUtils;
/** A web service invocation.
*
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/SerializationContext.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/SerializationContext.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/SerializationContext.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAPMessageMarshaller.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAPMessageMarshaller.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAPMessageMarshaller.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,11 +32,11 @@
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.invocation.OnewayInvocation;
import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPElementWriter;
-import org.jboss.ws.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPElementWriter;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
/**
* @author Thomas.Diesler(a)jboss.org
* @since 25-Nov-2004
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAPMessageUnMarshaller.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAPMessageUnMarshaller.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/binding/soap/SOAPMessageUnMarshaller.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -39,7 +39,7 @@
import org.jboss.remoting.marshal.UnMarshaller;
import org.jboss.remoting.transport.http.HTTPMetadataConstants;
import org.jboss.ws.WSException;
-import org.jboss.ws.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
/**
* @author Thomas.Diesler(a)jboss.org
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonClient.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonClient.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonClient.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -39,12 +39,17 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.addressing.AddressingConstantsImpl;
import org.jboss.ws.binding.EndpointInvocation;
import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.handler.HandlerChainBaseImpl;
+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.SOAPConnectionImpl;
+import org.jboss.ws.core.utils.HolderUtils;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
import org.jboss.ws.metadata.ClientEndpointMetaData;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.OperationMetaData;
@@ -53,11 +58,6 @@
import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.EndpointMetaData.Type;
import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.soap.EndpointInfo;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.SOAPConnectionImpl;
-import org.jboss.ws.utils.HolderUtils;
-import org.jboss.ws.utils.JavaUtils;
/**
* Provides support for the dynamic invocation of a service endpoint.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonContextServlet.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonContextServlet.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonContextServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -33,7 +33,7 @@
import javax.servlet.http.HttpServletResponse;
import org.jboss.logging.Logger;
-import org.jboss.ws.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManager;
/**
* The servlet that that is associated with context /jbossws
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP11Binding.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -36,10 +36,10 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.EndpointInvocation;
import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.jaxrpc.Use;
+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.metadata.OperationMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
/**
* The SOAP11Binding
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAP12Binding.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -35,9 +35,9 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.EndpointInvocation;
import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
/**
* The SOAP11Binding
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -52,34 +52,34 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.xop.XOPContext;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.EndpointInvocation;
import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.jaxrpc.SOAPFaultExceptionHelper;
+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;
+import org.jboss.ws.core.soap.SOAPBodyElementDoc;
+import org.jboss.ws.core.soap.SOAPBodyElementRpc;
+import org.jboss.ws.core.soap.SOAPContentElement;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPFactoryImpl;
+import org.jboss.ws.core.soap.SOAPFaultImpl;
+import org.jboss.ws.core.soap.SOAPHeaderElementImpl;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
+import org.jboss.ws.core.soap.attachment.CIDGenerator;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.core.utils.MimeUtils;
+import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ParameterMetaData;
import org.jboss.ws.metadata.TypesMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.soap.SOAPBodyElementDoc;
-import org.jboss.ws.soap.SOAPBodyElementRpc;
-import org.jboss.ws.soap.SOAPContentElement;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPFactoryImpl;
-import org.jboss.ws.soap.SOAPFaultImpl;
-import org.jboss.ws.soap.SOAPHeaderElementImpl;
-import org.jboss.ws.soap.SOAPMessageImpl;
-import org.jboss.ws.soap.attachment.AttachmentPartImpl;
-import org.jboss.ws.soap.attachment.CIDGenerator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.JavaUtils;
-import org.jboss.ws.utils.MimeUtils;
import org.jboss.xb.binding.NamespaceRegistry;
import org.w3c.dom.Element;
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,660 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap.SOAPException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.binding.UnboundHeader;
+import org.jboss.ws.common.CommonClient;
+import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
+import org.jboss.ws.jbossxb.JBossXBSerializerFactory;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.TypesMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+
+/** 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;
+ }
+
+ @Override
+ protected Map<String, Object> getResponseContext()
+ {
+ 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());
+ opMetaData.addParameter(paramMetaData);
+ paramMetaData.setMode(mode);
+ paramMetaData.setInHeader(inHeader);
+
+ 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 rex)
+ {
+ throw new JAXRPCException("Cannot invokeOneWay", rex.getCause());
+ }
+ }
+
+ /** 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 oneway) 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);
+ try
+ {
+ Object retObj = super.invoke(opName, inputParams, unboundHeaders, oneway);
+ return retObj;
+ }
+ 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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java (from
rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.WSException;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.OperationMetaData;
+
+/**
+ * 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.isOneWayOperation())
+ {
+ 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.getPrimitiveValue(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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/EncodedTypeMapping.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/EncodedTypeMapping.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.core.jaxrpc.handler.ClientHandlerChain;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.HandlerMetaDataJAXRPC;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+
+/**
+ * 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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/LiteralTypeMapping.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/LiteralTypeMapping.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.Constants;
+import org.jboss.ws.core.jaxrpc.encoding.*;
+import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
+import org.jboss.ws.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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,539 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+import java.util.List;
+
+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.WSException;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
+import org.jboss.ws.jbossxb.JBossXBSerializerFactory;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.TypeMappingMetaData;
+import org.jboss.ws.metadata.TypesMetaData;
+
+/** 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);
+
+ 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());
+ }
+
+ public static boolean matchRequestParameters(OperationMetaData opMetaData, Class[]
paramTypes)
+ {
+ assertOperationMetaData(opMetaData);
+
+ // [JBWS-1125] Support empty soap body elements
+ if (opMetaData.getParameters().size() == 0)
+ {
+ log.debug("Detected document/literal/wrapped with no parameter
part");
+ return true;
+ }
+
+ ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
+ List<String> varNames = paramMetaData.getWrappedVariables();
+ Class reqStructType = paramMetaData.getJavaType();
+
+ log.debug("matchRequestParameters: " + reqStructType.getName());
+ try
+ {
+ boolean pass = true;
+ for (int i = 0; pass && i < varNames.size(); i++)
+ {
+ String varName = varNames.get(i);
+ Method method = null;
+ try
+ {
+ PropertyDescriptor pd = new PropertyDescriptor(varName, reqStructType);
+ method = pd.getWriteMethod();
+ }
+ catch (IntrospectionException ex)
+ {
+ // jaxws-ri wsimport generates setter without the underscore
+ if (varName.indexOf("_") > 0)
+ {
+ varName = varName.replace("_", "");
+ PropertyDescriptor pd = new PropertyDescriptor(varName,
reqStructType);
+ method = pd.getWriteMethod();
+ }
+ }
+
+ if (method == null)
+ throw new NoSuchMethodError("No write method for: " + varName);
+
+ Class methodType = method.getParameterTypes()[0];
+ Class paramType = paramTypes[i];
+ pass = JavaUtils.isAssignableFrom(methodType, paramType);
+ }
+ return pass;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ log.debug("Invalid request wrapper: " + ex);
+ return false;
+ }
+ }
+
+ public static boolean matchResponseParameters(OperationMetaData opMetaData, Class
returnType)
+ {
+ assertOperationMetaData(opMetaData);
+
+ // [JBWS-1125] Support empty soap body elements
+ if (opMetaData.getReturnParameter() == null)
+ {
+ log.debug("Detected document/literal/wrapped with no return part");
+ return true;
+ }
+
+ ParameterMetaData paramMetaData = opMetaData.getReturnParameter();
+ Class resStructType = paramMetaData.getJavaType();
+
+ log.debug("matchResponseParameters: " + resStructType.getName());
+ try
+ {
+ boolean pass = (returnType == void.class);
+ if (pass == false)
+ {
+ // The return paramter is the wrapper bean
+ // See: org.jboss.test.webservice.jbws718.JBWS718TestCase
+ if (JavaUtils.isAssignableFrom(returnType, resStructType))
+ pass = true;
+ }
+ if (pass == false)
+ {
+ try
+ {
+ resStructType.getConstructor(new Class[] { returnType });
+ pass = true;
+ }
+ catch (NoSuchMethodException ex)
+ {
+ // jaxws-ri wsimport does not generate a ctor with return param type
+ resStructType.getMethod("setResult", returnType);
+ pass = true;
+ }
+ }
+ return pass;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ log.debug("Invalid response wrapper: " + ex);
+ return false;
+ }
+ }
+
+ public static Object wrapRequestParameters(OperationMetaData opMetaData, Object[]
inParams)
+ {
+ assertOperationMetaData(opMetaData);
+
+ // [JBWS-1125] Support empty soap body elements
+ if (opMetaData.getParameters().size() == 0)
+ {
+ log.debug("Detected document/literal/wrapped with no parameter
part");
+ return null;
+ }
+
+ ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
+ List<String> varNames = paramMetaData.getWrappedVariables();
+ Class reqStructType = paramMetaData.getJavaType();
+
+ // Message types can be wrapped
+ if (paramMetaData.isMessageType())
+ {
+ if (inParams == null || inParams.length == 0)
+ return null;
+
+ if (inParams.length > 1)
+ throw new IllegalStateException("Wrapped message parameter cannot have
multiple parts");
+
+ return inParams[0];
+ }
+
+ log.debug("wrapRequestParameters: " + reqStructType.getName());
+ try
+ {
+ Object reqStruct = reqStructType.newInstance();
+ for (int i = 0; i < varNames.size(); i++)
+ {
+ String varName = varNames.get(i);
+ Method method = null;
+ try
+ {
+ PropertyDescriptor pd = new PropertyDescriptor(varName, reqStructType);
+ method = pd.getWriteMethod();
+ }
+ catch (IntrospectionException ex)
+ {
+ // jaxws-ri wsimport generates setter without the underscore
+ if (varName.indexOf("_") > 0)
+ {
+ varName = varName.replace("_", "");
+ PropertyDescriptor pd = new PropertyDescriptor(varName,
reqStructType);
+ method = pd.getWriteMethod();
+ }
+ }
+
+ if (method == null)
+ throw new NoSuchMethodError("No write method for: " + varName);
+
+ Object value = inParams[i];
+ log.debug(" " + method.getName() + ": " + (value != null
? value.getClass().getName() : null));
+ method.invoke(reqStruct, new Object[] { value });
+ }
+
+ return reqStruct;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Cannot wrap request structure: " + e);
+ }
+ }
+
+ public static Object[] unwrapRequestParameters(OperationMetaData opMetaData, Object
reqStruct)
+ {
+ assertOperationMetaData(opMetaData);
+
+ if (reqStruct == null)
+ throw new IllegalArgumentException("Request struct cannot be null");
+
+ ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
+ List<String> varNames = paramMetaData.getWrappedVariables();
+ Class reqStructType = reqStruct.getClass();
+
+ log.debug("unwrapRequestParameters: " + reqStructType.getName());
+ Object[] inParams = new Object[varNames.size()];
+ try
+ {
+ for (int i = 0; i < varNames.size(); i++)
+ {
+ String varName = varNames.get(i);
+ Method method = null;
+ try
+ {
+ PropertyDescriptor pd = new PropertyDescriptor(varName, reqStructType);
+ method = pd.getReadMethod();
+ }
+ catch (IntrospectionException ex)
+ {
+ // jaxws-ri wsimport generates getter without the underscore
+ if (varName.indexOf("_") > 0)
+ {
+ varName = varName.replace("_", "");
+ PropertyDescriptor pd = new PropertyDescriptor(varName,
reqStructType);
+ method = pd.getReadMethod();
+ }
+ }
+
+ if (method == null)
+ throw new NoSuchMethodError("No read method for: " + varName);
+
+ Object value = method.invoke(reqStruct, new Object[] {});
+ log.debug(" " + method.getName() + ": " + (value != null
? value.getClass().getName() : null));
+ inParams[i] = value;
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new IllegalArgumentException("Cannot unwrap request structure: "
+ e);
+ }
+
+ return inParams;
+ }
+
+ public static Object wrapResponseParameter(OperationMetaData opMetaData, Object
outParam)
+ {
+ assertOperationMetaData(opMetaData);
+
+ // [JBWS-1125] Support empty soap body elements
+ if (opMetaData.getReturnParameter() == null)
+ {
+ log.debug("Detected document/literal/wrapped with no return part");
+ return null;
+ }
+
+ ParameterMetaData paramMetaData = opMetaData.getReturnParameter();
+ List<String> varNames = paramMetaData.getWrappedVariables();
+ Class resStructType = paramMetaData.getJavaType();
+
+ // Message types can be wrapped
+ if (paramMetaData.isMessageType())
+ return outParam;
+
+ if (outParam != null && outParam.getClass() == resStructType)
+ {
+ log.debug("Response parameter already wrapped" +
resStructType.getName());
+ return outParam;
+ }
+
+ log.debug("wrapResponseParameter: " + resStructType.getName());
+ try
+ {
+ Object resStruct = resStructType.newInstance();
+ if (varNames.size() > 0)
+ {
+ String varName = varNames.get(0);
+ Method method = null;
+ try
+ {
+ PropertyDescriptor pd = new PropertyDescriptor(varName, resStructType);
+ method = pd.getWriteMethod();
+ }
+ catch (IntrospectionException ex)
+ {
+ // jaxws-ri wsimport generates setter without the underscore
+ if (varName.indexOf("_") > 0)
+ {
+ varName = varName.replace("_", "");
+ PropertyDescriptor pd = new PropertyDescriptor(varName,
resStructType);
+ method = pd.getWriteMethod();
+ }
+ }
+
+ if (method == null)
+ throw new NoSuchMethodError("No write method for: " + varName);
+
+ Object value = outParam;
+ log.debug(" " + method.getName() + ": " + (value != null
? value.getClass().getName() : null));
+ method.invoke(resStruct, new Object[] { value });
+ }
+ return resStruct;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Cannot wrap response structure: " + e);
+ }
+ }
+
+ public static Object unwrapResponseParameter(OperationMetaData opMetaData, Object
resStruct)
+ {
+ assertOperationMetaData(opMetaData);
+
+ Object retValue = null;
+ if (resStruct != null)
+ {
+ ParameterMetaData paramMetaData = opMetaData.getReturnParameter();
+ List<String> varNames = paramMetaData.getWrappedVariables();
+ Class resStructType = resStruct.getClass();
+
+ log.debug("unwrapResponseParameter: " + resStructType.getName());
+ try
+ {
+ if (varNames.size() > 0)
+ {
+ String varName = varNames.get(0);
+ Method method = null;
+ try
+ {
+ PropertyDescriptor pd = new PropertyDescriptor(varName,
resStructType);
+ method = pd.getReadMethod();
+ }
+ catch (IntrospectionException ex)
+ {
+ // jaxws-ri wsimport generates getter without the underscore
+ if (varName.indexOf("_") > 0)
+ {
+ varName = varName.replace("_", "");
+ PropertyDescriptor pd = new PropertyDescriptor(varName,
resStructType);
+ method = pd.getReadMethod();
+ }
+ }
+
+ if (method == null)
+ throw new NoSuchMethodError("No read method for: " +
varName);
+
+ Object value = method.invoke(resStruct, new Object[] {});
+ log.debug(" " + method.getName() + ": " + (value !=
null ? value.getClass().getName() : null));
+ retValue = 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<String> wrappedTypes = pmd.getWrappedTypes();
+ List<String> wrappedVariables = pmd.getWrappedVariables();
+ 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 (wrappedTypes.size() == 0)
+ throw new WSException("No wrapped types available");
+
+ String serviceName = serviceMetaData.getQName().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 (int i = 0; i < wrappedTypes.size(); i++)
+ {
+ String typeName = wrappedTypes.get(i);
+ String name = wrappedVariables.get(i);
+
+ CtField field = new CtField(pool.get(typeName), name, clazz);
+ field.setModifiers(Modifier.PRIVATE);
+ clazz.addField(field);
+
+ String capName = capitalize(name);
+ clazz.addMethod(CtNewMethod.getter("get" + capName, field));
+ clazz.addMethod(CtNewMethod.setter("set" + capName, field));
+
+ if (pmd.getOperationMetaData().getReturnParameter() == pmd)
+ {
+ if (capName.equals("Result") == false)
+ {
+ clazz.addMethod(CtNewMethod.getter("getResult", field));
+ clazz.addMethod(CtNewMethod.setter("setResult", 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);
+ }
+
+ private static String capitalize(String source)
+ {
+ if (source == null)
+ return null;
+
+ if (source.length() == 0)
+ return source;
+
+ char c = Character.toUpperCase(source.charAt(0));
+
+ return c + source.substring(1);
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultExceptionHelper.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultExceptionHelper.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultExceptionHelper.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultExceptionHelper.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.BindingException;
+import org.jboss.ws.binding.DeserializerSupport;
+import org.jboss.ws.binding.SerializationContext;
+import org.jboss.ws.binding.SerializerSupport;
+import org.jboss.ws.common.CommonMessageContext;
+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.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.metadata.FaultMetaData;
+import org.jboss.ws.metadata.OperationMetaData;
+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 SOAPFaultExceptionHelper
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPFaultExceptionHelper.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 SOAPFaultExceptionHelper()
+ {
+ }
+
+ /** 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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SchemaGenerator.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SchemaGenerator.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/SchemaGenerator.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.WSException;
+import org.jboss.ws.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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.SerializationContext;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.TypesMetaData;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
+
+/**
+ * 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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java (from
rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceExt.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceExt.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceExt.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceFactoryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,161 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, 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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,409 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.deployment.JSR109ClientMetaDataBuilder;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.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;
+ JSR109ClientMetaDataBuilder builder = new JSR109ClientMetaDataBuilder();
+
+ ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
+ builder.setResourceLoader(new URLClassLoader(new URL[] {}, ctxClassLoader));
+ builder.setClassLoader(ctxClassLoader);
+
+ serviceMetaData = builder.buildMetaData(serviceName, wsdlURL, mappingURL,
securityURL, null);
+ 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;
+ JSR109ClientMetaDataBuilder builder = new JSR109ClientMetaDataBuilder();
+
+ ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
+ builder.setResourceLoader(new URLClassLoader(new URL[] {}, ctxClassLoader));
+ builder.setClassLoader(ctxClassLoader);
+
+ serviceMetaData = builder.buildMetaData(serviceName, wsdlURL, mappingURL,
securityConfig, serviceRefMetaData);
+ 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.getQName();
+ }
+
+ /**
+ * 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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.HandlerMetaData;
+import org.jboss.ws.metadata.HandlerMetaDataJAXRPC;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+
+/**
+ * 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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceProxy.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceProxy.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceProxy.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceReferenceable.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceReferenceable.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
+
+/**
+ * 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.localUrl != null ? udi.localUrl : 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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServletEndpointContextImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServletEndpointContextImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/StubExt.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/StubExt.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.metadata.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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/Style.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Style.java)
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Style.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/Style.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.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.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;
+import org.jboss.ws.core.utils.JavaUtils;
+
+/**
+ * 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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingRegistryImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingRegistryImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedCallParameter.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedCallParameter.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedCallParameter.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedFaultException.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedFaultException.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/UnqualifiedFaultException.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/Use.java
(from rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Use.java)
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Use.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/Use.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.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/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding
(from rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Deserializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Deserializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
@@ -29,9 +29,9 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.xop.XOPContext;
-import org.jboss.ws.xop.XOPUnmarshallerImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.extensions.xop.XOPUnmarshallerImpl;
import org.jboss.ws.WSException;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64DeserializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64DeserializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64DeserializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.DeserializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Serializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64Serializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
@@ -29,9 +29,9 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.binding.SerializerSupport;
-import org.jboss.ws.utils.JavaUtils;
-import org.jboss.ws.xop.XOPContext;
-import org.jboss.ws.xop.XOPMarshallerImpl;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.extensions.xop.XOPMarshallerImpl;
import org.jboss.xb.binding.NamespaceRegistry;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64SerializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64SerializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/Base64SerializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.SerializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarDeserializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarDeserializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarDeserializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.DeserializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarSerializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/CalendarSerializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/CalendarSerializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.SerializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/DateDeserializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/DateDeserializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateDeserializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.DeserializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/DateSerializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/DateSerializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DateSerializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.SerializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DeserializerFactoryBase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/DeserializerFactoryBase.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/DeserializerFactoryBase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementDeserializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,17 +19,17 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementDeserializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementDeserializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.DeserializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementSerializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,17 +19,17 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.binding.SerializerSupport;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/ElementSerializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/ElementSerializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.SerializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/HexDeserializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/HexDeserializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexDeserializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.DeserializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/HexSerializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
@@ -29,7 +29,7 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.binding.SerializerSupport;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.xb.binding.NamespaceRegistry;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.w3c.dom.NamedNodeMap;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/HexSerializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/HexSerializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.SerializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/NullValueSerializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/NullValueSerializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/NullValueSerializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameDeserializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
@@ -28,10 +28,10 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.xb.binding.NamespaceRegistry;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameDeserializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameDeserializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.DeserializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameSerializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/QNameSerializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/QNameSerializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.SerializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
@@ -31,16 +31,16 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.utils.JavaUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArrayDeserializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArrayDeserializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.DeserializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
@@ -31,9 +31,9 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.binding.SerializerSupport;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.utils.JavaUtils;
import org.w3c.dom.NamedNodeMap;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPArraySerializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPArraySerializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.SerializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementDeserializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,19 +19,19 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPFactoryImpl;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPFactoryImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementDeserializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementDeserializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.DeserializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementSerializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
@@ -27,10 +27,10 @@
import javax.xml.soap.SOAPElement;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.binding.SerializerSupport;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.NamedNodeMap;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SOAPElementSerializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SOAPElementSerializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.SerializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SerializerFactoryBase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SerializerFactoryBase.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SerializerFactoryBase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleDeserializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleDeserializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleDeserializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.DeserializerSupport;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleSerializer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/SimpleSerializerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/encoding/SimpleSerializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.encoding;
import org.jboss.ws.binding.SerializerSupport;
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler (from
rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/handler)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/handler/ClientHandlerChain.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/ClientHandlerChain.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.handler;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerChainBaseImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.handler;
// $Id$
@@ -49,14 +49,14 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.common.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.EndpointMetaData;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ParameterMetaData;
import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPElementWriter;
-import org.jboss.ws.soap.SOAPEnvelopeImpl;
-import org.jboss.ws.soap.SOAPMessageImpl;
/**
* Represents a list of handlers. All elements in the
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.handler;
// $Id$
@@ -34,15 +34,15 @@
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.extensions.xop.XOPContext;
import org.jboss.ws.metadata.HandlerMetaData;
import org.jboss.ws.metadata.HandlerMetaDataJAXRPC;
import org.jboss.ws.metadata.ServerEndpointMetaData;
import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.server.HandlerDelegate;
-import org.jboss.ws.server.ServiceEndpointInfo;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.xop.XOPContext;
/** Delegates to JAXRPC handlers
*
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerWrapper.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerWrapper.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.handler;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/handler/MessageContextJAXRPC.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.handler;
// $Id$
@@ -28,7 +28,7 @@
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.SerializationContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.ServiceMetaData;
import org.jboss.xb.binding.NamespaceRegistry;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/handler/SOAPMessageContextJAXRPC.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/SOAPMessageContextJAXRPC.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.handler;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/handler/ServerHandlerChain.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/jaxrpc/handler/ServerHandlerChain.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, 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;
+package org.jboss.ws.core.jaxrpc.handler;
// $Id$
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server (from rev
1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/AbstractServiceEndpointInvoker.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
@@ -42,15 +42,15 @@
import org.jboss.ws.common.CommonBinding;
import org.jboss.ws.common.CommonBindingProvider;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper;
-import org.jboss.ws.jaxrpc.handler.HandlerDelegateJAXRPC;
+import org.jboss.ws.core.jaxrpc.SOAPFaultExceptionHelper;
+import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ServerEndpointMetaData;
import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.SOAPMessageImpl;
-import org.jboss.ws.utils.JavaUtils;
/** An implementation handles invocations on the endpoint
*
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/EndpointContext.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/EndpointContext.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/EndpointContext.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
@@ -29,7 +29,7 @@
import javax.servlet.http.HttpSession;
import javax.xml.rpc.handler.MessageContext;
-import org.jboss.ws.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.MessageContextAssociation;
/**
* Implementation of ServletEndpointContext
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/HandlerDelegate.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/HandlerDelegate.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/HandlerDelegate.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/HeaderSource.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/HeaderSource.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/HeaderSource.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
import javax.xml.soap.MimeHeaders;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/KernelLocator.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/KernelLocator.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/KernelLocator.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
//$Id: WebServiceDeployer.java 312 2006-05-11 10:49:22Z thomas.diesler(a)jboss.com $
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServerConfig.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServerConfig.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServerConfig.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z
thomas.diesler(a)jboss.com $
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServerConfigFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.logging.Logger;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServiceEndpoint.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
@@ -38,18 +38,18 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
-import org.jboss.ws.xop.XOPContext;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper;
+import org.jboss.ws.core.jaxrpc.SOAPFaultExceptionHelper;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPElementWriter;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPElementWriter;
-import org.jboss.ws.soap.SOAPMessageImpl;
-import org.jboss.ws.utils.DOMWriter;
import org.w3c.dom.Document;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServiceEndpointInfo.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServiceEndpointInvoker.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServiceEndpointInvokerJSE.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
@@ -33,7 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.jaxrpc.ServletEndpointContextImpl;
+import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
import org.jboss.ws.metadata.ServerEndpointMetaData;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
@@ -55,18 +55,18 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.addressing.AddressingConstantsImpl;
import org.jboss.ws.common.CommonMessageContext;
import org.jboss.ws.common.MessageContextPropertyHelper;
-import org.jboss.ws.jaxrpc.handler.MessageContextJAXRPC;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.SOAPConnectionImpl;
+import org.jboss.ws.core.utils.ThreadLocalAssociation;
+import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
import org.jboss.ws.metadata.HandlerMetaData;
import org.jboss.ws.metadata.ServerEndpointMetaData;
import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.SOAPConnectionImpl;
-import org.jboss.ws.utils.ThreadLocalAssociation;
/**
* A service that manages JBossWS endpoints.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServiceEndpointManagerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServiceEndpointManagerMBean.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointManagerMBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
import java.net.UnknownHostException;
import java.util.List;
import javax.management.ObjectName;
+import org.jboss.ws.core.utils.ObjectNameFactory;
import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.utils.ObjectNameFactory;
/**
* MBean interface.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServiceEndpointMetrics.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServiceEndpointMetrics.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServletHeaderSource.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/ServletHeaderSource.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/ServletHeaderSource.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/StandardEndpointServlet.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/StandardEndpointServlet.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/StandardEndpointServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id: AbstractServiceEndpointServlet.java 396 2006-05-23 09:48:45Z
thomas.diesler(a)jboss.com $
@@ -38,9 +38,9 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.ServletEndpointContextImpl;
+import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
+import org.jboss.ws.core.utils.ObjectNameFactory;
import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.utils.ObjectNameFactory;
/**
* A servlet that is installed for every web service endpoint.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/WSDLFilePublisher.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
@@ -41,14 +41,14 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
import org.jboss.ws.metadata.ServiceMetaData;
import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.utils.IOUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/server/WSDLRequestHandler.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.server;
+package org.jboss.ws.core.server;
// $Id$
@@ -29,8 +29,8 @@
import java.net.URL;
import org.jboss.logging.Logger;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/AttrImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/AttrImpl.java)
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/AttrImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/AttrImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.TypeInfo;
+
+/**
+ * Facade for DOM Attr. Helps ensure that the propper SAAJ entities are returned
+ * after DOM calls are made.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class AttrImpl extends NodeImpl implements Attr
+{
+ private SOAPElementImpl element;
+
+ private Attr attr;
+
+ public AttrImpl(SOAPElementImpl element, Attr attr)
+ {
+ super(attr);
+ this.attr = attr;
+ this.element = element;
+ }
+
+ public String getName()
+ {
+ return attr.getName();
+ }
+
+ public Element getOwnerElement()
+ {
+ return element;
+ }
+
+ public Document getOwnerDocument()
+ {
+ return element.getOwnerDocument();
+ }
+
+ public boolean getSpecified()
+ {
+ return attr.getSpecified();
+ }
+
+ public String getValue()
+ {
+ return attr.getValue();
+ }
+
+ public TypeInfo getSchemaTypeInfo()
+ {
+ // TODO Implement DOM3
+ return null;
+ }
+
+ public boolean isId()
+ {
+ // TODO Implement DOM3
+ return false;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/DetailEntryImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/DetailEntryImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, 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.soap;
+
+import javax.xml.soap.DetailEntry;
+import javax.xml.soap.Name;
+
+/**
+ * The content for a Detail object, giving details for a SOAPFault object.
+ * A DetailEntry object, which carries information about errors related to the SOAPBody
object that contains it,
+ * is application-specific.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class DetailEntryImpl extends SOAPElementImpl implements DetailEntry
+{
+ public DetailEntryImpl(Name name)
+ {
+ super(name);
+ }
+
+ public DetailEntryImpl(SOAPElementImpl soapElement)
+ {
+ super(soapElement);
+ }
+}
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/DetailImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/DetailImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/DetailImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/DetailImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+import java.util.Iterator;
+
+import javax.xml.soap.Detail;
+import javax.xml.soap.DetailEntry;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPException;
+
+/**
+ * A container for DetailEntry objects. DetailEntry objects give detailed error
information that is application-specific
+ * and related to the SOAPBody object that contains it.
+ *
+ * A Detail object, which is part of a SOAPFault object, can be retrieved using the
method SOAPFault.getDetail.
+ *
+ * The Detail interface provides two methods. One creates a new DetailEntry object and
also automatically adds
+ * it to the Detail object. The second method gets a list of the DetailEntry objects
contained in a Detail object.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class DetailImpl extends SOAPFaultElementImpl implements Detail
+{
+ public DetailImpl()
+ {
+ super("detail");
+ }
+
+ public DetailEntry addDetailEntry(Name name) throws SOAPException
+ {
+ DetailEntryImpl detailEntry = new DetailEntryImpl(name);
+ addChildElement(detailEntry);
+ return detailEntry;
+ }
+
+ public Iterator getDetailEntries()
+ {
+ return getChildElements();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/DocumentFragmentImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/DocumentFragmentImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/DocumentFragmentImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/DocumentFragmentImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,231 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, 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.soap;
+
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.UserDataHandler;
+
+/**
+ * An implementation of a DOM Document fragment. This just delegates to
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class DocumentFragmentImpl implements DocumentFragment
+{
+ private DocumentFragment delegate;
+
+ public DocumentFragmentImpl(DocumentFragment fragment)
+ {
+ this.delegate = fragment;
+ }
+
+ public Node appendChild(Node arg0) throws DOMException
+ {
+ return delegate.appendChild(arg0);
+ }
+
+ public Node cloneNode(boolean arg0)
+ {
+ return delegate.cloneNode(arg0);
+ }
+
+ public short compareDocumentPosition(Node arg0) throws DOMException
+ {
+ return delegate.compareDocumentPosition(arg0);
+ }
+
+ public NamedNodeMap getAttributes()
+ {
+ return delegate.getAttributes();
+ }
+
+ public String getBaseURI()
+ {
+ return delegate.getBaseURI();
+ }
+
+ public NodeList getChildNodes()
+ {
+ return delegate.getChildNodes();
+ }
+
+ public Object getFeature(String arg0, String arg1)
+ {
+ return delegate.getFeature(arg0, arg1);
+ }
+
+ public Node getFirstChild()
+ {
+ return delegate.getFirstChild();
+ }
+
+ public Node getLastChild()
+ {
+ return delegate.getLastChild();
+ }
+
+ public String getLocalName()
+ {
+ return delegate.getLocalName();
+ }
+
+ public String getNamespaceURI()
+ {
+ return delegate.getNamespaceURI();
+ }
+
+ public Node getNextSibling()
+ {
+ return delegate.getNextSibling();
+ }
+
+ public String getNodeName()
+ {
+ return delegate.getNodeName();
+ }
+
+ public short getNodeType()
+ {
+ return delegate.getNodeType();
+ }
+
+ public String getNodeValue() throws DOMException
+ {
+ return delegate.getNodeValue();
+ }
+
+ public Document getOwnerDocument()
+ {
+ return delegate.getOwnerDocument();
+ }
+
+ public Node getParentNode()
+ {
+ return delegate.getParentNode();
+ }
+
+ public String getPrefix()
+ {
+ return delegate.getPrefix();
+ }
+
+ public Node getPreviousSibling()
+ {
+ return delegate.getPreviousSibling();
+ }
+
+ public String getTextContent() throws DOMException
+ {
+ return delegate.getTextContent();
+ }
+
+ public Object getUserData(String arg0)
+ {
+ return delegate.getUserData(arg0);
+ }
+
+ public boolean hasAttributes()
+ {
+ return delegate.hasAttributes();
+ }
+
+ public boolean hasChildNodes()
+ {
+ return delegate.hasChildNodes();
+ }
+
+ public Node insertBefore(Node arg0, Node arg1) throws DOMException
+ {
+ return delegate.insertBefore(arg0, arg1);
+ }
+
+ public boolean isDefaultNamespace(String arg0)
+ {
+ return delegate.isDefaultNamespace(arg0);
+ }
+
+ public boolean isEqualNode(Node arg0)
+ {
+ return delegate.isEqualNode(arg0);
+ }
+
+ public boolean isSameNode(Node arg0)
+ {
+ return delegate.isSameNode(arg0);
+ }
+
+ public boolean isSupported(String arg0, String arg1)
+ {
+ return delegate.isSupported(arg0, arg1);
+ }
+
+ public String lookupNamespaceURI(String arg0)
+ {
+ return delegate.lookupNamespaceURI(arg0);
+ }
+
+ public String lookupPrefix(String arg0)
+ {
+ return delegate.lookupPrefix(arg0);
+ }
+
+ public void normalize()
+ {
+ delegate.normalize();
+ }
+
+ public Node removeChild(Node arg0) throws DOMException
+ {
+ return delegate.removeChild(arg0);
+ }
+
+ public Node replaceChild(Node arg0, Node arg1) throws DOMException
+ {
+ return delegate.replaceChild(arg0, arg1);
+ }
+
+ public void setNodeValue(String arg0) throws DOMException
+ {
+ delegate.setNodeValue(arg0);
+ }
+
+ public void setPrefix(String arg0) throws DOMException
+ {
+ delegate.setPrefix(arg0);
+ }
+
+ public void setTextContent(String arg0) throws DOMException
+ {
+ delegate.setTextContent(arg0);
+ }
+
+ public Object setUserData(String arg0, Object arg1, UserDataHandler arg2)
+ {
+ return delegate.setUserData(arg0, arg1, arg2);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/EndpointInfo.java (from
rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/EndpointInfo.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/EndpointInfo.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/EndpointInfo.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import org.jboss.ws.metadata.EndpointMetaData;
+
+/** A wrapper object that associates the target address with some metadata
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 20-Jul-2005
+ */
+public class EndpointInfo
+{
+ private String targetAddress;
+ private Map<String, Object> properties;
+
+ public EndpointInfo(EndpointMetaData epMetaData, String targetAddress, Map<String,
Object> callProps)
+ {
+ this.targetAddress = targetAddress;
+ this.properties = new HashMap<String, Object>();
+
+ // Add the service properties
+ Properties serviceProps = epMetaData.getServiceMetaData().getProperties();
+ if (serviceProps != null)
+ {
+ Iterator it = serviceProps.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ String key = (String)entry.getKey();
+ Object val = entry.getValue();
+ properties.put(key, val);
+ }
+ }
+
+ // Add the endpoint properties
+ Properties epProps = epMetaData.getProperties();
+ if (epProps != null)
+ {
+ Iterator it = epProps.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ String key = (String)entry.getKey();
+ Object val = entry.getValue();
+ properties.put(key, val);
+ }
+ }
+
+ // Add the call properties
+ if (callProps != null)
+ {
+ properties.putAll(callProps);
+ }
+ }
+
+ public Map<String, Object> getProperties()
+ {
+ return properties;
+ }
+
+ public String getTargetAddress()
+ {
+ return targetAddress;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof EndpointInfo))
+ return false;
+ return toString().equals(obj.toString());
+ }
+
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ public String toString()
+ {
+ return "[addr=" + targetAddress + ",props=" + properties +
"]";
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/MessageContextAssociation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/MessageContextAssociation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+// $Id$
+
+import java.util.Stack;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.utils.ThreadLocalAssociation;
+
+/**
+ * A thread local association with the current message context
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Dec-2004
+ */
+public class MessageContextAssociation
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(MessageContextAssociation.class);
+
+
+ public static void pushMessageContext(CommonMessageContext msgContext)
+ {
+ log.debug("pushMessageContext: " + msgContext);
+ Stack<CommonMessageContext> stack =
ThreadLocalAssociation.localMsgContextAssoc().get();
+ if (stack == null)
+ {
+ stack = new Stack<CommonMessageContext>();
+ ThreadLocalAssociation.localMsgContextAssoc().set(stack);
+ }
+ stack.push(msgContext);
+ }
+
+ public static CommonMessageContext peekMessageContext()
+ {
+ CommonMessageContext msgContext = null;
+ Stack<CommonMessageContext> stack =
ThreadLocalAssociation.localMsgContextAssoc().get();
+ if (stack != null && stack.isEmpty() == false)
+ {
+ msgContext = stack.peek();
+ }
+ return msgContext;
+ }
+
+ public static CommonMessageContext popMessageContext()
+ {
+ CommonMessageContext msgContext = null;
+ Stack<CommonMessageContext> stack =
ThreadLocalAssociation.localMsgContextAssoc().get();
+ if (stack != null && stack.isEmpty() == false)
+ {
+ msgContext = stack.pop();
+ }
+ log.debug("popMessageContext: " + msgContext);
+ return msgContext;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/MessageFactoryImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/MessageFactoryImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,257 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+// $Id$
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.mail.internet.ContentType;
+import javax.mail.internet.ParseException;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.common.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.core.utils.IOUtils;
+
+/**
+ * MessageFactory implementation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class MessageFactoryImpl extends MessageFactory
+{
+ private static Logger log = Logger.getLogger(MessageFactoryImpl.class);
+
+ // The envelope URI used by the MessageFactory
+ private String envelopeURI = Constants.NS_SOAP11_ENV;
+
+ // The style used by this MessageFactory
+ private Style style;
+
+ /**
+ * Get the SOAP envelope URI this factory will use when creating envelopes.
+ */
+ public String getEnvelopeURI()
+ {
+ return envelopeURI;
+ }
+
+ /**
+ * Set the SOAP envelope URI this factory will use when creating envelopes.
+ */
+ public void setEnvelopeURI(String envelopeURI)
+ {
+ this.envelopeURI = envelopeURI;
+ }
+
+ /**
+ * Get the Style this message factory will use
+ */
+ public Style getStyle()
+ {
+ if (style == null)
+ {
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ if (msgContext != null && msgContext.getOperationMetaData() != null)
+ {
+ style = msgContext.getOperationMetaData().getStyle();
+ }
+ log.trace("Using style: " + style);
+ }
+ return style;
+ }
+
+ public void setStyle(Style style)
+ {
+ this.style = style;
+ }
+
+ /**
+ * Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope,
+ * SOAPBody, and SOAPHeader objects. Profile-specific message factories can
+ * choose to prepopulate the SOAPMessage object with profile-specific
+ * headers.
+ *
+ * Content can be added to this message's SOAPPart object, and the message
+ * can be sent "as is" when a message containing only a SOAP part is
+ * sufficient. Otherwise, the SOAPMessage object needs to create one or more
+ * AttachmentPart objects and add them to itself. Any content that is not in
+ * XML format must be in an AttachmentPart object.
+ *
+ * @return a new SOAPMessage object
+ * @throws javax.xml.soap.SOAPException
+ * if a SOAP error occurs
+ */
+ public SOAPMessage createMessage() throws SOAPException
+ {
+ SOAPMessageImpl soapMessage = new SOAPMessageImpl();
+ SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
+ new SOAPEnvelopeImpl(soapPart, envelopeURI);
+ return soapMessage;
+ }
+
+ /**
+ * Internalizes the contents of the given InputStream object into a new
+ * SOAPMessage object and returns the SOAPMessage object.
+ *
+ * @param mimeHeaders
+ * the transport-specific headers passed to the message in a
+ * transport-independent fashion for creation of the message
+ * @param ins
+ * the InputStream object that contains the data for a message
+ * @return a new SOAPMessage object containing the data from the given
+ * InputStream object
+ * @throws java.io.IOException
+ * if there is a problem in reading data from the input stream
+ * @throws javax.xml.soap.SOAPException
+ * if the message is invalid
+ */
+ public SOAPMessage createMessage(MimeHeaders mimeHeaders, InputStream ins) throws
IOException, SOAPException
+ {
+ return createMessageInternal(mimeHeaders, ins, false);
+ }
+
+ public SOAPMessage createMessageInternal(MimeHeaders mimeHeaders, InputStream ins,
boolean ignoreParseError) throws IOException, SOAPException
+ {
+ if (mimeHeaders == null)
+ {
+ mimeHeaders = new MimeHeaders();
+ }
+ else if (log.isTraceEnabled())
+ {
+ Iterator<MimeHeader> itMimeHeaders = mimeHeaders.getAllHeaders();
+ while (itMimeHeaders.hasNext())
+ {
+ MimeHeader mh = itMimeHeaders.next();
+ log.trace(mh);
+ }
+ }
+
+ ContentType contentType = getContentType(mimeHeaders);
+ log.debug("createMessage: [contentType=" + contentType + "]");
+
+ // Debug the incoming message
+ if (log.isTraceEnabled())
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ IOUtils.copyStream(baos, ins);
+ byte[] bytes = baos.toByteArray();
+
+ log.trace("createMessage\n" + new String(bytes));
+ ins = new ByteArrayInputStream(bytes);
+ }
+
+ Collection<AttachmentPart> attachments = null;
+ if (isMultipartRelatedContent(contentType))
+ {
+ MultipartRelatedDecoder decoder;
+ try
+ {
+ decoder = new MultipartRelatedDecoder(contentType);
+ decoder.decodeMultipartRelatedMessage(ins);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (IOException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new SOAPException("Cannot decode multipart related message",
ex);
+ }
+
+ ins = decoder.getRootPart().getDataHandler().getInputStream();
+ attachments = decoder.getRelatedParts();
+ }
+ else if (isSoapContent(contentType) == false)
+ {
+ throw new SOAPException("Unsupported content type: " + contentType);
+ }
+
+ SOAPMessageImpl soapMessage = new SOAPMessageImpl();
+ if (mimeHeaders != null)
+ soapMessage.setMimeHeaders(mimeHeaders);
+
+ if (attachments != null)
+ soapMessage.setAttachments(attachments);
+
+ // Get the SOAPEnvelope builder
+ PayloadBuilder payloadBuilder = new SAAJPayloadBuilderDOM(getStyle());
+
+ // Build the payload
+ payloadBuilder.build(soapMessage, ins, ignoreParseError);
+
+ return soapMessage;
+ }
+
+ private static ContentType getContentType(MimeHeaders headers) throws SOAPException
+ {
+ ContentType contentType = null;
+ try
+ {
+ String[] type = headers.getHeader(MimeConstants.CONTENT_TYPE);
+ if (type != null)
+ {
+ contentType = new ContentType(type[0]);
+ }
+ else
+ {
+ contentType = new ContentType(MimeConstants.TYPE_SOAP11);
+ }
+ return contentType;
+ }
+ catch (ParseException e)
+ {
+ throw new SOAPException("Could not parse content type:" + e);
+ }
+ }
+
+ private boolean isSoapContent(ContentType type)
+ {
+ String baseType = type.getBaseType();
+ return MimeConstants.TYPE_SOAP11.equals(baseType) ||
MimeConstants.TYPE_SOAP12.equals(baseType);
+ }
+
+ private boolean isMultipartRelatedContent(ContentType type)
+ {
+ String baseType = type.getBaseType();
+ return MimeConstants.TYPE_MULTIPART_RELATED.equals(baseType);
+ }
+}
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/NameImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/NameImpl.java)
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/NameImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/NameImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+
+/**
+ * An implementation of a Name
+ * <p/>
+ * At this time of writing, the spec does not say anything about null values.
+ * We assume emty string for any null value.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 01-June-2004
+ */
+public class NameImpl implements Name
+{
+ private QName qname;
+
+ public NameImpl(QName qname)
+ {
+ this.qname = qname;
+ }
+
+ public NameImpl(String local)
+ {
+ qname = new QName(local);
+ }
+
+ public NameImpl(String local, String prefix, String uri)
+ {
+ if (prefix != null)
+ qname = new QName(uri, local, prefix);
+ else
+ qname = new QName(uri, local);
+ }
+
+ /**
+ * Gets the local name part of the XML name that this Name object represents.
+ *
+ * @return a string giving the local name
+ */
+ public String getLocalName()
+ {
+ return qname.getLocalPart();
+ }
+
+ /**
+ * Returns the prefix that was specified when this Name object was initialized.
+ * This prefix is associated with the namespace for the XML name that this Name object
represents.
+ *
+ * @return the prefix as a string
+ */
+ public String getPrefix()
+ {
+ return qname.getPrefix();
+ }
+
+ /**
+ * Gets the namespace-qualified name of the XML name that this Name object
represents.
+ *
+ * @return the namespace-qualified name as a string
+ */
+ public String getQualifiedName()
+ {
+ String prefix = getPrefix();
+ if (prefix.length() > 0)
+ return prefix + ":" + qname.getLocalPart();
+ else
+ return qname.getLocalPart();
+ }
+
+ /**
+ * Returns the URI of the namespace for the XML name that this Name object
represents.
+ *
+ * @return the URI as a string
+ */
+ public String getURI()
+ {
+ return qname.getNamespaceURI();
+ }
+
+ public int hashCode()
+ {
+ return qname.hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof NameImpl)) return false;
+ if (obj == this) return true;
+ NameImpl other = (NameImpl)obj;
+ return qname.equals(other.qname);
+ }
+
+ public QName toQName()
+ {
+ return qname;
+ }
+
+ public String toString()
+ {
+ return qname.toString();
+ }
+}
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/NodeImpl.java)
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/NodeImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,674 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.WSException;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.UserDataHandler;
+
+/**
+ * A representation of a node (element) in an XML document.
+ * This interface extnends the standard DOM Node interface with methods for getting and
setting the value of a node,
+ * for getting and setting the parent of a node, and for removing a node.
+ *
+ * When creating a DOM2 tree the objects maintained by the tree are
<code>org.w3c.dom.Node</code> objects
+ * and not <code>javax.xml.soap.Node</code> objects.
+ * <p/>
+ * This implementation schields the client from the the underlying DOM2 tree, returning
<code>javax.xml.soap.Node</code>
+ * objects.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class NodeImpl implements javax.xml.soap.Node
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(NodeImpl.class);
+
+ // The parent of this Node
+ protected SOAPElementImpl soapParent;
+ // This org.w3c.dom.Node
+ protected org.w3c.dom.Node domNode;
+ // A list of soap children
+ private List<NodeImpl> soapChildren = new ArrayList<NodeImpl>();
+
+ /** Construct the Node for a given org.w3c.dom.Node
+ *
+ * This constructor is used:
+ *
+ * 1) SOAPElement construction
+ * 2) Text construction
+ */
+ NodeImpl(org.w3c.dom.Node node)
+ {
+ // Method selection in Java is done at compile time
+ // Late binding does not work in this case
+ if (node instanceof NodeImpl)
+ throw new IllegalArgumentException("Copy constructor should be
used");
+
+ domNode = node;
+
+ // SOAP child elements should be constructed externally
+ if (DOMUtils.hasChildElements(node))
+ throw new IllegalArgumentException("Node cannot have child
elements");
+ }
+
+ /** The copy constructor used when converting types (i.e. SOAPElement ->
SOAPHeaderElement)
+ */
+ NodeImpl(NodeImpl node)
+ {
+ soapParent = node.soapParent;
+ domNode = node.domNode;
+ Iterator i = node.soapChildren.iterator();
+ while (i.hasNext())
+ {
+ NodeImpl childNode = (NodeImpl)i.next();
+ childNode.soapParent = (SOAPElementImpl)this;
+ soapChildren.add(childNode);
+ }
+ }
+
+ /** Get the QName of this Node */
+ protected QName getQName()
+ {
+ String nsURI = getNamespaceURI();
+ String localPart = getLocalName();
+ String prefix = getPrefix();
+
+ QName qname;
+ if (nsURI != null && prefix != null)
+ {
+ qname = new QName(nsURI, localPart, prefix);
+ }
+ else if (nsURI != null)
+ {
+ qname = new QName(nsURI, localPart);
+ }
+ else
+ {
+ qname = new QName(localPart);
+ }
+
+ return qname;
+ }
+
+ // javax.xml.soap.Node
*********************************************************************************************
+
+ /**
+ * Removes this Node object from the tree.
+ */
+ public void detachNode()
+ {
+ org.w3c.dom.Node domParent = domNode.getParentNode();
+ if (domParent != null)
+ domParent.removeChild(domNode);
+
+ if (soapParent != null)
+ ((NodeImpl)soapParent).soapChildren.remove(this);
+
+ soapParent = null;
+ }
+
+ /**
+ * Returns the parent node of this Node object.
+ * This method can throw an UnsupportedOperationException if the tree is not kept in
memory.
+ *
+ * @return the SOAPElement object that is the parent of this Node object or null if
this Node object is root
+ */
+ public SOAPElement getParentElement()
+ {
+ return soapParent;
+ }
+
+ /**
+ * Sets the parent of this Node object to the given SOAPElement object.
+ *
+ * @param parent the SOAPElement object to be set as the parent of this Node object
+ * @throws javax.xml.soap.SOAPException if there is a problem in setting the parent to
the given node
+ */
+ public void setParentElement(SOAPElement parent) throws SOAPException
+ {
+ // detach from the old parent
+ if (soapParent != null)
+ detachNode();
+
+ soapParent = (SOAPElementImpl)parent;
+ }
+
+ /**
+ * Returns the value of this node if this is a Text node or the value of the immediate
child of this node otherwise.
+ * <p/>
+ * If there is an immediate child of this Node that it is a Text node then it's
value will be returned.
+ * If there is more than one Text node then the value of the first Text Node will be
returned.
+ * Otherwise null is returned.
+ *
+ * @return a String with the text of this node if this is a Text node or the text
contained by the first immediate
+ * child of this Node object that is a Text object if such a child exists;
null otherwise.
+ */
+ public String getValue()
+ {
+ // The Text node should overwrite getValue
+ if (this instanceof javax.xml.soap.Text)
+ throw new WSException("javax.xml.soap.Text should take care of
this");
+
+ String nodeValue = null;
+ org.w3c.dom.Node child = (org.w3c.dom.Node)getFirstChild();
+ if (child instanceof org.w3c.dom.Text)
+ nodeValue = ((org.w3c.dom.Text)child).getNodeValue();
+
+ return nodeValue;
+ }
+
+ /**
+ * If this is a Text node then this method will set its value, otherwise it sets the
value of the immediate (Text) child of this node.
+ * <p/>
+ * The value of the immediate child of this node can be set only if, there is one
child node and
+ * that node is a Text node, or if there are no children in which case a child Text
node will be created.
+ *
+ * @param value A value string
+ * @throws IllegalStateException if the node is not a Text node and either has more
than one child node or has a child node that is not a Text node.
+ */
+ public void setValue(String value)
+ {
+ // The Text node should overwrite setValue
+ if (this instanceof javax.xml.soap.Text)
+ throw new WSException("javax.xml.soap.Text should take care of
this");
+
+ org.w3c.dom.Node child = (org.w3c.dom.Node)getFirstChild();
+ if (child instanceof org.w3c.dom.Text)
+ ((org.w3c.dom.Text)child).setNodeValue(value);
+
+ if (child == null)
+ {
+ child = domNode.getOwnerDocument().createTextNode(value);
+ appendChild(new TextImpl(child));
+ }
+ }
+
+ /**
+ * Notifies the implementation that this Node object is no longer being used by the
application and that the
+ * implementation is free to reuse this object for nodes that may be created later.
+ * Calling the method recycleNode implies that the method detachNode has been called
previously.
+ */
+ public void recycleNode()
+ {
+
+ }
+
+ private List<NodeImpl> convertDocumentFragment(DocumentFragment docFragment)
throws DOMException
+ {
+ List<NodeImpl> list = new ArrayList<NodeImpl>();
+ try
+ {
+ SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
+ for (Node node = docFragment.getFirstChild(); node != null; node =
node.getNextSibling())
+ {
+ switch (node.getNodeType())
+ {
+ case Node.ELEMENT_NODE:
+ {
+ SOAPElementImpl soapChild = soapFactory.createElement((Element)node,
true);
+ list.add(soapChild);
+ break;
+ }
+ case Node.TEXT_NODE:
+ {
+ TextImpl text = new TextImpl(node);
+ list.add(text);
+ break;
+ }
+ case Node.CDATA_SECTION_NODE:
+ {
+ TextImpl text = new TextImpl(node);
+ list.add(text);
+ break;
+ }
+ }
+ }
+ }
+ catch (SOAPException ex)
+ {
+ throw new DOMException(DOMException.INVALID_STATE_ERR, "Could not convert a
document fragment to a node");
+ }
+ return list;
+ }
+
+ // BEGIN org.w3c.dom.Node
*******************************************************************************************
+
+ public String getNodeName()
+ {
+ return domNode.getNodeName();
+ }
+
+ public String getNodeValue() throws DOMException
+ {
+ return domNode.getNodeValue();
+ }
+
+ public void setNodeValue(String nodeValue) throws DOMException
+ {
+ domNode.setNodeValue(nodeValue);
+ }
+
+ public short getNodeType()
+ {
+ return domNode.getNodeType();
+ }
+
+ public org.w3c.dom.Node getParentNode()
+ {
+ assertSOAPParent();
+ return soapParent;
+ }
+
+ public NodeList getChildNodes()
+ {
+ return new NodeListImpl(soapChildren);
+ }
+
+ public org.w3c.dom.Node getFirstChild()
+ {
+ NodeImpl child = null;
+ org.w3c.dom.Node domChild = domNode.getFirstChild();
+ if (domChild != null)
+ {
+ child = (NodeImpl)soapChildren.get(0);
+ if (domChild != child.domNode)
+ throw new WSException("Inconsistent node, child lists not
synchronized");
+ }
+ return child;
+ }
+
+ public org.w3c.dom.Node getLastChild()
+ {
+ NodeImpl child = null;
+ org.w3c.dom.Node domChild = domNode.getLastChild();
+ if (domChild != null)
+ {
+ child = (NodeImpl)soapChildren.get(soapChildren.size() - 1);
+ if (domChild != child.domNode)
+ throw new WSException("Inconsistent node, child lists not
synchronized");
+ }
+ return child;
+ }
+
+ public org.w3c.dom.Node getPreviousSibling()
+ {
+ assertSOAPParent();
+
+ NodeImpl sibling = null;
+ if (soapParent != null)
+ {
+ List children = ((NodeImpl)soapParent).soapChildren;
+ for (int i = 0; i < children.size(); i++)
+ {
+ NodeImpl node = (NodeImpl)children.get(i);
+ if (node == this && i > 0)
+ {
+ sibling = (NodeImpl)children.get(i - 1);
+ break;
+ }
+ }
+
+ if (sibling != null && sibling.domNode != domNode.getPreviousSibling())
+ throw new WSException("Inconsistent node, child lists not
synchronized");
+ }
+
+ return sibling;
+ }
+
+ public org.w3c.dom.Node getNextSibling()
+ {
+ assertSOAPParent();
+
+ NodeImpl sibling = null;
+ if (soapParent != null)
+ {
+ List children = ((NodeImpl)soapParent).soapChildren;
+ for (int i = 0; i < children.size(); i++)
+ {
+ NodeImpl node = (NodeImpl)children.get(i);
+ if (node == this && (i + 1) < children.size())
+ {
+ sibling = (NodeImpl)children.get(i + 1);
+ break;
+ }
+ }
+
+ if (sibling != null && sibling.domNode != domNode.getNextSibling())
+ throw new WSException("Inconsistent node, child lists not
synchronized");
+ }
+
+ return sibling;
+ }
+
+ public NamedNodeMap getAttributes()
+ {
+ return domNode.getAttributes();
+ }
+
+ public Document getOwnerDocument()
+ {
+ // Climb the tree in hopes of finding the soap envelope.
+ // If it's not there (a detached subtree), then we return a non-associated
document
+ if (soapParent == null)
+ return new SOAPDocument();
+
+ return soapParent.getOwnerDocument();
+ }
+
+ public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node
refChild) throws DOMException
+ {
+ // DOM says that if refChild is null, an append is performed
+ if (refChild == null)
+ return appendChild(newChild);
+
+ newChild = convertDOMNode(newChild);
+ refChild = convertDOMNode(refChild);
+
+ if (newChild instanceof DocumentFragment)
+ {
+ List<NodeImpl> list =
convertDocumentFragment((DocumentFragment)newChild);
+ for (NodeImpl node : list)
+ {
+ insertBefore(node, refChild);
+ }
+ return newChild;
+ }
+
+ int index = soapChildren.indexOf(refChild);
+ if (index < 0)
+ throw new IllegalArgumentException("Cannot find refChild in list of
javax.xml.soap.Node children");
+
+ NodeImpl soapNewNode = (NodeImpl)newChild;
+ soapNewNode.detachNode();
+
+ NodeImpl soapRefNode = (NodeImpl)refChild;
+ domNode.insertBefore(soapNewNode.domNode, soapRefNode.domNode);
+ soapChildren.add(index, soapNewNode);
+
+ soapNewNode.soapParent = (SOAPElementImpl)this;
+
+ return newChild;
+ }
+
+ public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node
oldChild) throws DOMException
+ {
+ newChild = convertDOMNode(newChild);
+ oldChild = convertDOMNode(oldChild);
+
+ if (newChild instanceof DocumentFragment)
+ {
+ insertBefore(newChild, oldChild);
+ ((NodeImpl)oldChild).detachNode();
+ return newChild;
+ }
+
+ int index = soapChildren.indexOf(oldChild);
+ if (index < 0)
+ throw new DOMException(DOMException.NOT_FOUND_ERR, "Cannot find oldChild in
list of javax.xml.soap.Node children");
+
+ NodeImpl soapNewNode = (NodeImpl)newChild;
+ NodeImpl soapOldNode = (NodeImpl)oldChild;
+
+ soapNewNode.detachNode();
+
+ if (soapNewNode.domNode != soapOldNode.domNode)
+ domNode.replaceChild(soapNewNode.domNode, soapOldNode.domNode);
+
+ soapChildren.remove(index);
+ soapChildren.add(index, soapNewNode);
+
+ soapNewNode.soapParent = soapOldNode.soapParent;
+ soapOldNode.soapParent = null;
+
+ return newChild;
+ }
+
+ public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws DOMException
+ {
+ oldChild = convertDOMNode(oldChild);
+
+ int index = soapChildren.indexOf(oldChild);
+ if (index < 0)
+ throw new DOMException(DOMException.NOT_FOUND_ERR, "Cannot find oldChild in
list of javax.xml.soap.Node children");
+
+ NodeImpl soapOldNode = (NodeImpl)oldChild;
+ domNode.removeChild(soapOldNode.domNode);
+ soapChildren.remove(index);
+
+ soapOldNode.soapParent = null;
+
+ return oldChild;
+ }
+
+ public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws DOMException
+ {
+ newChild = convertDOMNode(newChild);
+
+ if (newChild instanceof DocumentFragment)
+ {
+ List<NodeImpl> list =
convertDocumentFragment((DocumentFragment)newChild);
+ for (NodeImpl node : list)
+ {
+ appendChild(node);
+ }
+ return newChild;
+ }
+
+ if ((this instanceof SOAPElementImpl) == false)
+ throw new DOMException(DOMException.INVALID_ACCESS_ERR, "Cannot append
child to this node: " + this);
+
+ NodeImpl soapNode = (NodeImpl)newChild;
+ soapNode.detachNode();
+
+ domNode.appendChild(soapNode.domNode);
+ soapNode.soapParent = (SOAPElementImpl)this;
+
+ soapChildren.add(soapNode);
+
+ return newChild;
+ }
+
+ public boolean hasChildNodes()
+ {
+ return domNode.hasChildNodes();
+ }
+
+ public org.w3c.dom.Node cloneNode(boolean deep)
+ {
+ return domNode.cloneNode(deep);
+ }
+
+ public void normalize()
+ {
+ domNode.normalize();
+ }
+
+ public boolean isSupported(String feature, String version)
+ {
+ return domNode.isSupported(feature, version);
+ }
+
+ public String getNamespaceURI()
+ {
+ return domNode.getNamespaceURI();
+ }
+
+ public String getPrefix()
+ {
+ return domNode.getPrefix();
+ }
+
+ public void setPrefix(String prefix) throws DOMException
+ {
+ domNode.setPrefix(prefix);
+ }
+
+ public String getLocalName()
+ {
+ return domNode.getLocalName();
+ }
+
+ public boolean hasAttributes()
+ {
+ return domNode.hasAttributes();
+ }
+
+ public int hashCode()
+ {
+ return domNode.hashCode();
+ }
+
+ public String toString()
+ {
+ return super.toString() + "[" + domNode.toString() + "]";
+ }
+
+ private Node convertDOMNode(org.w3c.dom.Node node)
+ {
+ Node retNode;
+ if (node instanceof NodeImpl)
+ {
+ retNode = node;
+ }
+ else if (node instanceof DocumentFragment)
+ {
+ retNode = new DocumentFragmentImpl((DocumentFragment)node);
+ }
+ else if (node instanceof org.w3c.dom.Text)
+ {
+ retNode = new TextImpl(node);
+ }
+ else
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Operation only
supported for javax.xml.soap.Node, this is a " + node);
+ }
+ return retNode;
+ }
+
+ private void assertSOAPParent()
+ {
+ org.w3c.dom.Node domParent = domNode.getParentNode();
+ if (domParent != null && soapParent == null)
+ throw new WSException("Inconsistent node, has a DOM parent but no SOAP
parent [" + this + "] " + DOMWriter.printNode(this, false));
+ if (domParent == null && soapParent != null)
+ throw new WSException("Inconsistent node, has a SOAP parent but no DOM
parent [" + this + "] " + DOMWriter.printNode(this, false));
+ if (soapParent != null && domParent != soapParent.domNode)
+ throw new WSException("Inconsistent node, SOAP parent is not identical with
DOM parent [" + this + "] " + DOMWriter.printNode(this, false));
+ }
+
+ // END org.w3c.dom.Node
*******************************************************************************************
+
+ // BEGIN org.w3c.dom.Node DOM Level 3
*****************************************************************************
+
+ public short compareDocumentPosition(Node other) throws DOMException
+ {
+ // FIXME compareDocumentPosition
+ throw new NotImplementedException("compareDocumentPosition");
+ }
+
+ public String getBaseURI()
+ {
+ // FIXME getBaseURI
+ throw new NotImplementedException("getBaseURI");
+ }
+
+ public Object getFeature(String feature, String version)
+ {
+ // FIXME getFeature
+ throw new NotImplementedException("getFeature");
+ }
+
+ public String getTextContent() throws DOMException
+ {
+ // FIXME getTextContent
+ throw new NotImplementedException("getTextContent");
+ }
+
+ public Object getUserData(String key)
+ {
+ // FIXME getUserData
+ throw new NotImplementedException("getUserData");
+ }
+
+ public boolean isDefaultNamespace(String namespaceURI)
+ {
+ // FIXME isDefaultNamespace
+ throw new NotImplementedException("isDefaultNamespace");
+ }
+
+ public boolean isEqualNode(Node arg)
+ {
+ // FIXME isEqualNode
+ throw new NotImplementedException("isEqualNode");
+ }
+
+ public boolean isSameNode(Node other)
+ {
+ // FIXME isSameNode
+ throw new NotImplementedException("isSameNode");
+ }
+
+ public String lookupNamespaceURI(String prefix)
+ {
+ // FIXME lookupNamespaceURI
+ throw new NotImplementedException("lookupNamespaceURI");
+ }
+
+ public String lookupPrefix(String namespaceURI)
+ {
+ // FIXME lookupPrefix
+ throw new NotImplementedException("lookupPrefix");
+ }
+
+ public void setTextContent(String textContent) throws DOMException
+ {
+ // FIXME setTextContent
+ throw new NotImplementedException("setTextContent");
+ }
+
+ public Object setUserData(String key, Object data, UserDataHandler handler)
+ {
+ // FIXME setUserData
+ throw new NotImplementedException("setUserData");
+ }
+
+ // END org.w3c.dom.Node DOM Level 3
*****************************************************************************
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/NodeListImpl.java (from
rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/NodeListImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/NodeListImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/NodeListImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * The NodeList interface provides the abstraction of an ordered collection of nodes,
without defining or constraining
+ * how this collection is implemented. NodeList objects in the DOM are live.
+ *
+ * The items in the NodeList are accessible via an integral index, starting from 0.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+class NodeListImpl implements NodeList
+{
+ private List<NodeImpl> nodeList = new ArrayList<NodeImpl>();
+
+ NodeListImpl(List<NodeImpl> nodes)
+ {
+ nodeList = new ArrayList<NodeImpl>(nodes);
+ }
+
+ NodeListImpl(Iterator<NodeImpl> nodes)
+ {
+ nodeList = new ArrayList<NodeImpl>();
+ while (nodes.hasNext())
+ nodeList.add(nodes.next());
+ }
+
+ public Node item(int index)
+ {
+ if (nodeList.size() > index)
+ return nodeList.get(index);
+ else
+ return null;
+ }
+
+ public int getLength()
+ {
+ return nodeList.size();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/PayloadBuilder.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/PayloadBuilder.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/PayloadBuilder.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/PayloadBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.soap.SOAPException;
+
+/**
+ * @author Heiko Braun, <heiko.braun(a)jboss.com>
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 19-Apr-2006
+ */
+public interface PayloadBuilder
+{
+ void build(SOAPMessageImpl soapMessage, InputStream in, boolean ignoreParseError)
throws IOException, SOAPException;
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderDOM.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderDOM.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,251 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+//$Id$
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+/**
+ * A SOAPEnvelope builder for JAXRPC based on DOM
+ *
+ * @author Heiko Braun, <heiko.braun(a)jboss.com>
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 19-Apr-2006
+ */
+public class SAAJPayloadBuilderDOM implements PayloadBuilder
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SAAJPayloadBuilderDOM.class);
+
+ private Style style = Style.DOCUMENT;
+
+ public SAAJPayloadBuilderDOM(Style style)
+ {
+ this.style = style;
+ }
+
+ public void build(SOAPMessageImpl soapMessage, InputStream ins, boolean
ignoreParseError) throws IOException, SOAPException
+ {
+ // Parse the XML input stream
+ Element domEnv = null;
+ try
+ {
+ domEnv = DOMUtils.parse(ins);
+ }
+ catch (IOException ex)
+ {
+ if (ignoreParseError)
+ {
+ return;
+ }
+ throw ex;
+ }
+
+ String envNS = domEnv.getNamespaceURI();
+ String envPrefix = domEnv.getPrefix();
+
+ // Construct the envelope
+ SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
+ SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
+ SOAPEnvelopeImpl soapEnv = new SOAPEnvelopeImpl(soapPart,
soapFactory.createElement(domEnv, false));
+
+ DOMUtils.copyAttributes(soapEnv, domEnv);
+
+ // Add the header elements
+ Element domHeader = DOMUtils.getFirstChildElement(domEnv, new QName(envNS,
"Header"));
+ if (domHeader != null)
+ {
+ SOAPHeader soapHeader = soapEnv.getHeader();
+
+ DOMUtils.copyAttributes(soapHeader, domHeader);
+
+ Iterator it = DOMUtils.getChildElements(domHeader);
+ while (it.hasNext())
+ {
+ Element srcElement = (Element)it.next();
+ //registerNamespacesLocally(srcElement);
+ String xmlFragment = DOMWriter.printNode(srcElement, false);
+
+ Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(),
srcElement.getNamespaceURI());
+ SOAPContentElement destElement = new SOAPHeaderElementImpl(name);
+ soapHeader.addChildElement(destElement);
+
+ DOMUtils.copyAttributes(destElement, srcElement);
+ destElement.setXMLFragment(xmlFragment);
+ }
+ }
+
+ // Add the body elements
+ Element domBody = DOMUtils.getFirstChildElement(domEnv, new QName(envNS,
"Body"));
+ SOAPBody soapBody = soapEnv.getBody();
+
+ DOMUtils.copyAttributes(soapBody, domBody);
+
+ Iterator itBody = DOMUtils.getChildElements(domBody);
+ if (itBody.hasNext())
+ {
+ Element domBodyElement = (Element)itBody.next();
+
+ String localName = domBodyElement.getLocalName();
+ String prefix = domBodyElement.getPrefix();
+ String nsURI = domBodyElement.getNamespaceURI();
+ Name beName = new NameImpl(localName, prefix, nsURI);
+
+ // Process a <env:Fault> message
+ if (beName.equals(new NameImpl("Fault", envPrefix, envNS)))
+ {
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(envNS);
+ soapBody.addChildElement(soapFault);
+
+ DOMUtils.copyAttributes(soapFault, domBodyElement);
+
+ Element domFaultCode = DOMUtils.getFirstChildElement(domBodyElement, new
QName("faultcode"));
+ if (domFaultCode == null)
+ throw new SOAPException("SOAPFault does not contain a
<faultcode> element");
+
+ Element domFaultString = DOMUtils.getFirstChildElement(domBodyElement, new
QName("faultstring"));
+ if (domFaultString == null)
+ throw new SOAPException("SOAPFault does not contain a
<faultstring> element");
+
+ String faultCode = DOMUtils.getTextContent(domFaultCode);
+ soapFault.setFaultCode(faultCode);
+
+ String faultString = DOMUtils.getTextContent(domFaultString);
+ soapFault.setFaultString(faultString);
+
+ Element domFaultActor = DOMUtils.getFirstChildElement(domBodyElement, new
QName("faultactor"));
+ if (domFaultActor != null)
+ {
+ String faultActor = DOMUtils.getTextContent(domFaultActor);
+ soapFault.setFaultActor(faultActor);
+ }
+
+ // Add the fault detail
+ Element domFaultDetail = DOMUtils.getFirstChildElement(domBodyElement,
"detail");
+ if (domFaultDetail != null)
+ {
+ Detail detail = soapFault.addDetail();
+ Iterator it = DOMUtils.getChildElements(domFaultDetail);
+ while (it.hasNext())
+ {
+ Element domElement = (Element)it.next();
+ SOAPElement detailEntry = new
DetailEntryImpl(soapFactory.createElement(domElement, true));
+ detailEntry = detail.addChildElement(detailEntry);
+ }
+ }
+ }
+
+ // Process and RPC or DOCUMENT style message
+ else
+ {
+
+ if (style == Style.RPC)
+ {
+ SOAPBodyElementRpc soapBodyElement = new SOAPBodyElementRpc(beName);
+ soapBodyElement =
(SOAPBodyElementRpc)soapBody.addChildElement(soapBodyElement);
+
+ DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
+
+ Iterator itBodyElement = DOMUtils.getChildElements(domBodyElement);
+ while (itBodyElement.hasNext())
+ {
+ Element srcElement = (Element)itBodyElement.next();
+
+ Name name = new NameImpl(srcElement.getLocalName(),
srcElement.getPrefix(), srcElement.getNamespaceURI());
+ SOAPContentElement destElement = new SOAPContentElement(name);
+ destElement =
(SOAPContentElement)soapBodyElement.addChildElement(destElement);
+
+ DOMUtils.copyAttributes(destElement, srcElement);
+
+ String xmlFragment = DOMWriter.printNode(srcElement, false);
+ destElement.setXMLFragment(xmlFragment);
+ }
+ }
+ else if (style == Style.DOCUMENT)
+ {
+ Element srcElement = (Element)domBodyElement;
+ SOAPContentElement destElement = new SOAPBodyElementDoc(beName);
+ destElement = (SOAPContentElement)soapBody.addChildElement(destElement);
+
+ DOMUtils.copyAttributes(destElement, srcElement);
+
+ String xmlFragment = DOMWriter.printNode(srcElement, false);
+ destElement.setXMLFragment(xmlFragment);
+ }
+ else if (style == null)
+ {
+ SOAPBodyElementMessage soapBodyElement = new
SOAPBodyElementMessage(beName);
+ soapBodyElement =
(SOAPBodyElementMessage)soapBody.addChildElement(soapBodyElement);
+
+ DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
+
+ NodeList nlist = domBodyElement.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ org.w3c.dom.Node child = nlist.item(i);
+ short childType = child.getNodeType();
+ if (childType == org.w3c.dom.Node.ELEMENT_NODE)
+ {
+ SOAPElement soapElement = soapFactory.createElement((Element)child,
true);
+ soapBodyElement.addChildElement(soapElement);
+ }
+ else if (childType == org.w3c.dom.Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBodyElement.addTextNode(nodeValue);
+ }
+ else if (childType == org.w3c.dom.Node.CDATA_SECTION_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBodyElement.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
+ }
+ }
+ else
+ {
+ throw new WSException("Unsupported message style: " + style);
+ }
+ }
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderStax.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJPayloadBuilderStax.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,467 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.w3c.dom.Element;
+
+import com.ctc.wstx.stax.WstxInputFactory;
+
+/**
+ * A SOAPEnvelope builder for JAXRPC based on Stax
+ *
+ * @author Heiko Braun, <heiko.braun(a)jboss.com>
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 15-Apr-2006
+ */
+public class SAAJPayloadBuilderStax implements PayloadBuilder
+{
+ private static final String END_ELEMENT_BRACKET = "</";
+ private static final String EMPTY_STRING = "";
+ private static final String CLOSING_BRACKET = ">";
+ private static final String START_ELEMENT_BRACKET = "<";
+ private static final String HEADER_ELEMENT_NAME = "Header";
+ private static final String BODY_ELEMENT_NAME = "Body";
+ private static final String FAULT_ELEMENT_NAME = "Fault";
+
+ private static enum Part
+ {
+ ENVELOPE, HEADER, BODY, FAULT, RPC_PAYLOAD, DOC_PAYLOAD, BARE_PAYLOAD
+ }
+
+ private Part currentPart = Part.ENVELOPE;
+ private Part previousPart = null;
+
+ // saaj
+ private SOAPPartImpl soapPart;
+ private SOAPEnvelopeImpl soapEnv;
+
+ private StringBuffer fragmentBuffer;
+ private QName fragmentRootCursor = null;
+ private QName currentRootElement = null;
+ private XMLStreamReader reader;
+
+ private static XMLInputFactory factory;
+
+ public SAAJPayloadBuilderStax()
+ {
+ resetFragmentBuffer();
+ }
+
+ private void resetFragmentBuffer()
+ {
+ this.fragmentBuffer = new StringBuffer();
+ this.fragmentBuffer.ensureCapacity(2048);
+ }
+
+ public void build(SOAPMessageImpl soapMessage, InputStream in, boolean
ignoreParseError) throws IOException, SOAPException
+ {
+ try
+ {
+ reader = getFactoryInstance().createXMLStreamReader(in);
+ }
+ catch (XMLStreamException e)
+ {
+ throw new IOException("Failed to create stream reader:" +
e.getMessage());
+ }
+
+ try
+ {
+ soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
+
+ while (reader.hasNext())
+ {
+
+ if (reader.isStartElement())
+ {
+ processStartElement();
+ }
+ else if (reader.isCharacters())
+ {
+ processCharacters();
+ }
+ else if (reader.isEndElement())
+ {
+ processEndElement();
+ }
+
+ reader.next();
+ }
+
+ }
+ catch (XMLStreamException e)
+ {
+ if (!ignoreParseError)
+ throw new IOException("Failed to parse stream: " +
e.getMessage());
+ }
+ catch (SOAPException e)
+ {
+ e.printStackTrace();
+ throw e;
+ }
+ finally
+ {
+ try
+ {
+ if (reader != null)
+ reader.close();
+ }
+ catch (XMLStreamException e)
+ {
+ // ignore
+ }
+ }
+ }
+
+ private static synchronized XMLInputFactory getFactoryInstance()
+ {
+ if (null == factory)
+ {
+ System.setProperty("javax.xml.stream.XMLInputFactory",
"com.ctc.wstx.stax.WstxInputFactory");
+ //System.setProperty("javax.xml.stream.XMLInputFactory",
"com.sun.xml.stream.ZephyrParserFactory");
+ factory = XMLInputFactory.newInstance();
+ factory.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
+ ((WstxInputFactory)factory).configureForSpeed();
+ }
+ return factory;
+
+ }
+
+ private void processCharacters() throws SOAPException
+ {
+ if (fragmentRootCursor != null)
+ consumeCharacters();
+ }
+
+ private void consumeCharacters() throws SOAPException
+ {
+
+ String text = normalize(reader.getText());
+
+ if (!atPartMargin() && !reader.isWhiteSpace())
+ {
+
+ fragmentBuffer.append(text);
+
+ if (Part.FAULT == currentPart)
+ {
+ String localName = currentRootElement.getLocalPart();
+ SOAPFault fault = soapEnv.getBody().getFault();
+ if ("faultcode".equalsIgnoreCase(localName))
+ fault.setFaultCode(text);
+ else if ("faultactor".equalsIgnoreCase(localName))
+ fault.setFaultActor(text);
+ else if ("faultstring".equalsIgnoreCase(localName))
+ fault.setFaultString(text);
+ }
+ }
+ }
+
+ private void processEndElement() throws SOAPException
+ {
+ if (fragmentRootCursor != null)
+ consumeEndElement();
+ }
+
+ private void consumeEndElement() throws SOAPException
+ {
+
+ QName qName = reader.getName();
+
+ fragmentBuffer.append(END_ELEMENT_BRACKET);
+ fragmentBuffer.append(getFQElementName(qName));
+ fragmentBuffer.append(CLOSING_BRACKET);
+
+ if (fragmentRootCursor != null && fragmentRootCursor.equals(qName))
+ {
+ flushBuffer();
+ fragmentRootCursor = null;
+ }
+ }
+
+ private void flushBuffer() throws SOAPException
+ {
+ if (Part.HEADER == currentPart)
+ {
+ SOAPHeader soapHeader = soapEnv.getHeader();
+ SOAPContentElement lastHeaderElement =
(SOAPContentElement)soapHeader.getChildNodes().item(soapHeader.getChildNodes().getLength()
- 1);
+
+ lastHeaderElement.setXMLFragment(fragmentBuffer.toString());
+ }
+ else if (Part.BODY == currentPart)
+ {
+ SOAPBody soapBody = soapEnv.getBody();
+ SOAPContentElement lastBodyElement =
(SOAPContentElement)soapBody.getChildNodes().item(soapBody.getChildNodes().getLength() -
1);
+ lastBodyElement.setXMLFragment(fragmentBuffer.toString());
+ }
+ else if (Part.FAULT == currentPart)
+ {
+ SOAPBody soapBody = soapEnv.getBody();
+ SOAPContentElement faultElement = (SOAPContentElement)soapBody.getFault();
+ faultElement.setXMLFragment(fragmentBuffer.toString());
+ }
+
+ resetFragmentBuffer();
+ }
+
+ private void processStartElement() throws SOAPException
+ {
+
+ QName qName = reader.getName();
+ currentRootElement = qName;
+
+ // identify current envelope part
+ togglePartMargin(qName);
+
+ // toggle current element
+ Element destElement = null;
+ if (Part.ENVELOPE == currentPart)
+ {
+ // setup envelope impl
+ soapEnv = new SOAPEnvelopeImpl(soapPart, qName.getNamespaceURI());
+ destElement = soapEnv; // soapEnv becomes current
+ }
+ else if (Part.HEADER == currentPart)
+ {
+ if (atPartMargin())
+ {
+ // the env:Header element itself
+ SOAPHeader soapHeader = soapEnv.getHeader();
+ destElement = soapHeader; // header becomes current
+ previousPart = Part.HEADER;
+ }
+ else
+ {
+ // child element of env:Header
+ if (fragmentRootCursor == null)
+ {
+ Name name = new NameImpl(qName.getLocalPart(), qName.getPrefix(),
qName.getNamespaceURI());
+ SOAPContentElement headerElement = new SOAPHeaderElementImpl(name);
+ soapEnv.getHeader().addChildElement(headerElement);
+
+ destElement = headerElement; // headerElement becomes current
+ fragmentRootCursor = qName;
+ }
+
+ consumeStartElement();
+ }
+ }
+ else if (Part.BODY == currentPart)
+ {
+
+ SOAPBody soapBody = soapEnv.getBody();
+
+ if (atPartMargin())
+ {
+ // the env:Body element
+ destElement = soapBody;
+ previousPart = Part.BODY;
+ }
+ else
+ {
+ // payload not fault
+ Name bodyElementName = new NameImpl(qName.getLocalPart(), qName.getPrefix(),
qName.getNamespaceURI());
+
+ if (fragmentRootCursor == null)
+ {
+ SOAPBodyElementDoc docBodyElement = new
SOAPBodyElementDoc(bodyElementName);
+ docBodyElement =
(SOAPBodyElementDoc)soapBody.addChildElement(docBodyElement);
+
+ destElement = docBodyElement;
+ fragmentRootCursor = qName;
+ }
+
+ consumeStartElement();
+ }
+ }
+ else if (Part.FAULT == currentPart)
+ {
+ // payload is fault
+ if (atPartMargin())
+ {
+ SOAPBody soapBody = soapEnv.getBody();
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(soapEnv.getNamespaceURI());
+ soapBody.addChildElement(soapFault);
+ destElement = soapFault;
+ previousPart = Part.FAULT;
+ }
+
+ if (fragmentRootCursor == null)
+ {
+ fragmentRootCursor = qName;
+ }
+
+ consumeStartElement();
+ }
+
+ if (fragmentRootCursor == null) // constructing soap elements
+ {
+ copyAttributes(destElement);
+ }
+ }
+
+ private void togglePartMargin(QName qName)
+ {
+ // identify the current part
+ if (qName.getLocalPart().equalsIgnoreCase(HEADER_ELEMENT_NAME))
+ {
+ previousPart = currentPart;
+ currentPart = Part.HEADER;
+ }
+ else if (qName.getLocalPart().equalsIgnoreCase(BODY_ELEMENT_NAME))
+ {
+ previousPart = currentPart;
+ currentPart = Part.BODY;
+ }
+ else if (qName.getLocalPart().equalsIgnoreCase(FAULT_ELEMENT_NAME))
+ {
+ previousPart = currentPart;
+ currentPart = Part.FAULT;
+ }
+ }
+
+ private void consumeStartElement()
+ {
+
+ QName qName = reader.getName();
+
+ // element
+ fragmentBuffer.append(START_ELEMENT_BRACKET);
+ fragmentBuffer.append(getFQElementName(qName));
+
+ // local namespaces
+ for (int x = 0; x < reader.getNamespaceCount(); x++)
+ {
+ if (reader.getNamespacePrefix(x) != null)
+ {
+ fragmentBuffer.append(" xmlns:");
+
fragmentBuffer.append(reader.getNamespacePrefix(x)).append("='");
+ fragmentBuffer.append(reader.getNamespaceURI(x)).append("'");
+ }
+ else if (reader.getNamespaceURI(x) != null)
+ {
+ fragmentBuffer.append(" xmlns='");
+ fragmentBuffer.append(reader.getNamespaceURI(x)).append("'");
+ }
+ }
+
+ // attributes
+ if (reader.getAttributeCount() > 0)
+ {
+ for (int i = 0; i < reader.getAttributeCount(); i++)
+ {
+ QName attQName = reader.getAttributeName(i);
+ fragmentBuffer.append(" ").append(getFQElementName(attQName));
+
fragmentBuffer.append("='").append(reader.getAttributeValue(i)).append("'");
+ }
+ }
+
+ fragmentBuffer.append(CLOSING_BRACKET);
+ }
+
+ private String getFQElementName(QName qName)
+ {
+ return !qName.getPrefix().equals(EMPTY_STRING) ? qName.getPrefix() + ":"
+ qName.getLocalPart() : qName.getLocalPart();
+ }
+
+ private void copyAttributes(Element destElement)
+ {
+
+ if (reader.getAttributeCount() == 0)
+ return;
+
+ for (int i = 0; i < reader.getAttributeCount(); i++)
+ {
+ destElement.setAttributeNS(reader.getAttributeNamespace(i),
reader.getAttributeLocalName(i), reader.getAttributeValue(i));
+ }
+ }
+
+ private boolean atPartMargin()
+ {
+ return previousPart != currentPart;
+ }
+
+ private static String normalize(String valueStr)
+ {
+ // We assume most strings will not contain characters that need
"escaping",
+ // and optimize for this case.
+ boolean found = false;
+ int i = 0;
+
+ outer: for (; i < valueStr.length(); i++)
+ {
+ switch (valueStr.charAt(i))
+ {
+ case '<':
+ case '>':
+ case '&':
+ case '"':
+ found = true;
+ break outer;
+ }
+ }
+
+ if (!found)
+ return valueStr;
+
+ // Resume where we left off
+ StringBuilder builder = new StringBuilder();
+ builder.append(valueStr.substring(0, i));
+ for (; i < valueStr.length(); i++)
+ {
+ char c = valueStr.charAt(i);
+ switch (c)
+ {
+ case '<':
+ builder.append("<");
+ break;
+ case '>':
+ builder.append(">");
+ break;
+ case '&':
+ builder.append("&");
+ break;
+ case '"':
+ builder.append(""");
+ break;
+ default:
+ builder.append(c);
+ }
+ }
+
+ return builder.toString();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJVisitable.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJVisitable.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJVisitable.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,31 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, 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.soap;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Sep 26, 2006
+ */
+public interface SAAJVisitable {
+ public void accept(SAAJVisitor visitor);
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java (from
rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJVisitor.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SAAJVisitor.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+import javax.xml.soap.SOAPElement;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Sep 26, 2006
+ */
+public interface SAAJVisitor {
+ void visitSOAPElement(SOAPElementImpl soapElement);
+ void visitSOAPContentElement(SOAPContentElement scElement);
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPBodyElementDoc.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPBodyElementDoc.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBodyElement;
+
+/**
+ * An abstract implemenation of the SOAPBodyElement
+ * <p/>
+ * This class should not expose functionality that is not part of
+ * {@link javax.xml.soap.SOAPBodyElement}. Client code should use
<code>SOAPBodyElement</code>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPBodyElementDoc extends SOAPContentElement implements SOAPBodyElement
+{
+ public SOAPBodyElementDoc(Name name)
+ {
+ super(name);
+ }
+
+ public SOAPBodyElementDoc(SOAPElementImpl element)
+ {
+ super(element);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPBodyElementMessage.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPBodyElementMessage.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+import org.jboss.ws.core.utils.DOMWriter;
+
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.rpc.JAXRPCException;
+import java.io.Writer;
+
+/**
+ * An abstract implemenation of the SOAPBodyElement
+ * <p/>
+ * This class should not expose functionality that is not part of
+ * {@link javax.xml.soap.SOAPBodyElement}. Client code should use
<code>SOAPBodyElement</code>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPBodyElementMessage extends SOAPElementImpl implements SOAPBodyElement
+{
+ public SOAPBodyElementMessage(Name name)
+ {
+ super(name);
+ }
+
+ public SOAPBodyElementMessage(SOAPElementImpl element)
+ {
+ super(element);
+ }
+
+ public void writeElement(Writer writer) {
+ try
+ {
+ DOMWriter domWriter = new DOMWriter(writer);
+ domWriter.print(this);
+ }
+ catch (Exception e)
+ {
+ throw new JAXRPCException(e);
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPBodyElementRpc.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPBodyElementRpc.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.WSException;
+import org.w3c.dom.Element;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.rpc.JAXRPCException;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
+
+/**
+ * An abstract implemenation of the SOAPBodyElement
+ * <p/>
+ * This class should not expose functionality that is not part of
+ * {@link javax.xml.soap.SOAPBodyElement}. Client code should use
<code>SOAPBodyElement</code>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPBodyElementRpc extends SOAPElementImpl implements SOAPBodyElement
+{
+ public SOAPBodyElementRpc(Name name)
+ {
+ super(name);
+ }
+
+ public SOAPBodyElementRpc(SOAPElementImpl element)
+ {
+ super(element);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java (from
rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPBodyImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPBodyImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+// $Id$
+
+import java.util.Iterator;
+import java.util.Locale;
+
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * An object that represents the contents of the SOAP body element in a SOAP message.
+ * A SOAP body element consists of XML data that affects the way the application-specific
content is processed.
+ *
+ * A SOAPBody object contains SOAPBodyElement objects, which have the content for the
SOAP body.
+ * A SOAPFault object, which carries status and/or error information, is an example of a
SOAPBodyElement object.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPBodyImpl extends SOAPElementImpl implements SOAPBody
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPBodyImpl.class);
+
+ public SOAPBodyImpl(String prefix, String namespace)
+ {
+ super("Body", prefix, namespace);
+ }
+
+ /** Convert the child into a SOAPBodyElement */
+ public SOAPElement addChildElement(SOAPElement child) throws SOAPException
+ {
+ log.trace("addChildElement: " + child.getElementName());
+ if ((child instanceof SOAPBodyElement) == false)
+ child = convertToBodyElement(child);
+
+ child = super.addChildElement(child);
+ return child;
+ }
+
+ public SOAPBodyElement addBodyElement(Name name) throws SOAPException
+ {
+ log.trace("addBodyElement: " + name);
+ SOAPBodyElement child = new SOAPBodyElementDoc(name);
+ return (SOAPBodyElement)addChildElement(child);
+ }
+
+ public SOAPBodyElement addDocument(Document doc) throws SOAPException
+ {
+ log.trace("addDocument");
+ Element rootElement = doc.getDocumentElement();
+ SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
+ SOAPElementImpl soapElement = soapFactory.createElement(rootElement, true);
+ return (SOAPBodyElement)addChildElement(soapElement);
+ }
+
+ public SOAPFault addFault() throws SOAPException
+ {
+ log.trace("addFault");
+ if (hasFault())
+ throw new SOAPException("A SOAPBody may contain at most one SOAPFault child
element");
+
+ return addFault(new NameImpl(Constants.SOAP11_FAULT_CODE_SERVER), "Generic
server fault");
+ }
+
+ public SOAPFault addFault(Name faultCode, String faultString) throws SOAPException
+ {
+ log.trace("addFault");
+ if (hasFault())
+ throw new SOAPException("A SOAPBody may contain at most one SOAPFault child
element");
+
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(getNamespaceURI());
+ soapFault = (SOAPFaultImpl)addChildElement(soapFault);
+ soapFault.setFaultCode(faultCode);
+ soapFault.setFaultString(faultString);
+ return soapFault;
+ }
+
+ public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws
SOAPException
+ {
+ log.trace("addFault");
+ if (hasFault())
+ throw new SOAPException("A SOAPBody may contain at most one SOAPFault child
element");
+
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(getNamespaceURI());
+ soapFault.setFaultCode(faultCode);
+ soapFault.setFaultString(faultString, locale);
+ addChildElement(soapFault);
+ return soapFault;
+ }
+
+ public SOAPFault getFault()
+ {
+ log.trace("getFault");
+ Iterator it = getChildElements(new NameImpl("Fault",
Constants.PREFIX_ENV, getSOAPEnvelope().getNamespaceURI()));
+ return (it.hasNext() ? (SOAPFault)it.next() : null);
+ }
+
+ public boolean hasFault()
+ {
+ log.trace("hasFault");
+ return getChildElements(Constants.SOAP11_FAULT).hasNext();
+ }
+
+ public Node appendChild(Node newChild) throws DOMException
+ {
+ log.trace("appendChild: " + newChild.getNodeName());
+ Node retNode;
+ if (!(newChild instanceof SOAPBodyElement || newChild instanceof
DocumentFragment))
+ {
+ newChild = convertToBodyElement(newChild);
+ }
+ retNode = super.appendChild(newChild);
+ return retNode;
+ }
+
+ public Node insertBefore(Node newChild, Node refChild) throws DOMException
+ {
+ log.trace("insertBefore: " + newChild.getNodeName());
+ if (!(newChild instanceof SOAPBodyElement || newChild instanceof
DocumentFragment))
+ newChild = convertToBodyElement(newChild);
+
+ return super.insertBefore(newChild, refChild);
+ }
+
+ public Node replaceChild(Node newChild, Node oldChild) throws DOMException
+ {
+ log.trace("replaceChild: " + newChild.getNodeName());
+ if (!(newChild instanceof SOAPBodyElement || newChild instanceof
DocumentFragment))
+ {
+ newChild = convertToBodyElement(newChild);
+ }
+
+ return super.replaceChild(newChild, oldChild);
+ }
+
+ private SOAPBodyElementDoc convertToBodyElement(Node node)
+ {
+ if (!(node instanceof SOAPElementImpl))
+ throw new IllegalArgumentException("SOAPElement expected");
+
+ SOAPElementImpl element = (SOAPElementImpl)node;
+ element.detachNode();
+ return new SOAPBodyElementDoc(element);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPConnectionFactoryImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionFactoryImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionFactoryImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPConnectionFactoryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,80 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ *
+ * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (
http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Axis" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache(a)apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <
http://www.apache.org/>.
+ */
+package org.jboss.ws.core.soap;
+
+// $Id$
+
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPException;
+
+/**
+ * SOAP Connection Factory implementation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 02-Feb-2005
+ */
+public class SOAPConnectionFactoryImpl extends SOAPConnectionFactory
+{
+ /** Create a new SOAPConnection.
+ *
+ * @return the new SOAPConnection object.
+ * @throws javax.xml.soap.SOAPException if there was an exception creating
theSOAPConnection object.
+ */
+ public SOAPConnection createConnection() throws SOAPException
+ {
+ return new SOAPConnectionImpl();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,338 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.util.socket.RemotingSSLSocketFactory;
+import org.jboss.ws.binding.soap.SOAPMessageMarshaller;
+import org.jboss.ws.binding.soap.SOAPMessageUnMarshaller;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.extensions.xop.XOPContext;
+
+import javax.xml.rpc.Stub;
+import javax.xml.soap.*;
+import javax.xml.ws.addressing.EndpointReference;
+import java.net.MalformedURLException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * SOAPConnection implementation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
+ *
+ * @since 02-Feb-2005
+ */
+public class SOAPConnectionImpl extends SOAPConnection
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPConnectionImpl.class);
+ private static Logger msgLog = Logger.getLogger("jbossws.SOAPMessage");
+
+ private Map<String, Object> config = new HashMap<String, Object>();
+
+ private static Map<String, String> metadataMap = new HashMap<String,
String>();
+ static
+ {
+ metadataMap.put(Stub.USERNAME_PROPERTY, "http.basic.username");
+ metadataMap.put(Stub.PASSWORD_PROPERTY, "http.basic.password");
+ }
+ private static Map<String, String> configMap = new HashMap<String,
String>();
+ static
+ {
+ configMap.put(StubExt.PROPERTY_KEY_STORE,
RemotingSSLSocketFactory.REMOTING_KEY_STORE_FILE_PATH);
+ configMap.put(StubExt.PROPERTY_KEY_STORE_PASSWORD,
RemotingSSLSocketFactory.REMOTING_KEY_STORE_PASSWORD);
+ configMap.put(StubExt.PROPERTY_KEY_STORE_TYPE,
RemotingSSLSocketFactory.REMOTING_KEY_STORE_TYPE);
+ configMap.put(StubExt.PROPERTY_TRUST_STORE,
RemotingSSLSocketFactory.REMOTING_TRUST_STORE_FILE_PATH);
+ configMap.put(StubExt.PROPERTY_TRUST_STORE_PASSWORD,
RemotingSSLSocketFactory.REMOTING_TRUST_STORE_PASSWORD);
+ configMap.put(StubExt.PROPERTY_TRUST_STORE_TYPE,
RemotingSSLSocketFactory.REMOTING_TRUST_STORE_TYPE);
+ }
+
+ private boolean closed;
+
+ public SOAPConnectionImpl()
+ {
+ // HTTPClientInvoker conect sends gratuitous POST
+ //
http://jira.jboss.com/jira/browse/JBWS-711
+ config.put(Client.ENABLE_LEASE, false);
+ }
+
+ /**
+ * Sends the given message to the specified endpoint and blocks until it has
+ * returned the response.
+ */
+ public SOAPMessage call(SOAPMessage reqMessage, Object endpoint) throws SOAPException
+ {
+ return callInternal(reqMessage, endpoint, false);
+ }
+
+ /**
+ * Sends the given message to the specified endpoint. This method is logically
+ * non blocking.
+ */
+ public SOAPMessage callOneWay(SOAPMessage reqMessage, Object endpoint) throws
SOAPException
+ {
+ return callInternal(reqMessage, endpoint, true);
+ }
+
+ /** Sends the given message to the specified endpoint. */
+ private SOAPMessage callInternal(SOAPMessage reqMessage, Object endpoint, boolean
oneway) throws SOAPException
+ {
+ if (reqMessage == null)
+ throw new IllegalArgumentException("Given SOAPMessage cannot be
null");
+ if (endpoint == null)
+ throw new IllegalArgumentException("Given endpoint cannot be null");
+ if (closed)
+ throw new SOAPException("SOAPConnection is already closed");
+
+ String targetAddress;
+ Map callProps = null;
+
+ if (endpoint instanceof EndpointInfo)
+ {
+ EndpointInfo epInfo = (EndpointInfo)endpoint;
+ targetAddress = epInfo.getTargetAddress();
+ callProps = epInfo.getProperties();
+
+ if (callProps.containsKey(StubExt.PROPERTY_CLIENT_TIMEOUT))
+ {
+ Object timeout = callProps.get(StubExt.PROPERTY_CLIENT_TIMEOUT);
+ int qmIndex = targetAddress.indexOf("?");
+ targetAddress += (qmIndex < 0 ? "?" : "&") +
"timeout=" + timeout;
+ }
+ }
+ else if (endpoint instanceof EndpointReference)
+ {
+ EndpointReference epr = (EndpointReference)endpoint;
+ targetAddress = epr.getAddress().toString();
+ }
+ else
+ {
+ targetAddress = endpoint.toString();
+ }
+
+ // enforce xop transitions
+ // TODO: there should be a clear transition to an immutable object model
+ XOPContext.eagerlyCreateAttachments();
+
+ // save object model changes
+ if (reqMessage.saveRequired()) reqMessage.saveChanges();
+
+ // setup remoting client
+ Map metadata = createRemotingMetaData(reqMessage, callProps);
+ Client client = createRemotingClient(endpoint, targetAddress, oneway);
+
+ try
+ {
+ // debug the outgoing message
+ traceRequest(reqMessage, metadata);
+
+ SOAPMessage resMessage = null;
+ if (oneway == true)
+ {
+ client.invokeOneway(reqMessage, metadata, false);
+ }
+ else
+ {
+ resMessage = (SOAPMessage)client.invoke(reqMessage, metadata);
+ }
+
+ // debug the incomming response message
+ traceResponse(resMessage);
+
+ return resMessage;
+
+ }
+ catch (Throwable t)
+ {
+ throw new SOAPException("Could not transmit message", t);
+ }
+ }
+
+ private void traceResponse(SOAPMessage resMessage) throws SOAPException {
+ if (resMessage != null && msgLog.isTraceEnabled())
+ {
+ SOAPEnvelope soapResEnv = resMessage.getSOAPPart().getEnvelope();
+ String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapResEnv,
true);
+ msgLog.trace("Incoming Response SOAPMessage\n" + envStr);
+ }
+ }
+
+ private void traceRequest(SOAPMessage reqMessage, Map metadata) throws SOAPException
{
+ if(msgLog.isTraceEnabled())
+ {
+ SOAPEnvelope soapReqEnv = reqMessage.getSOAPPart().getEnvelope();
+ String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapReqEnv,
true);
+ msgLog.trace("Remoting meta data: " + metadata);
+ msgLog.trace("Outgoing SOAPMessage\n" + envStr);
+ }
+ }
+
+ private Client createRemotingClient(Object endpoint, String targetAddress, boolean
oneway) throws SOAPException {
+ Client remotingClient;
+ try
+ {
+ // Get the invoker from Remoting for a given endpoint address
+ log.debug("Get locator for: " + endpoint);
+ InvokerLocator locator = new InvokerLocator(targetAddress);
+
+ remotingClient = new Client(locator, "saaj", config);
+ remotingClient.setMarshaller(new SOAPMessageMarshaller());
+ remotingClient.setUnMarshaller(oneway == false ? new SOAPMessageUnMarshaller() :
null);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new SOAPException("Malformed endpoint address", e);
+ }
+ catch (Exception e)
+ {
+ throw new SOAPException("Could not setup remoting client", e);
+ }
+ return remotingClient;
+ }
+
+ /** Closes this SOAPConnection
+ */
+ public void close() throws SOAPException
+ {
+ if (closed)
+ throw new SOAPException("SOAPConnection is already closed");
+
+ closed = true;
+ }
+
+ private Map createRemotingMetaData(SOAPMessage reqMessage, Map callProps) throws
SOAPException
+ {
+ // 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.
+
+ MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
+ String[] action = mimeHeaders.getHeader("SOAPAction");
+ if (action != null && action.length > 0)
+ {
+ String soapAction = action[0];
+
+ // R1109 The value of the SOAPAction HTTP header field in a HTTP request MESSAGE
MUST be a quoted string.
+ if (soapAction.startsWith("\"") == false ||
soapAction.endsWith("\"") == false)
+ soapAction = "\"" + soapAction + "\"";
+
+ mimeHeaders.setHeader("SOAPAction", soapAction);
+ }
+ else
+ {
+ mimeHeaders.setHeader("SOAPAction", "\"\"");
+ }
+
+ Map<String, Object> metadata = new HashMap<String, Object>();
+ Properties props = new Properties();
+ metadata.put("HEADER", props);
+
+ Iterator i = mimeHeaders.getAllHeaders();
+ while (i.hasNext())
+ {
+ MimeHeader header = (MimeHeader)i.next();
+ String currentValue = props.getProperty(header.getName());
+
+ /*
+ * Coalesce multiple headers into one
+ *
+ * From HTTP/1.1 RFC 2616:
+ *
+ * Multiple message-header fields with the same field-name MAY be
+ * present in a message if and only if the entire field-value for that
+ * header field is defined as a comma-separated list [i.e., #(values)].
+ * It MUST be possible to combine the multiple header fields into one
+ * "field-name: field-value" pair, without changing the semantics of
+ * the message, by appending each subsequent field-value to the first,
+ * each separated by a comma.
+ */
+ if (currentValue != null)
+ {
+ props.put(header.getName(), currentValue + "," +
header.getValue());
+ }
+ else
+ {
+ props.put(header.getName(), header.getValue());
+ }
+ }
+
+ if (callProps != null)
+ {
+ Iterator it = callProps.entrySet().iterator();
+
+ // Get authentication type, default to BASIC authetication
+ String authType = (String)callProps.get(StubExt.PROPERTY_AUTH_TYPE);
+ if (authType == null)
+ authType = StubExt.PROPERTY_AUTH_TYPE_BASIC;
+
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ String key = (String)entry.getKey();
+ Object val = entry.getValue();
+
+ // pass properties to remoting meta data
+ if (metadataMap.containsKey(key))
+ {
+ String remotingKey = metadataMap.get(key);
+ if (key.equals(Stub.USERNAME_PROPERTY) ||
key.equals(Stub.PASSWORD_PROPERTY))
+ {
+ if (authType.equals(StubExt.PROPERTY_AUTH_TYPE_BASIC))
+ {
+ metadata.put(remotingKey, val);
+ }
+ else
+ {
+ log.warn("Ignore '" + key + "' with auth
typy: " + authType);
+ }
+ }
+ else
+ {
+ metadata.put(remotingKey, val);
+ }
+ }
+
+ // pass properties to remoting client config
+ if (configMap.containsKey(key))
+ {
+ String remotingKey = configMap.get(key);
+ config.put(remotingKey, val);
+ }
+ }
+ }
+
+ return metadata;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPContentElement.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPContentElement.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,1040 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.BindingException;
+import org.jboss.ws.binding.DeserializerSupport;
+import org.jboss.ws.binding.SerializationContext;
+import org.jboss.ws.binding.SerializerSupport;
+import org.jboss.ws.common.CommonMessageContext;
+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.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.core.utils.MimeUtils;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.metadata.ParameterMetaData;
+import org.jboss.ws.metadata.UnifiedMetaData;
+import org.w3c.dom.*;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import java.io.IOException;
+import java.io.Writer;
+import java.io.InputStream;
+import java.io.ByteArrayOutputStream;
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+import java.util.Iterator;
+
+/**
+ * A SOAPElement that gives access to its content as XML fragment or Java object.
+ *
+ * The SOAPContentElement has three content representations, which may exist in
parallel.
+ * The getter and setter of the content properties perform the conversions.
+ * It is the responsibility of this objects to keep the representations in sync.
+ *
+ * +---------+ +-------------+ +-------------+
+ * | Object | <-----> | XMLFragment | <-----> | DOMTree |
+ * +---------+ +-------------+ +-------------+
+ *
+ * The idea is, that jaxrpc handlers can work with both the object and the dom view of
this SOAPElement.
+ * Note, that state transitions may be expensive.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 13-Dec-2004
+ */
+public class SOAPContentElement extends SOAPElementImpl
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPContentElement.class);
+
+ // The well formed XML content of this element.
+ private String xmlFragment;
+ // The java object content of this element.
+ private Object objectValue;
+ // True if the current DOM tree is valid
+ private boolean isDOMValid;
+ // True if the current content object is valid
+ private boolean isObjectValid;
+ // True while expanding to DOM
+ private boolean expandingToDOM;
+
+ // The associated parameter
+ private ParameterMetaData paramMetaData;
+
+ /** Construct a SOAPContentElement
+ */
+ public SOAPContentElement(Name name)
+ {
+ super(name);
+ isDOMValid = true;
+ }
+
+ public SOAPContentElement(SOAPElementImpl element)
+ {
+ super(element);
+ isDOMValid = true;
+ }
+
+ public ParameterMetaData getParamMetaData()
+ {
+ if (paramMetaData == null)
+ throw new IllegalStateException("Parameter meta data not available");
+
+ return paramMetaData;
+ }
+
+ public void setParamMetaData(ParameterMetaData paramMetaData)
+ {
+ this.paramMetaData = paramMetaData;
+ }
+
+ public QName getXmlType()
+ {
+ return getParamMetaData().getXmlType();
+ }
+
+ public Class getJavaType()
+ {
+ return getParamMetaData().getJavaType();
+ }
+
+ public boolean isDOMValid()
+ {
+ return isDOMValid;
+ }
+
+ public boolean isObjectValid()
+ {
+ return isObjectValid;
+ }
+
+ public boolean isFragmentValid()
+ {
+ return xmlFragment != null;
+ }
+
+ public String getXMLFragment()
+ {
+ // Serialize the valueContent
+ if (xmlFragment == null && isObjectValid)
+ {
+ assertContentMapping();
+
+ QName xmlType = getXmlType();
+ Class javaType = getJavaType();
+ log.debug("getXMLFragment from Object [xmlType=" + xmlType +
",javaType=" + javaType + "]");
+
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ SerializationContext serContext = msgContext.getSerializationContext();
+ serContext.setProperty(ParameterMetaData.class.getName(), getParamMetaData());
+
+ TypeMappingImpl typeMapping = serContext.getTypeMapping();
+
+ QName xmlName = getQName();
+ try
+ {
+ SerializerSupport ser;
+ if (objectValue != null)
+ {
+ SerializerFactoryBase serializerFactory =
getSerializerFactory(typeMapping, javaType, xmlType);
+ ser = (SerializerSupport)serializerFactory.getSerializer();
+ }
+ else
+ {
+ ser = new NullValueSerializer();
+ }
+
+ xmlFragment = ser.serialize(xmlName, xmlType, getObjectValue(), serContext,
null);
+ log.debug("xmlFragment: " + xmlFragment);
+ invalidateObjectContent();
+ }
+ catch (BindingException e)
+ {
+ throw new WSException(e);
+ }
+ }
+
+ // Generate the xmlFragment from the DOM tree
+ else if (xmlFragment == null && isDOMValid)
+ {
+ log.debug("getXMLFragment from DOM");
+ xmlFragment = DOMWriter.printNode(this, false);
+ log.debug("xmlFragment: " + xmlFragment);
+ invalidateDOMContent();
+ }
+
+ if (xmlFragment == null || xmlFragment.startsWith("<") == false)
+ throw new WSException("Invalid XMLFragment: " + xmlFragment);
+
+ return xmlFragment;
+ }
+
+ public void setXMLFragment(String xmlFragment)
+ {
+ log.debug("setXMLFragment: " + xmlFragment);
+
+ if (xmlFragment == null || xmlFragment.startsWith("<") == false)
+ throw new WSException("Invalid XMLFragment: " + xmlFragment);
+
+ removeContentsAsIs();
+ resetElementContent();
+
+ this.xmlFragment = xmlFragment;
+ invalidateDOMContent();
+ invalidateObjectContent();
+ }
+
+ public Object getObjectValue()
+ {
+ if (isObjectValid == false)
+ {
+ QName xmlType = getXmlType();
+ Class javaType = getJavaType();
+
+ log.debug("getObjectValue [xmlType=" + xmlType +
",javaType=" + javaType + "]");
+ assertContentMapping();
+
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ SerializationContext serContext = msgContext.getSerializationContext();
+ serContext.setProperty(ParameterMetaData.class.getName(), getParamMetaData());
+
+ try
+ {
+ // Get the deserializer from the type mapping
+ TypeMappingImpl typeMapping = serContext.getTypeMapping();
+ DeserializerFactoryBase deserializerFactory =
getDeserializerFactory(typeMapping, javaType, xmlType);
+ DeserializerSupport des =
(DeserializerSupport)deserializerFactory.getDeserializer();
+
+ String strContent = getXMLFragment();
+
+ Object obj = des.deserialize(getQName(), xmlType, strContent, serContext);
+ if (obj != null)
+ {
+ Class objType = obj.getClass();
+ boolean isAssignable = JavaUtils.isAssignableFrom(javaType, objType);
+ if (isAssignable == false && javaType.isArray())
+ {
+ try
+ {
+ Method toArrayMethod = objType.getMethod("toArray", new
Class[] {});
+ Class returnType = toArrayMethod.getReturnType();
+ if (JavaUtils.isAssignableFrom(javaType, returnType))
+ {
+ Method getValueMethod = objType.getMethod("getValue",
new Class[] {});
+ Object value = getValueMethod.invoke(obj, new Object[] {});
+ if (value != null)
+ {
+ // Do not invoke toArray if getValue returns null
+ obj = toArrayMethod.invoke(obj, new Object[] {});
+ }
+ else
+ {
+ // if the fragment did not indicate a null return
+ // by an xsi:nil we return an empty array
+ Class componentType = javaType.getComponentType();
+ obj = Array.newInstance(componentType, 0);
+ }
+ isAssignable = true;
+ }
+ }
+ catch (Exception e)
+ {
+ // ignore
+ }
+ }
+
+ if (isAssignable == false)
+ {
+ // handle XOP simple types, i.e. in RPC/LIT
+ try
+ {
+ String contentType = MimeUtils.resolveMimeType(javaType);
+ log.debug("Adopt DataHandler to " + javaType +",
contentType "+ contentType);
+
+ DataSource ds = new
SwapableMemoryDataSource(((DataHandler)obj).getInputStream(), contentType);
+ DataHandler dh = new DataHandler(ds);
+ obj = dh.getContent();
+
+ // 'application/octet-stream' will return a byte[] instead
fo the stream
+ if(obj instanceof InputStream)
+ {
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ dh.writeTo(bout);
+ obj = bout.toByteArray();
+ }
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to adopt XOP content type",
e);
+ }
+
+ if(!JavaUtils.isAssignableFrom(javaType, obj.getClass()))
+ {
+ throw new WSException("Java type '" + javaType +
"' is not assignable from: " + objType.getName());
+ }
+ }
+ }
+
+ this.objectValue = obj;
+ this.isObjectValid = true;
+ }
+ catch (BindingException e)
+ {
+ throw new WSException(e);
+ }
+
+ log.debug("objectValue: " + (objectValue != null ?
objectValue.getClass().getName() : null));
+ }
+
+ return objectValue;
+ }
+
+ public void setObjectValue(Object objValue)
+ {
+ log.debug("setObjectValue: " + objValue);
+ removeContentsAsIs();
+ resetElementContent();
+ this.objectValue = objValue;
+ this.isObjectValid = true;
+ }
+
+ private void removeContentsAsIs()
+ {
+ log.trace("removeContentsAsIs");
+ boolean cachedFlag = isDOMValid;
+ try
+ {
+ this.isDOMValid = true;
+ super.removeContents();
+ }
+ finally
+ {
+ this.isDOMValid = cachedFlag;
+ }
+ }
+
+ // Get the serializer factory for a given javaType and xmlType
+ private SerializerFactoryBase getSerializerFactory(TypeMappingImpl typeMapping, Class
javaType, QName xmlType)
+ {
+ SerializerFactoryBase serializerFactory =
(SerializerFactoryBase)typeMapping.getSerializer(javaType, xmlType);
+
+ // The type mapping might contain a mapping for the array wrapper bean
+ if (serializerFactory == null && javaType.isArray())
+ {
+ Class arrayWrapperType = typeMapping.getJavaType(xmlType);
+ if (arrayWrapperType != null)
+ {
+ try
+ {
+ Method toArrayMethod = arrayWrapperType.getMethod("toArray", new
Class[] {});
+ Class returnType = toArrayMethod.getReturnType();
+ if (JavaUtils.isAssignableFrom(javaType, returnType))
+ {
+ serializerFactory =
(SerializerFactoryBase)typeMapping.getSerializer(arrayWrapperType, xmlType);
+ }
+ }
+ catch (NoSuchMethodException e)
+ {
+ // ignore
+ }
+ }
+ }
+
+ if (serializerFactory == null)
+ throw new WSException("Cannot obtain serializer factory for:
[xmlType=" + xmlType + ",javaType=" + javaType + "]");
+
+ return serializerFactory;
+ }
+
+ // Get the deserializer factory for a given javaType and xmlType
+ private DeserializerFactoryBase getDeserializerFactory(TypeMappingImpl typeMapping,
Class javaType, QName xmlType)
+ {
+ DeserializerFactoryBase deserializerFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(javaType, xmlType);
+
+ // The type mapping might contain a mapping for the array wrapper bean
+ if (deserializerFactory == null && javaType.isArray())
+ {
+ Class arrayWrapperType = typeMapping.getJavaType(xmlType);
+ if (arrayWrapperType != null)
+ {
+ try
+ {
+ Method toArrayMethod = arrayWrapperType.getMethod("toArray", new
Class[] {});
+ Class returnType = toArrayMethod.getReturnType();
+ if (JavaUtils.isAssignableFrom(javaType, returnType))
+ {
+ deserializerFactory =
(DeserializerFactoryBase)typeMapping.getDeserializer(arrayWrapperType, xmlType);
+ }
+ }
+ catch (NoSuchMethodException e)
+ {
+ // ignore
+ }
+ }
+ }
+
+ if (deserializerFactory == null)
+ throw new WSException("Cannot obtain deserializer factory for:
[xmlType=" + xmlType + ",javaType=" + javaType + "]");
+
+ return deserializerFactory;
+ }
+
+ /** Assert the notNull state of the xmlType and javaType
+ */
+ private void assertContentMapping()
+ {
+ if (getJavaType() == null)
+ throw new WSException("javaType cannot be null");
+ if (getXmlType() == null)
+ throw new WSException("xmlType cannot be null");
+ }
+
+ // SOAPElement interface
********************************************************************************************
+
+ public SOAPElement addChildElement(SOAPElement child) throws SOAPException
+ {
+ log.trace("addChildElement: " + child);
+ expandToDOM();
+ SOAPElement soapElement = super.addChildElement(child);
+ invalidateObjectContent();
+ invalidateXMLContent();
+ return soapElement;
+ }
+
+ public SOAPElement addChildElement(String localName, String prefix) throws
SOAPException
+ {
+ log.trace("addChildElement: [localName=" + localName +
",prefix=" + prefix + "]");
+ expandToDOM();
+ SOAPElement soapElement = super.addChildElement(localName, prefix);
+ invalidateObjectContent();
+ invalidateXMLContent();
+ return soapElement;
+ }
+
+ public SOAPElement addChildElement(String localName, String prefix, String uri) throws
SOAPException
+ {
+ log.trace("addChildElement: [localName=" + localName +
",prefix=" + prefix + ",uri=" + uri + "]");
+ expandToDOM();
+ SOAPElement soapElement = super.addChildElement(localName, prefix, uri);
+ invalidateObjectContent();
+ invalidateXMLContent();
+ return soapElement;
+ }
+
+ public SOAPElement addChildElement(Name name) throws SOAPException
+ {
+ log.trace("addChildElement: [name=" + name + "]");
+ expandToDOM();
+ SOAPElement soapElement = super.addChildElement(name);
+ invalidateObjectContent();
+ invalidateXMLContent();
+ return soapElement;
+ }
+
+ public SOAPElement addChildElement(String name) throws SOAPException
+ {
+ log.trace("addChildElement: [name=" + name + "]");
+ expandToDOM();
+ SOAPElement soapElement = super.addChildElement(name);
+ invalidateObjectContent();
+ invalidateXMLContent();
+ return soapElement;
+ }
+
+ public SOAPElement addTextNode(String value) throws SOAPException
+ {
+ log.trace("addTextNode: [value=" + value + "]");
+ expandToDOM();
+ SOAPElement soapElement = super.addTextNode(value);
+ invalidateObjectContent();
+ invalidateXMLContent();
+ return soapElement;
+ }
+
+ public Iterator getChildElements()
+ {
+ log.trace("getChildElements");
+ expandToDOM();
+ return super.getChildElements();
+ }
+
+ public Iterator getChildElements(Name name)
+ {
+ log.trace("getChildElements: [name=" + name + "]");
+ expandToDOM();
+ return super.getChildElements(name);
+ }
+
+ public void removeContents()
+ {
+ log.trace("removeContents");
+ expandToDOM();
+ super.removeContents();
+ invalidateObjectContent();
+ invalidateXMLContent();
+ }
+
+ public Iterator getAllAttributes()
+ {
+ return super.getAllAttributes();
+ }
+
+ public String getAttribute(String name)
+ {
+ return super.getAttribute(name);
+ }
+
+ public Attr getAttributeNode(String name)
+ {
+ return super.getAttributeNode(name);
+ }
+
+ public Attr getAttributeNodeNS(String namespaceURI, String localName)
+ {
+ return super.getAttributeNodeNS(namespaceURI, localName);
+ }
+
+ public String getAttributeNS(String namespaceURI, String localName)
+ {
+ return super.getAttributeNS(namespaceURI, localName);
+ }
+
+ public String getAttributeValue(Name name)
+ {
+ return super.getAttributeValue(name);
+ }
+
+ public SOAPElement addAttribute(Name name, String value) throws SOAPException
+ {
+ log.trace("addAttribute: [name=" + name + ",value=" + value +
"]");
+ expandToDOM();
+ return super.addAttribute(name, value);
+ }
+
+ public SOAPElement addNamespaceDeclaration(String prefix, String nsURI)
+ {
+ log.trace("addNamespaceDeclaration: [prefix=" + prefix +
",nsURI=" + nsURI + "]");
+ expandToDOM();
+ return super.addNamespaceDeclaration(prefix, nsURI);
+ }
+
+ public Name getElementName()
+ {
+ return super.getElementName();
+ }
+
+ public NodeList getElementsByTagName(String name)
+ {
+ log.trace("getElementsByTagName: [name=" + name + "]");
+ expandToDOM();
+ return super.getElementsByTagName(name);
+ }
+
+ public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
+ {
+ log.trace("getElementsByTagName: [nsURI=" + namespaceURI +
",localName=" + localName + "]");
+ expandToDOM();
+ return super.getElementsByTagNameNS(namespaceURI, localName);
+ }
+
+ public String getEncodingStyle()
+ {
+ return super.getEncodingStyle();
+ }
+
+ public Iterator getNamespacePrefixes()
+ {
+ return super.getNamespacePrefixes();
+ }
+
+ public String getNamespaceURI(String prefix)
+ {
+ return super.getNamespaceURI(prefix);
+ }
+
+ public TypeInfo getSchemaTypeInfo()
+ {
+ return super.getSchemaTypeInfo();
+ }
+
+ public String getTagName()
+ {
+ return super.getTagName();
+ }
+
+ public Iterator getVisibleNamespacePrefixes()
+ {
+ return super.getVisibleNamespacePrefixes();
+ }
+
+ public boolean hasAttribute(String name)
+ {
+ return super.hasAttribute(name);
+ }
+
+ public boolean hasAttributeNS(String namespaceURI, String localName)
+ {
+ return super.hasAttributeNS(namespaceURI, localName);
+ }
+
+ public boolean removeAttribute(Name name)
+ {
+ log.trace("removeAttribute: " + name.getQualifiedName());
+ expandToDOM();
+ return super.removeAttribute(name);
+ }
+
+ public void removeAttribute(String name) throws DOMException
+ {
+ log.trace("removeAttribute: " + name);
+ expandToDOM();
+ super.removeAttribute(name);
+ }
+
+ public Attr removeAttributeNode(Attr oldAttr) throws DOMException
+ {
+ log.trace("removeAttribute: " + oldAttr.getNodeName());
+ expandToDOM();
+ return super.removeAttributeNode(oldAttr);
+ }
+
+ public void removeAttributeNS(String namespaceURI, String localName) throws
DOMException
+ {
+ log.trace("removeAttributeNS: {" + namespaceURI + "}" +
localName);
+ expandToDOM();
+ super.removeAttributeNS(namespaceURI, localName);
+ }
+
+ public boolean removeNamespaceDeclaration(String prefix)
+ {
+ log.trace("removeNamespaceDeclaration: " + prefix);
+ expandToDOM();
+ return super.removeNamespaceDeclaration(prefix);
+ }
+
+ public void setAttribute(String name, String value) throws DOMException
+ {
+ log.trace("setAttribute: [name=" + name + ",value=" + value +
"]");
+ expandToDOM();
+ super.setAttribute(name, value);
+ }
+
+ public Attr setAttributeNode(Attr newAttr) throws DOMException
+ {
+ log.trace("setAttributeNode: " + newAttr);
+ expandToDOM();
+ return super.setAttributeNode(newAttr);
+ }
+
+ public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
+ {
+ log.trace("setAttributeNodeNS: " + newAttr);
+ expandToDOM();
+ return super.setAttributeNodeNS(newAttr);
+ }
+
+ public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
throws DOMException
+ {
+ log.trace("setAttribute: [nsURI=" + namespaceURI + ",name=" +
qualifiedName + ",value=" + value + "]");
+ expandToDOM();
+ super.setAttributeNS(namespaceURI, qualifiedName, value);
+ }
+
+ public void setEncodingStyle(String encodingStyle) throws SOAPException
+ {
+ super.setEncodingStyle(encodingStyle);
+ }
+
+ public void setIdAttribute(String name, boolean isId) throws DOMException
+ {
+ log.trace("setIdAttribute: [name=" + name + ",value=" + isId +
"]");
+ expandToDOM();
+ super.setIdAttribute(name, isId);
+ }
+
+ public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
+ {
+ log.trace("setIdAttributeNode: [idAttr=" + idAttr + ",value=" +
isId + "]");
+ expandToDOM();
+ super.setIdAttributeNode(idAttr, isId);
+ }
+
+ public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
throws DOMException
+ {
+ log.trace("setIdAttributeNS: [nsURI=" + namespaceURI + ",name="
+ localName + ",value=" + isId + "]");
+ expandToDOM();
+ super.setIdAttributeNS(namespaceURI, localName, isId);
+ }
+
+ // Node interface
**************************************************************************************************
+
+ public Node appendChild(Node newChild) throws DOMException
+ {
+ log.trace("appendChild: " + newChild);
+ expandToDOM();
+ Node node = super.appendChild(newChild);
+ invalidateObjectContent();
+ invalidateXMLContent();
+ return node;
+ }
+
+ public Node cloneNode(boolean deep)
+ {
+ log.trace("cloneNode: deep=" + deep);
+ expandToDOM();
+ return super.cloneNode(deep);
+ }
+
+ public NodeList getChildNodes()
+ {
+ log.trace("getChildNodes");
+ expandToDOM();
+ return super.getChildNodes();
+ }
+
+ public Node getFirstChild()
+ {
+ log.trace("getFirstChild");
+ expandToDOM();
+ return super.getFirstChild();
+ }
+
+ public Node getLastChild()
+ {
+ log.trace("getLastChild");
+ expandToDOM();
+ return super.getLastChild();
+ }
+
+ public String getValue()
+ {
+ log.trace("getValue");
+ expandToDOM();
+ return super.getValue();
+ }
+
+ public boolean hasChildNodes()
+ {
+ log.trace("hasChildNodes");
+ expandToDOM();
+ return super.hasChildNodes();
+ }
+
+ public Node removeChild(Node oldChild) throws DOMException
+ {
+ log.trace("removeChild: " + oldChild);
+ expandToDOM();
+ Node node = super.removeChild(oldChild);
+ invalidateObjectContent();
+ invalidateXMLContent();
+ return node;
+ }
+
+ public Node replaceChild(Node newChild, Node oldChild) throws DOMException
+ {
+ log.trace("replaceChild: [new=" + newChild + ",old=" + oldChild
+ "]");
+ expandToDOM();
+ Node node = super.replaceChild(newChild, oldChild);
+ invalidateObjectContent();
+ invalidateXMLContent();
+ return node;
+ }
+
+ public void setValue(String value)
+ {
+ log.trace("setValue: " + value);
+ expandToDOM();
+ super.setValue(value);
+ invalidateObjectContent();
+ invalidateXMLContent();
+ }
+
+ public NamedNodeMap getAttributes()
+ {
+ return super.getAttributes();
+ }
+
+ public boolean hasAttributes()
+ {
+ return super.hasAttributes();
+ }
+
+ // END Node interface
***********************************************************************************************
+
+ /** Expand the content, generating appropriate child nodes
+ */
+ private void expandToDOM()
+ {
+ // SOAPContentElements should only be expanded when handlers do require it.
+ if (isDOMValid == false && expandingToDOM == false)
+ {
+ log.trace("BEGIN: expandToDOM " + getElementName());
+ expandingToDOM = true;
+
+ // DOM expansion should only happen when a handler accesses the DOM API.
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ if (msgContext != null && !UnifiedMetaData.isFinalRelease())
+ {
+ Boolean allowExpand =
(Boolean)msgContext.getProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ if (Boolean.TRUE.equals(allowExpand) == false)
+ throw new WSException("Expanding content element to DOM");
+ }
+
+ try
+ {
+ if (xmlFragment == null && isObjectValid)
+ xmlFragment = getXMLFragment();
+
+ if (xmlFragment == null && isObjectValid == false)
+ throw new IllegalStateException("Neither DOM, nor XML, nor Object
valid");
+
+ if (xmlFragment != null)
+ {
+ String wrappedXMLFragment =
insertNamespaceDeclarations("<wrapper>" + xmlFragment +
"</wrapper>");
+ Element contentRoot = DOMUtils.parse(wrappedXMLFragment);
+ contentRoot = DOMUtils.getFirstChildElement(contentRoot);
+
+ String rootLocalName = contentRoot.getLocalName();
+ String rootPrefix = contentRoot.getPrefix();
+ String rootNS = contentRoot.getNamespaceURI();
+ Name contentRootName = new NameImpl(rootLocalName, rootPrefix, rootNS);
+
+ // Make sure the content root element name matches this element name
+ Name name = getElementName();
+ if (contentRootName.equals(name) == false)
+ throw new WSException("Content root name does not match element
name: " + contentRootName + " != " + name);
+
+ // Copy attributes
+ DOMUtils.copyAttributes(this, contentRoot);
+
+ SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
+
+ NodeList nlist = contentRoot.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ SOAPElementImpl soapElement =
soapFactory.createElement((Element)child, true);
+ super.addChildElement(soapElement);
+ if (Constants.NAME_XOP_INCLUDE.equals(name) || isXOPParameter())
+ XOPContext.inlineXOPData(soapElement);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ super.addTextNode(nodeValue);
+ }
+ else if (childType == Node.CDATA_SECTION_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ super.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.trace("Ignore child type: " + childType);
+ }
+ }
+ }
+
+ isDOMValid = true;
+ }
+ catch (RuntimeException e)
+ {
+ invalidateDOMContent();
+ throw e;
+ }
+ catch (Exception e)
+ {
+ invalidateDOMContent();
+ throw new WSException(e);
+ }
+ finally
+ {
+ expandingToDOM = false;
+ log.trace("END: expandToDOM " + getElementName());
+ }
+
+ invalidateXMLContent();
+ invalidateObjectContent();
+ }
+ }
+
+ public String insertNamespaceDeclarations(String xmlfragment)
+ {
+ StringBuilder xmlBuffer = new StringBuilder(xmlfragment);
+
+ int endIndex = xmlfragment.indexOf(">");
+ int insIndex = endIndex;
+ if (xmlfragment.charAt(insIndex - 1) == '/')
+ insIndex = insIndex - 1;
+
+ SOAPElement soapElement = this;
+ while (soapElement != null)
+ {
+ Iterator it = soapElement.getNamespacePrefixes();
+ while (it.hasNext())
+ {
+ String prefix = (String)it.next();
+ String nsURI = soapElement.getNamespaceURI(prefix);
+ String nsDecl = " xmlns:" + prefix + "='" + nsURI +
"'";
+
+ // Make sure there is not a duplicate on just the wrapper tag
+ int nsIndex = xmlBuffer.indexOf("xmlns:" + prefix);
+ if (nsIndex < 0 || nsIndex > endIndex)
+ {
+ xmlBuffer.insert(insIndex, nsDecl);
+ endIndex += nsDecl.length();
+ }
+ }
+ soapElement = soapElement.getParentElement();
+ }
+
+ log.trace("insertNamespaceDeclarations: " + xmlBuffer);
+ return xmlBuffer.toString();
+ }
+
+ private void invalidateDOMContent()
+ {
+ if (expandingToDOM == false)
+ {
+ log.trace("invalidateDOMContent");
+ this.isDOMValid = false;
+ }
+ }
+
+ private void invalidateObjectContent()
+ {
+ if (expandingToDOM == false)
+ {
+ log.trace("invalidateObjectContent");
+ this.isObjectValid = false;
+ this.objectValue = null;
+ }
+ }
+
+ private void invalidateXMLContent()
+ {
+ if (expandingToDOM == false)
+ {
+ log.trace("invalidateXMLContent");
+ this.xmlFragment = null;
+ }
+ }
+
+ private void resetElementContent()
+ {
+ if (expandingToDOM == false)
+ {
+ log.trace("resetElementContent");
+ invalidateDOMContent();
+ invalidateObjectContent();
+ invalidateXMLContent();
+ }
+ }
+
+ public void writeElement(Writer writer) throws IOException
+ {
+ handleMTOMTransitions();
+
+ if (isDOMValid)
+ {
+ new DOMWriter(writer).print(this);
+ }
+ else
+ {
+ writer.write(getXMLFragment());
+ }
+ }
+
+ /**
+ * When a SOAPContentElement transitions between dom-valid and xml-valid
+ * the XOP elements need to transition from XOP optimized to base64 and
reverse.<p>
+ *
+ * If MTOM is disabled through a message context property we always enforce the
+ * base64 representation by expanding to DOM, the same happens when a JAXRPC handler
+ * accesses the SOAPContentElement.<p>
+ *
+ * If the element is in dom-valid state (because a handlers accessed it), upon
marshalling
+ * it's needs to be decided wether or not the <code>xop:Include</code>
should be restored.
+ * This as well depends upon the message context property.
+ */
+ public void handleMTOMTransitions()
+ {
+ // MTOM processing is only required on XOP parameters
+ if( isXOPParameter() == false)
+ return;
+
+ if ( !XOPContext.isMTOMEnabled() )
+ {
+ // If MTOM is disabled, we force dom expansion on XOP parameters.
+ // This will inline any XOP include element and remove the attachment part.
+ // See SOAPFactoryImpl for details.
+
+ log.debug("MTOM disabled: Force inline XOP data");
+ CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
+ msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ expandToDOM();
+ }
+ else if ( isDOMValid && XOPContext.isMTOMEnabled() )
+ {
+ // When the DOM representation is valid,
+ // but MTOM is enabled we need to convert the inlined
+ // element back to an xop:Include element and create the attachment part
+
+ log.debug("MTOM enabled: Restore XOP data");
+ XOPContext.restoreXOPDataDOM(this);
+ }
+ }
+
+ private boolean isXOPParameter()
+ {
+ return paramMetaData != null && paramMetaData.isXOP();
+ }
+
+ public void accept(SAAJVisitor visitor)
+ {
+ visitor.visitSOAPContentElement(this);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPDocument.java (from
rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPDocument.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPDocument.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPDocument.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,440 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, 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.soap;
+
+import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Comment;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.Text;
+import org.w3c.dom.UserDataHandler;
+
+/**
+ * <code>SOAPDocument</code> ensures that the propper SAAJ elements are
+ * returned when Document calls are made from a DOM client. This implementation
+ * enscapsulates a single ThreadLocal Document object.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class SOAPDocument implements Document
+{
+ // TODO Revisit methods that are restricted or not implemented.
+
+ private Document doc = DOMUtils.getOwnerDocument();
+
+ // Document methods
+
+ public DocumentType getDoctype()
+ {
+ return doc.getDoctype();
+ }
+
+ public DOMImplementation getImplementation()
+ {
+ // Should this be allowed?
+ return doc.getImplementation();
+ }
+
+ public Element getDocumentElement()
+ {
+ // The base SOAPDocument does not have an element, only SOAPPart will
+ return null;
+ }
+
+ public Element createElement(String tagName) throws DOMException
+ {
+ return new SOAPElementImpl(tagName);
+ }
+
+ public DocumentFragment createDocumentFragment()
+ {
+ return doc.createDocumentFragment();
+ }
+
+ public Text createTextNode(String data)
+ {
+ return doc.createTextNode(data);
+ }
+
+ public Comment createComment(String data)
+ {
+ return doc.createComment(data);
+ }
+
+ public CDATASection createCDATASection(String data) throws DOMException
+ {
+ return createCDATASection(data);
+ }
+
+ public ProcessingInstruction createProcessingInstruction(String target, String data)
throws DOMException
+ {
+ return createProcessingInstruction(target, data);
+ }
+
+ public Attr createAttribute(String name) throws DOMException
+ {
+ return doc.createAttribute(name);
+ }
+
+ public EntityReference createEntityReference(String name) throws DOMException
+ {
+ // Not allowed
+ return null;
+ }
+
+ public NodeList getElementsByTagName(String tagname)
+ {
+ // The base SOAPDocument does not have an element, only SOAPPart will
+ return null;
+ }
+
+ public Node importNode(Node importedNode, boolean deep) throws DOMException
+ {
+ // This should never be needed
+ return doc.importNode(importedNode, deep);
+ }
+
+ public Element createElementNS(String namespaceURI, String qualifiedName) throws
DOMException
+ {
+ int loc = qualifiedName.indexOf(":");
+
+ if (loc == -1)
+ return new SOAPElementImpl(qualifiedName, null, namespaceURI);
+
+ if (loc == qualifiedName.length() - 1)
+ throw new IllegalArgumentException("Invalid qualified name");
+
+ return new SOAPElementImpl(qualifiedName.substring(loc + 1),
qualifiedName.substring(0, loc), namespaceURI);
+ }
+
+ public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws
DOMException
+ {
+ return doc.createAttributeNS(namespaceURI, qualifiedName);
+ }
+
+ public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
+ {
+ // The base SOAPDocument does not have an element, only SOAPPart will
+ return null;
+ }
+
+ public Element getElementById(String elementId)
+ {
+ // The base SOAPDocument does not have an element, only SOAPPart will
+ return null;
+ }
+
+ // Node methods
+ public String getNodeName()
+ {
+ return doc.getNodeName();
+ }
+
+ public String getNodeValue() throws DOMException
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public void setNodeValue(String nodeValue) throws DOMException
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public short getNodeType()
+ {
+ return doc.getNodeType();
+ }
+
+ public Node getParentNode()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public NodeList getChildNodes()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public Node getFirstChild()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public Node getLastChild()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public Node getPreviousSibling()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public Node getNextSibling()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public NamedNodeMap getAttributes()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public Document getOwnerDocument()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public Node insertBefore(Node newChild, Node refChild) throws DOMException
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public Node replaceChild(Node newChild, Node oldChild) throws DOMException
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public Node removeChild(Node oldChild) throws DOMException
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public Node appendChild(Node newChild) throws DOMException
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public boolean hasChildNodes()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public Node cloneNode(boolean deep)
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public void normalize()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public boolean isSupported(String feature, String version)
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public String getNamespaceURI()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public String getPrefix()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public void setPrefix(String prefix) throws DOMException
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public String getLocalName()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ public boolean hasAttributes()
+ {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node operations not
allowed on SOAPDocument");
+ }
+
+ // DOM3 methods
+
+ public String getInputEncoding()
+ {
+ // FIXME getInputEncoding
+ return null;
+ }
+
+ public String getXmlEncoding()
+ {
+ // FIXME getXmlEncoding
+ return null;
+ }
+
+ public boolean getXmlStandalone()
+ {
+ // FIXME getXmlStandalone
+ return false;
+ }
+
+ public void setXmlStandalone(boolean arg0) throws DOMException
+ {
+ // FIXME setXmlStandalone
+ }
+
+ public String getXmlVersion()
+ {
+ // FIXME getXmlVersion
+ return null;
+ }
+
+ public void setXmlVersion(String arg0) throws DOMException
+ {
+ // FIXME setXmlVersion
+ }
+
+ public boolean getStrictErrorChecking()
+ {
+ // FIXME getStrictErrorChecking
+ return false;
+ }
+
+ public void setStrictErrorChecking(boolean arg0)
+ {
+ // FIXME setStrictErrorChecking
+
+ }
+
+ public String getDocumentURI()
+ {
+ // FIXME getDocumentURI
+ return null;
+ }
+
+ public void setDocumentURI(String arg0)
+ {
+ // FIXME setDocumentURI
+
+ }
+
+ public Node adoptNode(Node arg0) throws DOMException
+ {
+ // FIXME adoptNode
+ return null;
+ }
+
+ public DOMConfiguration getDomConfig()
+ {
+ // FIXME getDomConfig
+ return null;
+ }
+
+ public void normalizeDocument()
+ {
+ // FIXME normalizeDocument
+
+ }
+
+ public Node renameNode(Node arg0, String arg1, String arg2) throws DOMException
+ {
+ // FIXME renameNode
+ return null;
+ }
+
+ public String getBaseURI()
+ {
+ // FIXME getBaseURI
+ return null;
+ }
+
+ public short compareDocumentPosition(Node arg0) throws DOMException
+ {
+ // FIXME compareDocumentPosition
+ return 0;
+ }
+
+ public String getTextContent() throws DOMException
+ {
+ // FIXME getTextContent
+ return null;
+ }
+
+ public void setTextContent(String arg0) throws DOMException
+ {
+ // FIXME setTextContent
+
+ }
+
+ public boolean isSameNode(Node arg0)
+ {
+ // FIXME isSameNode
+ return false;
+ }
+
+ public String lookupPrefix(String arg0)
+ {
+ // FIXME lookupPrefix
+ return null;
+ }
+
+ public boolean isDefaultNamespace(String arg0)
+ {
+ // FIXME isDefaultNamespace
+ return false;
+ }
+
+ public String lookupNamespaceURI(String arg0)
+ {
+ // FIXME lookupNamespaceURI
+ return null;
+ }
+
+ public boolean isEqualNode(Node arg0)
+ {
+ // FIXME isEqualNode
+ return false;
+ }
+
+ public Object getFeature(String arg0, String arg1)
+ {
+ // FIXME getFeature
+ return null;
+ }
+
+ public Object setUserData(String arg0, Object arg1, UserDataHandler arg2)
+ {
+ // FIXME setUserData
+ return null;
+ }
+
+ public Object getUserData(String arg0)
+ {
+ // FIXME getUserData
+ return null;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPElementImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPElementImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,738 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+import javax.xml.soap.Node;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.Text;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.TypeInfo;
+
+/**
+ * An object representing an element of a SOAP message that is allowed but not
specifically prescribed by a
+ * SOAP specification. This interface serves as the base interface for those objects that
are specifically
+ * prescribed by a SOAP specification.
+ *
+ * Methods in this interface that are required to return SAAJ specific objects may
"silently" replace nodes
+ * in the tree as required to successfully return objects of the correct type.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPElementImpl extends NodeImpl implements SOAPElement, SAAJVisitable
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPElementImpl.class);
+
+ // The org.w3c.dom.Element
+ private Element element;
+ // The element name
+ private Name elementName;
+ // The element's encoding style
+ private String encodingStyle = Constants.URI_LITERAL_ENC;
+
+ /** Called by SOAPFactory */
+ public SOAPElementImpl(String localPart)
+ {
+
+ super(DOMUtils.createElement(localPart, null, null));
+ this.element = (Element)domNode;
+ log.trace("new SOAPElementImpl: " + getElementName());
+ }
+
+ /** Called by SOAPFactory */
+ public SOAPElementImpl(String localPart, String prefix, String nsURI)
+ {
+ super(DOMUtils.createElement(localPart, prefix, nsURI));
+ this.element = (Element)domNode;
+ log.trace("new SOAPElementImpl: " + getElementName());
+ }
+
+ /** Called by SOAPFactory */
+ public SOAPElementImpl(Name name)
+ {
+ this(name.getLocalName(), name.getPrefix(), name.getURI());
+ }
+
+ /** Copy constructor for converting SOAPElement types
+ */
+ protected SOAPElementImpl(SOAPElementImpl element)
+ {
+ super(element);
+ this.element = (Element)domNode;
+ log.trace("new SOAPElementImpl: " + getElementName());
+ }
+
+ /** Get the SOAPEnvelope for this SOAPElement */
+ public SOAPEnvelope getSOAPEnvelope()
+ {
+ SOAPElement soapElement = this;
+ while (soapElement != null && (soapElement instanceof SOAPEnvelope) ==
false)
+ soapElement = soapElement.getParentElement();
+
+ return (SOAPEnvelope)soapElement;
+ }
+
+ // javax.xml.soap.SOAPElement
*************************************************************************************
+
+ /**
+ * Adds an attribute with the specified name and value to this SOAPElement object.
+ *
+ * @param name a Name object with the name of the attribute
+ * @param value a String giving the value of the attribute
+ * @return the SOAPElement object into which the attribute was inserted
+ * @throws javax.xml.soap.SOAPException if there is an error in creating the
Attribute
+ */
+ public SOAPElement addAttribute(Name name, String value) throws SOAPException
+ {
+ // xml:lang='en'
+ if ("xml".equals(name.getPrefix()))
+ {
+ setAttribute(name.getQualifiedName(), value);
+ }
+ else
+ {
+ setAttributeNS(name.getURI(), name.getQualifiedName(), value);
+ }
+ return this;
+ }
+
+ /**
+ * Creates a new SOAPElement object initialized with the specified local name and adds
the new element to this SOAPElement object.
+ *
+ * @param name a String giving the local name for the element
+ * @return the new SOAPElement object that was created
+ * @throws javax.xml.soap.SOAPException if there is an error in creating the
SOAPElement object
+ */
+ public SOAPElement addChildElement(String name) throws SOAPException
+ {
+ SOAPElement soapElement = new SOAPElementImpl(name);
+ soapElement = addChildElement(soapElement);
+ return soapElement;
+ }
+
+ /**
+ * Creates a new SOAPElement object initialized with the specified local name and
prefix and adds the new element to this SOAPElement object.
+ *
+ * @param localName a String giving the local name for the new element
+ * @param prefix a String giving the namespace prefix for the new element
+ * @return the new SOAPElement object that was created
+ * @throws javax.xml.soap.SOAPException if there is an error in creating the
SOAPElement object
+ */
+ public SOAPElement addChildElement(String localName, String prefix) throws
SOAPException
+ {
+ String nsURI = getNamespaceURI(prefix);
+ if (nsURI == null)
+ throw new IllegalArgumentException("Cannot obtain namespace URI for prefix:
" + prefix);
+
+ SOAPElement soapElement = new SOAPElementImpl(localName, prefix, nsURI);
+ soapElement = addChildElement(soapElement);
+ return soapElement;
+ }
+
+ /**
+ * Creates a new SOAPElement object initialized with the specified local name, prefix,
and URI and adds the new element to this SOAPElement object.
+ *
+ * @param localName a String giving the local name for the new element
+ * @param prefix a String giving the namespace prefix for the new element
+ * @param uri a String giving the URI of the namespace to which the new element
belongs
+ * @return the new SOAPElement object that was created
+ * @throws javax.xml.soap.SOAPException if there is an error in creating the
SOAPElement object
+ */
+ public SOAPElement addChildElement(String localName, String prefix, String uri) throws
SOAPException
+ {
+ SOAPElement soapElement = new SOAPElementImpl(localName, prefix, uri);
+ soapElement = addChildElement(soapElement);
+ return soapElement;
+ }
+
+ /**
+ * Creates a new SOAPElement object initialized with the given Name object and adds
the new element to this SOAPElement object.
+ *
+ * @param name a Name object with the XML name for the new element
+ * @return the new SOAPElement object that was created
+ * @throws javax.xml.soap.SOAPException if there is an error in creating the
SOAPElement object
+ */
+ public SOAPElement addChildElement(Name name) throws SOAPException
+ {
+ SOAPElement soapElement = new SOAPElementImpl(name);
+ soapElement = addChildElement(soapElement);
+ return soapElement;
+ }
+
+ /**
+ * Add a SOAPElement as a child of this SOAPElement instance. The SOAPElement is
expected to be created by a
+ * SOAPElementFactory.
+ * <p/>
+ * Callers should not rely on the element instance being added as is into the XML
tree.
+ * Implementations could end up copying the content of the SOAPElement passed into an
instance of a different SOAPElement
+ * implementation. For instance if addChildElement() is called on a SOAPHeader,
element will be copied into an instance
+ * of a SOAPHeaderElement.
+ * <p/>
+ * The fragment rooted in element is either added as a whole or not at all, if there
was an error.
+ * <p/>
+ * The fragment rooted in element cannot contain elements named "Envelope",
"Header" or "Body" and in the SOAP namespace.
+ * Any namespace prefixes present in the fragment should be fully resolved using
appropriate namespace declarations
+ * within the fragment itself.
+ *
+ * @param child the SOAPElement to be added as a new child
+ * @return an instance representing the new SOAP element that was actually added to
the tree.
+ * @throws javax.xml.soap.SOAPException if there was an error in adding this element
as a child
+ */
+ public SOAPElement addChildElement(SOAPElement child) throws SOAPException
+ {
+ log.trace("addChildElement: " + getElementName() + " -> " +
child.getElementName());
+ SOAPElementImpl soapElement = (SOAPElementImpl)child;
+ soapElement = (SOAPElementImpl)appendChild(soapElement);
+ return soapElement.completeNamespaceDeclaration();
+ }
+
+ /**
+ * Adds a namespace declaration with the specified prefix and URI to this SOAPElement
object.
+ *
+ * @param prefix a String giving the prefix of the namespace
+ * @param nsURI a String giving the uri of the namespace
+ * @return the SOAPElement object into which this namespace declaration was inserted.
+ * @throws javax.xml.soap.SOAPException if there is an error in creating the
namespace
+ */
+ public SOAPElement addNamespaceDeclaration(String prefix, String nsURI)
+ {
+ if (nsURI == null)
+ throw new IllegalArgumentException("Invalid 'null' namespace
URI");
+ if (nsURI.length() == 0)
+ throw new IllegalArgumentException("Invalid empty namespace URI");
+
+ String qualifiedName = "xmlns";
+ if (prefix != null && prefix.length() > 0)
+ qualifiedName += ":" + prefix;
+
+ log.trace("addNamespaceDeclaration: " + qualifiedName +
"='" + nsURI + "'");
+
element.setAttributeNS("http://www.w3.org/2000/xmlns/", qualifiedName,
nsURI);
+ return this;
+ }
+
+ // Add the namespace declaration if it is not visible yet
+ private SOAPElement completeNamespaceDeclaration()
+ {
+ String prefix = getPrefix();
+ String nsURI = getNamespaceURI();
+ if (prefix != null && nsURI != null)
+ {
+ String prevNS = getNamespaceURI(prefix);
+ if (nsURI.equals(prevNS) == false)
+ addNamespaceDeclaration(prefix, nsURI);
+ }
+ return this;
+ }
+
+ /**
+ * Creates a new Text object initialized with the given String and adds it to this
SOAPElement object.
+ *
+ * @param value a String object with the textual content to be added
+ * @return the SOAPElement object into which the new Text object was inserted
+ * @throws javax.xml.soap.SOAPException if there is an error in creating the new Text
object
+ */
+ public SOAPElement addTextNode(String value) throws SOAPException
+ {
+ log.trace("addTextNode: " + value);
+ org.w3c.dom.Text domText = element.getOwnerDocument().createTextNode(value);
+ javax.xml.soap.Text soapText = new TextImpl(domText);
+ appendChild(soapText);
+ return this;
+ }
+
+ /**
+ * Returns an Iterator over all of the attribute Name objects in this SOAPElement
object.
+ * <p/>
+ * The iterator can be used to get the attribute names, which can then be passed to
the method getAttributeValue to
+ * retrieve the value of each attribute.
+ *
+ * @return an iterator over the names of the attributes
+ */
+ public Iterator getAllAttributes()
+ {
+ ArrayList list = new ArrayList();
+ NamedNodeMap nnm = getAttributes();
+ for (int i = 0; i < nnm.getLength(); i++)
+ {
+ org.w3c.dom.Node node = (org.w3c.dom.Node)nnm.item(i);
+ String local = node.getLocalName();
+ String prefix = node.getPrefix();
+ String uri = node.getNamespaceURI();
+ if ("xmlns".equals(prefix) == false)
+ {
+ Name name;
+ if (uri != null && uri.length() > 0)
+ {
+ name = new NameImpl(local, prefix, uri);
+ }
+ else
+ {
+ name = new NameImpl(local);
+ }
+ list.add(name);
+ }
+ }
+ return list.iterator();
+ }
+
+ /**
+ * Returns the value of the attribute with the specified name.
+ *
+ * @param name a Name object with the name of the attribute
+ * @return a String giving the value of the specified attribute
+ */
+ public String getAttributeValue(Name name)
+ {
+ Attr attr = getAttributeNode(name);
+ return (attr != null ? attr.getValue() : null);
+ }
+
+ private Attr getAttributeNode(Name name)
+ {
+ Attr attr = null;
+ String nsURI = name.getURI();
+ if (nsURI.length() > 0)
+ attr = element.getAttributeNodeNS(nsURI, name.getLocalName());
+ else attr = element.getAttributeNode(name.getLocalName());
+
+ return attr;
+ }
+
+ /**
+ * Returns an Iterator over all the immediate child Nodes of this element.
+ * <p/>
+ * This includes javax.xml.soap.Text objects as well as SOAPElement objects.
+ * Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes
to be replaced by SOAPElement,
+ * SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for
the type of this parent node.
+ * As a result the calling application must treat any existing references to these
child nodes that have been obtained
+ * through DOM APIs as invalid and either discard them or refresh them with the values
returned by this Iterator.
+ * This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap
for more details.
+ *
+ * @return an iterator with the content of this SOAPElement object
+ */
+ public Iterator getChildElements()
+ {
+ List list = new ArrayList();
+ NodeList nodeList = getChildNodes();
+ for (int i = 0; i < nodeList.getLength(); i++)
+ {
+ org.w3c.dom.Node node = nodeList.item(i);
+ if (node instanceof SOAPElement)
+ {
+ list.add(node);
+ }
+ else if (node instanceof Text)
+ {
+ String value = node.getNodeValue();
+ if (value.trim().length() > 0)
+ list.add(node);
+ }
+ }
+ return list.iterator();
+ }
+
+ /**
+ * Returns an Iterator over all the immediate child Nodes of this element with the
specified name.
+ * <p/>
+ * All of these children will be SOAPElement nodes.
+ * Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes
to be replaced by SOAPElement,
+ * SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for
the type of this parent node.
+ * As a result the calling application must treat any existing references to these
child nodes that have been obtained
+ * through DOM APIs as invalid and either discard them or refresh them with the values
returned by this Iterator.
+ * This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap
for more details.
+ *
+ * @param name a Name object with the name of the child elements to be returned
+ * @return an Iterator object over all the elements in this SOAPElement object with
the specified name
+ */
+ public Iterator getChildElements(Name name)
+ {
+ List<SOAPElement> list = new ArrayList<SOAPElement>();
+ Iterator it = getChildElements();
+ while (it.hasNext())
+ {
+ Object elementOrTextNode = it.next();
+ if (elementOrTextNode instanceof SOAPElement)
+ {
+ SOAPElement el = (SOAPElement)elementOrTextNode;
+ if (el.getElementName().equals(name))
+ list.add(el);
+ }
+ }
+ return list.iterator();
+ }
+
+ /**
+ * Returns the name of this SOAPElement object.
+ *
+ * @return a Name object with the name of this SOAPElement object
+ */
+ public Name getElementName()
+ {
+ if (elementName == null)
+ {
+ String nsURI = element.getNamespaceURI();
+ if (nsURI != null && nsURI.length() > 0)
+ {
+ String prefix = element.getPrefix();
+ String localName = element.getLocalName();
+ elementName = new NameImpl(localName, prefix, nsURI);
+ }
+ else
+ {
+ String nodeName = element.getNodeName();
+ elementName = new NameImpl(nodeName);
+ }
+ }
+ return elementName;
+ }
+
+ /**
+ * Returns the encoding style for this SOAPElement object.
+ *
+ * @return a String giving the encoding style
+ */
+ public String getEncodingStyle()
+ {
+ return encodingStyle;
+ }
+
+ /**
+ * Returns an Iterator over the namespace prefix Strings declared by this element.
+ * <p/>
+ * The prefixes returned by this iterator can be passed to the method getNamespaceURI
to retrieve the URI of each namespace.
+ *
+ * @return an iterator over the namespace prefixes in this SOAPElement object
+ */
+ public Iterator getNamespacePrefixes()
+ {
+ ArrayList list = getNamespacePrefixList();
+ return list.iterator();
+ }
+
+ private ArrayList getNamespacePrefixList()
+ {
+ ArrayList list = new ArrayList();
+ NamedNodeMap attrMap = element.getAttributes();
+ for (int i = 0; i < attrMap.getLength(); i++)
+ {
+ Attr attr = (Attr)attrMap.item(i);
+ String attrName = attr.getNodeName();
+ if (attrName.startsWith("xmlns:"))
+ list.add(attrName.substring(6));
+ }
+ return list;
+ }
+
+ /**
+ * Returns the URI of the namespace that has the given prefix.
+ *
+ * @param prefix a String giving the prefix of the namespace for which to search
+ * @return a String with the uri of the namespace that has the given prefix
+ */
+ public String getNamespaceURI(String prefix)
+ {
+ String nsURI = element.getAttribute("xmlns:" + prefix);
+ if (nsURI.length() == 0 && getParentElement() != null)
+ return getParentElement().getNamespaceURI(prefix);
+
+ return (nsURI.length() > 0 ? nsURI : null);
+ }
+
+ /**
+ * Returns an Iterator over the namespace prefix Strings visible to this element.
+ * <p/>
+ * The prefixes returned by this iterator can be passed to the method getNamespaceURI
to retrieve the URI of each namespace.
+ *
+ * @return an iterator over the namespace prefixes are within scope of this
SOAPElement object
+ */
+ public Iterator getVisibleNamespacePrefixes()
+ {
+ ArrayList list = getNamespacePrefixList();
+ SOAPElementImpl parent = (SOAPElementImpl)getParentElement();
+ while (parent != null)
+ {
+ list.addAll(parent.getNamespacePrefixList());
+ parent = (SOAPElementImpl)parent.getParentElement();
+ }
+ return list.iterator();
+ }
+
+ /**
+ * Removes the attribute with the specified name.
+ *
+ * @param name the Name object with the name of the attribute to be removed
+ * @return true if the attribute was removed successfully; false if it was not
+ */
+ public boolean removeAttribute(Name name)
+ {
+ Attr attr = getAttributeNode(name);
+ if (attr != null)
+ {
+ element.removeAttributeNode(attr);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Detaches all children of this SOAPElement.
+ * <p/>
+ * This method is useful for rolling back the construction of partially completed
SOAPHeaders and SOAPBodys in
+ * preparation for sending a fault when an error condition is detected.
+ * It is also useful for recycling portions of a document within a SOAP message.
+ */
+ public void removeContents()
+ {
+ log.trace("removeContents");
+ Iterator it = getChildElements();
+ while (it.hasNext())
+ {
+ SOAPElement el = (SOAPElement)it.next();
+ el.detachNode();
+ }
+ }
+
+ /**
+ * Removes the namespace declaration corresponding to the given prefix.
+ *
+ * @param prefix a String giving the prefix for which to search
+ * @return true if the namespace declaration was removed successfully; false if it was
not
+ */
+ public boolean removeNamespaceDeclaration(String prefix)
+ {
+ boolean ret = getAttributeNode("xmlns:" + prefix) != null;
+ removeAttribute("xmlns:" + prefix);
+ return ret;
+ }
+
+ /**
+ * Sets the encoding style for this SOAPElement object to one specified.
+ *
+ * @param encodingStyle a String giving the encoding style
+ * @throws javax.xml.soap.SOAPException if there was a problem in the encoding style
being set.
+ */
+ public void setEncodingStyle(String encodingStyle) throws SOAPException
+ {
+ if (!Constants.URI_LITERAL_ENC.equals(encodingStyle) &&
!Constants.URI_SOAP11_ENC.equals(encodingStyle))
+ throw new IllegalArgumentException("Unsupported encodingStyle: " +
encodingStyle);
+
+ this.encodingStyle = encodingStyle;
+ }
+
+ // org.w3c.Element
***********************************************************************************************
+
+ public String getTagName()
+ {
+ return element.getTagName();
+ }
+
+ public void removeAttribute(String name) throws DOMException
+ {
+ element.removeAttribute(name);
+ }
+
+ public boolean hasAttribute(String name)
+ {
+ return element.hasAttribute(name);
+ }
+
+ public String getAttribute(String name)
+ {
+ return element.getAttribute(name);
+ }
+
+ public void removeAttributeNS(String namespaceURI, String localName) throws
DOMException
+ {
+ element.removeAttributeNS(namespaceURI, localName);
+ }
+
+ public void setAttribute(String name, String value) throws DOMException
+ {
+ element.setAttribute(name, value);
+ }
+
+ public boolean hasAttributeNS(String namespaceURI, String localName)
+ {
+ return element.hasAttributeNS(namespaceURI, localName);
+ }
+
+ public Attr getAttributeNode(String name)
+ {
+ Attr attr = element.getAttributeNode(name);
+
+ return (attr == null) ? null : new AttrImpl(this, attr);
+ }
+
+ public Attr removeAttributeNode(Attr oldAttr) throws DOMException
+ {
+ return element.removeAttributeNode(oldAttr);
+ }
+
+ public Attr setAttributeNode(Attr newAttr) throws DOMException
+ {
+ return element.setAttributeNode(newAttr);
+ }
+
+ public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
+ {
+ return element.setAttributeNodeNS(newAttr);
+ }
+
+ public NodeList getElementsByTagName(String name)
+ {
+ return new NodeListImpl(DOMUtils.getChildElements(this, name));
+ }
+
+ public String getAttributeNS(String namespaceURI, String localName)
+ {
+ return element.getAttributeNS(namespaceURI, localName);
+ }
+
+ public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
throws DOMException
+ {
+ element.setAttributeNS(namespaceURI, qualifiedName, value);
+ }
+
+ public Attr getAttributeNodeNS(String namespaceURI, String localName)
+ {
+ /* FIXME We really need to do more than just return an object wrapper.
+ * All Attrs should be stored as nodes on our local tree, so that
+ * they are discovered during node traversal calls.
+ */
+ Attr attr = element.getAttributeNodeNS(namespaceURI, localName);
+
+ return (attr == null) ? null : new AttrImpl(this, attr);
+ }
+
+ public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
+ {
+ return new NodeListImpl(DOMUtils.getChildElements(this, new QName(namespaceURI,
localName)));
+ }
+
+ public TypeInfo getSchemaTypeInfo()
+ {
+ throw new NotImplementedException("getSchemaTypeInfo");
+ }
+
+ public void setIdAttribute(String name, boolean isId) throws DOMException
+ {
+ throw new NotImplementedException("setIdAttribute");
+ }
+
+ public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
+ {
+ throw new NotImplementedException("setIdAttributeNode");
+ }
+
+ public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
throws DOMException
+ {
+ throw new NotImplementedException("setIdAttributeNS");
+ }
+
+ public void accept(SAAJVisitor visitor) {
+ visitor.visitSOAPElement(this);
+ }
+ /**
+ * The default implementation uses a DOMWriter.
+ * SOAPContentElements overwrite this to optimize DOM callbacks.
+ */
+ public void writeElement(Writer writer) throws IOException
+ {
+ String qualName = getElementName().getQualifiedName();
+ writer.write("<" + qualName);
+
+ // namespaces
+ Iterator nsPrefixes = getNamespacePrefixes();
+ while (nsPrefixes.hasNext())
+ {
+ String prefix = (String)nsPrefixes.next();
+ writer.write(" xmlns:" + prefix + "='" +
getNamespaceURI(prefix) + "'");
+ }
+
+ // attributes
+ Iterator attNames = getAllAttributes();
+ while (attNames.hasNext())
+ {
+ NameImpl name = (NameImpl)attNames.next();
+ String attPrefix = name.getPrefix() != null ? name.getPrefix() : "";
+ String attFqn = attPrefix.length() > 0 ? attPrefix + ":" +
name.getLocalName() : name.getLocalName();
+ writer.write(" " + attFqn + "='" +
getAttributeValue(name) + "'");
+ }
+ writer.write(">");
+
+ writeElementContent(writer);
+
+ writer.write("</" + qualName + ">");
+ }
+
+ protected void writeElementContent(Writer out) throws IOException
+ {
+ Iterator it = getChildElements();
+ if (it.hasNext())
+ {
+ while (it.hasNext())
+ {
+ Node node = (Node)it.next();
+ if (node instanceof SOAPElementImpl)
+ {
+ ((SOAPElementImpl)node).writeElement(out);
+ }
+ else if (node instanceof TextImpl)
+ {
+ out.write(node.getValue());
+ }
+ else
+ {
+ throw new WSException("Unhandled soap node: " +
node.getClass().getName());
+ }
+ }
+ }
+ else
+ {
+ String value = getValue();
+ if (value != null)
+ out.write(value);
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPElementWriter.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPElementWriter.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,157 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+
+import javax.xml.soap.SOAPEnvelope;
+
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.WSException;
+
+/**
+ * Writes a SAAJ elements to an output stream.
+ *
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 4-Aug-2006
+ */
+public class SOAPElementWriter
+{
+
+ // Print writer
+ private PrintWriter out;
+ // True, if the XML declaration should be written
+ private boolean writeXMLDeclaration;
+ // Explicit character set encoding
+ private String charsetName;
+
+ public SOAPElementWriter(Writer w)
+ {
+ this.out = new PrintWriter(w);
+ }
+
+ public SOAPElementWriter(OutputStream stream)
+ {
+ try
+ {
+ this.out = new PrintWriter(new OutputStreamWriter(stream, "UTF-8"));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ // ignore, UTF-8 should be available
+ }
+ }
+
+ public SOAPElementWriter(OutputStream stream, String charsetName)
+ {
+ try
+ {
+ this.out = new PrintWriter(new OutputStreamWriter(stream, charsetName));
+ this.charsetName = charsetName;
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new IllegalArgumentException("Unsupported encoding: " +
charsetName);
+ }
+ }
+
+ /**
+ * Set wheter the XML declaration should be written.
+ * The default is false.
+ */
+ public SOAPElementWriter setWriteXMLDeclaration(boolean writeXMLDeclaration)
+ {
+ this.writeXMLDeclaration = writeXMLDeclaration;
+ return this;
+ }
+
+ /**
+ * Print a node with explicit prettyprinting.
+ * The defaults for all other DOMWriter properties apply.
+ */
+ public static String writeElement(SOAPElementImpl element, boolean pretty)
+ {
+ if (element == null)
+ return null;
+
+ StringWriter strw = new StringWriter();
+ new SOAPElementWriter(strw).writeElement(element);
+ String xmlStr = strw.toString();
+
+ if (pretty)
+ {
+ // This is expensive. Make sure it only happens for debugging
+ try
+ {
+ xmlStr = DOMWriter.printNode(DOMUtils.parse(xmlStr), true);
+ }
+ catch (IOException ex)
+ {
+ throw new WSException ("Cannot parse xml: " + xmlStr, ex);
+ }
+ }
+
+ return xmlStr;
+ }
+
+ public void writeElement(SOAPElementImpl element)
+ {
+ writeElementInternal(element);
+ }
+
+ private void writeElementInternal(SOAPElementImpl element)
+ {
+ if (element != null)
+ {
+ try
+ {
+ if (writeXMLDeclaration == true && element instanceof SOAPEnvelope)
+ {
+ out.print("<?xml version='1.0'");
+ if (charsetName != null)
+ out.print(" encoding='" + charsetName +
"'");
+
+ out.println("?>");
+ writeXMLDeclaration = false;
+ }
+
+ element.writeElement(out);
+
+ out.flush();
+ }
+ catch (IOException ex)
+ {
+ throw new WSException("Cannot write SOAP element", ex);
+ }
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPEnvelopeImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPEnvelopeImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.Name;
+import javax.xml.soap.Node;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.Constants;
+import org.w3c.dom.Document;
+
+/**
+ * The container for the SOAPHeader and SOAPBody portions of a SOAPPart object. By
default, a
+ * SOAPMessage object is created with a SOAPPart object that has a SOAPEnvelope object.
+ * The SOAPEnvelope object by default has an empty SOAPBody object and an empty
SOAPHeader object.
+ * The SOAPBody object is required, and the SOAPHeader object, though optional, is used
in the majority of cases.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPEnvelopeImpl extends SOAPElementImpl implements SOAPEnvelope
+{
+ // Reference the enclosing SOAPPart, so that getOwnerDocument() works correctly
+ private SOAPPartImpl soapPart;
+ private boolean domExpansionEnabled = false;
+
+ /** Construct a SOAP envelope for the given SOAP version URI prefix, etc.
+ */
+ public SOAPEnvelopeImpl(SOAPPartImpl soapPart, SOAPElementImpl element) throws
SOAPException
+ {
+ super(element);
+
+ this.soapPart = soapPart;
+ soapPart.setEnvelope(this);
+
+ String prefix = getPrefix();
+ String namespaceURI = getNamespaceURI();
+
+ assertEnvelopeNamespace(namespaceURI);
+ addNamespaceDeclaration(prefix, namespaceURI);
+
+ addHeader();
+ addBody();
+ }
+
+ /** Construct a SOAP envelope for the given SOAP version URI.
+ */
+ SOAPEnvelopeImpl(SOAPPartImpl soapPart, String namespace) throws SOAPException
+ {
+ super("Envelope", Constants.PREFIX_ENV, namespace);
+
+ this.soapPart = soapPart;
+ soapPart.setEnvelope(this);
+
+ assertEnvelopeNamespace(namespace);
+ addNamespaceDeclaration(getPrefix(), namespace);
+
+ addHeader();
+ addBody();
+ }
+
+ private void assertEnvelopeNamespace(String namespaceURI)
+ {
+ if (!Constants.NS_SOAP12_ENV.equals(namespaceURI) &&
!Constants.NS_SOAP11_ENV.equals(namespaceURI))
+ {
+ QName faultCode = Constants.SOAP11_FAULT_CODE_VERSION_MISMATCH;
+ String faultString = "Invalid SOAP envelope namespace: " +
namespaceURI;
+ throw new SOAPFaultException(faultCode, faultString, null, null);
+ }
+ }
+
+ public SOAPMessage getSOAPMessage()
+ {
+ return soapPart.getSOAPMessage();
+ }
+
+ public SOAPBody addBody() throws SOAPException
+ {
+ SOAPBody body = getBody();
+ if (body != null)
+ throw new SOAPException("SOAPEnvelope already has a body element");
+
+ body = new SOAPBodyImpl(getPrefix(), getNamespaceURI());
+ addChildElement(body);
+ return body;
+ }
+
+ public SOAPHeader addHeader() throws SOAPException
+ {
+ SOAPHeader header = getHeader();
+ if (header != null)
+ throw new SOAPException("SOAPEnvelope already has a header element");
+
+ header = new SOAPHeaderImpl(getPrefix(), getNamespaceURI());
+ return (SOAPHeader)addChildElement(header);
+ }
+
+ /** Make sure the child is either a SOAPHeader or SOAPBody */
+ public SOAPElement addChildElement(SOAPElement child) throws SOAPException
+ {
+ if ((child instanceof SOAPHeader) == false && (child instanceof SOAPBody)
== false)
+ throw new IllegalArgumentException("SOAPHeader or SOAPBody
expected");
+
+ return super.addChildElement(child);
+ }
+
+ public Name createName(String localName) throws SOAPException
+ {
+ return new NameImpl(localName);
+ }
+
+ public Name createName(String localName, String prefix, String uri) throws
SOAPException
+ {
+ return new NameImpl(localName, prefix, uri);
+ }
+
+ public SOAPBody getBody() throws SOAPException
+ {
+ Iterator it = getChildElements();
+ while (it.hasNext())
+ {
+ Node node = (Node)it.next();
+ if (node.getLocalName().equals("Body"))
+ return (SOAPBody)node;
+ }
+ return null;
+ }
+
+ public SOAPHeader getHeader() throws SOAPException
+ {
+ Iterator it = getChildElements();
+ while (it.hasNext())
+ {
+ Node node = (Node)it.next();
+ if (node.getLocalName().equals("Header"))
+ return (SOAPHeader)node;
+ }
+ return null;
+ }
+
+ /**
+ * Text nodes are not supported.
+ */
+ public SOAPElement addTextNode(String value) throws SOAPException
+ {
+ throw new SOAPException("Cannot add Text node to SOAPEnvelope");
+ }
+
+ public Document getOwnerDocument()
+ {
+ return soapPart;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPFactoryImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPFactoryImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+// $Id$
+
+import javax.xml.soap.Detail;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * SOAPFactory implementation.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPFactoryImpl extends SOAPFactory
+{
+ private static Logger log = Logger.getLogger(SOAPFactoryImpl.class);
+
+ public SOAPElement createElement(Name name) throws SOAPException
+ {
+ return new SOAPElementImpl(name);
+ }
+
+ public SOAPElement createElement(String localName) throws SOAPException
+ {
+ return new SOAPElementImpl(localName);
+ }
+
+ public SOAPElement createElement(String localName, String prefix, String uri) throws
SOAPException
+ {
+ return new SOAPElementImpl(localName, prefix, uri);
+ }
+
+ /**
+ * Create a SOAPElement from a DOM Element.
+ * This method is not part of the javax.xml.soap.SOAPFactory interface.
+ */
+ public SOAPElementImpl createElement(Element domNode, boolean deep) throws
SOAPException
+ {
+ if (domNode == null)
+ throw new IllegalArgumentException("Source node cannot be null");
+
+ String localName = domNode.getLocalName();
+ String prefix = domNode.getPrefix() != null ? domNode.getPrefix() : "";
+ String nsURI = domNode.getNamespaceURI() != null ? domNode.getNamespaceURI() :
"";
+
+ SOAPElementImpl soapElement = new SOAPElementImpl(localName, prefix, nsURI);
+
+ // Add the child elements as well
+ if (deep)
+ {
+ if (domNode instanceof Element)
+ DOMUtils.copyAttributes(soapElement, (Element)domNode);
+
+ NodeList nlist = domNode.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ short nodeType = child.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE)
+ {
+ SOAPElementImpl soapChild = createElement((Element)child, true);
+ soapElement.addChildElement(soapChild);
+ }
+ else if (nodeType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapElement.addTextNode(nodeValue);
+ }
+ else if (nodeType == Node.CDATA_SECTION_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapElement.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.trace("Ignore child type: " + nodeType);
+ }
+ }
+ }
+
+ return soapElement;
+ }
+
+ public Detail createDetail() throws SOAPException
+ {
+ return new DetailImpl();
+ }
+
+ public Name createName(String localName, String prefix, String uri) throws
SOAPException
+ {
+ return new NameImpl(localName, prefix, uri);
+ }
+
+ public Name createName(String localName) throws SOAPException
+ {
+ return new NameImpl(localName);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPFaultElementImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPFaultElementImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPFaultElementImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.soap;
+
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPFaultElement;
+
+public class SOAPFaultElementImpl extends SOAPElementImpl implements SOAPFaultElement
+{
+ public SOAPFaultElementImpl(String localPart)
+ {
+ super(localPart);
+ }
+
+ public SOAPFaultElementImpl(String localPart, String prefix, String namespace)
+ {
+ super(localPart, prefix, namespace);
+ }
+
+ public SOAPFaultElementImpl(Name name)
+ {
+ super(name);
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPFaultImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPFaultImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,242 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.soap.Detail;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.xb.QNameBuilder;
+import org.w3c.dom.Element;
+
+/**
+ * An element in the SOAPBody object that contains error and/or status information.
+ * This information may relate to errors in the SOAPMessage object or to problems
+ * that are not related to the content in the message itself. Problems not related
+ * to the message itself are generally errors in processing, such as the inability
+ * to communicate with an upstream server.
+ *
+ * The SOAPFault interface provides methods for retrieving the information contained
+ * in a SOAPFault object and for setting the fault code, the fault actor, and a string
+ * describing the fault. A fault code is one of the codes defined in the SOAP 1.1
specification
+ * that describe the fault. An actor is an intermediate recipient to whom a message was
routed.
+ * The message path may include one or more actors, or, if no actors are specified, the
message
+ * goes only to the default actor, which is the final intended recipient.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPFaultImpl extends SOAPBodyElementDoc implements SOAPFault
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPFaultImpl.class);
+
+ private SOAPElement faultcode;
+ private SOAPElement faultstring;
+ private SOAPElement faultactor;
+ private Locale faultStringLocale;
+
+ public SOAPFaultImpl(String namespaceURI) throws SOAPException
+ {
+ super(new NameImpl("Fault", Constants.PREFIX_ENV, namespaceURI));
+ SOAPFactoryImpl factory = new SOAPFactoryImpl();
+ addChildElement(faultcode = factory.createElement("faultcode"));
+ addChildElement(faultstring = factory.createElement("faultstring"));
+ }
+
+ /** Creates an optional Detail object and sets it as the Detail object for this
SOAPFault object.
+ */
+ public Detail addDetail() throws SOAPException
+ {
+ Detail detail = getDetail();
+ if (detail != null)
+ throw new SOAPException("SOAPFault already contains a detail node");
+
+ SOAPFactoryImpl factory = new SOAPFactoryImpl();
+ detail = (Detail)addChildElement(factory.createDetail());
+ return detail;
+ }
+
+ /** Returns the optional detail element for this SOAPFault object.
+ */
+ public Detail getDetail()
+ {
+ Detail detail = null;
+ Iterator it = getChildElements(new NameImpl("detail"));
+ while (it.hasNext())
+ {
+ Object obj = it.next();
+ if (obj instanceof Detail)
+ {
+ detail = (Detail)obj;
+ }
+ else if (obj instanceof SOAPElementImpl)
+ {
+ try
+ {
+ SOAPElementImpl soapEl = (SOAPElementImpl)obj;
+ SOAPFactoryImpl factory = new SOAPFactoryImpl();
+ detail = (Detail)addChildElement(factory.createDetail());
+
+ Iterator childIt = DOMUtils.getChildElements(soapEl);
+ while (childIt.hasNext())
+ {
+ Element domElement = (Element)childIt.next();
+ SOAPElement detailEntry = new
DetailEntryImpl(factory.createElement(domElement, true));
+ detail.addChildElement(detailEntry);
+ }
+ }
+ catch (SOAPException e)
+ {
+ throw new WSException("Unable to create fault detail: " +
e.getMessage());
+ }
+
+ }
+ }
+
+ return detail;
+ }
+
+ /** Gets the fault actor for this SOAPFault object.
+ */
+ public String getFaultActor()
+ {
+ return (faultactor != null ? faultactor.getValue() : null);
+ }
+
+ /** Gets the fault code for this SOAPFault object.
+ */
+ public String getFaultCode()
+ {
+ String value = faultcode.getValue();
+ return value;
+ }
+
+ /**
+ * Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name
object.
+ */
+ public Name getFaultCodeAsName()
+ {
+ QName qname = QNameBuilder.buildQName(this, faultcode.getValue());
+ return new NameImpl(qname);
+ }
+
+ /** Gets the fault string for this SOAPFault object.
+ */
+ public String getFaultString()
+ {
+ String value = faultstring.getValue();
+ return value;
+ }
+
+ /** Gets the locale of the fault string for this SOAPFault object.
+ */
+ public Locale getFaultStringLocale()
+ {
+ return faultStringLocale;
+ }
+
+ /** Sets this SOAPFault object with the given fault actor.
+ */
+ public void setFaultActor(String faultActor) throws SOAPException
+ {
+ if (faultactor == null)
+ {
+ SOAPFactoryImpl factory = new SOAPFactoryImpl();
+ addChildElement(faultactor = factory.createElement("faultactor"));
+ }
+
+ faultactor.setValue(faultActor);
+ }
+
+ /** Sets this SOAPFault object with the give fault code.
+ */
+ public void setFaultCode(String faultCode) throws SOAPException
+ {
+ // Must be of the form "prefix:localName" where the prefix has been
defined in a namespace declaration.
+ if (faultCode == null || faultCode.indexOf(":") < 1)
+ throw new IllegalArgumentException("Invalid faultCode: " +
faultCode);
+
+ QName qname = QNameBuilder.buildQName(this, faultCode);
+ setFaultCode(new NameImpl(qname));
+ }
+
+ /** Sets this SOAPFault object with the given fault code.
+ */
+ public void setFaultCode(Name faultName) throws SOAPException
+ {
+ String nsURI = faultName.getURI();
+ String prefix = faultName.getPrefix();
+ String localName = faultName.getLocalName();
+
+ // For lazy folkes like the CTS that don't bother to give
+ // a namesapce URI, assume they use a standard code
+ if ("".equals(nsURI))
+ {
+ log.warn("Empty namespace URI with fault code '" + faultName +
"', assuming: " + Constants.NS_SOAP11_ENV);
+ nsURI = Constants.NS_SOAP11_ENV;
+ }
+
+ if ("".equals(prefix) && getNamespaceURI().equals(nsURI))
+ prefix = getPrefix();
+
+ String prevNS = getNamespaceURI(prefix);
+ if (nsURI.equals(prevNS) == false)
+ addNamespaceDeclaration(prefix, nsURI);
+
+ String faultCode = prefix + ":" + localName;
+ faultcode.setValue(faultCode);
+ }
+
+ /** Sets the fault string for this SOAPFault object to the given string.
+ */
+ public void setFaultString(String faultString) throws SOAPException
+ {
+ faultstring.setValue(faultString);
+ }
+
+ /** Sets the fault string for this SOAPFault object to the given string and localized
to the given locale.
+ */
+ public void setFaultString(String faultString, Locale locale) throws SOAPException
+ {
+ setFaultString(faultString);
+ this.faultStringLocale = locale;
+ }
+
+ public void writeElement(Writer writer)
+ {
+ new DOMWriter(writer).print(this);
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPHeaderElementImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPHeaderElementImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,142 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, 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.soap;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPHeaderElement;
+
+import org.jboss.ws.Constants;
+
+/**
+ * An object representing the contents in the SOAP header part of the SOAP envelope.
+ * The immediate children of a SOAPHeader object can be represented only as
SOAPHeaderElement objects.
+ *
+ * A SOAPHeaderElement object can have other SOAPElement objects as its children.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPHeaderElementImpl extends SOAPContentElement implements
SOAPHeaderElement
+{
+ public SOAPHeaderElementImpl(Name name)
+ {
+ super(name);
+ }
+
+ public SOAPHeaderElementImpl(SOAPElementImpl element)
+ {
+ super(element);
+ }
+
+ public String getActor()
+ {
+ String envURI = Constants.NS_SOAP11_ENV;
+ String attr = getAttributeNS(envURI, Constants.SOAP11_ATTR_ACTOR);
+ return attr;
+ }
+
+ public boolean getMustUnderstand()
+ {
+ String envURI = Constants.NS_SOAP11_ENV;
+ String attr = getAttributeNS(envURI, Constants.SOAP11_ATTR_MUST_UNDERSTAND);
+ return "1".equals(attr);
+ }
+
+ public void setActor(String actorURI)
+ {
+ String envURI = Constants.NS_SOAP11_ENV;
+ String qualifiedName = Constants.PREFIX_ENV + ":" +
Constants.SOAP11_ATTR_ACTOR;
+ setAttributeNS(envURI, qualifiedName, actorURI);
+ }
+
+ public void setMustUnderstand(boolean mustUnderstand)
+ {
+ String envURI = Constants.NS_SOAP11_ENV;
+ String qualifiedName = Constants.PREFIX_ENV + ":" +
Constants.SOAP11_ATTR_MUST_UNDERSTAND;
+ setAttributeNS(envURI, qualifiedName, mustUnderstand ? "1" :
"0");
+ }
+
+ public void setParentElement(SOAPElement parent) throws SOAPException
+ {
+ if (parent == null)
+ throw new SOAPException("Invalid null parent element");
+
+ if ((parent instanceof SOAPHeader) == false)
+ throw new SOAPException("Invalid parent element: " +
parent.getElementName());
+
+ super.setParentElement(parent);
+ }
+
+ @Override
+ public void writeElement(Writer writer) throws IOException
+ {
+ StringWriter strwr = new StringWriter(256);
+ super.writeElement(strwr);
+
+ SOAPHeader soapHeader = (SOAPHeader)getParentElement();
+ SOAPEnvelope soapEnvelope = (SOAPEnvelope)soapHeader.getParentElement();
+
+ // Find known namespace declarations
+ List<String> knownNamespaces = new ArrayList<String>();
+ Iterator prefixes = soapEnvelope.getNamespacePrefixes();
+ while (prefixes.hasNext())
+ {
+ String prefix = (String)prefixes.next();
+ String nsURI = soapEnvelope.getNamespaceURI(prefix);
+ String xmlns = " xmlns:" + prefix + "='" + nsURI +
"'";
+ knownNamespaces.add(xmlns);
+ }
+ prefixes = soapHeader.getNamespacePrefixes();
+ while (prefixes.hasNext())
+ {
+ String prefix = (String)prefixes.next();
+ String nsURI = soapHeader.getNamespaceURI(prefix);
+ String xmlns = " xmlns:" + prefix + "='" + nsURI +
"'";
+ knownNamespaces.add(xmlns);
+ }
+
+ // Remove known namespace declarations
+ String xmlFragment = strwr.toString();
+ for (String xmlns : knownNamespaces)
+ {
+ int start = xmlFragment.indexOf(xmlns);
+ while (start > 0)
+ {
+ int end = start + xmlns.length();
+ xmlFragment = xmlFragment.substring(0, start) + xmlFragment.substring(end);
+ start = xmlFragment.indexOf(xmlns);
+ }
+ }
+
+ writer.write(xmlFragment);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPHeaderImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPHeaderImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,197 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPHeaderElement;
+
+import org.w3c.dom.DOMException;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Node;
+
+/**
+ * A representation of the SOAP header element. A SOAP header element consists of XML
data that affects the way the
+ * application-specific content is processed by the message provider. For example,
transaction semantics,
+ * authentication information, and so on, can be specified as the content of a SOAPHeader
object.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPHeaderImpl extends SOAPElementImpl implements SOAPHeader
+{
+ public SOAPHeaderImpl(String prefix, String namespace)
+ {
+ super("Header", prefix, namespace);
+ }
+
+ private SOAPHeaderElementImpl convertToHeaderElement(Node node)
+ {
+ if (!(node instanceof SOAPElementImpl))
+ throw new IllegalArgumentException("SOAPElement expected");
+
+ SOAPElementImpl element = (SOAPElementImpl)node;
+
+ // convert to SOAPHeaderElement
+ element.detachNode();
+ return new SOAPHeaderElementImpl(element);
+ }
+
+ /*** Add a SOAPHeaderElement as a child of this SOAPHeader instance.
+ */
+ public SOAPElement addChildElement(SOAPElement child) throws SOAPException
+ {
+ // Check that we get a SOAPHeaderElement
+ if ((child instanceof SOAPHeaderElement) == false)
+ child = convertToHeaderElement(child);
+
+ return super.addChildElement(child);
+ }
+
+ /** Creates a new SOAPHeaderElement object initialized with the specified name and
adds it to this SOAPHeader object.
+ */
+ public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException
+ {
+ if (name == null || name.getURI().length() == 0 || name.getPrefix().length() == 0)
+ throw new SOAPException("Invalid SOAPHeaderElement name: " + name);
+
+ SOAPHeaderElementImpl headerElement = new SOAPHeaderElementImpl(name);
+ addChildElement(headerElement);
+ return headerElement;
+ }
+
+ /** Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader
object.
+ */
+ public Iterator examineAllHeaderElements()
+ {
+ // make a defensive copy
+ ArrayList list = new ArrayList();
+ Iterator it = getChildElements();
+ while (it.hasNext())
+ {
+ SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
+ list.add(shElement);
+ }
+ return list.iterator();
+ }
+
+ /** Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader
object that have the specified actor.
+ */
+ public Iterator examineHeaderElements(String actor)
+ {
+ if (actor == null)
+ throw new IllegalArgumentException("Invalid actor: " + actor);
+
+ // make a defensive copy
+ ArrayList list = new ArrayList();
+ Iterator it = getChildElements();
+ while (it.hasNext())
+ {
+ SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
+ if (actor.equals(shElement.getActor()))
+ list.add(shElement);
+ }
+ return list.iterator();
+ }
+
+ /** Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader
object that have the specified
+ * actor and that have a MustUnderstand attribute whose value is equivalent to true.
+ */
+ public Iterator examineMustUnderstandHeaderElements(String actor)
+ {
+ if (actor == null)
+ throw new IllegalArgumentException("Invalid actor: " + actor);
+
+ // make a defensive copy
+ ArrayList list = new ArrayList();
+ Iterator it = getChildElements();
+ while (it.hasNext())
+ {
+ SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
+ if (actor.equals(shElement.getActor()) &&
shElement.getMustUnderstand())
+ list.add(shElement);
+ }
+ return list.iterator();
+ }
+
+ public Iterator extractAllHeaderElements()
+ {
+ // make a defensive copy
+ ArrayList list = new ArrayList();
+ Iterator it = getChildElements();
+ while (it.hasNext())
+ {
+ SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
+ removeChild(shElement);
+ list.add(shElement);
+ }
+ return list.iterator();
+ }
+
+ public Iterator extractHeaderElements(String actor)
+ {
+ if (actor == null)
+ throw new IllegalArgumentException("Invalid actor: " + actor);
+
+ // make a defensive copy
+ ArrayList list = new ArrayList();
+ Iterator it = getChildElements();
+ while (it.hasNext())
+ {
+ SOAPHeaderElement shElement = (SOAPHeaderElement)it.next();
+ if (actor.equals(shElement.getActor()))
+ {
+ removeChild(shElement);
+ list.add(shElement);
+ }
+ }
+ return list.iterator();
+ }
+
+ public Node appendChild(Node newChild) throws DOMException
+ {
+ if (!(newChild instanceof SOAPHeaderElementImpl || newChild instanceof
DocumentFragment))
+ newChild = convertToHeaderElement(newChild);
+
+ return super.appendChild(newChild);
+ }
+
+ public Node insertBefore(Node newChild, Node refChild) throws DOMException
+ {
+ if (!(newChild instanceof SOAPHeaderElementImpl || newChild instanceof
DocumentFragment))
+ newChild = convertToHeaderElement(newChild);
+
+ return super.insertBefore(newChild, refChild);
+ }
+
+ public Node replaceChild(Node newChild, Node oldChild) throws DOMException
+ {
+ if (!(newChild instanceof SOAPHeaderElementImpl || newChild instanceof
DocumentFragment))
+ newChild = convertToHeaderElement(newChild);
+
+ return super.replaceChild(newChild, oldChild);
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPMessageDispatcher.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPMessageDispatcher.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+// $Id$
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.OperationMetaData;
+
+/**
+ * Derive the operation meta data from incomming SOAP message
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 22-Nov-2005
+ */
+public class SOAPMessageDispatcher
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPMessageDispatcher.class);
+
+ /** Get the operation meta data for a given SOAP message
+ */
+ public OperationMetaData getDispatchDestination(EndpointMetaData epMetaData,
SOAPMessage soapMessage) throws SOAPException
+ {
+ OperationMetaData opMetaData = null;
+
+ // Dispatch based on wsa:Action
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ AddressingProperties inProps =
(AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ if (inProps != null && inProps.getAction() != null)
+ {
+ String wsaAction = inProps.getAction().getURI().toASCIIString();
+ for (OperationMetaData opAux : epMetaData.getOperations())
+ {
+ if (wsaAction.equals(opAux.getSOAPAction()))
+ {
+ opMetaData = opAux;
+ log.debug("Use wsa:Action dispatch: " + wsaAction);
+ break;
+ }
+ }
+ }
+
+ // Dispatch based on SOAPBodyElement name
+ if (opMetaData == null)
+ {
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ Iterator bodyChildren = soapBody.getChildElements();
+ if (bodyChildren.hasNext() == false)
+ {
+ if (epMetaData.getStyle() == Style.RPC)
+ throw new SOAPException("Empty SOAP body with no child element not
supported for RPC");
+
+ // [JBWS-1125] Support empty soap body elements
+ for (OperationMetaData opAux : epMetaData.getOperations())
+ {
+ if (opAux.getParameters().size() == 0)
+ {
+ log.debug ("Dispatching empty SOAP body");
+ opMetaData = opAux;
+ break;
+ }
+ }
+ }
+ else
+ {
+ SOAPBodyElement soapBodyElement = (SOAPBodyElement)bodyChildren.next();
+ if (bodyChildren.hasNext())
+ throw new SOAPException("SOAPBody has more than on child
element");
+
+ Name soapName = soapBodyElement.getElementName();
+ QName xmlElementName = new QName(soapName.getURI(),
soapName.getLocalName());
+ opMetaData = epMetaData.getOperation(xmlElementName);
+ }
+ }
+
+ // Dispatch to a generic operation that takes an org.w3c.dom.Element
+ if (opMetaData == null)
+ {
+ for (OperationMetaData opAux : epMetaData.getOperations())
+ {
+ if (opAux.isMessageEndpoint())
+ {
+ log.debug("Use generic message style dispatch");
+ opMetaData = opAux;
+ break;
+ }
+ }
+ }
+
+ log.debug("getDispatchDestination: " + (opMetaData != null ?
opMetaData.getQName() : null));
+ return opMetaData;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPMessageImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPMessageImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,414 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, 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.soap;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.mail.MessagingException;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
+import org.jboss.ws.core.soap.attachment.CIDGenerator;
+import org.jboss.ws.core.soap.attachment.MimeConstants;
+import org.jboss.ws.core.soap.attachment.MultipartRelatedEncoder;
+import org.jboss.ws.core.soap.attachment.MultipartRelatedSwAEncoder;
+import org.jboss.ws.core.soap.attachment.MultipartRelatedXOPEncoder;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.OperationMetaData;
+
+/**
+ * The root class for all SOAP messages. As transmitted on the "wire", a SOAP
message is an XML document or a
+ * MIME message whose first body part is an XML/SOAP document.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
+ */
+public class SOAPMessageImpl extends SOAPMessage
+{
+ private boolean saveRequired = true;
+ private MimeHeaders mimeHeaders = new MimeHeaders();
+ private List<AttachmentPart> attachments = new
LinkedList<AttachmentPart>();
+ private CIDGenerator cidGenerator = new CIDGenerator();
+ private boolean isXOPMessage;
+ private SOAPPartImpl soapPart;
+ private MultipartRelatedEncoder multipartRelatedEncoder;
+
+ // Cache the associated operation meta data
+ private OperationMetaData opMetaData;
+
+ SOAPMessageImpl() throws SOAPException
+ {
+ soapPart = new SOAPPartImpl(this);
+ setProperty(CHARACTER_SET_ENCODING, "UTF-8");
+ setProperty(WRITE_XML_DECLARATION, false);
+ }
+
+ public CIDGenerator getCidGenerator()
+ {
+ return cidGenerator;
+ }
+
+ public boolean isXOPMessage()
+ {
+ return isXOPMessage;
+ }
+
+ public void setXOPMessage(boolean isXOPMessage)
+ {
+ this.isXOPMessage = isXOPMessage;
+ }
+
+ public void setAttachments(Collection<AttachmentPart> parts) throws
SOAPException
+ {
+ for (AttachmentPart part : parts)
+ {
+ attachments.add(part);
+ }
+ saveRequired = true;
+ }
+
+ public void addAttachmentPart(AttachmentPart part)
+ {
+ if (part == null)
+ return;
+
+ attachments.add(part);
+ saveRequired = true;
+ }
+
+ public AttachmentPart getAttachmentByContentId(String cid) throws SOAPException
+ {
+ for (AttachmentPart part : attachments)
+ {
+ String contentId = part.getContentId();
+ if (contentId.equals(cid))
+ return part;
+ }
+ return null;
+ }
+
+ public AttachmentPart removeAttachmentByContentId(String cid)
+ {
+ for (AttachmentPart part : attachments)
+ {
+ String contentId = part.getContentId();
+ if (contentId.equals(cid))
+ {
+ attachments.remove(part);
+ return part;
+ }
+ }
+
+ return null;
+ }
+ public AttachmentPart getAttachmentByPartName(String partName)
+ {
+ for (AttachmentPart part : attachments)
+ {
+ String contentId = part.getContentId();
+ if (contentId.startsWith("<" + partName + "="))
+ return part;
+ }
+ return null;
+ }
+
+ public AttachmentPart createAttachmentPart()
+ {
+ return new AttachmentPartImpl();
+ }
+
+ public String getContentDescription()
+ {
+ String[] value = mimeHeaders.getHeader(MimeConstants.CONTENT_DESCRIPTION);
+
+ return (value == null) ? null : value[0];
+ }
+
+ public void setContentDescription(String description)
+ {
+ mimeHeaders.setHeader(MimeConstants.CONTENT_DESCRIPTION, description);
+ }
+
+ public MimeHeaders getMimeHeaders()
+ {
+ return mimeHeaders;
+ }
+
+ public void setMimeHeaders(MimeHeaders headers)
+ {
+ if (headers == null)
+ throw new IllegalArgumentException("MimeHeaders cannot be null");
+ this.mimeHeaders = headers;
+ }
+
+ public SOAPPart getSOAPPart()
+ {
+ return soapPart;
+ }
+
+ public void removeAllAttachments()
+ {
+ attachments.clear();
+ saveRequired = true;
+ }
+
+ public int countAttachments()
+ {
+ return attachments.size();
+ }
+
+ public Iterator getAttachments()
+ {
+ // Someone could call remove on this iterator, affecting the attachment count
+ saveRequired = true;
+ return attachments.iterator();
+ }
+
+ public Iterator getAttachments(MimeHeaders headers)
+ {
+ if (headers == null)
+ throw new WSException("MimeHeaders can not be null");
+
+ return new MimeMatchingAttachmentsIterator(headers, attachments);
+ }
+
+ public void saveChanges() throws SOAPException
+ {
+ if (saveRequired == true)
+ {
+ try
+ {
+ boolean hasAttachments = attachments.size() > 0;
+
+ if (isXOPMessage() && !XOPContext.isMTOMEnabled() &&
hasAttachments)
+ throw new IllegalStateException("XOP parameter not properly
inlined");
+
+ // default content-type
+ String contentType = MimeConstants.TYPE_SOAP11 + "; charset=" +
getCharSetEncoding();
+
+ if (hasAttachments)
+ {
+ if (isXOPMessage() && XOPContext.isMTOMEnabled())
+ {
+ multipartRelatedEncoder = new MultipartRelatedXOPEncoder(this);
+ multipartRelatedEncoder.encodeMultipartRelatedMessage();
+ contentType = multipartRelatedEncoder.getContentType();
+ }
+ else
+ {
+ multipartRelatedEncoder = new MultipartRelatedSwAEncoder(this);
+ multipartRelatedEncoder.encodeMultipartRelatedMessage();
+ contentType = multipartRelatedEncoder.getContentType();
+ }
+ }
+
+ mimeHeaders.setHeader(MimeConstants.CONTENT_TYPE, contentType);
+
+ }
+ catch (MessagingException ex)
+ {
+ throw new SOAPException(ex);
+ }
+
+ /*
+ * We are lazily encoding our message, which means that currently
+ * Content-Length is not being calculated. This should not be a problem
+ * because HTTP/1.1 does not require that it be sent (WS Basic Profile 1.1
+ * states that implementations SHOULD send HTTP 1.1). If it is determined
+ * that it must be sent, this perhaps should be done by the transport
+ * layer. However, there could be a space optimization where length is
+ * precalulated per attachment, and that calculation would, of course,
+ * belong here.
+ */
+
+ saveRequired = false;
+ }
+ }
+
+ public boolean saveRequired()
+ {
+ return saveRequired;
+ }
+
+ public void writeTo(OutputStream outs) throws SOAPException, IOException
+ {
+ // Save all changes
+ saveChanges();
+
+ // If there are attachments then we delegate encoding to MultipartRelatedEncoder
+ if (attachments.size() > 0)
+ {
+ multipartRelatedEncoder.writeTo(outs);
+ }
+ else
+ {
+ SOAPEnvelope soapEnv = getSOAPPart().getEnvelope();
+ if (soapEnv != null)
+ {
+ boolean writeXML = isWriteXMLDeclaration();
+ String charsetEncoding = getCharSetEncoding();
+ SOAPElementWriter writer = new SOAPElementWriter(outs, charsetEncoding);
+
writer.setWriteXMLDeclaration(writeXML).writeElement((SOAPEnvelopeImpl)soapEnv);
+ }
+ }
+ }
+
+ private String getCharSetEncoding() throws SOAPException
+ {
+ String charsetName = (String)getProperty(CHARACTER_SET_ENCODING);
+ if (charsetName == null)
+ charsetName = "UTF-8";
+ return charsetName;
+ }
+
+ /** Get the operation meta data for this SOAP message
+ */
+ public OperationMetaData getOperationMetaData(EndpointMetaData epMetaData) throws
SOAPException
+ {
+ if (opMetaData == null)
+ {
+ SOAPMessageDispatcher dispatcher = new SOAPMessageDispatcher();
+ opMetaData = dispatcher.getDispatchDestination(epMetaData, this);
+ }
+ return opMetaData;
+ }
+
+ public boolean isFaultMessage()
+ {
+ SOAPFault soapFault = null;
+ try
+ {
+ soapFault = getSOAPBody().getFault();
+ }
+ catch (Exception ignore)
+ {
+ }
+ return soapFault != null;
+ }
+
+ private boolean isWriteXMLDeclaration() throws SOAPException
+ {
+ Boolean booleanValue = new Boolean(false);
+ Object propValue = getProperty(WRITE_XML_DECLARATION);
+ if (propValue instanceof Boolean)
+ booleanValue = (Boolean)propValue;
+ if (propValue instanceof String)
+ booleanValue = new Boolean((String)propValue);
+ return booleanValue.booleanValue();
+ }
+
+ public static class MimeMatchingAttachmentsIterator implements Iterator
+ {
+ private Iterator iterator;
+
+ private MimeHeaders headers = new MimeHeaders();
+
+ private AttachmentPart lastMatch;
+
+ public MimeMatchingAttachmentsIterator(MimeHeaders headers, List attachments)
+ {
+ iterator = attachments.iterator();
+
+ if (headers != null)
+ this.headers = headers;
+ }
+
+ private boolean containsAllHeaders(Iterator headerIterator, AttachmentPart part)
+ {
+ while (headerIterator.hasNext())
+ {
+ MimeHeader header = (MimeHeader)headerIterator.next();
+ String[] values = part.getMimeHeader(header.getName());
+ if (values == null)
+ return false;
+
+ boolean match = false;
+ for (int j = 0; j < values.length; j++)
+ {
+ if (values[j].equalsIgnoreCase(header.getValue()))
+ {
+ match = true;
+ break;
+ }
+ }
+
+ if (!match)
+ return false;
+ }
+
+ return true;
+ }
+
+ private void nextMatch()
+ {
+ while (iterator.hasNext())
+ {
+ AttachmentPart part = (AttachmentPart)iterator.next();
+ if (containsAllHeaders(headers.getAllHeaders(), part))
+ {
+ lastMatch = part;
+ break;
+ }
+ }
+ }
+
+ public boolean hasNext()
+ {
+ if (lastMatch == null)
+ nextMatch();
+
+ return lastMatch != null;
+ }
+
+ public Object next()
+ {
+ if (!hasNext())
+ return null;
+
+ Object retval = lastMatch;
+ lastMatch = null;
+
+ return retval;
+ }
+
+ public void remove()
+ {
+ iterator.remove();
+ }
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java (from
rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPPartImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPPartImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,547 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, 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.soap;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Comment;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.Text;
+import org.w3c.dom.UserDataHandler;
+
+/** An implementation of SOAPPart.
+ *
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SOAPPartImpl extends SOAPPart
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPPartImpl.class);
+
+ private SOAPMessage soapMessage;
+ private SOAPEnvelope soapEnvelope;
+
+ private SOAPDocument doc = new SOAPDocument();
+
+ SOAPPartImpl(SOAPMessage message)
+ {
+ this.soapMessage = message;
+ }
+
+ public SOAPMessage getSOAPMessage()
+ {
+ return soapMessage;
+ }
+
+ public SOAPEnvelope getEnvelope() throws SOAPException
+ {
+ return soapEnvelope;
+ }
+
+ public void setEnvelope(SOAPEnvelope soapEnvelope)
+ {
+ this.soapEnvelope = soapEnvelope;
+ }
+
+ public void removeMimeHeader(String s)
+ {
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ mimeHeaders.removeHeader(s);
+ }
+
+ public void removeAllMimeHeaders()
+ {
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ mimeHeaders.removeAllHeaders();
+ }
+
+ public String[] getMimeHeader(String name)
+ {
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ return mimeHeaders.getHeader(name);
+ }
+
+ public void setMimeHeader(String name, String value)
+ {
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ mimeHeaders.setHeader(name, value);
+ }
+
+ public void addMimeHeader(String name, String value)
+ {
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ mimeHeaders.addHeader(name, value);
+ }
+
+ public Iterator getAllMimeHeaders()
+ {
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ return mimeHeaders.getAllHeaders();
+ }
+
+ public Iterator getMatchingMimeHeaders(String names[])
+ {
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ return mimeHeaders.getMatchingHeaders(names);
+ }
+
+ public Iterator getNonMatchingMimeHeaders(String names[])
+ {
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ return mimeHeaders.getNonMatchingHeaders(names);
+ }
+
+ public void setContent(Source source) throws SOAPException
+ {
+ // R2714 For one-way operations, an INSTANCE MUST NOT return a HTTP response that
contains a SOAP envelope.
+ // Specifically, the HTTP response entity-body must be empty.
+ if (source == null)
+ {
+ log.debug("Setting content source to null removes the SOAPEnvelope");
+ soapEnvelope = null;
+ return;
+ }
+
+ Element domElement;
+ if (source instanceof DOMSource)
+ {
+ DOMSource domSource = (DOMSource)source;
+ Node node = domSource.getNode();
+ if (node instanceof Document)
+ domElement = ((Document)node).getDocumentElement();
+ else if (node instanceof Element)
+ domElement = (Element)node;
+ else
+ throw new SOAPException("Unsupported DOMSource node: " + node);
+ }
+ else if (source instanceof StreamSource)
+ {
+ try
+ {
+ StreamSource streamSource = (StreamSource)source;
+ domElement = DOMUtils.parse(streamSource.getInputStream());
+ }
+ catch (IOException e)
+ {
+ throw new SOAPException("Cannot parse stream source", e);
+ }
+ }
+ else
+ {
+ throw new SOAPException("Unsupported source parameter: " + source);
+ }
+
+ SOAPFactoryImpl factory = new SOAPFactoryImpl();
+ SOAPElementImpl soapElement = factory.createElement(domElement, true);
+
+ SOAPBody body = soapEnvelope.getBody();
+ body.removeContents();
+ body.addChildElement(soapElement);
+ }
+
+ public Source getContent() throws SOAPException
+ {
+ SOAPBody body = soapEnvelope.getBody();
+ return new DOMSource(body.getFirstChild());
+ }
+
+ // Document
*********************************************************************************************************
+
+ public DOMImplementation getImplementation()
+ {
+ return doc.getImplementation();
+ }
+
+ public DocumentFragment createDocumentFragment()
+ {
+ return doc.createDocumentFragment();
+ }
+
+ public DocumentType getDoctype()
+ {
+ return doc.getDoctype();
+ }
+
+ public Element getDocumentElement()
+ {
+ return soapEnvelope;
+ }
+
+ public Attr createAttribute(String name) throws DOMException
+ {
+ return doc.createAttribute(name);
+ }
+
+ public CDATASection createCDATASection(String data) throws DOMException
+ {
+ return doc.createCDATASection(data);
+ }
+
+ public Comment createComment(String data)
+ {
+ return doc.createComment(data);
+ }
+
+ public Element createElement(String tagName) throws DOMException
+ {
+ return doc.createElement(tagName);
+ }
+
+ public Element getElementById(String elementId)
+ {
+ return doc.getElementById(elementId);
+ }
+
+ public EntityReference createEntityReference(String name) throws DOMException
+ {
+ return doc.createEntityReference(name);
+ }
+
+ public org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep) throws
DOMException
+ {
+ return doc.importNode(importedNode, deep);
+ }
+
+ public NodeList getElementsByTagName(String tagname)
+ {
+ return doc.getElementsByTagName(tagname);
+ }
+
+ public Text createTextNode(String data)
+ {
+ return doc.createTextNode(data);
+ }
+
+ public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws
DOMException
+ {
+ return doc.createAttributeNS(namespaceURI, qualifiedName);
+ }
+
+ public Element createElementNS(String namespaceURI, String qualifiedName) throws
DOMException
+ {
+ return doc.createElementNS(namespaceURI, qualifiedName);
+ }
+
+ public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
+ {
+ return doc.getElementsByTagNameNS(namespaceURI, localName);
+ }
+
+ public ProcessingInstruction createProcessingInstruction(String target, String data)
throws DOMException
+ {
+ return doc.createProcessingInstruction(target, data);
+ }
+
+ // Node
*********************************************************************************************************
+
+ public org.w3c.dom.Node appendChild(org.w3c.dom.Node node) throws DOMException
+ {
+ throw new NotImplementedException();
+ }
+
+ public org.w3c.dom.Node cloneNode(boolean b)
+ {
+ throw new NotImplementedException();
+ }
+
+ public NamedNodeMap getAttributes()
+ {
+ throw new NotImplementedException();
+ }
+
+ public NodeList getChildNodes()
+ {
+ List<NodeImpl> list = new ArrayList<NodeImpl>();
+ if (soapEnvelope != null)
+ {
+ list.add((NodeImpl)soapEnvelope);
+ }
+ return new NodeListImpl(list);
+ }
+
+ public org.w3c.dom.Node getFirstChild()
+ {
+ return soapEnvelope;
+ }
+
+ public org.w3c.dom.Node getLastChild()
+ {
+ return soapEnvelope;
+ }
+
+ public String getLocalName()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getNamespaceURI()
+ {
+ throw new NotImplementedException();
+ }
+
+ public org.w3c.dom.Node getNextSibling()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getNodeName()
+ {
+ return doc.getNodeName();
+ }
+
+ public short getNodeType()
+ {
+ return doc.getNodeType();
+ }
+
+ public String getNodeValue() throws DOMException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Document getOwnerDocument()
+ {
+ throw new NotImplementedException();
+ }
+
+ public org.w3c.dom.Node getParentNode()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getPrefix()
+ {
+ throw new NotImplementedException();
+ }
+
+ public org.w3c.dom.Node getPreviousSibling()
+ {
+ throw new NotImplementedException();
+ }
+
+ public boolean hasAttributes()
+ {
+ throw new NotImplementedException();
+ }
+
+ public boolean hasChildNodes()
+ {
+ throw new NotImplementedException();
+ }
+
+ public org.w3c.dom.Node insertBefore(org.w3c.dom.Node node, org.w3c.dom.Node node1)
throws DOMException
+ {
+ throw new NotImplementedException();
+ }
+
+ public boolean isSupported(String s, String s1)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void normalize()
+ {
+ throw new NotImplementedException();
+ }
+
+ public org.w3c.dom.Node removeChild(org.w3c.dom.Node node) throws DOMException
+ {
+ throw new NotImplementedException();
+ }
+
+ public org.w3c.dom.Node replaceChild(org.w3c.dom.Node node, org.w3c.dom.Node node1)
throws DOMException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void setNodeValue(String s) throws DOMException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void setPrefix(String s) throws DOMException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Node adoptNode(Node source) throws DOMException
+ {
+ throw new NotImplementedException("adoptNode");
+ }
+
+ public String getDocumentURI()
+ {
+ throw new NotImplementedException("getDocumentURI");
+ }
+
+ public DOMConfiguration getDomConfig()
+ {
+ throw new NotImplementedException("getDomConfig");
+ }
+
+ public String getInputEncoding()
+ {
+ throw new NotImplementedException("getInputEncoding");
+ }
+
+ public boolean getStrictErrorChecking()
+ {
+ throw new NotImplementedException("getStrictErrorChecking");
+ }
+
+ public String getXmlEncoding()
+ {
+ throw new NotImplementedException("getXmlEncoding");
+ }
+
+ public boolean getXmlStandalone()
+ {
+ throw new NotImplementedException("getXmlStandalone");
+ }
+
+ public String getXmlVersion()
+ {
+ throw new NotImplementedException("getXmlVersion");
+ }
+
+ public void normalizeDocument()
+ {
+ throw new NotImplementedException("normalizeDocument");
+ }
+
+ public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws
DOMException
+ {
+ throw new NotImplementedException("renameNode");
+ }
+
+ public void setDocumentURI(String documentURI)
+ {
+ throw new NotImplementedException("setDocumentURI");
+ }
+
+ public void setStrictErrorChecking(boolean strictErrorChecking)
+ {
+ throw new NotImplementedException("setStrictErrorChecking");
+ }
+
+ public void setXmlStandalone(boolean xmlStandalone) throws DOMException
+ {
+ throw new NotImplementedException("setXmlStandalone");
+ }
+
+ public void setXmlVersion(String xmlVersion) throws DOMException
+ {
+ throw new NotImplementedException("setXmlVersion");
+ }
+
+ public short compareDocumentPosition(Node other) throws DOMException
+ {
+ throw new NotImplementedException("compareDocumentPosition");
+ }
+
+ public String getBaseURI()
+ {
+ throw new NotImplementedException("getBaseURI");
+ }
+
+ public Object getFeature(String feature, String version)
+ {
+ throw new NotImplementedException("getFeature");
+ }
+
+ public String getTextContent() throws DOMException
+ {
+ throw new NotImplementedException("getTextContent");
+ }
+
+ public Object getUserData(String key)
+ {
+ throw new NotImplementedException("getUserData");
+ }
+
+ public boolean isDefaultNamespace(String namespaceURI)
+ {
+ throw new NotImplementedException("isDefaultNamespace");
+ }
+
+ public boolean isEqualNode(Node arg)
+ {
+ throw new NotImplementedException("isEqualNode");
+ }
+
+ public boolean isSameNode(Node other)
+ {
+ throw new NotImplementedException("isSameNode");
+ }
+
+ public String lookupNamespaceURI(String prefix)
+ {
+ throw new NotImplementedException("lookupNamespaceURI");
+ }
+
+ public String lookupPrefix(String namespaceURI)
+ {
+ throw new NotImplementedException("lookupPrefix");
+ }
+
+ public void setTextContent(String textContent) throws DOMException
+ {
+ throw new NotImplementedException("setTextContent");
+ }
+
+ public Object setUserData(String key, Object data, UserDataHandler handler)
+ {
+ throw new NotImplementedException("setUserData");
+ }
+}
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/TextImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/TextImpl.java)
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/TextImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/TextImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,327 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, 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.soap;
+
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Text;
+
+/**
+ * A representation of a node whose value is text. A Text
+ * object may represent text that is content or text that is a comment.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class TextImpl extends NodeImpl implements javax.xml.soap.Text
+{
+
+ public TextImpl(org.w3c.dom.Node node)
+ {
+ super(node);
+ }
+
+ /** Retrieves whether this object represents a comment.
+ */
+ public boolean isComment()
+ {
+ String value = getNodeValue().trim();
+ return value.startsWith("<!--") &&
value.endsWith("-->");
+ }
+
+ public String getValue()
+ {
+ return getNodeValue();
+ }
+
+ public void setValue(String value)
+ {
+ setNodeValue(value);
+ }
+
+ /**
+ * Breaks this node into two nodes at the specified <code>offset</code>,
keeping both in the tree as siblings.
+ * <p/>
+ * After being split, this node will contain all the content up to the
<code>offset</code> point. A
+ * new node of the same type, which contains all the content at and after the
<code>offset</code> point, is returned.
+ * If the original node had a parent node, the new node is inserted as the next
sibling of the original node.
+ * When the <code>offset</code> is equal to the length of this node, the
new node has no data.
+ *
+ * @param offset The 16-bit unit offset at which to split, starting from
<code>0</code>.
+ * @return The new node, of the same type as this node.
+ * @throws org.w3c.dom.DOMException INDEX_SIZE_ERR: Raised if the specified offset is
negative or greater
+ * than the number of 16-bit units in
<code>data</code>.
+ * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is
readonly.
+ */
+ public Text splitText(int offset) throws DOMException
+ {
+
+ if (offset < 0 || offset > getNodeValue().length())
+ throw new IllegalArgumentException("Invalid offset [" + offset +
"] for '" + getNodeValue() + "'");
+
+ String before = getNodeValue().substring(0, offset + 1);
+ setNodeValue(before);
+
+ String after = getNodeValue().substring(offset + 1);
+ TextImpl txtNode = new TextImpl(domNode.getOwnerDocument().createTextNode(after));
+
+ org.w3c.dom.Node parent = getParentNode();
+ if (parent != null)
+ {
+ org.w3c.dom.Node sibling = getNextSibling();
+ if (sibling == null)
+ parent.appendChild(txtNode);
+ else
+ parent.insertBefore(txtNode, sibling);
+ }
+
+ return txtNode;
+ }
+
+ // org.w3c.dom.CharacterData
***************************************************************************************
+
+ /**
+ * The number of 16-bit units that are available through
<code>data</code>
+ * and the <code>substringData</code> method below. This may have the
+ * value zero, i.e., <code>CharacterData</code> nodes may be empty.
+ */
+ public int getLength()
+ {
+ return getNodeValue().length();
+ }
+
+ /**
+ * Remove a range of 16-bit units from the node. Upon success,
+ * <code>data</code> and <code>length</code> reflect the
change.
+ *
+ * @param offset The offset from which to start removing.
+ * @param count The number of 16-bit units to delete. If the sum of
+ * <code>offset</code> and <code>count</code>
exceeds
+ * <code>length</code> then all 16-bit units from
<code>offset</code>
+ * to the end of the data are deleted.
+ * @throws org.w3c.dom.DOMException INDEX_SIZE_ERR: Raised if the specified
<code>offset</code> is
+ * negative or greater than the number of 16-bit
units in
+ * <code>data</code>, or if the specified
<code>count</code> is
+ * negative.
+ * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if
this node is readonly.
+ */
+ public void deleteData(int offset, int count) throws DOMException
+ {
+ String value = getNodeValue().substring(0, offset + 1);
+ setNodeValue(value);
+ }
+
+ /**
+ * The character data of the node that implements this interface. The DOM
+ * implementation may not put arbitrary limits on the amount of data
+ * that may be stored in a <code>CharacterData</code> node. However,
+ * implementation limits may mean that the entirety of a node's data may
+ * not fit into a single <code>DOMString</code>. In such cases, the user
+ * may call <code>substringData</code> to retrieve the data in
+ * appropriately sized pieces.
+ *
+ * @throws org.w3c.dom.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the node
is readonly.
+ * @throws org.w3c.dom.DOMException DOMSTRING_SIZE_ERR: Raised when it would return
more characters than
+ * fit in a <code>DOMString</code>
variable on the implementation
+ * platform.
+ */
+ public String getData() throws DOMException
+ {
+ return getNodeValue();
+ }
+
+ /**
+ * Extracts a range of data from the node.
+ *
+ * @param offset Start offset of substring to extract.
+ * @param count The number of 16-bit units to extract.
+ * @return The specified substring. If the sum of <code>offset</code> and
+ * <code>count</code> exceeds the <code>length</code>,
then all 16-bit
+ * units to the end of the data are returned.
+ * @throws org.w3c.dom.DOMException INDEX_SIZE_ERR: Raised if the specified
<code>offset</code> is
+ * negative or greater than the number of 16-bit
units in
+ * <code>data</code>, or if the specified
<code>count</code> is
+ * negative.
+ * <br>DOMSTRING_SIZE_ERR: Raised if the
specified range of text does
+ * not fit into a
<code>DOMString</code>.
+ */
+ public String substringData(int offset, int count) throws DOMException
+ {
+ return getNodeValue().substring(offset, offset + count);
+ }
+
+ /**
+ * Replace the characters starting at the specified 16-bit unit offset
+ * with the specified string.
+ *
+ * @param offset The offset from which to start replacing.
+ * @param count The number of 16-bit units to replace. If the sum of
+ * <code>offset</code> and <code>count</code>
exceeds
+ * <code>length</code>, then all 16-bit units to the end of
the data
+ * are replaced; (i.e., the effect is the same as a
<code>remove</code>
+ * method call with the same range, followed by an
<code>append</code>
+ * method invocation).
+ * @param arg The <code>DOMString</code> with which the range must be
+ * replaced.
+ * @throws org.w3c.dom.DOMException INDEX_SIZE_ERR: Raised if the specified
<code>offset</code> is
+ * negative or greater than the number of 16-bit
units in
+ * <code>data</code>, or if the specified
<code>count</code> is
+ * negative.
+ * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if
this node is readonly.
+ */
+ public void replaceData(int offset, int count, String arg) throws DOMException
+ {
+ StringBuilder buffer = new StringBuilder(getNodeValue());
+ buffer.replace(offset, offset + count, arg);
+ setNodeValue(buffer.toString());
+ }
+
+ /**
+ * Insert a string at the specified 16-bit unit offset.
+ *
+ * @param offset The character offset at which to insert.
+ * @param arg The <code>DOMString</code> to insert.
+ * @throws org.w3c.dom.DOMException INDEX_SIZE_ERR: Raised if the specified
<code>offset</code> is
+ * negative or greater than the number of 16-bit
units in
+ * <code>data</code>.
+ * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if
this node is readonly.
+ */
+ public void insertData(int offset, String arg) throws DOMException
+ {
+ StringBuilder buffer = new StringBuilder(getNodeValue());
+ buffer.insert(offset, arg);
+ setNodeValue(buffer.toString());
+ }
+
+ /**
+ * Append the string to the end of the character data of the node. Upon
+ * success, <code>data</code> provides access to the concatenation of
+ * <code>data</code> and the <code>DOMString</code>
specified.
+ *
+ * @param arg The <code>DOMString</code> to append.
+ * @throws org.w3c.dom.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised if this node
is readonly.
+ */
+ public void appendData(String arg) throws DOMException
+ {
+ setNodeValue(getNodeValue() + arg);
+ }
+
+ /**
+ * The character data of the node that implements this interface. The DOM
+ * implementation may not put arbitrary limits on the amount of data
+ * that may be stored in a <code>CharacterData</code> node. However,
+ * implementation limits may mean that the entirety of a node's data may
+ * not fit into a single <code>DOMString</code>. In such cases, the user
+ * may call <code>substringData</code> to retrieve the data in
+ * appropriately sized pieces.
+ *
+ * @throws org.w3c.dom.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the node
is readonly.
+ * @throws org.w3c.dom.DOMException DOMSTRING_SIZE_ERR: Raised when it would return
more characters than
+ * fit in a <code>DOMString</code>
variable on the implementation
+ * platform.
+ */
+ public void setData(String data) throws DOMException
+ {
+ setNodeValue(data);
+ }
+
+ // Stubbed out org.w3c.dom.Text methods **************************
+
+ /**
+ * TODO - complete the implementation
+ *
+ * Returns whether this text node contains <a
href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.cha...
+ * element content whitespace</a>, often abusively called "ignorable
whitespace". The text node is
+ * determined to contain whitespace in element content during the load
+ * of the document or if validation occurs while using
+ * <code>Document.normalizeDocument()</code>.
+ * @since DOM Level 3
+ */
+ public boolean isElementContentWhitespace()
+ {
+ return false;
+ }
+
+ /**
+ * TODO - complete the implementation
+ *
+ * Returns all text of <code>Text</code> nodes logically-adjacent text
+ * nodes to this node, concatenated in document order.
+ * <br>For instance, in the example below <code>wholeText</code> on
the
+ * <code>Text</code> node that contains "bar" returns
"barfoo", while on
+ * the <code>Text</code> node that contains "foo" it returns
"barfoo".
+ * @since DOM Level 3
+ */
+ public String getWholeText()
+ {
+ return null;
+ }
+
+ /**
+ * TODO - complete the implementation
+ *
+ * Replaces the text of the current node and all logically-adjacent text
+ * nodes with the specified text. All logically-adjacent text nodes are
+ * removed including the current node unless it was the recipient of the
+ * replacement text.
+ * <br>This method returns the node which received the replacement text.
+ * The returned node is:
+ * <ul>
+ * <li><code>null</code>, when the replacement text is
+ * the empty string;
+ * </li>
+ * <li>the current node, except when the current node is
+ * read-only;
+ * </li>
+ * <li> a new <code>Text</code> node of the same type (
+ * <code>Text</code> or <code>CDATASection</code>) as the
current node
+ * inserted at the location of the replacement.
+ * </li>
+ * </ul>
+ * <br>For instance, in the above example calling
+ * <code>replaceWholeText</code> on the <code>Text</code> node
that
+ * contains "bar" with "yo" in argument results in the following:
+ * <br>Where the nodes to be removed are read-only descendants of an
+ * <code>EntityReference</code>, the
<code>EntityReference</code> must
+ * be removed instead of the read-only nodes. If any
+ * <code>EntityReference</code> to be removed has descendants that are
+ * not <code>EntityReference</code>, <code>Text</code>, or
+ * <code>CDATASection</code> nodes, the
<code>replaceWholeText</code>
+ * method must fail before performing any modification of the document,
+ * raising a <code>DOMException</code> with the code
+ * <code>NO_MODIFICATION_ALLOWED_ERR</code>.
+ * <br>For instance, in the example below calling
+ * <code>replaceWholeText</code> on the <code>Text</code> node
that
+ * contains "bar" fails, because the
<code>EntityReference</code> node
+ * "ent" contains an <code>Element</code> node which cannot be
removed.
+ * @param content The content of the replacing <code>Text</code> node.
+ * @return The <code>Text</code> node created with the specified content.
+ * @exception org.w3c.dom.DOMException
+ * NO_MODIFICATION_ALLOWED_ERR: Raised if one of the <code>Text</code>
+ * nodes being replaced is readonly.
+ * @since DOM Level 3
+ */
+ public Text replaceWholeText(String content)
+ throws DOMException
+ {
+ return null;
+ }
+
+}
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment
(from rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/AttachmentPartImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
import java.io.IOException;
import java.io.InputStream;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/BoundaryDelimitedInputStream.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/BoundaryDelimitedInputStream.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
import java.io.FilterInputStream;
import java.io.IOException;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,10 +19,10 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
-import org.jboss.ws.utils.MimeUtils;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.core.utils.IOUtils;
+import org.jboss.ws.core.utils.MimeUtils;
import javax.activation.ActivationDataFlavor;
import javax.activation.DataContentHandler;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/CIDGenerator.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
//$Id$
@@ -27,7 +27,7 @@
import java.net.URLEncoder;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.UUIDGenerator;
+import org.jboss.ws.core.utils.UUIDGenerator;
/**
* A common CID generator
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/ContentHandlerRegistry.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
import java.awt.datatransfer.DataFlavor;
import java.util.HashSet;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/ImageDataContentHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/ImageDataContentHandler.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/ImageDataContentHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
import java.awt.Component;
import java.awt.Graphics2D;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MimeConstants.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/MimeConstants.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MimeConstants.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
/**
* Generic mime related constants.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/MultipartRelatedDecoder.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/MultipartRelatedEncoder.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
//$Id$
@@ -35,7 +35,7 @@
import javax.xml.soap.MimeHeader;
import javax.xml.soap.SOAPException;
-import org.jboss.ws.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
/**
* MultipartRelatedEncoder encodes a SOAPMessage
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/MultipartRelatedSwAEncoder.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
import java.io.OutputStream;
@@ -30,9 +30,9 @@
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPElementWriter;
-import org.jboss.ws.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPElementWriter;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
/**
* MultipartRelatedEncoder encodes a SOAPMessage
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedXOPEncoder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/MultipartRelatedXOPEncoder.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedXOPEncoder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
import java.io.OutputStream;
@@ -30,9 +30,9 @@
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPElementWriter;
-import org.jboss.ws.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPElementWriter;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
/**
* <code>MultipartRelatedEncoder</code> encodes a
<code>SOAPMessage</code>
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/RawByteArrayOutputStream.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/RawByteArrayOutputStream.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/RawByteArrayOutputStream.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
import java.io.ByteArrayOutputStream;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/SimpleBoyerMoore.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/SimpleBoyerMoore.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/SimpleBoyerMoore.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
/**
* <code>SimpleBoyerMoore</code> is an implementation of the simplified
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/SwapableMemoryDataSource.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/SwapableMemoryDataSource.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/SwapableMemoryDataSource.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
import java.io.ByteArrayInputStream;
import java.io.File;
@@ -33,8 +33,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfigFactory;
/**
* A datasource which offloads large attachments to disk.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/XmlDataContentHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/XmlDataContentHandler.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/soap/attachment/XmlDataContentHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.soap.attachment;
+package org.jboss.ws.core.soap.attachment;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
@@ -32,7 +32,7 @@
import javax.activation.DataSource;
import javax.xml.transform.stream.StreamSource;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.core.utils.IOUtils;
/**
* <code>XmlDataContentHandler</code> is a JAF content handler that provides
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils (from rev
1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/DOMUtils.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/DOMUtils.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/DOMUtils.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/DOMWriter.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/DOMWriter.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/DOMWriter.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -53,7 +53,7 @@
* information on the Apache Software Foundation, please see
* <
http://www.apache.org/>.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/HolderUtils.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/HolderUtils.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/HolderUtils.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -53,7 +53,7 @@
* <
http://www.apache.org/>.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
import java.lang.reflect.Field;
import java.math.BigDecimal;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/IOUtils.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/IOUtils.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/IOUtils.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
import java.io.*;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/JBossWSEntityResolver.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/JavaUtils.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/JavaUtils.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/JavaUtils.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/MimeUtils.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/ObjectNameFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/ObjectNameFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/ObjectNameFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
import java.util.Hashtable;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/ThreadLocalAssociation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,14 +19,14 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
// $Id$
import java.util.Stack;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.wsse.SecurityStore;
+import org.jboss.ws.extensions.security.SecurityStore;
/**
* Maintain thread locals at a single point.
@@ -44,12 +44,12 @@
/**
* SOAP message context
- * @see org.jboss.ws.soap.MessageContextAssociation
+ * @see org.jboss.ws.core.soap.MessageContextAssociation
*/
private static ThreadLocal<Stack<CommonMessageContext>> msgContextAssoc =
new ThreadLocal<Stack<CommonMessageContext>>();
/**
- * @see org.jboss.ws.wsse.STRTransform
+ * @see org.jboss.ws.extensions.security.STRTransform
*/
private static ThreadLocal<SecurityStore> strTransformAssoc = new
ThreadLocal<SecurityStore>();
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/UUIDGenerator.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/UUIDGenerator.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/UUIDGenerator.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
import java.security.SecureRandom;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/XMLPredefinedEntityReferenceResolver.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/utils/XMLPredefinedEntityReferenceResolver.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/core/utils/XMLPredefinedEntityReferenceResolver.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.utils;
+package org.jboss.ws.core.utils;
import java.util.HashMap;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/AnnotationsMetaDataBuilder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/AnnotationsMetaDataBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/AnnotationsMetaDataBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -33,6 +33,9 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfigFactory;
+import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.ServerEndpointMetaData;
import org.jboss.ws.metadata.ServiceMetaData;
@@ -40,10 +43,7 @@
import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
import org.jboss.ws.tools.JavaToWSDL;
-import org.jboss.ws.utils.IOUtils;
/** An abstract annotation meta data builder.
*
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -37,11 +37,13 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-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.Use;
+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.Use;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.extensions.xop.XOPScanner;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ParameterMetaData;
@@ -70,8 +72,6 @@
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.utils.JavaUtils;
-import org.jboss.ws.xop.XOPScanner;
/**
* A meta data builder that is based on webservices.xml.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -55,13 +55,15 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+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.Use;
+import org.jboss.ws.core.utils.HolderUtils;
+import org.jboss.ws.core.utils.JBossWSEntityResolver;
+import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.FaultMetaData;
import org.jboss.ws.metadata.OperationMetaData;
@@ -83,8 +85,6 @@
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.tools.ToolsUtils;
-import org.jboss.ws.utils.HolderUtils;
-import org.jboss.ws.utils.JBossWSEntityResolver;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/MetaDataBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -47,14 +47,17 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.common.CommonSOAPBinding;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.deployment.EventingEndpoint;
-import org.jboss.ws.eventing.metadata.EventingEpMetaExt;
-import org.jboss.ws.jaxrpc.UnqualifiedFaultException;
-import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.core.jaxrpc.UnqualifiedFaultException;
+import org.jboss.ws.core.jaxrpc.Use;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.deployment.EventingEndpoint;
+import org.jboss.ws.extensions.eventing.metadata.EventingEpMetaExt;
import org.jboss.ws.metadata.ClientEndpointMetaData;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.FaultMetaData;
@@ -80,9 +83,6 @@
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
-import org.jboss.ws.server.ServiceEndpointManager;
-import org.jboss.ws.server.ServiceEndpointManagerFactory;
-import org.jboss.ws.utils.ObjectNameFactory;
import org.w3c.dom.Element;
/** An abstract meta data builder.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/ServiceEndpointDeployer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,13 +28,13 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.WSDLFilePublisher;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.ServerEndpointMetaData;
import org.jboss.ws.metadata.ServiceMetaData;
import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.server.ServiceEndpointInfo;
-import org.jboss.ws.server.ServiceEndpointManager;
-import org.jboss.ws.server.WSDLFilePublisher;
/**
* The deployer for web service endpoints
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/ServiceEndpointPublisher.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/ServiceEndpointPublisher.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/deployment/ServiceEndpointPublisher.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,8 +32,8 @@
import java.util.Set;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.WSException;
import org.w3c.dom.Element;
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpoint.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpoint.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpoint.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,45 +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.eventing;
-
-// $Id$
-
-import org.jboss.ws.eventing.element.SubscribeRequest;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.eventing.element.SubscriptionEndRequest;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-/**
- * Event source endpoint interface.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 24-Nov-2005
- */
-public interface EventSourceEndpoint extends Remote
-{
-
- SubscribeResponse subscribe(SubscribeRequest subscribeRequest) throws
RemoteException;
-
- SubscriptionEndRequest subscriptionEnd() throws RemoteException;
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpointImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpointImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,108 +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.eventing;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.SubscribeRequest;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.eventing.element.SubscriptionEndRequest;
-import org.jboss.ws.eventing.mgmt.Filter;
-import org.jboss.ws.eventing.mgmt.SubscriptionError;
-import org.jboss.ws.eventing.mgmt.SubscriptionManagerMBean;
-import org.jboss.ws.eventing.mgmt.SubscriptionTicket;
-
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.addressing.AttributedURI;
-import java.rmi.RemoteException;
-
-/**
- * Event source endpoint implementation.<br>
- * Delegates to {@link org.jboss.ws.eventing.mgmt.SubscriptionManager}
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 25-Nov-2005
- */
-public class EventSourceEndpointImpl extends EventingEndpointBase
- implements EventSourceEndpoint
-{
- private static Logger log = Logger.getLogger(EventSourceEndpointImpl.class);
-
- public SubscribeResponse subscribe(SubscribeRequest request) throws RemoteException
- {
- try
- {
- // retrieve addressing headers
- AddressingProperties inProps = getAddrProperties();
- AttributedURI eventSourceURI = inProps.getTo();
- log.debug("Subscribe request for event source: " +
eventSourceURI.getURI());
-
- assertSubscriberEndpoints(request);
- EndpointReference notifyTo = request.getDelivery().getNotifyTo();
- EndpointReference endTo = request.getEndTo();
-
- // adapt filter elements
- Filter filter = null;
- if (request.getFilter() != null)
- {
- filter = new Filter(request.getFilter().getDialect(),
request.getFilter().get_value());
- }
-
- // invoke subscription manager
- SubscriptionManagerMBean subscriptionManager = getSubscriptionManager();
- SubscriptionTicket ticket =
subscriptionManager.subscribe(eventSourceURI.getURI(), notifyTo, endTo,
request.getExpires(), filter);
-
- // create the response element
- SubscribeResponse res = new SubscribeResponse();
- res.setExpires(ticket.getExpires());
- res.setSubscriptionManager(ticket.getSubscriptionManager());
-
- return res;
-
- }
- catch (SubscriptionError e)
- {
- throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
- }
- }
-
- public SubscriptionEndRequest subscriptionEnd() throws RemoteException
- {
- return new SubscriptionEndRequest();
- }
-
- /**
- * Ensure that the subscriber endpoint information is supplied in request.
- * Namely NotifyTo and EndTo need to be set.
- * @param request
- */
- private void assertSubscriberEndpoints(SubscribeRequest request) {
- if(null == request.getDelivery().getNotifyTo() || null == request.getEndTo() )
- throw new SOAPFaultException(
buildFaultQName(EventingConstants.CODE_INVALID_MESSAGE) ,
- "Subcriber endpoint information missing from request",
- null, null
- );
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingConstants.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingConstants.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingConstants.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,161 +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.eventing;
-
-// $Id$
-
-import org.jboss.ws.WSException;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.xml.ws.addressing.AddressingBuilder;
-import javax.xml.ws.addressing.AddressingConstants;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 19-Dec-2005
- */
-public class EventingConstants
-{
- private static AddressingBuilder WSA_BUILDER =
AddressingBuilder.getAddressingBuilder();
- private static AddressingConstants WSA_CONSTANTS =
WSA_BUILDER.newAddressingConstants();
-
- // common namespaces
-
- public final static String NS_EVENTING =
"http://schemas.xmlsoap.org/ws/2004/08/eventing";
- public final static String PREFIX_EVENTING = "wse";
- public final static String NS_ADDRESSING = WSA_CONSTANTS.getNamespaceURI();
-
- // request /response action from specification
-
- public final static String SUBSCRIBE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe";
- public final static String SUBSCRIBE_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse";
- public final static String UNSUBSCRIBE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe";
- public final static String UNSUBSCRIBE_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse";
- public final static String GET_STATUS_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus";
- public final static String GET_STATUS_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse";
- public final static String RENEW_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew";
- public final static String RENEW_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse";
- public final static String SUBSCRIPTION_END_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd";
-
- public final static String WSA_FAULT_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/addressing/fault";
- public final static String WSA_ANONYMOUS_URI = WSA_CONSTANTS.getAnonymousURI();
-
- // failures
-
- public final static String DELIVERY_FAILURE =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryFailure";
- public final static String SOURCE_SHUTTING_DOWN =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SourceShuttingDown";
- public final static String SOURCE_CANCELING =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SourceCanceling";
-
- public final static String CODE_UNABLE_TO_PROCESS =
"EventSourceUnableToProcess";
- public final static String CODE_FILTER_NOT_SUPPORTED =
"FilteringNotSupported";
- public final static String CODE_REQUESTED_FILTER_UNAVAILABLE =
"FilteringRequestedUnavailable";
- public final static String CODE_INVALID_EXPIRATION_TIME =
"InvalidExpirationTime";
- public final static String CODE_UNABLE_TO_RENEW = "UnableToRenew";
- public final static String CODE_INVALID_MESSAGE = "InvalidMessage";
-
- // default config
-
- public final static String DISPATCHER_JNDI_NAME = "EventDispatcher";
-
- private static URI DELIVERY_PUSH_URI = null;
- private static URI DIALECT_XPATH_URI = null;
-
- private static URI SUBSCRIBE_ACTION_URI = null;
-
- public final static URI buildURI(String uri)
- {
- try
- {
- return new URI(uri);
- }
- catch (URISyntaxException e)
- {
- throw new IllegalArgumentException(e.getMessage());
- }
- }
-
- public static final URI getDefaultFilterDialect()
- {
- try
- {
- return new
URI("http://www.w3.org/TR/1999/REC-xpath-19991116");
- }
- catch (URISyntaxException e)
- {
- throw new WSException(e.getMessage());
- }
- }
-
- public static final URI getDeliveryPush()
- {
- if (null == DELIVERY_PUSH_URI)
- {
- try
- {
- DELIVERY_PUSH_URI = new
URI("http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Pu...;
- }
- catch (URISyntaxException e)
- {
- //
- }
- }
- return DELIVERY_PUSH_URI;
- }
-
- public static URI getDialectXPath()
- {
- if (null == DIALECT_XPATH_URI)
- {
- try
- {
- DIALECT_XPATH_URI = new
URI("http://www.w3.org/TR/1999/REC-xpath-19991116");
- }
- catch (URISyntaxException e)
- {
- //
- }
- }
-
- return DIALECT_XPATH_URI;
- }
-
- public static URI getSubscribeAction()
- {
- if (null == SUBSCRIBE_ACTION_URI)
- {
- try
- {
- SUBSCRIBE_ACTION_URI = new URI(SUBSCRIBE_ACTION);
- }
- catch (URISyntaxException e)
- {
- //
- }
- }
-
- return SUBSCRIBE_ACTION_URI;
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingEndpointBase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingEndpointBase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingEndpointBase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,99 +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.eventing;
-
-
-// $Id$
-
-import java.net.URI;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.ws.addressing.AddressingBuilder;
-import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.addressing.JAXWSAConstants;
-
-import org.jboss.ws.Constants;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.eventing.mgmt.SubscriptionManagerFactory;
-import org.jboss.ws.eventing.mgmt.SubscriptionManagerMBean;
-import org.jboss.ws.soap.MessageContextAssociation;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 13-Jan-2006
- */
-public abstract class EventingEndpointBase
-{
-
- private AddressingBuilder addrBuilder;
-
- /**
- * Retrieve the addressing properties associated with the request
- * and verify them.
- */
- protected static AddressingProperties getAddrProperties()
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- AddressingProperties inProps =
(AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
- assertAddrProperties(inProps);
- return inProps;
- }
-
- protected void setReplyAction(URI replyAction)
- {
-
- }
-
- /**
- * Access local subscription manager service.
- */
- protected SubscriptionManagerMBean getSubscriptionManager()
- {
- SubscriptionManagerFactory factory = SubscriptionManagerFactory.getInstance();
- SubscriptionManagerMBean subscriptionManager = factory.getSubscriptionManager();
- return subscriptionManager;
- }
-
- protected AddressingBuilder getAddrBuilder()
- {
- if (null == addrBuilder)
- addrBuilder = AddressingBuilder.getAddressingBuilder();
- return addrBuilder;
- }
-
- /**
- * Ensure that all required inbound properties are supplied in request.
- * @param inProps
- * @throws javax.xml.rpc.soap.SOAPFaultException
- */
- protected static void assertAddrProperties(AddressingProperties inProps) throws
SOAPFaultException
- {
- if (null == inProps)
- throw new SOAPFaultException(Constants.SOAP11_FAULT_CODE_CLIENT,
"Addressing headers missing from request", "wse:InvalidMessage",
null);
- }
-
- public QName buildFaultQName(String elementName)
- {
- return new QName(EventingConstants.NS_EVENTING, elementName,
EventingConstants.PREFIX_EVENTING);
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingService.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingService.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingService.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.eventing;
-
-// $Id$
-
-import javax.xml.rpc.Service;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 24-Nov-2005
- */
-public interface EventingService extends Service
-{
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpoint.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpoint.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpoint.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,45 +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.eventing;
-
-// $Id$
-
-import org.jboss.ws.eventing.element.*;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-/**
- * Subscription manager endpoint interface.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 16-Dec-2005
- */
-public interface SubscriptionManagerEndpoint extends Remote
-{
-
- StatusResponse getStatus(StatusRequest request) throws RemoteException;
-
- RenewResponse renew(RenewRequest request) throws RemoteException;
-
- void unsubscribe(UnsubscribeRequest request) throws RemoteException;
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpointImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpointImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.eventing;
-
-// $Id$
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.rmi.RemoteException;
-import java.util.Date;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.addressing.JAXWSAConstants;
-import javax.xml.ws.addressing.ReferenceParameters;
-
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.Constants;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.eventing.element.RenewRequest;
-import org.jboss.ws.eventing.element.RenewResponse;
-import org.jboss.ws.eventing.element.StatusRequest;
-import org.jboss.ws.eventing.element.StatusResponse;
-import org.jboss.ws.eventing.element.UnsubscribeRequest;
-import org.jboss.ws.eventing.mgmt.SubscriptionError;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.w3c.dom.Element;
-
-/**
- * SubscriptionManager endpoint implementation.<br>
- * Delegates to {@link org.jboss.ws.eventing.mgmt.SubscriptionManager}
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 16-Dec-2005
- */
-public class SubscriptionManagerEndpointImpl extends EventingEndpointBase
- implements SubscriptionManagerEndpoint
-{
-
- public static final QName IDQN = new
QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Identifier",
"ns1");
-
- /**
- * Get the status of a subscription.
- *
- * @param request
- * @return response including the lease time.
- * @throws RemoteException
- */
- public StatusResponse getStatus(StatusRequest request) throws RemoteException
- {
- URI identifier = retrieveSubscriptionId();
-
- try
- {
- Date leaseTime = getSubscriptionManager().getStatus(identifier);
- StatusResponse response = new StatusResponse();
- response.setExpires(leaseTime);
-
- return response;
- }
- catch (SubscriptionError e)
- {
- throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
- }
- }
-
- /**
- * Update the expiration for a subscription.
- *
- * @param request
- * @return response inclduing the new lease time.
- * @throws RemoteException
- */
- public RenewResponse renew(RenewRequest request) throws RemoteException
- {
-
setReplyAction(EventingConstants.buildURI(EventingConstants.RENEW_RESPONSE_ACTION));
- URI identifier = retrieveSubscriptionId();
-
- try
- {
- Date newLeaseTime = getSubscriptionManager().renew(identifier,
request.getExpires());
- RenewResponse response = new RenewResponse();
- response.setExpires(newLeaseTime);
-
- return response;
- }
- catch (SubscriptionError e)
- {
- throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
- }
-
- }
-
- /**
- * Explicitly delete a subscription.
- *
- * @param request
- * @throws RemoteException
- */
- public void unsubscribe(UnsubscribeRequest request) throws RemoteException
- {
-
setReplyAction(EventingConstants.buildURI(EventingConstants.UNSUBSCRIBE_RESPONSE_ACTION));
- URI identifier = retrieveSubscriptionId();
-
- try
- {
- getSubscriptionManager().unsubscribe(identifier);
- }
- catch (SubscriptionError e)
- {
- throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
- }
-
- }
-
- private URI retrieveSubscriptionId()
- {
- URI subscriptionId = null;
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- AddressingProperties addrProps =
(AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-
- if (null == addrProps)
- {
- throw new SOAPFaultException(
- Constants.SOAP11_FAULT_CODE_CLIENT,
- "The message is not valid and cannot be processed:" +
- "Cannot obtain addressing properties.",
- null, null
- );
- }
-
- ReferenceParameters refParams = addrProps.getReferenceParameters();
- if (refParams != null)
- {
- for (Object obj : refParams.getElements())
- {
- if (obj instanceof Element)
- {
- Element el = (Element)obj;
- QName qname = DOMUtils.getElementQName(el);
- if (qname.equals(IDQN))
- {
- try
- {
- subscriptionId = new URI(DOMUtils.getTextContent(el));
- break;
- }
- catch (URISyntaxException e)
- {
- throw new SOAPFaultException(
- Constants.SOAP11_FAULT_CODE_CLIENT,
- "The message is not valid and cannot be processed:"
+
- "Invalid subscription id.",
- null, null
- );
- }
- }
- }
- }
- }
-
- if (null == subscriptionId)
- {
- throw new SOAPFaultException(
- buildFaultQName(EventingConstants.CODE_INVALID_MESSAGE),
- "The message is not valid and cannot be processed."
- + "Cannot obtain subscription id.",
- null, null
- );
- }
-
- return subscriptionId;
- }
-}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingBuilderImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AddressingBuilderImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AddressingBuilderImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingBuilderImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.addressing;
+
+//$Id$
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedQName;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.addressing.Relationship;
+
+/**
+ * Factory for <code>AddressingElements</code>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AddressingBuilderImpl extends AddressingBuilder
+{
+ public AttributedURI newURI(URI uri)
+ {
+ return new AttributedURIImpl(uri);
+ }
+
+ public AttributedURI newURI(String uri) throws URISyntaxException
+ {
+ return newURI(new URI(uri));
+ }
+
+ public AttributedQName newQName(QName name)
+ {
+ return new AttributedQNameImpl(name);
+ }
+
+ public Relationship newRelationship(URI uri)
+ {
+ return new RelationshipImpl(uri);
+ }
+
+ public EndpointReference newEndpointReference(URI uri)
+ {
+ return new EndpointReferenceImpl(uri);
+ }
+
+ public AddressingProperties newAddressingProperties()
+ {
+ return new AddressingPropertiesImpl();
+ }
+
+ public AddressingConstants newAddressingConstants()
+ {
+ return new AddressingConstantsImpl();
+ }
+
+ public String getNamespaceURI()
+ {
+ return new AddressingTypeImpl().getNamespaceURI();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingClientUtil.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AddressingClientUtil.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AddressingClientUtil.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingClientUtil.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,121 @@
+package org.jboss.ws.extensions.addressing;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.xml.rpc.Stub;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+
+import org.jboss.ws.core.utils.UUIDGenerator;
+
+/**
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 04-Mar-2006
+ */
+public class AddressingClientUtil
+{
+ private static AddressingBuilder BUILDER;
+ private static AddressingConstants CONSTANTS;
+ static
+ {
+ BUILDER = AddressingBuilder.getAddressingBuilder();
+ CONSTANTS = BUILDER.newAddressingConstants();
+ }
+
+ /* creates outbound addressing properties */
+ public static AddressingProperties createRequestProperties()
+ {
+ AddressingProperties addrProps = BUILDER.newAddressingProperties();
+ return addrProps;
+ }
+
+ /**
+ * create default outbound addressing properties.
+ */
+ public static AddressingProperties createDefaultProps(String wsaAction, String wsaTo)
+ {
+ try
+ {
+ AddressingProperties addrProps = createRequestProperties();
+ addrProps.setAction(BUILDER.newURI(wsaAction));
+ addrProps.setTo(BUILDER.newURI(wsaTo));
+ return addrProps;
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ /**
+ * create anonymous request properties.
+ * wsa:ReplyTo is set to anonymous and a messageID is supplied.
+ */
+ public static AddressingProperties createAnonymousProps(String wsaAction, String
wsaTo)
+ {
+ try
+ {
+ AddressingProperties addrProps = createDefaultProps(wsaAction, wsaTo);
+ addrProps.setMessageID(BUILDER.newURI(generateMessageID()));
+ addrProps.setReplyTo(BUILDER.newEndpointReference(new
URI(CONSTANTS.getAnonymousURI())));
+ return addrProps;
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ /**
+ * one-way properties cary a wsa:ReplyTo of none
+ * upon which no response is expected.
+ */
+ public static AddressingProperties createOneWayProps(String wsaAction, String wsaTo)
+ {
+ try
+ {
+ AddressingProperties addrProps = createDefaultProps(wsaAction, wsaTo);
+ addrProps.setMessageID(BUILDER.newURI(generateMessageID()));
+ addrProps.setReplyTo(BUILDER.newEndpointReference(new
URI(CONSTANTS.getNoneURI())));
+ return addrProps;
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ /**
+ * customize a stubs endpooint url
+ */
+ public static void setTargetAddress(Stub stub, String url)
+ {
+ stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, url);
+ }
+
+ /**
+ * generate a UUID based message id.
+ */
+ public static URI generateMessageID() throws URISyntaxException
+ {
+ URI messageId = new URI("urn:uuid:" +
UUIDGenerator.generateRandomUUIDString());
+ return messageId;
+ }
+
+ public static AttributedURI createMessageID()
+ {
+ AttributedURI msgId = null;
+ try
+ {
+ msgId = BUILDER.newURI(generateMessageID());
+ }
+ catch (URISyntaxException e)
+ {
+ //
+ }
+ return msgId;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AddressingConstantsImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AddressingConstantsImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.addressing;
+
+//$Id$
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingConstants;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.Constants;
+
+/**
+ * Encapsulation for version-specific WS-Addressing constants.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AddressingConstantsImpl implements AddressingConstants
+{
+ static final String URI_ADDRESSING =
"http://www.w3.org/2005/08/addressing";
+ static final String PREFIX_ADDRESSING = "wsa";
+
+ public String getNamespaceURI()
+ {
+ return URI_ADDRESSING;
+ }
+
+ public String getNamespacePrefix()
+ {
+ return PREFIX_ADDRESSING;
+ }
+
+ public String getWSDLNamespaceURI()
+ {
+ return Constants.NS_WSDL11;
+ }
+
+ public String getWSDLNamespacePrefix()
+ {
+ return Constants.PREFIX_WSDL;
+ }
+
+ public QName getWSDLExtensibilityQName()
+ {
+ return null;
+ }
+
+ public QName getWSDLActionQName()
+ {
+ return new QName(URI_ADDRESSING, "Action", "wsa");
+ }
+
+ public String getAnonymousURI()
+ {
+ return "http://www.w3.org/2005/08/addressing/anonymous";
+ }
+
+ public String getNoneURI()
+ {
+ return "http://www.w3.org/2005/08/addressing/none";
+ }
+
+ public QName getFromQName()
+ {
+ return new QName(URI_ADDRESSING, "From", PREFIX_ADDRESSING);
+ }
+
+ public QName getToQName()
+ {
+ return new QName(URI_ADDRESSING, "To", PREFIX_ADDRESSING);
+ }
+
+ public QName getReplyToQName()
+ {
+ return new QName(URI_ADDRESSING, "ReplyTo", PREFIX_ADDRESSING);
+ }
+
+ public QName getFaultToQName()
+ {
+ return new QName(URI_ADDRESSING, "FaultTo", PREFIX_ADDRESSING);
+ }
+
+ public QName getActionQName()
+ {
+ return new QName(URI_ADDRESSING, "Action", PREFIX_ADDRESSING);
+ }
+
+ public QName getMessageIDQName()
+ {
+ return new QName(URI_ADDRESSING, "MessageID", PREFIX_ADDRESSING);
+ }
+
+ public QName getRelationshipReplyQName()
+ {
+ return new QName(URI_ADDRESSING, "Reply", PREFIX_ADDRESSING);
+ }
+
+ public QName getRelatesToQName()
+ {
+ return new QName(URI_ADDRESSING, "RelatesTo", PREFIX_ADDRESSING);
+ }
+
+ public String getRelationshipTypeName()
+ {
+ return "RelationshipType";
+ }
+
+ public QName getMetadataQName()
+ {
+ return new QName(URI_ADDRESSING, "Metadata", PREFIX_ADDRESSING);
+ }
+
+ public QName getAddressQName()
+ {
+ return new QName(URI_ADDRESSING, "Address", PREFIX_ADDRESSING);
+ }
+
+ public QName getReferenceParametersQName()
+ {
+ return new QName(URI_ADDRESSING, "ReferenceParameters",
PREFIX_ADDRESSING);
+ }
+
+ public String getPackageName()
+ {
+ return getClass().getPackage().getName();
+ }
+
+ public String getIsReferenceParameterName()
+ {
+ throw new NotImplementedException();
+ }
+
+ public QName getInvalidMapQName()
+ {
+ return new QName(URI_ADDRESSING, "InvalidMessageInformationHeader",
PREFIX_ADDRESSING);
+ }
+
+ public QName getMapRequiredQName()
+ {
+ return new QName(URI_ADDRESSING, "MessageInformationHeaderRequired",
PREFIX_ADDRESSING);
+ }
+
+ public QName getDestinationUnreachableQName()
+ {
+ return new QName(URI_ADDRESSING, "DestinationUnreachable",
PREFIX_ADDRESSING);
+ }
+
+ public QName getActioNotSupportedQName()
+ {
+ return new QName(URI_ADDRESSING, "ActionNotSupported",
PREFIX_ADDRESSING);
+ }
+
+ public QName getEndpointUnavailableQName()
+ {
+ return new QName(URI_ADDRESSING, "EndpointUnavailable",
PREFIX_ADDRESSING);
+ }
+
+ public String getDefaultFaultAction()
+ {
+ return "http://www.w3.org/2005/08/addressing/fault";
+ }
+
+ public String getActionNotSupportedText()
+ {
+ return "Action not supported";
+ }
+
+ public String getDestinationUnreachableText()
+ {
+ return "Destination unreachable";
+ }
+
+ public String getEndpointUnavailableText()
+ {
+ return "Endpoint unavailable";
+ }
+
+ public String getInvalidMapText()
+ {
+ return "Invalid Map";
+ }
+
+ public String getMapRequiredText()
+ {
+ return "Map Required";
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AddressingPropertiesImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AddressingPropertiesImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,277 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.addressing;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+import javax.xml.ws.addressing.*;
+
+import org.jboss.ws.core.soap.NameImpl;
+
+// $Id$
+
+/**
+ * Each instance is associated with a particular WS-Addressing schema whose
+ * namespace URI is returned by its <code>getAddressingVersion</code>
method.
+ *
+ * The namespace of each key in the underlying map must match this URI and the
+ * local names of all the keys must be exactly the names of the Message Addressing
Properties
+ * defined in that version of the WS-Addressing specification.
+ *
+ * Each value in the underlying type must be an instance of
<code>AddressingType</code> whose
+ * WS-Addressing version (determined by its
<code>getAddressingVersion</code>) method must
+ * match the WS-Addressing version associated with the
<code>AddressingProperties</code>.
+ *
+ * TODO: verify that AddressingPropertiesImpl can extend ElementExtensibleImpl.
+ * See
http://jira.jboss.com/jira/browse/JBWS-728
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AddressingPropertiesImpl extends ElementExtensibleImpl implements
AddressingProperties
+{
+ private static AddressingConstants ADDR = new AddressingConstantsImpl();
+
+ // A REQUIRED absolute URI representing the address of the intended receiver of this
message.
+ private AttributedURI to;
+ // A REQUIRED absolute URI that uniquely identifies the semantics implied by this
message.
+ private AttributedURI action;
+ // An OPTIONAL absolute URI that uniquely identifies the message.
+ private AttributedURI messageId;
+ // An OPTIONAL pair of values that indicate how this message relates to another
message.
+ private Relationship[] relatesTo;
+ // An OPTIONAL endpoint reference for the intended receiver for replies to this
message.
+ private EndpointReference replyTo;
+ // An OPTIONAL endpoint reference for the intended receiver for faults related to this
message.
+ private EndpointReference faultTo;
+ // An OPTIONAL reference to the endpoint from which the message originated.
+ private EndpointReference from;
+ // Corresponds to the value of the [reference parameters] property of the endpoint
reference to which the message is addressed.
+ private ReferenceParameters refParams = new ReferenceParametersImpl();
+
+ private Map<QName, AddressingType> addrTypes = new HashMap<QName,
AddressingType>();
+
+ public AttributedURI getTo()
+ {
+ return to;
+ }
+
+ public void setTo(AttributedURI to)
+ {
+ this.to = to;
+ }
+
+ public AttributedURI getAction()
+ {
+ return action;
+ }
+
+ public void setAction(AttributedURI action)
+ {
+ this.action = action;
+ }
+
+ public AttributedURI getMessageID()
+ {
+ return messageId;
+ }
+
+ public void setMessageID(AttributedURI iri)
+ {
+ this.messageId = iri;
+ }
+
+ public Relationship[] getRelatesTo()
+ {
+ return relatesTo;
+ }
+
+ public void setRelatesTo(Relationship[] relatesTo)
+ {
+ this.relatesTo = relatesTo;
+ }
+
+ public EndpointReference getReplyTo()
+ {
+ return replyTo;
+ }
+
+ public void setReplyTo(EndpointReference replyTo)
+ {
+ this.replyTo = replyTo;
+ }
+
+ public EndpointReference getFaultTo()
+ {
+ return faultTo;
+ }
+
+ public void setFaultTo(EndpointReference faultTo)
+ {
+ this.faultTo = faultTo;
+ }
+
+ public EndpointReference getFrom()
+ {
+ return from;
+ }
+
+ public void setFrom(EndpointReference from)
+ {
+ this.from = from;
+ }
+
+ public ReferenceParameters getReferenceParameters()
+ {
+ return refParams;
+ }
+
+ /**
+ * Initializes the properties as a destination using the given
+ * <code>EndpointReference</code>. The <bold>To</bold>
property is initialized
+ * using the <bold>Address</bold> property of the
<code>EndpointReference</code>
+ * and the <bold>ReferenceParameters</bold> property is initialized using
the
+ * <bold>ReferenceParameters</bold> property of the
<code>EndpointReference</code>.
+ *
+ * @param epr The <code>EndpointReference</code> representing the
destination.
+ */
+ public void initializeAsDestination(EndpointReference epr)
+ {
+ if (epr == null)
+ throw new IllegalArgumentException("Invalid null endpoint
reference");
+
+ this.to = epr.getAddress();
+
+ ReferenceParameters srcParams = epr.getReferenceParameters();
+ for (Object obj : srcParams.getElements())
+ {
+ SOAPElement soapElement = (SOAPElement)obj;
+ soapElement.setAttributeNS(getNamespaceURI(),
"wsa:IsReferenceParameter", "true");
+ addElement(soapElement);
+ }
+ }
+
+ /**
+ * Initialize this <code>AddressingProperties</code> as a reply to the
+ * given message. As described in the WS-Addressing Core specification.
+ * The <bold>ReplyTo</bold> property is using the
<bold>Address</bold>
+ * property of the source <code>AddressingProperties</code> and the
+ * <bold>ReferenceParameters</bold> property is initialized using the
+ * <bold>ReferenceParameters</bold> property of the source message.
+ *
+ * @param props The source <code>AddressingProperties</code>
+ * @param isFault <code>true</code> if the reply is a Fault message.
+ */
+ public void initializeAsReply(AddressingProperties props, boolean isFault)
+ {
+ EndpointReference epr = (isFault ? props.getFaultTo() : null);
+ if (epr == null)
+ {
+ epr = props.getReplyTo();
+ }
+ this.to = (epr != null ? epr.getAddress() : new
AttributedURIImpl(ADDR.getAnonymousURI()));
+
+ if (epr != null)
+ {
+ ReferenceParameters srcParams = epr.getReferenceParameters();
+ for (Object obj : srcParams.getElements())
+ {
+ SOAPElement soapElement = (SOAPElement)obj;
+ soapElement.setAttributeNS(getNamespaceURI(),
"wsa:IsReferenceParameter", "true");
+ addElement(soapElement);
+ }
+ }
+ if (props.getMessageID() != null)
+ {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ Relationship rel = builder.newRelationship(props.getMessageID().getURI());
+ this.relatesTo = new Relationship[] { rel };
+ }
+ }
+
+ // Map interface ****************************************************************
+
+ public int size()
+ {
+ return addrTypes.size();
+ }
+
+ public boolean isEmpty()
+ {
+ return addrTypes.isEmpty();
+ }
+
+ public boolean containsKey(Object arg0)
+ {
+ return addrTypes.containsKey(arg0);
+ }
+
+ public boolean containsValue(Object arg0)
+ {
+ return addrTypes.containsValue(arg0);
+ }
+
+ public AddressingType get(Object arg0)
+ {
+ return addrTypes.get(arg0);
+ }
+
+ public AddressingType put(QName arg0, AddressingType arg1)
+ {
+ return addrTypes.put(arg0, arg1);
+ }
+
+ public AddressingType remove(Object arg0)
+ {
+ return addrTypes.remove(arg0);
+ }
+
+ public void putAll(Map<? extends QName, ? extends AddressingType> arg0)
+ {
+ addrTypes.putAll(arg0);
+ }
+
+ public void clear()
+ {
+ addrTypes.clear();
+ }
+
+ public Set<QName> keySet()
+ {
+ return addrTypes.keySet();
+ }
+
+ public Collection<AddressingType> values()
+ {
+ return addrTypes.values();
+ }
+
+ public Set<Entry<QName, AddressingType>> entrySet()
+ {
+ return addrTypes.entrySet();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingTypeImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AddressingTypeImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AddressingTypeImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AddressingTypeImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.addressing;
+
+//$Id$
+
+import javax.xml.ws.addressing.AddressingType;
+
+/**
+ * Implemented by wrappers for types defined by <b>WS-Addressing</b>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AddressingTypeImpl implements AddressingType
+{
+ public String getNamespaceURI()
+ {
+ return AddressingConstantsImpl.URI_ADDRESSING;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributeElementExtensibleImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AttributeElementExtensibleImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AttributeElementExtensibleImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributeElementExtensibleImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.addressing;
+
+//$Id$
+
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingException;
+import javax.xml.ws.addressing.AddressingType;
+import javax.xml.ws.addressing.AttributeExtensible;
+import javax.xml.ws.addressing.ElementExtensible;
+
+/**
+ * Used to represent Addressing classes that support collections of arbitrary XML
Elements.
+ * Used to represent Addressing classes that support extensibility attributes.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AttributeElementExtensibleImpl implements AttributeExtensible,
ElementExtensible, AddressingType
+{
+ private AttributeExtensible attrExt = new AttributeExtensibleImpl();
+ private ElementExtensible elmtExt = new ElementExtensibleImpl();
+
+ public Map<QName, String> getAttributes()
+ {
+ return attrExt.getAttributes();
+ }
+
+ public void addAttribute(QName name, String value) throws AddressingException
+ {
+ attrExt.addAttribute(name, value);
+ }
+
+ public List<Object> getElements()
+ {
+ return elmtExt.getElements();
+ }
+
+ public void addElement(Object element)
+ {
+ elmtExt.addElement(element);
+ }
+
+ public boolean removeElement(Object element)
+ {
+ return elmtExt.removeElement(element);
+ }
+
+ public String getNamespaceURI()
+ {
+ return new AddressingTypeImpl().getNamespaceURI();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributeExtensibleImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AttributeExtensibleImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AttributeExtensibleImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributeExtensibleImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.addressing;
+
+//$Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingException;
+import javax.xml.ws.addressing.AttributeExtensible;
+
+/**
+ * Used to represent Addressing classes that support extensibility attributes.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AttributeExtensibleImpl extends AddressingTypeImpl implements
AttributeExtensible
+{
+ private Map<QName, String> extMap = new HashMap<QName, String>();
+
+ public Map<QName, String> getAttributes()
+ {
+ return extMap;
+ }
+
+ public void addAttribute(QName name, String value) throws AddressingException
+ {
+ extMap.put(name, value);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributedQNameImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AttributedQNameImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AttributedQNameImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributedQNameImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.addressing;
+
+//$Id$
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AttributedQName;
+
+/**
+ * Abstraction of <code>AttributedQNameType</code> defined in the normative
+ * WS-Addressing core schema.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AttributedQNameImpl extends AttributeExtensibleImpl implements
AttributedQName
+{
+ private QName qname;
+
+ public AttributedQNameImpl(QName qname)
+ {
+ this.qname = qname;
+ }
+
+ public QName getQName()
+ {
+ return qname;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributedURIImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AttributedURIImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/AttributedURIImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/AttributedURIImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.addressing;
+
+//$Id$
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.xml.ws.addressing.AttributedURI;
+
+/**
+ * Abstraction <code>AttributedURIType</code> defined in the normative
WS-Addressing core schema.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class AttributedURIImpl extends AttributeExtensibleImpl implements AttributedURI
+{
+ private URI uri;
+
+ public AttributedURIImpl(URI uri)
+ {
+ this.uri = uri;
+ }
+
+ public AttributedURIImpl(String uri)
+ {
+ try
+ {
+ this.uri = new URI(uri);
+ }
+ catch (URISyntaxException ex)
+ {
+ throw new IllegalArgumentException(ex.toString());
+ }
+ }
+
+ public URI getURI()
+ {
+ return uri;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/ElementExtensibleImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/ElementExtensibleImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/ElementExtensibleImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/ElementExtensibleImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.addressing;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.ws.addressing.ElementExtensible;
+
+/**
+ * Implemented by classes exposing a <code>List</code> of
+ * <code>SOAPElements</code>. Used to represent addressing classes that
+ * support collections of arbitrary XML Elements.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class ElementExtensibleImpl extends AddressingTypeImpl implements
ElementExtensible
+{
+ private List<Object> elements = new ArrayList<Object>();
+
+ public List<Object> getElements()
+ {
+ return elements;
+ }
+
+ public void addElement(Object element)
+ {
+ elements.add(element);
+ }
+
+ public boolean removeElement(Object element)
+ {
+ return elements.remove(element);
+ }
+
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/EndpointReferenceImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/EndpointReferenceImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,300 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.addressing;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.net.URI;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.AddressingException;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.addressing.Metadata;
+import javax.xml.ws.addressing.ReferenceParameters;
+import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.extensions.addressing.soap.SOAPAddressingBuilderImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Abstraction of EndpointReference.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class EndpointReferenceImpl extends AttributeElementExtensibleImpl implements
EndpointReference
+{
+ private static AddressingConstants ADDR = new AddressingConstantsImpl();
+
+ // The REQUIRED root element name
+ private QName rootQName = new QName(ADDR.getNamespaceURI(),
"EndpointReference", ADDR.getNamespacePrefix());
+ // This REQUIRED element (whose content is of type xs:anyURI) specifies the [address]
property of the endpoint reference.
+ private AttributedURIImpl address = new AttributedURIImpl(ADDR.getAnonymousURI());
+ // This OPTIONAL element may contain elements from any namespace. Such elements form
the [reference parameters] of the reference.
+ private ReferenceParametersImpl refParams = new ReferenceParametersImpl();
+ // This OPTIONAL element may contain elements from any namespace.
+ private MetadataImpl metadata = new MetadataImpl();
+
+ public EndpointReferenceImpl(URI uri)
+ {
+ this.address = new AttributedURIImpl(uri);
+ }
+
+ public EndpointReferenceImpl(Element elRoot)
+ {
+ initFromElement(elRoot);
+ }
+
+ public QName getRootQName()
+ {
+ return rootQName;
+ }
+
+ public void setRootQName(QName rootElementName)
+ {
+ this.rootQName = rootElementName;
+ }
+
+ public AttributedURI getAddress()
+ {
+ return address;
+ }
+
+ public ReferenceParameters getReferenceParameters()
+ {
+ return refParams;
+ }
+
+ public Metadata getMetadata()
+ {
+ return metadata;
+ }
+
+ private void initFromElement(Element elRoot)
+ {
+ if (elRoot == null)
+ throw new IllegalArgumentException("Cannot initialize from null
element");
+
+ try
+ {
+ Map<QName, String> attributes = DOMUtils.getAttributes(elRoot);
+ for (QName attqname : attributes.keySet())
+ {
+ String value = attributes.get(attqname);
+ addAttribute(attqname, value);
+ }
+
+ Iterator it = DOMUtils.getChildElements(elRoot);
+ while (it.hasNext())
+ {
+ Element el = (Element)it.next();
+ QName qname = DOMUtils.getElementQName(el);
+
+ // Parse Address
+ if (qname.equals(ADDR.getAddressQName()))
+ {
+ address = new AttributedURIImpl(DOMUtils.getTextContent(el));
+
+ attributes = DOMUtils.getAttributes(el);
+ for (QName attqname : attributes.keySet())
+ {
+ String value = attributes.get(attqname);
+ address.addAttribute(attqname, value);
+ }
+ }
+ // Parse ReferenceParameters
+ else if (qname.equals(ADDR.getReferenceParametersQName()))
+ {
+ attributes = DOMUtils.getAttributes(el);
+ for (QName attqname : attributes.keySet())
+ {
+ String value = attributes.get(attqname);
+ refParams.addAttribute(attqname, value);
+ }
+ Iterator itel = DOMUtils.getChildElements(el);
+ while (itel.hasNext())
+ {
+ Element child = (Element)itel.next();
+ refParams.addElement(child);
+ }
+ }
+ // Parse Metadata
+ else if (qname.equals(ADDR.getMetadataQName()))
+ {
+ attributes = DOMUtils.getAttributes(el);
+ for (QName attqname : attributes.keySet())
+ {
+ String value = attributes.get(attqname);
+ metadata.addAttribute(attqname, value);
+ }
+ Iterator itel = DOMUtils.getChildElements(el);
+ while (itel.hasNext())
+ {
+ Element child = (Element)itel.next();
+ metadata.addElement(child);
+ }
+ }
+ else
+ {
+ addElement(el);
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new AddressingException("Cannot init EPR from element", ex);
+ }
+ }
+
+ public Element toElement()
+ {
+ String xmlString = toXMLString(false);
+ try
+ {
+ return DOMUtils.parse(xmlString);
+ }
+ catch (IOException ex)
+ {
+ throw new WSException("Cannot parse: " + xmlString, ex);
+ }
+ }
+
+ public String toXMLString(boolean pretty)
+ {
+ if (pretty)
+ {
+ Element epRef = toElement();
+ return DOMWriter.printNode(epRef, true);
+ }
+
+ SOAPAddressingBuilder builder = new SOAPAddressingBuilderImpl();
+ AddressingConstants ADDR = builder.newAddressingConstants();
+
+ String rootname = getPrefixedName(rootQName);
+ StringBuilder xmlBuffer = new StringBuilder("<" + rootname);
+ appendAttributes(xmlBuffer, getAttributes());
+ xmlBuffer.append(">");
+
+ // insert xmlns:wsa
+ String wsaURI = ADDR.getNamespaceURI();
+ String wsaPrefix = ADDR.getNamespacePrefix();
+ String wsaDeclaration = " xmlns:" + wsaPrefix + "='" +
wsaURI + "'";
+ if (xmlBuffer.indexOf(wsaDeclaration) < 0)
+ {
+ xmlBuffer.insert(rootname.length() + 1, wsaDeclaration);
+ }
+
+ // append address
+ xmlBuffer.append("<" + getPrefixedName(ADDR.getAddressQName()));
+ appendAttributes(xmlBuffer, address.getAttributes());
+ xmlBuffer.append(">");
+ xmlBuffer.append(address.getURI() + "</" +
getPrefixedName(ADDR.getAddressQName()) + ">");
+
+ // append parameters
+ if (refParams.getElements().size() > 0 || refParams.getAttributes().size() >
0)
+ {
+ xmlBuffer.append("<" +
getPrefixedName(ADDR.getReferenceParametersQName()));
+ appendAttributes(xmlBuffer, refParams.getAttributes());
+ xmlBuffer.append(">");
+ appendElements(xmlBuffer, refParams.getElements());
+ xmlBuffer.append("</" +
getPrefixedName(ADDR.getReferenceParametersQName()) + ">");
+ }
+
+ // append metadata
+ if (metadata.getElements().size() > 0 || metadata.getAttributes().size() >
0)
+ {
+ xmlBuffer.append("<" + getPrefixedName(ADDR.getMetadataQName()));
+ appendAttributes(xmlBuffer, metadata.getAttributes());
+ xmlBuffer.append(">");
+ appendElements(xmlBuffer, metadata.getElements());
+ xmlBuffer.append("</" + getPrefixedName(ADDR.getMetadataQName()) +
">");
+ }
+
+ // append custom elements
+ appendElements(xmlBuffer, getElements());
+
+ xmlBuffer.append("</" + rootname + ">");
+
+ String xmlString = xmlBuffer.toString();
+ return xmlString;
+ }
+
+ private void appendAttributes(StringBuilder xmlBuffer, Map<QName, String>
attributes)
+ {
+ for (QName qname : attributes.keySet())
+ {
+ String qualname = getPrefixedName(qname);
+ String value = attributes.get(qname);
+ xmlBuffer.append(" " + qualname + "='" + value +
"'");
+ }
+ }
+
+ private void appendElements(StringBuilder xmlBuffer, List<Object> elements)
+ {
+ for (Object obj : elements)
+ {
+ if (obj instanceof Element)
+ {
+ StringWriter strwr = new StringWriter();
+ DOMWriter domWriter = new DOMWriter(strwr).setCompleteNamespaces(false);
+ domWriter.print((Element)obj);
+ String xmlFragment = strwr.toString();
+ xmlBuffer.append(xmlFragment);
+ }
+ else if (obj instanceof String)
+ {
+ xmlBuffer.append(obj);
+ }
+ else
+ {
+ throw new AddressingException("Unsupported element: " +
obj.getClass().getName());
+ }
+ }
+ }
+
+ private String getPrefixedName(QName qname)
+ {
+ String prefix = qname.getPrefix();
+ String localPart = qname.getLocalPart();
+ String qualname = (prefix != null && prefix.length() > 0 ? prefix +
":" + localPart : localPart);
+ return qualname;
+ }
+
+ public String toString()
+ {
+ return toXMLString(true);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/MetadataImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/MetadataImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/MetadataImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/MetadataImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.addressing;
+
+//$Id$
+
+import javax.xml.ws.addressing.Metadata;
+
+/**
+ * Abstraction of Metadata bucket in an <code>EndpointReference</code>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class MetadataImpl extends AttributeElementExtensibleImpl implements Metadata
+{
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/ReferenceParametersImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/ReferenceParametersImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/ReferenceParametersImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/ReferenceParametersImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.addressing;
+
+import javax.xml.ws.addressing.ReferenceParameters;
+
+// $Id$
+
+/**
+ * Abstraction of ReferenceParameters bucket in an
+ * <code>EndpointReference</code>.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class ReferenceParametersImpl extends AttributeElementExtensibleImpl implements
ReferenceParameters
+{
+ public ReferenceParametersImpl()
+ {
+ super();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/RelationshipImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/RelationshipImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/RelationshipImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/RelationshipImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.addressing;
+
+import java.net.URI;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.Relationship;
+
+// $Id$
+
+/**
+ * Abstraction of the RelatesToType defined by WS-Addressing. Includes an ID
+ * property that references the MessageID of the related message and a Type
+ * property corresponding to the RelationshipType attribute of the
+ * RelatesToType. Implementing classes must supply a single argument constructor
+ * with parameter type <code>java.net.URI</code>, which is used to
initialize
+ * the <b>ID</b> property.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Nov-2005
+ */
+public class RelationshipImpl extends AttributeExtensibleImpl implements Relationship
+{
+ private URI uri;
+ private QName type;
+
+ public RelationshipImpl(URI uri)
+ {
+ this.uri = uri;
+ }
+
+ public URI getID()
+ {
+ return uri;
+ }
+
+ public QName getType()
+ {
+ return type;
+ }
+
+ public void setType(QName type)
+ {
+ this.type = type;
+ }
+
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/jaxrpc)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/jaxrpc/WSAddressingClientHandler.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingClientHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.jaxrpc;
+package org.jboss.ws.extensions.addressing.jaxrpc;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.GenericHandler;
@@ -35,7 +35,7 @@
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import org.jboss.logging.Logger;
-import org.jboss.ws.addressing.soap.SOAPAddressingPropertiesImpl;
+import org.jboss.ws.extensions.addressing.soap.SOAPAddressingPropertiesImpl;
/**
* A client side handler that reads/writes the addressing properties
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingServerHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/jaxrpc/WSAddressingServerHandler.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/jaxrpc/WSAddressingServerHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.jaxrpc;
+package org.jboss.ws.extensions.addressing.jaxrpc;
import java.net.URISyntaxException;
@@ -35,9 +35,9 @@
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import org.jboss.logging.Logger;
-import org.jboss.ws.addressing.AddressingConstantsImpl;
-import org.jboss.ws.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
+import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.metadata.OperationMetaData;
/**
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/metadata
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/metadata)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/metadata/AddressingOpMetaExt.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.metadata;
+package org.jboss.ws.extensions.addressing.metadata;
// $Id$
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/soap (from
rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/soap)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingBuilderImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/soap/SOAPAddressingBuilderImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingBuilderImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.soap;
+package org.jboss.ws.extensions.addressing.soap;
//$Id$
@@ -35,12 +35,12 @@
import javax.xml.ws.addressing.Relationship;
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
-import org.jboss.ws.addressing.AddressingConstantsImpl;
-import org.jboss.ws.addressing.AddressingTypeImpl;
-import org.jboss.ws.addressing.AttributedQNameImpl;
-import org.jboss.ws.addressing.AttributedURIImpl;
-import org.jboss.ws.addressing.EndpointReferenceImpl;
-import org.jboss.ws.addressing.RelationshipImpl;
+import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
+import org.jboss.ws.extensions.addressing.AddressingTypeImpl;
+import org.jboss.ws.extensions.addressing.AttributedQNameImpl;
+import org.jboss.ws.extensions.addressing.AttributedURIImpl;
+import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
+import org.jboss.ws.extensions.addressing.RelationshipImpl;
/**
* Factory for <code>AddressingElements</code>.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.addressing.soap;
+package org.jboss.ws.extensions.addressing.soap;
//$Id$
@@ -46,14 +46,14 @@
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.addressing.AddressingConstantsImpl;
-import org.jboss.ws.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.addressing.EndpointReferenceImpl;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPFactoryImpl;
-import org.jboss.ws.utils.ThreadLocalAssociation;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPFactoryImpl;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.ThreadLocalAssociation;
+import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
+import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
import org.jboss.xb.binding.NamespaceRegistry;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpoint.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpoint.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpoint.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpoint.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.eventing;
+
+// $Id$
+
+import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.eventing.element.SubscriptionEndRequest;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * Event source endpoint interface.
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 24-Nov-2005
+ */
+public interface EventSourceEndpoint extends Remote
+{
+
+ SubscribeResponse subscribe(SubscribeRequest subscribeRequest) throws
RemoteException;
+
+ SubscriptionEndRequest subscriptionEnd() throws RemoteException;
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpointImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpointImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventSourceEndpointImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventSourceEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.eventing;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.eventing.element.SubscriptionEndRequest;
+import org.jboss.ws.extensions.eventing.mgmt.Filter;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionError;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerMBean;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionTicket;
+
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import java.rmi.RemoteException;
+
+/**
+ * Event source endpoint implementation.<br>
+ * Delegates to {@link org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager}
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 25-Nov-2005
+ */
+public class EventSourceEndpointImpl extends EventingEndpointBase
+ implements EventSourceEndpoint
+{
+ private static Logger log = Logger.getLogger(EventSourceEndpointImpl.class);
+
+ public SubscribeResponse subscribe(SubscribeRequest request) throws RemoteException
+ {
+ try
+ {
+ // retrieve addressing headers
+ AddressingProperties inProps = getAddrProperties();
+ AttributedURI eventSourceURI = inProps.getTo();
+ log.debug("Subscribe request for event source: " +
eventSourceURI.getURI());
+
+ assertSubscriberEndpoints(request);
+ EndpointReference notifyTo = request.getDelivery().getNotifyTo();
+ EndpointReference endTo = request.getEndTo();
+
+ // adapt filter elements
+ Filter filter = null;
+ if (request.getFilter() != null)
+ {
+ filter = new Filter(request.getFilter().getDialect(),
request.getFilter().get_value());
+ }
+
+ // invoke subscription manager
+ SubscriptionManagerMBean subscriptionManager = getSubscriptionManager();
+ SubscriptionTicket ticket =
subscriptionManager.subscribe(eventSourceURI.getURI(), notifyTo, endTo,
request.getExpires(), filter);
+
+ // create the response element
+ SubscribeResponse res = new SubscribeResponse();
+ res.setExpires(ticket.getExpires());
+ res.setSubscriptionManager(ticket.getSubscriptionManager());
+
+ return res;
+
+ }
+ catch (SubscriptionError e)
+ {
+ throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
+ }
+ }
+
+ public SubscriptionEndRequest subscriptionEnd() throws RemoteException
+ {
+ return new SubscriptionEndRequest();
+ }
+
+ /**
+ * Ensure that the subscriber endpoint information is supplied in request.
+ * Namely NotifyTo and EndTo need to be set.
+ * @param request
+ */
+ private void assertSubscriberEndpoints(SubscribeRequest request) {
+ if(null == request.getDelivery().getNotifyTo() || null == request.getEndTo() )
+ throw new SOAPFaultException(
buildFaultQName(EventingConstants.CODE_INVALID_MESSAGE) ,
+ "Subcriber endpoint information missing from request",
+ null, null
+ );
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventingConstants.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingConstants.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingConstants.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventingConstants.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.eventing;
+
+// $Id$
+
+import org.jboss.ws.WSException;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 19-Dec-2005
+ */
+public class EventingConstants
+{
+ private static AddressingBuilder WSA_BUILDER =
AddressingBuilder.getAddressingBuilder();
+ private static AddressingConstants WSA_CONSTANTS =
WSA_BUILDER.newAddressingConstants();
+
+ // common namespaces
+
+ public final static String NS_EVENTING =
"http://schemas.xmlsoap.org/ws/2004/08/eventing";
+ public final static String PREFIX_EVENTING = "wse";
+ public final static String NS_ADDRESSING = WSA_CONSTANTS.getNamespaceURI();
+
+ // request /response action from specification
+
+ public final static String SUBSCRIBE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe";
+ public final static String SUBSCRIBE_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse";
+ public final static String UNSUBSCRIBE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe";
+ public final static String UNSUBSCRIBE_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse";
+ public final static String GET_STATUS_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus";
+ public final static String GET_STATUS_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse";
+ public final static String RENEW_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew";
+ public final static String RENEW_RESPONSE_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse";
+ public final static String SUBSCRIPTION_END_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd";
+
+ public final static String WSA_FAULT_ACTION =
"http://schemas.xmlsoap.org/ws/2004/08/addressing/fault";
+ public final static String WSA_ANONYMOUS_URI = WSA_CONSTANTS.getAnonymousURI();
+
+ // failures
+
+ public final static String DELIVERY_FAILURE =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryFailure";
+ public final static String SOURCE_SHUTTING_DOWN =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SourceShuttingDown";
+ public final static String SOURCE_CANCELING =
"http://schemas.xmlsoap.org/ws/2004/08/eventing/SourceCanceling";
+
+ public final static String CODE_UNABLE_TO_PROCESS =
"EventSourceUnableToProcess";
+ public final static String CODE_FILTER_NOT_SUPPORTED =
"FilteringNotSupported";
+ public final static String CODE_REQUESTED_FILTER_UNAVAILABLE =
"FilteringRequestedUnavailable";
+ public final static String CODE_INVALID_EXPIRATION_TIME =
"InvalidExpirationTime";
+ public final static String CODE_UNABLE_TO_RENEW = "UnableToRenew";
+ public final static String CODE_INVALID_MESSAGE = "InvalidMessage";
+
+ // default config
+
+ public final static String DISPATCHER_JNDI_NAME = "EventDispatcher";
+
+ private static URI DELIVERY_PUSH_URI = null;
+ private static URI DIALECT_XPATH_URI = null;
+
+ private static URI SUBSCRIBE_ACTION_URI = null;
+
+ public final static URI buildURI(String uri)
+ {
+ try
+ {
+ return new URI(uri);
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ public static final URI getDefaultFilterDialect()
+ {
+ try
+ {
+ return new
URI("http://www.w3.org/TR/1999/REC-xpath-19991116");
+ }
+ catch (URISyntaxException e)
+ {
+ throw new WSException(e.getMessage());
+ }
+ }
+
+ public static final URI getDeliveryPush()
+ {
+ if (null == DELIVERY_PUSH_URI)
+ {
+ try
+ {
+ DELIVERY_PUSH_URI = new
URI("http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Pu...;
+ }
+ catch (URISyntaxException e)
+ {
+ //
+ }
+ }
+ return DELIVERY_PUSH_URI;
+ }
+
+ public static URI getDialectXPath()
+ {
+ if (null == DIALECT_XPATH_URI)
+ {
+ try
+ {
+ DIALECT_XPATH_URI = new
URI("http://www.w3.org/TR/1999/REC-xpath-19991116");
+ }
+ catch (URISyntaxException e)
+ {
+ //
+ }
+ }
+
+ return DIALECT_XPATH_URI;
+ }
+
+ public static URI getSubscribeAction()
+ {
+ if (null == SUBSCRIBE_ACTION_URI)
+ {
+ try
+ {
+ SUBSCRIBE_ACTION_URI = new URI(SUBSCRIBE_ACTION);
+ }
+ catch (URISyntaxException e)
+ {
+ //
+ }
+ }
+
+ return SUBSCRIBE_ACTION_URI;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventingEndpointBase.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingEndpointBase.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingEndpointBase.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventingEndpointBase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.eventing;
+
+
+// $Id$
+
+import java.net.URI;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import org.jboss.ws.Constants;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerFactory;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerMBean;
+
+/**
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 13-Jan-2006
+ */
+public abstract class EventingEndpointBase
+{
+
+ private AddressingBuilder addrBuilder;
+
+ /**
+ * Retrieve the addressing properties associated with the request
+ * and verify them.
+ */
+ protected static AddressingProperties getAddrProperties()
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ AddressingProperties inProps =
(AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ assertAddrProperties(inProps);
+ return inProps;
+ }
+
+ protected void setReplyAction(URI replyAction)
+ {
+
+ }
+
+ /**
+ * Access local subscription manager service.
+ */
+ protected SubscriptionManagerMBean getSubscriptionManager()
+ {
+ SubscriptionManagerFactory factory = SubscriptionManagerFactory.getInstance();
+ SubscriptionManagerMBean subscriptionManager = factory.getSubscriptionManager();
+ return subscriptionManager;
+ }
+
+ protected AddressingBuilder getAddrBuilder()
+ {
+ if (null == addrBuilder)
+ addrBuilder = AddressingBuilder.getAddressingBuilder();
+ return addrBuilder;
+ }
+
+ /**
+ * Ensure that all required inbound properties are supplied in request.
+ * @param inProps
+ * @throws javax.xml.rpc.soap.SOAPFaultException
+ */
+ protected static void assertAddrProperties(AddressingProperties inProps) throws
SOAPFaultException
+ {
+ if (null == inProps)
+ throw new SOAPFaultException(Constants.SOAP11_FAULT_CODE_CLIENT,
"Addressing headers missing from request", "wse:InvalidMessage",
null);
+ }
+
+ public QName buildFaultQName(String elementName)
+ {
+ return new QName(EventingConstants.NS_EVENTING, elementName,
EventingConstants.PREFIX_EVENTING);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventingService.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingService.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/EventingService.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/EventingService.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.eventing;
+
+// $Id$
+
+import javax.xml.rpc.Service;
+
+/**
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 24-Nov-2005
+ */
+public interface EventingService extends Service
+{
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpoint.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpoint.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpoint.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpoint.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.eventing;
+
+// $Id$
+
+import org.jboss.ws.extensions.eventing.element.*;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * Subscription manager endpoint interface.
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 16-Dec-2005
+ */
+public interface SubscriptionManagerEndpoint extends Remote
+{
+
+ StatusResponse getStatus(StatusRequest request) throws RemoteException;
+
+ RenewResponse renew(RenewRequest request) throws RemoteException;
+
+ void unsubscribe(UnsubscribeRequest request) throws RemoteException;
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpointImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpointImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/SubscriptionManagerEndpointImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/SubscriptionManagerEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.eventing;
+
+// $Id$
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.rmi.RemoteException;
+import java.util.Date;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.addressing.ReferenceParameters;
+
+import org.jboss.ws.Constants;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.extensions.eventing.element.RenewRequest;
+import org.jboss.ws.extensions.eventing.element.RenewResponse;
+import org.jboss.ws.extensions.eventing.element.StatusRequest;
+import org.jboss.ws.extensions.eventing.element.StatusResponse;
+import org.jboss.ws.extensions.eventing.element.UnsubscribeRequest;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionError;
+import org.w3c.dom.Element;
+
+/**
+ * SubscriptionManager endpoint implementation.<br>
+ * Delegates to {@link org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager}
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 16-Dec-2005
+ */
+public class SubscriptionManagerEndpointImpl extends EventingEndpointBase
+ implements SubscriptionManagerEndpoint
+{
+
+ public static final QName IDQN = new
QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Identifier",
"ns1");
+
+ /**
+ * Get the status of a subscription.
+ *
+ * @param request
+ * @return response including the lease time.
+ * @throws RemoteException
+ */
+ public StatusResponse getStatus(StatusRequest request) throws RemoteException
+ {
+ URI identifier = retrieveSubscriptionId();
+
+ try
+ {
+ Date leaseTime = getSubscriptionManager().getStatus(identifier);
+ StatusResponse response = new StatusResponse();
+ response.setExpires(leaseTime);
+
+ return response;
+ }
+ catch (SubscriptionError e)
+ {
+ throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
+ }
+ }
+
+ /**
+ * Update the expiration for a subscription.
+ *
+ * @param request
+ * @return response inclduing the new lease time.
+ * @throws RemoteException
+ */
+ public RenewResponse renew(RenewRequest request) throws RemoteException
+ {
+
setReplyAction(EventingConstants.buildURI(EventingConstants.RENEW_RESPONSE_ACTION));
+ URI identifier = retrieveSubscriptionId();
+
+ try
+ {
+ Date newLeaseTime = getSubscriptionManager().renew(identifier,
request.getExpires());
+ RenewResponse response = new RenewResponse();
+ response.setExpires(newLeaseTime);
+
+ return response;
+ }
+ catch (SubscriptionError e)
+ {
+ throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
+ }
+
+ }
+
+ /**
+ * Explicitly delete a subscription.
+ *
+ * @param request
+ * @throws RemoteException
+ */
+ public void unsubscribe(UnsubscribeRequest request) throws RemoteException
+ {
+
setReplyAction(EventingConstants.buildURI(EventingConstants.UNSUBSCRIBE_RESPONSE_ACTION));
+ URI identifier = retrieveSubscriptionId();
+
+ try
+ {
+ getSubscriptionManager().unsubscribe(identifier);
+ }
+ catch (SubscriptionError e)
+ {
+ throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(),
null, null);
+ }
+
+ }
+
+ private URI retrieveSubscriptionId()
+ {
+ URI subscriptionId = null;
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ AddressingProperties addrProps =
(AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+
+ if (null == addrProps)
+ {
+ throw new SOAPFaultException(
+ Constants.SOAP11_FAULT_CODE_CLIENT,
+ "The message is not valid and cannot be processed:" +
+ "Cannot obtain addressing properties.",
+ null, null
+ );
+ }
+
+ ReferenceParameters refParams = addrProps.getReferenceParameters();
+ if (refParams != null)
+ {
+ for (Object obj : refParams.getElements())
+ {
+ if (obj instanceof Element)
+ {
+ Element el = (Element)obj;
+ QName qname = DOMUtils.getElementQName(el);
+ if (qname.equals(IDQN))
+ {
+ try
+ {
+ subscriptionId = new URI(DOMUtils.getTextContent(el));
+ break;
+ }
+ catch (URISyntaxException e)
+ {
+ throw new SOAPFaultException(
+ Constants.SOAP11_FAULT_CODE_CLIENT,
+ "The message is not valid and cannot be processed:"
+
+ "Invalid subscription id.",
+ null, null
+ );
+ }
+ }
+ }
+ }
+ }
+
+ if (null == subscriptionId)
+ {
+ throw new SOAPFaultException(
+ buildFaultQName(EventingConstants.CODE_INVALID_MESSAGE),
+ "The message is not valid and cannot be processed."
+ + "Cannot obtain subscription id.",
+ null, null
+ );
+ }
+
+ return subscriptionId;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/deployment
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/deployment)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/deployment/EventingEndpoint.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpoint.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,13 +1,13 @@
-package org.jboss.ws.eventing.deployment;
+package org.jboss.ws.extensions.eventing.deployment;
import org.jboss.ws.WSException;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.metadata.EventingEpMetaExt;
-import org.jboss.ws.eventing.mgmt.SubscriptionManagerFactory;
-import org.jboss.ws.eventing.mgmt.SubscriptionManagerMBean;
+import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.metadata.EventingEpMetaExt;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerFactory;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManagerMBean;
import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.server.ServiceEndpoint;
-import org.jboss.ws.server.ServiceEndpointInfo;
/**
* EventingEndpointLifecycle is responsible to create event sources
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpointDI.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/deployment/EventingEndpointDI.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/deployment/EventingEndpointDI.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,6 +1,6 @@
-package org.jboss.ws.eventing.deployment;
+package org.jboss.ws.extensions.eventing.deployment;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
import java.io.IOException;
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element (from
rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/DeliveryType.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/DeliveryType.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/DeliveryType.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/EndpointReference.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/EndpointReference.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/EndpointReference.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,14 +19,14 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
import org.w3c.dom.Element;
-import org.jboss.ws.addressing.EndpointReferenceImpl;
-import org.jboss.ws.soap.SOAPFactoryImpl;
-import org.jboss.ws.eventing.EventingConstants;
+import org.jboss.ws.core.soap.SOAPFactoryImpl;
+import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
+import org.jboss.ws.extensions.eventing.EventingConstants;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/FilterType.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/FilterType.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/FilterType.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
@@ -36,7 +36,7 @@
* <br>
* For further information see
<
code>http://www.w3.org/TR/xpath#predicates</code>.
*
- * @see org.jboss.ws.eventing.mgmt.Filter
+ * @see org.jboss.ws.extensions.eventing.mgmt.Filter
*
* @author Heiko Braun, <heiko(a)openj.net>
* @since 24-Nov-2005
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/MetaData.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/MetaData.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/MetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/ReferenceParameters.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/ReferenceParameters.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/ReferenceParameters.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/RenewRequest.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/RenewRequest.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/RenewRequest.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/RenewResponse.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/RenewResponse.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/RenewResponse.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/StatusRequest.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/StatusRequest.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/StatusRequest.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
import javax.xml.soap.SOAPElement;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/StatusResponse.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/StatusResponse.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/StatusResponse.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeRequest.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/SubscribeRequest.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeRequest.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
@@ -49,7 +49,7 @@
this.endTo = endTo;
}
- public org.jboss.ws.eventing.element.DeliveryType getDelivery()
+ public org.jboss.ws.extensions.eventing.element.DeliveryType getDelivery()
{
return delivery;
}
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeResponse.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/SubscribeResponse.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/SubscribeResponse.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
@@ -31,7 +31,7 @@
*/
public class SubscribeResponse
{
- private org.jboss.ws.eventing.element.EndpointReference subscriptionManager;
+ private org.jboss.ws.extensions.eventing.element.EndpointReference
subscriptionManager;
private Date expires;
public EndpointReference getSubscriptionManager()
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/SubscriptionEndRequest.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/SubscriptionEndRequest.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/SubscriptionEndRequest.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
-import org.jboss.ws.addressing.EndpointReferenceImpl;
+import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
import java.net.URI;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/UnsubscribeRequest.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/UnsubscribeRequest.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/element/UnsubscribeRequest.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.element;
+package org.jboss.ws.extensions.eventing.element;
// $Id$
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/metadata
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/metadata)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/metadata/EventingEpMetaExt.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/metadata/EventingEpMetaExt.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/metadata/EventingEpMetaExt.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,4 +1,4 @@
-package org.jboss.ws.eventing.metadata;
+package org.jboss.ws.extensions.eventing.metadata;
import java.net.URI;
import java.net.URISyntaxException;
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt
(from rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatchJob.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/DispatchJob.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatchJob.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/DispatcherDelegate.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,4 +1,4 @@
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
import java.net.URI;
import java.util.Properties;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/DispatcherFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,4 +1,4 @@
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
import javax.naming.Context;
import javax.naming.Name;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventDispatcher.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/EventDispatcher.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventDispatcher.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventSource.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/EventSource.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventSource.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/EventingBuilder.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,8 +1,8 @@
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
import org.jboss.ws.WSException;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.deployment.EventingEndpointDI;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.deployment.EventingEndpointDI;
import java.net.URI;
import java.net.URISyntaxException;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Filter.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/Filter.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Filter.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
// $Id$
@@ -28,7 +28,7 @@
/**
* A local filter representation.
*
- * @see org.jboss.ws.eventing.element.FilterType
+ * @see org.jboss.ws.extensions.eventing.element.FilterType
*
* @author Heiko Braun, <heiko(a)openj.net>
* @since 08-Dec-2005
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Subscription.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/Subscription.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/Subscription.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,17 +19,17 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
// $Id$
import org.apache.xpath.XPathAPI;
import org.apache.xpath.objects.XObject;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.soap.SOAPConnectionImpl;
+import org.jboss.ws.core.soap.SOAPConnectionImpl;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
import org.w3c.dom.Element;
import javax.xml.soap.MessageFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionError.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionError.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionError.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,4 +1,4 @@
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
/**
* @author Heiko Braun, <heiko(a)openj.net>
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionManager.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,19 +19,19 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
// $Id$
import org.jboss.logging.Logger;
import org.jboss.util.naming.Util;
import org.jboss.ws.WSException;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.deployment.EventingEndpointDI;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.ReferenceParameters;
-import org.jboss.ws.utils.ObjectNameFactory;
-import org.jboss.ws.utils.UUIDGenerator;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.core.utils.UUIDGenerator;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.deployment.EventingEndpointDI;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.ReferenceParameters;
import org.w3c.dom.Element;
import javax.management.MBeanServer;
@@ -66,9 +66,9 @@
* <p>
* Currently only event push is supported.
*
- * @see org.jboss.ws.eventing.EventSourceEndpoint
- * @see org.jboss.ws.eventing.SubscriptionManagerEndpoint
- * @see org.jboss.ws.eventing.element.FilterType
+ * @see org.jboss.ws.extensions.eventing.EventSourceEndpoint
+ * @see org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint
+ * @see org.jboss.ws.extensions.eventing.element.FilterType
*
* @author Heiko Braun, <heiko(a)openj.net>
* @since 02-Dec-2005
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionManagerFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,8 +1,8 @@
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.ws.server.KernelLocator;
+import org.jboss.ws.core.server.KernelLocator;
/**
* @author Heiko Braun, <heiko(a)openj.net>
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionManagerMBean.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
// $Id$
import java.net.URI;
import java.util.Date;
-import org.jboss.ws.eventing.deployment.EventingEndpointDI;
-import org.jboss.ws.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.deployment.EventingEndpointDI;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionTicket.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/eventing/mgmt/SubscriptionTicket.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionTicket.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.eventing.mgmt;
+package org.jboss.ws.extensions.eventing.mgmt;
// $Id$
-import org.jboss.ws.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
import java.net.URI;
import java.util.Date;
@@ -51,7 +51,7 @@
return identifier;
}
- public org.jboss.ws.eventing.element.EndpointReference getSubscriptionManager()
+ public org.jboss.ws.extensions.eventing.element.EndpointReference
getSubscriptionManager()
{
return subscriptionManager;
}
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy (from
rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wspolicy)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/Policy.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wspolicy/Policy.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/Policy.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wspolicy;
+package org.jboss.ws.extensions.policy;
// $Id$
@@ -28,8 +28,8 @@
import java.util.Collection;
import java.util.Iterator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.WSException;
import org.jboss.xb.binding.NamespaceRegistry;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/PolicyAlternative.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wspolicy/PolicyAlternative.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/PolicyAlternative.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wspolicy;
+package org.jboss.ws.extensions.policy;
//$Id$
@@ -28,8 +28,8 @@
import java.util.Collection;
import java.util.Iterator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.WSException;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wspolicy/PolicyAssertion.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/PolicyAssertion.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,12 +19,12 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wspolicy;
+package org.jboss.ws.extensions.policy;
//$Id$
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/PolicyFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wspolicy/PolicyFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/policy/PolicyFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wspolicy;
+package org.jboss.ws.extensions.policy;
// $Id$
@@ -28,7 +28,7 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.WSException;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/BinarySecurityTokenValidator.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/BinarySecurityTokenValidator.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/BinarySecurityTokenValidator.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+import org.jboss.ws.extensions.security.element.BinarySecurityToken;
+import org.jboss.ws.extensions.security.element.X509Token;
+
+
+/**
+ * <code>BinarySecurityTokenValidator</code> is responsible for validating
BSTs
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class BinarySecurityTokenValidator
+{
+ private SecurityStore store;
+
+ public BinarySecurityTokenValidator(SecurityStore store)
+ {
+ this.store = store;
+ }
+
+ public void validateToken(BinarySecurityToken token) throws WSSecurityException
+ {
+ if (token instanceof X509Token)
+ store.validateCertificate(((X509Token)token).getCert());
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Constants.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/Constants.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/Constants.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Constants.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import org.apache.xml.security.utils.EncryptionConstants;
+
+
+/**
+ * @author Jason T. Greene
+ * @version $Id$
+ */
+public class Constants
+{
+ public static final String WSS_SOAP_NS =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0";
+
+ public static final String JBOSS_WSSE_NS =
"http://www.jboss.com/jbossws/ws-security";
+
+ public static final String JBOSS_WSSE_PREFIX = "jboss-wsse";
+
+ public static final String WSSE_PREFIX = "wsse";
+
+ public static final String WSSE_NS =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
+
+ public static final String WSU_PREFIX = "wsu";
+
+ public static final String WSU_NS =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
+
+ public static final String XML_SIGNATURE_NS =
org.apache.xml.security.utils.Constants.SignatureSpecNS;
+
+ public static final String XML_ENCRYPTION_NS = EncryptionConstants.EncryptionSpecNS;
+
+ public static final String XML_ENCRYPTION_PREFIX = "xenc";
+
+ public static final String ID = "Id";
+
+ public static final String WSU_ID = WSU_PREFIX + ":" + ID;
+
+ public static final String BASE64_ENCODING_TYPE = WSS_SOAP_NS +
"#Base64Binary";
+
+ public static final String WSSE_HEADER = WSSE_PREFIX + ":Security";
+
+ public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/";
+
+ public static final String XENC_DATAREFERENCE = "DataReference";
+
+ public static final String XENC_REFERENCELIST = "ReferenceList";
+
+ public static final String XENC_ELEMENT_TYPE = EncryptionConstants.TYPE_ELEMENT;
+
+ public static final String XENC_CONTENT_TYPE = EncryptionConstants.TYPE_CONTENT;
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/DecodingOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/DecodingOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/DecodingOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.util.Collection;
+
+import org.jboss.ws.extensions.security.element.SecurityProcess;
+import org.w3c.dom.Document;
+
+/**
+ * <code>DecodingOperation</code> represents an operation that is applied to
a
+ * WS-Security encoded message to both convert and verify the contents of the
+ * message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public interface DecodingOperation extends Operation
+{
+ public Collection<String> process(Document message, SecurityProcess process)
throws WSSecurityException;
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/DecryptionOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/DecryptionOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/DecryptionOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,145 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+import java.util.Collection;
+import java.util.HashSet;
+
+import javax.crypto.SecretKey;
+
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.encryption.XMLEncryptionException;
+import org.jboss.ws.extensions.security.element.EncryptedKey;
+import org.jboss.ws.extensions.security.element.ReferenceList;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.SecurityProcess;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class DecryptionOperation implements DecodingOperation
+{
+
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public DecryptionOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ private boolean isContent(Element element)
+ {
+ return Constants.XENC_CONTENT_TYPE.equals(element.getAttribute("Type"));
+ }
+
+ private String getEncryptionAlgorithm(Element element) throws WSSecurityException
+ {
+ element = Util.findElement(element, "EncryptionMethod",
Constants.XML_ENCRYPTION_NS);
+ if (element == null)
+ throw new InvalidSecurityHeaderException("Encrypted element corrupted, no
encryption method");
+
+ String alg = element.getAttribute("Algorithm");
+ if (alg == null || alg.length() == 0)
+ throw new InvalidSecurityHeaderException("Encrypted element corrupted, no
algorithm specified");
+
+ return alg;
+ }
+
+ private String decryptElement(Element element, SecretKey key) throws
WSSecurityException
+ {
+ Element previous;
+ boolean parent;
+ boolean isContent;
+
+ // We find the decrypted element by traversing to the element before the
+ // encrypted data. If there is no sibling before the encrypted data, then
+ // we traverse to the parent.
+ // "Now take a step back . . . and then a step forward . . . and then a
+ // step back . . . and then we're cha-chaing." -Chris Knight
+ parent = isContent = isContent(element);
+ if (parent)
+ {
+ previous = (Element) element.getParentNode();
+ }
+ else
+ {
+ previous = Util.getPreviousSiblingElement(element);
+ if (previous == null)
+ {
+ parent = true;
+ previous = (Element) element.getParentNode();
+ }
+ }
+
+ String alg = getEncryptionAlgorithm(element);
+ try
+ {
+ XMLCipher cipher = XMLCipher.getInstance(alg);
+ cipher.init(XMLCipher.DECRYPT_MODE, key);
+ cipher.doFinal(element.getOwnerDocument(), element);
+ }
+ catch (XMLEncryptionException e)
+ {
+ throw new FailedCheckException("Decryption was invalid.");
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Could not decrypt element: " +
e.getMessage(), e);
+ }
+
+ if (isContent)
+ return Util.getWsuId(previous);
+
+ Element decrypted = (parent) ? Util.getFirstChildElement(previous) :
Util.getNextSiblingElement(previous);
+ if (decrypted == null)
+ return null;
+
+ return Util.getWsuId(decrypted);
+ }
+
+ private boolean isEncryptedData(Element element)
+ {
+ return "EncryptedData".equals(element.getLocalName()) &&
Constants.XML_ENCRYPTION_NS.equals(element.getNamespaceURI());
+ }
+
+ public Collection<String> process(Document message, SecurityProcess process)
throws WSSecurityException
+ {
+ Collection<String> ids = new HashSet<String>();
+ EncryptedKey key = (EncryptedKey) process;
+ ReferenceList list = key.getReferenceList();
+ for (String uri : list.getAllReferences())
+ {
+ Element element = Util.findElementByWsuId(message.getDocumentElement(), uri);
+ if (element == null)
+ throw new WSSecurityException("A reference list refered to an element
that was not found: " + uri);
+
+ if (!isEncryptedData(element))
+ throw new WSSecurityException("Malformed reference list, a non encrypted
data element was referenced: " + uri);
+
+ ids.add(decryptElement(element, key.getSecretKey()));
+ }
+
+ return ids;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/EncodingOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/EncodingOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/EncodingOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.util.List;
+
+import org.w3c.dom.Document;
+
+/**
+ * <code>EncodingOperation</code> represents an encoding operation that is
+ * applied to a standard SOAP message, transforming it into a WS-Security
+ * encoded message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public interface EncodingOperation extends Operation
+{
+ public void process(Document message, List<Target> targets, String alias, String
credential, String algorithm) throws WSSecurityException;
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/EncryptionOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/EncryptionOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,172 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+import javax.xml.namespace.QName;
+
+import org.apache.xml.security.encryption.EncryptedData;
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.security.element.EncryptedKey;
+import org.jboss.ws.extensions.security.element.ReferenceList;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.X509Token;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class EncryptionOperation implements EncodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ private static class Algorithm
+ {
+ Algorithm(String jceName, String xmlName, int size)
+ {
+ this.jceName = jceName;
+ this.xmlName = xmlName;
+ this.size = size;
+ }
+
+ public String jceName;
+ public String xmlName;
+ public int size;
+ }
+
+ private static HashMap<String, Algorithm> algorithms;
+
+ private static final String DEFAULT_ALGORITHM = "aes-128";
+
+ static
+ {
+ algorithms = new HashMap<String, Algorithm>(4);
+ algorithms.put("aes-128", new Algorithm("AES",
XMLCipher.AES_128, 128));
+ algorithms.put("aes-192", new Algorithm("AES",
XMLCipher.AES_192, 192));
+ algorithms.put("aes-256", new Algorithm("AES",
XMLCipher.AES_256, 256));
+ algorithms.put("tripledes", new Algorithm("TripleDes",
XMLCipher.TRIPLEDES, 168));
+ }
+
+ public EncryptionOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ private void processTarget(XMLCipher cipher, Document message, Target target,
ReferenceList list, SecretKey key) throws WSSecurityException
+ {
+ if (!(target instanceof QNameTarget))
+ throw new NotImplementedException();
+
+ QName name = ((QNameTarget)target).getName();
+
+ Element element = Util.findElement(message.getDocumentElement(), name);
+ if (element == null)
+ throw new RuntimeException("Could not find element");
+
+ // Ensure that the element has an id, so that encryption verification can be
performed
+ Util.assignWsuId(element);
+
+ try
+ {
+ cipher.init(XMLCipher.ENCRYPT_MODE, key);
+ EncryptedData encrypted = cipher.getEncryptedData();
+ String id = Util.generateId("encrypted");
+ encrypted.setId(id);
+ list.add(id);
+ cipher.doFinal(message, element, target.isContent());
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Error encrypting target: " + name, e);
+ }
+ }
+
+ public SecretKey getSecretKey(String algorithm) throws WSSecurityException
+ {
+ Algorithm alg = algorithms.get(algorithm);
+
+ try
+ {
+ KeyGenerator kgen = KeyGenerator.getInstance(alg.jceName);
+ kgen.init(alg.size);
+ return kgen.generateKey();
+ }
+ catch (NoSuchAlgorithmException e)
+ {
+ throw new WSSecurityException(e.getMessage());
+ }
+ }
+
+ public void process(Document message, List<Target> targets, String alias, String
credential, String algorithm) throws WSSecurityException
+ {
+ if (! algorithms.containsKey(algorithm))
+ algorithm = DEFAULT_ALGORITHM;
+
+ SecretKey secretKey = getSecretKey(algorithm);
+ XMLCipher cipher;
+ try
+ {
+ cipher = XMLCipher.getInstance(algorithms.get(algorithm).xmlName);
+ cipher.init(XMLCipher.ENCRYPT_MODE, secretKey);
+ }
+ catch (XMLSecurityException e)
+ {
+ throw new WSSecurityException("Error initializing xml cipher" +
e.getMessage(), e);
+ }
+
+ ReferenceList list = new ReferenceList();
+
+ if (targets == null || targets.size() == 0)
+ {
+ // By default we encrypt the content of the body element
+ String namespace = message.getDocumentElement().getNamespaceURI();
+ processTarget(cipher, message, new QNameTarget(new QName(namespace,
"Body"), true), list, secretKey);
+ }
+ else
+ {
+ for (Target target : targets)
+ processTarget(cipher, message, target, list, secretKey);
+ }
+
+ X509Certificate cert = store.getCertificate(alias);
+ X509Token token = (X509Token) header.getSharedToken(cert);
+
+ // Can we reuse an existing token?
+ if (token == null)
+ {
+ token = new X509Token(cert, message);
+ header.addToken(token);
+ }
+
+ EncryptedKey eKey = new EncryptedKey(message, secretKey, token, list);
+ header.addSecurityProcess(eKey);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/FailedAuthenticationException.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/FailedAuthenticationException.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/FailedAuthenticationException.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class FailedAuthenticationException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS,
"FailedAuthentication", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "The security token could not be
authenticated or authorized.";
+
+ public FailedAuthenticationException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedAuthenticationException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedAuthenticationException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public FailedAuthenticationException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/FailedCheckException.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/FailedCheckException.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/FailedCheckException.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class FailedCheckException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS,
"FailedCheck", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "The signature or decryption was
invlaid.";
+
+ public FailedCheckException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedCheckException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public FailedCheckException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public FailedCheckException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/InvalidSecurityHeaderException.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/InvalidSecurityHeaderException.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityHeaderException.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class InvalidSecurityHeaderException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS,
"InvalidSecurity", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "An error was dicovered processing the
<wsse:Security> header.";
+
+ public InvalidSecurityHeaderException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityHeaderException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityHeaderException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public InvalidSecurityHeaderException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/InvalidSecurityTokenException.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/InvalidSecurityTokenException.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/InvalidSecurityTokenException.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class InvalidSecurityTokenException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS,
"InvlalidSecurityToken", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "An invlaid security token was
provided.";
+
+ public InvalidSecurityTokenException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityTokenException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public InvalidSecurityTokenException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public InvalidSecurityTokenException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/KeyResolver.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/KeyResolver.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/KeyResolver.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+
+import org.apache.xml.security.keys.KeyInfo;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.security.element.BinarySecurityToken;
+import org.jboss.ws.extensions.security.element.DirectReference;
+import org.jboss.ws.extensions.security.element.KeyIdentifier;
+import org.jboss.ws.extensions.security.element.Reference;
+import org.jboss.ws.extensions.security.element.SecurityTokenReference;
+import org.jboss.ws.extensions.security.element.X509IssuerSerial;
+import org.jboss.ws.extensions.security.element.X509Token;
+import org.w3c.dom.Element;
+
+
+/**
+ * <code>KeyResolver</code> is responsible for locating security tokens
+ * within a WS-Security message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class KeyResolver
+{
+ private HashMap<String, BinarySecurityToken> tokenCache = new HashMap<String,
BinarySecurityToken>();
+
+ private SecurityStore store;
+
+ public KeyResolver(SecurityStore store)
+ {
+ this.store = store;
+ }
+
+ private SecurityTokenReference extractSecurityTokenReference(KeyInfo info) throws
WSSecurityException
+ {
+ Element child = Util.getFirstChildElement(info.getElement());
+ if (child == null)
+ throw new WSSecurityException("Empty KeyInfo");
+
+ if (! child.getLocalName().equals("SecurityTokenReference"))
+ throw new WSSecurityException("KeyInfo did not contain expected
SecurityTokenReference, instead got: " + child.getLocalName());
+
+ return new SecurityTokenReference(child);
+ }
+
+ public void cacheToken(BinarySecurityToken token)
+ {
+ tokenCache.put(token.getId(), token);
+ }
+
+ public BinarySecurityToken resolve(SecurityTokenReference reference) throws
WSSecurityException
+ {
+ Reference ref = reference.getReference();
+ if (ref instanceof DirectReference)
+ {
+ DirectReference direct = (DirectReference) ref;
+ return resolveDirectReference(direct);
+ }
+ else if (ref instanceof KeyIdentifier)
+ {
+ KeyIdentifier identifier = (KeyIdentifier) ref;
+ return resolveKeyIdentifier(identifier);
+ }
+ else if (ref instanceof X509IssuerSerial)
+ {
+ X509IssuerSerial issuerSerial = (X509IssuerSerial) ref;
+ return resolveX509IssuerSerial(issuerSerial);
+ }
+
+ throw new NotImplementedException("Currently only DirectReference is
supported!");
+ }
+
+ private BinarySecurityToken resolveDirectReference(DirectReference direct) throws
WSSecurityException
+ {
+ String id = direct.getUri().substring(1);
+
+ BinarySecurityToken token = tokenCache.get(id);
+ if (token == null)
+ throw new SecurityTokenUnavailableException("Could not resolve token id:
" + id);
+
+ return token;
+ }
+
+ private BinarySecurityToken resolveKeyIdentifier(KeyIdentifier identifier) throws
WSSecurityException
+ {
+ // Support only SKI at the moment
+ X509Certificate cert =
store.getCertificateBySubjectKeyIdentifier(identifier.getIdentifier());
+ if (cert == null)
+ throw new SecurityTokenUnavailableException("Could not locate certificate
by key identifier");
+ return new X509Token(cert, identifier.getDocument());
+ }
+
+ private BinarySecurityToken resolveX509IssuerSerial(X509IssuerSerial issuerSerial)
throws WSSecurityException
+ {
+ X509Certificate cert = store.getCertificateByIssuerSerial(issuerSerial.getIssuer(),
issuerSerial.getSerial());
+ if (cert == null)
+ throw new SecurityTokenUnavailableException("Could not locate certificate by
issuer and serial number");
+
+ return new X509Token(cert, issuerSerial.getDocument());
+ }
+
+ public X509Certificate resolveCertificate(SecurityTokenReference reference) throws
WSSecurityException
+ {
+ BinarySecurityToken token = resolve(reference);
+
+ if (! (token instanceof X509Token))
+ throw new WSSecurityException("Expected X509Token, cache contained: "
+ token.getClass().getName());
+
+ return ((X509Token)token).getCert();
+ }
+
+ public PublicKey resolvePublicKey(SecurityTokenReference reference) throws
WSSecurityException
+ {
+ return resolveCertificate(reference).getPublicKey();
+ }
+
+ public PrivateKey resolvePrivateKey(SecurityTokenReference reference) throws
WSSecurityException
+ {
+ return store.getPrivateKey(resolveCertificate(reference));
+ }
+
+ public BinarySecurityToken resolve(KeyInfo info) throws WSSecurityException
+ {
+ return resolve(extractSecurityTokenReference(info));
+ }
+
+ public X509Certificate resolveCertificate(KeyInfo info) throws WSSecurityException
+ {
+ return resolveCertificate(extractSecurityTokenReference(info));
+ }
+
+ public PublicKey resolvePublicKey(KeyInfo info) throws WSSecurityException
+ {
+ return resolvePublicKey(extractSecurityTokenReference(info));
+ }
+
+ public PrivateKey resolvePrivateKey(KeyInfo info) throws WSSecurityException
+ {
+ return resolvePrivateKey(extractSecurityTokenReference(info));
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Operation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/Operation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/Operation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Operation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+/**
+ * Marker interface for all WS-Security operations
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public interface Operation
+{
+
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/OperationDescription.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/OperationDescription.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/OperationDescription.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.util.List;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class OperationDescription<T extends Operation>
+{
+ private Class<? extends T> operation;
+
+ private List<Target> targets;
+
+ private String certificateAlias;
+
+ private String credential;
+
+ private String algorithm;
+
+ public OperationDescription(Class<? extends T> operation, List<Target>
targets, String certicateAlias, String credential, String algorithm)
+ {
+ this.operation = operation;
+ this.targets = targets;
+ this.certificateAlias = certicateAlias;
+ this.credential = credential;
+ this.algorithm = algorithm;
+ }
+
+ public Class<? extends T> getOperation()
+ {
+ return operation;
+ }
+
+ public void setOperation(Class<? extends T> operation)
+ {
+ this.operation = operation;
+ }
+
+ public List<Target> getTargets()
+ {
+ return targets;
+ }
+
+ public void setTargets(List<Target> targets)
+ {
+ this.targets = targets;
+ }
+
+
+ public String getCertificateAlias()
+ {
+ return certificateAlias;
+ }
+
+
+ public void setCertificateAlias(String certificateAlias)
+ {
+ this.certificateAlias = certificateAlias;
+ }
+
+
+ public String getCredential()
+ {
+ return credential;
+ }
+
+ public void setCredential(String credential)
+ {
+ this.credential = credential;
+ }
+
+ public String getAlgorithm()
+ {
+ return algorithm;
+ }
+
+ public void setAlgorithm(String algorithm)
+ {
+ this.algorithm = algorithm;
+ }
+
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/QNameTarget.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/QNameTarget.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/QNameTarget.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/QNameTarget.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import javax.xml.namespace.QName;
+
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class QNameTarget extends Target
+{
+ private QName name;
+
+ private boolean content;
+
+ public QNameTarget(QName name)
+ {
+ this.name = name;
+ this.content = false;
+ }
+
+ public QNameTarget(QName name, boolean content)
+ {
+ this(name);
+ this.content = content;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public boolean isContent()
+ {
+ return content;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/ReceiveUsernameOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/ReceiveUsernameOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.security;
+
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.Token;
+import org.jboss.ws.extensions.security.element.UsernameToken;
+import org.w3c.dom.Document;
+
+public class ReceiveUsernameOperation implements TokenOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public ReceiveUsernameOperation(SecurityHeader header, SecurityStore store)
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ public void process(Document message, Token token) throws WSSecurityException
+ {
+ UsernameToken user = (UsernameToken)token;
+
+ SecurityAdaptorFactory factory = SecurityAdaptorFactory.getInstance();
+ SecurityAdaptor securityAdaptor = factory.getSecurityAdaptor();
+ securityAdaptor.setPrincipal(new SimplePrincipal(user.getUsername()));
+ securityAdaptor.setCredential(user.getPassword());
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/RequireEncryptionOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/RequireEncryptionOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireEncryptionOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+
+
+public class RequireEncryptionOperation extends RequireTargetableOperation
+{
+ public RequireEncryptionOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ super(header, store);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/RequireOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/RequireOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.w3c.dom.Document;
+
+/**
+ * Marker interface for all requirement based WS-Security operations.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public interface RequireOperation extends Operation
+{
+ public void process(Document message, List<Target> targets, String alias, String
credential, Collection<String> processedIds) throws WSSecurityException;
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/RequireSignatureOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/RequireSignatureOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireSignatureOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+
+
+public class RequireSignatureOperation extends RequireTargetableOperation
+{
+ public RequireSignatureOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ super(header, store);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/RequireTargetableOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/RequireTargetableOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireTargetableOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class RequireTargetableOperation implements RequireOperation
+{
+ public RequireTargetableOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ }
+
+ private Collection<String> resolveTarget(Document message, Target target) throws
WSSecurityException
+ {
+ if (target instanceof QNameTarget)
+ return resolveQNameTarget(message, (QNameTarget) target);
+ else if (target instanceof WsuIdTarget)
+ {
+ Collection<String> result = new ArrayList<String>(1);
+ result.add(((WsuIdTarget)target).getId());
+ return result;
+ }
+
+ throw new WSSecurityException("Unknown target");
+ }
+
+ private Collection<String> resolveQNameTarget(Document message, QNameTarget
target) throws WSSecurityException
+ {
+ QName name = target.getName();
+
+ Element element = Util.findElement(message.getDocumentElement(), name);
+ if (element == null)
+ throw new FailedCheckException("Required QName was not present: " +
name);
+
+ String id = Util.getWsuId(element);
+
+ if (id == null)
+ throw new FailedCheckException("Required element did not contain a
wsu:id.");
+
+ Collection<String> result = new ArrayList<String>(1);
+ result.add(id);
+
+ return result;
+ }
+
+ public void process(Document message, List<Target> targets, String alias, String
credential, Collection<String> processedIds) throws WSSecurityException
+ {
+ if (targets == null || targets.size() == 0)
+ {
+ // By default we require just the body element
+ String namespace = message.getDocumentElement().getNamespaceURI();
+ targets = new ArrayList<Target>(1);
+ targets.add(new QNameTarget(new QName(namespace, "Body"), true));
+ }
+
+ for (Target target : targets)
+ {
+ Collection<String> ids = resolveTarget(message, target);
+ if (! processedIds.containsAll(ids))
+ throw new FailedCheckException("Required elements for encryption and or
signing are not all present.");
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/RequireTimestampOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/RequireTimestampOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/RequireTimestampOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.List;
+
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.Timestamp;
+import org.w3c.dom.Document;
+
+
+public class RequireTimestampOperation implements RequireOperation
+{
+ private SecurityHeader header;
+
+ public RequireTimestampOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ this.header = header;
+ }
+
+ public void process(Document message, List<Target> targets, String maxAge,
String credential, Collection<String> processedIds) throws WSSecurityException
+ {
+ Timestamp stamp = header.getTimestamp();
+ if (stamp == null)
+ throw new FailedCheckException("Required timestamp not present.");
+
+ // If there is no maxAge specified then we are done
+ if (maxAge == null)
+ return;
+
+ int max = Integer.parseInt(maxAge);
+
+ Calendar expired = (Calendar)stamp.getCreated().clone();
+ expired.add(Calendar.SECOND, max);
+
+ if (! Calendar.getInstance().before(expired))
+ throw new FailedCheckException("Timestamp of message is too old.");
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/STRTransform.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/STRTransform.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/STRTransform.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/STRTransform.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.xml.security.c14n.CanonicalizationException;
+import org.apache.xml.security.c14n.Canonicalizer;
+import org.apache.xml.security.c14n.InvalidCanonicalizerException;
+import org.apache.xml.security.signature.XMLSignatureInput;
+import org.apache.xml.security.transforms.Transform;
+import org.apache.xml.security.transforms.TransformSpi;
+import org.apache.xml.security.transforms.TransformationException;
+import org.apache.xml.security.utils.XMLUtils;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.ThreadLocalAssociation;
+import org.jboss.ws.extensions.security.element.BinarySecurityToken;
+import org.jboss.ws.extensions.security.element.SecurityTokenReference;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+
+/**
+ * <code>STRTransform</code> implements the STR-Transform specified in the
+ * WS-Security specification. This class dynamically registers itself with
+ * XML Security on its first load (using a static initializer).
+ *
+ * You must call the static yet thread safe setSecurityStore() before use of
+ * this class.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class STRTransform extends TransformSpi
+{
+ public static final String STR_URI =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#STR-Transform";
+
+ static
+ {
+ try
+ {
+ Transform.register(STR_URI, STRTransform.class.getName());
+ }
+ catch (Exception e)
+ {
+ // Eat
+ }
+ }
+
+ private String canonicalize(Element element, Element method) throws
TransformationException, InvalidCanonicalizerException, CanonicalizationException
+ {
+ if (method == null || !
method.getLocalName().equals("CanonicalizationMethod"))
+ throw new TransformationException("CanonicalizationMethod
expected!");
+
+ String algorithm = method.getAttribute("Algorithm");
+ if (algorithm == null || algorithm.length() == 0)
+ throw new TransformationException("CanonicalizationMethod missing
algorithm!");
+
+ Canonicalizer canon = Canonicalizer.getInstance(algorithm);
+
+ return new String(canon.canonicalizeSubtree(element, "#default"));
+ }
+
+ @Override
+ protected String engineGetURI()
+ {
+ return STR_URI;
+ }
+
+
+ @Override
+ protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input) throws
IOException, CanonicalizationException,
+ InvalidCanonicalizerException, TransformationException,
ParserConfigurationException, SAXException
+ {
+
+ SecurityStore store = ThreadLocalAssociation.localStrTransformAssoc().get();
+
+ if (store == null)
+ throw new WSException("SecurityStore Thread Local not initialized before
call!");
+
+ try
+ {
+ if (! input.isElement())
+ throw new NotImplementedException("Only element input is
supported");
+
+ // Resolve the BinarySecurityToken associated with this SecurityTokenReference
+ Element element = (Element)input.getSubNode();
+ SecurityTokenReference ref = new SecurityTokenReference(element);
+ KeyResolver resolver = new KeyResolver(store);
+ BinarySecurityToken token = resolver.resolve(ref);
+
+ // Get the specially formated dom element for this element
+ element = token.getSTRTransformElement();
+
+ // Obtain the canonicalizer specified in the transformation parameters
+ Element parameters =
XMLUtils.selectNode(this._transformObject.getElement().getFirstChild(),
Constants.WSSE_NS,
+ "TransformationParameters", 0);
+ if (parameters == null)
+ throw new TransformationException("wsse:TransformationParameters
expected!");
+
+ Element method = Util.getFirstChildElement(parameters);
+ String transformed = canonicalize(element, method);
+
+ // Now WS-Security says we must augment the transformed output to ensure that
there is
+ // a default namespace
+ int startTag = transformed.indexOf('<');
+ int endTag = transformed.indexOf('>', startTag + 1);
+ String within = transformed.substring(startTag + 1, endTag);
+ if (! within.contains("xmlns="))
+ {
+ int insPos = within.indexOf(" ") + startTag + 1;
+ transformed = new StringBuilder(transformed).insert(insPos, "
xmlns=\"\"").toString();
+ }
+
+ return new XMLSignatureInput(transformed.getBytes());
+ }
+ catch (WSSecurityException e)
+ {
+ throw new TransformationException(e.getMessage(), e);
+ }
+ finally
+ {
+ ThreadLocalAssociation.localStrTransformAssoc().set(null);
+ }
+ }
+
+ public static void setSecurityStore(SecurityStore store)
+ {
+ ThreadLocalAssociation.localStrTransformAssoc().set(store);
+ }
+
+ public boolean wantsOctetStream()
+ {
+ return false;
+ }
+
+ public boolean wantsNodeSet()
+ {
+ return false;
+ }
+
+ public boolean returnsOctetStream()
+ {
+ return false;
+ }
+
+ public boolean returnsNodeSet()
+ {
+ return false;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptor.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityAdaptor.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityAdaptor.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+// $Id: SecurityAdaptor.java 314 2006-05-11 10:57:59Z thomas.diesler(a)jboss.com $
+
+import java.security.Principal;
+
+/**
+ * A container idependent security adaptor
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public interface SecurityAdaptor
+{
+ void setPrincipal(Principal pricipal);
+ void setCredential(Object credential);
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptorFactory.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityAdaptorFactory.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityAdaptorFactory.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityAdaptorFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+//$Id: SecurityAdaptorFactory.java 314 2006-05-11 10:57:59Z thomas.diesler(a)jboss.com $
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+
+/**
+ * A container idependent security adaptor factory
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public class SecurityAdaptorFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SecurityAdaptorFactory.class);
+
+ public static final String DEFAULT_FACTORY =
"org.jboss.ws.integration.SecurityAdaptorFactoryImpl";
+
+ private static SecurityAdaptorFactory delegate;
+
+ public static SecurityAdaptorFactory getInstance()
+ {
+ if (delegate == null)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Class factoryClass = ctxLoader.loadClass(DEFAULT_FACTORY);
+ delegate = (SecurityAdaptorFactory)factoryClass.newInstance();
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Cannot load: " + DEFAULT_FACTORY, e);
+ }
+ }
+ return delegate;
+ }
+
+ public SecurityAdaptor getSecurityAdaptor()
+ {
+ return delegate.getSecurityAdaptor();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityDecoder.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityDecoder.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.lang.reflect.Constructor;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+
+import org.jboss.ws.extensions.security.element.EncryptedKey;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.SecurityProcess;
+import org.jboss.ws.extensions.security.element.Signature;
+import org.jboss.ws.extensions.security.element.Timestamp;
+import org.jboss.ws.extensions.security.element.Token;
+import org.jboss.ws.extensions.security.element.UsernameToken;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class SecurityDecoder
+{
+ private Element headerElement;
+
+ private Calendar now = null;
+
+ private SecurityHeader header;
+
+ private Document message;
+
+ private SecurityStore store;
+
+ private HashSet<String> signedIds = new HashSet<String>();
+
+ private HashSet<String> encryptedIds = new HashSet<String>();
+
+ public SecurityDecoder(SecurityStore store)
+ {
+ org.apache.xml.security.Init.init();
+ this.store = store;
+ }
+
+ /**
+ * A special constructor that allows you to use a different value when validating the
message.
+ * DO NOT USE THIS UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!.
+ *
+ * @param SecurityStore the security store that contains key and trust information
+ * @param now The timestamp to use as the current time when validating a message
expiration
+ */
+ public SecurityDecoder(SecurityStore store, Calendar now)
+ {
+ this(store);
+ this.now = now;
+ }
+
+ private Element getHeader(Document message) throws WSSecurityException
+ {
+ Element header = Util.findElement(message.getDocumentElement(),
"Security", Constants.WSSE_NS);
+ if (header == null)
+ throw new WSSecurityException("Expected security header was not
found");
+
+ return header;
+ }
+
+ private void detachHeader()
+ {
+ headerElement.getParentNode().removeChild(headerElement);
+ }
+
+
+ private void decode() throws WSSecurityException
+ {
+ // Validate a timestamp if it is present
+ Timestamp timestamp = header.getTimestamp();
+
+ if (timestamp != null)
+ {
+ TimestampVerificationOperation operation =
+ (now == null) ? new TimestampVerificationOperation() : new
TimestampVerificationOperation(now);
+ operation.process(message, timestamp);
+ }
+
+ for (Token token : header.getTokens())
+ {
+ if (token instanceof UsernameToken)
+ new ReceiveUsernameOperation(header, store).process(message, token);
+ }
+
+ signedIds.clear();
+ encryptedIds.clear();
+
+ SignatureVerificationOperation signatureVerifier = new
SignatureVerificationOperation(header, store);
+ DecryptionOperation decrypter = new DecryptionOperation(header, store);
+
+ for (SecurityProcess process : header.getSecurityProcesses())
+ {
+ // If this list gets much larger it should probably be a hash lookup
+ if (process instanceof Signature)
+ {
+ Collection<String> ids = signatureVerifier.process(message, process);
+ if (ids != null)
+ signedIds.addAll(ids);
+ }
+ else if (process instanceof EncryptedKey)
+ {
+ Collection<String> ids = decrypter.process(message, process);
+ if (ids != null)
+ encryptedIds.addAll(ids);
+ }
+ }
+ }
+
+ public void verify(List<OperationDescription<RequireOperation>>
requireOperations) throws WSSecurityException
+ {
+ if (requireOperations == null)
+ return;
+
+ for (OperationDescription<RequireOperation> o : requireOperations)
+ {
+ Class<? extends RequireOperation> operation = o.getOperation();
+ RequireOperation op;
+ Collection<String> processedIds = null;
+
+ if (operation.equals(RequireSignatureOperation.class))
+ {
+ op = new RequireSignatureOperation(header, store);
+ processedIds = signedIds;
+ }
+ else if (operation.equals(RequireEncryptionOperation.class))
+ {
+ op = new RequireEncryptionOperation(header, store);
+ processedIds = encryptedIds;
+ }
+ else
+ {
+ try
+ {
+ Constructor<? extends RequireOperation> c =
operation.getConstructor(SecurityHeader.class, SecurityStore.class);
+ op = c.newInstance(header, store);
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Error constructing operation: " +
operation);
+ }
+ }
+
+ op.process(message, o.getTargets(), o.getCertificateAlias(), o.getCredential(),
processedIds);
+ }
+ }
+
+ public void decode(Document message) throws WSSecurityException
+ {
+ decode(message, getHeader(message));
+ }
+
+ public void decode(Document message, Element headerElement) throws
WSSecurityException
+ {
+ this.headerElement = headerElement;
+ this.header = new SecurityHeader(this.headerElement, store);
+ this.message = message;
+
+ decode();
+ }
+
+ public void complete()
+ {
+ // On completion we must remove the header so that no one else can process this
+ // message (required by the specification)
+ detachHeader();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityEncoder.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityEncoder.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityEncoder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.lang.reflect.Constructor;
+import java.util.List;
+
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+/**
+ * <code>SecurityEncoder</code> is responsible for transforming a SOAP
message
+ * into a WS-Security encoded message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class SecurityEncoder
+{
+ private List<OperationDescription<EncodingOperation>> operations;
+
+ private SecurityStore store;
+
+ public SecurityEncoder(List<OperationDescription<EncodingOperation>>
operations, SecurityStore store)
+ {
+ org.apache.xml.security.Init.init();
+ this.operations = operations;
+ this.store = store;
+ }
+
+ private void attachHeader(SecurityHeader header, Document message)
+ {
+ Element soapHeader = Util.findOrCreateSoapHeader(message.getDocumentElement());
+ try
+ {
+ Element wsse = header.getElement();
+ wsse.setAttributeNS(soapHeader.getNamespaceURI(), soapHeader.getPrefix() +
":mustUnderstand", "1");
+ soapHeader.insertBefore(wsse, soapHeader.getFirstChild());
+ }
+ catch (Exception e) {}
+
+ }
+
+ public void encode(Document message) throws WSSecurityException
+ {
+ SecurityHeader header = new SecurityHeader(message);
+ for (OperationDescription<EncodingOperation> o : operations)
+ {
+ EncodingOperation operation;
+
+ try
+ {
+ Constructor<? extends EncodingOperation> constructor =
o.getOperation().getConstructor(SecurityHeader.class, SecurityStore.class);
+ operation = constructor.newInstance(header, store);
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Error constructing operation: " +
o.getOperation());
+ }
+
+ operation.process(message, o.getTargets(), o.getCertificateAlias(),
o.getCredential(), o.getAlgorithm());
+ }
+ attachHeader(header, message);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityStore.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityStore.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,488 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.security;
+
+// $Id$
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.PrivateKey;
+import java.security.cert.CertPath;
+import java.security.cert.CertPathValidator;
+import java.security.cert.CertPathValidatorException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.cert.PKIXParameters;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.jboss.logging.Logger;
+
+/**
+ * <code>SecurityStore</code> holds and loads the keystore and truststore
required for encyption and signing.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @author <a href="mailto:jason.greene@jboss.com">Magesh Kumar
B</a>
+ * @version $Revision$
+ */
+public class SecurityStore
+{
+ private static Logger log = Logger.getLogger(SecurityStore.class);
+
+ private KeyStore keyStore;
+
+ private String keyStorePassword;
+
+ private KeyStore trustStore;
+
+ private String trustStorePassword;
+
+ public SecurityStore() throws WSSecurityException
+ {
+ this(null, null, null, null, null, null);
+ }
+
+ public SecurityStore(URL keyStoreURL, String keyStoreType, String keyStorePassword)
throws WSSecurityException
+ {
+ loadKeyStore(keyStoreURL, keyStoreType, keyStorePassword);
+ loadTrustStore(keyStoreURL, keyStoreType, keyStorePassword);
+ }
+
+ public SecurityStore(URL keyStoreURL, String keyStoreType, String keyStorePassword,
URL trustStoreURL, String trustStoreType, String trustStorePassword)
+ throws WSSecurityException
+ {
+ loadKeyStore(keyStoreURL, keyStoreType, keyStorePassword);
+ loadTrustStore(trustStoreURL, trustStoreType, trustStorePassword);
+ }
+
+ private void loadKeyStore(URL keyStoreURL, String keyStoreType, String
keyStorePassword) throws WSSecurityException
+ {
+ if (keyStorePassword == null)
+ keyStorePassword =
System.getProperty("org.jboss.ws.wsse.keyStorePassword");
+
+ keyStore = loadStore("org.jboss.ws.wsse.keyStore", "Keystore",
keyStoreURL, keyStoreType, keyStorePassword);
+ this.keyStorePassword = keyStorePassword;
+ }
+
+ private void loadTrustStore(URL trustStoreURL, String trustStoreType, String
trustStorePassword) throws WSSecurityException
+ {
+ if (trustStorePassword == null)
+ trustStorePassword =
System.getProperty("org.jboss.ws.wsse.trustStorePassword");
+
+ trustStore = loadStore("org.jboss.ws.wsse.trustStore",
"Truststore", trustStoreURL, trustStoreType, trustStorePassword);
+ this.trustStorePassword = trustStorePassword;
+ }
+
+ private KeyStore loadStore(String property, String type, URL storeURL, String
storeType, String storePassword) throws WSSecurityException
+ {
+ if (storeURL == null)
+ {
+ String defaultStore = System.getProperty(property);
+ if (defaultStore == null)
+ {
+ return null;
+ }
+
+ File storeFile = new File(defaultStore);
+ try
+ {
+ storeURL = storeFile.toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ throw new WSSecurityException("Problems loading " + type + ":
" + e.getMessage(), e);
+ }
+ }
+
+ if (storeType == null)
+ storeType = System.getProperty(property + "Type");
+ if (storeType == null)
+ storeType = "jks";
+
+ KeyStore keyStore = null;
+ try
+ {
+ log.debug("loadStore: " + storeURL);
+ InputStream stream = storeURL.openStream();
+ if (stream == null)
+ throw new WSSecurityException("Cannot load store from: " +
storeURL);
+
+ keyStore = KeyStore.getInstance(storeType);
+ if (keyStore == null)
+ throw new WSSecurityException("Cannot get keystore for type: " +
storeType);
+
+ String decryptedPassword = decryptPassword(storePassword);
+ if (decryptedPassword == null)
+ throw new WSSecurityException("Cannot decrypt store password");
+
+ keyStore.load(stream, decryptedPassword.toCharArray());
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (WSSecurityException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new WSSecurityException("Problems loading " + type + ":
" + ex.getMessage(), ex);
+ }
+
+ return keyStore;
+ }
+
+ /**
+ * This method examines the password for the presence of a encryption algorithm, if
found
+ * decrypts and returns the password, else returns the password as is.
+ */
+ private String decryptPassword(String password) throws WSSecurityException
+ {
+ log.trace("decrypt password: " + password);
+
+ if (password == null)
+ throw new WSSecurityException("Invalid null password for security
store");
+
+ if (password.charAt(0) == '{')
+ {
+ StringTokenizer tokenizer = new StringTokenizer(password, "{}");
+ String keyStorePasswordCmdType = tokenizer.nextToken();
+ String keyStorePasswordCmd = tokenizer.nextToken();
+ if (keyStorePasswordCmdType.equals("EXT"))
+ {
+ password = execPasswordCmd(keyStorePasswordCmd);
+ }
+ else if (keyStorePasswordCmdType.equals("CLASS"))
+ {
+ password = invokePasswordClass(keyStorePasswordCmd);
+ }
+ else
+ {
+ throw new WSSecurityException("Unknown keyStorePasswordCmdType: " +
keyStorePasswordCmdType);
+ }
+ }
+ if (password == null)
+ throw new WSSecurityException("Cannot decrypt password, result is
null");
+
+ log.trace("decrypted password: " + password);
+ return password;
+ }
+
+ private String execPasswordCmd(String keyStorePasswordCmd) throws WSSecurityException
+ {
+ log.debug("Executing command: " + keyStorePasswordCmd);
+ try
+ {
+ Runtime rt = Runtime.getRuntime();
+ Process p = rt.exec(keyStorePasswordCmd);
+ InputStream stdin = p.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(stdin));
+ String password = reader.readLine();
+ stdin.close();
+ int exitCode = p.waitFor();
+ log.debug("Command exited with: " + exitCode);
+ return password;
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems executing password command: "
+ keyStorePasswordCmd, e);
+ }
+ }
+
+ private String invokePasswordClass(String keyStorePasswordCmd) throws
WSSecurityException
+ {
+ String password = null;
+ String classname = keyStorePasswordCmd;
+ String ctorArg = null;
+ int colon = keyStorePasswordCmd.indexOf(':');
+ if (colon > 0)
+ {
+ classname = keyStorePasswordCmd.substring(0, colon);
+ ctorArg = keyStorePasswordCmd.substring(colon + 1);
+ }
+ log.debug("Loading class: " + classname + ", ctorArg=" +
ctorArg);
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class c = loader.loadClass(classname);
+ Object instance = null;
+ if (ctorArg != null)
+ {
+ Class[] sig = { String.class };
+ Constructor ctor = c.getConstructor(sig);
+ Object[] args = { ctorArg };
+ instance = ctor.newInstance(args);
+ }
+ else
+ {
+ instance = c.newInstance();
+ }
+ try
+ {
+ log.debug("Checking for toCharArray");
+ Class[] sig = {};
+ Method toCharArray = c.getMethod("toCharArray", sig);
+ Object[] args = {};
+ log.debug("Invoking toCharArray");
+ password = new String((char[])toCharArray.invoke(instance, args));
+ }
+ catch (NoSuchMethodException e)
+ {
+ log.debug("No toCharArray found, invoking toString");
+ password = instance.toString();
+ }
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems loading or invoking Password class
: " + classname, e);
+ }
+ return password;
+ }
+
+ public static byte[] getSubjectKeyIdentifier(X509Certificate cert)
+ {
+ // Maybee we should make one ourselves if it isn't there?
+ byte[] encoded = cert.getExtensionValue("2.5.29.14");
+ if (encoded == null)
+ return null;
+
+ // We need to skip 4 bytes [(OCTET STRING) (LENGTH)[(OCTET STRING) (LENGTH) (Actual
data)]]
+ int trunc = encoded.length - 4;
+
+ byte[] identifier = new byte[trunc];
+ System.arraycopy(encoded, 4, identifier, 0, trunc);
+
+ return identifier;
+ }
+
+ public X509Certificate getCertificate(String alias) throws WSSecurityException
+ {
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("KeyStore not set.");
+ }
+
+ X509Certificate cert;
+ try
+ {
+ cert = (X509Certificate)keyStore.getCertificate(alias);
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems retrieving cert: " +
e.getMessage(), e);
+ }
+
+ if (cert == null)
+ throw new WSSecurityException("Certificate (" + alias + ") not in
keystore");
+
+ return cert;
+ }
+
+ public X509Certificate getCertificateBySubjectKeyIdentifier(byte[] identifier) throws
WSSecurityException
+ {
+ if (identifier == null)
+ return null;
+
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("KeyStore not set.");
+ }
+
+ try
+ {
+ Enumeration i = keyStore.aliases();
+
+ while (i.hasMoreElements())
+ {
+ String alias = (String)i.nextElement();
+ Certificate cert = keyStore.getCertificate(alias);
+ if (!(cert instanceof X509Certificate))
+ continue;
+
+ byte[] subjectKeyIdentifier =
getSubjectKeyIdentifier((X509Certificate)cert);
+ if (subjectKeyIdentifier == null)
+ continue;
+
+ if (Arrays.equals(identifier, subjectKeyIdentifier))
+ return (X509Certificate)cert;
+ }
+ }
+ catch (KeyStoreException e)
+ {
+ throw new WSSecurityException("Problems retrieving cert: " +
e.getMessage(), e);
+ }
+
+ return null;
+ }
+
+ public X509Certificate getCertificateByIssuerSerial(String issuer, String serial)
throws WSSecurityException
+ {
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("KeyStore not set.");
+ }
+
+ try
+ {
+ Enumeration i = keyStore.aliases();
+
+ while (i.hasMoreElements())
+ {
+ String alias = (String)i.nextElement();
+ Certificate cert = keyStore.getCertificate(alias);
+ if (!(cert instanceof X509Certificate))
+ continue;
+
+ X509Certificate x509 = (X509Certificate)cert;
+ if (issuer.equals(x509.getIssuerDN().toString()) &&
serial.equals(x509.getSerialNumber().toString()))
+ return x509;
+ }
+ }
+ catch (KeyStoreException e)
+ {
+ throw new WSSecurityException("Problems retrieving cert: " +
e.getMessage(), e);
+ }
+
+ return null;
+ }
+
+ public PrivateKey getPrivateKey(String alias) throws WSSecurityException
+ {
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("KeyStore not set.");
+ }
+
+ PrivateKey key;
+ try
+ {
+ key = (PrivateKey)keyStore.getKey(alias,
decryptPassword(keyStorePassword).toCharArray());
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems retrieving private key: " +
e.getMessage(), e);
+ }
+
+ if (key == null)
+ throw new WSSecurityException("Private key (" + alias + ") not in
keystore");
+
+ return key;
+ }
+
+ public PrivateKey getPrivateKey(X509Certificate cert) throws WSSecurityException
+ {
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("KeyStore not set.");
+ }
+
+ try
+ {
+ String alias = keyStore.getCertificateAlias(cert);
+ return getPrivateKey(alias);
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems retrieving private key: " +
e.getMessage(), e);
+ }
+ }
+
+ public void validateCertificate(X509Certificate cert) throws WSSecurityException
+ {
+ try
+ {
+ cert.checkValidity();
+ }
+ catch (Exception e)
+ {
+ log.debug("Certificate is invalid", e);
+ throw new FailedAuthenticationException();
+ }
+
+ if (keyStore == null)
+ {
+ throw new WSSecurityException("TrustStore not set.");
+ }
+
+ // Check for the exact entry in the truststore first, then fallback to a CA check
+ try
+ {
+ if (trustStore.getCertificateAlias(cert) != null)
+ {
+ return;
+ }
+ }
+ catch (KeyStoreException e)
+ {
+ throw new WSSecurityException("Problems searching truststore", e);
+ }
+
+ List list = new ArrayList(1);
+ list.add(cert);
+
+ CertPath cp;
+ CertPathValidator cpv;
+ PKIXParameters parameters;
+
+ try
+ {
+ cp = CertificateFactory.getInstance("X.509").generateCertPath(list);
+ cpv = CertPathValidator.getInstance("PKIX");
+ parameters = new PKIXParameters(trustStore);
+
+ // We currently don't support CRLs
+ parameters.setRevocationEnabled(false);
+ }
+ catch (Exception e)
+ {
+ throw new WSSecurityException("Problems setting up certificate
validation", e);
+ }
+
+ try
+ {
+ cpv.validate(cp, parameters);
+ }
+ catch (CertPathValidatorException cpve)
+ {
+ log.debug("Certificate is invalid:", cpve);
+ throw new FailedAuthenticationException();
+ }
+ catch (InvalidAlgorithmParameterException e)
+ {
+ throw new WSSecurityException("Problems setting up certificate
validation", e);
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityTokenUnavailableException.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SecurityTokenUnavailableException.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SecurityTokenUnavailableException.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class SecurityTokenUnavailableException extends WSSecurityException
+{
+ public static final QName faultCode = new QName(Constants.WSSE_NS,
"SecurityTokenUnavailable", Constants.WSSE_PREFIX);
+
+ public static final String faultString = "Referenced security token could not be
retrieved.";
+
+ public SecurityTokenUnavailableException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public SecurityTokenUnavailableException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public SecurityTokenUnavailableException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public SecurityTokenUnavailableException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SendUsernameOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SendUsernameOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SendUsernameOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.util.List;
+
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.UsernameToken;
+import org.w3c.dom.Document;
+
+public class SendUsernameOperation implements EncodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public SendUsernameOperation(SecurityHeader header, SecurityStore store)
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ public void process(Document message, List<Target> targets, String alias, String
credential, String algorithm) throws WSSecurityException
+ {
+ header.addToken(new UsernameToken(alias, credential, message));
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SignatureOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SignatureOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SignatureOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,178 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xml.security.c14n.Canonicalizer;
+import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.signature.XMLSignatureException;
+import org.apache.xml.security.transforms.TransformationException;
+import org.apache.xml.security.transforms.Transforms;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.security.element.DirectReference;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.SecurityTokenReference;
+import org.jboss.ws.extensions.security.element.Signature;
+import org.jboss.ws.extensions.security.element.X509Token;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+public class SignatureOperation implements EncodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public SignatureOperation(SecurityHeader header, SecurityStore store) throws
WSSecurityException
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ private void processTarget(XMLSignature sig, Document message, Target target)
+ {
+ if (target instanceof QNameTarget)
+ processQNameTarget(sig, message, (QNameTarget) target);
+ else if (target instanceof WsuIdTarget)
+ processWsuIdTarget(sig, message, (WsuIdTarget) target);
+ else
+ throw new NotImplementedException();
+ }
+
+ private void processQNameTarget(XMLSignature sig, Document message, QNameTarget
target)
+ {
+ QName name = target.getName();
+
+ Transforms transforms = new Transforms(message);
+ try
+ {
+ transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
+ }
+ catch (TransformationException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ Element element = Util.findElement(message.getDocumentElement(), name);
+ if (element == null)
+ throw new RuntimeException("Could not find element");
+
+ String id = Util.assignWsuId(element);
+
+ try
+ {
+ sig.addDocument("#" + id, transforms);
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void processWsuIdTarget(XMLSignature sig, Document message, WsuIdTarget
target)
+ {
+ String id = target.getId();
+
+ Transforms transforms = new Transforms(message);
+ try
+ {
+ transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
+ }
+ catch (TransformationException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ try
+ {
+ sig.addDocument("#" + id, transforms);
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void process(Document message, List<Target> targets, String alias, String
credential, String algorithm) throws WSSecurityException
+ {
+ Element envelope = message.getDocumentElement();
+ XMLSignature sig;
+ try
+ {
+ sig = new XMLSignature(message, null, XMLSignature.ALGO_ID_SIGNATURE_RSA,
Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+ }
+ catch (XMLSecurityException e)
+ {
+ throw new WSSecurityException("Error building signature", e);
+ }
+
+ // For now we pass our resolver the root document because the signature element
isn't attached
+ // to the evelope yet (no wsse header). Perhaps we should do this differently
+ sig.addResourceResolver(new WsuIdResolver(message, header.getElement()));
+ PrivateKey key = store.getPrivateKey(alias);
+
+ if (targets == null || targets.size() == 0)
+ {
+ // By default we sign the body element, and a timestamp if it is available
+ String namespace = envelope.getNamespaceURI();
+ processTarget(sig, message, new QNameTarget(new QName(namespace,
"Body")));
+ if (header.getTimestamp() != null)
+ processTarget(sig, message, new WsuIdTarget("timestamp"));
+ }
+ else
+ {
+ for (Target target : targets)
+ processTarget(sig, message, target);
+ }
+
+ try
+ {
+ sig.sign(key);
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new WSSecurityException("Error signing message: " +
e.getMessage(), e);
+ }
+
+ X509Certificate cert = store.getCertificate(alias);
+ X509Token token = (X509Token) header.getSharedToken(cert);
+
+ // Can we reuse an existing token?
+ if (token == null)
+ {
+ token = new X509Token(cert, message);
+ header.addToken(token);
+ }
+
+ SecurityTokenReference reference = new SecurityTokenReference(new
DirectReference(message, token));
+ sig.getKeyInfo().addUnknownElement(reference.getElement());
+
+ header.addSecurityProcess(new Signature(sig));
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SignatureVerificationOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SignatureVerificationOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SignatureVerificationOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.
+*/
+package org.jboss.ws.extensions.security;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.apache.xml.security.signature.SignedInfo;
+import org.apache.xml.security.signature.XMLSignature;
+import org.apache.xml.security.signature.XMLSignatureException;
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.SecurityProcess;
+import org.jboss.ws.extensions.security.element.Signature;
+import org.w3c.dom.Document;
+
+public class SignatureVerificationOperation implements DecodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public SignatureVerificationOperation(SecurityHeader header, SecurityStore store)
throws WSSecurityException
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ public Collection<String> process(Document message, SecurityProcess process)
throws WSSecurityException
+ {
+ Signature signature = (Signature) process;
+ XMLSignature xmlSig = signature.getSignature();
+
+ xmlSig.addResourceResolver(new WsuIdResolver(message));
+ STRTransform.setSecurityStore(store);
+
+ try
+ {
+ if (! xmlSig.checkSignatureValue(signature.getPublicKey()))
+ throw new FailedCheckException("Signature is invalid.");
+ }
+ catch (XMLSignatureException e)
+ {
+ throw new WSSecurityException("An unexpected error occured while verifying
signature", e);
+ }
+ finally
+ {
+ STRTransform.setSecurityStore(null);
+ }
+
+ SignedInfo info = xmlSig.getSignedInfo();
+ int length = info.getLength();
+ Collection<String> processed = new ArrayList<String>(length);
+ try
+ {
+ for (int i = 0; i < length; i++)
+ {
+ String uri = info.item(i).getURI();
+ if (uri != null && uri.length() > 1 &&
uri.charAt(0)=='#')
+ processed.add(uri.substring(1));
+ }
+ }
+ catch (XMLSecurityException e)
+ {
+ throw new WSSecurityException("Could not extract references", e);
+ }
+
+ return processed;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SimplePrincipal.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SimplePrincipal.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/SimplePrincipal.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/SimplePrincipal.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.io.Serializable;
+import java.security.Principal;
+
+/** A simple String based implementation of Principal.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class SimplePrincipal implements Principal, Serializable
+{
+ private static final long serialVersionUID = 136345402844480211L;
+
+ private String name;
+
+ public SimplePrincipal(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof Principal))
+ return false;
+
+ return toString().equals(((Principal)obj).getName());
+ }
+
+ public int hashCode()
+ {
+ return (name == null ? 0 : name.hashCode());
+ }
+
+ public String toString()
+ {
+ return "" + name;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Target.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/Target.java)
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/Target.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Target.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+abstract public class Target
+{
+ // Applies only to encryption
+ abstract public boolean isContent();
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/TimestampOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/TimestampOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/TimestampOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.util.List;
+
+import org.jboss.ws.extensions.security.element.SecurityHeader;
+import org.jboss.ws.extensions.security.element.Timestamp;
+import org.w3c.dom.Document;
+
+public class TimestampOperation implements EncodingOperation
+{
+ private SecurityHeader header;
+
+ private SecurityStore store;
+
+ public TimestampOperation(SecurityHeader header, SecurityStore store)
+ {
+ this.header = header;
+ this.store = store;
+ }
+
+ public void process(Document message, List<Target> targets, String alias, String
credential, String algorithm) throws WSSecurityException
+ {
+ Integer ttl = null;
+
+ try
+ {
+ // Time to live is stuffed in the credential field
+ ttl = Integer.valueOf(credential);
+ }
+ catch (NumberFormatException e)
+ {
+ // Eat
+ }
+
+ header.setTimestamp(new Timestamp(ttl, message));
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/TimestampVerificationOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/TimestampVerificationOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/TimestampVerificationOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import java.util.Calendar;
+
+import org.jboss.ws.extensions.security.element.Timestamp;
+import org.w3c.dom.Document;
+
+
+public class TimestampVerificationOperation
+{
+ private Calendar now = null;
+
+ public TimestampVerificationOperation()
+ {
+ }
+
+ /**
+ * A special constructor that allows you to use a different value when validating the
message.
+ * DO NOT USE THIS UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!.
+ *
+ * @param now The timestamp to use as the current time when validating a message
expiration
+ */
+ public TimestampVerificationOperation(Calendar now)
+ {
+ this.now = now;
+ }
+
+ public void process(Document message, Timestamp timestamp) throws WSSecurityException
+ {
+ Calendar expired = timestamp.getExpires();
+ Calendar created = timestamp.getCreated();
+ Calendar now = (this.now == null) ? Calendar.getInstance() : this.now;
+
+ if (created.after(now))
+ throw new WSSecurityException("Invalid timestamp, message claimed to be
created after now");
+
+ if (expired != null && ! now.before(expired))
+ throw new FailedCheckException("Expired message.");
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/TokenOperation.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/TokenOperation.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/TokenOperation.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+import org.jboss.ws.extensions.security.element.Token;
+import org.w3c.dom.Document;
+
+/**
+ * <code>DecodingOperation</code> represents an operation that is applied to
a
+ * WS-Security encoded message to both convert and verify the contents of the
+ * message.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public interface TokenOperation
+{
+ public void process(Document message, Token token) throws WSSecurityException;
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/UnsupportedAlgorithmException.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/UnsupportedAlgorithmException.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/UnsupportedAlgorithmException.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+
+public class UnsupportedAlgorithmException extends WSSecurityException
+{
+ public static final QName faultCode = new QName("UnsupportedAlgorithm",
Constants.WSSE_PREFIX, Constants.WSSE_NS);
+
+ public static final String faultString = "An unsupported signature or encryption
algorithm was used.";
+
+ public UnsupportedAlgorithmException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedAlgorithmException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedAlgorithmException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public UnsupportedAlgorithmException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/UnsupportedSecurityTokenException.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/UnsupportedSecurityTokenException.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/UnsupportedSecurityTokenException.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class UnsupportedSecurityTokenException extends WSSecurityException
+{
+ public static final QName faultCode = new QName("UnsupportedSecurityToken",
Constants.WSSE_PREFIX, Constants.WSSE_NS);
+
+ public static final String faultString = "An unsupported token was
provided.";
+
+ public UnsupportedSecurityTokenException()
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedSecurityTokenException(Throwable cause)
+ {
+ super(faultString);
+ setFaultCode(faultCode);
+ setFaultString(faultString);
+ }
+
+ public UnsupportedSecurityTokenException(String message)
+ {
+ super(message);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+
+ public UnsupportedSecurityTokenException(String message, Throwable cause)
+ {
+ super(message, cause);
+ setFaultCode(faultCode);
+ setFaultString(message);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Util.java
(from rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/Util.java)
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/Util.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/Util.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,217 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @author Jason T. Greene
+ * @version $Id$
+ */
+public class Util
+{
+ public static int count = 0;
+
+ public static String assignWsuId(Element element)
+ {
+ String id = element.getAttributeNS(Constants.WSU_NS, Constants.ID);
+
+ if (id == null || id.length() < 1)
+ {
+ id = generateId();
+ element.setAttributeNS(Constants.WSU_NS, Constants.WSU_ID, id);
+ addNamespace(element, Constants.WSU_PREFIX, Constants.WSU_NS);
+ }
+
+ return id;
+ }
+
+ public static Element getFirstChildElement(Node node)
+ {
+ Node child = node.getFirstChild();
+ while (child != null && child.getNodeType() != Node.ELEMENT_NODE)
+ child = child.getNextSibling();
+
+ return (Element)child;
+ }
+
+ public static Element getNextSiblingElement(Element element)
+ {
+ Node sibling = element.getNextSibling();
+ while (sibling != null && sibling.getNodeType() != Node.ELEMENT_NODE)
+ sibling = sibling.getNextSibling();
+
+ return (Element)sibling;
+ }
+
+ public static Element getPreviousSiblingElement(Element element)
+ {
+ Node sibling = element.getPreviousSibling();
+ while (sibling != null && sibling.getNodeType() != Node.ELEMENT_NODE)
+ sibling = sibling.getPreviousSibling();
+
+ return (Element)sibling;
+ }
+
+ public static Element findElement(Element root, String localName, String namespace)
+ {
+ return findElement(root, new QName(namespace, localName));
+ }
+
+ public static Element findElement(Element root, QName name)
+ {
+ // Here lies your standard recusive DFS.....
+ if (matchNode(root, name))
+ return root;
+
+ // Search children
+ for (Node child = root.getFirstChild(); child != null; child =
child.getNextSibling())
+ {
+ if (child.getNodeType() != Node.ELEMENT_NODE)
+ continue;
+
+ Node possibleMatch = findElement((Element)child, name);
+ if (possibleMatch != null)
+ return (Element)possibleMatch;
+ }
+
+ return null;
+ }
+
+ public static List<Node> findAllElements(Element root, QName name, boolean
local)
+ {
+ List<Node> list = new ArrayList<Node>();
+ if (matchNode(root, name, local))
+ list.add(root);
+
+ for (Node child = root.getFirstChild(); child != null; child =
child.getNextSibling())
+ {
+ if (child.getNodeType() != Node.ELEMENT_NODE)
+ continue;
+
+ list.addAll(findAllElements((Element) child, name, local));
+ }
+
+ return list;
+ }
+
+ public static Element findElementByWsuId(Element root, String id)
+ {
+ // Here lies another standard recusive DFS.....
+ if (id.equals(getWsuId(root)))
+ return root;
+
+ // Search children
+ for (Node child = root.getFirstChild(); child != null; child =
child.getNextSibling())
+ {
+ if (child.getNodeType() != Node.ELEMENT_NODE)
+ continue;
+
+ Node possibleMatch = findElementByWsuId((Element)child, id);
+ if (possibleMatch != null)
+ return (Element)possibleMatch;
+ }
+
+ return null;
+ }
+
+ public static Element findOrCreateSoapHeader(Element envelope)
+ {
+ String prefix = envelope.getPrefix();
+ String uri = envelope.getNamespaceURI();
+ QName name = new QName(uri, "Header");
+ Element header = findElement(envelope, name);
+ if (header == null)
+ {
+ header = envelope.getOwnerDocument().createElementNS(uri, prefix +
":Header");
+ envelope.insertBefore(header, envelope.getFirstChild());
+ }
+
+ return header;
+ }
+
+ public static String getWsuId(Element element)
+ {
+ if (element.hasAttributeNS(Constants.WSU_NS, Constants.ID))
+ return element.getAttributeNS(Constants.WSU_NS, Constants.ID);
+
+ if (element.hasAttribute(Constants.ID))
+ {
+ String ns = element.getNamespaceURI();
+ if (Constants.XML_SIGNATURE_NS.equals(ns) ||
Constants.XML_ENCRYPTION_NS.equals(ns))
+ return element.getAttribute(Constants.ID);
+ }
+
+ return null;
+ }
+
+ public static boolean equalStrings(String string1, String string2)
+ {
+ if (string1 == null && string2 == null)
+ return true;
+
+ return string1 != null && string1.equals(string2);
+ }
+
+ public static boolean matchNode(Node node, QName name)
+ {
+ return matchNode(node, name, false);
+ }
+
+ public static boolean matchNode(Node node, QName name, boolean local)
+ {
+ return equalStrings(node.getLocalName(), name.getLocalPart())
+ && (local || equalStrings(node.getNamespaceURI(),
name.getNamespaceURI()));
+ }
+
+ public static String generateId()
+ {
+ return generateId("element");
+ }
+
+ public static void addNamespace(Element element, String prefix, String uri)
+ {
+ element.setAttributeNS(Constants.XMLNS_NS, "xmlns:" + prefix, uri);
+ }
+
+ public static String generateId(String prefix)
+ {
+ StringBuilder id = new StringBuilder();
+ long time = System.currentTimeMillis();
+
+ // reasonably gaurantee uniqueness
+ synchronized (Util.class)
+ {
+ count++;
+ }
+
+
id.append(prefix).append("-").append(count).append("-").append(time).append("-").append(id.hashCode());
+
+ return id.toString();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/WSSecurityDispatcher.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/WSSecurityDispatcher.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,303 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.extensions.security;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Stub;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.OperationMetaData;
+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
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(WSSecurityDispatcher.class);
+
+ private static List<Target>
convertTargets(List<org.jboss.ws.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)
+ {
+ if ("qname".equals(target.getType()))
+ {
+ QNameTarget qnameTarget = new QNameTarget(QName.valueOf(target.getValue()),
target.isContentOnly());
+ newList.add(qnameTarget);
+ }
+ else if ("wsuid".equals(target.getType()))
+ {
+ newList.add(new WsuIdTarget(target.getValue()));
+ }
+ }
+
+ return newList;
+ }
+
+ private static Config getConfig(WSSecurityConfiguration config, String portName,
String operationName)
+ {
+ Port port = config.getPorts().get(portName);
+ if (port == null)
+ return config.getDefaultConfig();
+
+ Operation operation = port.getOperations().get(operationName);
+ if (operation == null)
+ {
+ Config portConfig = port.getDefaultConfig();
+ return (portConfig == null) ? config.getDefaultConfig() : portConfig;
+
+ }
+
+ return operation.getConfig();
+ }
+
+ private static SOAPFaultException convertToFault(WSSecurityException e)
+ {
+ return new SOAPFaultException(e.getFaultCode(), e.getFaultString(), null, null);
+ }
+
+ public static void handleInbound(CommonMessageContext ctx) throws SOAPException,
SOAPFaultException
+ {
+ WSSecurityConfiguration config = getSecurityConfig(ctx);
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
+
+ SOAPHeader soapHeader = soapMessage.getSOAPHeader();
+ QName secQName = new QName(Constants.WSSE_NS, "Security");
+ Element secHeaderElement = Util.findElement(soapHeader, secQName);
+
+ if (secHeaderElement == null)
+ {
+ // This is ok, we always allow faults to be received because WS-Security does
not encrypt faults
+ if (soapMessage.getSOAPBody().getFault() != null)
+ return;
+
+ OperationMetaData opMetaData = ctx.getOperationMetaData();
+ if (opMetaData == null)
+ {
+ // Get the operation meta data from the soap message
+ // for the server side inbound message.
+ EndpointMetaData epMetaData = ctx.getEndpointMetaData();
+ opMetaData = soapMessage.getOperationMetaData(epMetaData);
+ }
+
+ String operation = opMetaData.getQName().toString();
+ String port = opMetaData.getEndpointMetaData().getQName().getLocalPart();
+
+ if (hasRequirements(config, operation, port))
+ throw convertToFault(new InvalidSecurityHeaderException("This service
requires <wsse:Security>, which is missing."));
+
+ return;
+ }
+
+ try
+ {
+ SecurityStore securityStore = new SecurityStore(config.getKeyStoreURL(),
config.getKeyStoreType(), config.getKeyStorePassword(), config.getTrustStoreURL(),
+ config.getTrustStoreType(), config.getTrustStorePassword());
+ SecurityDecoder decoder = new SecurityDecoder(securityStore);
+
+ decoder.decode(soapMessage.getSOAPPart(), secHeaderElement);
+ log.debug("Decoded Message:\n" +
DOMWriter.printNode(soapMessage.getSOAPPart(), true));
+
+ OperationMetaData opMetaData = ctx.getOperationMetaData();
+ if (opMetaData == null)
+ {
+ // Get the operation meta data from the soap message
+ // for the server side inbound message.
+ EndpointMetaData epMetaData = ctx.getEndpointMetaData();
+ opMetaData = soapMessage.getOperationMetaData(epMetaData);
+ }
+
+ String operation = opMetaData.getQName().toString();
+ String port = opMetaData.getEndpointMetaData().getQName().getLocalPart();
+
+ List<OperationDescription<RequireOperation>> operations =
buildRequireOperations(config, operation, port);
+
+ decoder.verify(operations);
+ log.debug("Verification is successful");
+
+ decoder.complete();
+ }
+ catch (WSSecurityException e)
+ {
+ if (e.isInternalError())
+ log.error("Internal error occured handling inbound message:", e);
+ else log.debug("Returning error to sender: " + e.getMessage());
+
+ throw convertToFault(e);
+ }
+ }
+
+ private static WSSecurityConfiguration getSecurityConfig(CommonMessageContext ctx)
+ {
+ WSSecurityConfiguration config =
ctx.getEndpointMetaData().getServiceMetaData().getSecurityConfiguration();
+ if (config == null)
+ throw new WSException("Cannot obtatin security configuration from message
context");
+
+ return config;
+ }
+
+ private static boolean hasRequirements(WSSecurityConfiguration config, String
operation, String port)
+ {
+ Config operationConfig = getConfig(config, port, operation);
+ return (operationConfig != null && operationConfig.getRequires() != null);
+ }
+
+ private static List<OperationDescription<RequireOperation>>
buildRequireOperations(WSSecurityConfiguration config, String operation, String port)
+ {
+ Config operationConfig = getConfig(config, port, operation);
+ if (operationConfig == null)
+ return null;
+
+ Requires requires = operationConfig.getRequires();
+ if (requires == null)
+ return null;
+
+ ArrayList<OperationDescription<RequireOperation>> operations = new
ArrayList<OperationDescription<RequireOperation>>();
+ RequireTimestamp requireTimestamp = requires.getRequireTimestamp();
+ if (requireTimestamp != null)
+ operations.add(new
OperationDescription<RequireOperation>(RequireTimestampOperation.class, null,
requireTimestamp.getMaxAge(), null, null));
+
+ RequireSignature requireSignature = requires.getRequireSignature();
+ if (requireSignature != null)
+ {
+ List<Target> targets = convertTargets(requireSignature.getTargets());
+ operations.add(new
OperationDescription<RequireOperation>(RequireSignatureOperation.class, targets,
null, null, null));
+ }
+
+ RequireEncryption requireEncryption = requires.getRequireEncryption();
+ if (requireEncryption != null)
+ {
+ List<Target> targets = convertTargets(requireEncryption.getTargets());
+ operations.add(new
OperationDescription<RequireOperation>(RequireEncryptionOperation.class, targets,
null, null, null));
+ }
+
+ return operations;
+ }
+
+ public static void handleOutbound(CommonMessageContext ctx) throws SOAPException,
SOAPFaultException
+ {
+ WSSecurityConfiguration config = getSecurityConfig(ctx);
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
+
+ OperationMetaData opMetaData = ctx.getOperationMetaData();
+ String operation = opMetaData.getQName().toString();
+ String port = opMetaData.getEndpointMetaData().getQName().getLocalPart();
+
+ Config operationConfig = getConfig(config, port, operation);
+
+ log.debug("WS-Security config:" + operationConfig);
+ // Nothing to process
+ if (operationConfig == null)
+ return;
+
+ ArrayList<OperationDescription<EncodingOperation>> operations = new
ArrayList<OperationDescription<EncodingOperation>>();
+ Timestamp timestamp = operationConfig.getTimestamp();
+ if (timestamp != null)
+ {
+ operations.add(new
OperationDescription<EncodingOperation>(TimestampOperation.class, null, null,
timestamp.getTtl(), null));
+ }
+
+ if (operationConfig.getUsername() != null)
+ {
+ Object user = ctx.getProperty(Stub.USERNAME_PROPERTY);
+ Object pass = ctx.getProperty(Stub.PASSWORD_PROPERTY);
+
+ if (user != null && pass != null)
+ {
+ operations.add(new
OperationDescription<EncodingOperation>(SendUsernameOperation.class, null,
user.toString(), pass.toString(), null));
+ ctx.setProperty(StubExt.PROPERTY_AUTH_TYPE,
StubExt.PROPERTY_AUTH_TYPE_WSSE);
+ }
+ }
+
+ Sign sign = operationConfig.getSign();
+ if (sign != null)
+ {
+ List<Target> targets = convertTargets(sign.getTargets());
+ if (sign.isIncludeTimestamp())
+ {
+ if (timestamp == null)
+ operations.add(new
OperationDescription<EncodingOperation>(TimestampOperation.class, null, null, null,
null));
+
+ if (targets != null && targets.size() > 0)
+ targets.add(new WsuIdTarget("timestamp"));
+ }
+
+ operations.add(new
OperationDescription<EncodingOperation>(SignatureOperation.class, targets,
sign.getAlias(), null, null));
+ }
+
+ Encrypt encrypt = operationConfig.getEncrypt();
+ if (encrypt != null)
+ {
+ List<Target> targets = convertTargets(encrypt.getTargets());
+ operations.add(new
OperationDescription<EncodingOperation>(EncryptionOperation.class, targets,
encrypt.getAlias(), null, encrypt.getAlgorithm()));
+ }
+
+ if (operations.size() == 0)
+ return;
+
+ log.debug("Encoding Message:\n" +
DOMWriter.printNode(soapMessage.getSOAPPart(), true));
+
+ try
+ {
+ SecurityStore securityStore = new SecurityStore(config.getKeyStoreURL(),
config.getKeyStoreType(), config.getKeyStorePassword(), config.getTrustStoreURL(),
+ config.getTrustStoreType(), config.getTrustStorePassword());
+ SecurityEncoder encoder = new SecurityEncoder(operations, securityStore);
+ encoder.encode(soapMessage.getSOAPPart());
+ }
+ catch (WSSecurityException e)
+ {
+ if (e.isInternalError())
+ log.error("Internal error occured handling outbound message:", e);
+ else log.debug("Returning error to sender: " + e.getMessage());
+
+ throw convertToFault(e);
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/WSSecurityException.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/WSSecurityException.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WSSecurityException.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.security;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WSSecurityException extends Exception
+{
+ private boolean internal = false;
+
+ private QName faultCode = new QName(Constants.JBOSS_WSSE_NS,
"InternalError", Constants.JBOSS_WSSE_PREFIX);
+
+ private String faultString = "An internal WS-Security error occurred. See log for
details";
+
+ public WSSecurityException(String message)
+ {
+ super(message);
+ this.internal = true;
+ }
+
+ public WSSecurityException(String message, Throwable cause)
+ {
+ super(message, cause);
+ this.internal = true;
+ }
+
+ protected void setFaultCode(QName faultCode)
+ {
+ this.faultCode = faultCode;
+ }
+
+ protected void setFaultString(String faultMessage)
+ {
+ this.faultString = faultMessage;
+ }
+
+ public boolean isInternalError()
+ {
+ return internal;
+ }
+
+ public QName getFaultCode()
+ {
+ return faultCode;
+ }
+
+ public String getFaultString()
+ {
+ return faultString;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WsuIdResolver.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/WsuIdResolver.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/WsuIdResolver.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WsuIdResolver.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.
+*/
+package org.jboss.ws.extensions.security;
+
+import org.apache.xml.security.signature.XMLSignatureInput;
+import org.apache.xml.security.utils.resolver.ResourceResolverException;
+import org.apache.xml.security.utils.resolver.ResourceResolverSpi;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Jason T. Greene
+ * @version $Id$
+ */
+public class WsuIdResolver extends ResourceResolverSpi
+{
+ Document doc;
+ Element header;
+
+ public WsuIdResolver(Document doc)
+ {
+ this.doc = doc;
+ }
+
+ public WsuIdResolver(Document doc, Element header)
+ {
+ this.doc = doc;
+ this.header = header;
+ }
+
+ /**
+ * @see
org.apache.xml.security.utils.resolver.ResourceResolverSpi#engineCanResolve(org.w3c.dom.Attr,
java.lang.String)
+ */
+ public boolean engineCanResolve(Attr uri, String baseURI)
+ {
+ if (uri == null)
+ return false;
+
+ String nodeValue = uri.getNodeValue();
+ return nodeValue != null && nodeValue.startsWith("#");
+ }
+
+ /**
+ * @see
org.apache.xml.security.utils.resolver.ResourceResolverSpi#engineResolve(org.w3c.dom.Attr,
java.lang.String)
+ */
+ public XMLSignatureInput engineResolve(Attr uri, String BaseURI) throws
ResourceResolverException
+ {
+ //Document doc = uri.getOwnerDocument();
+ String id = uri.getValue().substring(1);
+
+ Element element = doc.getDocumentElement();
+ element = Util.findElementByWsuId(element, id);
+
+ // If its not in the document, try the header
+ if (element == null && header != null)
+ element = Util.findElementByWsuId(header, id);
+
+ if (element == null)
+ throw new ResourceResolverException(id, uri, BaseURI);
+
+ XMLSignatureInput input = new XMLSignatureInput(element);
+ input.setMIMEType("text/xml");
+
+ input.setSourceURI(BaseURI + uri);
+
+ return input;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WsuIdTarget.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/WsuIdTarget.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/WsuIdTarget.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/WsuIdTarget.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,56 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security;
+
+
+/**
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WsuIdTarget extends Target
+{
+ private String id;
+
+ private boolean content;
+
+ public WsuIdTarget(String url)
+ {
+ this.id = url;
+ this.content = false;
+ }
+
+ public WsuIdTarget(String url, boolean content)
+ {
+ this(url);
+ this.content = content;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public boolean isContent()
+ {
+ return content;
+ }
+}
\ No newline at end of file
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element (from
rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/BinarySecurityToken.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/BinarySecurityToken.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/DirectReference.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/DirectReference.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,10 +19,10 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -32,8 +32,8 @@
* retrievable via a URL. This is typically used for refering to a
* <code>BinarySecurityToken</code> that is within the same message.
*
- * @see org.jboss.ws.wsse.element.SecurityTokenReference
- * @see org.jboss.ws.wsse.element.BinarySecurityToken
+ * @see org.jboss.ws.extensions.security.element.SecurityTokenReference
+ * @see org.jboss.ws.extensions.security.element.BinarySecurityToken
*
* @author Jason T. Greene
* @version $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/EncryptedKey.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
import java.security.PrivateKey;
@@ -28,11 +28,11 @@
import org.apache.xml.security.encryption.XMLCipher;
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.keys.KeyInfo;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.InvalidSecurityHeaderException;
-import org.jboss.ws.wsse.KeyResolver;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.InvalidSecurityHeaderException;
+import org.jboss.ws.extensions.security.KeyResolver;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/KeyIdentifier.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/KeyIdentifier.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
import java.security.cert.X509Certificate;
import org.apache.xml.security.exceptions.Base64DecodingException;
import org.apache.xml.security.utils.Base64;
import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -38,8 +38,8 @@
* X.509v3 Subject Key Identifier, which is the only currently
* supported key identifier by this class.
*
- * @see org.jboss.ws.wsse.element.SecurityTokenReference
- * @see org.jboss.ws.wsse.element.BinarySecurityToken
+ * @see org.jboss.ws.extensions.security.element.SecurityTokenReference
+ * @see org.jboss.ws.extensions.security.element.BinarySecurityToken
*
* @author Jason T. Greene
* @version $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Reference.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/Reference.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Reference.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,9 +19,9 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Element;
abstract public class Reference implements SecurityElement
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/ReferenceList.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/ReferenceList.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/ReferenceList.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import org.apache.xml.security.encryption.Reference;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.Util;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.Util;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/SecurityElement.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityElement.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,9 +19,9 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/SecurityHeader.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,18 +19,18 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
import java.util.HashMap;
import java.util.LinkedList;
-import org.jboss.ws.wsse.BinarySecurityTokenValidator;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.KeyResolver;
-import org.jboss.ws.wsse.SecurityStore;
-import org.jboss.ws.wsse.UnsupportedSecurityTokenException;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.BinarySecurityTokenValidator;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.KeyResolver;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.UnsupportedSecurityTokenException;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityProcess.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/SecurityProcess.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityProcess.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/SecurityTokenReference.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/SecurityTokenReference.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Signature.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/Signature.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Signature.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,14 +19,14 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
import java.security.PublicKey;
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.signature.XMLSignature;
-import org.jboss.ws.wsse.KeyResolver;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.KeyResolver;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/Timestamp.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,16 +19,16 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Token.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/Token.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/Token.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
/**
* <code>Token</code> represnts an authenticated identifier contained in a
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/UsernameToken.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,12 +19,12 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/X509IssuerSerial.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/X509IssuerSerial.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
import java.security.cert.X509Certificate;
import org.apache.xml.security.utils.XMLUtils;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.InvalidSecurityHeaderException;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.InvalidSecurityHeaderException;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -36,8 +36,8 @@
* <code>SecurityTokenReference</code> that referes to a token that
* using the Issuer's DN, and certificate serial number.
*
- * @see org.jboss.ws.wsse.element.SecurityTokenReference
- * @see org.jboss.ws.wsse.element.BinarySecurityToken
+ * @see org.jboss.ws.extensions.security.element.SecurityTokenReference
+ * @see org.jboss.ws.extensions.security.element.BinarySecurityToken
*
* @author Jason T. Greene
* @version $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/element/X509Token.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.element;
+package org.jboss.ws.extensions.security.element;
import java.io.ByteArrayInputStream;
import java.security.cert.CertificateEncodingException;
@@ -28,8 +28,8 @@
import org.apache.xml.security.utils.XMLUtils;
import org.jboss.util.Base64;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.WSSecurityException;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.WSSecurityException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc (from
rev 1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/jaxrpc)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/jaxrpc/WSSecurityHandler.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.jaxrpc;
+package org.jboss.ws.extensions.security.jaxrpc;
// $Id$
@@ -29,10 +29,10 @@
import javax.xml.soap.SOAPException;
import org.jboss.logging.Logger;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.extensions.security.WSSecurityDispatcher;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.wsse.WSSecurityDispatcher;
/**
* An abstract JAXRPC handler that delegates to the WSSecurityDispatcher
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/jaxrpc/WSSecurityHandlerInbound.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.jaxrpc;
+package org.jboss.ws.extensions.security.jaxrpc;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerOutbound.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/wsse/jaxrpc/WSSecurityHandlerOutbound.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerOutbound.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.wsse.jaxrpc;
+package org.jboss.ws.extensions.security.jaxrpc;
// $Id$
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop (from rev
1586, branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/xop)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/CreateAttachmentVisitor.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/xop/CreateAttachmentVisitor.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/CreateAttachmentVisitor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop;
+package org.jboss.ws.extensions.xop;
-import org.jboss.ws.soap.SAAJVisitor;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPContentElement;
+import org.jboss.ws.core.soap.SAAJVisitor;
+import org.jboss.ws.core.soap.SOAPContentElement;
+import org.jboss.ws.core.soap.SOAPElementImpl;
import java.util.Iterator;
import java.io.Writer;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/DisableMTOMHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/xop/DisableMTOMHandler.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/DisableMTOMHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,9 +19,9 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop;
+package org.jboss.ws.extensions.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/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/JBossXBContentAdapter.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/xop/JBossXBContentAdapter.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/JBossXBContentAdapter.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop;
+package org.jboss.ws.extensions.xop;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
-import org.jboss.ws.soap.attachment.SwapableMemoryDataSource;
-import org.jboss.ws.utils.IOUtils;
-import org.jboss.ws.utils.MimeUtils;
+import org.jboss.ws.core.soap.attachment.ContentHandlerRegistry;
+import org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource;
+import org.jboss.ws.core.utils.IOUtils;
+import org.jboss.ws.core.utils.MimeUtils;
import org.jboss.xb.binding.sunday.marshalling.MarshallingContext;
import org.jboss.xb.binding.sunday.marshalling.TermBeforeMarshallingCallback;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/RestoreXOPElementVisitor.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/RestoreXOPElementVisitor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,11 +19,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop;
+package org.jboss.ws.extensions.xop;
-import org.jboss.ws.soap.SAAJVisitor;
-import org.jboss.ws.soap.SOAPContentElement;
-import org.jboss.ws.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SAAJVisitor;
+import org.jboss.ws.core.soap.SOAPContentElement;
+import org.jboss.ws.core.soap.SOAPElementImpl;
import java.util.Iterator;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPContext.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPContext.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,21 +19,21 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop;
+package org.jboss.ws.extensions.xop;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.soap.SOAPElementImpl;
-import org.jboss.ws.soap.SOAPMessageImpl;
-import org.jboss.ws.soap.attachment.MimeConstants;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.JavaUtils;
-import org.jboss.ws.utils.MimeUtils;
+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.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.core.utils.MimeUtils;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
import org.jboss.xb.binding.sunday.xop.XOPObject;
@@ -51,7 +51,7 @@
* A good starting point to understand how MTOM in JBossWS works is to take a
* look at the SOAPContentElement implementation.
*
- * @see org.jboss.ws.soap.SOAPContentElement#handleMTOMTransitions()
+ * @see org.jboss.ws.core.soap.SOAPContentElement#handleMTOMTransitions()
* @see XOPUnmarshallerImpl
* @see XOPMarshallerImpl
*
@@ -178,7 +178,7 @@
* If we would do this lazily (i.e. upon remoting callback) the previous content-type
* would already have been written.
*
- * @see org.jboss.ws.soap.SOAPConnectionImpl#callInternal(javax.xml.soap.SOAPMessage,
Object, boolean)
+ * @see
org.jboss.ws.core.soap.SOAPConnectionImpl#callInternal(javax.xml.soap.SOAPMessage, Object,
boolean)
* @see org.jboss.ws.binding.soap.SOAPMessageMarshaller#write(Object,
java.io.OutputStream)
*/
public static void eagerlyCreateAttachments()
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPMarshallerImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPMarshallerImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop;
+package org.jboss.ws.extensions.xop;
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.SOAPMessageImpl;
-import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
-import org.jboss.ws.soap.attachment.MimeConstants;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.attachment.ContentHandlerRegistry;
+import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
import org.jboss.xb.binding.sunday.xop.XOPObject;
@@ -39,7 +39,7 @@
* The XOPUnmarshallerImpl allows callbacks from the binding layer towards the
* soap processing components in order to optimize binary processing.
*
- * @see org.jboss.ws.xop.XOPUnmarshallerImpl
+ * @see org.jboss.ws.extensions.xop.XOPUnmarshallerImpl
*
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @since May 9, 2006
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPScanner.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPScanner.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPScanner.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop;
+package org.jboss.ws.extensions.xop;
import org.apache.xerces.xs.*;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPUnmarshallerImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/extensions/xop/XOPUnmarshallerImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,12 +19,12 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.xop;
+package org.jboss.ws.extensions.xop;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
+import org.jboss.ws.core.soap.attachment.ContentHandlerRegistry;
import org.jboss.xb.binding.sunday.xop.XOPObject;
import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/SecurityAdaptorFactoryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,8 +26,8 @@
import java.security.Principal;
import org.jboss.security.SecurityAssociation;
-import org.jboss.ws.wsse.SecurityAdaptor;
-import org.jboss.ws.wsse.SecurityAdaptorFactory;
+import org.jboss.ws.extensions.security.SecurityAdaptor;
+import org.jboss.ws.extensions.security.SecurityAdaptorFactory;
/**
* A Jboss specific SecurityAdaptorFactory
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,126 +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.integration.jboss;
-
-// $Id: ApplicationMetaDataAdaptor.java 354 2006-05-16 13:46:47Z thomas.diesler(a)jboss.com
$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.BeanMetaData;
-import org.jboss.metadata.EjbPortComponentMetaData;
-import org.jboss.metadata.MessageDrivenMetaData;
-import org.jboss.metadata.SessionMetaData;
-import org.jboss.metadata.WebMetaData;
-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.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
-
-/**
- * Build container independent application meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class ApplicationMetaDataAdaptor
-{
- public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(ApplicationMetaData apmd)
- {
- UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
- buildUnifiedBeanMetaData(umd, apmd);
- umd.setConfigName(apmd.getConfigName());
- umd.setConfigFile(apmd.getConfigFile());
- umd.setWebServiceContextRoot(apmd.getWebServiceContextRoot());
- umd.setSecurityDomain(apmd.getSecurityDomain());
- umd.setPublishLocationAdapter(getPublishLocationAdpater(apmd));
- return umd;
- }
-
- private static PublishLocationAdapter getPublishLocationAdpater(final
ApplicationMetaData apmd)
- {
- return new PublishLocationAdapter ()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- return apmd.getWsdlPublishLocationByName(name);
- }
- };
- }
-
- private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData metaData)
- {
- List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
- Iterator it = metaData.getEnterpriseBeans();
- while (it.hasNext())
- {
- BeanMetaData bmd = (BeanMetaData)it.next();
- UnifiedBeanMetaData ubmd = buildUnifiedBeanMetaData(bmd);
- if (ubmd != null)
- {
- beans.add(ubmd);
- }
- }
- umd.setEnterpriseBeans(beans);
- }
-
- private static UnifiedBeanMetaData buildUnifiedBeanMetaData(BeanMetaData bmd)
- {
- UnifiedBeanMetaData ubmd = null;
- if (bmd instanceof SessionMetaData)
- {
- ubmd = new UnifiedSessionMetaData();
- }
- else if (bmd instanceof MessageDrivenMetaData)
- {
- ubmd = new UnifiedMessageDrivenMetaData();
-
((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessageDrivenMetaData)bmd).getDestinationJndiName());
- }
-
- if (ubmd != null)
- {
- ubmd.setEjbName(bmd.getEjbName());
- ubmd.setEjbClass(bmd.getEjbClass());
- ubmd.setServiceEndpoint(bmd.getServiceEndpoint());
- ubmd.setHome(bmd.getHome());
- ubmd.setLocalHome(bmd.getLocalHome());
- ubmd.setJndiName(bmd.getJndiName());
- ubmd.setLocalJndiName(bmd.getLocalJndiName());
-
- EjbPortComponentMetaData pcmd = bmd.getPortComponent();
- if (pcmd != null)
- {
- UnifiedEjbPortComponentMetaData upcmd = new
UnifiedEjbPortComponentMetaData();
- upcmd.setPortComponentName(pcmd.getPortComponentName());
- upcmd.setPortComponentURI(pcmd.getPortComponentURI());
- upcmd.setAuthMethod(pcmd.getAuthMethod());
- upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
- ubmd.setPortComponent(upcmd);
- }
- }
- return ubmd;
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,184 +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.integration.jboss;
-
-//$Id: WebServiceDeployer.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.deployment.SubDeployerInterceptorSupport;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.mx.server.Invocation;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.ws.deployment.ServiceEndpointDeployer;
-import org.jboss.ws.deployment.ServiceEndpointPublisher;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.server.KernelLocator;
-
-/**
- * A deployer service that manages WS4EE compliant Web Services
- *
- * This service is called from the {@see org.jboss.ws.metadata.WebServiceInterceptor}
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Dimitris.Andreadis(a)jboss.org
- * @since 15-Jan-2005
- */
-public abstract class DeployerInterceptor extends SubDeployerInterceptorSupport
-{
- // The main deployer
- private MainDeployerMBean mainDeployer;
-
- /** Create the deployer service
- */
- protected void createService() throws Exception
- {
- mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class,
MainDeployerMBean.OBJECT_NAME, server);
- super.attach();
- }
-
- /** Destroy the deployer service
- */
- protected void destroyService()
- {
- super.detach();
- }
-
- /** Overwrite to create the webservice
- */
- protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- log.debug("create: " + di.url);
-
- Object retn = invokeNext(invocation);
-
- if (isWebserviceDeployment(di))
- {
- UnifiedDeploymentInfo udi = createUnifiedDeploymentInfo(di);
- di.context.put(UnifiedDeploymentInfo.class.getName(), udi);
- getServiceEndpointDeployer().create(udi);
- }
-
- return retn;
- }
-
- /** Overwrite to start the webservice
- */
- protected Object start(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- log.debug("start: " + di.url);
-
- Object retn = invokeNext(invocation);
-
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- // late initialization of the web context loader
- if (di.metaData instanceof WebMetaData)
- {
- ClassLoader classLoader = ((WebMetaData)di.metaData).getContextLoader();
- udi.ucl = classLoader;
- }
-
- getServiceEndpointDeployer().start(udi);
- }
-
- return retn;
- }
-
- /** Overwrite to stop the webservice
- */
- protected Object stop(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- log.debug("stop: " + di.url);
-
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- getServiceEndpointDeployer().stop(udi);
- }
-
- return invokeNext(invocation);
- }
-
- /** Overwrite to destroy the webservice
- */
- protected Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- log.debug("destroy: " + di.url);
-
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- getServiceEndpointDeployer().destroy(udi);
- }
-
- return invokeNext(invocation);
- }
-
- protected ServiceEndpointDeployer getServiceEndpointDeployer()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry = registry.getEntry(ServiceEndpointDeployer.BEAN_NAME);
- return (ServiceEndpointDeployer)entry.getTarget();
- }
-
- protected ServiceEndpointPublisher getServiceEndpointPublisher()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry = registry.getEntry(ServiceEndpointPublisher.BEAN_NAME);
- return (ServiceEndpointPublisher)entry.getTarget();
- }
-
- /** Return true if the deployment contains a web service endpoint
- */
- protected abstract boolean isWebserviceDeployment(DeploymentInfo di);
-
- protected abstract UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo
di) throws Throwable;
-
- protected UnifiedDeploymentInfo getServiceEndpointDeployment(DeploymentInfo di)
- {
- return
(UnifiedDeploymentInfo)di.context.get(UnifiedDeploymentInfo.class.getName());
- }
-
- /** Handle all webservice deployment exceptions.
- * You can either simply logs the problem and keep the EJB/WAR module
- * alive or undeploy properly.
- */
- protected void handleStartupException(DeploymentInfo di, Throwable th)
- {
- log.error("Cannot startup webservice for: " + di.shortName, th);
- mainDeployer.undeploy(di);
- }
-
- /** Handle all webservice deployment exceptions.
- *
- * You can either simply logs the problem and keep the EJB/WAR module
- * alive or undeploy properly.
- */
- protected void handleShutdownException(String moduleName, Throwable th)
- {
- log.error("Cannot shutdown webservice for: " + moduleName, th);
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,70 +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.integration.jboss;
-
-//$Id: WebServiceDeployerEJB.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.mx.server.Invocation;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
-
-/**
- * A deployer service that manages WS4EE compliant Web-Services for EJB Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public abstract class DeployerInterceptorEJB extends DeployerInterceptor
-{
- protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- Object retObj = super.create(invocation, di);
-
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- UnifiedMetaData wsMetaData =
getServiceEndpointDeployer().getUnifiedMetaData(udi);
- udi.localUrl = generateWebDeployment(di, wsMetaData);
- udi.context.put(DeploymentInfo.class.getName(), di);
- getServiceEndpointPublisher().publishServiceEndpoint(udi);
- }
-
- return retObj;
- }
-
- protected abstract URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData
wsMetaData) throws IOException;
-
- protected Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- getServiceEndpointPublisher().destroyServiceEndpoint(udi);
- }
-
- return super.destroy(invocation, di);
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,119 +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.integration.jboss;
-
-//$Id: WebServiceDeployerEJB21.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Iterator;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.BeanMetaData;
-import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.JSR109Deployment;
-import org.jboss.ws.deployment.JSR181Deployment;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
-
-/**
- * A deployer service that manages WS4EE compliant Web-Services for EJB-2.1 Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public class DeployerInterceptorEJB21 extends DeployerInterceptorEJB implements
DeployerInterceptorEJB21MBean
-{
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
- {
- UnifiedDeploymentInfo udi;
- URL webservicesURL = getWebservicesDescriptor(di);
- if (webservicesURL != null)
- {
- udi = new JSR109Deployment(UnifiedDeploymentInfo.DeploymentType.JSR109_EJB21,
webservicesURL);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
- }
- else
- {
- udi = new JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_EJB21);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
- }
- return udi;
- }
-
- /** Return true if the deployment is a web service endpoint
- */
- protected boolean isWebserviceDeployment(DeploymentInfo di)
- {
- ApplicationMetaData applMetaData = (ApplicationMetaData)di.metaData;
- boolean isWebserviceDeployment = applMetaData.isWebServiceDeployment();
-
- // Check if we have a webservices.xml descriptor
- if (isWebserviceDeployment == false)
- {
- isWebserviceDeployment = getWebservicesDescriptor(di) != null;
- }
-
- // Check if the ejb-jar contains annotated endpoints
- if (isWebserviceDeployment == false)
- {
- try
- {
- Iterator itBeans = applMetaData.getEnterpriseBeans();
- while (itBeans.hasNext() && isWebserviceDeployment == false)
- {
- BeanMetaData beanMetaData = (BeanMetaData)itBeans.next();
- String ejbClassName = beanMetaData.getEjbClass();
- Class ejbClass = di.annotationsCl.loadClass(ejbClassName);
- isWebserviceDeployment =
ejbClass.isAnnotationPresent(javax.jws.WebService.class);
- }
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new WSException(e);
- }
- }
-
- applMetaData.setWebServiceDeployment(isWebserviceDeployment);
- return isWebserviceDeployment;
- }
-
- /**
- * Get the resource name of the webservices.xml descriptor.
- */
- protected URL getWebservicesDescriptor(DeploymentInfo di)
- {
- return di.localCl.findResource("META-INF/webservices.xml");
- }
-
- protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
- {
- ServiceEndpointGeneratorEJB21 generator = new ServiceEndpointGeneratorEJB21();
- return generator.generatWebDeployment(di, wsMetaData);
- }
-
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss;
-
-import javax.management.ObjectName;
-
-import org.jboss.deployment.SubDeployerInterceptorMBean;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * MBean interface.
- * @since 19-Jan-2005
- */
-public interface DeployerInterceptorEJB21MBean extends SubDeployerInterceptorMBean
-{
- //default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerEJB21");
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,129 +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.integration.jboss;
-
-// $Id: WebServiceDeployerEJB3.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-
-import javax.jws.WebService;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.ejb3.Ejb3ModuleMBean;
-import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.JSR181Deployment;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-
-/**
- * A deployer service that manages WS4EE compliant Web-Services for EJB3 Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-May-2005
- */
-public class DeployerInterceptorEJB3 extends DeployerInterceptorEJB implements
DeployerInterceptorEJB3MBean
-{
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
- {
- UnifiedDeploymentInfo udi = new
JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_EJB3);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
-
- Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
-
- // The container objects below provide access to all of the ejb metadata
- ArrayList<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
- for (Object container : ejb3Module.getContainers().values())
- {
- if (container instanceof StatelessContainer)
- {
- StatelessContainer slc = (StatelessContainer)container;
- UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
- uslc.setEjbName(slc.getEjbName());
- uslc.setEjbClass(slc.getBeanClassName());
- beans.add(uslc);
- }
- }
-
- UnifiedApplicationMetaData appMetaData = new UnifiedApplicationMetaData();
- appMetaData.setEnterpriseBeans(beans);
- udi.metaData = appMetaData;
-
- return udi;
- }
-
- /** Return true if the deployment is a web service endpoint
- */
- protected boolean isWebserviceDeployment(DeploymentInfo di)
- {
- boolean isWebserviceDeployment = false;
-
- // Check if the ejb3 contains annotated endpoints
- Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
- for (Object manager : ejb3Module.getContainers().values())
- {
- if (manager instanceof StatelessContainer)
- {
- StatelessContainer container = (StatelessContainer)manager;
- if (container.resolveAnnotation(WebService.class) != null)
- {
- isWebserviceDeployment = true;
- break;
- }
- }
- }
-
- return isWebserviceDeployment;
- }
-
- private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
- {
- Ejb3ModuleMBean ejb3Module;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
- if (ejb3Module == null)
- throw new WSException("Cannot obtain EJB3 module: " + objectName);
-
- return ejb3Module;
- }
- catch (MBeanProxyCreationException ex)
- {
- throw new WSException("Cannot obtain proxy to EJB3 module");
- }
- }
-
- protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
- {
- return new ServiceEndpointGeneratorEJB3().generatWebDeployment(di, wsMetaData);
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss;
-
-import javax.management.ObjectName;
-
-import org.jboss.deployment.SubDeployerInterceptorMBean;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * MBean interface.
- * @since 19-Jan-2005
- */
-public interface DeployerInterceptorEJB3MBean extends SubDeployerInterceptorMBean
-{
- //default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerEJB3");
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss;
-
-// $Id: WebServiceDeployerJSE.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.mx.server.Invocation;
-import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.JSR109Deployment;
-import org.jboss.ws.deployment.JSR181Deployment;
-import org.jboss.ws.deployment.ServiceEndpointPublisher;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-
-/**
- * A deployer service that manages WS4EE compliant Web Services for WAR
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public class DeployerInterceptorJSE extends DeployerInterceptor implements
DeployerInterceptorJSEMBean
-{
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
- {
- UnifiedDeploymentInfo udi;
-
- DeploymentType type =
(DeploymentType)di.context.get("UnifiedDeploymentInfo.Type");
- if (type == UnifiedDeploymentInfo.DeploymentType.JSR109_JSE)
- {
- URL webservicesURL = getWebservicesDescriptor(di);
- udi = new JSR109Deployment(UnifiedDeploymentInfo.DeploymentType.JSR109_JSE,
webservicesURL);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
-
- }
- else if (type == UnifiedDeploymentInfo.DeploymentType.JSR181_JSE)
- {
- udi = new JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_JSE);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
- }
- else
- {
- throw new WSException("Unexpected type: " + type);
- }
-
- return udi;
- }
-
- /** Overwrite to create the webservice
- *
- * This implemantation modifies the servlet entries in web.xml
- */
- protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
- {
- Object retn = super.create(invocation, di);
-
- UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
- if (udi != null)
- {
- ServiceEndpointPublisher endpointPublisher = getServiceEndpointPublisher();
- Map<String, String> sepTargetMap = endpointPublisher.rewriteWebXML(udi);
- updateServiceEndpointTargetBeans(udi, sepTargetMap);
- }
- return retn;
- }
-
- private void updateServiceEndpointTargetBeans(UnifiedDeploymentInfo udi,
Map<String, String> sepTargetMap)
- {
- UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
-
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String targetBean = sepTargetMap.get(sepMetaData.getLinkName());
- sepMetaData.setServiceEndpointImplName(targetBean);
- }
- }
- }
-
- /** Return true if the deployment is a web service endpoint
- */
- protected boolean isWebserviceDeployment(DeploymentInfo di)
- {
- WebMetaData webMetaData = (WebMetaData)di.metaData;
- boolean isWebserviceDeployment = webMetaData.isWebServiceDeployment();
-
- // Check if we have a webservices.xml descriptor
- if (isWebserviceDeployment == false)
- {
- if (getWebservicesDescriptor(di) != null)
- {
- di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JSR109_JSE);
- isWebserviceDeployment = true;
- }
- }
-
- // Check if the web.xml contains annotated endpoint impl
- if (isWebserviceDeployment == false)
- {
- Map servletClassMap = webMetaData.getServletClassMap();
- Iterator<String> it = servletClassMap.values().iterator();
- while (it.hasNext() && isWebserviceDeployment == false)
- {
- String servletClassName = it.next();
- try
- {
- Class servletClass = di.annotationsCl.loadClass(servletClassName);
- if (servletClass.isAnnotationPresent(javax.jws.WebService.class))
- {
- di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JSR181_JSE);
- isWebserviceDeployment = true;
- }
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load servlet class: " + servletClassName);
- }
- }
- }
-
- webMetaData.setWebServiceDeployment(isWebserviceDeployment);
- return isWebserviceDeployment;
- }
-
- /**
- * Get the resource name of the webservices.xml descriptor.
- */
- protected URL getWebservicesDescriptor(DeploymentInfo di)
- {
- return di.localCl.findResource("WEB-INF/webservices.xml");
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss;
-
-import javax.management.ObjectName;
-
-import org.jboss.deployment.SubDeployerInterceptorMBean;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * MBean interface.
- * @since 19-Jan-2005
- */
-public interface DeployerInterceptorJSEMBean extends SubDeployerInterceptorMBean
-{
- //default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerJSE");
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss;
-
-// $Id: WebServiceDeployerNestedJSE.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com
$
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.deployment.SubDeployerSupport;
-import org.jboss.system.server.ServerConfig;
-import org.jboss.system.server.ServerConfigLocator;
-import org.jboss.ws.utils.IOUtils;
-
-/**
- * A deployer service that manages WS4EE compliant Web Services for
- * nested POJO endpoints.
- *
- * The WebServiceDeployerJSE attaches itself as an deployment interceptor to
- * the jboss.web:service=WebServer deployer. As a consequence, all *.war deployments
- * that are picked up before the interceptor is installed are not treated as potential
- * web service endpoint deployments.
- *
- * Nested POJO endpoints can be packaged in *.jse deployments that are then picked up by
this
- * deployer.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 03-Mar-2005
- */
-public class DeployerInterceptorNestedJSE extends SubDeployerSupport implements
DeployerInterceptorNestedJSEMBean
-{
- private static final String NESTED_JSE_WAR_FILE =
"org.jboss.ws.server.nested.jse";
-
- // The MainDeployer
- protected MainDeployerMBean mainDeployer;
-
- public void setMainDeployer(MainDeployerMBean mainDeployer)
- {
- this.mainDeployer = mainDeployer;
- }
-
- public boolean accepts(DeploymentInfo sdi)
- {
- setSuffixes(new String[] { ".jse" });
- return super.accepts(sdi);
- }
-
- /** Copy the *.jse to a *.war and deploy through the main deployer
- */
- public void create(DeploymentInfo di) throws DeploymentException
- {
- log.debug("create: " + di.url);
-
- try
- {
- File jseFile = new File(di.localUrl.getFile());
- if (jseFile.isFile() == false)
- throw new DeploymentException("Expected a file: " + di.localUrl);
-
- ServerConfig config = ServerConfigLocator.locate();
- String warFileName = config.getServerTempDir().getCanonicalPath() +
"/deploy/" + di.shortName;
- warFileName = warFileName.substring(0, warFileName.length() - 4) +
".war";
- File warFile = new File(warFileName);
-
- FileOutputStream fos = new FileOutputStream(warFile);
- FileInputStream fis = new FileInputStream(jseFile);
- try
- {
- IOUtils.copyStream(fos, fis);
- }
- finally
- {
- fos.close();
- fis.close();
- }
-
- mainDeployer.deploy(warFile.toURL());
-
- // remember the war url that we deployed
- di.context.put(NESTED_JSE_WAR_FILE, warFile);
-
- super.create(di);
- }
- catch (IOException ex)
- {
- throw new DeploymentException("Failed to create: " + di.url, ex);
- }
- }
-
- /** Undeploy the *.war through the main deployer
- */
- public void destroy(DeploymentInfo di) throws DeploymentException
- {
- log.debug("destroy: " + di.url);
- try
- {
- File warFile = (File)di.context.get(NESTED_JSE_WAR_FILE);
- mainDeployer.undeploy(warFile.toURL());
- warFile.delete();
-
- super.destroy(di);
- }
- catch (IOException ex)
- {
- throw new DeploymentException("Failed to destroy: " + di.url, ex);
- }
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss;
-
-// $Id: WebServiceDeployerNestedJSEMBean.java 296 2006-05-08 19:45:49Z
thomas.diesler(a)jboss.com $
-
-import javax.management.ObjectName;
-
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.deployment.SubDeployerMBean;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 03-Mar-2005
- */
-public interface DeployerInterceptorNestedJSEMBean extends SubDeployerMBean
-{
- //default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerNestedJSE");
-
- void setMainDeployer(MainDeployerMBean mainDeployer);
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,72 +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.integration.jboss;
-
-// $Id: WebServiceDeploymentAdaptor.java 317 2006-05-14 17:16:59Z
thomas.diesler(a)jboss.com $
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-
-/**
- * Build container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class DeploymentInfoAdaptor
-{
- public static UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi,
DeploymentInfo di)
- {
- if (di.parent != null)
- {
- udi.parent = new UnifiedDeploymentInfo(null);
- buildDeploymentInfo(udi.parent, di.parent);
- }
-
- udi.shortName = di.shortName;
- udi.url = di.url;
- udi.localUrl = di.localUrl;
- udi.metaData = buildMetaData(di.metaData);
- udi.annotationsCl = di.annotationsCl;
- udi.localCl = di.localCl;
- udi.ucl = di.ucl;
- udi.deployedObject = di.deployedObject;
-
- return udi;
- }
-
- private static Object buildMetaData(Object metaData)
- {
- Object retMetaData = null;
- if (metaData instanceof WebMetaData)
- {
- retMetaData =
WebMetaDataAdaptor.buildUnifiedWebMetaData((WebMetaData)metaData);
- }
- else if (metaData instanceof ApplicationMetaData)
- {
- retMetaData =
ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData((ApplicationMetaData)metaData);
- }
- return retMetaData;
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossContextServlet.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossContextServlet.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossContextServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,46 +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.integration.jboss;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.CommonContextServlet;
-import org.jboss.ws.server.ServiceEndpointManagerFactory;
-
-/**
- * The servlet that that is associated with context /jbossws
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Mar-2005
- */
-public class JBossContextServlet extends CommonContextServlet
-{
- // provide logging
- protected final Logger log = Logger.getLogger(JBossContextServlet.class);
-
- protected void initServiceEndpointManager()
- {
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- epManager = factory.getServiceEndpointManager();
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss;
-
-// $Id: WebServiceDeployer.java 312 2006-05-11 10:49:22Z thomas.diesler(a)jboss.com $
-
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.management.MBeanServer;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.deployment.ServiceEndpointPublisher;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-
-/**
- * Publish the HTTP service endpoint to Tomcat
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class JBossServiceEndpointPublisher extends ServiceEndpointPublisher
-{
-
- public String publishServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
- {
- URL warURL = udi.localUrl;
- DeploymentInfo di =
(DeploymentInfo)udi.context.get(DeploymentInfo.class.getName());
- if (di == null)
- throw new IllegalStateException("Cannot obtain DeploymentInfo from
context");
-
- rewriteWebXML(udi);
-
- // Preserve the repository config
- DeploymentInfo auxdi = new DeploymentInfo(warURL, null,
MBeanServerLocator.locateJBoss());
- auxdi.repositoryConfig = di.getTopRepositoryConfig();
- getMainDeployer().deploy(auxdi);
- return "OK";
- }
-
- public String destroyServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
- {
- getMainDeployer().undeploy(udi.localUrl);
- return "OK";
- }
-
- public Set<String> getWebServiceServletLinks(UnifiedDeploymentInfo udi)
- {
- Set<String> links = new HashSet<String>();
-
- UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
-
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- links.add(sepMetaData.getLinkName());
-
- }
- }
-
- return links;
- }
-
- private MainDeployerMBean getMainDeployer() throws MBeanProxyCreationException
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- MainDeployerMBean mainDeployer =
(MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME,
server);
- return mainDeployer;
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,87 +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.integration.jboss;
-
-// $Id: ServiceEndpointServlet.java 296 2006-05-08 19:45:49Z thomas.diesler(a)jboss.com $
-
-import java.util.List;
-
-import javax.servlet.ServletContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.server.ServiceEndpoint;
-import org.jboss.ws.server.StandardEndpointServlet;
-
-/**
- * A servlet that is installed for every web service endpoint.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-May-2006
- */
-public class JBossServiceEndpointServlet extends StandardEndpointServlet
-{
- // provide logging
- private static final Logger log =
Logger.getLogger(JBossServiceEndpointServlet.class);
-
- /** Initialize the service endpoint
- */
- protected void initServiceEndpoint(String contextPath)
- {
- super.initServiceEndpoint(contextPath);
-
- ServiceEndpoint wsEndpoint = epManager.getServiceEndpointByID(sepId);
- if (wsEndpoint == null)
- throw new WSException("Cannot obtain endpoint for: " + sepId);
-
- // read the config name/file from web.xml
- ServletContext ctx = getServletContext();
- String configName = ctx.getInitParameter("jbossws-config-name");
- String configFile = ctx.getInitParameter("jbossws-config-file");
- if (configName != null || configFile != null)
- {
- log.debug("Updating service endpoint config\n config-name: " +
configName + "\n config-file: " + configFile);
- ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
- sepMetaData.setConfigName(configName);
- sepMetaData.setConfigFile(configFile);
-
- List<HandlerMetaData> sepHandlers =
sepMetaData.getHandlerMetaData(HandlerType.ENDPOINT);
- sepMetaData.clearHandlers();
-
- // Add pre handlers
- WSCommonConfig sepConfig = sepMetaData.getEndpointConfig();
- sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.PRE));
-
- // Restore the endpoint handlers
- sepMetaData.addHandlers(sepHandlers);
-
- // Add post handlers
- sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.POST));
-
- log.debug("Updated endpoint meta data" + sepMetaData);
- }
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,93 +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.integration.jboss;
-
-// $Id: PortComponentLinkServlet.java 419 2006-05-30 13:32:38Z thomas.diesler(a)jboss.com
$
-
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.server.ServiceEndpoint;
-import org.jboss.ws.server.ServiceEndpointManager;
-import org.jboss.ws.server.ServiceEndpointManagerFactory;
-
-/**
- * A servlet that reports the serviceURL for a given service ID.
- * <p/>
- * When the web service client ENC is setup, it may contain port-component-link
- * entries that point to service endpoints in the same top level deployment.
- * The final serviceURL of those endpoints will become available after the
- * reference to the javax.xml.rpc.Service is bound to JNDI.
- * <p/>
- * When the client does a lookup of the javax.xml.rpc.Service from JNDI the
ObjectFactory
- * will contact this servlet for the final serviceURL. It is acceptable that the client
- * wsdl does not contain the correct serviceURL if the client is using the
port-component-link element.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 29-May-2004
- */
-public class PortComponentLinkServlet extends HttpServlet
-{
- // provide logging
- private static final Logger log = Logger.getLogger(PortComponentLinkServlet.class);
-
- protected ServiceEndpointManager epManager;
-
- public void init(ServletConfig config) throws ServletException
- {
- super.init(config);
- ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
- epManager = factory.getServiceEndpointManager();
- }
-
- /**
- * Get the serviceURL as string for a given serviceID.
- */
- public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- String pcLink = req.getParameter("pcLink");
- if (pcLink == null)
- throw new IllegalArgumentException("Cannot obtain request parameter
'pcLink'");
-
- ServiceEndpoint serviceEndpoint = epManager.resolvePortComponentLink(pcLink);
- ;
- if (serviceEndpoint == null)
- throw new WSException("Cannot resolve port-component-link: " +
pcLink);
-
- res.setContentType("text/plain");
- PrintWriter out = res.getWriter();
-
- String endpointAddress =
serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
- out.println(endpointAddress);
-
- log.debug("Resolved " + pcLink + " to: " + endpointAddress);
- out.close();
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServerConfigImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServerConfigImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServerConfigImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,150 +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.integration.jboss;
-
-//$Id: ServiceEndpointManagerFactoryImpl.java 294 2006-05-08 16:33:42Z
thomas.diesler(a)jboss.com $
-
-import java.io.File;
-import java.util.Set;
-
-import javax.management.AttributeNotFoundException;
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * JBoss specific implementation of a ServerConfig
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author darran.lofthouse(a)jboss.com
- * @since 08-May-2006
- */
-public class ServerConfigImpl implements ServerConfig
-{
-
- private static final Logger log = Logger.getLogger(ServerConfigImpl.class);
-
- public File getServerTempDir()
- {
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)server.getAttribute(oname, "ServerTempDir");
- return tmpdir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public File getServerDataDir()
- {
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)server.getAttribute(oname, "ServerDataDir");
- return tmpdir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public int getWebServicePort()
- {
- int port = getConnectorPort("HTTP/1.1", false);
- if (port > -1)
- {
- return port;
- }
-
- log.warn("Unable to calculate 'WebServicePort', using default
'8080'");
- return 8080;
- }
-
- public int getWebServiceSecurePort()
- {
- int port = getConnectorPort("HTTP/1.1", true);
- if (port > -1)
- {
- return port;
- }
-
- log.warn("Unable to calculate 'WebServiceSecurePort', using default
'8443'");
- return 8443;
- }
-
- private int getConnectorPort(final String protocol, final boolean secure)
- {
- int port = -1;
-
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
-
- Set connectorNames = server.queryNames(connectors, null);
- for (Object current : connectorNames)
- {
- ObjectName currentName = (ObjectName)current;
-
- try
- {
- int connectorPort = (Integer)server.getAttribute(currentName,
"port");
- boolean connectorSecure = (Boolean)server.getAttribute(currentName,
"secure");
- String connectorProtocol = (String)server.getAttribute(currentName,
"protocol");
-
- if (protocol.equals(connectorProtocol) && secure ==
connectorSecure)
- {
- if (port > -1)
- {
- log.warn("Found multiple connectors for protocol='" +
protocol + "' and secure='" + secure + "', using first port
found '" + port + "'");
- }
- else
- {
- port = connectorPort;
- }
- }
- }
- catch (AttributeNotFoundException ignored)
- {
- }
- }
-
- return port;
- }
- catch (JMException e)
- {
- return -1;
- }
-
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,306 +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.integration.jboss;
-
-//$Id$
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.logging.Logger;
-import org.jboss.system.server.ServerConfig;
-import org.jboss.system.server.ServerConfigLocator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.w3c.dom.Element;
-
-/**
- * Generate a web deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public abstract class ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB.class);
-
- public URL generatWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData) throws
IOException
- {
- // Collect the list of PortComponentMetaData
- List<EndpointMetaData> epMetaDataList = new
ArrayList<EndpointMetaData>();
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
- {
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
- {
- epMetaDataList.add(epMetaData);
- }
- }
-
- Element webDoc = createWebAppDescriptor(di, epMetaDataList);
- Element jbossDoc = createJBossWebAppDescriptor(di, epMetaDataList);
-
- File tmpWar = null;
- try
- {
- ServerConfig config = ServerConfigLocator.locate();
- File tmpdir = new File(config.getServerTempDir().getCanonicalPath() +
"/deploy");
-
- String deploymentName = di.getCanonicalName().replace('/', '-')
+ "-ws";
- tmpWar = File.createTempFile(deploymentName, ".war", tmpdir);
- tmpWar.delete();
- File webInf = new File(tmpWar, "WEB-INF");
- webInf.mkdirs();
-
- File webXml = new File(webInf, "web.xml");
- FileWriter fw = new FileWriter(webXml);
- new DOMWriter(fw).setPrettyprint(true).print(webDoc);
- fw.close();
-
- File jbossWebXml = new File(webInf, "jboss-web.xml");
- fw = new FileWriter(jbossWebXml);
- new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
- fw.close();
- }
- catch (IOException e)
- {
- throw new WSException("Failed to create webservice.war", e);
- }
-
- return tmpWar.toURL();
- }
-
- private Element createWebAppDescriptor(DeploymentInfo di, List<EndpointMetaData>
epMetaDataList)
- {
- Element webApp = DOMUtils.createElement("web-app");
-
- /*
- <servlet>
- <servlet-name>
- <servlet-class>
- </servlet>
- */
- for (EndpointMetaData epMetaData : epMetaDataList)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String ejbName = sepMetaData.getLinkName();
- Element servlet =
(Element)webApp.appendChild(DOMUtils.createElement("servlet"));
- Element servletName =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
- servletName.appendChild(DOMUtils.createTextNode(ejbName));
- Element servletClass =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
- String targetBean = sepMetaData.getServiceEndpointImplName();
- String seiName = sepMetaData.getServiceEndpointInterfaceName();
- String servletClassName = (targetBean != null ? targetBean : seiName);
- servletClass.appendChild(DOMUtils.createTextNode(servletClassName));
- }
-
- /*
- <servlet-mapping>
- <servlet-name>
- <url-pattern>
- </servlet-mapping>
- */
- ArrayList<String> urlPatters = new ArrayList<String>();
- for (EndpointMetaData epMetaData : epMetaDataList)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String ejbName = sepMetaData.getLinkName();
- Element servletMapping =
(Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
- Element servletName =
(Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
- servletName.appendChild(DOMUtils.createTextNode(ejbName));
- Element urlPatternElement =
(Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
-
- String urlPattern = "/*";
- if (sepMetaData.getURLPattern() != null)
- {
- urlPattern = sepMetaData.getURLPattern();
- }
-
- if (urlPatters.contains(urlPattern))
- throw new IllegalArgumentException("Cannot use the same url-pattern with
different endpoints, " + "check your <port-component-uri> in
jboss.xml");
-
- urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
- urlPatters.add(urlPattern);
- }
-
- String authMethod = null;
-
- // Add web-app/security-constraint for each port component
- for (EndpointMetaData epMetaData : epMetaDataList)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String ejbName = sepMetaData.getLinkName();
- if (sepMetaData.getAuthMethod() != null || sepMetaData.getTransportGuarantee()
!= null)
- {
- /*
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>TestUnAuthPort</web-resource-name>
- <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
- </web-resource-collection>
- <auth-constraint>
- <role-name>*</role-name>
- </auth-constraint>
- <user-data-constraint>
- <transport-guarantee>NONE</transport-guarantee>
- </user-data-constraint>
- </security-constraint>
- */
- Element securityConstraint =
(Element)webApp.appendChild(DOMUtils.createElement("security-constraint"));
- Element wrc =
(Element)securityConstraint.appendChild(DOMUtils.createElement("web-resource-collection"));
- Element wrName =
(Element)wrc.appendChild(DOMUtils.createElement("web-resource-name"));
- wrName.appendChild(DOMUtils.createTextNode(ejbName));
- Element pattern =
(Element)wrc.appendChild(DOMUtils.createElement("url-pattern"));
- String uri = sepMetaData.getURLPattern();
- pattern.appendChild(DOMUtils.createTextNode(uri));
- Element method =
(Element)wrc.appendChild(DOMUtils.createElement("http-method"));
- method.appendChild(DOMUtils.createTextNode("GET"));
- method =
(Element)wrc.appendChild(DOMUtils.createElement("http-method"));
- method.appendChild(DOMUtils.createTextNode("POST"));
-
- // Optional auth-constraint
- if (sepMetaData.getAuthMethod() != null)
- {
- // Only the first auth-method gives the war login-config/auth-method
- if (authMethod == null)
- authMethod = sepMetaData.getAuthMethod();
-
- Element authConstraint =
(Element)securityConstraint.appendChild(DOMUtils.createElement("auth-constraint"));
- Element roleName =
(Element)authConstraint.appendChild(DOMUtils.createElement("role-name"));
- roleName.appendChild(DOMUtils.createTextNode("*"));
- }
- // Optional user-data-constraint
- if (sepMetaData.getTransportGuarantee() != null)
- {
- Element userData =
(Element)securityConstraint.appendChild(DOMUtils.createElement("user-data-constraint"));
- Element transport =
(Element)userData.appendChild(DOMUtils.createElement("transport-guarantee"));
-
transport.appendChild(DOMUtils.createTextNode(sepMetaData.getTransportGuarantee()));
- }
- }
- }
-
- // Optional login-config/auth-method
- if (authMethod != null)
- {
- Element loginConfig =
(Element)webApp.appendChild(DOMUtils.createElement("login-config"));
- Element method =
(Element)loginConfig.appendChild(DOMUtils.createElement("auth-method"));
- method.appendChild(DOMUtils.createTextNode(authMethod));
- Element realm =
(Element)loginConfig.appendChild(DOMUtils.createElement("realm-name"));
- realm.appendChild(DOMUtils.createTextNode("EJBServiceEndpointServlet
Realm"));
-
- addEJBSecurityRoles(di, webApp);
- }
-
- return webApp;
- }
-
- private Element createJBossWebAppDescriptor(DeploymentInfo di,
List<EndpointMetaData> epMetaDataList)
- {
- /* Create a jboss-web
- <jboss-web>
- <security-domain>java:/jaas/cts</security-domain>
- <context-root>/ws/ejbN/</context-root>
- </jboss-web>
- */
- Element jbossWeb = DOMUtils.createElement("jboss-web");
-
- UnifiedMetaData wsMetaData =
epMetaDataList.get(0).getServiceMetaData().getUnifiedMetaData();
- String securityDomain = wsMetaData.getSecurityDomain();
- if (securityDomain != null)
- {
- Element secDomain =
(Element)jbossWeb.appendChild(DOMUtils.createElement("security-domain"));
- secDomain.appendChild(DOMUtils.createTextNode("java:/jaas/" +
securityDomain));
- }
-
- // Get the context root for this deployment
- String contextRoot = null;
- for (EndpointMetaData epMetaData : epMetaDataList)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String next = sepMetaData.getContextRoot();
- if (next != null)
- {
- if (contextRoot == null)
- {
- contextRoot = next;
- }
- else if (contextRoot.equals(next) == false)
- {
- throw new WSException("Multiple context root not supported");
- }
- }
- }
- if (contextRoot == null)
- throw new WSException("Cannot obtain context root");
-
- Element root =
(Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
- root.appendChild(DOMUtils.createTextNode(contextRoot));
-
- String[] virtualHosts = null;
- for (EndpointMetaData epMetaData : epMetaDataList)
- {
- ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
- String[] next = sepMetaData.getVirtualHosts();
- if (next != null && next.length > 0)
- {
- Arrays.sort(next);
- if (virtualHosts == null)
- {
- virtualHosts = next;
- }
- else
- {
- if (Arrays.equals(virtualHosts, next) == false)
- {
- throw new WSException("All endpoints must define the same virtual
hosts");
- }
- }
- }
- }
-
- if (virtualHosts != null)
- {
- for (String current : virtualHosts)
- {
- Element virtualHost =
(Element)jbossWeb.appendChild(DOMUtils.createElement("virtual-host"));
- virtualHost.appendChild(DOMUtils.createTextNode(current));
- }
- }
-
- return jbossWeb;
- }
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- protected abstract void addEJBSecurityRoles(DeploymentInfo di, Element webApp);
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,69 +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.integration.jboss;
-
-//$Id$
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.AssemblyDescriptorMetaData;
-import org.jboss.ws.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-/**
- * Generate a service endpoint deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointGeneratorEJB21 extends ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB21.class);
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- protected void addEJBSecurityRoles(DeploymentInfo di, Element webApp)
- {
- // Fix:
http://jira.jboss.org/jira/browse/JBWS-309
- ApplicationMetaData applMetaData = (ApplicationMetaData)di.metaData;
- AssemblyDescriptorMetaData assemblyDescriptor =
applMetaData.getAssemblyDescriptor();
- if (assemblyDescriptor != null)
- {
- Map securityRoles = assemblyDescriptor.getSecurityRoles();
- if (securityRoles != null)
- {
- Iterator it = securityRoles.keySet().iterator();
- while (it.hasNext())
- {
- Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
- Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
- roleName.appendChild(DOMUtils.createTextNode((String)it.next()));
- }
- }
- }
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss;
-
-//$Id$
-
-import javax.annotation.security.RolesAllowed;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.ejb3.Ejb3ModuleMBean;
-import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.WSException;
-import org.w3c.dom.Element;
-
-/**
- * Generate a service endpoint deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointGeneratorEJB3 extends ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB3.class);
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- protected void addEJBSecurityRoles(DeploymentInfo di, Element webApp)
- {
- // The container objects below provide access to all of the ejb metadata
- Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
- for (Object manager : ejb3Module.getContainers().values())
- {
- if (manager instanceof StatelessContainer)
- {
- StatelessContainer container = (StatelessContainer)manager;
-
- RolesAllowed anRolesAllowed =
(RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
- if (anRolesAllowed != null)
- {
- for (String role : anRolesAllowed.value())
- {
- Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
- Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
- roleName.appendChild(DOMUtils.createTextNode(role));
- }
- }
- }
- }
- }
-
- private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
- {
- Ejb3ModuleMBean ejb3Module;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
- if (ejb3Module == null)
- throw new WSException("Cannot obtain EJB3 module: " + objectName);
-
- return ejb3Module;
- }
- catch (MBeanProxyCreationException ex)
- {
- throw new WSException("Cannot obtain proxy to EJB3 module");
- }
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,139 +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.integration.jboss;
-
-// $Id: ServiceEndpointInterceptor.java 906 2006-09-06 18:57:40Z thomas.diesler(a)jboss.com
$
-
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ejb.plugins.AbstractInterceptor;
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.InvocationKey;
-import org.jboss.logging.Logger;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.common.CommonBinding;
-import org.jboss.ws.common.CommonBindingProvider;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-
-/**
- * This Interceptor does the ws4ee handler processing.
- *
- * According to the ws4ee spec the handler logic must be invoked after the container
- * applied method level security to the invocation.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Sep-2005
- */
-public class ServiceEndpointInterceptor extends AbstractInterceptor
-{
- // provide logging
- private static Logger log = Logger.getLogger(ServiceEndpointInterceptor.class);
-
- // Interceptor implementation --------------------------------------
-
- /** Before and after we call the service endpoint bean, we process the handler
chains.
- */
- public Object invoke(final Invocation mi) throws Exception
- {
- // If no msgContext, it's not for us
- CommonMessageContext msgContext =
(CommonMessageContext)mi.getPayloadValue(InvocationKey.SOAP_MESSAGE_CONTEXT);
- if (msgContext == null)
- {
- return getNext().invoke(mi);
- }
-
- // Get the endpoint invocation
- EndpointInvocation epInv =
(EndpointInvocation)mi.getValue(EndpointInvocation.class.getName());
- OperationMetaData opMetaData = epInv.getOperationMetaData();
-
- // Get the handler callback
- String key = ServiceEndpointInvokerEJB21.HandlerCallback.class.getName();
- ServiceEndpointInvokerEJB21.HandlerCallback callback =
(ServiceEndpointInvokerEJB21.HandlerCallback)mi.getValue(key);
-
- // Handlers need to be Tx. Therefore we must invoke the handler chain after the
TransactionInterceptor.
- if (callback != null && epInv != null)
- {
- try
- {
- // call the request handlers
- boolean handlersPass =
callback.callRequestHandlerChain(HandlerType.ENDPOINT);
- handlersPass = handlersPass &&
callback.callRequestHandlerChain(HandlerType.POST);
-
- // Call the next interceptor in the chain
- if (handlersPass)
- {
- // The SOAPContentElements stored in the EndpointInvocation might have
changed after
- // handler processing. Get the updated request payload. This should be a
noop if request
- // handlers did not modify the incomming SOAP message.
- Object[] reqParams = epInv.getRequestPayload();
- mi.setArguments(reqParams);
- Object resObj = getNext().invoke(mi);
- epInv.setReturnValue(resObj);
-
- // Bind the response message
- CommonBindingProvider bindingProvider = new
CommonBindingProvider(opMetaData.getEndpointMetaData());
- CommonBinding binding =
(CommonBinding)bindingProvider.getCommonBinding();
- SOAPMessage resMessage =
(SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
- msgContext.setSOAPMessage(resMessage);
- }
-
- // call the response handlers
- handlersPass = callback.callResponseHandlerChain(HandlerType.POST);
- handlersPass = handlersPass &&
callback.callResponseHandlerChain(HandlerType.ENDPOINT);
-
- // update the return value after response handler processing
- Object resObj = epInv.getReturnValue();
-
- return resObj;
- }
- catch (Exception ex)
- {
- try
- {
- SOAPMessage faultMessage =
SOAPFaultExceptionHelper.exceptionToFaultMessage(ex);
- msgContext.setSOAPMessage(faultMessage);
-
- // call the fault handlers
- boolean handlersPass = callback.callFaultHandlerChain(HandlerType.POST,
ex);
- handlersPass = handlersPass &&
callback.callFaultHandlerChain(HandlerType.ENDPOINT, ex);
- }
- catch (Exception subEx)
- {
- log.warn("Cannot process handlerChain.handleFault, ignoring: ",
subEx);
- }
- throw ex;
- }
- finally
- {
- // do nothing
- }
- }
- else
- {
- log.warn("Handler callback not available");
- return getNext().invoke(mi);
- }
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,264 +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.integration.jboss;
-
-// $Id: ServiceEndpointInvokerEJB21.java 906 2006-09-06 18:57:40Z
thomas.diesler(a)jboss.com $
-
-import java.lang.reflect.Method;
-import java.security.Principal;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.ejb.EjbModule;
-import org.jboss.ejb.Interceptor;
-import org.jboss.ejb.StatelessSessionContainer;
-import org.jboss.invocation.Invocation;
-import org.jboss.invocation.InvocationKey;
-import org.jboss.invocation.InvocationType;
-import org.jboss.invocation.PayloadKey;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.ws.WSException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.metadata.EndpointMetaData.Type;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.server.ServiceEndpointInfo;
-import org.jboss.ws.server.ServiceEndpointInvoker;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * Handles invocations on EJB2.1 endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public class ServiceEndpointInvokerEJB21 extends AbstractServiceEndpointInvoker
implements ServiceEndpointInvoker
-{
- // provide logging
- private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB21.class);
-
- private String jndiName;
- private MBeanServer server;
- private ObjectName objectName;
-
- public ServiceEndpointInvokerEJB21()
- {
- server = MBeanServerLocator.locateJBoss();
- }
-
- /** Initialize the service endpoint */
- @Override
- public void initServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- super.initServiceEndpoint(seInfo);
-
- ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
- String ejbName = epMetaData.getLinkName();
- if (ejbName == null)
- throw new WSException("Cannot obtain ejb-link from port component");
-
- UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)seInfo.getUnifiedDeploymentInfo().metaData;
- UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
- if (beanMetaData == null)
- throw new WSException("Cannot obtain ejb meta data for: " + ejbName);
-
- // verify the service endpoint
- String seiName = epMetaData.getServiceEndpointInterfaceName();
- if (epMetaData.getType() == Type.JAXRPC && seiName != null)
- {
- String bmdSEI = beanMetaData.getServiceEndpoint();
- if (seiName.equals(bmdSEI) == false)
- throw new WSException("Endpoint meta data defines SEI '" +
seiName + "', <service-endpoint> in ejb-jar.xml defines '" +
bmdSEI + "'");
- }
-
- // get the bean's JNDI name
- jndiName = beanMetaData.getContainerObjectNameJndiName();
- if (jndiName == null)
- throw new WSException("Cannot obtain JNDI name for: " + ejbName);
-
- objectName = ObjectNameFactory.create("jboss.j2ee:jndiName=" + jndiName +
",service=EJB");
-
- // Dynamically add the service endpoint interceptor
- //
http://jira.jboss.org/jira/browse/JBWS-758
- try
- {
- EjbModule ejbModule = (EjbModule)server.getAttribute(objectName,
"EjbModule");
- StatelessSessionContainer container =
(StatelessSessionContainer)ejbModule.getContainer(ejbName);
-
- boolean injectionPointFound = false;
- Interceptor prev = container.getInterceptor();
- while (prev != null && prev.getNext() != null)
- {
- Interceptor next = prev.getNext();
- if (next.getNext() == null)
- {
- log.debug("Inject service endpoint interceptor after: " +
prev.getClass().getName());
- ServiceEndpointInterceptor sepInterceptor = new
ServiceEndpointInterceptor();
- prev.setNext(sepInterceptor);
- sepInterceptor.setNext(next);
- injectionPointFound = true;
- }
- prev = next;
- }
- if (injectionPointFound == false)
- log.warn("Cannot service endpoint interceptor injection point");
- }
- catch (Exception ex)
- {
- log.warn("Cannot add service endpoint interceptor", ex);
- }
- }
-
- /** Load the SEI implementation bean if necessary
- */
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- if (server.isRegistered(objectName) == false)
- throw new WSException("Cannot find service endpoint target: " +
objectName);
-
- return null;
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
- {
- return null;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
-
- // these are provided by the ServerLoginHandler
- Principal principal = SecurityAssociation.getPrincipal();
- Object credential = SecurityAssociation.getCredential();
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-
- // invoke on the container
- try
- {
- // setup the invocation
- Method method = epInv.getJavaMethod();
- Object[] args = epInv.getRequestPayload();
- Invocation inv = new Invocation(null, method, args, null, principal,
credential);
-
- inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
- inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getSOAPMessage());
- inv.setType(InvocationType.SERVICE_ENDPOINT);
-
- // Set the handler callback and endpoint invocation
- inv.setValue(HandlerCallback.class.getName(), new HandlerCallback(seInfo),
PayloadKey.TRANSIENT);
- inv.setValue(EndpointInvocation.class.getName(), epInv, PayloadKey.TRANSIENT);
-
- String[] sig = { Invocation.class.getName() };
- Object retObj = server.invoke(objectName, "invoke", new Object[] { inv
}, sig);
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
- {
- // do nothing
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- if (type == HandlerType.PRE)
- return handlerDelegate.callRequestHandlerChain(seInfo, type);
- else
- return true;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
- {
- if (type == HandlerType.PRE)
- return handlerDelegate.callResponseHandlerChain(seInfo, type);
- else
- return true;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
- {
- if (type == HandlerType.PRE)
- return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
- else
- return true;
- }
-
- // The ServiceEndpointInterceptor calls the methods in this callback
- public class HandlerCallback
- {
- private ServiceEndpointInfo seInfo;
-
- public HandlerCallback(ServiceEndpointInfo seInfo)
- {
- this.seInfo = seInfo;
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callRequestHandlerChain(HandlerType type)
- {
- if (type == HandlerType.PRE)
- return true;
- else
- return handlerDelegate.callRequestHandlerChain(seInfo, type);
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callResponseHandlerChain(HandlerType type)
- {
- if (type == HandlerType.PRE)
- return true;
- else
- return handlerDelegate.callResponseHandlerChain(seInfo, type);
- }
-
- /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
- public boolean callFaultHandlerChain(HandlerType type, Exception ex)
- {
- if (type == HandlerType.PRE)
- return true;
- else
- return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
- }
-
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,145 +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.integration.jboss;
-
-// $Id: ServiceEndpointInvokerEJB3.java 902 2006-09-05 20:10:19Z thomas.diesler(a)jboss.com
$
-
-import java.lang.reflect.Method;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.aop.Dispatcher;
-import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.WSException;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.server.ServiceEndpointInfo;
-import org.jboss.ws.server.ServiceEndpointInvoker;
-import org.jboss.ws.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.utils.ObjectNameFactory;
-
-/**
- * Handles invocations on EJB3 endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jul-2005
- */
-public class ServiceEndpointInvokerEJB3 extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
-{
- // provide logging
- private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB3.class);
-
- private MBeanServer server;
- private ObjectName objectName;
-
- public ServiceEndpointInvokerEJB3()
- {
- server = MBeanServerLocator.locateJBoss();
- }
-
- /** Initialize the service endpoint */
- @Override
- public void initServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- super.initServiceEndpoint(seInfo);
-
- String ejbName = seInfo.getServerEndpointMetaData().getLinkName();
- UnifiedDeploymentInfo udi = seInfo.getUnifiedDeploymentInfo();
- String nameStr = "jboss.j2ee:name=" + ejbName +
",service=EJB3,jar=" + udi.shortName;
- if (udi.parent != null)
- {
- nameStr += ",ear=" + udi.parent.shortName;
- }
-
- objectName = ObjectNameFactory.create(nameStr.toString());
- }
-
- /** Load the SEI implementation bean if necessary
- */
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
- {
- if (server.isRegistered(objectName) == false)
- throw new WSException("Cannot find service endpoint target: " +
objectName);
-
- return null;
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
- {
- return null;
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
-
- /* [FIXME] how to do this for EJB3
-
- // these are provided by the ServerLoginHandler
- Principal principal = SecurityAssociation.getPrincipal();
- Object credential = SecurityAssociation.getCredential();
-
- CommonMessageContext msgContext = MessageContextAssociation.getMessageContext();
-
- Invocation inv = new Invocation(null, method, args, null, principal, credential);
- inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
- inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getMessage());
- inv.setType(InvocationType.SERVICE_ENDPOINT);
- */
-
- // invoke on the container
- try
- {
- // setup the invocation
- Method seiMethod = epInv.getJavaMethod();
- Object[] args = epInv.getRequestPayload();
-
- Dispatcher dispatcher = Dispatcher.singleton;
- String canonicalName = objectName.getCanonicalName();
- StatelessContainer container =
(StatelessContainer)dispatcher.getRegistered(canonicalName);
- if (container == null)
- throw new WSException("Cannot obtain container from Dispatcher: " +
canonicalName);
-
- Class implClass = container.getBeanClass();
- Method implMethod = getImplMethod(implClass, seiMethod);
-
- Object retObj = container.localInvoke(implMethod, args);
- epInv.setReturnValue(retObj);
- }
- catch (Throwable e)
- {
- handleInvocationException(e);
- }
- }
-
- /** Create an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
- {
- // do nothing
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,97 +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.integration.jboss;
-
-// $Id: ServiceEndpointInvokerMDB.java 694 2006-08-04 16:27:13Z thomas.diesler(a)jboss.com
$
-
-import java.lang.reflect.Method;
-
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.binding.EndpointInvocation;
-import org.jboss.ws.server.ServiceEndpointInfo;
-import org.jboss.ws.server.ServiceEndpointInvoker;
-import org.jboss.ws.server.AbstractServiceEndpointInvoker;
-import org.jboss.ws.utils.ThreadLocalAssociation;
-
-/**
- * Handles invocations on MDB endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Mar-2006
- */
-public class ServiceEndpointInvokerMDB extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
-{
- // provide logging
- private Logger log = Logger.getLogger(ServiceEndpointInvokerMDB.class);
-
- /** Load the SEI implementation bean if necessary
- */
- public Class loadServiceEndpoint(ServiceEndpointInfo seInfo) throws
ClassNotFoundException
- {
- return null;
- }
-
- // The dispatcher sets the target bean object
- public void setTargetBeanObject(Object targetMDB)
- {
- ThreadLocalAssociation.localInvokerMDBAssoc().set(targetMDB);
- }
-
- /** Create an instance of the SEI implementation bean if necessary
- */
- public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass) throws InstantiationException,
IllegalAccessException
- {
- return ThreadLocalAssociation.localInvokerMDBAssoc().get();
- }
-
- /** Invoke an instance of the SEI implementation bean */
- public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
- {
- log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
- try
- {
- Class implClass = seiImpl.getClass();
- Method seiMethod = epInv.getJavaMethod();
- Method implMethod = getImplMethod(implClass, seiMethod);
-
- Object[] args = epInv.getRequestPayload();
- Object retObj = implMethod.invoke(seiImpl, args);
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- finally
- {
- // cleanup thread local
- setTargetBeanObject(null);
- }
- }
-
- /** Destroy an instance of the SEI implementation bean if necessary */
- public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
- {
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss;
-
-// $Id: ServiceRefMetaDataAdaptor.java 906 2006-09-06 18:57:40Z thomas.diesler(a)jboss.com
$
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.webservice.metadata.serviceref.HandlerMetaData;
-import org.jboss.webservice.metadata.serviceref.InitParamMetaData;
-import org.jboss.webservice.metadata.serviceref.PortComponentRefMetaData;
-import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-
-/**
- * Build container independent service ref meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class ServiceRefMetaDataAdaptor
-{
- public static UnifiedServiceRefMetaData
buildUnifiedServiceRefMetaData(ServiceRefMetaData srmd)
- {
- UnifiedServiceRefMetaData usrmd = new UnifiedServiceRefMetaData();
- usrmd.setServiceRefName(srmd.getServiceRefName());
- usrmd.setServiceInterface(srmd.getServiceInterface());
- usrmd.setWsdlFile(srmd.getWsdlFile());
- usrmd.setJaxrpcMappingFile(srmd.getJaxrpcMappingFile());
- usrmd.setServiceQName(srmd.getServiceQName());
-
- LinkedHashMap<String, UnifiedPortComponentRefMetaData> pcrefs = new
LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
- for (PortComponentRefMetaData pcmd : srmd.getPortComponentRefs())
- {
- UnifiedPortComponentRefMetaData upcmd = new UnifiedPortComponentRefMetaData();
- upcmd.setServiceEndpointInterface(pcmd.getServiceEndpointInterface());
- upcmd.setPortComponentLink(pcmd.getPortComponentLink());
- upcmd.setCallProperties(pcmd.getCallProperties());
- pcrefs.put(pcmd.getServiceEndpointInterface(), upcmd);
- }
- usrmd.setPortComponentRefs(pcrefs);
-
- ArrayList<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
- for (HandlerMetaData hmd : srmd.getHandlers())
- {
- UnifiedHandlerMetaData uhmd = new UnifiedHandlerMetaData(null);
- uhmd.setHandlerName(hmd.getHandlerName());
- uhmd.setHandlerClass(hmd.getHandlerClass());
-
- for(String portname : hmd.getPortNames())
- {
- uhmd.addPortName(portname);
- }
- for (InitParamMetaData ipmd : hmd.getInitParams())
- {
- HandlerInitParam ip = new HandlerInitParam();
- ip.setParamName(ipmd.getParamName());
- ip.setParamValue(ipmd.getParamValue());
- uhmd.addInitParam(ip);
- }
- for (QName soapHeader : hmd.getSoapHeaders())
- {
- uhmd.addSoapHeader(soapHeader);
- }
- for (String soapRole : hmd.getSoapRoles())
- {
- uhmd.addSoapRole(soapRole);
- }
- handlers.add(uhmd);
- }
- usrmd.setHandlers(handlers);
-
- usrmd.setConfigName(srmd.getConfigName());
- usrmd.setConfigFile(srmd.getConfigFile());
- usrmd.setWsdlOverride(srmd.getWsdlOverride());
- usrmd.setCallProperties(srmd.getCallProperties());
- usrmd.setResourceCL(srmd.getResourceCL());
-
- return usrmd;
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss;
-
-// $Id: WebMetaDataAdaptor.java 354 2006-05-16 13:46:47Z thomas.diesler(a)jboss.com $
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.WebSecurityMetaData;
-import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-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;
-
-/**
- * Build container independent web meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class WebMetaDataAdaptor
-{
- public static UnifiedWebMetaData buildUnifiedWebMetaData(WebMetaData wmd)
- {
- UnifiedWebMetaData umd = new UnifiedWebMetaData();
- umd.setContextRoot(wmd.getContextRoot());
- umd.setServletMappings(wmd.getServletMappings());
- umd.setServletClassMap(wmd.getServletClassMap());
- umd.setConfigName(wmd.getConfigName());
- umd.setConfigFile(wmd.getConfigFile());
- umd.setContextLoader(wmd.getContextLoader());
- umd.setSecurityDomain(wmd.getSecurityDomain());
- umd.setPublishLocationAdapter(getPublishLocationAdpater(wmd));
- umd.setSecurityMetaData(getSecurityMetaData(wmd.getSecurityContraints()));
-
- return umd;
- }
-
- private static PublishLocationAdapter getPublishLocationAdpater(final WebMetaData
wmd)
- {
- return new PublishLocationAdapter ()
- {
- public String getWsdlPublishLocationByName(String name)
- {
- return wmd.getWsdlPublishLocationByName(name);
- }
- };
- }
-
- private static List<UnifiedWebSecurityMetaData> getSecurityMetaData(final
Iterator securityConstraints)
- {
- ArrayList<UnifiedWebSecurityMetaData> unifiedsecurityMetaData = new
ArrayList<UnifiedWebSecurityMetaData>();
-
- while (securityConstraints.hasNext())
- {
- WebSecurityMetaData securityMetaData =
(WebSecurityMetaData)securityConstraints.next();
-
- UnifiedWebSecurityMetaData current = new UnifiedWebSecurityMetaData();
- unifiedsecurityMetaData.add(current);
-
- current.setTransportGuarantee(securityMetaData.getTransportGuarantee());
-
- HashMap resources = securityMetaData.getWebResources();
- for (Object webResourceObj : resources.values())
- {
- WebResourceCollection webResource = (WebResourceCollection)webResourceObj;
- UnifiedWebResourceCollection currentResource =
current.addWebResource(webResource.getName());
- for (String currentPattern : webResource.getUrlPatterns())
- {
- currentResource.addPattern(currentPattern);
- }
- }
-
- }
-
- return unifiedsecurityMetaData;
- }
-
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,139 +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.integration.jboss;
-
-// $Id: WebServiceClientDeployer.java 522 2006-06-30 06:54:49Z thomas.diesler(a)jboss.com
$
-
-import java.net.URL;
-import java.util.Iterator;
-
-import javax.naming.Context;
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.xml.rpc.JAXRPCException;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
-import org.jboss.naming.Util;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.ws.WSException;
-import org.jboss.ws.deployment.JSR109ClientDeployment;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.jaxrpc.ServiceReferenceable;
-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
- * deployment descriptor.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Jan-2005
- */
-public class WebServiceClientDeployer extends ServiceMBeanSupport implements
WebServiceClientDeployerMBean
-{
- /**
- * This binds a jaxrpc Service into the callers ENC for every service-ref element
- *
- * @param envCtx ENC to bind the javax.rpc.xml.Service object to
- * @param serviceRefs An iterator of the service-ref elements in the client deployment
descriptor
- * @param di The client's deployment info
- * @throws org.jboss.deployment.DeploymentException if it goes wrong
- */
- public void setupServiceRefEnvironment(Context envCtx, Iterator serviceRefs,
DeploymentInfo di) throws DeploymentException
- {
- try
- {
- while (serviceRefs.hasNext())
- {
- ServiceRefMetaData serviceRef = (ServiceRefMetaData)serviceRefs.next();
- String serviceRefName = serviceRef.getServiceRefName();
-
- UnifiedServiceRefMetaData wsServiceRef =
ServiceRefMetaDataAdaptor.buildUnifiedServiceRefMetaData(serviceRef);
-
- JavaWsdlMapping javaWsdlMapping = getJavaWsdlMapping(wsServiceRef);
- wsServiceRef.setJavaWsdlMapping(javaWsdlMapping);
-
- Definition wsdlDefinition = getWsdlDefinition(wsServiceRef);
- wsServiceRef.setWsdlDefinition(wsdlDefinition);
-
- // build the container independent deployment info
- UnifiedDeploymentInfo udi = new
JSR109ClientDeployment(UnifiedDeploymentInfo.DeploymentType.JSR109_Client);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
-
- ServiceReferenceable ref = new ServiceReferenceable(wsServiceRef, udi);
- Util.bind(envCtx, serviceRefName, ref);
-
- log.debug("Webservice binding: java:comp/env/" + serviceRefName);
- }
- }
- catch (Exception e)
- {
- throw new DeploymentException("Cannot bind webservice to client
environment", e);
- }
- }
-
- private JavaWsdlMapping getJavaWsdlMapping(UnifiedServiceRefMetaData serviceRef)
- {
- JavaWsdlMapping javaWsdlMapping = null;
- URL mappingURL = serviceRef.getJavaWsdlMappingURL();
- if (mappingURL != null)
- {
- try
- {
- // setup the XML binding Unmarshaller
- JavaWsdlMappingFactory mappingFactory =
JavaWsdlMappingFactory.newInstance();
- javaWsdlMapping = mappingFactory.parse(mappingURL);
- }
- catch (Exception e)
- {
- throw new JAXRPCException("Cannot unmarshal jaxrpc-mapping-file: "
+ mappingURL, e);
- }
- }
- return javaWsdlMapping;
- }
-
- private Definition getWsdlDefinition(UnifiedServiceRefMetaData serviceRef)
- {
- Definition wsdlDefinition = null;
- {
- URL wsdlOverride = serviceRef.getWsdlOverride();
- URL wsdlURL = serviceRef.getWsdlURL();
- if (wsdlOverride == null && wsdlURL != null)
- {
- try
- {
- WSDL11DefinitionFactory factory = WSDL11DefinitionFactory.newInstance();
- wsdlDefinition = factory.parse(wsdlURL);
- }
- catch (WSDLException e)
- {
- throw new WSException("Cannot unmarshall wsdl, cause: " +
e.toString());
- }
- }
- }
- return wsdlDefinition;
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,38 +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.integration.jboss;
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.utils.ObjectNameFactory;
-import org.jboss.system.ServiceMBean;
-import org.jboss.webservice.WebServiceClientDeployment;
-
-/**
- * MBean interface.
- * @since 19-Jan-2005
- */
-public interface WebServiceClientDeployerMBean extends WebServiceClientDeployment,
ServiceMBean
-{
- // default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceClientDeployer");
-}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ApplicationMetaDataAdaptor.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id: ApplicationMetaDataAdaptor.java 354 2006-05-16 13:46:47Z thomas.diesler(a)jboss.com
$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.BeanMetaData;
+import org.jboss.metadata.EjbPortComponentMetaData;
+import org.jboss.metadata.MessageDrivenMetaData;
+import org.jboss.metadata.SessionMetaData;
+import org.jboss.metadata.WebMetaData;
+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.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
+
+/**
+ * Build container independent application meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class ApplicationMetaDataAdaptor
+{
+ public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(ApplicationMetaData apmd)
+ {
+ UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
+ buildUnifiedBeanMetaData(umd, apmd);
+ umd.setConfigName(apmd.getConfigName());
+ umd.setConfigFile(apmd.getConfigFile());
+ umd.setWebServiceContextRoot(apmd.getWebServiceContextRoot());
+ umd.setSecurityDomain(apmd.getSecurityDomain());
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(apmd));
+ return umd;
+ }
+
+ private static PublishLocationAdapter getPublishLocationAdpater(final
ApplicationMetaData apmd)
+ {
+ return new PublishLocationAdapter ()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ return apmd.getWsdlPublishLocationByName(name);
+ }
+ };
+ }
+
+ private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData metaData)
+ {
+ List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ Iterator it = metaData.getEnterpriseBeans();
+ while (it.hasNext())
+ {
+ BeanMetaData bmd = (BeanMetaData)it.next();
+ UnifiedBeanMetaData ubmd = buildUnifiedBeanMetaData(bmd);
+ if (ubmd != null)
+ {
+ beans.add(ubmd);
+ }
+ }
+ umd.setEnterpriseBeans(beans);
+ }
+
+ private static UnifiedBeanMetaData buildUnifiedBeanMetaData(BeanMetaData bmd)
+ {
+ UnifiedBeanMetaData ubmd = null;
+ if (bmd instanceof SessionMetaData)
+ {
+ ubmd = new UnifiedSessionMetaData();
+ }
+ else if (bmd instanceof MessageDrivenMetaData)
+ {
+ ubmd = new UnifiedMessageDrivenMetaData();
+
((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessageDrivenMetaData)bmd).getDestinationJndiName());
+ }
+
+ if (ubmd != null)
+ {
+ ubmd.setEjbName(bmd.getEjbName());
+ ubmd.setEjbClass(bmd.getEjbClass());
+ ubmd.setServiceEndpoint(bmd.getServiceEndpoint());
+ ubmd.setHome(bmd.getHome());
+ ubmd.setLocalHome(bmd.getLocalHome());
+ ubmd.setJndiName(bmd.getJndiName());
+ ubmd.setLocalJndiName(bmd.getLocalJndiName());
+
+ EjbPortComponentMetaData pcmd = bmd.getPortComponent();
+ if (pcmd != null)
+ {
+ UnifiedEjbPortComponentMetaData upcmd = new
UnifiedEjbPortComponentMetaData();
+ upcmd.setPortComponentName(pcmd.getPortComponentName());
+ upcmd.setPortComponentURI(pcmd.getPortComponentURI());
+ upcmd.setAuthMethod(pcmd.getAuthMethod());
+ upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
+ ubmd.setPortComponent(upcmd);
+ }
+ }
+ return ubmd;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptor.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,184 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id: WebServiceDeployer.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerInterceptorSupport;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.mx.server.Invocation;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.ws.core.server.KernelLocator;
+import org.jboss.ws.deployment.ServiceEndpointDeployer;
+import org.jboss.ws.deployment.ServiceEndpointPublisher;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+
+/**
+ * A deployer service that manages WS4EE compliant Web Services
+ *
+ * This service is called from the {@see org.jboss.ws.metadata.WebServiceInterceptor}
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Dimitris.Andreadis(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public abstract class DeployerInterceptor extends SubDeployerInterceptorSupport
+{
+ // The main deployer
+ private MainDeployerMBean mainDeployer;
+
+ /** Create the deployer service
+ */
+ protected void createService() throws Exception
+ {
+ mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class,
MainDeployerMBean.OBJECT_NAME, server);
+ super.attach();
+ }
+
+ /** Destroy the deployer service
+ */
+ protected void destroyService()
+ {
+ super.detach();
+ }
+
+ /** Overwrite to create the webservice
+ */
+ protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("create: " + di.url);
+
+ Object retn = invokeNext(invocation);
+
+ if (isWebserviceDeployment(di))
+ {
+ UnifiedDeploymentInfo udi = createUnifiedDeploymentInfo(di);
+ di.context.put(UnifiedDeploymentInfo.class.getName(), udi);
+ getServiceEndpointDeployer().create(udi);
+ }
+
+ return retn;
+ }
+
+ /** Overwrite to start the webservice
+ */
+ protected Object start(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("start: " + di.url);
+
+ Object retn = invokeNext(invocation);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ // late initialization of the web context loader
+ if (di.metaData instanceof WebMetaData)
+ {
+ ClassLoader classLoader = ((WebMetaData)di.metaData).getContextLoader();
+ udi.ucl = classLoader;
+ }
+
+ getServiceEndpointDeployer().start(udi);
+ }
+
+ return retn;
+ }
+
+ /** Overwrite to stop the webservice
+ */
+ protected Object stop(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("stop: " + di.url);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ getServiceEndpointDeployer().stop(udi);
+ }
+
+ return invokeNext(invocation);
+ }
+
+ /** Overwrite to destroy the webservice
+ */
+ protected Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("destroy: " + di.url);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ getServiceEndpointDeployer().destroy(udi);
+ }
+
+ return invokeNext(invocation);
+ }
+
+ protected ServiceEndpointDeployer getServiceEndpointDeployer()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(ServiceEndpointDeployer.BEAN_NAME);
+ return (ServiceEndpointDeployer)entry.getTarget();
+ }
+
+ protected ServiceEndpointPublisher getServiceEndpointPublisher()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(ServiceEndpointPublisher.BEAN_NAME);
+ return (ServiceEndpointPublisher)entry.getTarget();
+ }
+
+ /** Return true if the deployment contains a web service endpoint
+ */
+ protected abstract boolean isWebserviceDeployment(DeploymentInfo di);
+
+ protected abstract UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo
di) throws Throwable;
+
+ protected UnifiedDeploymentInfo getServiceEndpointDeployment(DeploymentInfo di)
+ {
+ return
(UnifiedDeploymentInfo)di.context.get(UnifiedDeploymentInfo.class.getName());
+ }
+
+ /** Handle all webservice deployment exceptions.
+ * You can either simply logs the problem and keep the EJB/WAR module
+ * alive or undeploy properly.
+ */
+ protected void handleStartupException(DeploymentInfo di, Throwable th)
+ {
+ log.error("Cannot startup webservice for: " + di.shortName, th);
+ mainDeployer.undeploy(di);
+ }
+
+ /** Handle all webservice deployment exceptions.
+ *
+ * You can either simply logs the problem and keep the EJB/WAR module
+ * alive or undeploy properly.
+ */
+ protected void handleShutdownException(String moduleName, Throwable th)
+ {
+ log.error("Cannot shutdown webservice for: " + moduleName, th);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+//$Id: WebServiceDeployerEJB.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.mx.server.Invocation;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.UnifiedMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web-Services for EJB Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public abstract class DeployerInterceptorEJB extends DeployerInterceptor
+{
+ protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ Object retObj = super.create(invocation, di);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ UnifiedMetaData wsMetaData =
getServiceEndpointDeployer().getUnifiedMetaData(udi);
+ udi.localUrl = generateWebDeployment(di, wsMetaData);
+ udi.context.put(DeploymentInfo.class.getName(), di);
+ getServiceEndpointPublisher().publishServiceEndpoint(udi);
+ }
+
+ return retObj;
+ }
+
+ protected abstract URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData
wsMetaData) throws IOException;
+
+ protected Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ getServiceEndpointPublisher().destroyServiceEndpoint(udi);
+ }
+
+ return super.destroy(invocation, di);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id: WebServiceDeployerEJB21.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Iterator;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.BeanMetaData;
+import org.jboss.ws.WSException;
+import org.jboss.ws.deployment.JSR109Deployment;
+import org.jboss.ws.deployment.JSR181Deployment;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.UnifiedMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web-Services for EJB-2.1 Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public class DeployerInterceptorEJB21 extends DeployerInterceptorEJB implements
DeployerInterceptorEJB21MBean
+{
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
+ {
+ UnifiedDeploymentInfo udi;
+ URL webservicesURL = getWebservicesDescriptor(di);
+ if (webservicesURL != null)
+ {
+ udi = new JSR109Deployment(UnifiedDeploymentInfo.DeploymentType.JSR109_EJB21,
webservicesURL);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ else
+ {
+ udi = new JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_EJB21);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ return udi;
+ }
+
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ ApplicationMetaData applMetaData = (ApplicationMetaData)di.metaData;
+ boolean isWebserviceDeployment = applMetaData.isWebServiceDeployment();
+
+ // Check if we have a webservices.xml descriptor
+ if (isWebserviceDeployment == false)
+ {
+ isWebserviceDeployment = getWebservicesDescriptor(di) != null;
+ }
+
+ // Check if the ejb-jar contains annotated endpoints
+ if (isWebserviceDeployment == false)
+ {
+ try
+ {
+ Iterator itBeans = applMetaData.getEnterpriseBeans();
+ while (itBeans.hasNext() && isWebserviceDeployment == false)
+ {
+ BeanMetaData beanMetaData = (BeanMetaData)itBeans.next();
+ String ejbClassName = beanMetaData.getEjbClass();
+ Class ejbClass = di.annotationsCl.loadClass(ejbClassName);
+ isWebserviceDeployment =
ejbClass.isAnnotationPresent(javax.jws.WebService.class);
+ }
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new WSException(e);
+ }
+ }
+
+ applMetaData.setWebServiceDeployment(isWebserviceDeployment);
+ return isWebserviceDeployment;
+ }
+
+ /**
+ * Get the resource name of the webservices.xml descriptor.
+ */
+ protected URL getWebservicesDescriptor(DeploymentInfo di)
+ {
+ return di.localCl.findResource("META-INF/webservices.xml");
+ }
+
+ protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
+ {
+ ServiceEndpointGeneratorEJB21 generator = new ServiceEndpointGeneratorEJB21();
+ return generator.generatWebDeployment(di, wsMetaData);
+ }
+
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB21MBean.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.SubDeployerInterceptorMBean;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface DeployerInterceptorEJB21MBean extends SubDeployerInterceptorMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerEJB21");
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id: WebServiceDeployerEJB3.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+
+import javax.jws.WebService;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.ejb3.Ejb3ModuleMBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.WSException;
+import org.jboss.ws.deployment.JSR181Deployment;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.UnifiedMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web-Services for EJB3 Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public class DeployerInterceptorEJB3 extends DeployerInterceptorEJB implements
DeployerInterceptorEJB3MBean
+{
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
+ {
+ UnifiedDeploymentInfo udi = new
JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_EJB3);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
+
+ // The container objects below provide access to all of the ejb metadata
+ ArrayList<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ for (Object container : ejb3Module.getContainers().values())
+ {
+ if (container instanceof StatelessContainer)
+ {
+ StatelessContainer slc = (StatelessContainer)container;
+ UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
+ uslc.setEjbName(slc.getEjbName());
+ uslc.setEjbClass(slc.getBeanClassName());
+ beans.add(uslc);
+ }
+ }
+
+ UnifiedApplicationMetaData appMetaData = new UnifiedApplicationMetaData();
+ appMetaData.setEnterpriseBeans(beans);
+ udi.metaData = appMetaData;
+
+ return udi;
+ }
+
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ boolean isWebserviceDeployment = false;
+
+ // Check if the ejb3 contains annotated endpoints
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
+ for (Object manager : ejb3Module.getContainers().values())
+ {
+ if (manager instanceof StatelessContainer)
+ {
+ StatelessContainer container = (StatelessContainer)manager;
+ if (container.resolveAnnotation(WebService.class) != null)
+ {
+ isWebserviceDeployment = true;
+ break;
+ }
+ }
+ }
+
+ return isWebserviceDeployment;
+ }
+
+ private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
+ {
+ Ejb3ModuleMBean ejb3Module;
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
+ if (ejb3Module == null)
+ throw new WSException("Cannot obtain EJB3 module: " + objectName);
+
+ return ejb3Module;
+ }
+ catch (MBeanProxyCreationException ex)
+ {
+ throw new WSException("Cannot obtain proxy to EJB3 module");
+ }
+ }
+
+ protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
+ {
+ return new ServiceEndpointGeneratorEJB3().generatWebDeployment(di, wsMetaData);
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorEJB3MBean.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.SubDeployerInterceptorMBean;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface DeployerInterceptorEJB3MBean extends SubDeployerInterceptorMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerEJB3");
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSE.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id: WebServiceDeployerJSE.java 377 2006-05-18 13:57:29Z thomas.diesler(a)jboss.com $
+
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.mx.server.Invocation;
+import org.jboss.ws.WSException;
+import org.jboss.ws.deployment.JSR109Deployment;
+import org.jboss.ws.deployment.JSR181Deployment;
+import org.jboss.ws.deployment.ServiceEndpointPublisher;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.UnifiedMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web Services for WAR
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public class DeployerInterceptorJSE extends DeployerInterceptor implements
DeployerInterceptorJSEMBean
+{
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
+ {
+ UnifiedDeploymentInfo udi;
+
+ DeploymentType type =
(DeploymentType)di.context.get("UnifiedDeploymentInfo.Type");
+ if (type == UnifiedDeploymentInfo.DeploymentType.JSR109_JSE)
+ {
+ URL webservicesURL = getWebservicesDescriptor(di);
+ udi = new JSR109Deployment(UnifiedDeploymentInfo.DeploymentType.JSR109_JSE,
webservicesURL);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+
+ }
+ else if (type == UnifiedDeploymentInfo.DeploymentType.JSR181_JSE)
+ {
+ udi = new JSR181Deployment(UnifiedDeploymentInfo.DeploymentType.JSR181_JSE);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ else
+ {
+ throw new WSException("Unexpected type: " + type);
+ }
+
+ return udi;
+ }
+
+ /** Overwrite to create the webservice
+ *
+ * This implemantation modifies the servlet entries in web.xml
+ */
+ protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ Object retn = super.create(invocation, di);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ ServiceEndpointPublisher endpointPublisher = getServiceEndpointPublisher();
+ Map<String, String> sepTargetMap = endpointPublisher.rewriteWebXML(udi);
+ updateServiceEndpointTargetBeans(udi, sepTargetMap);
+ }
+ return retn;
+ }
+
+ private void updateServiceEndpointTargetBeans(UnifiedDeploymentInfo udi,
Map<String, String> sepTargetMap)
+ {
+ UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
+
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String targetBean = sepTargetMap.get(sepMetaData.getLinkName());
+ sepMetaData.setServiceEndpointImplName(targetBean);
+ }
+ }
+ }
+
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ WebMetaData webMetaData = (WebMetaData)di.metaData;
+ boolean isWebserviceDeployment = webMetaData.isWebServiceDeployment();
+
+ // Check if we have a webservices.xml descriptor
+ if (isWebserviceDeployment == false)
+ {
+ if (getWebservicesDescriptor(di) != null)
+ {
+ di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JSR109_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+
+ // Check if the web.xml contains annotated endpoint impl
+ if (isWebserviceDeployment == false)
+ {
+ Map servletClassMap = webMetaData.getServletClassMap();
+ Iterator<String> it = servletClassMap.values().iterator();
+ while (it.hasNext() && isWebserviceDeployment == false)
+ {
+ String servletClassName = it.next();
+ try
+ {
+ Class servletClass = di.annotationsCl.loadClass(servletClassName);
+ if (servletClass.isAnnotationPresent(javax.jws.WebService.class))
+ {
+ di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JSR181_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ }
+ }
+ }
+
+ webMetaData.setWebServiceDeployment(isWebserviceDeployment);
+ return isWebserviceDeployment;
+ }
+
+ /**
+ * Get the resource name of the webservices.xml descriptor.
+ */
+ protected URL getWebservicesDescriptor(DeploymentInfo di)
+ {
+ return di.localCl.findResource("WEB-INF/webservices.xml");
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorJSEMBean.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.SubDeployerInterceptorMBean;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface DeployerInterceptorJSEMBean extends SubDeployerInterceptorMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerJSE");
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSE.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id: WebServiceDeployerNestedJSE.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com
$
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerSupport;
+import org.jboss.system.server.ServerConfig;
+import org.jboss.system.server.ServerConfigLocator;
+import org.jboss.ws.core.utils.IOUtils;
+
+/**
+ * A deployer service that manages WS4EE compliant Web Services for
+ * nested POJO endpoints.
+ *
+ * The WebServiceDeployerJSE attaches itself as an deployment interceptor to
+ * the jboss.web:service=WebServer deployer. As a consequence, all *.war deployments
+ * that are picked up before the interceptor is installed are not treated as potential
+ * web service endpoint deployments.
+ *
+ * Nested POJO endpoints can be packaged in *.jse deployments that are then picked up by
this
+ * deployer.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 03-Mar-2005
+ */
+public class DeployerInterceptorNestedJSE extends SubDeployerSupport implements
DeployerInterceptorNestedJSEMBean
+{
+ private static final String NESTED_JSE_WAR_FILE =
"org.jboss.ws.server.nested.jse";
+
+ // The MainDeployer
+ protected MainDeployerMBean mainDeployer;
+
+ public void setMainDeployer(MainDeployerMBean mainDeployer)
+ {
+ this.mainDeployer = mainDeployer;
+ }
+
+ public boolean accepts(DeploymentInfo sdi)
+ {
+ setSuffixes(new String[] { ".jse" });
+ return super.accepts(sdi);
+ }
+
+ /** Copy the *.jse to a *.war and deploy through the main deployer
+ */
+ public void create(DeploymentInfo di) throws DeploymentException
+ {
+ log.debug("create: " + di.url);
+
+ try
+ {
+ File jseFile = new File(di.localUrl.getFile());
+ if (jseFile.isFile() == false)
+ throw new DeploymentException("Expected a file: " + di.localUrl);
+
+ ServerConfig config = ServerConfigLocator.locate();
+ String warFileName = config.getServerTempDir().getCanonicalPath() +
"/deploy/" + di.shortName;
+ warFileName = warFileName.substring(0, warFileName.length() - 4) +
".war";
+ File warFile = new File(warFileName);
+
+ FileOutputStream fos = new FileOutputStream(warFile);
+ FileInputStream fis = new FileInputStream(jseFile);
+ try
+ {
+ IOUtils.copyStream(fos, fis);
+ }
+ finally
+ {
+ fos.close();
+ fis.close();
+ }
+
+ mainDeployer.deploy(warFile.toURL());
+
+ // remember the war url that we deployed
+ di.context.put(NESTED_JSE_WAR_FILE, warFile);
+
+ super.create(di);
+ }
+ catch (IOException ex)
+ {
+ throw new DeploymentException("Failed to create: " + di.url, ex);
+ }
+ }
+
+ /** Undeploy the *.war through the main deployer
+ */
+ public void destroy(DeploymentInfo di) throws DeploymentException
+ {
+ log.debug("destroy: " + di.url);
+ try
+ {
+ File warFile = (File)di.context.get(NESTED_JSE_WAR_FILE);
+ mainDeployer.undeploy(warFile.toURL());
+ warFile.delete();
+
+ super.destroy(di);
+ }
+ catch (IOException ex)
+ {
+ throw new DeploymentException("Failed to destroy: " + di.url, ex);
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeployerInterceptorNestedJSEMBean.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id: WebServiceDeployerNestedJSEMBean.java 296 2006-05-08 19:45:49Z
thomas.diesler(a)jboss.com $
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerMBean;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 03-Mar-2005
+ */
+public interface DeployerInterceptorNestedJSEMBean extends SubDeployerMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerNestedJSE");
+
+ void setMainDeployer(MainDeployerMBean mainDeployer);
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/DeploymentInfoAdaptor.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id: WebServiceDeploymentAdaptor.java 317 2006-05-14 17:16:59Z
thomas.diesler(a)jboss.com $
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+
+/**
+ * Build container independent deployment info.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class DeploymentInfoAdaptor
+{
+ public static UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi,
DeploymentInfo di)
+ {
+ if (di.parent != null)
+ {
+ udi.parent = new UnifiedDeploymentInfo(null);
+ buildDeploymentInfo(udi.parent, di.parent);
+ }
+
+ udi.shortName = di.shortName;
+ udi.url = di.url;
+ udi.localUrl = di.localUrl;
+ udi.metaData = buildMetaData(di.metaData);
+ udi.annotationsCl = di.annotationsCl;
+ udi.localCl = di.localCl;
+ udi.ucl = di.ucl;
+ udi.deployedObject = di.deployedObject;
+
+ return udi;
+ }
+
+ private static Object buildMetaData(Object metaData)
+ {
+ Object retMetaData = null;
+ if (metaData instanceof WebMetaData)
+ {
+ retMetaData =
WebMetaDataAdaptor.buildUnifiedWebMetaData((WebMetaData)metaData);
+ }
+ else if (metaData instanceof ApplicationMetaData)
+ {
+ retMetaData =
ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData((ApplicationMetaData)metaData);
+ }
+ return retMetaData;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossContextServlet.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossContextServlet.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.CommonContextServlet;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+
+/**
+ * The servlet that that is associated with context /jbossws
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2005
+ */
+public class JBossContextServlet extends CommonContextServlet
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(JBossContextServlet.class);
+
+ protected void initServiceEndpointManager()
+ {
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ epManager = factory.getServiceEndpointManager();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointPublisher.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointPublisher.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointPublisher.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id: WebServiceDeployer.java 312 2006-05-11 10:49:22Z thomas.diesler(a)jboss.com $
+
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.deployment.ServiceEndpointPublisher;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.UnifiedMetaData;
+
+/**
+ * Publish the HTTP service endpoint to Tomcat
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class JBossServiceEndpointPublisher extends ServiceEndpointPublisher
+{
+
+ public String publishServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
+ {
+ URL warURL = udi.localUrl;
+ DeploymentInfo di =
(DeploymentInfo)udi.context.get(DeploymentInfo.class.getName());
+ if (di == null)
+ throw new IllegalStateException("Cannot obtain DeploymentInfo from
context");
+
+ rewriteWebXML(udi);
+
+ // Preserve the repository config
+ DeploymentInfo auxdi = new DeploymentInfo(warURL, null,
MBeanServerLocator.locateJBoss());
+ auxdi.repositoryConfig = di.getTopRepositoryConfig();
+ getMainDeployer().deploy(auxdi);
+ return "OK";
+ }
+
+ public String destroyServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
+ {
+ getMainDeployer().undeploy(udi.localUrl);
+ return "OK";
+ }
+
+ public Set<String> getWebServiceServletLinks(UnifiedDeploymentInfo udi)
+ {
+ Set<String> links = new HashSet<String>();
+
+ UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
+
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ links.add(sepMetaData.getLinkName());
+
+ }
+ }
+
+ return links;
+ }
+
+ private MainDeployerMBean getMainDeployer() throws MBeanProxyCreationException
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ MainDeployerMBean mainDeployer =
(MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME,
server);
+ return mainDeployer;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/JBossServiceEndpointServlet.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id: ServiceEndpointServlet.java 296 2006-05-08 19:45:49Z thomas.diesler(a)jboss.com $
+
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.core.server.StandardEndpointServlet;
+import org.jboss.ws.metadata.HandlerMetaData;
+import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.config.WSCommonConfig;
+
+/**
+ * A servlet that is installed for every web service endpoint.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-May-2006
+ */
+public class JBossServiceEndpointServlet extends StandardEndpointServlet
+{
+ // provide logging
+ private static final Logger log =
Logger.getLogger(JBossServiceEndpointServlet.class);
+
+ /** Initialize the service endpoint
+ */
+ protected void initServiceEndpoint(String contextPath)
+ {
+ super.initServiceEndpoint(contextPath);
+
+ ServiceEndpoint wsEndpoint = epManager.getServiceEndpointByID(sepId);
+ if (wsEndpoint == null)
+ throw new WSException("Cannot obtain endpoint for: " + sepId);
+
+ // read the config name/file from web.xml
+ ServletContext ctx = getServletContext();
+ String configName = ctx.getInitParameter("jbossws-config-name");
+ String configFile = ctx.getInitParameter("jbossws-config-file");
+ if (configName != null || configFile != null)
+ {
+ log.debug("Updating service endpoint config\n config-name: " +
configName + "\n config-file: " + configFile);
+ ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
+ sepMetaData.setConfigName(configName);
+ sepMetaData.setConfigFile(configFile);
+
+ List<HandlerMetaData> sepHandlers =
sepMetaData.getHandlerMetaData(HandlerType.ENDPOINT);
+ sepMetaData.clearHandlers();
+
+ // Add pre handlers
+ WSCommonConfig sepConfig = sepMetaData.getEndpointConfig();
+ sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.PRE));
+
+ // Restore the endpoint handlers
+ sepMetaData.addHandlers(sepHandlers);
+
+ // Add post handlers
+ sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.POST));
+
+ log.debug("Updated endpoint meta data" + sepMetaData);
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/PortComponentLinkServlet.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id: PortComponentLinkServlet.java 419 2006-05-30 13:32:38Z thomas.diesler(a)jboss.com
$
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+
+/**
+ * A servlet that reports the serviceURL for a given service ID.
+ * <p/>
+ * When the web service client ENC is setup, it may contain port-component-link
+ * entries that point to service endpoints in the same top level deployment.
+ * The final serviceURL of those endpoints will become available after the
+ * reference to the javax.xml.rpc.Service is bound to JNDI.
+ * <p/>
+ * When the client does a lookup of the javax.xml.rpc.Service from JNDI the
ObjectFactory
+ * will contact this servlet for the final serviceURL. It is acceptable that the client
+ * wsdl does not contain the correct serviceURL if the client is using the
port-component-link element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 29-May-2004
+ */
+public class PortComponentLinkServlet extends HttpServlet
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(PortComponentLinkServlet.class);
+
+ protected ServiceEndpointManager epManager;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ epManager = factory.getServiceEndpointManager();
+ }
+
+ /**
+ * Get the serviceURL as string for a given serviceID.
+ */
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ String pcLink = req.getParameter("pcLink");
+ if (pcLink == null)
+ throw new IllegalArgumentException("Cannot obtain request parameter
'pcLink'");
+
+ ServiceEndpoint serviceEndpoint = epManager.resolvePortComponentLink(pcLink);
+ ;
+ if (serviceEndpoint == null)
+ throw new WSException("Cannot resolve port-component-link: " +
pcLink);
+
+ res.setContentType("text/plain");
+ PrintWriter out = res.getWriter();
+
+ String endpointAddress =
serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
+ out.println(endpointAddress);
+
+ log.debug("Resolved " + pcLink + " to: " + endpointAddress);
+ out.close();
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServerConfigImpl.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServerConfigImpl.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id: ServiceEndpointManagerFactoryImpl.java 294 2006-05-08 16:33:42Z
thomas.diesler(a)jboss.com $
+
+import java.io.File;
+import java.util.Set;
+
+import javax.management.AttributeNotFoundException;
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * JBoss specific implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author darran.lofthouse(a)jboss.com
+ * @since 08-May-2006
+ */
+public class ServerConfigImpl implements ServerConfig
+{
+
+ private static final Logger log = Logger.getLogger(ServerConfigImpl.class);
+
+ public File getServerTempDir()
+ {
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File tmpdir = (File)server.getAttribute(oname, "ServerTempDir");
+ return tmpdir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public File getServerDataDir()
+ {
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File tmpdir = (File)server.getAttribute(oname, "ServerDataDir");
+ return tmpdir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public int getWebServicePort()
+ {
+ int port = getConnectorPort("HTTP/1.1", false);
+ if (port > -1)
+ {
+ return port;
+ }
+
+ log.warn("Unable to calculate 'WebServicePort', using default
'8080'");
+ return 8080;
+ }
+
+ public int getWebServiceSecurePort()
+ {
+ int port = getConnectorPort("HTTP/1.1", true);
+ if (port > -1)
+ {
+ return port;
+ }
+
+ log.warn("Unable to calculate 'WebServiceSecurePort', using default
'8443'");
+ return 8443;
+ }
+
+ private int getConnectorPort(final String protocol, final boolean secure)
+ {
+ int port = -1;
+
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
+
+ Set connectorNames = server.queryNames(connectors, null);
+ for (Object current : connectorNames)
+ {
+ ObjectName currentName = (ObjectName)current;
+
+ try
+ {
+ int connectorPort = (Integer)server.getAttribute(currentName,
"port");
+ boolean connectorSecure = (Boolean)server.getAttribute(currentName,
"secure");
+ String connectorProtocol = (String)server.getAttribute(currentName,
"protocol");
+
+ if (protocol.equals(connectorProtocol) && secure ==
connectorSecure)
+ {
+ if (port > -1)
+ {
+ log.warn("Found multiple connectors for protocol='" +
protocol + "' and secure='" + secure + "', using first port
found '" + port + "'");
+ }
+ else
+ {
+ port = connectorPort;
+ }
+ }
+ }
+ catch (AttributeNotFoundException ignored)
+ {
+ }
+ }
+
+ return port;
+ }
+ catch (JMException e)
+ {
+ return -1;
+ }
+
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,306 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id$
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.logging.Logger;
+import org.jboss.system.server.ServerConfig;
+import org.jboss.system.server.ServerConfigLocator;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.ServiceMetaData;
+import org.jboss.ws.metadata.UnifiedMetaData;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a web deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public abstract class ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB.class);
+
+ public URL generatWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData) throws
IOException
+ {
+ // Collect the list of PortComponentMetaData
+ List<EndpointMetaData> epMetaDataList = new
ArrayList<EndpointMetaData>();
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ epMetaDataList.add(epMetaData);
+ }
+ }
+
+ Element webDoc = createWebAppDescriptor(di, epMetaDataList);
+ Element jbossDoc = createJBossWebAppDescriptor(di, epMetaDataList);
+
+ File tmpWar = null;
+ try
+ {
+ ServerConfig config = ServerConfigLocator.locate();
+ File tmpdir = new File(config.getServerTempDir().getCanonicalPath() +
"/deploy");
+
+ String deploymentName = di.getCanonicalName().replace('/', '-')
+ "-ws";
+ tmpWar = File.createTempFile(deploymentName, ".war", tmpdir);
+ tmpWar.delete();
+ File webInf = new File(tmpWar, "WEB-INF");
+ webInf.mkdirs();
+
+ File webXml = new File(webInf, "web.xml");
+ FileWriter fw = new FileWriter(webXml);
+ new DOMWriter(fw).setPrettyprint(true).print(webDoc);
+ fw.close();
+
+ File jbossWebXml = new File(webInf, "jboss-web.xml");
+ fw = new FileWriter(jbossWebXml);
+ new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
+ fw.close();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to create webservice.war", e);
+ }
+
+ return tmpWar.toURL();
+ }
+
+ private Element createWebAppDescriptor(DeploymentInfo di, List<EndpointMetaData>
epMetaDataList)
+ {
+ Element webApp = DOMUtils.createElement("web-app");
+
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String ejbName = sepMetaData.getLinkName();
+ Element servlet =
(Element)webApp.appendChild(DOMUtils.createElement("servlet"));
+ Element servletName =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode(ejbName));
+ Element servletClass =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
+ String targetBean = sepMetaData.getServiceEndpointImplName();
+ String seiName = sepMetaData.getServiceEndpointInterfaceName();
+ String servletClassName = (targetBean != null ? targetBean : seiName);
+ servletClass.appendChild(DOMUtils.createTextNode(servletClassName));
+ }
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ ArrayList<String> urlPatters = new ArrayList<String>();
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String ejbName = sepMetaData.getLinkName();
+ Element servletMapping =
(Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
+ Element servletName =
(Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode(ejbName));
+ Element urlPatternElement =
(Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
+
+ String urlPattern = "/*";
+ if (sepMetaData.getURLPattern() != null)
+ {
+ urlPattern = sepMetaData.getURLPattern();
+ }
+
+ if (urlPatters.contains(urlPattern))
+ throw new IllegalArgumentException("Cannot use the same url-pattern with
different endpoints, " + "check your <port-component-uri> in
jboss.xml");
+
+ urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
+ urlPatters.add(urlPattern);
+ }
+
+ String authMethod = null;
+
+ // Add web-app/security-constraint for each port component
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String ejbName = sepMetaData.getLinkName();
+ if (sepMetaData.getAuthMethod() != null || sepMetaData.getTransportGuarantee()
!= null)
+ {
+ /*
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>TestUnAuthPort</web-resource-name>
+ <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>*</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ */
+ Element securityConstraint =
(Element)webApp.appendChild(DOMUtils.createElement("security-constraint"));
+ Element wrc =
(Element)securityConstraint.appendChild(DOMUtils.createElement("web-resource-collection"));
+ Element wrName =
(Element)wrc.appendChild(DOMUtils.createElement("web-resource-name"));
+ wrName.appendChild(DOMUtils.createTextNode(ejbName));
+ Element pattern =
(Element)wrc.appendChild(DOMUtils.createElement("url-pattern"));
+ String uri = sepMetaData.getURLPattern();
+ pattern.appendChild(DOMUtils.createTextNode(uri));
+ Element method =
(Element)wrc.appendChild(DOMUtils.createElement("http-method"));
+ method.appendChild(DOMUtils.createTextNode("GET"));
+ method =
(Element)wrc.appendChild(DOMUtils.createElement("http-method"));
+ method.appendChild(DOMUtils.createTextNode("POST"));
+
+ // Optional auth-constraint
+ if (sepMetaData.getAuthMethod() != null)
+ {
+ // Only the first auth-method gives the war login-config/auth-method
+ if (authMethod == null)
+ authMethod = sepMetaData.getAuthMethod();
+
+ Element authConstraint =
(Element)securityConstraint.appendChild(DOMUtils.createElement("auth-constraint"));
+ Element roleName =
(Element)authConstraint.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode("*"));
+ }
+ // Optional user-data-constraint
+ if (sepMetaData.getTransportGuarantee() != null)
+ {
+ Element userData =
(Element)securityConstraint.appendChild(DOMUtils.createElement("user-data-constraint"));
+ Element transport =
(Element)userData.appendChild(DOMUtils.createElement("transport-guarantee"));
+
transport.appendChild(DOMUtils.createTextNode(sepMetaData.getTransportGuarantee()));
+ }
+ }
+ }
+
+ // Optional login-config/auth-method
+ if (authMethod != null)
+ {
+ Element loginConfig =
(Element)webApp.appendChild(DOMUtils.createElement("login-config"));
+ Element method =
(Element)loginConfig.appendChild(DOMUtils.createElement("auth-method"));
+ method.appendChild(DOMUtils.createTextNode(authMethod));
+ Element realm =
(Element)loginConfig.appendChild(DOMUtils.createElement("realm-name"));
+ realm.appendChild(DOMUtils.createTextNode("EJBServiceEndpointServlet
Realm"));
+
+ addEJBSecurityRoles(di, webApp);
+ }
+
+ return webApp;
+ }
+
+ private Element createJBossWebAppDescriptor(DeploymentInfo di,
List<EndpointMetaData> epMetaDataList)
+ {
+ /* Create a jboss-web
+ <jboss-web>
+ <security-domain>java:/jaas/cts</security-domain>
+ <context-root>/ws/ejbN/</context-root>
+ </jboss-web>
+ */
+ Element jbossWeb = DOMUtils.createElement("jboss-web");
+
+ UnifiedMetaData wsMetaData =
epMetaDataList.get(0).getServiceMetaData().getUnifiedMetaData();
+ String securityDomain = wsMetaData.getSecurityDomain();
+ if (securityDomain != null)
+ {
+ Element secDomain =
(Element)jbossWeb.appendChild(DOMUtils.createElement("security-domain"));
+ secDomain.appendChild(DOMUtils.createTextNode("java:/jaas/" +
securityDomain));
+ }
+
+ // Get the context root for this deployment
+ String contextRoot = null;
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String next = sepMetaData.getContextRoot();
+ if (next != null)
+ {
+ if (contextRoot == null)
+ {
+ contextRoot = next;
+ }
+ else if (contextRoot.equals(next) == false)
+ {
+ throw new WSException("Multiple context root not supported");
+ }
+ }
+ }
+ if (contextRoot == null)
+ throw new WSException("Cannot obtain context root");
+
+ Element root =
(Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
+ root.appendChild(DOMUtils.createTextNode(contextRoot));
+
+ String[] virtualHosts = null;
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String[] next = sepMetaData.getVirtualHosts();
+ if (next != null && next.length > 0)
+ {
+ Arrays.sort(next);
+ if (virtualHosts == null)
+ {
+ virtualHosts = next;
+ }
+ else
+ {
+ if (Arrays.equals(virtualHosts, next) == false)
+ {
+ throw new WSException("All endpoints must define the same virtual
hosts");
+ }
+ }
+ }
+ }
+
+ if (virtualHosts != null)
+ {
+ for (String current : virtualHosts)
+ {
+ Element virtualHost =
(Element)jbossWeb.appendChild(DOMUtils.createElement("virtual-host"));
+ virtualHost.appendChild(DOMUtils.createTextNode(current));
+ }
+ }
+
+ return jbossWeb;
+ }
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected abstract void addEJBSecurityRoles(DeploymentInfo di, Element webApp);
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB21.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB21.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB21.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+//$Id$
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.AssemblyDescriptorMetaData;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a service endpoint deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class ServiceEndpointGeneratorEJB21 extends ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB21.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected void addEJBSecurityRoles(DeploymentInfo di, Element webApp)
+ {
+ // Fix:
http://jira.jboss.org/jira/browse/JBWS-309
+ ApplicationMetaData applMetaData = (ApplicationMetaData)di.metaData;
+ AssemblyDescriptorMetaData assemblyDescriptor =
applMetaData.getAssemblyDescriptor();
+ if (assemblyDescriptor != null)
+ {
+ Map securityRoles = assemblyDescriptor.getSecurityRoles();
+ if (securityRoles != null)
+ {
+ Iterator it = securityRoles.keySet().iterator();
+ while (it.hasNext())
+ {
+ Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
+ Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode((String)it.next()));
+ }
+ }
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointGeneratorEJB3.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+//$Id$
+
+import javax.annotation.security.RolesAllowed;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.ejb3.Ejb3ModuleMBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.WSException;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a service endpoint deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class ServiceEndpointGeneratorEJB3 extends ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB3.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected void addEJBSecurityRoles(DeploymentInfo di, Element webApp)
+ {
+ // The container objects below provide access to all of the ejb metadata
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
+ for (Object manager : ejb3Module.getContainers().values())
+ {
+ if (manager instanceof StatelessContainer)
+ {
+ StatelessContainer container = (StatelessContainer)manager;
+
+ RolesAllowed anRolesAllowed =
(RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
+ if (anRolesAllowed != null)
+ {
+ for (String role : anRolesAllowed.value())
+ {
+ Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
+ Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode(role));
+ }
+ }
+ }
+ }
+ }
+
+ private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
+ {
+ Ejb3ModuleMBean ejb3Module;
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
+ if (ejb3Module == null)
+ throw new WSException("Cannot obtain EJB3 module: " + objectName);
+
+ return ejb3Module;
+ }
+ catch (MBeanProxyCreationException ex)
+ {
+ throw new WSException("Cannot obtain proxy to EJB3 module");
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInterceptor.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInterceptor.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInterceptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id: ServiceEndpointInterceptor.java 906 2006-09-06 18:57:40Z thomas.diesler(a)jboss.com
$
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ejb.plugins.AbstractInterceptor;
+import org.jboss.invocation.Invocation;
+import org.jboss.invocation.InvocationKey;
+import org.jboss.logging.Logger;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.common.CommonBinding;
+import org.jboss.ws.common.CommonBindingProvider;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.SOAPFaultExceptionHelper;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+
+/**
+ * This Interceptor does the ws4ee handler processing.
+ *
+ * According to the ws4ee spec the handler logic must be invoked after the container
+ * applied method level security to the invocation.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Sep-2005
+ */
+public class ServiceEndpointInterceptor extends AbstractInterceptor
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(ServiceEndpointInterceptor.class);
+
+ // Interceptor implementation --------------------------------------
+
+ /** Before and after we call the service endpoint bean, we process the handler
chains.
+ */
+ public Object invoke(final Invocation mi) throws Exception
+ {
+ // If no msgContext, it's not for us
+ CommonMessageContext msgContext =
(CommonMessageContext)mi.getPayloadValue(InvocationKey.SOAP_MESSAGE_CONTEXT);
+ if (msgContext == null)
+ {
+ return getNext().invoke(mi);
+ }
+
+ // Get the endpoint invocation
+ EndpointInvocation epInv =
(EndpointInvocation)mi.getValue(EndpointInvocation.class.getName());
+ OperationMetaData opMetaData = epInv.getOperationMetaData();
+
+ // Get the handler callback
+ String key = ServiceEndpointInvokerEJB21.HandlerCallback.class.getName();
+ ServiceEndpointInvokerEJB21.HandlerCallback callback =
(ServiceEndpointInvokerEJB21.HandlerCallback)mi.getValue(key);
+
+ // Handlers need to be Tx. Therefore we must invoke the handler chain after the
TransactionInterceptor.
+ if (callback != null && epInv != null)
+ {
+ try
+ {
+ // call the request handlers
+ boolean handlersPass =
callback.callRequestHandlerChain(HandlerType.ENDPOINT);
+ handlersPass = handlersPass &&
callback.callRequestHandlerChain(HandlerType.POST);
+
+ // Call the next interceptor in the chain
+ if (handlersPass)
+ {
+ // The SOAPContentElements stored in the EndpointInvocation might have
changed after
+ // handler processing. Get the updated request payload. This should be a
noop if request
+ // handlers did not modify the incomming SOAP message.
+ Object[] reqParams = epInv.getRequestPayload();
+ mi.setArguments(reqParams);
+ Object resObj = getNext().invoke(mi);
+ epInv.setReturnValue(resObj);
+
+ // Bind the response message
+ CommonBindingProvider bindingProvider = new
CommonBindingProvider(opMetaData.getEndpointMetaData());
+ CommonBinding binding =
(CommonBinding)bindingProvider.getCommonBinding();
+ SOAPMessage resMessage =
(SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
+ msgContext.setSOAPMessage(resMessage);
+ }
+
+ // call the response handlers
+ handlersPass = callback.callResponseHandlerChain(HandlerType.POST);
+ handlersPass = handlersPass &&
callback.callResponseHandlerChain(HandlerType.ENDPOINT);
+
+ // update the return value after response handler processing
+ Object resObj = epInv.getReturnValue();
+
+ return resObj;
+ }
+ catch (Exception ex)
+ {
+ try
+ {
+ SOAPMessage faultMessage =
SOAPFaultExceptionHelper.exceptionToFaultMessage(ex);
+ msgContext.setSOAPMessage(faultMessage);
+
+ // call the fault handlers
+ boolean handlersPass = callback.callFaultHandlerChain(HandlerType.POST,
ex);
+ handlersPass = handlersPass &&
callback.callFaultHandlerChain(HandlerType.ENDPOINT, ex);
+ }
+ catch (Exception subEx)
+ {
+ log.warn("Cannot process handlerChain.handleFault, ignoring: ",
subEx);
+ }
+ throw ex;
+ }
+ finally
+ {
+ // do nothing
+ }
+ }
+ else
+ {
+ log.warn("Handler callback not available");
+ return getNext().invoke(mi);
+ }
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB21.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,264 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id: ServiceEndpointInvokerEJB21.java 906 2006-09-06 18:57:40Z
thomas.diesler(a)jboss.com $
+
+import java.lang.reflect.Method;
+import java.security.Principal;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.ejb.EjbModule;
+import org.jboss.ejb.Interceptor;
+import org.jboss.ejb.StatelessSessionContainer;
+import org.jboss.invocation.Invocation;
+import org.jboss.invocation.InvocationKey;
+import org.jboss.invocation.InvocationType;
+import org.jboss.invocation.PayloadKey;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.security.SecurityAssociation;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
+import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.EndpointMetaData.Type;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+
+/**
+ * Handles invocations on EJB2.1 endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-Jan-2005
+ */
+public class ServiceEndpointInvokerEJB21 extends AbstractServiceEndpointInvoker
implements ServiceEndpointInvoker
+{
+ // provide logging
+ private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB21.class);
+
+ private String jndiName;
+ private MBeanServer server;
+ private ObjectName objectName;
+
+ public ServiceEndpointInvokerEJB21()
+ {
+ server = MBeanServerLocator.locateJBoss();
+ }
+
+ /** Initialize the service endpoint */
+ @Override
+ public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ super.initServiceEndpoint(seInfo);
+
+ ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
+ String ejbName = epMetaData.getLinkName();
+ if (ejbName == null)
+ throw new WSException("Cannot obtain ejb-link from port component");
+
+ UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)seInfo.getUnifiedDeploymentInfo().metaData;
+ UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
+ if (beanMetaData == null)
+ throw new WSException("Cannot obtain ejb meta data for: " + ejbName);
+
+ // verify the service endpoint
+ String seiName = epMetaData.getServiceEndpointInterfaceName();
+ if (epMetaData.getType() == Type.JAXRPC && seiName != null)
+ {
+ String bmdSEI = beanMetaData.getServiceEndpoint();
+ if (seiName.equals(bmdSEI) == false)
+ throw new WSException("Endpoint meta data defines SEI '" +
seiName + "', <service-endpoint> in ejb-jar.xml defines '" +
bmdSEI + "'");
+ }
+
+ // get the bean's JNDI name
+ jndiName = beanMetaData.getContainerObjectNameJndiName();
+ if (jndiName == null)
+ throw new WSException("Cannot obtain JNDI name for: " + ejbName);
+
+ objectName = ObjectNameFactory.create("jboss.j2ee:jndiName=" + jndiName +
",service=EJB");
+
+ // Dynamically add the service endpoint interceptor
+ //
http://jira.jboss.org/jira/browse/JBWS-758
+ try
+ {
+ EjbModule ejbModule = (EjbModule)server.getAttribute(objectName,
"EjbModule");
+ StatelessSessionContainer container =
(StatelessSessionContainer)ejbModule.getContainer(ejbName);
+
+ boolean injectionPointFound = false;
+ Interceptor prev = container.getInterceptor();
+ while (prev != null && prev.getNext() != null)
+ {
+ Interceptor next = prev.getNext();
+ if (next.getNext() == null)
+ {
+ log.debug("Inject service endpoint interceptor after: " +
prev.getClass().getName());
+ ServiceEndpointInterceptor sepInterceptor = new
ServiceEndpointInterceptor();
+ prev.setNext(sepInterceptor);
+ sepInterceptor.setNext(next);
+ injectionPointFound = true;
+ }
+ prev = next;
+ }
+ if (injectionPointFound == false)
+ log.warn("Cannot service endpoint interceptor injection point");
+ }
+ catch (Exception ex)
+ {
+ log.warn("Cannot add service endpoint interceptor", ex);
+ }
+ }
+
+ /** Load the SEI implementation bean if necessary
+ */
+ public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ if (server.isRegistered(objectName) == false)
+ throw new WSException("Cannot find service endpoint target: " +
objectName);
+
+ return null;
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
+ {
+ return null;
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+
+ // these are provided by the ServerLoginHandler
+ Principal principal = SecurityAssociation.getPrincipal();
+ Object credential = SecurityAssociation.getCredential();
+
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+
+ // invoke on the container
+ try
+ {
+ // setup the invocation
+ Method method = epInv.getJavaMethod();
+ Object[] args = epInv.getRequestPayload();
+ Invocation inv = new Invocation(null, method, args, null, principal,
credential);
+
+ inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
+ inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getSOAPMessage());
+ inv.setType(InvocationType.SERVICE_ENDPOINT);
+
+ // Set the handler callback and endpoint invocation
+ inv.setValue(HandlerCallback.class.getName(), new HandlerCallback(seInfo),
PayloadKey.TRANSIENT);
+ inv.setValue(EndpointInvocation.class.getName(), epInv, PayloadKey.TRANSIENT);
+
+ String[] sig = { Invocation.class.getName() };
+ Object retObj = server.invoke(objectName, "invoke", new Object[] { inv
}, sig);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
+ {
+ // do nothing
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ else
+ return true;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ else
+ return true;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type,
Exception ex)
+ {
+ if (type == HandlerType.PRE)
+ return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ else
+ return true;
+ }
+
+ // The ServiceEndpointInterceptor calls the methods in this callback
+ public class HandlerCallback
+ {
+ private ServiceEndpointInfo seInfo;
+
+ public HandlerCallback(ServiceEndpointInfo seInfo)
+ {
+ this.seInfo = seInfo;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callRequestHandlerChain(HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return true;
+ else
+ return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callResponseHandlerChain(HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return true;
+ else
+ return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor
*/
+ public boolean callFaultHandlerChain(HandlerType type, Exception ex)
+ {
+ if (type == HandlerType.PRE)
+ return true;
+ else
+ return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ }
+
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerEJB3.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,145 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+// $Id: ServiceEndpointInvokerEJB3.java 902 2006-09-05 20:10:19Z thomas.diesler(a)jboss.com
$
+
+import java.lang.reflect.Method;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.aop.Dispatcher;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.WSException;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
+import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+
+/**
+ * Handles invocations on EJB3 endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 23-Jul-2005
+ */
+public class ServiceEndpointInvokerEJB3 extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
+{
+ // provide logging
+ private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB3.class);
+
+ private MBeanServer server;
+ private ObjectName objectName;
+
+ public ServiceEndpointInvokerEJB3()
+ {
+ server = MBeanServerLocator.locateJBoss();
+ }
+
+ /** Initialize the service endpoint */
+ @Override
+ public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ super.initServiceEndpoint(seInfo);
+
+ String ejbName = seInfo.getServerEndpointMetaData().getLinkName();
+ UnifiedDeploymentInfo udi = seInfo.getUnifiedDeploymentInfo();
+ String nameStr = "jboss.j2ee:name=" + ejbName +
",service=EJB3,jar=" + udi.shortName;
+ if (udi.parent != null)
+ {
+ nameStr += ",ear=" + udi.parent.shortName;
+ }
+
+ objectName = ObjectNameFactory.create(nameStr.toString());
+ }
+
+ /** Load the SEI implementation bean if necessary
+ */
+ public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ if (server.isRegistered(objectName) == false)
+ throw new WSException("Cannot find service endpoint target: " +
objectName);
+
+ return null;
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass)
+ {
+ return null;
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+
+ /* [FIXME] how to do this for EJB3
+
+ // these are provided by the ServerLoginHandler
+ Principal principal = SecurityAssociation.getPrincipal();
+ Object credential = SecurityAssociation.getCredential();
+
+ CommonMessageContext msgContext = MessageContextAssociation.getMessageContext();
+
+ Invocation inv = new Invocation(null, method, args, null, principal, credential);
+ inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
+ inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getMessage());
+ inv.setType(InvocationType.SERVICE_ENDPOINT);
+ */
+
+ // invoke on the container
+ try
+ {
+ // setup the invocation
+ Method seiMethod = epInv.getJavaMethod();
+ Object[] args = epInv.getRequestPayload();
+
+ Dispatcher dispatcher = Dispatcher.singleton;
+ String canonicalName = objectName.getCanonicalName();
+ StatelessContainer container =
(StatelessContainer)dispatcher.getRegistered(canonicalName);
+ if (container == null)
+ throw new WSException("Cannot obtain container from Dispatcher: " +
canonicalName);
+
+ Class implClass = container.getBeanClass();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object retObj = container.localInvoke(implMethod, args);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Throwable e)
+ {
+ handleInvocationException(e);
+ }
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
+ {
+ // do nothing
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceEndpointInvokerMDB.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id: ServiceEndpointInvokerMDB.java 694 2006-08-04 16:27:13Z thomas.diesler(a)jboss.com
$
+
+import java.lang.reflect.Method;
+
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.binding.EndpointInvocation;
+import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
+import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.utils.ThreadLocalAssociation;
+
+/**
+ * Handles invocations on MDB endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2006
+ */
+public class ServiceEndpointInvokerMDB extends AbstractServiceEndpointInvoker implements
ServiceEndpointInvoker
+{
+ // provide logging
+ private Logger log = Logger.getLogger(ServiceEndpointInvokerMDB.class);
+
+ /** Load the SEI implementation bean if necessary
+ */
+ public Class loadServiceEndpoint(ServiceEndpointInfo seInfo) throws
ClassNotFoundException
+ {
+ return null;
+ }
+
+ // The dispatcher sets the target bean object
+ public void setTargetBeanObject(Object targetMDB)
+ {
+ ThreadLocalAssociation.localInvokerMDBAssoc().set(targetMDB);
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary
+ */
+ public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object
endpointContext, Class seiImplClass) throws InstantiationException,
IllegalAccessException
+ {
+ return ThreadLocalAssociation.localInvokerMDBAssoc().get();
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl,
EndpointInvocation epInv) throws SOAPFaultException
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+ try
+ {
+ Class implClass = seiImpl.getClass();
+ Method seiMethod = epInv.getJavaMethod();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object[] args = epInv.getRequestPayload();
+ Object retObj = implMethod.invoke(seiImpl, args);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ finally
+ {
+ // cleanup thread local
+ setTargetBeanObject(null);
+ }
+ }
+
+ /** Destroy an instance of the SEI implementation bean if necessary */
+ public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
+ {
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/ServiceRefMetaDataAdaptor.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id: ServiceRefMetaDataAdaptor.java 906 2006-09-06 18:57:40Z thomas.diesler(a)jboss.com
$
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.webservice.metadata.serviceref.HandlerMetaData;
+import org.jboss.webservice.metadata.serviceref.InitParamMetaData;
+import org.jboss.webservice.metadata.serviceref.PortComponentRefMetaData;
+import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+
+/**
+ * Build container independent service ref meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class ServiceRefMetaDataAdaptor
+{
+ public static UnifiedServiceRefMetaData
buildUnifiedServiceRefMetaData(ServiceRefMetaData srmd)
+ {
+ UnifiedServiceRefMetaData usrmd = new UnifiedServiceRefMetaData();
+ usrmd.setServiceRefName(srmd.getServiceRefName());
+ usrmd.setServiceInterface(srmd.getServiceInterface());
+ usrmd.setWsdlFile(srmd.getWsdlFile());
+ usrmd.setJaxrpcMappingFile(srmd.getJaxrpcMappingFile());
+ usrmd.setServiceQName(srmd.getServiceQName());
+
+ LinkedHashMap<String, UnifiedPortComponentRefMetaData> pcrefs = new
LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
+ for (PortComponentRefMetaData pcmd : srmd.getPortComponentRefs())
+ {
+ UnifiedPortComponentRefMetaData upcmd = new UnifiedPortComponentRefMetaData();
+ upcmd.setServiceEndpointInterface(pcmd.getServiceEndpointInterface());
+ upcmd.setPortComponentLink(pcmd.getPortComponentLink());
+ upcmd.setCallProperties(pcmd.getCallProperties());
+ pcrefs.put(pcmd.getServiceEndpointInterface(), upcmd);
+ }
+ usrmd.setPortComponentRefs(pcrefs);
+
+ ArrayList<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
+ for (HandlerMetaData hmd : srmd.getHandlers())
+ {
+ UnifiedHandlerMetaData uhmd = new UnifiedHandlerMetaData(null);
+ uhmd.setHandlerName(hmd.getHandlerName());
+ uhmd.setHandlerClass(hmd.getHandlerClass());
+
+ for(String portname : hmd.getPortNames())
+ {
+ uhmd.addPortName(portname);
+ }
+ for (InitParamMetaData ipmd : hmd.getInitParams())
+ {
+ HandlerInitParam ip = new HandlerInitParam();
+ ip.setParamName(ipmd.getParamName());
+ ip.setParamValue(ipmd.getParamValue());
+ uhmd.addInitParam(ip);
+ }
+ for (QName soapHeader : hmd.getSoapHeaders())
+ {
+ uhmd.addSoapHeader(soapHeader);
+ }
+ for (String soapRole : hmd.getSoapRoles())
+ {
+ uhmd.addSoapRole(soapRole);
+ }
+ handlers.add(uhmd);
+ }
+ usrmd.setHandlers(handlers);
+
+ usrmd.setConfigName(srmd.getConfigName());
+ usrmd.setConfigFile(srmd.getConfigFile());
+ usrmd.setWsdlOverride(srmd.getWsdlOverride());
+ usrmd.setCallProperties(srmd.getCallProperties());
+ usrmd.setResourceCL(srmd.getResourceCL());
+
+ return usrmd;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebMetaDataAdaptor.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id: WebMetaDataAdaptor.java 354 2006-05-16 13:46:47Z thomas.diesler(a)jboss.com $
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.metadata.WebMetaData;
+import org.jboss.metadata.WebSecurityMetaData;
+import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
+import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+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;
+
+/**
+ * Build container independent web meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class WebMetaDataAdaptor
+{
+ public static UnifiedWebMetaData buildUnifiedWebMetaData(WebMetaData wmd)
+ {
+ UnifiedWebMetaData umd = new UnifiedWebMetaData();
+ umd.setContextRoot(wmd.getContextRoot());
+ umd.setServletMappings(wmd.getServletMappings());
+ umd.setServletClassMap(wmd.getServletClassMap());
+ umd.setConfigName(wmd.getConfigName());
+ umd.setConfigFile(wmd.getConfigFile());
+ umd.setContextLoader(wmd.getContextLoader());
+ umd.setSecurityDomain(wmd.getSecurityDomain());
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(wmd));
+ umd.setSecurityMetaData(getSecurityMetaData(wmd.getSecurityContraints()));
+
+ return umd;
+ }
+
+ private static PublishLocationAdapter getPublishLocationAdpater(final WebMetaData
wmd)
+ {
+ return new PublishLocationAdapter ()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ return wmd.getWsdlPublishLocationByName(name);
+ }
+ };
+ }
+
+ private static List<UnifiedWebSecurityMetaData> getSecurityMetaData(final
Iterator securityConstraints)
+ {
+ ArrayList<UnifiedWebSecurityMetaData> unifiedsecurityMetaData = new
ArrayList<UnifiedWebSecurityMetaData>();
+
+ while (securityConstraints.hasNext())
+ {
+ WebSecurityMetaData securityMetaData =
(WebSecurityMetaData)securityConstraints.next();
+
+ UnifiedWebSecurityMetaData current = new UnifiedWebSecurityMetaData();
+ unifiedsecurityMetaData.add(current);
+
+ current.setTransportGuarantee(securityMetaData.getTransportGuarantee());
+
+ HashMap resources = securityMetaData.getWebResources();
+ for (Object webResourceObj : resources.values())
+ {
+ WebResourceCollection webResource = (WebResourceCollection)webResourceObj;
+ UnifiedWebResourceCollection currentResource =
current.addWebResource(webResource.getName());
+ for (String currentPattern : webResource.getUrlPatterns())
+ {
+ currentResource.addPattern(currentPattern);
+ }
+ }
+
+ }
+
+ return unifiedsecurityMetaData;
+ }
+
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployer.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.integration.jboss42;
+
+// $Id: WebServiceClientDeployer.java 522 2006-06-30 06:54:49Z thomas.diesler(a)jboss.com
$
+
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.naming.Context;
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.xml.rpc.JAXRPCException;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.naming.Util;
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxrpc.ServiceReferenceable;
+import org.jboss.ws.deployment.JSR109ClientDeployment;
+import org.jboss.ws.deployment.UnifiedDeploymentInfo;
+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
+ * deployment descriptor.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public class WebServiceClientDeployer extends ServiceMBeanSupport implements
WebServiceClientDeployerMBean
+{
+ /**
+ * This binds a jaxrpc Service into the callers ENC for every service-ref element
+ *
+ * @param envCtx ENC to bind the javax.rpc.xml.Service object to
+ * @param serviceRefs An iterator of the service-ref elements in the client deployment
descriptor
+ * @param di The client's deployment info
+ * @throws org.jboss.deployment.DeploymentException if it goes wrong
+ */
+ public void setupServiceRefEnvironment(Context envCtx, Iterator serviceRefs,
DeploymentInfo di) throws DeploymentException
+ {
+ try
+ {
+ while (serviceRefs.hasNext())
+ {
+ ServiceRefMetaData serviceRef = (ServiceRefMetaData)serviceRefs.next();
+ String serviceRefName = serviceRef.getServiceRefName();
+
+ UnifiedServiceRefMetaData wsServiceRef =
ServiceRefMetaDataAdaptor.buildUnifiedServiceRefMetaData(serviceRef);
+
+ JavaWsdlMapping javaWsdlMapping = getJavaWsdlMapping(wsServiceRef);
+ wsServiceRef.setJavaWsdlMapping(javaWsdlMapping);
+
+ Definition wsdlDefinition = getWsdlDefinition(wsServiceRef);
+ wsServiceRef.setWsdlDefinition(wsdlDefinition);
+
+ // build the container independent deployment info
+ UnifiedDeploymentInfo udi = new
JSR109ClientDeployment(UnifiedDeploymentInfo.DeploymentType.JSR109_Client);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+
+ ServiceReferenceable ref = new ServiceReferenceable(wsServiceRef, udi);
+ Util.bind(envCtx, serviceRefName, ref);
+
+ log.debug("Webservice binding: java:comp/env/" + serviceRefName);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Cannot bind webservice to client
environment", e);
+ }
+ }
+
+ private JavaWsdlMapping getJavaWsdlMapping(UnifiedServiceRefMetaData serviceRef)
+ {
+ JavaWsdlMapping javaWsdlMapping = null;
+ URL mappingURL = serviceRef.getJavaWsdlMappingURL();
+ if (mappingURL != null)
+ {
+ try
+ {
+ // setup the XML binding Unmarshaller
+ JavaWsdlMappingFactory mappingFactory =
JavaWsdlMappingFactory.newInstance();
+ javaWsdlMapping = mappingFactory.parse(mappingURL);
+ }
+ catch (Exception e)
+ {
+ throw new JAXRPCException("Cannot unmarshal jaxrpc-mapping-file: "
+ mappingURL, e);
+ }
+ }
+ return javaWsdlMapping;
+ }
+
+ private Definition getWsdlDefinition(UnifiedServiceRefMetaData serviceRef)
+ {
+ Definition wsdlDefinition = null;
+ {
+ URL wsdlOverride = serviceRef.getWsdlOverride();
+ URL wsdlURL = serviceRef.getWsdlURL();
+ if (wsdlOverride == null && wsdlURL != null)
+ {
+ try
+ {
+ WSDL11DefinitionFactory factory = WSDL11DefinitionFactory.newInstance();
+ wsdlDefinition = factory.parse(wsdlURL);
+ }
+ catch (WSDLException e)
+ {
+ throw new WSException("Cannot unmarshall wsdl, cause: " +
e.toString());
+ }
+ }
+ }
+ return wsdlDefinition;
+ }
+}
Copied:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java)
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/WebServiceClientDeployerMBean.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.system.ServiceMBean;
+import org.jboss.webservice.WebServiceClientDeployment;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface WebServiceClientDeployerMBean extends WebServiceClientDeployment,
ServiceMBean
+{
+ // default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceClientDeployer");
+}
Copied: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms
(from rev 1586,
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/jms)
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/jms/JMSMessageDispatcher.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.integration.jboss.jms;
+package org.jboss.ws.integration.jboss42.jms;
// $Id:JMSMessageDispatcher.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
@@ -36,14 +36,14 @@
import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.integration.jboss.ServiceEndpointInvokerMDB;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.integration.jboss42.ServiceEndpointInvokerMDB;
import org.jboss.ws.metadata.ServerEndpointMetaData;
-import org.jboss.ws.server.ServiceEndpoint;
-import org.jboss.ws.server.ServiceEndpointInvoker;
-import org.jboss.ws.server.ServiceEndpointManager;
-import org.jboss.ws.server.ServiceEndpointManagerFactory;
-import org.jboss.ws.soap.MessageContextAssociation;
/**
* A dispatcher for SOAPMessages
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcherMBean.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/jms/JMSMessageDispatcherMBean.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcherMBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.integration.jboss.jms;
+package org.jboss.ws.integration.jboss42.jms;
// $Id:JMSMessageDispatcher.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSTransportSupport.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/jms/JMSTransportSupport.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSTransportSupport.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.integration.jboss.jms;
+package org.jboss.ws.integration.jboss42.jms;
// $Id:JMSTransportSupport.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss/jms/MessageDispatcher.java 2006-12-07
00:31:03 UTC (rev 1586)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.ws.integration.jboss.jms;
+package org.jboss.ws.integration.jboss42.jms;
// $Id:MessageDispatcher.java 898 2006-09-05 08:23:03Z thomas.diesler(a)jboss.com $
@@ -29,7 +29,7 @@
import javax.management.ObjectName;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.utils.ObjectNameFactory;
+import org.jboss.ws.core.utils.ObjectNameFactory;
/**
* A dispatcher for SOAPMessages
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -36,8 +36,8 @@
import javax.servlet.ServletContext;
-import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
import org.jboss.ws.deployment.ServiceEndpointPublisher;
import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,7 +28,7 @@
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer;
import org.jboss.logging.Logger;
-import org.jboss.ws.server.KernelLocator;
+import org.jboss.ws.core.server.KernelLocator;
/**
* Bootstrap the microkernel in Tomcat
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,7 +26,7 @@
import java.io.File;
import java.io.IOException;
-import org.jboss.ws.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfig;
/**
* Tomcat specific implementation of a ServerConfig
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -38,8 +38,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.common.CommonContextServlet;
-import org.jboss.ws.server.ServiceEndpointManager;
-import org.jboss.ws.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
/**
* The servlet that that is associated with context /jbossws
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -35,14 +35,14 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.JBossWSEntityResolver;
import org.jboss.ws.deployment.ServiceEndpointPublisher;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
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.utils.DOMUtils;
-import org.jboss.ws.utils.JBossWSEntityResolver;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -38,12 +38,12 @@
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.KernelLocator;
+import org.jboss.ws.core.server.StandardEndpointServlet;
import org.jboss.ws.deployment.JSR109Deployment;
import org.jboss.ws.deployment.JSR181Deployment;
import org.jboss.ws.deployment.ServiceEndpointDeployer;
import org.jboss.ws.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.server.KernelLocator;
-import org.jboss.ws.server.StandardEndpointServlet;
/**
* A servlet that is installed for every web service endpoint.
Deleted: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,660 +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;
-
-// $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.soap.SOAPException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.binding.UnboundHeader;
-import org.jboss.ws.common.CommonClient;
-import org.jboss.ws.jaxrpc.handler.HandlerChainBaseImpl;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
-import org.jboss.ws.jbossxb.JBossXBSerializerFactory;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.TypesMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.utils.JavaUtils;
-import org.jboss.ws.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;
- }
-
- @Override
- protected Map<String, Object> getResponseContext()
- {
- 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());
- opMetaData.addParameter(paramMetaData);
- paramMetaData.setMode(mode);
- paramMetaData.setInHeader(inHeader);
-
- 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 rex)
- {
- throw new JAXRPCException("Cannot invokeOneWay", rex.getCause());
- }
- }
-
- /** 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 oneway) 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);
- try
- {
- Object retObj = super.invoke(opName, inputParams, unboundHeaders, oneway);
- return retObj;
- }
- 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());
- }
- }
- }
-}
Deleted: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,207 +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;
-
-// $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.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.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.isOneWayOperation())
- {
- 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.getPrimitiveValue(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;
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/EncodedTypeMapping.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/EncodedTypeMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/EncodedTypeMapping.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,182 +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;
-
-// $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.Constants;
-import org.jboss.ws.jaxrpc.encoding.Base64DeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.Base64SerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.CalendarDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.CalendarSerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.DateDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.DateSerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.ElementDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.ElementSerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.HexDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.HexSerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.QNameDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.QNameSerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SOAPElementDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SOAPElementSerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SimpleDeserializerFactory;
-import org.jboss.ws.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();
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/HandlerRegistryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,120 +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;
-
-// $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.jaxrpc.handler.ClientHandlerChain;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaDataJAXRPC;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-
-/**
- * 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);
- }
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/LiteralTypeMapping.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/LiteralTypeMapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/LiteralTypeMapping.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,114 +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;
-
-// $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.Constants;
-import org.jboss.ws.jaxrpc.encoding.*;
-import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
-import org.jboss.ws.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();
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,539 +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;
-
-// $Id$
-
-import java.beans.IntrospectionException;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-import java.util.List;
-
-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.WSException;
-import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
-import org.jboss.ws.jbossxb.JBossXBSerializerFactory;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.TypeMappingMetaData;
-import org.jboss.ws.metadata.TypesMetaData;
-import org.jboss.ws.utils.JavaUtils;
-
-/** 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);
-
- 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());
- }
-
- public static boolean matchRequestParameters(OperationMetaData opMetaData, Class[]
paramTypes)
- {
- assertOperationMetaData(opMetaData);
-
- // [JBWS-1125] Support empty soap body elements
- if (opMetaData.getParameters().size() == 0)
- {
- log.debug("Detected document/literal/wrapped with no parameter
part");
- return true;
- }
-
- ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
- List<String> varNames = paramMetaData.getWrappedVariables();
- Class reqStructType = paramMetaData.getJavaType();
-
- log.debug("matchRequestParameters: " + reqStructType.getName());
- try
- {
- boolean pass = true;
- for (int i = 0; pass && i < varNames.size(); i++)
- {
- String varName = varNames.get(i);
- Method method = null;
- try
- {
- PropertyDescriptor pd = new PropertyDescriptor(varName, reqStructType);
- method = pd.getWriteMethod();
- }
- catch (IntrospectionException ex)
- {
- // jaxws-ri wsimport generates setter without the underscore
- if (varName.indexOf("_") > 0)
- {
- varName = varName.replace("_", "");
- PropertyDescriptor pd = new PropertyDescriptor(varName,
reqStructType);
- method = pd.getWriteMethod();
- }
- }
-
- if (method == null)
- throw new NoSuchMethodError("No write method for: " + varName);
-
- Class methodType = method.getParameterTypes()[0];
- Class paramType = paramTypes[i];
- pass = JavaUtils.isAssignableFrom(methodType, paramType);
- }
- return pass;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.debug("Invalid request wrapper: " + ex);
- return false;
- }
- }
-
- public static boolean matchResponseParameters(OperationMetaData opMetaData, Class
returnType)
- {
- assertOperationMetaData(opMetaData);
-
- // [JBWS-1125] Support empty soap body elements
- if (opMetaData.getReturnParameter() == null)
- {
- log.debug("Detected document/literal/wrapped with no return part");
- return true;
- }
-
- ParameterMetaData paramMetaData = opMetaData.getReturnParameter();
- Class resStructType = paramMetaData.getJavaType();
-
- log.debug("matchResponseParameters: " + resStructType.getName());
- try
- {
- boolean pass = (returnType == void.class);
- if (pass == false)
- {
- // The return paramter is the wrapper bean
- // See: org.jboss.test.webservice.jbws718.JBWS718TestCase
- if (JavaUtils.isAssignableFrom(returnType, resStructType))
- pass = true;
- }
- if (pass == false)
- {
- try
- {
- resStructType.getConstructor(new Class[] { returnType });
- pass = true;
- }
- catch (NoSuchMethodException ex)
- {
- // jaxws-ri wsimport does not generate a ctor with return param type
- resStructType.getMethod("setResult", returnType);
- pass = true;
- }
- }
- return pass;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.debug("Invalid response wrapper: " + ex);
- return false;
- }
- }
-
- public static Object wrapRequestParameters(OperationMetaData opMetaData, Object[]
inParams)
- {
- assertOperationMetaData(opMetaData);
-
- // [JBWS-1125] Support empty soap body elements
- if (opMetaData.getParameters().size() == 0)
- {
- log.debug("Detected document/literal/wrapped with no parameter
part");
- return null;
- }
-
- ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
- List<String> varNames = paramMetaData.getWrappedVariables();
- Class reqStructType = paramMetaData.getJavaType();
-
- // Message types can be wrapped
- if (paramMetaData.isMessageType())
- {
- if (inParams == null || inParams.length == 0)
- return null;
-
- if (inParams.length > 1)
- throw new IllegalStateException("Wrapped message parameter cannot have
multiple parts");
-
- return inParams[0];
- }
-
- log.debug("wrapRequestParameters: " + reqStructType.getName());
- try
- {
- Object reqStruct = reqStructType.newInstance();
- for (int i = 0; i < varNames.size(); i++)
- {
- String varName = varNames.get(i);
- Method method = null;
- try
- {
- PropertyDescriptor pd = new PropertyDescriptor(varName, reqStructType);
- method = pd.getWriteMethod();
- }
- catch (IntrospectionException ex)
- {
- // jaxws-ri wsimport generates setter without the underscore
- if (varName.indexOf("_") > 0)
- {
- varName = varName.replace("_", "");
- PropertyDescriptor pd = new PropertyDescriptor(varName,
reqStructType);
- method = pd.getWriteMethod();
- }
- }
-
- if (method == null)
- throw new NoSuchMethodError("No write method for: " + varName);
-
- Object value = inParams[i];
- log.debug(" " + method.getName() + ": " + (value != null
? value.getClass().getName() : null));
- method.invoke(reqStruct, new Object[] { value });
- }
-
- return reqStruct;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSException("Cannot wrap request structure: " + e);
- }
- }
-
- public static Object[] unwrapRequestParameters(OperationMetaData opMetaData, Object
reqStruct)
- {
- assertOperationMetaData(opMetaData);
-
- if (reqStruct == null)
- throw new IllegalArgumentException("Request struct cannot be null");
-
- ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
- List<String> varNames = paramMetaData.getWrappedVariables();
- Class reqStructType = reqStruct.getClass();
-
- log.debug("unwrapRequestParameters: " + reqStructType.getName());
- Object[] inParams = new Object[varNames.size()];
- try
- {
- for (int i = 0; i < varNames.size(); i++)
- {
- String varName = varNames.get(i);
- Method method = null;
- try
- {
- PropertyDescriptor pd = new PropertyDescriptor(varName, reqStructType);
- method = pd.getReadMethod();
- }
- catch (IntrospectionException ex)
- {
- // jaxws-ri wsimport generates getter without the underscore
- if (varName.indexOf("_") > 0)
- {
- varName = varName.replace("_", "");
- PropertyDescriptor pd = new PropertyDescriptor(varName,
reqStructType);
- method = pd.getReadMethod();
- }
- }
-
- if (method == null)
- throw new NoSuchMethodError("No read method for: " + varName);
-
- Object value = method.invoke(reqStruct, new Object[] {});
- log.debug(" " + method.getName() + ": " + (value != null
? value.getClass().getName() : null));
- inParams[i] = value;
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Cannot unwrap request structure: "
+ e);
- }
-
- return inParams;
- }
-
- public static Object wrapResponseParameter(OperationMetaData opMetaData, Object
outParam)
- {
- assertOperationMetaData(opMetaData);
-
- // [JBWS-1125] Support empty soap body elements
- if (opMetaData.getReturnParameter() == null)
- {
- log.debug("Detected document/literal/wrapped with no return part");
- return null;
- }
-
- ParameterMetaData paramMetaData = opMetaData.getReturnParameter();
- List<String> varNames = paramMetaData.getWrappedVariables();
- Class resStructType = paramMetaData.getJavaType();
-
- // Message types can be wrapped
- if (paramMetaData.isMessageType())
- return outParam;
-
- if (outParam != null && outParam.getClass() == resStructType)
- {
- log.debug("Response parameter already wrapped" +
resStructType.getName());
- return outParam;
- }
-
- log.debug("wrapResponseParameter: " + resStructType.getName());
- try
- {
- Object resStruct = resStructType.newInstance();
- if (varNames.size() > 0)
- {
- String varName = varNames.get(0);
- Method method = null;
- try
- {
- PropertyDescriptor pd = new PropertyDescriptor(varName, resStructType);
- method = pd.getWriteMethod();
- }
- catch (IntrospectionException ex)
- {
- // jaxws-ri wsimport generates setter without the underscore
- if (varName.indexOf("_") > 0)
- {
- varName = varName.replace("_", "");
- PropertyDescriptor pd = new PropertyDescriptor(varName,
resStructType);
- method = pd.getWriteMethod();
- }
- }
-
- if (method == null)
- throw new NoSuchMethodError("No write method for: " + varName);
-
- Object value = outParam;
- log.debug(" " + method.getName() + ": " + (value != null
? value.getClass().getName() : null));
- method.invoke(resStruct, new Object[] { value });
- }
- return resStruct;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSException("Cannot wrap response structure: " + e);
- }
- }
-
- public static Object unwrapResponseParameter(OperationMetaData opMetaData, Object
resStruct)
- {
- assertOperationMetaData(opMetaData);
-
- Object retValue = null;
- if (resStruct != null)
- {
- ParameterMetaData paramMetaData = opMetaData.getReturnParameter();
- List<String> varNames = paramMetaData.getWrappedVariables();
- Class resStructType = resStruct.getClass();
-
- log.debug("unwrapResponseParameter: " + resStructType.getName());
- try
- {
- if (varNames.size() > 0)
- {
- String varName = varNames.get(0);
- Method method = null;
- try
- {
- PropertyDescriptor pd = new PropertyDescriptor(varName,
resStructType);
- method = pd.getReadMethod();
- }
- catch (IntrospectionException ex)
- {
- // jaxws-ri wsimport generates getter without the underscore
- if (varName.indexOf("_") > 0)
- {
- varName = varName.replace("_", "");
- PropertyDescriptor pd = new PropertyDescriptor(varName,
resStructType);
- method = pd.getReadMethod();
- }
- }
-
- if (method == null)
- throw new NoSuchMethodError("No read method for: " +
varName);
-
- Object value = method.invoke(resStruct, new Object[] {});
- log.debug(" " + method.getName() + ": " + (value !=
null ? value.getClass().getName() : null));
- retValue = 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<String> wrappedTypes = pmd.getWrappedTypes();
- List<String> wrappedVariables = pmd.getWrappedVariables();
- 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 (wrappedTypes.size() == 0)
- throw new WSException("No wrapped types available");
-
- String serviceName = serviceMetaData.getQName().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 (int i = 0; i < wrappedTypes.size(); i++)
- {
- String typeName = wrappedTypes.get(i);
- String name = wrappedVariables.get(i);
-
- CtField field = new CtField(pool.get(typeName), name, clazz);
- field.setModifiers(Modifier.PRIVATE);
- clazz.addField(field);
-
- String capName = capitalize(name);
- clazz.addMethod(CtNewMethod.getter("get" + capName, field));
- clazz.addMethod(CtNewMethod.setter("set" + capName, field));
-
- if (pmd.getOperationMetaData().getReturnParameter() == pmd)
- {
- if (capName.equals("Result") == false)
- {
- clazz.addMethod(CtNewMethod.getter("getResult", field));
- clazz.addMethod(CtNewMethod.setter("setResult", 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);
- }
-
- private static String capitalize(String source)
- {
- if (source == null)
- return null;
-
- if (source.length() == 0)
- return source;
-
- char c = Character.toUpperCase(source.charAt(0));
-
- return c + source.substring(1);
- }
-}
\ No newline at end of file
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultExceptionHelper.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultExceptionHelper.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SOAPFaultExceptionHelper.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.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.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.binding.BindingException;
-import org.jboss.ws.binding.DeserializerSupport;
-import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.binding.SerializerSupport;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
-import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
-import org.jboss.ws.metadata.FaultMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.soap.SOAPEnvelopeImpl;
-import org.jboss.ws.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 SOAPFaultExceptionHelper
-{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPFaultExceptionHelper.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 SOAPFaultExceptionHelper()
- {
- }
-
- /** 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
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SchemaGenerator.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SchemaGenerator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SchemaGenerator.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.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.WSException;
-import org.jboss.ws.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
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/SerializationContextJAXRPC.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,127 +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;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.TypesMetaData;
-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.soap.MessageContextAssociation;
-import org.jboss.ws.utils.JavaUtils;
-
-/**
- * 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();
- }
-}
Deleted: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceExt.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceExt.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceExt.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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;
-
-//$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();
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,161 +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;
-
-// $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;
- }
-}
Deleted: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,409 +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;
-
-// $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.deployment.JSR109ClientMetaDataBuilder;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.UnifiedMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.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;
- JSR109ClientMetaDataBuilder builder = new JSR109ClientMetaDataBuilder();
-
- ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
- builder.setResourceLoader(new URLClassLoader(new URL[] {}, ctxClassLoader));
- builder.setClassLoader(ctxClassLoader);
-
- serviceMetaData = builder.buildMetaData(serviceName, wsdlURL, mappingURL,
securityURL, null);
- 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;
- JSR109ClientMetaDataBuilder builder = new JSR109ClientMetaDataBuilder();
-
- ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
- builder.setResourceLoader(new URLClassLoader(new URL[] {}, ctxClassLoader));
- builder.setClassLoader(ctxClassLoader);
-
- serviceMetaData = builder.buildMetaData(serviceName, wsdlURL, mappingURL,
securityConfig, serviceRefMetaData);
- 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.getQName();
- }
-
- /**
- * 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);
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.
- */
-// $Id$
-package org.jboss.ws.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.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.metadata.HandlerMetaDataJAXRPC;
-import org.jboss.ws.metadata.ServiceMetaData;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.server.ServiceEndpoint;
-import org.jboss.ws.server.ServiceEndpointManager;
-import org.jboss.ws.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);
- }
- }
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceProxy.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceProxy.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceProxy.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.
-*/
-// $Id$
-package org.jboss.ws.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
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceReferenceable.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceReferenceable.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceReferenceable.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,177 +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.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.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
-import org.jboss.ws.server.ServiceEndpointManager;
-import org.jboss.ws.server.ServiceEndpointManagerFactory;
-
-/**
- * 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.localUrl != null ? udi.localUrl : 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
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServletEndpointContextImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServletEndpointContextImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServletEndpointContextImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.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.server.EndpointContext;
-import org.jboss.ws.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
Deleted: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/StubExt.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/StubExt.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/StubExt.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,112 +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;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-
-import org.jboss.ws.metadata.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();
-}
Deleted: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Style.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Style.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Style.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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;
-
-// $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;
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,624 +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;
-
-// $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.Constants;
-import org.jboss.ws.jaxrpc.encoding.Base64DeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.Base64SerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.CalendarDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.CalendarSerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.DateDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.DateSerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.HexDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.HexSerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.QNameDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.QNameSerializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SimpleDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SimpleSerializerFactory;
-import org.jboss.ws.utils.JavaUtils;
-
-/**
- * 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;
- }
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingRegistryImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingRegistryImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/TypeMappingRegistryImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.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.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);
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedCallParameter.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedCallParameter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedCallParameter.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.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 +"]";
- }
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedFaultException.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedFaultException.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/UnqualifiedFaultException.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.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 +"]";
- }
-}
Deleted: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Use.java
===================================================================
--- branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Use.java 2006-12-07
07:57:14 UTC (rev 1598)
+++ branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/Use.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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;
-
-import org.jboss.ws.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;
- }
-}
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBDeserializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBDeserializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBDeserializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,7 +32,7 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.ComplexTypeDeserializer;
import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.jaxrpc.SerializationContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBDeserializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBDeserializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBDeserializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -23,7 +23,7 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.DeserializerSupport;
-import org.jboss.ws.jaxrpc.encoding.DeserializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.encoding.DeserializerFactoryBase;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBMarshallerImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBMarshallerImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBMarshallerImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,11 +26,11 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.extensions.xop.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.ws.utils.JavaUtils;
-import org.jboss.ws.xop.XOPMarshallerImpl;
import org.jboss.xb.binding.Constants;
import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSerializer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSerializer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSerializer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,7 +28,7 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.ComplexTypeSerializer;
import org.jboss.ws.binding.SerializationContext;
-import org.jboss.ws.jaxrpc.SerializationContextJAXRPC;
+import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.w3c.dom.NamedNodeMap;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSerializerFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSerializerFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSerializerFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -23,7 +23,7 @@
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.SerializerSupport;
-import org.jboss.ws.jaxrpc.encoding.SerializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.encoding.SerializerFactoryBase;
// $Id$
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -5,12 +5,12 @@
import javax.xml.namespace.QName;
import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ServiceMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.xb.binding.MarshallingContext;
import org.jboss.xb.binding.ObjectLocalMarshaller;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -24,7 +24,7 @@
// $Id$
import org.jboss.ws.WSException;
-import org.jboss.ws.xop.XOPUnmarshallerImpl;
+import org.jboss.ws.extensions.xop.XOPUnmarshallerImpl;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,9 +28,9 @@
import org.jboss.util.xml.JBossEntityResolver;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.JBossWSEntityResolver;
+import org.jboss.ws.extensions.xop.JBossXBContentAdapter;
import org.jboss.ws.metadata.jaxrpcmapping.*;
-import org.jboss.ws.utils.JBossWSEntityResolver;
-import org.jboss.ws.xop.JBossXBContentAdapter;
import org.jboss.xb.binding.metadata.ClassMetaData;
import org.jboss.xb.binding.metadata.PackageMetaData;
import org.jboss.xb.binding.metadata.PropertyMetaData;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/XercesXSMarshallerImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/XercesXSMarshallerImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/XercesXSMarshallerImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,10 +27,10 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.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.utils.JavaUtils;
import org.jboss.xb.binding.Constants;
import org.jboss.xb.binding.MappingObjectModelProvider;
import org.jboss.xb.binding.XercesXsMarshaller;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -39,8 +39,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.common.CommonSOAPBinding;
-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.jboss.ws.metadata.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.config.WSCommonConfig;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/FaultMetaData.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/FaultMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/FaultMetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,7 +27,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.utils.JavaUtils;
/**
* A Fault component describes a fault that a given operation supports.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/HandlerMetaData.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/HandlerMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/HandlerMetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -33,8 +33,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerInbound;
-import org.jboss.ws.wsse.jaxrpc.WSSecurityHandlerOutbound;
+import org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerInbound;
+import org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerOutbound;
/**
* The common metdata data for a handler element
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/OperationMetaData.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -33,13 +33,13 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+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.utils.HolderUtils;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.EndpointMetaData.Type;
-import org.jboss.ws.utils.HolderUtils;
-import org.jboss.ws.utils.JavaUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -35,8 +35,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.utils.JavaUtils;
/**
* A request/response parameter that a given operation supports.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -31,11 +31,11 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.ServiceEndpoint;
import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
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.server.ServiceEndpoint;
/**
* Client side endpoint meta data.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -37,11 +37,12 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.jaxrpc.Use;
-import org.jboss.ws.jaxrpc.encoding.SOAPArrayDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SOAPArraySerializerFactory;
+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.jaxrpc.encoding.SOAPArrayDeserializerFactory;
+import org.jboss.ws.core.jaxrpc.encoding.SOAPArraySerializerFactory;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.jbossxb.JBossXBDeserializerFactory;
import org.jboss.ws.jbossxb.JBossXBSerializerFactory;
import org.jboss.ws.jbossxb.SchemaBindingBuilder;
@@ -54,7 +55,6 @@
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.utils.JavaUtils;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/TypesMetaData.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/TypesMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/TypesMetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,7 +32,7 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/UnifiedMetaData.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/UnifiedMetaData.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/UnifiedMetaData.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -31,9 +31,9 @@
import java.util.StringTokenizer;
import org.jboss.logging.Logger;
+import org.jboss.ws.core.server.ServiceEndpointManager;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.server.ServiceEndpointManager;
/**
* The top level meta data.
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -29,9 +29,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.JBossWSEntityResolver;
import org.jboss.ws.metadata.config.jaxrpc.WSConfigFactoryJAXRPC;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.JBossWSEntityResolver;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -24,7 +24,7 @@
import javax.xml.namespace.QName;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11DefinitionFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11DefinitionFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11DefinitionFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -24,7 +24,7 @@
// $Id: WSDL11DefinitionFactory.java 906 2006-09-06 18:57:40Z thomas.diesler(a)jboss.com $
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.JBossWSEntityResolver;
+import org.jboss.ws.core.utils.JBossWSEntityResolver;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Reader.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Reader.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Reader.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -66,11 +66,11 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.JavaToXSD;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Writer.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Writer.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Writer.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,8 +32,8 @@
import javax.wsdl.factory.WSDLFactory;
import javax.xml.namespace.QName;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitionsFactory.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitionsFactory.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitionsFactory.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -36,9 +36,9 @@
import javax.xml.parsers.DocumentBuilder;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.JBossWSEntityResolver;
import org.jboss.ws.Constants;
-import org.jboss.ws.utils.JBossWSEntityResolver;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.EntityResolver;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -71,9 +71,9 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.utils.HolderUtils;
import org.jboss.xb.binding.Util;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLWriter.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLWriter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLWriter.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,9 +30,9 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -54,8 +54,8 @@
import org.apache.xerces.xs.XSTerm;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.xb.binding.NamespaceRegistry;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -47,8 +47,8 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.jboss.xb.binding.NamespaceRegistry;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -49,14 +49,14 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
import org.jboss.ws.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;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
/**
* Util class that deals with XML Schema
Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,14 +34,14 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.Configuration.OperationConfig;
import org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToXSD.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -35,6 +35,7 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.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;
@@ -45,7 +46,6 @@
import org.jboss.ws.tools.helpers.JavaToXSDHelper;
import org.jboss.ws.tools.interfaces.JavaToXSDIntf;
import org.jboss.ws.tools.interfaces.SchemaCreatorIntf;
-import org.jboss.ws.utils.JBossWSEntityResolver;
import org.jboss.xb.binding.sunday.unmarshalling.LSInputAdaptor;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/ToolsUtils.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/ToolsUtils.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/ToolsUtils.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -45,12 +45,12 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.encoding.SimpleDeserializerFactory;
-import org.jboss.ws.jaxrpc.encoding.SimpleSerializerFactory;
+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.utils.JavaUtils;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.ws.utils.JavaUtils;
/**
* Util class for the JBossWS Tools project
Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -43,7 +43,8 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
@@ -58,7 +59,6 @@
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
-import org.jboss.ws.utils.JavaUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -31,12 +31,12 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.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.tools.interfaces.WSDotXMLCreatorIntf;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/XSDToJava.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/XSDToJava.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/XSDToJava.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,7 +34,7 @@
import org.apache.xerces.xs.XSSimpleTypeDefinition;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.interfaces.XSDToJavaIntf;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -49,10 +49,10 @@
import org.apache.xerces.xs.XSWildcard;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.ws.utils.JavaUtils;
/** Class that converts a XSD Type into Java class
* @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -41,8 +41,9 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.common.CommonSOAPBinding;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.FaultMetaData;
import org.jboss.ws.metadata.OperationMetaData;
@@ -84,7 +85,6 @@
import org.jboss.ws.tools.JavaToXSD;
import org.jboss.ws.tools.interfaces.JavaToXSDIntf;
import org.jboss.ws.tools.interfaces.SchemaCreatorIntf;
-import org.jboss.ws.utils.JavaUtils;
/**
* Java To WSDL Helper which uses UnifiedMetaData
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -41,7 +41,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
@@ -73,7 +74,6 @@
import org.jboss.ws.tools.ToolsUtils;
import org.jboss.ws.tools.WSToolsConstants;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
-import org.jboss.ws.utils.JavaUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -38,8 +38,12 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.core.utils.IOUtils;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ParameterMetaData;
@@ -63,10 +67,6 @@
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.interfaces.WSDotXMLCreatorIntf;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.utils.IOUtils;
-import org.jboss.ws.utils.JavaUtils;
/**
* Helper class used by the command line tool "jbossws"
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/SchemaCreatorIntf.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,7 +26,7 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.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;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/WSDLToJavaIntf.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,7 +26,7 @@
import java.net.URL;
import java.util.Map;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLException;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/interfaces/XSDToJavaIntf.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,7 +32,7 @@
import org.apache.xerces.xs.XSSimpleTypeDefinition;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,15 +34,15 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.utils.HolderUtils;
+import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.FaultMetaData;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ParameterMetaData;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.ToolsUtils;
import org.jboss.ws.tools.Configuration.OperationConfig;
-import org.jboss.ws.utils.HolderUtils;
-import org.jboss.ws.utils.JavaUtils;
/**
* Builds the Tools Endpoint Meta Data using Java Reflection
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ToolsAnnotationMetaDataBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -36,7 +36,7 @@
import javax.xml.rpc.holders.Holder;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.metadata.FaultMetaData;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ParameterMetaData;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,7 +32,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.metadata.ServiceMetaData;
import org.jboss.ws.metadata.UnifiedMetaData;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
Modified:
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -53,8 +53,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
Modified: branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/JBossWSTest.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/JBossWSTest.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/JBossWSTest.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,7 +34,7 @@
import junit.framework.TestCase;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -42,13 +42,13 @@
import org.jboss.ws.common.CommonBindingProvider;
import org.jboss.ws.common.CommonMessageContext;
import org.jboss.ws.common.CommonSOAPBinding;
-import org.jboss.ws.jaxrpc.CallImpl;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
+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.utils.DOMUtils;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ParameterMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the SOAPBindingProvider
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -35,11 +35,11 @@
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
import org.jboss.ws.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/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,10 +28,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.jbossxb.JBossXBConstants;
import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,10 +28,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.jbossxb.JBossXBConstants;
import org.jboss.ws.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,10 +30,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.jbossxb.JBossXBConstants;
import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,10 +30,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.jbossxb.JBossXBConstants;
import org.jboss.ws.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,10 +27,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.jbossxb.JBossXBConstants;
import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,10 +27,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.jbossxb.JBossXBConstants;
import org.jboss.ws.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of array types
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,11 +30,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.jbossxb.JBossXBConstants;
import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of complex types
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,11 +30,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.jbossxb.JBossXBConstants;
import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of complex types
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,11 +27,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.jbossxb.JBossXBConstants;
import org.jboss.ws.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB marshalling of a SimpleUserType
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,11 +27,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.jbossxb.JBossXBConstants;
import org.jboss.ws.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
-import org.jboss.ws.utils.DOMUtils;
/**
* Test the JAXB unmarshalling of a SimpleUserType
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -31,8 +31,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -38,7 +38,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.soap.SOAPBodyElementRpc;
+import org.jboss.ws.core.soap.SOAPBodyElementRpc;
/** Test call on a SOAPConnection
*
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -33,8 +33,8 @@
import javax.xml.soap.Text;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.soap.SOAPContentElement;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.core.soap.SOAPContentElement;
/**
* Test the SOAPContentElement
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPEnvelopeTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPEnvelopeTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPEnvelopeTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,8 +32,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPFactoryTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPFactoryTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPFactoryTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -39,7 +39,7 @@
public void testSOAPFactoryCreation() throws Exception
{
SOAPFactory factory = SOAPFactory.newInstance();
- assertEquals(org.jboss.ws.soap.SOAPFactoryImpl.class, factory.getClass());
+ assertEquals(org.jboss.ws.core.soap.SOAPFactoryImpl.class, factory.getClass());
}
public void testCreateDetail() throws Exception
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPFaultTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -37,8 +37,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.jaxrpc.SOAPFaultExceptionHelper;
+import org.jboss.ws.core.utils.DOMUtils;
/**
* Test the SOAPFault
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,9 +32,9 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.core.utils.DOMUtils;
/**
* Test the SOAPHeaderElement
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,9 +34,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.NameImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.core.utils.DOMUtils;
/**
* Test the SOAPHeader
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -45,12 +45,12 @@
import org.jboss.ws.common.CommonBinding;
import org.jboss.ws.common.CommonBindingProvider;
import org.jboss.ws.common.CommonSOAPBinding;
-import org.jboss.ws.jaxrpc.CallImpl;
-import org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC;
+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.metadata.OperationMetaData;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.soap.attachment.MimeConstants;
/**
* TODO
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,7 +30,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.util.xml.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/JavaUtilsTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/JavaUtilsTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/JavaUtilsTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -23,7 +23,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.jbws_161.custom.HelloObj;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.utils.JavaUtils;
/**
* Test the JavaUtils
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,7 +27,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.EventingConstants;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLWithAnonTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,10 +32,10 @@
import org.apache.xerces.xs.XSTerm;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.core.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.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/JavaBean.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/JavaBean.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/JavaBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -10,7 +10,7 @@
import java.util.Arrays;
import java.util.Calendar;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.utils.JavaUtils;
public class JavaBean
{
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/ValueType.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/ValueType.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/encoded/marshalltest/ValueType.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -10,7 +10,7 @@
import java.util.Arrays;
import java.util.Calendar;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.utils.JavaUtils;
public class ValueType
{
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1107/JBWS1107TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,7 +26,7 @@
import javax.management.ObjectName;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.utils.ObjectNameFactory;
+import org.jboss.ws.core.utils.ObjectNameFactory;
/**
*
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/JBWS1124TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,8 +26,8 @@
import javax.servlet.http.HttpSession;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.handler.MessageContextJAXRPC;
-import org.jboss.ws.soap.MessageContextAssociation;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
+import org.jboss.ws.core.soap.MessageContextAssociation;
/**
*
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/JBWS1186TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/ServerHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/ServerHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1186/ServerHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -36,7 +36,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.ws.soap.SOAPContentElement;
+import org.jboss.ws.core.soap.SOAPContentElement;
public class ServerHandler extends GenericHandler
{
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -25,12 +25,12 @@
import java.io.FilenameFilter;
import java.net.MalformedURLException;
+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;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
/**
*
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,8 +28,8 @@
import javax.naming.InitialContext;
import javax.xml.rpc.Service;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.server.ServerConfigFactory;
/**
* @author darran.lofthouse(a)jboss.com
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws775/JBWS775TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws775/JBWS775TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws775/JBWS775TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMWriter;
/**
* Web services deployment can fail when deploying multiple EJB JARs
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/JBWS812TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/JBWS812TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/JBWS812TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -41,8 +41,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/ServerHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/ServerHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws812/ServerHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,7 +30,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMWriter;
public class ServerHandler extends GenericHandler
{
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws950/JBWS950TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws955/JBWS955TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws955/JBWS955TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws955/JBWS955TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,8 +32,8 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws956/JBWS956TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallDocLitTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallDocLitTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallDocLitTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.test.ws.jaxrpc.marshall.types.JavaBean;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.StubExt;
/**
* Test standard JAX-RPC types.
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallRpcLitDIITestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.test.ws.jaxrpc.marshall.types.JavaBean;
import org.jboss.ws.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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,7 +32,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.jaxrpc.marshall.types.JavaBean;
import org.jboss.test.ws.jaxrpc.marshall.types.JavaBean2;
-import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.core.utils.JavaUtils;
/**
* Test standard JAX-RPC types.
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/dynamichandler/DynamicHandlerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -35,9 +35,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceExt;
+import org.jboss.ws.core.jaxrpc.ServiceExt;
+import org.jboss.ws.core.utils.ObjectNameFactory;
import org.jboss.ws.metadata.HandlerMetaData;
-import org.jboss.ws.utils.ObjectNameFactory;
/**
* Test dynamic handlers
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -36,8 +36,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderDIITestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderProxyTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -33,9 +33,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -24,7 +24,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
/**
* A web service client that connects to a MDB endpoint.
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -11,7 +11,7 @@
import java.rmi.RemoteException;
import org.jboss.logging.Logger;
-import org.jboss.ws.integration.jboss.jms.JMSTransportSupport;
+import org.jboss.ws.integration.jboss42.jms.JMSTransportSupport;
/**
* An example of a MDB acting as a web service endpoint.
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIConfiguredCallTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcDIIUnconfiguredCallTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109ejb/RpcProxyTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/DocJSETestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIConfiguredCallTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcDIIUnconfiguredCallTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcJSETestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/jsr109pojo/RpcProxyTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -50,8 +50,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestServiceBean.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestServiceBean.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestServiceBean.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -36,7 +36,7 @@
import javax.xml.transform.dom.DOMSource;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -33,7 +33,7 @@
import javax.xml.transform.stream.StreamSource;
import org.jboss.ws.WSException;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.core.utils.IOUtils;
/**
* EmployeeRecords service endpoint
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentProxyTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentSAAJTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentSAAJTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/swa/AttachmentSAAJTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -49,7 +49,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.soap.SOAPBodyElementRpc;
+import org.jboss.ws.core.soap.SOAPBodyElementRpc;
/**
* Test SOAP with Attachements (SwA) through the SAAJ layer.
Deleted:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,15 +0,0 @@
-/*
- * JBossWS WS-Tools Generated Source
- *
- * Generation Date: Fri Sep 01 15:37:35 CDT 2006
- *
- * This generated source code represents a derivative work of the input to
- * the generator that produced it. Consult the input for the copyright and
- * terms of use that apply to this source code.
- */
-package org.jboss.test.ws.jaxrpc.samples.wsbpel.hello;
-public interface Greeter extends java.rmi.Remote
-{
-
- public java.lang.String sayHello(java.lang.String name) throws
java.rmi.RemoteException;
-}
Deleted:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/HelloWorldService.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/HelloWorldService.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/HelloWorldService.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,19 +0,0 @@
-/*
-* JBoss, the OpenSource EJB server
-* Distributable under LGPL license. See terms of license at
gnu.org.
-*/
-
-//Auto Generated by jbossws - Please do not edit!!!
-
-package org.jboss.test.ws.jaxrpc.samples.wsbpel.hello;
-
-
-import javax.xml.rpc.ServiceException;
-
-
-public interface HelloWorldService extends javax.xml.rpc.Service
-{
-
- public org.jboss.test.ws.jaxrpc.samples.wsbpel.hello.Greeter getGreeterPort() throws
ServiceException;
-
-}
\ No newline at end of file
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -42,21 +42,21 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.addressing.AddressingClientUtil;
-import org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler;
-import org.jboss.ws.eventing.EventSourceEndpoint;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.SubscriptionManagerEndpoint;
-import org.jboss.ws.eventing.element.DeliveryType;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.FilterType;
-import org.jboss.ws.eventing.element.StatusRequest;
-import org.jboss.ws.eventing.element.SubscribeRequest;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.eventing.element.UnsubscribeRequest;
-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;
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler;
+import org.jboss.ws.extensions.eventing.EventSourceEndpoint;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint;
+import org.jboss.ws.extensions.eventing.element.DeliveryType;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.FilterType;
+import org.jboss.ws.extensions.eventing.element.StatusRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.eventing.element.UnsubscribeRequest;
/**
* Test the eventing example service.
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wseventing/SysmonUtil.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -10,9 +10,9 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import org.jboss.logging.Logger;
-import org.jboss.ws.addressing.AddressingClientUtil;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
/**
* Util methods that drive the SysmoneTestCase.
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleEncryptTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -37,9 +37,9 @@
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.wsse.jaxrpc.WSSecurityHandlerOutbound;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
+import org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerOutbound;
/**
* Test WS-Security with RPC/Literal
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/SimpleSignTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -37,9 +37,9 @@
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.wsse.jaxrpc.WSSecurityHandlerOutbound;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
+import org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerOutbound;
/**
* Test WS-Security with RPC/Literal
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -39,9 +39,9 @@
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.wsse.jaxrpc.WSSecurityHandlerOutbound;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceImpl;
+import org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerOutbound;
/**
* This test simulates simulates the usage of a jboss-ws-security keystore and truststore
use cases
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,7 +34,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;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,7 +34,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;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -43,20 +43,20 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.addressing.AddressingClientUtil;
-import org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler;
-import org.jboss.ws.eventing.EventSourceEndpoint;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.SubscriptionManagerEndpoint;
-import org.jboss.ws.eventing.element.DeliveryType;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.FilterType;
-import org.jboss.ws.eventing.element.SubscribeRequest;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.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.core.jaxrpc.ServiceExt;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler;
+import org.jboss.ws.extensions.eventing.EventSourceEndpoint;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint;
+import org.jboss.ws.extensions.eventing.element.DeliveryType;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.FilterType;
+import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.eventing.element.UnsubscribeRequest;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventSinkServlet.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventSinkServlet.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventSinkServlet.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -29,8 +29,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -35,16 +35,16 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.addressing.AddressingClientUtil;
-import org.jboss.ws.eventing.EventSourceEndpoint;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.SubscriptionManagerEndpoint;
-import org.jboss.ws.eventing.element.DeliveryType;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.element.FilterType;
-import org.jboss.ws.eventing.element.SubscribeRequest;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.eventing.EventSourceEndpoint;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.SubscriptionManagerEndpoint;
+import org.jboss.ws.extensions.eventing.element.DeliveryType;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.element.FilterType;
+import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,17 +32,17 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.addressing.AddressingClientUtil;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.element.DeliveryType;
-import org.jboss.ws.eventing.element.RenewRequest;
-import org.jboss.ws.eventing.element.RenewResponse;
-import org.jboss.ws.eventing.element.StatusRequest;
-import org.jboss.ws.eventing.element.StatusResponse;
-import org.jboss.ws.eventing.element.SubscribeRequest;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.eventing.element.UnsubscribeRequest;
-import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.element.DeliveryType;
+import org.jboss.ws.extensions.eventing.element.RenewRequest;
+import org.jboss.ws.extensions.eventing.element.RenewResponse;
+import org.jboss.ws.extensions.eventing.element.StatusRequest;
+import org.jboss.ws.extensions.eventing.element.StatusResponse;
+import org.jboss.ws.extensions.eventing.element.SubscribeRequest;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.eventing.element.UnsubscribeRequest;
/**
* Test the eventing endpoints.
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/NotificationTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,10 +28,10 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.element.SubscribeResponse;
-import org.jboss.ws.eventing.mgmt.EventDispatcher;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.element.SubscribeResponse;
+import org.jboss.ws.extensions.eventing.mgmt.EventDispatcher;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/SubscriptionManagerTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,13 +27,13 @@
import java.util.Date;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.eventing.EventingConstants;
-import org.jboss.ws.eventing.deployment.EventingEndpointDI;
-import org.jboss.ws.eventing.element.EndpointReference;
-import org.jboss.ws.eventing.mgmt.Filter;
-import org.jboss.ws.eventing.mgmt.SubscriptionManager;
-import org.jboss.ws.eventing.mgmt.SubscriptionTicket;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.extensions.eventing.EventingConstants;
+import org.jboss.ws.extensions.eventing.deployment.EventingEndpointDI;
+import org.jboss.ws.extensions.eventing.element.EndpointReference;
+import org.jboss.ws.extensions.eventing.mgmt.Filter;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager;
+import org.jboss.ws.extensions.eventing.mgmt.SubscriptionTicket;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/MicrosoftInteropTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,12 +32,12 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.SecurityDecoder;
-import org.jboss.ws.wsse.SecurityStore;
-import org.jboss.ws.wsse.Util;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.SecurityDecoder;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.Util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,23 +34,23 @@
import org.jboss.security.SecurityAssociation;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.EncryptionOperation;
-import org.jboss.ws.wsse.OperationDescription;
-import org.jboss.ws.wsse.QNameTarget;
-import org.jboss.ws.wsse.RequireEncryptionOperation;
-import org.jboss.ws.wsse.RequireSignatureOperation;
-import org.jboss.ws.wsse.SecurityDecoder;
-import org.jboss.ws.wsse.SecurityEncoder;
-import org.jboss.ws.wsse.SecurityStore;
-import org.jboss.ws.wsse.SendUsernameOperation;
-import org.jboss.ws.wsse.SignatureOperation;
-import org.jboss.ws.wsse.Target;
-import org.jboss.ws.wsse.TimestampOperation;
-import org.jboss.ws.wsse.Util;
-import org.jboss.ws.wsse.WsuIdTarget;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.EncryptionOperation;
+import org.jboss.ws.extensions.security.OperationDescription;
+import org.jboss.ws.extensions.security.QNameTarget;
+import org.jboss.ws.extensions.security.RequireEncryptionOperation;
+import org.jboss.ws.extensions.security.RequireSignatureOperation;
+import org.jboss.ws.extensions.security.SecurityDecoder;
+import org.jboss.ws.extensions.security.SecurityEncoder;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.SendUsernameOperation;
+import org.jboss.ws.extensions.security.SignatureOperation;
+import org.jboss.ws.extensions.security.Target;
+import org.jboss.ws.extensions.security.TimestampOperation;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WsuIdTarget;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/wsse/SunInteropTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -31,12 +31,12 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.soap.MessageFactoryImpl;
-import org.jboss.ws.utils.DOMWriter;
-import org.jboss.ws.wsse.Constants;
-import org.jboss.ws.wsse.SecurityDecoder;
-import org.jboss.ws.wsse.SecurityStore;
-import org.jboss.ws.wsse.Util;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.SecurityDecoder;
+import org.jboss.ws.extensions.security.SecurityStore;
+import org.jboss.ws.extensions.security.Util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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.extensions.xop.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.ws.xop.XOPScanner;
import org.jboss.xb.binding.NamespaceRegistry;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -22,7 +22,7 @@
package org.jboss.test.ws.jaxrpc.xop.doclit;
import org.jboss.logging.Logger;
-import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.core.soap.NameImpl;
import javax.xml.rpc.handler.GenericHandler;
import javax.xml.rpc.handler.HandlerInfo;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -24,8 +24,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
import org.jboss.test.ws.jaxrpc.xop.shared.*;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.utils.IOUtils;
import javax.activation.DataHandler;
import javax.xml.rpc.Stub;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -1,7 +1,7 @@
package org.jboss.test.ws.jaxrpc.xop.rpclit;
import org.jboss.logging.Logger;
-import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.core.soap.NameImpl;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.GenericHandler;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -24,8 +24,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
import org.jboss.test.ws.jaxrpc.xop.shared.*;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.utils.IOUtils;
import javax.activation.DataHandler;
import javax.xml.rpc.Stub;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -22,9 +22,9 @@
package org.jboss.test.ws.jaxrpc.xop.shared;
import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.xop.XOPContext;
+import org.jboss.ws.core.jaxrpc.StubExt;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.extensions.xop.XOPContext;
import java.util.StringTokenizer;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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;
/**
*
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,12 +27,12 @@
import javax.jws.WebService;
+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;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
/**
*
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/JSR181ComplexTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/JSR181ComplexTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/JSR181ComplexTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -43,7 +43,7 @@
import org.jboss.test.ws.jaxws.jsr181.complex.client.RegistrationService;
import org.jboss.test.ws.jaxws.jsr181.complex.client.Statistics;
import org.jboss.test.ws.jaxws.jsr181.complex.client.ValidationException;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
/**
*
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/JSR181HandlerChainTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/JSR181HandlerChainTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/handlerchain/JSR181HandlerChainTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,8 +30,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-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.HandlerChain
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/oneway/JSR181OneWayTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/oneway/JSR181OneWayTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/oneway/JSR181OneWayTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,8 +30,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-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;
import org.jboss.ws.metadata.OperationMetaData;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -38,12 +38,12 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.CallImpl;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.jaxrpc.Style;
-import org.jboss.ws.jaxrpc.Use;
+import org.jboss.ws.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Use;
+import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.metadata.OperationMetaData;
-import org.jboss.ws.soap.NameImpl;
/**
* Test the JSR-181 annotation: javax.jws.SOAPBinding
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.CallImpl;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.soap.NameImpl;
/**
* Test the JSR-181 annotation: javax.jws.webmethod
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webparam/JSR181WebParamTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -32,8 +32,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-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;
import org.jboss.ws.metadata.OperationMetaData;
import org.jboss.ws.metadata.ParameterMetaData;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -37,9 +37,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.CallImpl;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.core.jaxrpc.CallImpl;
+import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.core.soap.NameImpl;
/**
* Test the JSR-181 annotation: javax.jws.webresult
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/AddressingStatefulTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -36,9 +36,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.addressing.jaxrpc.WSAddressingClientHandler;
-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;
+import org.jboss.ws.extensions.addressing.jaxrpc.WSAddressingClientHandler;
/**
* Test stateful endpoint using ws-addressing
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -36,8 +36,8 @@
import javax.xml.ws.addressing.ReferenceParameters;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.UUIDGenerator;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.UUIDGenerator;
/**
* A client side handler for the ws-addressing
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,7 +34,7 @@
import javax.xml.ws.addressing.ReferenceParameters;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
/**
* A server side handler for the ws-addressing
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/EndpointReferenceTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -24,8 +24,8 @@
//$Id$
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.addressing.EndpointReferenceImpl;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ClientHandler.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ClientHandler.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ClientHandler.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -33,7 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.test.ws.jaxws.wsaddressing.AddressingHandler;
-import org.jboss.ws.utils.UUIDGenerator;
+import org.jboss.ws.core.utils.UUIDGenerator;
/**
* A client side handler for the ws-addressing
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -33,7 +33,7 @@
import javax.xml.soap.SOAPFault;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMWriter;
+import org.jboss.ws.core.utils.DOMWriter;
/**
* WS-Addressing service endpoint
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/JavaToWSDL11TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -34,13 +34,13 @@
import org.jboss.test.ws.tools.sei.ServiceException;
import org.jboss.test.ws.tools.sei.StandardJavaTypes;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.WSToolsConstants;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.IOUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/SchemaGeneratorTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/SchemaGeneratorTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/SchemaGeneratorTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,7 +28,7 @@
import org.jboss.test.ws.common.jbossxb.complex.Base;
import org.jboss.test.ws.common.jbossxb.complex.Composite;
import org.jboss.test.ws.common.jbossxb.complex.Derived;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/** Test the XSD schema generator
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -31,7 +31,7 @@
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.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.WSDL20Writer;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.WSDLToJava;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -31,7 +31,7 @@
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.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.WSDL20Writer;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -39,8 +39,10 @@
import org.jboss.test.ws.tools.validation.WSDL11Validator;
import org.jboss.test.ws.tools.validation.WSDLValidator;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
@@ -51,8 +53,6 @@
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/clientside/ClientSideArtifactsTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,14 +28,14 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/doclit/ToolsDocLitTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,12 +26,12 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.WSToolsConstants;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.IOUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/enums/EnumTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/enums/EnumTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/enums/EnumTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -24,8 +24,8 @@
import java.io.FileInputStream;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,8 +30,10 @@
import org.jboss.test.ws.tools.validation.WSDL11Validator;
import org.jboss.test.ws.tools.validation.WSDLValidator;
import org.jboss.ws.Constants;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.JavaToWSDL;
@@ -39,8 +41,6 @@
import org.jboss.ws.tools.WSToolsConstants;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.IOUtils;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -31,9 +31,9 @@
import org.jboss.test.ws.common.jbossxb.complex.Derived;
import org.jboss.test.ws.common.jbossxb.simple.SimpleUserType;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.tools.JavaToXSD;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/java2xsd/SchemaTypesCreatorTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -29,10 +29,10 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.jbws_161.customexceptions.UserException;
import org.jboss.test.ws.tools.sei.Derived;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
import org.jboss.ws.tools.schema.SchemaTypeCreator;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1079/JBWS1079TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1079/JBWS1079TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1079/JBWS1079TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,8 +26,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1090/JBWS1090TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1090/JBWS1090TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1090/JBWS1090TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -30,9 +30,9 @@
import java.io.OutputStream;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.IOUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1170/JBWS1170TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1170/JBWS1170TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1170/JBWS1170TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,8 +26,8 @@
import java.io.FileReader;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -26,8 +26,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws818/JBWS818TestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws818/JBWS818TestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws818/JBWS818TestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -24,8 +24,8 @@
import java.io.FileInputStream;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/AnonTypesTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/AnonTypesTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/AnonTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -29,8 +29,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.jbws_204.wscompile.anontypes.Items;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.JavaToXSD;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/NillableTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -31,10 +31,10 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.tools.jbws_204.wscompile.nillabletypes.NillableType;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
import org.jboss.ws.tools.JavaToXSD;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardArraysTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardArraysTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardArraysTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -29,8 +29,8 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.tools.JavaToXSD;
-import org.jboss.ws.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardDoubleArraysTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardDoubleArraysTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_204/StandardDoubleArraysTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -29,7 +29,7 @@
import org.jboss.test.ws.tools.WSToolsTest;
import org.jboss.ws.Constants;
-import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/metadata/JavaWsdlMappingMetaDataTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,6 +27,7 @@
import javax.xml.namespace.QName;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.metadata.jaxrpcmapping.MethodParamPartsMapping;
@@ -37,7 +38,6 @@
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.utils.DOMUtils;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/metadata/WebServicesMetaDataTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -28,11 +28,11 @@
import javax.xml.namespace.QName;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.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.utils.DOMUtils;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xmlschema/WSDLTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -27,7 +27,7 @@
import javax.xml.namespace.QName;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.jaxrpc.LiteralTypeMapping;
+import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLTypes;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xmlschema/XercesSchemaParserTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -47,6 +47,7 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.apache.xerces.xs.XSWildcard;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.core.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;
@@ -54,7 +55,6 @@
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSParticle;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.JavaToXSD;
-import org.jboss.ws.utils.JBossWSEntityResolver;
import org.jboss.xb.binding.sunday.unmarshalling.LSInputAdaptor;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
Modified:
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/AnonymousTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/ComplexTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/NillableTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/ReferencesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java
===================================================================
---
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java 2006-12-07
07:57:14 UTC (rev 1598)
+++
branches/tdiesler/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/xsdjava/SimpleTypesTestCase.java 2006-12-07
10:45:48 UTC (rev 1599)
@@ -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;