java.lang.Object
samples.attachments.TestRef
- public class TestRef
- extends java.lang.Object
An example of sending an attachment via messages.
The main purpose is to validate the different types of attachment references
by content Id, content location both absolute and relative.
Creates 5 separate attachments referenced differently by a SOAP document.
Each attachment contains a string that is assembled and tested to see if
if the attachments are correctly sent and referenced. Each attachment also
contains a mime header indicating its position and validated on the server
to see if mime headers are correctly sent with attachments.
Sends the same message again however the second attachments are placed in the
stream in reverse to see if they are still referenced ok.
The return SOAP document references a single attachment which is the a Java
serialized vector holding strings to the individual attachments sent.
Demos using attachments directly.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
opts
org.apache.axis.utils.Options opts
positionHTTPHeader
public static final java.lang.String positionHTTPHeader
- See Also:
- Constant Field Values
TheKey
public static final java.lang.String TheKey
- See Also:
- Constant Field Values
TestRef
public TestRef(org.apache.axis.utils.Options opts)
testit
public boolean testit()
throws java.lang.Exception
- This method sends all the files in a directory.
validate
void validate(java.lang.Object ret,
org.apache.axis.client.Call call,
java.lang.String expOrdPattern)
throws java.lang.Exception
getNextFirstChildElement
org.w3c.dom.Element getNextFirstChildElement(org.w3c.dom.Node n)
getNextSiblingElement
org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node n)
main
public static void main(java.lang.String[] args)
- Give a single file to send or name a directory
to send an array of attachments of the files in
that directory.
getAttachmentsFromDir
protected javax.activation.DataHandler[] getAttachmentsFromDir(java.lang.String dirName)
- Return an array of datahandlers for each file in the dir.