* or POST).
*/
public void testGetHttpInputSerialization() {
//1. test that the property is parsed correctly from the WSDL
BindingOperation oper = fBindOpers[0];
HTTPBindingOperationExtensions httpBindOperExts =
(HTTPBindingOperationExtensions) oper
.getComponentExtensionContext(
HTTPConstants.NS_URI_HTTP);
String actual = httpBindOperExts.getHttpInputSerialization();
assertEquals("Unexpected value for http input serialization.",
"text/plain",
actual);
//2. test that the property defaults to application/xml if the http method
//defaults to POST.
BindingOperation oper2 = fBindOpers[1];
HTTPBindingOperationExtensions httpBindOperExts2 =
(HTTPBindingOperationExtensions) oper2
.getComponentExtensionContext(
HTTPConstants.NS_URI_HTTP);
String actual2 = httpBindOperExts2.getHttpInputSerialization();
assertEquals("Unexpected default value for http input serialization.",
"application/xml",
actual2);
//3. test that the property defaults to application/x-www-form-urlencoded
//if the http method is GET.
BindingOperation oper3 = fBindOpers[2];
HTTPBindingOperationExtensions httpBindOperExts3 =
(HTTPBindingOperationExtensions) oper3
.getComponentExtensionContext(
HTTPConstants.NS_URI_HTTP);
String actual3 = httpBindOperExts3.getHttpInputSerialization();
assertEquals("Unexpected default value for http input serialization.",
"application/x-www-form-urlencoded",
actual3);
//4. test that the property defaults to application/x-www-form-urlencoded
//if the http method is DELETE.
BindingOperation oper4 = fBindOpers[3];
HTTPBindingOperationExtensions httpBindOperExts4 =
(HTTPBindingOperationExtensions) oper4
.getComponentExtensionContext(
HTTPConstants.NS_URI_HTTP);
String actual4 = httpBindOperExts4.getHttpInputSerialization();
assertEquals("Unexpected default value for http input serialization.",
"application/x-www-form-urlencoded",
actual4);
//5. test that the property defaults to application/xml
//if the http method is PUT.
BindingOperation oper5 = fBindOpers[4];
HTTPBindingOperationExtensions httpBindOperExts5 =
(HTTPBindingOperationExtensions) oper5
.getComponentExtensionContext(
HTTPConstants.NS_URI_HTTP);
String actual5 = httpBindOperExts5.getHttpInputSerialization();
assertEquals("Unexpected default value for http input serialization.",
"application/xml",
actual5);
//6. test that the property defaults to application/xml
//if the http method is POST.
BindingOperation oper6 = fBindOpers[5];
HTTPBindingOperationExtensions httpBindOperExts6 =
(HTTPBindingOperationExtensions) oper6
.getComponentExtensionContext(
HTTPConstants.NS_URI_HTTP);
String actual6 = httpBindOperExts6.getHttpInputSerialization();
assertEquals("Unexpected default value for http input serialization.",
"application/xml",
actual6);
//7. test that the property defaults to application/xml
//if the http method is CONNECT.
BindingOperation oper7 = fBindOpers[6];
HTTPBindingOperationExtensions httpBindOperExts7 =
(HTTPBindingOperationExtensions) oper7
.getComponentExtensionContext(
HTTPConstants.NS_URI_HTTP);
String actual7 = httpBindOperExts7.getHttpInputSerialization();
assertEquals("Unexpected default value for http input serialization.",