Package com.sun.xml.ws.api.server

Examples of com.sun.xml.ws.api.server.SDDocument


            }
        } else if (connection.getRequestMethod().equals("HEAD")) {
            connection.getInput().close();
            Binding binding = getEndpoint().getBinding();
            if (isMetadataQuery(connection.getQueryString())) {
                SDDocument doc = wsdls.get(connection.getQueryString());
                connection.setStatus(doc != null
                        ? HttpURLConnection.HTTP_OK
                        : HttpURLConnection.HTTP_NOT_FOUND);
                connection.getOutput().close();
                connection.close();
View Full Code Here


     * @throws java.io.IOException when I/O errors happen
     */
    public void publishWSDL(@NotNull WSHTTPConnection con) throws IOException {
        con.getInput().close();
       
        SDDocument doc = wsdls.get(con.getQueryString());
        if (doc == null) {
            writeNotFoundErrorPage(con,"Invalid Request");
            return;
        }

        con.setStatus(HttpURLConnection.HTTP_OK);
        con.setContentTypeResponseHeader("text/xml;charset=utf-8");

        OutputStream os = con.getProtocol().contains("1.1") ? con.getOutput() : new Http10OutputStream(con);

        PortAddressResolver portAddressResolver = getPortAddressResolver(con.getBaseAddress());
        DocumentAddressResolver resolver = getDocumentAddressResolver(portAddressResolver);

        doc.writeTo(portAddressResolver, resolver, os);
        os.close();
    }
View Full Code Here

     */
    public WOResponse handleRequest(WORequest woRequest)
    {
        if(isMetadataQuery(woRequest.queryString()))
        {
            SDDocument doc = wsdls.get(woRequest.queryString());
            if(doc == null)
            {
                ERXResponse resp = new ERXResponse();
                resp.setStatus(WOMessage.HTTP_STATUS_NOT_FOUND);
                return resp;
            }

            ERXResponse resp = new ERXResponse();

            resp.setStatus(HttpURLConnection.HTTP_OK);
            resp.setHeader("text/xml;charset=utf-8", "Content-Type");

            ByteArrayOutputStream baos = new ByteArrayOutputStream();

            WODynamicURL du = woRequest._uriDecomposed();
            String baseUri = String.format("%s/%s.woa/%s/%s",
                    du.prefix(),
                    du.applicationName(),
                    du.requestHandlerKey(),
                    du.requestHandlerPath());

            boolean isSecure;
           
            if(woRequest instanceof ERXRequest)
            {
                isSecure = ((ERXRequest)woRequest).isSecure();
            } else
            {
                isSecure = ERXRequest.isRequestSecure(woRequest);
            }
               
            String soapAddress = ERXResourceManager._completeURLForResource(
                    baseUri,
                    isSecure,
                    WOApplication.application().createContextForRequest(woRequest)
                    );

            try
            {
                doc.writeTo(new ERPortAddressResolver(soapAddress),
                            new ERDocumentAddressResolver(soapAddress),
                            baos);
                baos.flush();
            }
            catch(IOException e)
View Full Code Here

            int wsdlnum = 1;
            int xsdnum = 1;
            for(Map.Entry<String, SDDocument> e : systemIds.entrySet())
            {
                SDDocument sdd = e.getValue();
                if(sdd.isWSDL())
                {
                    wsdls.put("wsdl=" + (wsdlnum++), sdd);
                }
                if(sdd.isSchema())
                {
                    wsdls.put("xsd=" + (xsdnum++), sdd);
                }
            }
View Full Code Here

    private class MetadataResolverImpl implements MetadataUtil.MetadataResolver{

        Map<String, SDDocument> docs = new HashMap<String, SDDocument>();

        public SDDocument resolveEntity(String systemId) {
            SDDocument sdi = docs.get(systemId);
            if (sdi == null) {
                SDDocumentSource sds;
                try {
                    sds = SDDocumentSource.create(new URL(systemId));
                } catch(MalformedURLException e) {
View Full Code Here

                TransformerFactory.newInstance();
        final Transformer transformer = tFactory.newTransformer();
        transformer.setOutputProperty(OutputKeys.INDENT,"yes");
       
        for(final Iterator<SDDocument> it = endpoint.getServiceDefinition().iterator(); it.hasNext();) {
            final SDDocument document = it.next();
            baos.reset();
           
            document.writeTo(new PortAddressResolver() {
                public @Nullable String getAddressFor(QName serviceName, @NotNull String portName) {
                    return TCP_ENDPOINT_ADDRESS_STUB;
                }
            }, resolver, baos);
            final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
           
            final FileOutputStream fos = new FileOutputStream("./etc/" + document.getURL().getFile());
            final Source source = new StreamSource(bais);
            final StreamResult result = new StreamResult(fos);
            transformer.transform(source, result);
            fos.close();
            bais.close();
View Full Code Here

                    }

                    int wsdlnum = 1;
                    int xsdnum = 1;
                    for (Entry<String, SDDocument> e : systemIds.entrySet()) {
                        SDDocument sdd = e.getValue();
                        if (sdd.isWSDL()) {
                            delegate.put("wsdl="+(wsdlnum++),sdd);
                        }
                        if (sdd.isSchema()) {
                            delegate.put("xsd="+(xsdnum++),sdd);
                        }
                    }

                    return delegate;
View Full Code Here

            }
        } else if (connection.getRequestMethod().equals("HEAD")) {
            connection.getInput().close();
            Binding binding = getEndpoint().getBinding();
            if (isMetadataQuery(connection.getQueryString())) {
                SDDocument doc = wsdls.get(connection.getQueryString());
                connection.setStatus(doc != null
                        ? HttpURLConnection.HTTP_OK
                        : HttpURLConnection.HTTP_NOT_FOUND);
                connection.getOutput().close();
                connection.close();
View Full Code Here

     * @throws java.io.IOException when I/O errors happen
     */
    public void publishWSDL(@NotNull WSHTTPConnection con) throws IOException {
        con.getInput().close();
       
        SDDocument doc = wsdls.get(con.getQueryString());
        if (doc == null) {
            writeNotFoundErrorPage(con,"Invalid Request");
            return;
        }

        con.setStatus(HttpURLConnection.HTTP_OK);
        con.setContentTypeResponseHeader("text/xml;charset=utf-8");

        OutputStream os = con.getProtocol().contains("1.1") ? con.getOutput() : new Http10OutputStream(con);

        PortAddressResolver portAddressResolver = getPortAddressResolver(con.getBaseAddress());
        DocumentAddressResolver resolver = getDocumentAddressResolver(portAddressResolver);

        doc.writeTo(portAddressResolver, resolver, os);
        os.close();
    }
View Full Code Here

            String systemId = schema.getSystemId();
            try {
                XMLStreamBufferResult xsbr = XmlUtil.identityTransform(schema, new XMLStreamBufferResult());
                SDDocumentSource sds = SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer());
                SDDocument sdoc = SDDocumentImpl.create(sds, new QName(""), new QName(""));
                docs.put(systemId, sdoc);
                nsMapping.put(((SDDocument.Schema)sdoc).getTargetNamespace(), sdoc);
            } catch(Exception ex) {
                LOGGER.log(Level.WARNING, "Exception in adding schemas to resolver", ex);
            }
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.api.server.SDDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.