You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Nuwan Wimalasekara <nu...@gmail.com> on 2013/10/30 13:53:50 UTC

How to pass xml with
Hi,
I am trying to process a xml file via VFS transport. But I am having a
issue with output file.
Once input xml file with <!DOCTYPE declaration is sent to vfs proxy
service,  <!DOCTYPE declaration is ignored and It is not in the out put file
written to file system.

Is there any way to get the <!DOCTYPE declaration which was in input file
to the output file.

Really appreciate your help to get this solved.


Thanks,
Nuwanw

Re: How to pass xml with Posted by Nuwan Wimalasekara <nu...@gmail.com>.
Hi
We could read the complete DOCTYPE element by adding bellow code in to
message builder class. So we have both DOCTYPE declaration and xml content(
builder.getDocumentElement()) in message builder class. now the problem is
that how do we pass DOCTYPE declaration in to message formatter with input
message. Because we only set xml content(builder.getDocumentElement()) into
the sopabody. We can save output file with the DOCTYPE declaration which
was in input file, if there is a way to pass DOCTYPE declaration into
message formatter class.

So what could be the best way to pass additional informations(DOCTYPE
declaration) with the message.

In Message Builder class
xmlReader  = inputFactory.createXMLStreamReader(pushbackInputStream,

(String)
messageContext.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING))
builder = new StAXOMBuilder(xmlReader);
                        OMDocument root = builder.getDocument();
                        Iterator i = root.getChildren();
                        while (i.hasNext()) {
//DOCTYPE element can be retrieved as bellow
                            Object obj = i.next();

                        }


On Fri, Nov 1, 2013 at 4:26 AM, Hiranya Jayathilaka <hi...@gmail.com>wrote:

> There's probably an Axiom setting you can use to force Axiom to not drop
> the DOCTYPE declaration.
>
> Thanks,
> Hiranya
>
> On Oct 30, 2013, at 9:30 PM, Nuwan Wimalasekara <
> nuwanwimalasekara@gmail.com> wrote:
>
> > Hi Sadeep,
> > Thanks for the reply. in my scenario, I am having xslt transformation in
> IN
> > Sequence. The file need to be processed. Issue is that after building
>  the
> > file it ignores the <!DOCTYPE declaration.
> >
> > Thnaks,
> > Nuwanw
> >
> >
> >
> > On Wed, Oct 30, 2013 at 7:45 PM, Sadeep Jayasumana <
> gayansadeep@gmail.com>wrote:
> >
> >> Hi Nuwan,
> >>
> >> If it's just a pass-thru scenario, you could use message relay [1].
> IIRC,
> >> it's not shipped with Synapse, but can be added easily.
> >>
> >> This won't work if you actually 'process' the file.
> >>
> >> [1] http://docs.wso2.org/display/ESB460/Message+Relay
> >>
> >> Sadeep
> >>
> >>
> >> On Wed, Oct 30, 2013 at 11:53 PM, Nuwan Wimalasekara <
> >> nuwanwimalasekara@gmail.com> wrote:
> >>
> >>> Hi,
> >>> I am trying to process a xml file via VFS transport. But I am having a
> >>> issue with output file.
> >>> Once input xml file with <!DOCTYPE declaration is sent to vfs proxy
> >>> service,  <!DOCTYPE declaration is ignored and It is not in the out put
> >>> file
> >>> written to file system.
> >>>
> >>> Is there any way to get the <!DOCTYPE declaration which was in input
> file
> >>> to the output file.
> >>>
> >>> Really appreciate your help to get this solved.
> >>>
> >>>
> >>> Thanks,
> >>> Nuwanw
> >>>
> >>
> >>
> >>
> >> --
> >>
> >> Sadeep Jayasumana
> >>
> >>
> >> College of Engineering & Computer Science, Australian National
> University.
> >>
> >> Canberra Research Lab, National ICT Australia (NICTA).
> >>
> >> Mobile       :  +61 4 1468 8521
> >>
> >> Homepage :  http://users.cecs.anu.edu.au/~sjayasumana
> >>
> >> LinkedIn    :  http://www.linkedin.com/in/sadeepj
> >>
>
> --
> Hiranya Jayathilaka
> Mayhem Lab/RACE Lab;
> Dept. of Computer Science, UCSB;  http://cs.ucsb.edu
> E-mail: hiranya@cs.ucsb.edu;  Mobile: +1 (805) 895-7443
> Blog: http://techfeast-hiranya.blogspot.com
>
>

Re: How to pass xml with Posted by Hiranya Jayathilaka <hi...@gmail.com>.
There's probably an Axiom setting you can use to force Axiom to not drop the DOCTYPE declaration.

Thanks,
Hiranya

On Oct 30, 2013, at 9:30 PM, Nuwan Wimalasekara <nu...@gmail.com> wrote:

> Hi Sadeep,
> Thanks for the reply. in my scenario, I am having xslt transformation in IN
> Sequence. The file need to be processed. Issue is that after building  the
> file it ignores the <!DOCTYPE declaration.
> 
> Thnaks,
> Nuwanw
> 
> 
> 
> On Wed, Oct 30, 2013 at 7:45 PM, Sadeep Jayasumana <ga...@gmail.com>wrote:
> 
>> Hi Nuwan,
>> 
>> If it's just a pass-thru scenario, you could use message relay [1]. IIRC,
>> it's not shipped with Synapse, but can be added easily.
>> 
>> This won't work if you actually 'process' the file.
>> 
>> [1] http://docs.wso2.org/display/ESB460/Message+Relay
>> 
>> Sadeep
>> 
>> 
>> On Wed, Oct 30, 2013 at 11:53 PM, Nuwan Wimalasekara <
>> nuwanwimalasekara@gmail.com> wrote:
>> 
>>> Hi,
>>> I am trying to process a xml file via VFS transport. But I am having a
>>> issue with output file.
>>> Once input xml file with <!DOCTYPE declaration is sent to vfs proxy
>>> service,  <!DOCTYPE declaration is ignored and It is not in the out put
>>> file
>>> written to file system.
>>> 
>>> Is there any way to get the <!DOCTYPE declaration which was in input file
>>> to the output file.
>>> 
>>> Really appreciate your help to get this solved.
>>> 
>>> 
>>> Thanks,
>>> Nuwanw
>>> 
>> 
>> 
>> 
>> --
>> 
>> Sadeep Jayasumana
>> 
>> 
>> College of Engineering & Computer Science, Australian National University.
>> 
>> Canberra Research Lab, National ICT Australia (NICTA).
>> 
>> Mobile       :  +61 4 1468 8521
>> 
>> Homepage :  http://users.cecs.anu.edu.au/~sjayasumana
>> 
>> LinkedIn    :  http://www.linkedin.com/in/sadeepj
>> 

--
Hiranya Jayathilaka
Mayhem Lab/RACE Lab;
Dept. of Computer Science, UCSB;  http://cs.ucsb.edu
E-mail: hiranya@cs.ucsb.edu;  Mobile: +1 (805) 895-7443
Blog: http://techfeast-hiranya.blogspot.com


Re: How to pass xml with Posted by Nuwan Wimalasekara <nu...@gmail.com>.
Hi Sadeep,
Thanks for the reply. in my scenario, I am having xslt transformation in IN
Sequence. The file need to be processed. Issue is that after building  the
file it ignores the <!DOCTYPE declaration.

Thnaks,
Nuwanw



On Wed, Oct 30, 2013 at 7:45 PM, Sadeep Jayasumana <ga...@gmail.com>wrote:

> Hi Nuwan,
>
> If it's just a pass-thru scenario, you could use message relay [1]. IIRC,
> it's not shipped with Synapse, but can be added easily.
>
> This won't work if you actually 'process' the file.
>
> [1] http://docs.wso2.org/display/ESB460/Message+Relay
>
> Sadeep
>
>
> On Wed, Oct 30, 2013 at 11:53 PM, Nuwan Wimalasekara <
> nuwanwimalasekara@gmail.com> wrote:
>
> > Hi,
> > I am trying to process a xml file via VFS transport. But I am having a
> > issue with output file.
> > Once input xml file with <!DOCTYPE declaration is sent to vfs proxy
> > service,  <!DOCTYPE declaration is ignored and It is not in the out put
> > file
> > written to file system.
> >
> > Is there any way to get the <!DOCTYPE declaration which was in input file
> > to the output file.
> >
> > Really appreciate your help to get this solved.
> >
> >
> > Thanks,
> > Nuwanw
> >
>
>
>
> --
>
> Sadeep Jayasumana
>
>
> College of Engineering & Computer Science, Australian National University.
>
> Canberra Research Lab, National ICT Australia (NICTA).
>
> Mobile       :  +61 4 1468 8521
>
> Homepage :  http://users.cecs.anu.edu.au/~sjayasumana
>
> LinkedIn    :  http://www.linkedin.com/in/sadeepj
>

Re: How to pass xml with Posted by Sadeep Jayasumana <ga...@gmail.com>.
Hi Nuwan,

If it's just a pass-thru scenario, you could use message relay [1]. IIRC,
it's not shipped with Synapse, but can be added easily.

This won't work if you actually 'process' the file.

[1] http://docs.wso2.org/display/ESB460/Message+Relay

Sadeep


On Wed, Oct 30, 2013 at 11:53 PM, Nuwan Wimalasekara <
nuwanwimalasekara@gmail.com> wrote:

> Hi,
> I am trying to process a xml file via VFS transport. But I am having a
> issue with output file.
> Once input xml file with <!DOCTYPE declaration is sent to vfs proxy
> service,  <!DOCTYPE declaration is ignored and It is not in the out put
> file
> written to file system.
>
> Is there any way to get the <!DOCTYPE declaration which was in input file
> to the output file.
>
> Really appreciate your help to get this solved.
>
>
> Thanks,
> Nuwanw
>



-- 

Sadeep Jayasumana


College of Engineering & Computer Science, Australian National University.

Canberra Research Lab, National ICT Australia (NICTA).

Mobile       :  +61 4 1468 8521

Homepage :  http://users.cecs.anu.edu.au/~sjayasumana

LinkedIn    :  http://www.linkedin.com/in/sadeepj