1 package com.github.davidmoten.rx; 2 3 import java.util.List; 4 5 import javax.xml.bind.annotation.adapters.XmlAdapter; 6 7 import rx.Observable; 8 9 public class Jaxws { 10 11 @SuppressWarnings("rawtypes") 12 public static final class ObservableAdapter extends XmlAdapter<List, Observable> { 13 14 @SuppressWarnings({ "unchecked" }) 15 @Override 16 public Observable unmarshal(List list) throws Exception { 17 return Observable.from(list); 18 } 19 20 @Override 21 public List marshal(Observable o) throws Exception { 22 return (List) o.toList().toBlocking().single(); 23 } 24 25 } 26 27 }