Attachment parts are Axis's interface to attachments and JAF objects (DataHandler) are used to represent the attachments  which by in large is recommend or mandated by the JAX-RPC or JAX-M specs.  When used as attachments neither of these are on the "wire" so another implementation (MS) would not be aware of their existence.  The attachment demos do work and are tested by Axis's own functional test.  I have also tested attachments using TC 4.03 and 4.05, JDK 1.3.x and Xerces on Win2K.  I know they were working on RedHat using equivalent software versions, as late as Axis's B3 and I kind of doubt anything since 1.0 would have broken them.  I know of one interop demo/test between MS and Axis (B3) that involved DIME messages.  IMO, the samples provided use 10% of the functionality and cover 90% of what most user would do with attachments.  I would like to recommend  to please re visit the ! samples provided, get them to work, if possible in the environment mentioned above first then use them as a model for what you are doing.  I will admit that there has not been, that I know of  much interop testing, except the one demo mentioned.



Rick Rineholt
"The truth is out there...  All you need is a better search engine!"

[EMAIL PROTECTED]

Please respond to [EMAIL PROTECTED]

To:        [EMAIL PROTECTED]
cc:        
Subject:        Attachments



Hello,

this is a repost since I did not get any replies from the user list.
I looked at the attachments sample but realised that I cannot pass a
DataHandler object between the functions because the client will
eventually be written using MSSOAP and not axis. Then I read part of
the SAAJ specification.
Now I am quite confused. If I understood the spec correctly, the
following code should be possible (and sufficient) for using
attachments. Should this work and the Exception I get is due to axis
not correctly implementing the spec? Or is it me who is wrong?

Server:
public class MyService {
public String call()
{

SOAPMessage msg =
MessageContext.getCurrentContext().getResponseMessage();

msg.addAttachmentPart(msg.createAttachmentPart("string1",
"text/plain"));


return "string2";
}
}

Client:

...
call.setOperationName("call");
Object[] args = new Object[] {};
String ret = (String) call.invoke(args);
...


I see in tcpmon that there IS attachment content (which seems to be
correct) but nevertheless there is a SAXParseException thrown on
client side. Did I make any mistakes?

Software: Axis 1.0, Tomcat 4.1.12, JDK 1.4.1, Linux


Stack trace:
AxisFault

faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: org.xml.sax.SAXParseException: Document root missing
faultActor: null
faultDetail:

stackTrace: org.xml.sax.SAXParseException: Document root
missing

at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3170)
at

org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:501)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at

org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at

org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:232)
at

org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:546)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:377)
at org.apache.axis.client.Call.invokeEngine(Call.java:2132)
at org.apache.axis.client.Call.invoke(Call.java:2102)
at org.apache.axis.client.Call.invoke(Call.java:1851)
at org.apache.axis.client.Call.invoke(Call.java:1777)
at org.apache.axis.client.Call.invoke(Call.java:1315)
at test.TestClient.main(TestClient.java:123)


Cheers!
--
Matthias Brunner <[EMAIL PROTECTED]>
PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc



Reply via email to