public void init(ConfigurationContext configContext) { this.tmpconfigContext = configContext; //try { //super.init(DUMMY_CONFIG); //init(DUMMY_CONFIG); //} catch (ServletException e) { // throw new RuntimeException(e); //} agent = new TuscanyListingAgent(configContext); }
/** * This method overrides the Axis2 listing agent's computation of the * service name. */ @Override public String extractServiceName(String urlString) { String serviceName = findAxisServiceName(urlString); setContextRoot(urlString, serviceName); return serviceName; }
String serviceName = extractServiceName(url); HashMap services = configContext.getAxisConfiguration().getServices(); if ((services != null) && !services.isEmpty()) { for (Object p : ((Service)s).getPorts().values()) { String endpointURL = Axis2EngineIntegration.getPortAddress((Port)p); String modifiedURL = setIPAddress(endpointURL, url); modifiedURL = addContextRoot(modifiedURL, serviceName); Axis2EngineIntegration.setPortAddress((Port)p, modifiedURL); String serviceName = extractServiceName(url); HashMap services = configContext.getAxisConfiguration().getServices(); if ((services != null) && !services.isEmpty()) { ArrayList schemas = axisService.getSchema(); for (Object rootSchema : axisService.getSchema()) { XmlSchema schema = getSchema(((XmlSchema)rootSchema), xsds); if (schema != null) {
/** * Override the AxisServlet doGet to use the TuscanyListingAgent for ?wsdl */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { initContextRoot(request); String query = request.getQueryString(); if ((query != null) && (query.indexOf("wsdl2") >= 0 || query.indexOf("wsdl") >= 0 || query.indexOf("xsd") >= 0 || query.indexOf("policy") >= 0)) { agent.processListService(request, response); } else { super.doGet(request, response); } }
private XmlSchema getSchema(XmlSchema parentSchema, String name) { for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) { Object obj = iter.next(); if (obj instanceof XmlSchemaExternal) { XmlSchemaExternal extSchema = (XmlSchemaExternal)obj; if (extSchema.getSchemaLocation().endsWith(name)) { return extSchema.getSchema(); } else { XmlSchema schema = getSchema(extSchema.getSchema(), name); if (schema != null) { return schema; } } } } return null; }