cancel
Showing results for 
Search instead for 
Did you mean: 

How do I convert an XML Response into Java object? Can this be done in SoapUI by including jars?

SOLVED
Highlighted
Contributor

How do I convert an XML Response into Java object? Can this be done in SoapUI by including jars?

I get an XML response can I convert it into Java Object by using Java API for XML Binding or XML into Java Bean so that it becomes easier to validate the response using objects.

 

Please help

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: How do I convert an XML Response into Java object? Can this be done in SoapUI by including jars

While the question is valid, I was not sure why are you going for very long route while soapUI NG can do it for you with just a simple assertion as mentioned the below documentation link.
https://www.soapui.org/soap-and-wsdl/validating-soap-services.html


Regards,
Rao.

View solution in original post

6 REPLIES 6
Highlighted
Community Hero

Re: How do I convert an XML Response into Java object? Can this be done in SoapUI by including jars

While the question is valid, I was not sure why are you going for very long route while soapUI NG can do it for you with just a simple assertion as mentioned the below documentation link.
https://www.soapui.org/soap-and-wsdl/validating-soap-services.html


Regards,
Rao.

View solution in original post

Highlighted
Contributor

Re: How do I convert an XML Response into Java object? Can this be done in SoapUI by including jars

If the response is simple one then assertions would suffice. But in my case the response is complex and adding so many assertions and maintaining them would be a herculean task. Hence I was looking for converting the response into Java object and then validating the same.

Highlighted
Community Hero

Re: How do I convert an XML Response into Java object? Can this be done in SoapUI by including jars

Ok. If the question is only about validation of response, you can still use schema validation or compliance and this does not include any xpath or you require just a single assertion.

When you talk about maintenance, that is applicable only when there are changes in the application. So, it is natural that if the behaviour of the application gets changed, obiviously, tests or assertions might change if you have xpath assertions etc provided the structure of response gets changes. But it is not so frequent, imo.

Again that requires changes even if you use java. But it is up to the end users comfortability.

As I mentioned in the initial response, it can be done. You can use java or groovy to do the same if you wish to do so.

You should be able find in the forum for similar need, I remember answering few weeks back. Otherwise, I can dig it later and post it here.



Regards,
Rao.
Highlighted
Contributor

Re: How do I convert an XML Response into Java object? Can this be done in SoapUI by including jars

Is there any manual or book available for groovy specific to SoapUI?? 

 

Can you please list the book(s) in case if you have come across?

Highlighted
Community Hero

Re: How do I convert an XML Response into Java object? Can this be done in SoapUI by including jars

I know there is one books - SoapUI Cookbook By Rupert
Also you can some resources mentioned in the below thread
http://community.smartbear.com/t5/SoapUI-Open-Source/How-to-read-and-use-SoapUI-API-for-non-Dev-peop...


Regards,
Rao.
Highlighted
Contributor

Re: How do I convert an XML Response into Java object? Can this be done in SoapUI by including jars

best  Groovy tutorials and manual i found in internet

Vam
Tags (1)
New Here?
Join us and watch the welcome video:
Top Kudoed Authors