com.sun.xml.internal.ws.resources.WsservletMessages Java Examples

The following examples show how to use com.sun.xml.internal.ws.resources.WsservletMessages. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PortableConnectionImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public @Override @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null) {
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    }
    return address;
}
 
Example #2
Source File: HttpTransportPipe.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    for (Entry<String,List<String>> header : headers.entrySet()) {
        if(header.getValue().isEmpty()) {
            // I don't think this is legal, but let's just dump it,
            // as the point of the dump is to uncover problems.
            pw.println(header.getValue());
        } else {
            for (String value : header.getValue()) {
                pw.println(header.getKey()+": "+value);
            }
        }
    }

    if (buf.size() > HttpAdapter.dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, HttpAdapter.dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
        System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
        LOGGER.log(Level.FINER, msg);
    }
}
 
Example #3
Source File: PortableConnectionImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public @Override @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null) {
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    }
    return address;
}
 
Example #4
Source File: ServerConnectionImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    //return WSHttpHandler.getRequestAddress(httpExchange);

    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null)
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    return address;

}
 
Example #5
Source File: HttpAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void writeNotFoundErrorPage(WSHTTPConnection con, String message) throws IOException {
    con.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
    con.setContentTypeResponseHeader("text/html; charset=utf-8");

    PrintWriter out = new PrintWriter(new OutputStreamWriter(con.getOutput(),"UTF-8"));
    out.println("<html>");
    out.println("<head><title>");
    out.println(WsservletMessages.SERVLET_HTML_TITLE());
    out.println("</title></head>");
    out.println("<body>");
    out.println(WsservletMessages.SERVLET_HTML_NOT_FOUND(message));
    out.println("</body>");
    out.println("</html>");
    out.close();
}
 
Example #6
Source File: HttpAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    if (headers != null) {
        for (Entry<String, List<String>> header : headers.entrySet()) {
            if (header.getValue().isEmpty()) {
                // I don't think this is legal, but let's just dump it,
                // as the point of the dump is to uncover problems.
                pw.println(header.getValue());
            } else {
                for (String value : header.getValue()) {
                    pw.println(header.getKey() + ": " + value);
                }
            }
        }
    }
    if (buf.size() > dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
      System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
      LOGGER.log(Level.FINER, msg);
    }
}
 
Example #7
Source File: HttpTransportPipe.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    for (Entry<String,List<String>> header : headers.entrySet()) {
        if(header.getValue().isEmpty()) {
            // I don't think this is legal, but let's just dump it,
            // as the point of the dump is to uncover problems.
            pw.println(header.getValue());
        } else {
            for (String value : header.getValue()) {
                pw.println(header.getKey()+": "+value);
            }
        }
    }

    if (buf.size() > HttpAdapter.dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, HttpAdapter.dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
        System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
        LOGGER.log(Level.FINER, msg);
    }
}
 
Example #8
Source File: PortableConnectionImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public @Override @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null) {
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    }
    return address;
}
 
Example #9
Source File: ServerConnectionImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    //return WSHttpHandler.getRequestAddress(httpExchange);

    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null)
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    return address;

}
 
Example #10
Source File: HttpAdapter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void writeNotFoundErrorPage(WSHTTPConnection con, String message) throws IOException {
    con.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
    con.setContentTypeResponseHeader("text/html; charset=utf-8");

    PrintWriter out = new PrintWriter(new OutputStreamWriter(con.getOutput(),"UTF-8"));
    out.println("<html>");
    out.println("<head><title>");
    out.println(WsservletMessages.SERVLET_HTML_TITLE());
    out.println("</title></head>");
    out.println("<body>");
    out.println(WsservletMessages.SERVLET_HTML_NOT_FOUND(message));
    out.println("</body>");
    out.println("</html>");
    out.close();
}
 
Example #11
Source File: HttpAdapter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    if (headers != null) {
        for (Entry<String, List<String>> header : headers.entrySet()) {
            if (header.getValue().isEmpty()) {
                // I don't think this is legal, but let's just dump it,
                // as the point of the dump is to uncover problems.
                pw.println(header.getValue());
            } else {
                for (String value : header.getValue()) {
                    pw.println(header.getKey() + ": " + value);
                }
            }
        }
    }
    if (buf.size() > dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
      System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
      LOGGER.log(Level.FINER, msg);
    }
}
 
Example #12
Source File: HttpTransportPipe.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    for (Entry<String,List<String>> header : headers.entrySet()) {
        if(header.getValue().isEmpty()) {
            // I don't think this is legal, but let's just dump it,
            // as the point of the dump is to uncover problems.
            pw.println(header.getValue());
        } else {
            for (String value : header.getValue()) {
                pw.println(header.getKey()+": "+value);
            }
        }
    }

    if (buf.size() > HttpAdapter.dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, HttpAdapter.dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
        System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
        LOGGER.log(Level.FINER, msg);
    }
}
 
Example #13
Source File: HttpAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void writeNotFoundErrorPage(WSHTTPConnection con, String message) throws IOException {
    con.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
    con.setContentTypeResponseHeader("text/html; charset=utf-8");

    PrintWriter out = new PrintWriter(new OutputStreamWriter(con.getOutput(),"UTF-8"));
    out.println("<html>");
    out.println("<head><title>");
    out.println(WsservletMessages.SERVLET_HTML_TITLE());
    out.println("</title></head>");
    out.println("<body>");
    out.println(WsservletMessages.SERVLET_HTML_NOT_FOUND(message));
    out.println("</body>");
    out.println("</html>");
    out.close();
}
 
Example #14
Source File: ServerConnectionImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    //return WSHttpHandler.getRequestAddress(httpExchange);

    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null)
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    return address;

}
 
Example #15
Source File: HttpAdapter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void writeNotFoundErrorPage(WSHTTPConnection con, String message) throws IOException {
    con.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
    con.setContentTypeResponseHeader("text/html; charset=utf-8");

    PrintWriter out = new PrintWriter(new OutputStreamWriter(con.getOutput(),"UTF-8"));
    out.println("<html>");
    out.println("<head><title>");
    out.println(WsservletMessages.SERVLET_HTML_TITLE());
    out.println("</title></head>");
    out.println("<body>");
    out.println(WsservletMessages.SERVLET_HTML_NOT_FOUND(message));
    out.println("</body>");
    out.println("</html>");
    out.close();
}
 
Example #16
Source File: HttpAdapter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    if (headers != null) {
        for (Entry<String, List<String>> header : headers.entrySet()) {
            if (header.getValue().isEmpty()) {
                // I don't think this is legal, but let's just dump it,
                // as the point of the dump is to uncover problems.
                pw.println(header.getValue());
            } else {
                for (String value : header.getValue()) {
                    pw.println(header.getKey() + ": " + value);
                }
            }
        }
    }
    if (buf.size() > dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
      System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
      LOGGER.log(Level.FINER, msg);
    }
}
 
Example #17
Source File: HttpTransportPipe.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    for (Entry<String,List<String>> header : headers.entrySet()) {
        if(header.getValue().isEmpty()) {
            // I don't think this is legal, but let's just dump it,
            // as the point of the dump is to uncover problems.
            pw.println(header.getValue());
        } else {
            for (String value : header.getValue()) {
                pw.println(header.getKey()+": "+value);
            }
        }
    }

    if (buf.size() > HttpAdapter.dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, HttpAdapter.dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
        System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
        LOGGER.log(Level.FINER, msg);
    }
}
 
Example #18
Source File: PortableConnectionImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public @Override @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null) {
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    }
    return address;
}
 
Example #19
Source File: ServerConnectionImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    //return WSHttpHandler.getRequestAddress(httpExchange);

    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null)
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    return address;

}
 
Example #20
Source File: HttpAdapter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void writeNotFoundErrorPage(WSHTTPConnection con, String message) throws IOException {
    con.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
    con.setContentTypeResponseHeader("text/html; charset=utf-8");

    PrintWriter out = new PrintWriter(new OutputStreamWriter(con.getOutput(),"UTF-8"));
    out.println("<html>");
    out.println("<head><title>");
    out.println(WsservletMessages.SERVLET_HTML_TITLE());
    out.println("</title></head>");
    out.println("<body>");
    out.println(WsservletMessages.SERVLET_HTML_NOT_FOUND(message));
    out.println("</body>");
    out.println("</html>");
    out.close();
}
 
Example #21
Source File: HttpAdapter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    if (headers != null) {
        for (Entry<String, List<String>> header : headers.entrySet()) {
            if (header.getValue().isEmpty()) {
                // I don't think this is legal, but let's just dump it,
                // as the point of the dump is to uncover problems.
                pw.println(header.getValue());
            } else {
                for (String value : header.getValue()) {
                    pw.println(header.getKey() + ": " + value);
                }
            }
        }
    }
    if (buf.size() > dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
      System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
      LOGGER.log(Level.FINER, msg);
    }
}
 
Example #22
Source File: HttpTransportPipe.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    for (Entry<String,List<String>> header : headers.entrySet()) {
        if(header.getValue().isEmpty()) {
            // I don't think this is legal, but let's just dump it,
            // as the point of the dump is to uncover problems.
            pw.println(header.getValue());
        } else {
            for (String value : header.getValue()) {
                pw.println(header.getKey()+": "+value);
            }
        }
    }

    if (buf.size() > HttpAdapter.dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, HttpAdapter.dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
        System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
        LOGGER.log(Level.FINER, msg);
    }
}
 
Example #23
Source File: PortableConnectionImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public @Override @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null) {
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    }
    return address;
}
 
Example #24
Source File: ServerConnectionImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    //return WSHttpHandler.getRequestAddress(httpExchange);

    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null)
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    return address;

}
 
Example #25
Source File: PortableConnectionImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public @Override @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null) {
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    }
    return address;
}
 
Example #26
Source File: HttpAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    if (headers != null) {
        for (Entry<String, List<String>> header : headers.entrySet()) {
            if (header.getValue().isEmpty()) {
                // I don't think this is legal, but let's just dump it,
                // as the point of the dump is to uncover problems.
                pw.println(header.getValue());
            } else {
                for (String value : header.getValue()) {
                    pw.println(header.getKey() + ": " + value);
                }
            }
        }
    }
    if (buf.size() > dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
      System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
      LOGGER.log(Level.FINER, msg);
    }
}
 
Example #27
Source File: HttpTransportPipe.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos, true);
    pw.println("---["+caption +"]---");
    for (Entry<String,List<String>> header : headers.entrySet()) {
        if(header.getValue().isEmpty()) {
            // I don't think this is legal, but let's just dump it,
            // as the point of the dump is to uncover problems.
            pw.println(header.getValue());
        } else {
            for (String value : header.getValue()) {
                pw.println(header.getKey()+": "+value);
            }
        }
    }

    if (buf.size() > HttpAdapter.dump_threshold) {
        byte[] b = buf.getRawData();
        baos.write(b, 0, HttpAdapter.dump_threshold);
        pw.println();
        pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));
    } else {
        buf.writeTo(baos);
    }
    pw.println("--------------------");

    String msg = baos.toString();
    if (dump) {
        System.out.println(msg);
    }
    if (LOGGER.isLoggable(Level.FINER)) {
        LOGGER.log(Level.FINER, msg);
    }
}
 
Example #28
Source File: PortableConnectionImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public @Override @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null) {
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    }
    return address;
}
 
Example #29
Source File: ServerConnectionImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
    //return WSHttpHandler.getRequestAddress(httpExchange);

    PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
    String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
    if(address==null)
        throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
    return address;

}
 
Example #30
Source File: HttpAdapter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void writeNotFoundErrorPage(WSHTTPConnection con, String message) throws IOException {
    con.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
    con.setContentTypeResponseHeader("text/html; charset=utf-8");

    PrintWriter out = new PrintWriter(new OutputStreamWriter(con.getOutput(),"UTF-8"));
    out.println("<html>");
    out.println("<head><title>");
    out.println(WsservletMessages.SERVLET_HTML_TITLE());
    out.println("</title></head>");
    out.println("<body>");
    out.println(WsservletMessages.SERVLET_HTML_NOT_FOUND(message));
    out.println("</body>");
    out.println("</html>");
    out.close();
}