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代碼。
??
?? 唉,沒時間了,有空再繼續吧。現在先做個開始。