cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP UI tutorial - Google API

SOLVED
Occasional Contributor

SOAP UI tutorial - Google API

Hi,

 

I am using the GOOGLE API to learn about SOAP UI.

https://www.soapui.org/tutorials/google-maps.html

 

When I imported the project and run the sample request, I dont see an xml response. Instead I see the response in text as "The content you are trying to view cannot be viewed as xml". Note that I see a json response.

 

Where am I going wrong? How to get the xml response correctly?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: SOAP UI tutorial - Google API

@raptor,

 

The api support both xml / json formats.

 

User needs to provide it thru query parameter.

 

In the resource, define a parameter format of TEMPLATE type.

 

In the requests, provide the value for format.

 

Please see the attachment for details.

 

Selection_376.png

 

Hope this is clear.



Regards,
Rao.

View solution in original post

3 REPLIES 3
Community Hero

Re: SOAP UI tutorial - Google API

These view options are just for the sake of pretty-printing the response to you (as the SoapUI user). Meaning it just applies colors, and alignment etc to make it easy to read. But it is not actually converting anything. And since the content is not XML, SoapUI won't try to pretty-print it as if it were.

 

It is possible to convert the response to XML using Groovy. Here's one way to do it:

 

Add an Assertion to the Test Request. Choose Script Assertion as the assertion type, and enter:

 

log.info messageExchange.responseContentAsXml

Then press the green Play button. The converted response will appear in the Script Log (at the bottom of your SoapUI workspace).

 

Community Hero

Re: SOAP UI tutorial - Google API

@raptor,

 

The api support both xml / json formats.

 

User needs to provide it thru query parameter.

 

In the resource, define a parameter format of TEMPLATE type.

 

In the requests, provide the value for format.

 

Please see the attachment for details.

 

Selection_376.png

 

Hope this is clear.



Regards,
Rao.

View solution in original post

Highlighted
Occasional Contributor

Re: SOAP UI tutorial - Google API

Thanks JHunt and nmrao for your replies. nmrao's screenshot helped me. All I had to do was just change the format from json to xml. Viola! Much appreciate the effort!
New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors