本文整理汇总了Java中org.globus.wsrf.encoding.ObjectSerializer.toSOAPElement方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectSerializer.toSOAPElement方法的具体用法?Java ObjectSerializer.toSOAPElement怎么用?Java ObjectSerializer.toSOAPElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.globus.wsrf.encoding.ObjectSerializer
的用法示例。
在下文中一共展示了ObjectSerializer.toSOAPElement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serializeObject
import org.globus.wsrf.encoding.ObjectSerializer; //导入方法依赖的package包/类
private static String serializeObject(Object obj, MessageContext context, QName targetQName) throws Exception {
StringWriter writer = new StringWriter();
// derive a message element for the object
MessageElement element = (MessageElement) ObjectSerializer.toSOAPElement(obj, targetQName);
// create a serialization context to use the new message context
SerializationContext serializationContext = new SerializationContext(writer, context) {
public void serialize(QName elemQName, Attributes attributes, Object value)
throws IOException {
serialize(elemQName, attributes, value, null, Boolean.FALSE, null);
}
};
serializationContext.setPretty(true);
// output the message element through the serialization context
element.output(serializationContext);
writer.write("\n");
writer.flush();
return writer.getBuffer().toString();
}
示例2: serializeAttibuteResult
import org.globus.wsrf.encoding.ObjectSerializer; //导入方法依赖的package包/类
private String serializeAttibuteResult(CQLAttributeResult result) throws Exception {
StringWriter writer = new StringWriter();
// derive a message element for the object
MessageElement element = (MessageElement) ObjectSerializer.toSOAPElement(result, CQL2_ATTRIBUTE_RESULT_QNAME);
// create a serialization context to use the new message context
SerializationContext serializationContext = new SerializationContext(writer, getMessageContext()) {
public void serialize(QName elemQName, Attributes attributes, Object value)
throws IOException {
serialize(elemQName, attributes, value, null, Boolean.FALSE, null);
}
};
serializationContext.setPretty(true);
// output the message element through the serialization context
element.output(serializationContext);
writer.write("\n");
writer.flush();
return writer.getBuffer().toString();
}
示例3: next
import org.globus.wsrf.encoding.ObjectSerializer; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public IterationResult next(IterationConstraints ic) throws TimeoutException, NoSuchElementException {
if (this.searchResultIterator == null) {
throw new NoSuchElementException("Enumeration has been released");
}
List<SOAPElement> soapElements = new ArrayList<SOAPElement>(ic.getMaxElements());
try {
for (int i = 0; i < ic.getMaxElements() && searchResultIterator.hasNext(); i++) {
T nextResult = searchResultIterator.next();
SOAPElement element = ObjectSerializer.toSOAPElement(nextResult, this.qname);
soapElements.add(element);
}
return wrapUpElements(soapElements, soapElements.size() < ic.getMaxElements());
} catch (Exception ex) {
release();
NoSuchElementException nse = new NoSuchElementException("Error generating elements " + ex.getMessage());
nse.setStackTrace(ex.getStackTrace());
throw nse;
}
}