private SwACodec(SwACodec that) { super(that); this.mimeRootCodec = that.mimeRootCodec.copy(); }
@Override public void decode(InputStream in, String ct, Packet p) throws IOException { getCodec().decode(in, ct, p); }
@Override public ContentType encode(Packet packet, OutputStream out) throws IOException { return getCodec().encode(packet, out); }
ContentType ct = codec.getStaticContentType(request); requestPacketOutStream = new ByteArrayOutputStream(); ContentType dynamicCT = codec.encode(request, requestPacketOutStream); if (ct == null) { Packet reply = request.createClientResponse(null); replyPacketInStream = new ByteArrayInputStream(rplPacket); codec.decode(replyPacketInStream, contentTypeStr, reply);
request.addSatellite(new HttpResponseProperties(con)); ContentType ct = codec.getStaticContentType(request); if (ct == null) { ByteArrayBuffer buf = new ByteArrayBuffer(); ct = codec.encode(request, buf); codec.encode(request, buf); dump(buf, "HTTP request - "+request.endpointAddress, reqHeaders); OutputStream out = con.getOutput(); OutputStream os = con.getOutput(); if (os != null) { codec.encode(request, os);
if (hasAttachments) { writeln("--"+boundary, out); ContentType ct = rootCodec.getStaticContentType(packet); String ctStr = (ct != null) ? ct.getContentType() : rootCodec.getMimeType(); if (rootId != null) writeln("Content-ID: " + rootId, out); writeln("Content-Type: " + ctStr, out); writeln(out); ContentType primaryCt = rootCodec.encode(packet, out);
public ContentType getStaticContentType(Packet packet) { ContentType ct = (ContentType) packet.getInternalContentType(); if ( ct != null ) return ct; Message msg = packet.getMessage(); boolean hasAttachments = !msg.getAttachments().isEmpty(); Codec rootCodec = getMimeRootCodec(packet); if (hasAttachments) { String boundary = "uuid:" + UUID.randomUUID().toString(); String boundaryParameter = "boundary=\"" + boundary + "\""; // TODO use primaryEncoder to get type String messageContentType = MULTIPART_RELATED_MIME_TYPE + "; type=\"" + rootCodec.getMimeType() + "\"; " + boundaryParameter; ContentTypeImpl impl = new ContentTypeImpl(messageContentType, packet.soapAction, null); impl.setBoundary(boundary); impl.setBoundaryParameter(boundaryParameter); packet.setContentType(impl); return impl; } else { ct = rootCodec.getStaticContentType(packet); packet.setContentType(ct); return ct; } }
@Override public com.oracle.webservices.api.message.ContentType getContentType() { if (contentType == null) { contentType = getInternalContentType(); } if (contentType == null) { contentType = getCodec().getStaticContentType(this); } if (contentType == null) { //TODO write to buffer } return contentType; }
fiSoapCodec = getFICodec(xmlSoapCodec, version); if (fiSoapCodec != null) { fiMimeType = fiSoapCodec.getMimeType(); fiSwaCodec = new SwACodec(version, features, fiSoapCodec); connegXmlAccept = fiMimeType + ", " + clientAcceptedContentTypes;
private void handle(JmsServerTransport connection) throws IOException { this.connection = connection; String contentTypeStr = connection.getRequestContentType(); InputStream in = connection.getInputStream(); Packet packet = new Packet(); codec.decode(in, contentTypeStr, packet); packet.invocationProperties.put(BindingProvider.USERNAME_PROPERTY, connection.getRequestUsername()); packet.invocationProperties.put(BindingProvider.PASSWORD_PROPERTY, connection.getRequestPassword()); try { packet = head.process(packet, connection, this); } catch (Exception e) { throw new WebServiceException("Error during message processing", e); } if (packet.getMessage() != null) { connection.setMustReply(true); contentTypeStr = codec.getStaticContentType(packet).getContentType(); if (contentTypeStr == null) { throw new UnsupportedOperationException(); } else { connection.setResponseContentType(contentTypeStr); codec.encode(packet, connection.getOutputStream()); } } }
request.addSatellite(new HttpResponseProperties(con)); ContentType ct = codec.getStaticContentType(request); if (ct == null) { ByteArrayBuffer buf = new ByteArrayBuffer(); ct = codec.encode(request, buf); codec.encode(request, buf); dump(buf, "HTTP request - "+request.endpointAddress, reqHeaders); OutputStream out = con.getOutput(); OutputStream os = con.getOutput(); if (os != null) { codec.encode(request, os);
if (hasAttachments) { writeln("--"+boundary, out); ContentType ct = rootCodec.getStaticContentType(packet); String ctStr = (ct != null) ? ct.getContentType() : rootCodec.getMimeType(); if (rootId != null) writeln("Content-ID: " + rootId, out); writeln("Content-Type: " + ctStr, out); writeln(out); ContentType primaryCt = rootCodec.encode(packet, out);
public ContentType getStaticContentType(Packet packet) { ContentType ct = (ContentType) packet.getInternalContentType(); if ( ct != null ) return ct; Message msg = packet.getMessage(); boolean hasAttachments = !msg.getAttachments().isEmpty(); Codec rootCodec = getMimeRootCodec(packet); if (hasAttachments) { String boundary = "uuid:" + UUID.randomUUID().toString(); String boundaryParameter = "boundary=\"" + boundary + "\""; // TODO use primaryEncoder to get type String messageContentType = MULTIPART_RELATED_MIME_TYPE + "; type=\"" + rootCodec.getMimeType() + "\"; " + boundaryParameter; ContentTypeImpl impl = new ContentTypeImpl(messageContentType, packet.soapAction, null); impl.setBoundary(boundary); impl.setBoundaryParameter(boundaryParameter); packet.setContentType(impl); return impl; } else { ct = rootCodec.getStaticContentType(packet); packet.setContentType(ct); return ct; } }
public ContentType getStaticContentType(Packet packet) { ContentType toAdapt = getEncoder(packet).getStaticContentType(packet); return setAcceptHeader(packet, (ContentTypeImpl)toAdapt); }
fiSoapCodec = getFICodec(xmlSoapCodec, version); if (fiSoapCodec != null) { fiMimeType = fiSoapCodec.getMimeType(); fiSwaCodec = new SwACodec(version, features, fiSoapCodec); connegXmlAccept = fiMimeType + ", " + clientAcceptedContentTypes;
codec.decode(in.getInputStream(), in.getContentType(), p); codec.getStaticContentType(p); ContentType ct = codec.encode(p, bos); return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream()); } else if (!isFastInfoset && useFastInfoset) { codec.decode(in.getInputStream(), in.getContentType(), p); codec.getStaticContentType(p); com.sun.xml.ws.api.pipe.ContentType ct = codec.encode(p, bos); return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream());
request.addSatellite(new HttpResponseProperties(con)); ContentType ct = codec.getStaticContentType(request); if (ct == null) { ByteArrayBuffer buf = new ByteArrayBuffer(); ct = codec.encode(request, buf); codec.encode(request, buf); dump(buf, "HTTP request - "+request.endpointAddress, reqHeaders); OutputStream out = con.getOutput(); OutputStream os = con.getOutput(); if (os != null) { codec.encode(request, os);
@Override public void decode(InputStream in, String ct, Packet p) throws IOException { getCodec().decode(in, ct, p); }
if (hasAttachments) { writeln("--"+boundary, out); ContentType ct = rootCodec.getStaticContentType(packet); String ctStr = (ct != null) ? ct.getContentType() : rootCodec.getMimeType(); if (rootId != null) writeln("Content-ID: " + rootId, out); writeln("Content-Type: " + ctStr, out); writeln(out); ContentType primaryCt = rootCodec.encode(packet, out);
protected JmsTransportTube(JmsTransportTube that, TubeCloner cloner) { super(that, cloner); this.serviceName = that.serviceName; this.codec = that.codec.copy(); }