import org.apache.axis.EngineConfiguration; import org.apache.axis.Handler; import org.apache.axis.deployment.wsdd.WSDDProvider; import org.apache.axis.deployment.wsdd.WSDDService; public class WSDDSpringProvider extends WSDDProvider { public static final String PROVIDER_NAME = "SPRING"; public static final String PARAM_SPRING_BEAN_ID = "springBeanId"; public String getName(){ return "SPRING"; } public Handler newProviderInstance(WSDDService service, EngineConfiguration registry) throws Exception { return new SpringProvider(service.getParameter("springBeanId")); } }
protected void addService(WSDDService service) { WSDDService oldService = (WSDDService) services.get(service.getQName()); if (oldService != null) { oldService.removeNamespaceMappings(this); } services.put(service.getQName(), service); }
/** * Initialize a TypeMappingRegistry with the * WSDDTypeMappings. * Note: Extensions of WSDDService may override * initTMR to popluate the tmr with different * type mappings. */ protected void initTMR() throws WSDDException { // If not created, construct a tmr // and populate it with the type mappings. if (tmr == null) { createTMR(); for (int i=0; i<typeMappings.size(); i++) { deployTypeMapping((WSDDTypeMapping) typeMappings.get(i)); } } }
initTMR(); WSDDChain request = getRequestFlow(); WSDDChain response = getResponseFlow(); service.setSendType(sendType); if ( getQName() != null ) service.setName(getQName().getLocalPart()); service.setOptions(getParametersTable()); WSDDFaultFlow [] faultFlows = getFaultFlows(); if (faultFlows != null && faultFlows.length > 0) { FaultableHandler wrapper = new FaultableHandler(service);
desc.setName(getQName().getLocalPart()); Element [] operationElements = getChildElements(e, ELEM_WSDD_OPERATION); for (int i = 0; i < operationElements.length; i++) { WSDDOperation operation = new WSDDOperation(operationElements[i], desc); addOperation(operation); Element [] typeMappingElements = getChildElements(e, ELEM_WSDD_TYPEMAPPING); for (int i = 0; i < typeMappingElements.length; i++) { WSDDTypeMapping mapping = Element [] beanMappingElements = getChildElements(e, ELEM_WSDD_BEANMAPPING); for (int i = 0; i < beanMappingElements.length; i++) { WSDDBeanMapping mapping = Element [] arrayMappingElements = getChildElements(e, ELEM_WSDD_ARRAYMAPPING); for (int i = 0; i < arrayMappingElements.length; i++) { WSDDArrayMapping mapping = Element [] namespaceElements = getChildElements(e, ELEM_WSDD_NAMESPACE); for (int i = 0; i < namespaceElements.length; i++) { Element [] roleElements = getChildElements(e, ELEM_WSDD_ROLE); for (int i = 0; i < roleElements.length; i++) { String role = XMLUtils.getChildCharacterData(roleElements[i]); Element wsdlElem = getChildElement(e, ELEM_WSDD_WSDLFILE); if (wsdlElem != null) {
/** * This method can be used for dynamic deployment using new WSDDService() * etc. It validates some standard parameters for some standard providers * (if present). Do this before deployment.deployService(). */ public void validateDescriptors() throws WSDDException { if (tmr == null) { initTMR(); } desc.setTypeMappingRegistry(tmr); desc.setTypeMapping(getTypeMapping(desc.getUse().getEncoding())); String allowedMethods = getParameter(JavaProvider.OPTION_ALLOWEDMETHODS); if (allowedMethods != null && !"*".equals(allowedMethods)) { ArrayList methodList = new ArrayList(); StringTokenizer tokenizer = new StringTokenizer(allowedMethods, " ,"); while (tokenizer.hasMoreTokens()) { methodList.add(tokenizer.nextToken()); } desc.setAllowedMethods(methodList); } }
throws IOException { AttributesImpl attrs = new AttributesImpl(); QName name = getQName(); if (name != null) { attrs.addAttribute("", ATTR_NAME, ATTR_NAME, operation.writeToContext(context); writeFlowsToContext(context); writeParamsToContext(context);
public void removeNamespaceMappings(WSDDDeployment registry) { for (int i = 0; i < namespaces.size(); i++) { String namespace = (String) namespaces.elementAt(i); registry.removeNamespaceMapping(namespace); } registry.removeNamespaceMapping(getQName().getLocalPart()); }
/** * Put a WSDDService into this deployment, replacing any other * WSDDService which might already be present with the same QName. * * @param service a WSDDHandler to insert in this deployment */ public void deployService(WSDDService service) { service.deployToRegistry(this); }
/** * * @param name XXX * @return XXX */ public WSDDFaultFlow getFaultFlow(QName name) { WSDDFaultFlow[] t = getFaultFlows(); for (int n = 0; n < t.length; n++) { if (t[n].getQName().equals(name)) { return t[n]; } } return null; }
for (i = 0; i < elements.length; i++) { try { WSDDService service = new WSDDService(elements[i]); deployService(service); } catch (WSDDNonFatalException ex) {
initTMR(); WSDDChain request = getRequestFlow(); WSDDChain response = getResponseFlow(); service.setSendType(sendType); if ( getQName() != null ) service.setName(getQName().getLocalPart()); service.setOptions(getParametersTable()); WSDDFaultFlow [] faultFlows = getFaultFlows(); if (faultFlows != null && faultFlows.length > 0) { FaultableHandler wrapper = new FaultableHandler(service);
desc.setName(getQName().getLocalPart()); Element [] operationElements = getChildElements(e, ELEM_WSDD_OPERATION); for (int i = 0; i < operationElements.length; i++) { WSDDOperation operation = new WSDDOperation(operationElements[i], desc); addOperation(operation); Element [] typeMappingElements = getChildElements(e, ELEM_WSDD_TYPEMAPPING); for (int i = 0; i < typeMappingElements.length; i++) { WSDDTypeMapping mapping = Element [] beanMappingElements = getChildElements(e, ELEM_WSDD_BEANMAPPING); for (int i = 0; i < beanMappingElements.length; i++) { WSDDBeanMapping mapping = Element [] arrayMappingElements = getChildElements(e, ELEM_WSDD_ARRAYMAPPING); for (int i = 0; i < arrayMappingElements.length; i++) { WSDDArrayMapping mapping = Element [] namespaceElements = getChildElements(e, ELEM_WSDD_NAMESPACE); for (int i = 0; i < namespaceElements.length; i++) { Element [] roleElements = getChildElements(e, ELEM_WSDD_ROLE); for (int i = 0; i < roleElements.length; i++) { String role = XMLUtils.getChildCharacterData(roleElements[i]); Element wsdlElem = getChildElement(e, ELEM_WSDD_WSDLFILE); if (wsdlElem != null) {
/** * This method can be used for dynamic deployment using new WSDDService() * etc. It validates some standard parameters for some standard providers * (if present). Do this before deployment.deployService(). */ public void validateDescriptors() throws WSDDException { if (tmr == null) { initTMR(); } desc.setTypeMappingRegistry(tmr); desc.setTypeMapping(getTypeMapping(desc.getUse().getEncoding())); String allowedMethods = getParameter(JavaProvider.OPTION_ALLOWEDMETHODS); if (allowedMethods != null && !"*".equals(allowedMethods)) { ArrayList methodList = new ArrayList(); StringTokenizer tokenizer = new StringTokenizer(allowedMethods, " ,"); while (tokenizer.hasMoreTokens()) { methodList.add(tokenizer.nextToken()); } desc.setAllowedMethods(methodList); } }
throws IOException { AttributesImpl attrs = new AttributesImpl(); QName name = getQName(); if (name != null) { attrs.addAttribute("", ATTR_NAME, ATTR_NAME, operation.writeToContext(context); writeFlowsToContext(context); writeParamsToContext(context);
public void removeNamespaceMappings(WSDDDeployment registry) { for (int i = 0; i < namespaces.size(); i++) { String namespace = (String) namespaces.elementAt(i); registry.removeNamespaceMapping(namespace); } registry.removeNamespaceMapping(getQName().getLocalPart()); }
/** * Put a WSDDService into this deployment, replacing any other * WSDDService which might already be present with the same QName. * * @param service a WSDDHandler to insert in this deployment */ public void deployService(WSDDService service) { service.deployToRegistry(this); }
/** * * @param name XXX * @return XXX */ public WSDDFaultFlow getFaultFlow(QName name) { WSDDFaultFlow[] t = getFaultFlows(); for (int n = 0; n < t.length; n++) { if (t[n].getQName().equals(name)) { return t[n]; } } return null; }