public void start() { /** * Consider three scenarios here : * - Default servlet using service level operation * - Default servlet using GET, PUT, POST, DELETE operations mapped to interface names with same name * - RPC over HTTP like : http://localhost:8080/HelloworldComponent/Helloworld/sayHello?name=Petra */ if (binding.getOperationSelector() == null || binding.getRequestWireFormat() == null || binding.getResponseWireFormat() == null) { throw new IllegalStateException("Binding operation selector and/or wire formats not properly setup."); } Servlet servlet = new HTTPBindingServiceServlet(endpoint, messageFactory); // Create our HTTP service listener Servlet and register it with the // Servlet host servletMapping = binding.getURI(); if (!servletMapping.endsWith("/")) { servletMapping += "/"; } if (!servletMapping.endsWith("*")) { servletMapping += "*"; } String deployedURI = servletHost.addServletMapping(servletMapping, servlet); endpoint.setDeployedURI(deployedURI); }
public void write(HTTPBinding httpBinding, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException { // writer.writeStartElement(Constants.SCA10_NS, BINDING_HTTP); writeStart(writer, HTTPBinding.TYPE.getNamespaceURI(), HTTPBinding.TYPE.getLocalPart()); // Write binding name if (httpBinding.getName() != null) { writer.writeAttribute(NAME, httpBinding.getName()); } // Write binding URI if (httpBinding.getURI() != null) { writer.writeAttribute(URI, httpBinding.getURI()); } // Write operation selectors if (httpBinding.getOperationSelector() != null) { extensionProcessor.write(httpBinding.getOperationSelector(), writer, context); } // Write wire formats if (httpBinding.getRequestWireFormat() != null) { extensionProcessor.write(httpBinding.getRequestWireFormat(), writer, context); } if (httpBinding.getResponseWireFormat() != null && httpBinding.getRequestWireFormat() != httpBinding .getResponseWireFormat()) { writeStart(writer, RESPONSE_QNAME.getNamespaceURI(), RESPONSE_QNAME.getLocalPart()); extensionProcessor.write(httpBinding.getResponseWireFormat(), writer, context); writeEnd(writer); } writeEnd(writer); // writer.writeEndElement(); }
binding.setOperationSelector(new HTTPDefaultOperationSelector()); if (binding.getRequestWireFormat() == null) { binding.setRequestWireFormat(new HTTPDefaultWireFormat()); if (binding.getRequestWireFormat() != null && binding.getResponseWireFormat() != null) { WireFormatProviderFactory wfProviderFactory = (WireFormatProviderFactory) providerFactories.getProviderFactory(binding.getRequestWireFormat().getClass()); if (wfProviderFactory != null) { this.wfProvider = wfProviderFactory.createServiceWireFormatProvider(endpoint);