I am using retrofit 2.0.0-beta1 with SimpleXml. I want the retrieve a Simple (XML) resource from a REST service. Marshalling/Unmarshalling the Simple object with SimpleXML w
Add the following dependencies for retrofit 2
compile 'com.squareup.retrofit2:retrofit:2.1.0'
for GSON
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
for observables
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
In your case for XML , you would have to include the following dependencies
compile 'com.squareup.retrofit2:converter-simplexml:2.1.0'
Update the service call as below
final Retrofit rest = new Retrofit.Builder()
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.addConverterFactory(SimpleXmlConverterFactory.create())
.baseUrl(endpoint)
.build();
SimpleService service = rest.create(SimpleService.class);