You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Michael Svoboda <mi...@softwired-inc.com> on 2001/09/26 12:38:34 UTC

Re: Accessing xml data from xml file sent as attachment to messaging service

I got the sam as you. I don't know the reason why it's sending it as an
"application/octet-stream".
But I've got no problems reading it. I'm doing the following steps to
read my XML Attachment:

public String sendXmlAttachment(DataHandler dh) throws Exception
{ 
 InputSource inSource= new
InputSource((ByteArrayInputStream)dh.getContent());
 // Then I'll parse it
}

Michael



Rachel Gilmer wrote:
> 
> Hi all,
> Just wondered if anyone has tried to access xml data from an xml attachment
> file. The content type i'm receiving is "application/octet-stream" rather
> than text/xml???????
> Any suggestions?
> 
> Rachel
> 
> ----- Original Message -----
> From: "Richard Boehme" <bo...@acm.jhu.edu>
> To: <so...@xml.apache.org>
> Sent: Tuesday, September 25, 2001 3:48 PM
> Subject: Re: Probelm concerning String serialization of Excpetions
> 
> > That is on the bug list and a patch has been created; it just needs to be
> > put in, which should happen in the next few days.
> >
> > --Richard
> >
> > On Mon, 24 Sep 2001 michael.knuemann1@gerling.de wrote:
> >
> > > Hi!
> > >
> > > I've encountered a serious problem in case throwing an exception.
> > > The exception is thrown within a service call and should be transport to
> the
> > > soapclient.
> > > It is serialized within a FAULT tag as shown below:
> > >
> > > ...
> > > <faultstring>
> > > SGTEXC_MEXC_CODE: ENA2_0002
> > > SGTEXC_MEXC_INFO: Requested currency <EUR> differes from policy currency
> > > <DEM>
> > > </faultstring>
> > > <faultactor>/soap/servlet/rpcrouter</faultactor>
> > > <detail>
> > > <stackTrace>
> > > SGTEXC_MEXC_CODE: ENA2_0002 SGTEXC_MEXC_SEVERITY: 8
> > > SGTEXC_MEXC_INFO: Requested currency &amp;lt;EUR&amp;gt; differes from
> > > policy currency &amp;lt;DEM&amp;gt;
> > > ...
> > >
> > >
> > > My problem is, that the exception message string contains "<" and ">"
> > > characters. In the <detail> part of the soap message this characters are
> > > serialized
> > > to &gt; and &lt; but in the <faultstring> they aren't translated. This
> > > causes a crimpson parser exception, and the exception I want to show to
> the
> > > client is invisible.
> > >
> > > As a work around I translate the strings before creation of an
> exception.
> > > Is there any reason to handle the faulstring and the detail part
> > > different??? Or is that something which belongs on the buglist?
> > >
> > > Michael
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > This message is intended for the addressee or its representative only.
> Any
> > > form of unauthorized use, publication, reproduction, copying or
> disclosure
> > > of the content of this e-mail is not permitted. If you are not the
> intended
> > > recipient of this e-mail message and its contents, please notify the
> sender
> > > immediately and delete this message and all its attachments
> subsequently.
> > >
> >
> >