Java源码示例:com.sun.xml.internal.ws.encoding.xml.XMLMessage

示例1
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
示例2
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
示例3
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
示例4
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
示例5
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
示例6
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
示例7
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
示例8
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
示例9
@Override
Source toReturnValue(Packet response) {
    Message msg = response.getMessage();
    try {
        return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream());
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
示例10
Packet createPacket(DataSource arg) {

         switch (mode) {
            case PAYLOAD:
                throw new IllegalArgumentException("DataSource use is not allowed in Service.Mode.PAYLOAD\n");
            case MESSAGE:
                return new Packet(XMLMessage.create(arg, binding.getFeatures()));
            default:
                throw new WebServiceException("Unrecognized message mode");
        }
    }
 
示例11
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
示例12
@Override
Source toReturnValue(Packet response) {
    Message msg = response.getMessage();
    try {
        return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream());
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
示例13
Packet createPacket(DataSource arg) {

         switch (mode) {
            case PAYLOAD:
                throw new IllegalArgumentException("DataSource use is not allowed in Service.Mode.PAYLOAD\n");
            case MESSAGE:
                return new Packet(XMLMessage.create(arg, binding.getFeatures()));
            default:
                throw new WebServiceException("Unrecognized message mode");
        }
    }
 
示例14
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
示例15
@Override
Source toReturnValue(Packet response) {
    Message msg = response.getMessage();
    try {
        return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream());
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
示例16
Packet createPacket(DataSource arg) {

         switch (mode) {
            case PAYLOAD:
                throw new IllegalArgumentException("DataSource use is not allowed in Service.Mode.PAYLOAD\n");
            case MESSAGE:
                return new Packet(XMLMessage.create(arg, binding.getFeatures()));
            default:
                throw new WebServiceException("Unrecognized message mode");
        }
    }
 
示例17
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
示例18
@Override
Source toReturnValue(Packet response) {
    Message msg = response.getMessage();
    try {
        return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream());
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
示例19
Packet createPacket(DataSource arg) {

         switch (mode) {
            case PAYLOAD:
                throw new IllegalArgumentException("DataSource use is not allowed in Service.Mode.PAYLOAD\n");
            case MESSAGE:
                return new Packet(XMLMessage.create(arg, binding.getFeatures()));
            default:
                throw new WebServiceException("Unrecognized message mode");
        }
    }
 
示例20
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
示例21
@Override
Source toReturnValue(Packet response) {
    Message msg = response.getMessage();
    try {
        return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream());
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
示例22
Packet createPacket(DataSource arg) {

         switch (mode) {
            case PAYLOAD:
                throw new IllegalArgumentException("DataSource use is not allowed in Service.Mode.PAYLOAD\n");
            case MESSAGE:
                return new Packet(XMLMessage.create(arg, binding.getFeatures()));
            default:
                throw new WebServiceException("Unrecognized message mode");
        }
    }
 
示例23
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
示例24
@Override
Source toReturnValue(Packet response) {
    Message msg = response.getMessage();
    try {
        return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream());
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
示例25
Packet createPacket(DataSource arg) {

         switch (mode) {
            case PAYLOAD:
                throw new IllegalArgumentException("DataSource use is not allowed in Service.Mode.PAYLOAD\n");
            case MESSAGE:
                return new Packet(XMLMessage.create(arg, binding.getFeatures()));
            default:
                throw new WebServiceException("Unrecognized message mode");
        }
    }
 
示例26
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
示例27
@Override
Source toReturnValue(Packet response) {
    Message msg = response.getMessage();
    try {
        return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream());
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
示例28
Packet createPacket(DataSource arg) {

         switch (mode) {
            case PAYLOAD:
                throw new IllegalArgumentException("DataSource use is not allowed in Service.Mode.PAYLOAD\n");
            case MESSAGE:
                return new Packet(XMLMessage.create(arg, binding.getFeatures()));
            default:
                throw new WebServiceException("Unrecognized message mode");
        }
    }
 
示例29
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
示例30
@Override
Source toReturnValue(Packet response) {
    Message msg = response.getMessage();
    try {
        return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream());
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}