You can use the optional outputFormat control parameter to specify the format of the output messages from running an operation in a Web service. If you specify a value for the outputFormat parameter when you deploy a Web service, the specified output format is used every time an operation in the Web service is run. If you do not specify a value for the parameter at deployment, when an operation in the Web service is run, an output format can be specified. If an output format is not specified at run time, the default output format is used.
The HTTP binding determines the default output format, as shown in Table 1.
Binding | Default output format | MIME type |
---|---|---|
HTTP GET | XML | text/xml |
HTTP POST (url-encoded) | XML | text/xml |
HTTP POST (xml) | XML | text/xml |
HTTP POST (json) | JSON | application/json |
The default JSON output format follows the JSON specification at www.json.org.
{"getEmployeesResponse":
[
{
"EMPNO":"000010",
"FIRSTNME":"CHRISTINE",
"MIDINIT":"I",
"LASTNAME":"HAAS",
"WORKDEPT":"A00",
"PHONENO":"3978",
"HIREDATE":"1995-01-01Z",
"JOB":"PRES ",
"EDLEVEL":18,
"SEX":"F",
"BIRTHDATE":"1963-08-24Z",
"SALARY":96800.00,
"BONUS":21113.19,
"COMM":4220.00},
{
"EMPNO":"000020",
"FIRSTNME":"MICHAEL",
"MIDINIT":"L",
"LASTNAME":"THOMPSON", ...}
]
}
{"getEmployeesResponse":
{
"EMPNO":"000010",
"FIRSTNME":"CHRISTINE",
"MIDINIT":"I",
"LASTNAME":"HAAS",
"WORKDEPT":"A00",
"PHONENO":"3978",
"HIREDATE":"1995-01-01Z",
"JOB":"PRES ",
"EDLEVEL":18,
"SEX":"F",
"BIRTHDATE":"1963-08-24Z",
"SALARY":96800.00,
"BONUS":21113.19,
"COMM":4220.00}
}
{"updateEmployeeResponse":{"updateCount":1}}
{"BONUS_INCREASEResponse":
{
"P_DEPTSWITHOUTNEWBONUSES":"",
"P_COUNTDEPTSVIEWED":8,
"P_COUNTDEPTSBONUSCHANGED":8,
"P_ERRORMSG":"",
"rowset":
[
{
"WORKDEPT":"A00",
"EMPNO":"000010",
"BONUS":25546.95},
{
"WORKDEPT":"A00",
"EMPNO":"000110",
"BONUS":22992.12},
{
"WORKDEPT":"A00",
"EMPNO":"000120",
...}
],
"rowset2":
[
{
"WORKDEPT":"A00",
"EMPNO":"000010",
"BONUS":25546.95},
{
"WORKDEPT":"A00",
"EMPNO":"000110",
"BONUS":22992.12},
{
"WORKDEPT":"A00",
"EMPNO":"000120",
...}
],
...
}
}
{"testXQueryResponse":
[
"Basic Snow Shovel, ",
"A Deluxe Snow Shovel ...",
...
]
}
{"testXQueryResponse":
"Basic Snow Shovel, "
}