0

Is there a simple way to cast a SOAP object into a Java object (similar to converting JSON into Java object with objectmapper) ?

The server side is using C# and has a class called "User Info" and I've created the same class in Java (I have an Android app). When I login to my application, it connects to a web-service "GetUserInfo" and that web-service gives back the user information by responding with an object from that class.

Is there a way I can just cast it into a Java object since both classes are literally the same?

Falak Dhruve
  • 326
  • 1
  • 10
  • Does [this](https://stackoverflow.com/questions/15948927/working-soap-client-example) help? – ProgrammingLlama Oct 11 '18 at 07:23
  • umm the thing is im not getting an xml / soap message im getting a soap object with the same attribute as my class , i tried to cast it directly but it keep saying a ' java.lang.ClassCastException: org.ksoap2.serialization.SoapObject cannot be cast to jo.edu.bau.www.bauapp.UserInfo ' , i thought there would be an easy solution smth like objectMapper –  Oct 11 '18 at 07:35
  • Take a look to this https://stackoverflow.com/questions/25052913/casting-a-soap-object-to-a-own-object – Brank Victoria Oct 11 '18 at 07:40
  • @BrankVictoria thanks mate , i will give it a shot . –  Oct 11 '18 at 07:43

0 Answers0