1 package org.jbpm.bpel.wsdl.xml; 2 3 import javax.wsdl.Definition; 4 import javax.wsdl.extensions.ExtensionRegistry; 5 import javax.wsdl.xml.WSDLReader; 6 7 import org.jbpm.bpel.wsdl.impl.DefinitionImpl; 8 import org.jbpm.bpel.wsdl.impl.PartnerLinkTypeImpl; 9 import org.jbpm.bpel.wsdl.impl.PropertyAliasImpl; 10 import org.jbpm.bpel.wsdl.impl.PropertyImpl; 11 12 17 public class WsdlFactoryImpl extends com.ibm.wsdl.factory.WSDLFactoryImpl { 18 19 23 public Definition newDefinition() { 24 Definition def = new DefinitionImpl(); 25 ExtensionRegistry extReg = newPopulatedExtensionRegistry(); 26 27 def.setExtensionRegistry(extReg); 28 29 return def; 30 } 31 32 37 public WSDLReader newWSDLReader() { 38 WSDLReader reader = super.newWSDLReader(); 39 reader.setFactoryImplName(getClass().getName()); 40 reader.setExtensionRegistry(newPopulatedExtensionRegistry()); 41 reader.setFeature("javax.wsdl.verbose", false); 42 return reader; 43 } 44 45 51 public ExtensionRegistry newPopulatedExtensionRegistry() { 52 ExtensionRegistry registry = super.newPopulatedExtensionRegistry(); 53 54 PartnerLinkTypeSerializer plinkTypeSerializer = new PartnerLinkTypeSerializer(); 56 registry.registerDeserializer(Definition.class, 57 WsdlConstants.Q_PARTNER_LINK_TYPE, plinkTypeSerializer); 58 registry.registerSerializer(Definition.class, 59 WsdlConstants.Q_PARTNER_LINK_TYPE, plinkTypeSerializer); 60 registry.mapExtensionTypes(Definition.class, 61 WsdlConstants.Q_PARTNER_LINK_TYPE, PartnerLinkTypeImpl.class); 62 63 PropertySerializer propertySerializer = new PropertySerializer(); 65 registry.registerDeserializer(Definition.class, 66 WsdlConstants.Q_PROPERTY, propertySerializer); 67 registry.registerSerializer(Definition.class, 68 WsdlConstants.Q_PROPERTY, propertySerializer); 69 registry.mapExtensionTypes(Definition.class, 70 WsdlConstants.Q_PROPERTY, PropertyImpl.class); 71 72 PropertyAliasSerializer aliasSerializer = new PropertyAliasSerializer(); 74 registry.registerDeserializer(Definition.class, 75 WsdlConstants.Q_PROPERTY_ALIAS, aliasSerializer); 76 registry.registerSerializer(Definition.class, 77 WsdlConstants.Q_PROPERTY_ALIAS, aliasSerializer); 78 registry.mapExtensionTypes(Definition.class, 79 WsdlConstants.Q_PROPERTY_ALIAS, PropertyAliasImpl.class); 80 81 return registry; 82 } 83 } 84 | Popular Tags |