axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Börkel ...@ap-ag.com>
Subject RE: Attachments
Date Thu, 17 Oct 2002 09:35:22 GMT
HI!

In the meantime, I tried something. I used an attachment in the client and looked at the TCP
dump. Apparently, SOAP attachments are not embedded in the SOAP message, but in the HTTP body.
So, the HTTP implementation has to understand multipart HTTP bodies. So, maybe that is the
problem.

Regards,
Thomas

> -----Original Message-----
> From: Matthias Brunner [mailto:mb@blumenstrasse.vol.at] 
> Sent: Donnerstag, 17. Oktober 2002 11:24
> To: axis-dev@xml.apache.org
> Subject: Re: Attachments
> 
> 
> On Thursday 17 October 2002 10:00, Thomas Börkel wrote:
> >
> > After a first look, I would say you should use Xerces and not
> > Crimson as XML parser.
> 
> That does not work either. But the error message is different. I will 
> file a bug report.
> 
> AxisFault
>  faultCode: {http://xml.apache.org/axis/}Server.userException
>  faultString: org.xml.sax.SAXParseException: Content is not allowed 
> in prolog.
>  faultActor: null
>  faultDetail:
>         stackTrace: org.xml.sax.SAXParseException: Content is not 
> allowed in prolog.
>         at 
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXP
> arser.java:1162)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
>         at 
> org.apache.axis.encoding.DeserializationContextImpl.parse(Dese
> rializationContextImpl.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 Client.main(Client.java:23)
> 
> 
> org.xml.sax.SAXParseException: Content is not allowed in prolog.
>         at org.apache.axis.AxisFault.makeFault(AxisFault.java:120)
>         at 
> org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:551)
>         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 Client.main(Client.java:23)
> Caused by: org.xml.sax.SAXParseException: Content is not allowed in 
> prolog.
>         at 
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXP
> arser.java:1162)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
>         at 
> org.apache.axis.encoding.DeserializationContextImpl.parse(Dese
> rializationContextImpl.java:232)
>         at 
> org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:546)
>         ... 7 more
> 
> 
> >
> >
> > > -----Original Message-----
> > > From: Matthias Brunner [mailto:mb@blumenstrasse.vol.at]
> > > Sent: Mittwoch, 16. Oktober 2002 16:45
> > > To: axis-dev@xml.apache.org
> > > 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(Dese
> > > rializationContextImpl.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 <mb@blumenstrasse.vol.at>
> > > PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
> > > Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc
> 
> -- 
> Matthias Brunner <mb@blumenstrasse.vol.at>
> PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
> Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc
> 
> 

Mime
View raw message