MessageContext msgctx= MessageContext.getCurrentMessageContext();
AxisService axisServce= msgctx.getAxisService();
AxisEndpoint axisEndpoint= axisServce.getEndpoint("AnnotationServiceHttpEndpoint");
AxisBinding axisBinding=axisEndpoint.getBinding();
AxisBindingOperation axisBindingOperation;
Iterator<AxisBindingOperation> iterator=axisBinding.getChildren();
while(iterator.hasNext()){
axisBindingOperation=iterator.next();
if(axisBindingOperation.getName().equals(new QName("addDataFromURLandBody"))){
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION).equals("testroot/getFromBody/{data1}")){
System.out.println("wrong http location : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION)+" expected : testroot/getFromBody/{data1}" );
return false;
}
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD).equals("POST")){
System.out.println("wrong http method : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD)+" expected : POST" );
return false;
}
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION).equals("application/xml")){
System.out.println("INPUT SERIALIZATION TESTS");
System.out.println("wrong input serialization : found : "+ axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION) +" expected : application/xml" );
return false;
}
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION).equals("text/xml")){
System.out.println("OUTPUT SERIALIZATION TEST");
System.out.println("wrong output serialization : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION)+" expected : text/xml" );
return false;
}
System.out.println("Type publishing test \"addDataFromURLandBody\" OK.........");
}
if(axisBindingOperation.getName().equals(new QName("updateDataFromURL"))){
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION).equals("testroot/update/{data1}")){
System.out.println("wrong http location : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION)+" expected : testroot/update/{data1}" );
return false;
}
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD).equals("PUT")){
System.out.println("wrong http method : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD)+" expected : PUT" );
return false;
}
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION).equals("text/xml")){
System.out.println("wrong input serialization : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION)+" expected : text/xml" );
return false;
}
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION).equals("application/xml")) {
System.out.println("wrong output serialization : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION)+" expected : application/xml" );
return false;
}
System.out.println("Type publishing test \"updateDataFromURL\" OK.........");
}
if(axisBindingOperation.getName().equals(new QName("checkServicesXMLoverriding"))){
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION).equals("serviceroot/check")){
System.out.println("wrong http location : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION)+" expected : serviceroot/check" );
return false;
}
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD).equals("POST")){
System.out.println("wrong http method : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD)+" expected : POST" );
return false;
}
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION).equals("application/xml")){
System.out.println("wrong input serialization : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION)+" expected : application/xml" );
return false;
}
if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION).equals("application/xml")) {
System.out.println("wrong output serialization : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION)+" expected : application/xml" );
return false;
}
System.out.println("Type publishing test \"checkServicesXMLoverriding\" OK.........");
}
}