当前位置: 首页>>代码示例>>Java>>正文


Java ObjectSerializer.toSOAPElement方法代码示例

本文整理汇总了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();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:CQL2ResultsCreationUtil.java

示例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();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:CQL2AttributeResultIterator.java

示例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;
    }
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:25,代码来源:SearchEnumIterator.java


注:本文中的org.globus.wsrf.encoding.ObjectSerializer.toSOAPElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。