Search code examples
webmethods

Invoking a wmRoot service to get package list as a xml or json


When calling GET on IS /invoke/wm.server.packages:packageList I get a result formatted as a table. I would much rather get a format that I can use without much parsing hassle.

<BODY bgcolor=#dddddd>
    <TABLE bgcolor=#dddddd border=1>
        <TR>
            <TD valign="top">
                <B>packages</B>
            </TD>
            <TD>
                <TABLE>
...
                            <TABLE bgcolor=#dddddd border=1>
                                <TR>
                                    <TD valign="top">
                                        <B>name</B>
                                    </TD>
                                    <TD>PackageNameX</TD>
                                </TR>
...
                </TABLE>
            </TD>
        </TR>
    </TABLE>
</BODY>

How to get a decent output in xml or json?


Solution

  • It is enough to add content negotiation to the request header.

    Accept: application/json; charset=utf-8