Methods Summary |
---|
public void | testAddingHeaderElements()
SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
SOAPHeader header = soapEnv.getHeader();
header.addChildElement("ebxmlms");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
soapMessage.writeTo(baos);
String xml = new String(baos.toByteArray());
assertTrue(xml.indexOf("ebxmlms") != -1);
|
public void | testAddingHeaderElements2()
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage soapMessage = mf.createMessage(new MimeHeaders(), new ByteArrayInputStream(xmlString.getBytes()));
SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
SOAPHeader header = soapEnv.getHeader();
Name headerName = soapEnv.createName(localName, prefix, prefix);
SOAPHeaderElement he = header.addHeaderElement(headerName);
he.setActor(actor);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
soapMessage.writeTo(baos);
String xml = new String(baos.toByteArray());
assertTrue(xml.indexOf(localName) != -1);
|
public void | testExamineAllHeaders()
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage soapMessage = mf.createMessage();
SOAPEnvelope envelope = soapMessage.getSOAPPart().getEnvelope();
SOAPHeader hdr = envelope.getHeader();
SOAPHeaderElement she1 = hdr.addHeaderElement(envelope.createName("foo1", "f1", "foo1-URI"));
she1.setActor("actor-URI");
Iterator iterator = hdr.examineAllHeaderElements();
SOAPHeaderElement she = null;
int cnt = 0;
while (iterator.hasNext()) {
cnt++;
she = (SOAPHeaderElement) iterator.next();
assertEquals(she, she1);
}
assertEquals(1, cnt);
iterator = hdr.examineAllHeaderElements();
assertTrue(iterator.hasNext());
|
public void | testExtractAllHeaders()
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage soapMessage = mf.createMessage();
SOAPEnvelope envelope = soapMessage.getSOAPPart().getEnvelope();
SOAPHeader hdr = envelope.getHeader();
SOAPHeaderElement she1 = hdr.addHeaderElement(envelope.createName("foo1", "f1", "foo1-URI"));
she1.setActor("actor-URI");
Iterator iterator = hdr.extractAllHeaderElements();
SOAPHeaderElement she = null;
int cnt = 0;
while (iterator.hasNext()) {
cnt++;
she = (SOAPHeaderElement) iterator.next();
assertEquals(she, she1);
}
assertEquals(1, cnt);
iterator = hdr.extractAllHeaderElements();
assertTrue(!iterator.hasNext());
|