@Override public void write(QName element, XmlOutputStream out, TypeMapper typeMapper) throws IOException { xmlizable.write(element, out, typeMapper); }
@Override public void load(XmlInputStream in, TypeMapper typeMapper) throws IOException, ConnectionException { name = new QName(in.getNamespace(), in.getName()); xmlType = typeMapper.getXsiType(in); xmlizable.load(in, typeMapper); }
@Override public void load(XmlInputStream in, TypeMapper typeMapper) throws IOException, ConnectionException { name = new QName(in.getNamespace(), in.getName()); xmlType = typeMapper.getXsiType(in); xmlizable.load(in, typeMapper); }
@Override public void write(QName element, XmlOutputStream out, TypeMapper typeMapper) throws IOException { xmlizable.write(element, out, typeMapper); }
result.load(in, this); return result; } catch (InstantiationException e) {
private void writeHeaders(XmlOutputStream xout) throws IOException { xout.writeStartTag(Constants.SOAP_ENVELOPE_NS, "Header"); for (Map.Entry<QName, Object> entry : headers.entrySet()) { xout.setPrefix(null, entry.getKey().getNamespaceURI()); Object value = entry.getValue(); if (value instanceof XMLizable) { ((XMLizable) value).write(entry.getKey(), xout, typeMapper); } else { //todo: add simple type } } xout.writeEndTag(Constants.SOAP_ENVELOPE_NS, "Header"); }
result.load(in, this); return result; } catch (InstantiationException e) {
private void writeHeaders(XmlOutputStream xout) throws IOException { xout.writeStartTag(Constants.SOAP_ENVELOPE_NS, "Header"); for (Map.Entry<QName, Object> entry : headers.entrySet()) { xout.setPrefix(null, entry.getKey().getNamespaceURI()); Object value = entry.getValue(); if (value instanceof XMLizable) { ((XMLizable) value).write(entry.getKey(), xout, typeMapper); } else { //todo: add simple type } } xout.writeEndTag(Constants.SOAP_ENVELOPE_NS, "Header"); }
private void writeBody(XmlOutputStream xout, QName requestElement, XMLizable request) throws IOException { xout.writeStartTag(Constants.SOAP_ENVELOPE_NS, "Body"); xout.setPrefix("m", requestElement.getNamespaceURI()); if (objectNamespace != null) xout.setPrefix("sobj", objectNamespace); request.write(requestElement, xout, typeMapper); xout.writeEndTag(Constants.SOAP_ENVELOPE_NS, "Body"); }
private void writeBody(XmlOutputStream xout, QName requestElement, XMLizable request) throws IOException { xout.writeStartTag(Constants.SOAP_ENVELOPE_NS, "Body"); xout.setPrefix("m", requestElement.getNamespaceURI()); if (objectNamespace != null) xout.setPrefix("sobj", objectNamespace); request.write(requestElement, xout, typeMapper); xout.writeEndTag(Constants.SOAP_ENVELOPE_NS, "Body"); }
private void writeSingleObject(XmlOutputStream out, TypeInfo info, Object value) throws IOException { if (value == null) { writeSimpleType(out, info, null, true, String.class.getName()); } else if (value instanceof XMLizable) { XMLizable xmlObject = (XMLizable) value; xmlObject.write(new QName(getNamespace(info), info.getName()), out, this); } else if (value instanceof Time) { writeSimpleType(out, info, value.toString(), true, Time.class.getName()); } else if (value instanceof Calendar || value instanceof Date) { String s = calendarCodec.getValueAsString(value); writeSimpleType(out, info, s, true, Calendar.class.getName()); } else if (value instanceof byte[]) { String s = new String(Base64.encode((byte[]) value)); writeSimpleType(out, info, s, true, "[B"); } else if (value instanceof Double) { writeDouble(out, info, (Double)value, true); } else if (value instanceof Float) { writeFloat(out, info, (Float)value, true); } else if (value instanceof Long) { writeLong(out, info, (Long)value, true); } else if (value instanceof Integer) { writeInt(out, info, (Integer)value, true); } else if (value instanceof Boolean) { writeBoolean(out, info, (Boolean)value, true); } else if (value instanceof BigDecimal) { writeBigDecimal(out, info, (BigDecimal)value, true); } else { writeString(out, info, value.toString(), true); } }
private void writeSingleObject(XmlOutputStream out, TypeInfo info, Object value) throws IOException { if (value == null) { writeSimpleType(out, info, null, true, String.class.getName()); } else if (value instanceof XMLizable) { XMLizable xmlObject = (XMLizable) value; xmlObject.write(new QName(getNamespace(info), info.getName()), out, this); } else if (value instanceof Time) { writeSimpleType(out, info, value.toString(), true, Time.class.getName()); } else if (value instanceof Calendar || value instanceof Date) { String s = calendarCodec.getValueAsString(value); writeSimpleType(out, info, s, true, Calendar.class.getName()); } else if (value instanceof byte[]) { String s = new String(Base64.encode((byte[]) value)); writeSimpleType(out, info, s, true, "[B"); } else if (value instanceof Double) { writeDouble(out, info, (Double)value, true); } else if (value instanceof Float) { writeFloat(out, info, (Float)value, true); } else if (value instanceof Long) { writeLong(out, info, (Long)value, true); } else if (value instanceof Integer) { writeInt(out, info, (Integer)value, true); } else if (value instanceof Boolean) { writeBoolean(out, info, (Boolean)value, true); } else if (value instanceof BigDecimal) { writeBigDecimal(out, info, (BigDecimal)value, true); } else { writeString(out, info, value.toString(), true); } }