posts - 2,  comments - 2,  trackbacks - 0

1、Aegis Binding这是XFire默认的绑定方式。
      他的特点是支持简单的绑定,不支持复杂的shema绑定。如果要实现复杂的schema绑定,需要自定义实现Type。
       1)public PurchaseOrderType receiveOrder(PurchaseOrderType po){......}
       2)public class PurchaseOrderType extends Type
            {
    
                 public ReferenceToDataType() {
                      setTypeClass(PurchaseOrderType.class);
                      setSchemaType(new QName(.. the QName of the type you're returning ..));
                 }

                 public void writeObject(Object value, XMLStreamWriter writer, 
                                    MessageContext context)
                 {
                      PurchaseOrderType data = (PurchaseOrderType) value;
                      ... do you're writing to the writer
                 }

                 publicObject readObject( MessageReader reader, MessageContext context )
                 {
                      // If you're reading you can read in a reference to the data
                      XMLStreamReader reader = context.getInMessage().getXMLStreamReader();

                      PurchaseOrderType data = read(reader);
                      return data;
                 }

                 public void writeSchema(Element schemaRoot)
                 {
                      // override this to write out your schema
                      // if you have it in DOM form you can convert it to YOM via DOMConverter
                 }
               }
2、Jibx绑定
     这种类型的绑定相对来说不需要自己写额外的代码,代是需要自己在开发之前进行Jibx的预编译,他会为我们生成相应的辅助类。但是这些东需要额外的配置,所以在开发过程中也不是很方便。
3、XMLBeans绑定
    这种绑定支持任意复杂的schema,可以自动生成javabean代码。
  
   唉,没时间了,有空再继续吧。现在先做个开始。

posted on 2006-09-21 13:26 吃饭不洗手 阅读(1603) 评论(1)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: