Methods Summary |
---|
public boolean | deserialize(java.lang.String req, javax.xml.namespace.QName expected_code, java.lang.String expected_str)
Message message = new Message(req);
MessageContext context = new MessageContext(server);
context.setSOAPConstants(SOAPConstants.SOAP12_CONSTANTS);
context.setProperty(Constants.MC_NO_OPERATION_OK, Boolean.TRUE);
message.setMessageContext(context);
boolean expectedFault = false;
try {
SOAPEnvelope envelope = message.getSOAPEnvelope();
} catch (AxisFault af) {
return af.getFaultString().indexOf(expected_str) != -1 &&
expected_code.equals(af.getFaultCode());
}
return expectedFault;
|
public void | testAcceptUserEncodingStyle()
String req = ENVELOPE + HEADER + BODY + MESSAGE_HEAD + INVALID_ENCSTYLE_DEF + MESSAGE + ITEM + MESSAGE_TAIL + TAIL;
Message message = new Message(req);
MessageContext context = new MessageContext(server);
context.setProperty(Constants.MC_NO_OPERATION_OK, Boolean.TRUE);
// Set the "invalid" encoding style
TypeMappingRegistry reg = context.getTypeMappingRegistry();
TypeMapping tm = (TypeMapping) reg.createTypeMapping();
tm.setSupportedEncodings(new String[] { INVALID_ENCSTYLE });
reg.register(INVALID_ENCSTYLE, tm);
context.setSOAPConstants(SOAPConstants.SOAP12_CONSTANTS);
message.setMessageContext(context);
SOAPEnvelope envelope = message.getSOAPEnvelope();
assertTrue(envelope != null);
|
public void | testEncStyleInBody()
String req = ENVELOPE + HEADER + BODY + ENCSTYLE_DEF + FAULT_HEAD + FAULT_DETAIL + FAULT_TAIL + TAIL;
assertTrue(deserialize(req, Constants.FAULT_SOAP12_SENDER,
Messages.getMessage("noEncodingStyleAttrAppear", "Body")));
|
public void | testEncStyleInDetail()
String req = ENVELOPE + HEADER + BODY + FAULT_HEAD + FAULT_DETAIL + ENCSTYLE_DEF + FAULT_TAIL + TAIL;
assertTrue(deserialize(req, Constants.FAULT_SOAP12_SENDER,
Messages.getMessage("noEncodingStyleAttrAppear", "Detail")));
|
public void | testEncStyleInEnvelope()
String req = ENVELOPE + ENCSTYLE_DEF + HEADER + BODY + FAULT_HEAD + FAULT_DETAIL + FAULT_TAIL + TAIL;
assertTrue(deserialize(req, Constants.FAULT_SOAP12_SENDER,
Messages.getMessage("noEncodingStyleAttrAppear", "Envelope")));
|
public void | testEncStyleInFault()
String req = ENVELOPE + HEADER + BODY + FAULT_HEAD + ENCSTYLE_DEF + FAULT_DETAIL + FAULT_TAIL + TAIL;
assertTrue(deserialize(req, Constants.FAULT_SOAP12_SENDER,
Messages.getMessage("noEncodingStyleAttrAppear", "Fault")));
|
public void | testEncStyleInHeader()
String req = ENVELOPE + HEADER + ENCSTYLE_DEF + BODY + FAULT_HEAD + FAULT_DETAIL + FAULT_TAIL + TAIL;
assertTrue(deserialize(req, Constants.FAULT_SOAP12_SENDER,
Messages.getMessage("noEncodingStyleAttrAppear", "Header")));
|
public void | testInvalidEncodingStyle()
String req = ENVELOPE + HEADER + BODY + MESSAGE_HEAD + INVALID_ENCSTYLE_DEF + MESSAGE + ITEM + MESSAGE_TAIL + TAIL;
assertTrue(deserialize(req, Constants.FAULT_SOAP12_DATAENCODINGUNKNOWN,
Messages.getMessage("invalidEncodingStyle")));
|
public void | testNoEncodingStyle()
String req = ENVELOPE + HEADER + BODY + MESSAGE_HEAD + NO_ENCSTYLE_DEF + MESSAGE + ITEM + MESSAGE_TAIL + TAIL;
assertTrue(deserialize(req, null, null) == false);
|