Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

samples.attachments
Class TestRef  view TestRef download TestRef.java

java.lang.Object
  extended bysamples.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.


Nested Class Summary
(package private) static class TestRef.MemoryOnlyDataSource
          This class should store all attachment data in memory
 
Field Summary
(package private)  org.apache.axis.utils.Options opts
           
static java.lang.String positionHTTPHeader
           
static java.lang.String TheKey
           
 
Constructor Summary
TestRef(org.apache.axis.utils.Options opts)
           
 
Method Summary
protected  javax.activation.DataHandler[] getAttachmentsFromDir(java.lang.String dirName)
          Return an array of datahandlers for each file in the dir.
(package private)  org.w3c.dom.Element getNextFirstChildElement(org.w3c.dom.Node n)
           
(package private)  org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node n)
           
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.
 boolean testit()
          This method sends all the files in a directory.
(package private)  void validate(java.lang.Object ret, org.apache.axis.client.Call call, java.lang.String expOrdPattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

TestRef

public TestRef(org.apache.axis.utils.Options opts)
Method Detail

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.