Forum Discussion

jhsachs's avatar
jhsachs
New Contributor
13 years ago

Displaying response format from WSDL?

One of soapUI's most useful abilities for me is translating a WSDL into readable form. The project lists the WSDL's operations; I can get the format of any operation's request from the skeleton "Request 1" that soapUI generates.

I don't see a way to get the format of a response, though. Is there a way to do this?

The closest I can come is to execute an operation and look at the actual response. This is difficult, because it is hard to construct a valid request for some operations, and even harder to construct a set of requests that elicit every possible element in their responses (and hardest of all to know when I have done so).

6 Replies

  • nmrao's avatar
    nmrao
    Icon for Champion Level 1 rankChampion Level 1
    That is true, you will see the response on execution only. Is there any specific issue that you are facing being lack of response message? If your comfortable reading the xml schema, it can be looked into by going to Service Interface ==> WSDL Content tab ==> Global Elements ==> The response type of particular operation. You may also generate sample response using xml schema with help of tools like xsd2instance of xml beans or some online sites.
  • jhsachs's avatar
    jhsachs
    New Contributor
    I don't think I'm facing a "specific issue"; I'm facing a highly general one, that the WSDL is an awkward format for conveying information to humans, however convenient it may be for computers.

    I'm responsible for writing documentation that explains APIs to developers who want to use them. The awkwardness of the WSDL means that I have to translate it into a more comprehensible form, and also means that the translation is a very labor-intensive job.

    Yesterday I spent a very long day -- about ten hours -- translating the description of one operation's response message from WSDL definitions into a readable format. This was not because I am unaccustomed to WSDLs; it was just because the message is complex, and the manual labor required to translate it took that long. How long would it have taken a suitable tool to produce the same result? Probably less than a second.

    I appreciate your suggestion that I use the structured WSDL listing in the WSDL Content tab. I wasn't aware of it, and it will make my work easier the next time I have to do this. It won't make that big a difference, though. It will help me to find the definitions of message elements faster, but that isn't a major part of the process.

    I'm thinking about writing my own tool to generate a model response message, or even something that is semantically equivalent but closer in form to the description I need to produce. I'm certainly capable of doing that, but I don't want to waste my time reinventing the wheel... if this particular wheel has already been invented.
  • nmrao's avatar
    nmrao
    Icon for Champion Level 1 rankChampion Level 1
    I believe you don't have to as there are various tools exists as I mentioned a couple in previous post.
    As you browser for the response message types, collect the chunk of lines from xsd, try it online like http://xmlgrid.net/genXml.html
    where it gives you expected reponse message.
  • nmrao's avatar
    nmrao
    Icon for Champion Level 1 rankChampion Level 1
    Another way to see the response format is to use Generate Mockservice on the right click of your Service Interface.
  • jhsachs's avatar
    jhsachs
    New Contributor
    nmrao wrote:
    I believe you don't have to as there are various tools exists as I mentioned a couple in previous post.
    As you browser for the response message types, collect the chunk of lines from xsd, try it online like http://xmlgrid.net/genXml.html
    where it gives you expected reponse message.


    I'm interested in any better tool I can find (rather than write), but this isn't clear to me. What do you mean about the XSD? The XSD for my WSDL -- or any WSDL, I believe -- is http://www.w3.org/2001/XMLSchema. That wouldn't contain any useful information.

    I tried putting the WSDL itself into the genXml tool, but it just said "invalid schema."

    So, I've got two questions.

    The first is: what does this tool produce? It says "XML" but is silent about the content. If it generates something that can easily be transformed into HTML that presents a tabular description of the message formats, it's the answer to my prayers. If not, it probably doesn't matter.

    The second is: how do I make it work?
  • nmrao's avatar
    nmrao
    Icon for Champion Level 1 rankChampion Level 1
    I provided you an online link which can translate an xsd into xml instance. In your case, you are looking for response documents. If you can collect the response type from xsd (location mentioned earlier response where to get that in soapui).

    Alternative method is to generate the soap mock service which will generate you response document automatically.
    Hope this link will help you.
    http://www.soapui.org/Getting-Started/m ... vices.html