You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by De Vleeschauwer Nele <Ne...@nbb.be> on 2011/08/03 10:49:24 UTC
Custom Mediator
Hi,
I've just created my own custom mediator class (based on the
org.apache.synapse.Mediator interface), but it's not quite clear to me
how I should proceed further. Should I configure this class somewhere
before I can use it in one of my proxy services ?
Any help is welcome...
-----------------------------------------
Visit our website! http://www.nbb.be
"DISCLAIMER: The content of this e-mail message should not be
construed as binding on the part of the National Bank of Belgium
(NBB) unless otherwise and previously stated. The opinions
expressed in this message are solely those of the author and do not
necessarily reflect NBB viewpoints, particularly when the content
of this message, or part thereof, is private by nature or does not
fall within the professional scope of its author."
Re: SEND mediator
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Thu, Apr 5, 2012 at 8:44 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> I think we need to develop another mediator that is like filter mediator;
> but the condition is send success or send failed, and can invoke another
> sequence or set of mediators in both cases (i.e. send succeeded or failed).
> Kind of branching of the sequence based on the send success or failure.
>
This is already supported with the callout mediator (blocking send). If
successful the following mediators will execute. Otherwise the fault
sequence will execute.
Thanks,
Hiranya
>
> Regards,
> Abid
>
>
>
> -----Original Message-----
> From: Hiranya Jayathilaka [mailto:hiranya911@gmail.com]
> Sent: Thursday, April 05, 2012 7:19 AM
> To: user@synapse.apache.org
> Subject: Re: SEND mediator
>
> Hi Paul,
>
> On Thu, Apr 5, 2012 at 2:06 PM, Paul Fremantle <pz...@gmail.com> wrote:
>
> > Hiranya
> >
> > I agree this is one way, but its a little complex. Maybe we should add a
> > JIRA to try and come up with a simpler solution?
> >
>
> I'm sorry but I didn't get your point. Do you mean that the way we handle
> out-only sends is too complex? Or do you mean that the error handling
> mechanism for out-only messages is too complex? I believe a comm error in
> an out-only message will trigger the respective fault sequences and the
> usual error handling logic of Synapse will kick in.
>
> Thanks,
> Hiranya
>
>
> >
> > Paul
> >
> > On Wed, Apr 4, 2012 at 4:53 AM, Hiranya Jayathilaka <
> hiranya911@gmail.com
> > >wrote:
> >
> > > On Wed, Apr 4, 2012 at 6:51 AM, Abid Khan <Ab...@jeppesen.com>
> > wrote:
> > >
> > > > I have a configuration where I am publishing some messages.
> > > >
> > > > In the configuration I have set the property to OUT_ONLY to be true.
> > > >
> > > > But still I want to know if the message was posted or received by the
> > > > other application, which mean is there anything in the MesageContext
> > that
> > > > tells me that the message was posted successfully?
> > > >
> > >
> > > Such a communication error would usually result in an endpoint error
> and
> > > the endpoint would be forced into either the TIMEOUT state or the
> > SUSPENDED
> > > state.
> > >
> > > Thanks,
> > > Hiranya
> > >
> > >
> > > >
> > > > Regards,
> > > >
> > > > Abid
> > > >
> > >
> > >
> > >
> > > --
> > > Hiranya Jayathilaka
> > > Associate Technical Lead;
> > > WSO2 Inc.; http://wso2.org
> > > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > > Blog: http://techfeast-hiranya.blogspot.com
> > >
> >
> >
> >
> > --
> > Paul Fremantle
> > Co-Founder and CTO, WSO2
> > Apache Synapse PMC Chair
> > OASIS WS-RX TC Co-chair
> >
> > blog: http://pzf.fremantle.org
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.; http://wso2.org
> E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
RE: SEND mediator
Posted by Abid Khan <Ab...@jeppesen.com>.
I think we need to develop another mediator that is like filter mediator; but the condition is send success or send failed, and can invoke another sequence or set of mediators in both cases (i.e. send succeeded or failed). Kind of branching of the sequence based on the send success or failure.
Regards,
Abid
-----Original Message-----
From: Hiranya Jayathilaka [mailto:hiranya911@gmail.com]
Sent: Thursday, April 05, 2012 7:19 AM
To: user@synapse.apache.org
Subject: Re: SEND mediator
Hi Paul,
On Thu, Apr 5, 2012 at 2:06 PM, Paul Fremantle <pz...@gmail.com> wrote:
> Hiranya
>
> I agree this is one way, but its a little complex. Maybe we should add a
> JIRA to try and come up with a simpler solution?
>
I'm sorry but I didn't get your point. Do you mean that the way we handle
out-only sends is too complex? Or do you mean that the error handling
mechanism for out-only messages is too complex? I believe a comm error in
an out-only message will trigger the respective fault sequences and the
usual error handling logic of Synapse will kick in.
Thanks,
Hiranya
>
> Paul
>
> On Wed, Apr 4, 2012 at 4:53 AM, Hiranya Jayathilaka <hiranya911@gmail.com
> >wrote:
>
> > On Wed, Apr 4, 2012 at 6:51 AM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > I have a configuration where I am publishing some messages.
> > >
> > > In the configuration I have set the property to OUT_ONLY to be true.
> > >
> > > But still I want to know if the message was posted or received by the
> > > other application, which mean is there anything in the MesageContext
> that
> > > tells me that the message was posted successfully?
> > >
> >
> > Such a communication error would usually result in an endpoint error and
> > the endpoint would be forced into either the TIMEOUT state or the
> SUSPENDED
> > state.
> >
> > Thanks,
> > Hiranya
> >
> >
> > >
> > > Regards,
> > >
> > > Abid
> > >
> >
> >
> >
> > --
> > Hiranya Jayathilaka
> > Associate Technical Lead;
> > WSO2 Inc.; http://wso2.org
> > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > Blog: http://techfeast-hiranya.blogspot.com
> >
>
>
>
> --
> Paul Fremantle
> Co-Founder and CTO, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
Re: SEND mediator
Posted by Paul Fremantle <pz...@gmail.com>.
Hiranya
Ah ok. Sorry I misunderstood. I thought you were saying that one had to
check the transport failure state in order to understand if the error had
happened.
Paul
On Thu, Apr 5, 2012 at 2:19 PM, Hiranya Jayathilaka <hi...@gmail.com>wrote:
> Hi Paul,
>
> On Thu, Apr 5, 2012 at 2:06 PM, Paul Fremantle <pz...@gmail.com> wrote:
>
> > Hiranya
> >
> > I agree this is one way, but its a little complex. Maybe we should add a
> > JIRA to try and come up with a simpler solution?
> >
>
> I'm sorry but I didn't get your point. Do you mean that the way we handle
> out-only sends is too complex? Or do you mean that the error handling
> mechanism for out-only messages is too complex? I believe a comm error in
> an out-only message will trigger the respective fault sequences and the
> usual error handling logic of Synapse will kick in.
>
> Thanks,
> Hiranya
>
>
> >
> > Paul
> >
> > On Wed, Apr 4, 2012 at 4:53 AM, Hiranya Jayathilaka <
> hiranya911@gmail.com
> > >wrote:
> >
> > > On Wed, Apr 4, 2012 at 6:51 AM, Abid Khan <Ab...@jeppesen.com>
> > wrote:
> > >
> > > > I have a configuration where I am publishing some messages.
> > > >
> > > > In the configuration I have set the property to OUT_ONLY to be true.
> > > >
> > > > But still I want to know if the message was posted or received by the
> > > > other application, which mean is there anything in the MesageContext
> > that
> > > > tells me that the message was posted successfully?
> > > >
> > >
> > > Such a communication error would usually result in an endpoint error
> and
> > > the endpoint would be forced into either the TIMEOUT state or the
> > SUSPENDED
> > > state.
> > >
> > > Thanks,
> > > Hiranya
> > >
> > >
> > > >
> > > > Regards,
> > > >
> > > > Abid
> > > >
> > >
> > >
> > >
> > > --
> > > Hiranya Jayathilaka
> > > Associate Technical Lead;
> > > WSO2 Inc.; http://wso2.org
> > > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > > Blog: http://techfeast-hiranya.blogspot.com
> > >
> >
> >
> >
> > --
> > Paul Fremantle
> > Co-Founder and CTO, WSO2
> > Apache Synapse PMC Chair
> > OASIS WS-RX TC Co-chair
> >
> > blog: http://pzf.fremantle.org
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.; http://wso2.org
> E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
--
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
Re: SEND mediator
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Hi Paul,
On Thu, Apr 5, 2012 at 2:06 PM, Paul Fremantle <pz...@gmail.com> wrote:
> Hiranya
>
> I agree this is one way, but its a little complex. Maybe we should add a
> JIRA to try and come up with a simpler solution?
>
I'm sorry but I didn't get your point. Do you mean that the way we handle
out-only sends is too complex? Or do you mean that the error handling
mechanism for out-only messages is too complex? I believe a comm error in
an out-only message will trigger the respective fault sequences and the
usual error handling logic of Synapse will kick in.
Thanks,
Hiranya
>
> Paul
>
> On Wed, Apr 4, 2012 at 4:53 AM, Hiranya Jayathilaka <hiranya911@gmail.com
> >wrote:
>
> > On Wed, Apr 4, 2012 at 6:51 AM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > I have a configuration where I am publishing some messages.
> > >
> > > In the configuration I have set the property to OUT_ONLY to be true.
> > >
> > > But still I want to know if the message was posted or received by the
> > > other application, which mean is there anything in the MesageContext
> that
> > > tells me that the message was posted successfully?
> > >
> >
> > Such a communication error would usually result in an endpoint error and
> > the endpoint would be forced into either the TIMEOUT state or the
> SUSPENDED
> > state.
> >
> > Thanks,
> > Hiranya
> >
> >
> > >
> > > Regards,
> > >
> > > Abid
> > >
> >
> >
> >
> > --
> > Hiranya Jayathilaka
> > Associate Technical Lead;
> > WSO2 Inc.; http://wso2.org
> > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > Blog: http://techfeast-hiranya.blogspot.com
> >
>
>
>
> --
> Paul Fremantle
> Co-Founder and CTO, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
Re: SEND mediator
Posted by Paul Fremantle <pz...@gmail.com>.
Hiranya
I agree this is one way, but its a little complex. Maybe we should add a
JIRA to try and come up with a simpler solution?
Paul
On Wed, Apr 4, 2012 at 4:53 AM, Hiranya Jayathilaka <hi...@gmail.com>wrote:
> On Wed, Apr 4, 2012 at 6:51 AM, Abid Khan <Ab...@jeppesen.com> wrote:
>
> > I have a configuration where I am publishing some messages.
> >
> > In the configuration I have set the property to OUT_ONLY to be true.
> >
> > But still I want to know if the message was posted or received by the
> > other application, which mean is there anything in the MesageContext that
> > tells me that the message was posted successfully?
> >
>
> Such a communication error would usually result in an endpoint error and
> the endpoint would be forced into either the TIMEOUT state or the SUSPENDED
> state.
>
> Thanks,
> Hiranya
>
>
> >
> > Regards,
> >
> > Abid
> >
>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.; http://wso2.org
> E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
--
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
Re: SEND mediator
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Wed, Apr 4, 2012 at 6:51 AM, Abid Khan <Ab...@jeppesen.com> wrote:
> I have a configuration where I am publishing some messages.
>
> In the configuration I have set the property to OUT_ONLY to be true.
>
> But still I want to know if the message was posted or received by the
> other application, which mean is there anything in the MesageContext that
> tells me that the message was posted successfully?
>
Such a communication error would usually result in an endpoint error and
the endpoint would be forced into either the TIMEOUT state or the SUSPENDED
state.
Thanks,
Hiranya
>
> Regards,
>
> Abid
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
SEND mediator
Posted by Abid Khan <Ab...@jeppesen.com>.
I have a configuration where I am publishing some messages.
In the configuration I have set the property to OUT_ONLY to be true.
But still I want to know if the message was posted or received by the other application, which mean is there anything in the MesageContext that tells me that the message was posted successfully?
Regards,
Abid
RE: how can I avoid this exception
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello all,
Thanks for your help in this regards, I was able to fix this; the issue was on my side. I had "somehow" changed the line from
"<transportSender name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLSender">"
To
<transportSender name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
And this happened some month ago as at that time we were not doing any SSL communication, so this bug was there in my code for more than some 5 months. Because I know I tested SSL http some time before that.
Regards,
Abid
-----Original Message-----
From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
Sent: Wednesday, May 23, 2012 11:47 AM
To: user@synapse.apache.org
Subject: Re: how can I avoid this exception
On Sat, May 19, 2012 at 8:40 PM, Hiranya Jayathilaka
<hi...@gmail.com>wrote:
> On Fri, May 18, 2012 at 10:01 PM, Abid Khan <Ab...@jeppesen.com>
> wrote:
>
> > Hello Hiranya,
> >
> > That is too bad to hear, we are not in position to move to a later
> version
> > of Synapse, so what is the way out for us, please advise.
> >
>
> You can try upgrading HTTP Core to the latest version (v4.1.4 I think).
>
+1. That known issue with HTTPS communication is fixed in HTTPCore 4.1.3
and above (and in Synapse 2.1).
However, that particular issue occurred under very specific circumstances.
Moreover, IIRC, it occurred while Synapse is trying to 'read' the response from an HTTPS server. Hence, I don't think it's what Abid is experiencing.
The best way to verify this would be to carry out a simple test with Synapse 2.1 in the same environment and see whether the problem gets solved.
Thanks,
Sadeep
>
> Thanks,
> Hiranya
>
>
> >
> > Thanks
> > Abid
> >
> > -----Original Message-----
> > From: Hiranya Jayathilaka [mailto:hiranya911@gmail.com]
> > Sent: Thursday, May 17, 2012 12:06 PM
> > To: user@synapse.apache.org
> > Subject: Re: how can I avoid this exception
> >
> > On Thu, May 17, 2012 at 9:30 PM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > Hello Paul,
> > >
> > > Thanks for prompt response, and what you are saying makes perfect
> > > sense, the issue on my side turned out to be more serious. As in
> > > my message below I was thinking server is sending a valid XML
> > > response with (may be) invalid DOCTYPE. Which is not the case.
> > >
> > > The problem seems to be that Synapse is not able to send the
> > > complete message when the server is SSL, which is if we are using
> > > an httpS url instead of plain http. And since server is getting a
> > > malformed XML from synapse it is throwing html-based error back.
> > >
> > > I am wondering whether synapse was tested with https or is there
> > > any special thing I have to configure to support https.
> > >
> >
> > IIRC this was a known bug in the HTTP core version used in old
> > Synapse releases.
> >
> > Thanks,
> > Hiranya
> >
> >
> > >
> > > Thanks,
> > > Abid
> > >
> > > -----Original Message-----
> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > Sent: Wednesday, May 16, 2012 9:43 PM
> > > To: user@synapse.apache.org
> > > Subject: Re: how can I avoid this exception
> > >
> > > Abid
> > >
> > > I'm not an expert on this. Basically the XML parser is behaving as
> > > it *should*. The question is can we get it to behave as it
> > > shouldn't :-)
> > >
> > > 1) I think there is a way to tell the StAX parser to ignore the
> DOCTYPE.
> > > I'm not sure if its possible to do this through Synapse into the
> > > underlying StAX parser easily though.
> > >
> > > 2) If you aren't really doing any XML processing you could turn
> > > off parsing completely
> > >
> > > 3) A complete hack I can think of is to use the message relay to
> > > parse this as a binary, hack the message in place to avoid the
> > > problem, and then use the builder mediator.
> > >
> > > Paul
> > >
> > > On Tue, May 15, 2012 at 3:57 PM, Abid Khan
> > > <Ab...@jeppesen.com>
> > wrote:
> > >
> > > > I did that; and the response is valid XML but the doctype is
> > > > expected to be something like
> > > >
> > > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML/2.0//EN">
> > > >
> > > > Instead of
> > > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> > > >
> > > >
> > > >
> > > > PS: notice a forward slash before 2.0 in the correct one.
> > > >
> > > > The problem is that it will take very long time to go thru
> > > > build/test cycle of that product, and if I can change that
> > > > behavior in Synapse configuration that would help.
> > > >
> > > > Regards,
> > > > Abid
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > > Sent: Tuesday, May 15, 2012 6:16 AM
> > > > To: user@synapse.apache.org
> > > > Subject: Re: how can I avoid this exception
> > > >
> > > > Abid
> > > >
> > > > A good approach is to put TCPMON in the middle to look at
> > > > exactly what the server is responding to the Synapse engine.
> > > >
> > > > Paul
> > > >
> > > > On Tue, May 15, 2012 at 1:19 AM, Abid Khan
> > > > <Ab...@jeppesen.com>
> > > wrote:
> > > >
> > > > > Hello all,
> > > > >
> > > > > I am getting following fault from synapse, It looks like the
> > > > > application is sending back an protocol version that synapse
> > > > > cannot accept, is there any way I can avoid this issue?
> > > > >
> > > > >
> > > > > <soapenv:Fault
> > > > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><fau
> > > > > ltco de xmlns:tns="http://www.w3.org/2003/05/soap-envelope
> > > > ">tns:Receiver</faultcode><faultstring>org.apache.axis2.AxisFault:
> > > > > org.apache.http.ProtocolException: Not a valid protocol version:
> > > > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
> > > > > 2.0//EN"></faultstring></soapenv:Fault
> > > > >
> > > > >
> > > > > Regards,
> > > > > Abid Khan
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Paul Fremantle
> > > > Co-Founder and CTO, WSO2
> > > > Apache Synapse PMC Chair
> > > > OASIS WS-RX TC Co-chair
> > > >
> > > > blog: http://pzf.fremantle.org
> > > > paul@wso2.com
> > > >
> > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > >
> > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > Co-Founder and CTO, WSO2
> > > Apache Synapse PMC Chair
> > > OASIS WS-RX TC Co-chair
> > >
> > > blog: http://pzf.fremantle.org
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> >
> >
> >
> > --
> > Hiranya Jayathilaka
> > Associate Technical Lead;
> > WSO2 Inc.; http://wso2.org
> > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > Blog: http://techfeast-hiranya.blogspot.com
> >
>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.; http://wso2.org
> E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
--
Sadeep Jayasumana
**
Email: gayansadeep@gmail.com****
Mobile: +61 4 1468 8521
Re: how can I avoid this exception
Posted by Sadeep Jayasumana <ga...@gmail.com>.
On Sat, May 19, 2012 at 8:40 PM, Hiranya Jayathilaka
<hi...@gmail.com>wrote:
> On Fri, May 18, 2012 at 10:01 PM, Abid Khan <Ab...@jeppesen.com>
> wrote:
>
> > Hello Hiranya,
> >
> > That is too bad to hear, we are not in position to move to a later
> version
> > of Synapse, so what is the way out for us, please advise.
> >
>
> You can try upgrading HTTP Core to the latest version (v4.1.4 I think).
>
+1. That known issue with HTTPS communication is fixed in HTTPCore 4.1.3
and above (and in Synapse 2.1).
However, that particular issue occurred under very specific circumstances.
Moreover, IIRC, it occurred while Synapse is trying to 'read' the response
from an HTTPS server. Hence, I don't think it's what Abid is experiencing.
The best way to verify this would be to carry out a simple test with
Synapse 2.1 in the same environment and see whether the problem gets solved.
Thanks,
Sadeep
>
> Thanks,
> Hiranya
>
>
> >
> > Thanks
> > Abid
> >
> > -----Original Message-----
> > From: Hiranya Jayathilaka [mailto:hiranya911@gmail.com]
> > Sent: Thursday, May 17, 2012 12:06 PM
> > To: user@synapse.apache.org
> > Subject: Re: how can I avoid this exception
> >
> > On Thu, May 17, 2012 at 9:30 PM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > Hello Paul,
> > >
> > > Thanks for prompt response, and what you are saying makes perfect
> > > sense, the issue on my side turned out to be more serious. As in my
> > > message below I was thinking server is sending a valid XML response
> > > with (may be) invalid DOCTYPE. Which is not the case.
> > >
> > > The problem seems to be that Synapse is not able to send the complete
> > > message when the server is SSL, which is if we are using an httpS url
> > > instead of plain http. And since server is getting a malformed XML
> > > from synapse it is throwing html-based error back.
> > >
> > > I am wondering whether synapse was tested with https or is there any
> > > special thing I have to configure to support https.
> > >
> >
> > IIRC this was a known bug in the HTTP core version used in old Synapse
> > releases.
> >
> > Thanks,
> > Hiranya
> >
> >
> > >
> > > Thanks,
> > > Abid
> > >
> > > -----Original Message-----
> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > Sent: Wednesday, May 16, 2012 9:43 PM
> > > To: user@synapse.apache.org
> > > Subject: Re: how can I avoid this exception
> > >
> > > Abid
> > >
> > > I'm not an expert on this. Basically the XML parser is behaving as it
> > > *should*. The question is can we get it to behave as it shouldn't :-)
> > >
> > > 1) I think there is a way to tell the StAX parser to ignore the
> DOCTYPE.
> > > I'm not sure if its possible to do this through Synapse into the
> > > underlying StAX parser easily though.
> > >
> > > 2) If you aren't really doing any XML processing you could turn off
> > > parsing completely
> > >
> > > 3) A complete hack I can think of is to use the message relay to parse
> > > this as a binary, hack the message in place to avoid the problem, and
> > > then use the builder mediator.
> > >
> > > Paul
> > >
> > > On Tue, May 15, 2012 at 3:57 PM, Abid Khan <Ab...@jeppesen.com>
> > wrote:
> > >
> > > > I did that; and the response is valid XML but the doctype is
> > > > expected to be something like
> > > >
> > > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML/2.0//EN">
> > > >
> > > > Instead of
> > > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> > > >
> > > >
> > > >
> > > > PS: notice a forward slash before 2.0 in the correct one.
> > > >
> > > > The problem is that it will take very long time to go thru
> > > > build/test cycle of that product, and if I can change that behavior
> > > > in Synapse configuration that would help.
> > > >
> > > > Regards,
> > > > Abid
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > > Sent: Tuesday, May 15, 2012 6:16 AM
> > > > To: user@synapse.apache.org
> > > > Subject: Re: how can I avoid this exception
> > > >
> > > > Abid
> > > >
> > > > A good approach is to put TCPMON in the middle to look at exactly
> > > > what the server is responding to the Synapse engine.
> > > >
> > > > Paul
> > > >
> > > > On Tue, May 15, 2012 at 1:19 AM, Abid Khan <Ab...@jeppesen.com>
> > > wrote:
> > > >
> > > > > Hello all,
> > > > >
> > > > > I am getting following fault from synapse, It looks like the
> > > > > application is sending back an protocol version that synapse
> > > > > cannot accept, is there any way I can avoid this issue?
> > > > >
> > > > >
> > > > > <soapenv:Fault
> > > > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultco
> > > > > de xmlns:tns="http://www.w3.org/2003/05/soap-envelope
> > > > ">tns:Receiver</faultcode><faultstring>org.apache.axis2.AxisFault:
> > > > > org.apache.http.ProtocolException: Not a valid protocol version:
> > > > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
> > > > > 2.0//EN"></faultstring></soapenv:Fault
> > > > >
> > > > >
> > > > > Regards,
> > > > > Abid Khan
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Paul Fremantle
> > > > Co-Founder and CTO, WSO2
> > > > Apache Synapse PMC Chair
> > > > OASIS WS-RX TC Co-chair
> > > >
> > > > blog: http://pzf.fremantle.org
> > > > paul@wso2.com
> > > >
> > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > >
> > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > Co-Founder and CTO, WSO2
> > > Apache Synapse PMC Chair
> > > OASIS WS-RX TC Co-chair
> > >
> > > blog: http://pzf.fremantle.org
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> >
> >
> >
> > --
> > Hiranya Jayathilaka
> > Associate Technical Lead;
> > WSO2 Inc.; http://wso2.org
> > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > Blog: http://techfeast-hiranya.blogspot.com
> >
>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.; http://wso2.org
> E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
--
Sadeep Jayasumana
**
Email: gayansadeep@gmail.com****
Mobile: +61 4 1468 8521
Re: how can I avoid this exception
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Fri, May 18, 2012 at 10:01 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello Hiranya,
>
> That is too bad to hear, we are not in position to move to a later version
> of Synapse, so what is the way out for us, please advise.
>
You can try upgrading HTTP Core to the latest version (v4.1.4 I think).
Thanks,
Hiranya
>
> Thanks
> Abid
>
> -----Original Message-----
> From: Hiranya Jayathilaka [mailto:hiranya911@gmail.com]
> Sent: Thursday, May 17, 2012 12:06 PM
> To: user@synapse.apache.org
> Subject: Re: how can I avoid this exception
>
> On Thu, May 17, 2012 at 9:30 PM, Abid Khan <Ab...@jeppesen.com> wrote:
>
> > Hello Paul,
> >
> > Thanks for prompt response, and what you are saying makes perfect
> > sense, the issue on my side turned out to be more serious. As in my
> > message below I was thinking server is sending a valid XML response
> > with (may be) invalid DOCTYPE. Which is not the case.
> >
> > The problem seems to be that Synapse is not able to send the complete
> > message when the server is SSL, which is if we are using an httpS url
> > instead of plain http. And since server is getting a malformed XML
> > from synapse it is throwing html-based error back.
> >
> > I am wondering whether synapse was tested with https or is there any
> > special thing I have to configure to support https.
> >
>
> IIRC this was a known bug in the HTTP core version used in old Synapse
> releases.
>
> Thanks,
> Hiranya
>
>
> >
> > Thanks,
> > Abid
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Wednesday, May 16, 2012 9:43 PM
> > To: user@synapse.apache.org
> > Subject: Re: how can I avoid this exception
> >
> > Abid
> >
> > I'm not an expert on this. Basically the XML parser is behaving as it
> > *should*. The question is can we get it to behave as it shouldn't :-)
> >
> > 1) I think there is a way to tell the StAX parser to ignore the DOCTYPE.
> > I'm not sure if its possible to do this through Synapse into the
> > underlying StAX parser easily though.
> >
> > 2) If you aren't really doing any XML processing you could turn off
> > parsing completely
> >
> > 3) A complete hack I can think of is to use the message relay to parse
> > this as a binary, hack the message in place to avoid the problem, and
> > then use the builder mediator.
> >
> > Paul
> >
> > On Tue, May 15, 2012 at 3:57 PM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > I did that; and the response is valid XML but the doctype is
> > > expected to be something like
> > >
> > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML/2.0//EN">
> > >
> > > Instead of
> > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> > >
> > >
> > >
> > > PS: notice a forward slash before 2.0 in the correct one.
> > >
> > > The problem is that it will take very long time to go thru
> > > build/test cycle of that product, and if I can change that behavior
> > > in Synapse configuration that would help.
> > >
> > > Regards,
> > > Abid
> > >
> > >
> > > -----Original Message-----
> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > Sent: Tuesday, May 15, 2012 6:16 AM
> > > To: user@synapse.apache.org
> > > Subject: Re: how can I avoid this exception
> > >
> > > Abid
> > >
> > > A good approach is to put TCPMON in the middle to look at exactly
> > > what the server is responding to the Synapse engine.
> > >
> > > Paul
> > >
> > > On Tue, May 15, 2012 at 1:19 AM, Abid Khan <Ab...@jeppesen.com>
> > wrote:
> > >
> > > > Hello all,
> > > >
> > > > I am getting following fault from synapse, It looks like the
> > > > application is sending back an protocol version that synapse
> > > > cannot accept, is there any way I can avoid this issue?
> > > >
> > > >
> > > > <soapenv:Fault
> > > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultco
> > > > de xmlns:tns="http://www.w3.org/2003/05/soap-envelope
> > > ">tns:Receiver</faultcode><faultstring>org.apache.axis2.AxisFault:
> > > > org.apache.http.ProtocolException: Not a valid protocol version:
> > > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
> > > > 2.0//EN"></faultstring></soapenv:Fault
> > > >
> > > >
> > > > Regards,
> > > > Abid Khan
> > > >
> > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > Co-Founder and CTO, WSO2
> > > Apache Synapse PMC Chair
> > > OASIS WS-RX TC Co-chair
> > >
> > > blog: http://pzf.fremantle.org
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> >
> >
> >
> > --
> > Paul Fremantle
> > Co-Founder and CTO, WSO2
> > Apache Synapse PMC Chair
> > OASIS WS-RX TC Co-chair
> >
> > blog: http://pzf.fremantle.org
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.; http://wso2.org
> E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
RE: how can I avoid this exception
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello Hiranya,
That is too bad to hear, we are not in position to move to a later version of Synapse, so what is the way out for us, please advise.
Thanks
Abid
-----Original Message-----
From: Hiranya Jayathilaka [mailto:hiranya911@gmail.com]
Sent: Thursday, May 17, 2012 12:06 PM
To: user@synapse.apache.org
Subject: Re: how can I avoid this exception
On Thu, May 17, 2012 at 9:30 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello Paul,
>
> Thanks for prompt response, and what you are saying makes perfect
> sense, the issue on my side turned out to be more serious. As in my
> message below I was thinking server is sending a valid XML response
> with (may be) invalid DOCTYPE. Which is not the case.
>
> The problem seems to be that Synapse is not able to send the complete
> message when the server is SSL, which is if we are using an httpS url
> instead of plain http. And since server is getting a malformed XML
> from synapse it is throwing html-based error back.
>
> I am wondering whether synapse was tested with https or is there any
> special thing I have to configure to support https.
>
IIRC this was a known bug in the HTTP core version used in old Synapse releases.
Thanks,
Hiranya
>
> Thanks,
> Abid
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Wednesday, May 16, 2012 9:43 PM
> To: user@synapse.apache.org
> Subject: Re: how can I avoid this exception
>
> Abid
>
> I'm not an expert on this. Basically the XML parser is behaving as it
> *should*. The question is can we get it to behave as it shouldn't :-)
>
> 1) I think there is a way to tell the StAX parser to ignore the DOCTYPE.
> I'm not sure if its possible to do this through Synapse into the
> underlying StAX parser easily though.
>
> 2) If you aren't really doing any XML processing you could turn off
> parsing completely
>
> 3) A complete hack I can think of is to use the message relay to parse
> this as a binary, hack the message in place to avoid the problem, and
> then use the builder mediator.
>
> Paul
>
> On Tue, May 15, 2012 at 3:57 PM, Abid Khan <Ab...@jeppesen.com> wrote:
>
> > I did that; and the response is valid XML but the doctype is
> > expected to be something like
> >
> > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML/2.0//EN">
> >
> > Instead of
> > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> >
> >
> >
> > PS: notice a forward slash before 2.0 in the correct one.
> >
> > The problem is that it will take very long time to go thru
> > build/test cycle of that product, and if I can change that behavior
> > in Synapse configuration that would help.
> >
> > Regards,
> > Abid
> >
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Tuesday, May 15, 2012 6:16 AM
> > To: user@synapse.apache.org
> > Subject: Re: how can I avoid this exception
> >
> > Abid
> >
> > A good approach is to put TCPMON in the middle to look at exactly
> > what the server is responding to the Synapse engine.
> >
> > Paul
> >
> > On Tue, May 15, 2012 at 1:19 AM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > Hello all,
> > >
> > > I am getting following fault from synapse, It looks like the
> > > application is sending back an protocol version that synapse
> > > cannot accept, is there any way I can avoid this issue?
> > >
> > >
> > > <soapenv:Fault
> > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultco
> > > de xmlns:tns="http://www.w3.org/2003/05/soap-envelope
> > ">tns:Receiver</faultcode><faultstring>org.apache.axis2.AxisFault:
> > > org.apache.http.ProtocolException: Not a valid protocol version:
> > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
> > > 2.0//EN"></faultstring></soapenv:Fault
> > >
> > >
> > > Regards,
> > > Abid Khan
> > >
> >
> >
> >
> > --
> > Paul Fremantle
> > Co-Founder and CTO, WSO2
> > Apache Synapse PMC Chair
> > OASIS WS-RX TC Co-chair
> >
> > blog: http://pzf.fremantle.org
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
>
>
>
> --
> Paul Fremantle
> Co-Founder and CTO, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
Re: how can I avoid this exception
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Thu, May 17, 2012 at 9:30 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello Paul,
>
> Thanks for prompt response, and what you are saying makes perfect sense,
> the issue on my side turned out to be more serious. As in my message below
> I was thinking server is sending a valid XML response with (may be) invalid
> DOCTYPE. Which is not the case.
>
> The problem seems to be that Synapse is not able to send the complete
> message when the server is SSL, which is if we are using an httpS url
> instead of plain http. And since server is getting a malformed XML from
> synapse it is throwing html-based error back.
>
> I am wondering whether synapse was tested with https or is there any
> special thing I have to configure to support https.
>
IIRC this was a known bug in the HTTP core version used in old Synapse
releases.
Thanks,
Hiranya
>
> Thanks,
> Abid
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Wednesday, May 16, 2012 9:43 PM
> To: user@synapse.apache.org
> Subject: Re: how can I avoid this exception
>
> Abid
>
> I'm not an expert on this. Basically the XML parser is behaving as it
> *should*. The question is can we get it to behave as it shouldn't :-)
>
> 1) I think there is a way to tell the StAX parser to ignore the DOCTYPE.
> I'm not sure if its possible to do this through Synapse into the
> underlying StAX parser easily though.
>
> 2) If you aren't really doing any XML processing you could turn off
> parsing completely
>
> 3) A complete hack I can think of is to use the message relay to parse
> this as a binary, hack the message in place to avoid the problem, and then
> use the builder mediator.
>
> Paul
>
> On Tue, May 15, 2012 at 3:57 PM, Abid Khan <Ab...@jeppesen.com> wrote:
>
> > I did that; and the response is valid XML but the doctype is expected
> > to be something like
> >
> > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML/2.0//EN">
> >
> > Instead of
> > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> >
> >
> >
> > PS: notice a forward slash before 2.0 in the correct one.
> >
> > The problem is that it will take very long time to go thru build/test
> > cycle of that product, and if I can change that behavior in Synapse
> > configuration that would help.
> >
> > Regards,
> > Abid
> >
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Tuesday, May 15, 2012 6:16 AM
> > To: user@synapse.apache.org
> > Subject: Re: how can I avoid this exception
> >
> > Abid
> >
> > A good approach is to put TCPMON in the middle to look at exactly what
> > the server is responding to the Synapse engine.
> >
> > Paul
> >
> > On Tue, May 15, 2012 at 1:19 AM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > Hello all,
> > >
> > > I am getting following fault from synapse, It looks like the
> > > application is sending back an protocol version that synapse cannot
> > > accept, is there any way I can avoid this issue?
> > >
> > >
> > > <soapenv:Fault
> > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultcode
> > > xmlns:tns="http://www.w3.org/2003/05/soap-envelope
> > ">tns:Receiver</faultcode><faultstring>org.apache.axis2.AxisFault:
> > > org.apache.http.ProtocolException: Not a valid protocol version:
> > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
> > > 2.0//EN"></faultstring></soapenv:Fault
> > >
> > >
> > > Regards,
> > > Abid Khan
> > >
> >
> >
> >
> > --
> > Paul Fremantle
> > Co-Founder and CTO, WSO2
> > Apache Synapse PMC Chair
> > OASIS WS-RX TC Co-chair
> >
> > blog: http://pzf.fremantle.org
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
>
>
>
> --
> Paul Fremantle
> Co-Founder and CTO, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
RE: how can I avoid this exception
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello Paul,
Thanks for prompt response, and what you are saying makes perfect sense, the issue on my side turned out to be more serious. As in my message below I was thinking server is sending a valid XML response with (may be) invalid DOCTYPE. Which is not the case.
The problem seems to be that Synapse is not able to send the complete message when the server is SSL, which is if we are using an httpS url instead of plain http. And since server is getting a malformed XML from synapse it is throwing html-based error back.
I am wondering whether synapse was tested with https or is there any special thing I have to configure to support https.
Thanks,
Abid
-----Original Message-----
From: Paul Fremantle [mailto:pzfreo@gmail.com]
Sent: Wednesday, May 16, 2012 9:43 PM
To: user@synapse.apache.org
Subject: Re: how can I avoid this exception
Abid
I'm not an expert on this. Basically the XML parser is behaving as it *should*. The question is can we get it to behave as it shouldn't :-)
1) I think there is a way to tell the StAX parser to ignore the DOCTYPE.
I'm not sure if its possible to do this through Synapse into the underlying StAX parser easily though.
2) If you aren't really doing any XML processing you could turn off parsing completely
3) A complete hack I can think of is to use the message relay to parse this as a binary, hack the message in place to avoid the problem, and then use the builder mediator.
Paul
On Tue, May 15, 2012 at 3:57 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> I did that; and the response is valid XML but the doctype is expected
> to be something like
>
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML/2.0//EN">
>
> Instead of
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>
>
>
> PS: notice a forward slash before 2.0 in the correct one.
>
> The problem is that it will take very long time to go thru build/test
> cycle of that product, and if I can change that behavior in Synapse
> configuration that would help.
>
> Regards,
> Abid
>
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Tuesday, May 15, 2012 6:16 AM
> To: user@synapse.apache.org
> Subject: Re: how can I avoid this exception
>
> Abid
>
> A good approach is to put TCPMON in the middle to look at exactly what
> the server is responding to the Synapse engine.
>
> Paul
>
> On Tue, May 15, 2012 at 1:19 AM, Abid Khan <Ab...@jeppesen.com> wrote:
>
> > Hello all,
> >
> > I am getting following fault from synapse, It looks like the
> > application is sending back an protocol version that synapse cannot
> > accept, is there any way I can avoid this issue?
> >
> >
> > <soapenv:Fault
> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultcode
> > xmlns:tns="http://www.w3.org/2003/05/soap-envelope
> ">tns:Receiver</faultcode><faultstring>org.apache.axis2.AxisFault:
> > org.apache.http.ProtocolException: Not a valid protocol version:
> > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
> > 2.0//EN"></faultstring></soapenv:Fault
> >
> >
> > Regards,
> > Abid Khan
> >
>
>
>
> --
> Paul Fremantle
> Co-Founder and CTO, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
--
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
Re: how can I avoid this exception
Posted by Paul Fremantle <pz...@gmail.com>.
Abid
I'm not an expert on this. Basically the XML parser is behaving as it
*should*. The question is can we get it to behave as it shouldn't :-)
1) I think there is a way to tell the StAX parser to ignore the DOCTYPE.
I'm not sure if its possible to do this through Synapse into the underlying
StAX parser easily though.
2) If you aren't really doing any XML processing you could turn off parsing
completely
3) A complete hack I can think of is to use the message relay to parse this
as a binary, hack the message in place to avoid the problem, and then use
the builder mediator.
Paul
On Tue, May 15, 2012 at 3:57 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> I did that; and the response is valid XML but the doctype is expected to
> be something like
>
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML/2.0//EN">
>
> Instead of
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>
>
>
> PS: notice a forward slash before 2.0 in the correct one.
>
> The problem is that it will take very long time to go thru build/test
> cycle of that product, and if I can change that behavior in Synapse
> configuration that would help.
>
> Regards,
> Abid
>
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Tuesday, May 15, 2012 6:16 AM
> To: user@synapse.apache.org
> Subject: Re: how can I avoid this exception
>
> Abid
>
> A good approach is to put TCPMON in the middle to look at exactly what the
> server is responding to the Synapse engine.
>
> Paul
>
> On Tue, May 15, 2012 at 1:19 AM, Abid Khan <Ab...@jeppesen.com> wrote:
>
> > Hello all,
> >
> > I am getting following fault from synapse, It looks like the
> > application is sending back an protocol version that synapse cannot
> > accept, is there any way I can avoid this issue?
> >
> >
> > <soapenv:Fault
> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultcode
> > xmlns:tns="http://www.w3.org/2003/05/soap-envelope
> ">tns:Receiver</faultcode><faultstring>org.apache.axis2.AxisFault:
> > org.apache.http.ProtocolException: Not a valid protocol version:
> > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
> > 2.0//EN"></faultstring></soapenv:Fault
> >
> >
> > Regards,
> > Abid Khan
> >
>
>
>
> --
> Paul Fremantle
> Co-Founder and CTO, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
--
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
RE: how can I avoid this exception
Posted by Abid Khan <Ab...@jeppesen.com>.
I did that; and the response is valid XML but the doctype is expected to be something like
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML/2.0//EN">
Instead of
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
PS: notice a forward slash before 2.0 in the correct one.
The problem is that it will take very long time to go thru build/test cycle of that product, and if I can change that behavior in Synapse configuration that would help.
Regards,
Abid
-----Original Message-----
From: Paul Fremantle [mailto:pzfreo@gmail.com]
Sent: Tuesday, May 15, 2012 6:16 AM
To: user@synapse.apache.org
Subject: Re: how can I avoid this exception
Abid
A good approach is to put TCPMON in the middle to look at exactly what the server is responding to the Synapse engine.
Paul
On Tue, May 15, 2012 at 1:19 AM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello all,
>
> I am getting following fault from synapse, It looks like the
> application is sending back an protocol version that synapse cannot
> accept, is there any way I can avoid this issue?
>
>
> <soapenv:Fault
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultcode
> xmlns:tns="http://www.w3.org/2003/05/soap-envelope">tns:Receiver</faultcode><faultstring>org.apache.axis2.AxisFault:
> org.apache.http.ProtocolException: Not a valid protocol version:
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
> 2.0//EN"></faultstring></soapenv:Fault
>
>
> Regards,
> Abid Khan
>
--
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
Re: how can I avoid this exception
Posted by Paul Fremantle <pz...@gmail.com>.
Abid
A good approach is to put TCPMON in the middle to look at exactly what the
server is responding to the Synapse engine.
Paul
On Tue, May 15, 2012 at 1:19 AM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello all,
>
> I am getting following fault from synapse, It looks like the application
> is sending back an protocol version that synapse cannot accept, is there
> any way I can avoid this issue?
>
>
> <soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultcode
> xmlns:tns="http://www.w3.org/2003/05/soap-envelope">tns:Receiver</faultcode><faultstring>org.apache.axis2.AxisFault:
> org.apache.http.ProtocolException: Not a valid protocol version:
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
> 2.0//EN"></faultstring></soapenv:Fault
>
>
> Regards,
> Abid Khan
>
--
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
how can I avoid this exception
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello all,
I am getting following fault from synapse, It looks like the application is sending back an protocol version that synapse cannot accept, is there any way I can avoid this issue?
<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultcode xmlns:tns="http://www.w3.org/2003/05/soap-envelope">tns:Receiver</faultcode><faultstring>org.apache.axis2.AxisFault: org.apache.http.ProtocolException: Not a valid protocol version: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"></faultstring></soapenv:Fault
Regards,
Abid Khan
Re: Synapse and gzip encoding.
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Tue, May 1, 2012 at 10:56 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello all,
>
> I am sending message to synapse with http header named "Accept-Encoding"
> with value "gzip, deflate" and synapse seems to be "gzipping" some of the
> message not all.
>
> Could you please help what is the reason?
>
Setting the Accept-Encoding header to "gzip" doesn't imply that server
should always gzip the responses. It's only a hint to the server that
client is capable of handling gzipped content. It's up to the server to
decide whether to actually gzip the response or not. HTTP spec also
mandates that all HTTP clients be able to handle the identity encoding
(that is no particular encoding) at all times. Therefore the server
(Synapse in this case) can send the responses uncompressed whenever it
wants.
IIRC, the way this is implemented in Synapse is that, if the response from
the backend server is gzipped, Synapse will send a gzipped response back to
the client.
Thanks,
Hiranya
>
> Regards,
> Abid
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
Synapse and gzip encoding.
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello all,
I am sending message to synapse with http header named "Accept-Encoding" with value "gzip, deflate" and synapse seems to be "gzipping" some of the message not all.
Could you please help what is the reason?
Regards,
Abid
Re: Send mediator and HTTP 500 errors?
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Property name: HTTP_SC
Scope: axis2
eg:
<filter source="$axis2:HTTP_SC" regex="500">
...
</filter>
Thanks,
Hiranya
On Mon, Apr 16, 2012 at 7:15 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello all,
>
> Is there any way I can find if the <send> mediator received a 5XX error
> from the endpoint?
>
> Thanks
> Abid
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
Send mediator and HTTP 500 errors?
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello all,
Is there any way I can find if the <send> mediator received a 5XX error from the endpoint?
Thanks
Abid
Re: Custom Mediator
Posted by Ruwan Linton <ru...@gmail.com>.
Basically you just need to specify the class name of the custom mediator in
the class configuration, and optionally, if you want to configure any fields
of the custom mediator, use the properties.
Ruwan
On Wed, Aug 3, 2011 at 3:06 PM, Ruwan Linton <ru...@gmail.com> wrote:
> Ooohh, I'm sorry.
>
> Here is the link.
>
> http://wso2.org/library/2898
>
> Thanks,
> Ruwan
>
>
> On Wed, Aug 3, 2011 at 2:58 PM, De Vleeschauwer Nele <
> Nele.DeVleeschauwer@nbb.be> wrote:
>
>> Hi,
>>
>> I want to use the class mediator... Inside your previous post, there is
>> 2 times the same URL... Could you sent also the url for the second
>> article ?
>>
>> Thanks !
>>
>> -----Original Message-----
>> From: Ruwan Linton [mailto:ruwan.linton@gmail.com]
>> Sent: woensdag 3 augustus 2011 11:16
>> To: user@synapse.apache.org
>> Subject: Re: Custom Mediator
>>
>> The answer to your question depends on how you want the custom mediator
>> that
>> you wrote to be configured.
>>
>> That is, if you want a custom configuration for the mediator to be used
>> in a
>> sequence, like follows;
>>
>> <foo name="bar" blah="abc"/>
>>
>> Then you need to write a MediatorFactory and a MediatorSerializer to
>> support
>> the XML configuration. If not you can use the class mediator in synapse
>> to
>> call the custom mediator you wrote.
>>
>> You may find the following 2 articles useful;
>>
>> http://wso2.org/library/2936
>> http://wso2.org/library/2936
>>
>> While the first one describes the former approach where you can use the
>> class mediator to call the custom mediator you wrote, the second article
>> walks you through the first approach of giving a custom configuration to
>> it.
>>
>> Ruwan
>>
>> On Wed, Aug 3, 2011 at 2:19 PM, De Vleeschauwer Nele <
>> Nele.DeVleeschauwer@nbb.be> wrote:
>>
>> > Hi,
>> >
>> > I've just created my own custom mediator class (based on the
>> > org.apache.synapse.Mediator interface), but it's not quite clear to me
>> > how I should proceed further. Should I configure this class somewhere
>> > before I can use it in one of my proxy services ?
>> >
>> > Any help is welcome...
>> >
>> >
>> >
>> > -----------------------------------------
>> > Visit our website! http://www.nbb.be
>> >
>> > "DISCLAIMER: The content of this e-mail message should not be
>> > construed as binding on the part of the National Bank of Belgium
>> > (NBB) unless otherwise and previously stated. The opinions
>> > expressed in this message are solely those of the author and do not
>> > necessarily reflect NBB viewpoints, particularly when the content
>> > of this message, or part thereof, is private by nature or does not
>> > fall within the professional scope of its author."
>>
>>
>>
>>
>> --
>> Ruwan Linton
>> Member, Apache Software Foundation; http://www.apache.org
>> <http://wso2.org>
>>
>> phone: +94 11 282 7532
>> email: ruwan@blindvision.org; cell: +94 77 341 3097
>> blog: http://blog.ruwan.org
>> linkedin: http://www.linkedin.com/in/ruwanlinton
>> google: http://www.google.com/profiles/ruwan.linton
>> tweet: http://twitter.com/ruwanlinton
>>
>
>
>
> --
> Ruwan Linton
> Member, Apache Software Foundation; http://www.apache.org
> <http://wso2.org>
>
> phone: +94 11 282 7532
> email: ruwan@blindvision.org; cell: +94 77 341 3097
> blog: http://blog.ruwan.org
> linkedin: http://www.linkedin.com/in/ruwanlinton
> google: http://www.google.com/profiles/ruwan.linton
> tweet: http://twitter.com/ruwanlinton
>
>
--
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
<http://wso2.org>
phone: +94 11 282 7532
email: ruwan@blindvision.org; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton
RE: Help needed for endpoint level content type.
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello Sadeep,
I tried this, and several others. It look either synapse or axis2 is completely ignoring those properties. No matter what I set I always get "application/xml".
So there may be a bug somewhere or this is by design. The content type are always posted as "application/xml"
-----Original Message-----
From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
Sent: Tuesday, January 24, 2012 11:23 AM
To: user@synapse.apache.org
Subject: Re: Help needed for endpoint level content type.
Hi,
You can set these properties conditionally within your CBR logic. Please
check whether it works for you.
Eg:
<proxy name="CBRProxy">
<target>
<inSequence>
<switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="
http://services.samples">
<case regex="IBM">
<!-- Send with text/xml content type to endpoint 1 -->
<property name="messageType" value="text/xml"
scope="axis2"/>
<property name="ContentType" value="text/xml"
scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint1" />
</endpoint>
</send>
</case>
<case regex="MSFT">
<!-- Send with application/xml content type to endpoint 2
-->
<property name="messageType" value="application/xml"
scope="axis2"/>
<property name="ContentType" value="application/xml"
scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint2" />
</endpoint>
</send>
</case>
</switch>
</inSequence>
</target>
</proxy>
Thanks,
Sadeep
On Tue, Jan 24, 2012 at 9:14 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello Sadeep,
>
> Thanks for the quicker response.
>
> I actually knew this approach, but my problem is multiple application send
> request to same proxy. That same proxy is delivering message (using content
> based routing) to different endpoints.
>
> One of those endpoint expects "Content-Type=text/xml", where as rest of
> them expect "Content-Type=application/xml".
>
> Having said that I need something in the endpoint not in the proxy.
>
> Thanks,
> Abid
>
>
>
> -----Original Message-----
> From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
> Sent: Tuesday, January 24, 2012 12:52 AM
> To: user@synapse.apache.org
> Subject: Re: Help needed for endpoint level content type.
>
> Hi,
>
> You can force the content type while sending a message out using
> "messageType" and "ContentType" Axis2 level properties. Please check
> whether this works for your scenario. This might not work if the message
> content is not compatible with the formatter associated to the content type
> you are forcibly setting.
>
> ..
> ..
> <property name="messageType" value="text/xml" scope="axis2"/>
> <property name="ContentType" value="text/xml" scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint1" />
> </endpoint>
> </send>
>
> AND
>
> ..
> ..
> <property name="messageType" value="application/xml" scope="axis2"/>
> <property name="ContentType" value="application/xml" scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint2" />
> </endpoint>
> </send>
>
> Thanks,
> Sadeep
>
> On Tue, Jan 24, 2012 at 9:47 AM, Hiranya Jayathilaka
> <hi...@gmail.com>wrote:
>
> > I believe these endpoints are being invoked through some proxy service.
> If
> > so what is the content type of the requests sent to the proxy service?
> >
> > Thanks,
> > Hiranya
> >
> > On Tue, Jan 24, 2012 at 7:03 AM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > Hello all,
> > >
> > > Please help me in following scenario. (I am using synapse 1.2)
> > >
> > > I have two different endpoint, the application on one endpoint accepts
> > > "Content-Type=application/xml", and second application on the other
> > > endpoint accepts "Content-Type=text/xml".
> > >
> > > Those application are external application and are running for several
> > > years, is there any way I can configure Synapse to send content type
> > > properly to their respective endpoint.
> > >
> > > A prompt response will be much appreciated.
> > >
> > > Regards,
> > > Abid
> > >
> >
> >
> >
> > --
> > Hiranya Jayathilaka
> > Associate Technical Lead;
> > WSO2 Inc.; http://wso2.org
> > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > Blog: http://techfeast-hiranya.blogspot.com
> >
>
>
>
> --
>
> Sadeep Jayasumana****
>
> Email: gayansadeep@gmail.com****
>
> Phone: +94-77-2266507
>
--
Sadeep Jayasumana****
Email: gayansadeep@gmail.com****
Phone: +94-77-2266507
Re: Help needed for endpoint level content type.
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Fri, Jan 27, 2012 at 10:03 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello all,
>
> I have tried all options, I do need to change the content-type to
> "text/xml". And I do neet a quick resolution to this.
>
Setting ContentType property works, at least in the recent releases (2.0,
2.1). This is how the Content-type header is set on outgoing messages (in
Axis2HttpRequest class):
httpRequest.setHeader(
HTTP.CONTENT_TYPE,
messageFormatter.getContentType(msgContext,
format, msgContext.getSoapAction()));
In your case messageFormatter will be set to the ApplicationXMLFormatter
(from Axis2). This formatter looks at the ContentType property to determine
the content type of the message. So if you have set the property it will
get picked up. Not sure how it used to work back in the days of Synapse 1.2.
Thanks,
Hiranya
>
> Can anyone please point me to right direction.
>
> Thanks in advance,
> Abid
>
>
>
>
>
> -----Original Message-----
> From: Abid Khan
> Sent: Tuesday, January 24, 2012 4:02 PM
> To: user@synapse.apache.org
> Subject: RE: Help needed for endpoint level content type.
>
> Hello Sadeep,
>
> I tried this, and several others. It look either synapse or axis2 is
> completely ignoring those properties. No matter what I set I always get
> "application/xml".
>
> So there may be a bug somewhere or this is by design. The content type are
> always posted as "application/xml"
>
>
> -----Original Message-----
> From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
> Sent: Tuesday, January 24, 2012 11:23 AM
> To: user@synapse.apache.org
> Subject: Re: Help needed for endpoint level content type.
>
> Hi,
>
> You can set these properties conditionally within your CBR logic. Please
> check whether it works for you.
>
> Eg:
> <proxy name="CBRProxy">
> <target>
> <inSequence>
> <switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="
> http://services.samples">
> <case regex="IBM">
> <!-- Send with text/xml content type to endpoint 1 -->
> <property name="messageType" value="text/xml"
> scope="axis2"/>
> <property name="ContentType" value="text/xml"
> scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint1" />
> </endpoint>
> </send>
> </case>
> <case regex="MSFT">
> <!-- Send with application/xml content type to endpoint 2
> -->
> <property name="messageType" value="application/xml"
> scope="axis2"/>
> <property name="ContentType" value="application/xml"
> scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint2" />
> </endpoint>
> </send>
> </case>
> </switch>
> </inSequence>
> </target>
> </proxy>
>
> Thanks,
> Sadeep
>
> On Tue, Jan 24, 2012 at 9:14 PM, Abid Khan <Ab...@jeppesen.com> wrote:
>
> > Hello Sadeep,
> >
> > Thanks for the quicker response.
> >
> > I actually knew this approach, but my problem is multiple application
> send
> > request to same proxy. That same proxy is delivering message (using
> content
> > based routing) to different endpoints.
> >
> > One of those endpoint expects "Content-Type=text/xml", where as rest of
> > them expect "Content-Type=application/xml".
> >
> > Having said that I need something in the endpoint not in the proxy.
> >
> > Thanks,
> > Abid
> >
> >
> >
> > -----Original Message-----
> > From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
> > Sent: Tuesday, January 24, 2012 12:52 AM
> > To: user@synapse.apache.org
> > Subject: Re: Help needed for endpoint level content type.
> >
> > Hi,
> >
> > You can force the content type while sending a message out using
> > "messageType" and "ContentType" Axis2 level properties. Please check
> > whether this works for your scenario. This might not work if the message
> > content is not compatible with the formatter associated to the content
> type
> > you are forcibly setting.
> >
> > ..
> > ..
> > <property name="messageType" value="text/xml" scope="axis2"/>
> > <property name="ContentType" value="text/xml" scope="axis2"/>
> > <send>
> > <endpoint>
> > <address uri="http://localhost:9000/endpoint1" />
> > </endpoint>
> > </send>
> >
> > AND
> >
> > ..
> > ..
> > <property name="messageType" value="application/xml" scope="axis2"/>
> > <property name="ContentType" value="application/xml" scope="axis2"/>
> > <send>
> > <endpoint>
> > <address uri="http://localhost:9000/endpoint2" />
> > </endpoint>
> > </send>
> >
> > Thanks,
> > Sadeep
> >
> > On Tue, Jan 24, 2012 at 9:47 AM, Hiranya Jayathilaka
> > <hi...@gmail.com>wrote:
> >
> > > I believe these endpoints are being invoked through some proxy service.
> > If
> > > so what is the content type of the requests sent to the proxy service?
> > >
> > > Thanks,
> > > Hiranya
> > >
> > > On Tue, Jan 24, 2012 at 7:03 AM, Abid Khan <Ab...@jeppesen.com>
> > wrote:
> > >
> > > > Hello all,
> > > >
> > > > Please help me in following scenario. (I am using synapse 1.2)
> > > >
> > > > I have two different endpoint, the application on one endpoint
> accepts
> > > > "Content-Type=application/xml", and second application on the other
> > > > endpoint accepts "Content-Type=text/xml".
> > > >
> > > > Those application are external application and are running for
> several
> > > > years, is there any way I can configure Synapse to send content type
> > > > properly to their respective endpoint.
> > > >
> > > > A prompt response will be much appreciated.
> > > >
> > > > Regards,
> > > > Abid
> > > >
> > >
> > >
> > >
> > > --
> > > Hiranya Jayathilaka
> > > Associate Technical Lead;
> > > WSO2 Inc.; http://wso2.org
> > > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > > Blog: http://techfeast-hiranya.blogspot.com
> > >
> >
> >
> >
> > --
> >
> > Sadeep Jayasumana****
> >
> > Email: gayansadeep@gmail.com****
> >
> > Phone: +94-77-2266507
> >
>
>
>
> --
>
> Sadeep Jayasumana****
>
> Email: gayansadeep@gmail.com****
>
> Phone: +94-77-2266507
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
RE: Help needed for endpoint level content type.
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello all,
I have tried all options, I do need to change the content-type to "text/xml". And I do neet a quick resolution to this.
Can anyone please point me to right direction.
Thanks in advance,
Abid
-----Original Message-----
From: Abid Khan
Sent: Tuesday, January 24, 2012 4:02 PM
To: user@synapse.apache.org
Subject: RE: Help needed for endpoint level content type.
Hello Sadeep,
I tried this, and several others. It look either synapse or axis2 is completely ignoring those properties. No matter what I set I always get "application/xml".
So there may be a bug somewhere or this is by design. The content type are always posted as "application/xml"
-----Original Message-----
From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
Sent: Tuesday, January 24, 2012 11:23 AM
To: user@synapse.apache.org
Subject: Re: Help needed for endpoint level content type.
Hi,
You can set these properties conditionally within your CBR logic. Please
check whether it works for you.
Eg:
<proxy name="CBRProxy">
<target>
<inSequence>
<switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="
http://services.samples">
<case regex="IBM">
<!-- Send with text/xml content type to endpoint 1 -->
<property name="messageType" value="text/xml"
scope="axis2"/>
<property name="ContentType" value="text/xml"
scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint1" />
</endpoint>
</send>
</case>
<case regex="MSFT">
<!-- Send with application/xml content type to endpoint 2
-->
<property name="messageType" value="application/xml"
scope="axis2"/>
<property name="ContentType" value="application/xml"
scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint2" />
</endpoint>
</send>
</case>
</switch>
</inSequence>
</target>
</proxy>
Thanks,
Sadeep
On Tue, Jan 24, 2012 at 9:14 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello Sadeep,
>
> Thanks for the quicker response.
>
> I actually knew this approach, but my problem is multiple application send
> request to same proxy. That same proxy is delivering message (using content
> based routing) to different endpoints.
>
> One of those endpoint expects "Content-Type=text/xml", where as rest of
> them expect "Content-Type=application/xml".
>
> Having said that I need something in the endpoint not in the proxy.
>
> Thanks,
> Abid
>
>
>
> -----Original Message-----
> From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
> Sent: Tuesday, January 24, 2012 12:52 AM
> To: user@synapse.apache.org
> Subject: Re: Help needed for endpoint level content type.
>
> Hi,
>
> You can force the content type while sending a message out using
> "messageType" and "ContentType" Axis2 level properties. Please check
> whether this works for your scenario. This might not work if the message
> content is not compatible with the formatter associated to the content type
> you are forcibly setting.
>
> ..
> ..
> <property name="messageType" value="text/xml" scope="axis2"/>
> <property name="ContentType" value="text/xml" scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint1" />
> </endpoint>
> </send>
>
> AND
>
> ..
> ..
> <property name="messageType" value="application/xml" scope="axis2"/>
> <property name="ContentType" value="application/xml" scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint2" />
> </endpoint>
> </send>
>
> Thanks,
> Sadeep
>
> On Tue, Jan 24, 2012 at 9:47 AM, Hiranya Jayathilaka
> <hi...@gmail.com>wrote:
>
> > I believe these endpoints are being invoked through some proxy service.
> If
> > so what is the content type of the requests sent to the proxy service?
> >
> > Thanks,
> > Hiranya
> >
> > On Tue, Jan 24, 2012 at 7:03 AM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > Hello all,
> > >
> > > Please help me in following scenario. (I am using synapse 1.2)
> > >
> > > I have two different endpoint, the application on one endpoint accepts
> > > "Content-Type=application/xml", and second application on the other
> > > endpoint accepts "Content-Type=text/xml".
> > >
> > > Those application are external application and are running for several
> > > years, is there any way I can configure Synapse to send content type
> > > properly to their respective endpoint.
> > >
> > > A prompt response will be much appreciated.
> > >
> > > Regards,
> > > Abid
> > >
> >
> >
> >
> > --
> > Hiranya Jayathilaka
> > Associate Technical Lead;
> > WSO2 Inc.; http://wso2.org
> > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > Blog: http://techfeast-hiranya.blogspot.com
> >
>
>
>
> --
>
> Sadeep Jayasumana****
>
> Email: gayansadeep@gmail.com****
>
> Phone: +94-77-2266507
>
--
Sadeep Jayasumana****
Email: gayansadeep@gmail.com****
Phone: +94-77-2266507
Re: Help needed for endpoint level content type.
Posted by Sadeep Jayasumana <ga...@gmail.com>.
I came across the same problem sometime back. I was trying to connect to a
legacy server which accepts POX messages with "text/xml" content type.
Clearly it was some imperfection of the backend server, but I did not have
control over that since it was a legacy server.
However, I was able to resolve the problem by commenting out the code block
Abid has posted. Meaning, I went on the same path and got it working. But
I'm not sure whether this breaks something that I have not tested.
Thanks,
Sadeep
On Tue, Jan 31, 2012 at 12:23 PM, Hiranya Jayathilaka
<hi...@gmail.com>wrote:
> "text/xml" is the standard content type for SOAP 1.1. So if you try to send
> a POX message with text/xml content type the formatter will change that
> back to application/xml. I don't think changing this behavior will break
> something though (fingers crossed on that :)).
>
> Thanks,
> Hiranya
>
> On Tue, Jan 31, 2012 at 12:08 AM, Abid Khan <Ab...@jeppesen.com>
> wrote:
>
> > Hello all,
> >
> > Please look at the following code and tell me why this code is explicitly
> > changing contentType from "text/xml" to "application/xml"?
> >
> > This issue is because this kind of code in ApplicationXMLFormatter,
> >
> > if (contentType == null) {
> > contentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
> > } else if (isSOAPContentType(contentType)) {
> > contentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
> > if (log.isDebugEnabled()) {
> > log.debug("contentType is set incorrectly for Application
> > XML.");
> > log.debug("It is changed to " + contentType);
> > }
> > }
> >
> > Along with function in
> >
> >
> > private boolean isSOAPContentType(String contentType) {
> > if (JavaUtils.indexOfIgnoreCase(contentType,
> > SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
> > return true;
> > }
> > // search for "type=text/xml"
> > else if (JavaUtils.indexOfIgnoreCase(contentType,
> >
> > SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
> > return true;
> > }
> > return false;
> > }
> >
> > This code is explicitly changing the content type to "application/xml" if
> > it is "text/xml"
> >
> > I would like to know if changing this code would have any negative
> impacts.
> >
> > Regards,
> > Abid
> >
> > -----Original Message-----
> > From: Abid Khan
> > Sent: Friday, January 27, 2012 9:34 AM
> > To: 'user@synapse.apache.org'
> > Subject: RE: Help needed for endpoint level content type.
> >
> > Hello all,
> >
> > I have tried all options, I do need to change the content-type to
> > "text/xml". And I do neet a quick resolution to this.
> >
> > Can anyone please point me to right direction.
> >
> > Thanks in advance,
> > Abid
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Abid Khan
> > Sent: Tuesday, January 24, 2012 4:02 PM
> > To: user@synapse.apache.org
> > Subject: RE: Help needed for endpoint level content type.
> >
> > Hello Sadeep,
> >
> > I tried this, and several others. It look either synapse or axis2 is
> > completely ignoring those properties. No matter what I set I always get
> > "application/xml".
> >
> > So there may be a bug somewhere or this is by design. The content type
> are
> > always posted as "application/xml"
> >
> >
> > -----Original Message-----
> > From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
> > Sent: Tuesday, January 24, 2012 11:23 AM
> > To: user@synapse.apache.org
> > Subject: Re: Help needed for endpoint level content type.
> >
> > Hi,
> >
> > You can set these properties conditionally within your CBR logic. Please
> > check whether it works for you.
> >
> > Eg:
> > <proxy name="CBRProxy">
> > <target>
> > <inSequence>
> > <switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="
> > http://services.samples">
> > <case regex="IBM">
> > <!-- Send with text/xml content type to endpoint 1 -->
> > <property name="messageType" value="text/xml"
> > scope="axis2"/>
> > <property name="ContentType" value="text/xml"
> > scope="axis2"/>
> > <send>
> > <endpoint>
> > <address uri="http://localhost:9000/endpoint1"
> />
> > </endpoint>
> > </send>
> > </case>
> > <case regex="MSFT">
> > <!-- Send with application/xml content type to endpoint
> 2
> > -->
> > <property name="messageType" value="application/xml"
> > scope="axis2"/>
> > <property name="ContentType" value="application/xml"
> > scope="axis2"/>
> > <send>
> > <endpoint>
> > <address uri="http://localhost:9000/endpoint2"
> />
> > </endpoint>
> > </send>
> > </case>
> > </switch>
> > </inSequence>
> > </target>
> > </proxy>
> >
> > Thanks,
> > Sadeep
> >
> > On Tue, Jan 24, 2012 at 9:14 PM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > Hello Sadeep,
> > >
> > > Thanks for the quicker response.
> > >
> > > I actually knew this approach, but my problem is multiple application
> > send
> > > request to same proxy. That same proxy is delivering message (using
> > content
> > > based routing) to different endpoints.
> > >
> > > One of those endpoint expects "Content-Type=text/xml", where as rest of
> > > them expect "Content-Type=application/xml".
> > >
> > > Having said that I need something in the endpoint not in the proxy.
> > >
> > > Thanks,
> > > Abid
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
> > > Sent: Tuesday, January 24, 2012 12:52 AM
> > > To: user@synapse.apache.org
> > > Subject: Re: Help needed for endpoint level content type.
> > >
> > > Hi,
> > >
> > > You can force the content type while sending a message out using
> > > "messageType" and "ContentType" Axis2 level properties. Please check
> > > whether this works for your scenario. This might not work if the
> message
> > > content is not compatible with the formatter associated to the content
> > type
> > > you are forcibly setting.
> > >
> > > ..
> > > ..
> > > <property name="messageType" value="text/xml" scope="axis2"/>
> > > <property name="ContentType" value="text/xml" scope="axis2"/>
> > > <send>
> > > <endpoint>
> > > <address uri="http://localhost:9000/endpoint1" />
> > > </endpoint>
> > > </send>
> > >
> > > AND
> > >
> > > ..
> > > ..
> > > <property name="messageType" value="application/xml"
> scope="axis2"/>
> > > <property name="ContentType" value="application/xml"
> scope="axis2"/>
> > > <send>
> > > <endpoint>
> > > <address uri="http://localhost:9000/endpoint2" />
> > > </endpoint>
> > > </send>
> > >
> > > Thanks,
> > > Sadeep
> > >
> > > On Tue, Jan 24, 2012 at 9:47 AM, Hiranya Jayathilaka
> > > <hi...@gmail.com>wrote:
> > >
> > > > I believe these endpoints are being invoked through some proxy
> service.
> > > If
> > > > so what is the content type of the requests sent to the proxy
> service?
> > > >
> > > > Thanks,
> > > > Hiranya
> > > >
> > > > On Tue, Jan 24, 2012 at 7:03 AM, Abid Khan <Ab...@jeppesen.com>
> > > wrote:
> > > >
> > > > > Hello all,
> > > > >
> > > > > Please help me in following scenario. (I am using synapse 1.2)
> > > > >
> > > > > I have two different endpoint, the application on one endpoint
> > accepts
> > > > > "Content-Type=application/xml", and second application on the other
> > > > > endpoint accepts "Content-Type=text/xml".
> > > > >
> > > > > Those application are external application and are running for
> > several
> > > > > years, is there any way I can configure Synapse to send content
> type
> > > > > properly to their respective endpoint.
> > > > >
> > > > > A prompt response will be much appreciated.
> > > > >
> > > > > Regards,
> > > > > Abid
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Hiranya Jayathilaka
> > > > Associate Technical Lead;
> > > > WSO2 Inc.; http://wso2.org
> > > > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > > > Blog: http://techfeast-hiranya.blogspot.com
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > Sadeep Jayasumana****
> > >
> > > Email: gayansadeep@gmail.com****
> > >
> > > Phone: +94-77-2266507
> > >
> >
> >
> >
> > --
> >
> > Sadeep Jayasumana****
> >
> > Email: gayansadeep@gmail.com****
> >
> > Phone: +94-77-2266507
> >
>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.; http://wso2.org
> E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
--
Sadeep Jayasumana****
Email: gayansadeep@gmail.com****
Phone: +94-77-2266507
Re: Help needed for endpoint level content type.
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
"text/xml" is the standard content type for SOAP 1.1. So if you try to send
a POX message with text/xml content type the formatter will change that
back to application/xml. I don't think changing this behavior will break
something though (fingers crossed on that :)).
Thanks,
Hiranya
On Tue, Jan 31, 2012 at 12:08 AM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello all,
>
> Please look at the following code and tell me why this code is explicitly
> changing contentType from "text/xml" to "application/xml"?
>
> This issue is because this kind of code in ApplicationXMLFormatter,
>
> if (contentType == null) {
> contentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
> } else if (isSOAPContentType(contentType)) {
> contentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
> if (log.isDebugEnabled()) {
> log.debug("contentType is set incorrectly for Application
> XML.");
> log.debug("It is changed to " + contentType);
> }
> }
>
> Along with function in
>
>
> private boolean isSOAPContentType(String contentType) {
> if (JavaUtils.indexOfIgnoreCase(contentType,
> SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
> return true;
> }
> // search for "type=text/xml"
> else if (JavaUtils.indexOfIgnoreCase(contentType,
>
> SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
> return true;
> }
> return false;
> }
>
> This code is explicitly changing the content type to "application/xml" if
> it is "text/xml"
>
> I would like to know if changing this code would have any negative impacts.
>
> Regards,
> Abid
>
> -----Original Message-----
> From: Abid Khan
> Sent: Friday, January 27, 2012 9:34 AM
> To: 'user@synapse.apache.org'
> Subject: RE: Help needed for endpoint level content type.
>
> Hello all,
>
> I have tried all options, I do need to change the content-type to
> "text/xml". And I do neet a quick resolution to this.
>
> Can anyone please point me to right direction.
>
> Thanks in advance,
> Abid
>
>
>
>
>
> -----Original Message-----
> From: Abid Khan
> Sent: Tuesday, January 24, 2012 4:02 PM
> To: user@synapse.apache.org
> Subject: RE: Help needed for endpoint level content type.
>
> Hello Sadeep,
>
> I tried this, and several others. It look either synapse or axis2 is
> completely ignoring those properties. No matter what I set I always get
> "application/xml".
>
> So there may be a bug somewhere or this is by design. The content type are
> always posted as "application/xml"
>
>
> -----Original Message-----
> From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
> Sent: Tuesday, January 24, 2012 11:23 AM
> To: user@synapse.apache.org
> Subject: Re: Help needed for endpoint level content type.
>
> Hi,
>
> You can set these properties conditionally within your CBR logic. Please
> check whether it works for you.
>
> Eg:
> <proxy name="CBRProxy">
> <target>
> <inSequence>
> <switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="
> http://services.samples">
> <case regex="IBM">
> <!-- Send with text/xml content type to endpoint 1 -->
> <property name="messageType" value="text/xml"
> scope="axis2"/>
> <property name="ContentType" value="text/xml"
> scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint1" />
> </endpoint>
> </send>
> </case>
> <case regex="MSFT">
> <!-- Send with application/xml content type to endpoint 2
> -->
> <property name="messageType" value="application/xml"
> scope="axis2"/>
> <property name="ContentType" value="application/xml"
> scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint2" />
> </endpoint>
> </send>
> </case>
> </switch>
> </inSequence>
> </target>
> </proxy>
>
> Thanks,
> Sadeep
>
> On Tue, Jan 24, 2012 at 9:14 PM, Abid Khan <Ab...@jeppesen.com> wrote:
>
> > Hello Sadeep,
> >
> > Thanks for the quicker response.
> >
> > I actually knew this approach, but my problem is multiple application
> send
> > request to same proxy. That same proxy is delivering message (using
> content
> > based routing) to different endpoints.
> >
> > One of those endpoint expects "Content-Type=text/xml", where as rest of
> > them expect "Content-Type=application/xml".
> >
> > Having said that I need something in the endpoint not in the proxy.
> >
> > Thanks,
> > Abid
> >
> >
> >
> > -----Original Message-----
> > From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
> > Sent: Tuesday, January 24, 2012 12:52 AM
> > To: user@synapse.apache.org
> > Subject: Re: Help needed for endpoint level content type.
> >
> > Hi,
> >
> > You can force the content type while sending a message out using
> > "messageType" and "ContentType" Axis2 level properties. Please check
> > whether this works for your scenario. This might not work if the message
> > content is not compatible with the formatter associated to the content
> type
> > you are forcibly setting.
> >
> > ..
> > ..
> > <property name="messageType" value="text/xml" scope="axis2"/>
> > <property name="ContentType" value="text/xml" scope="axis2"/>
> > <send>
> > <endpoint>
> > <address uri="http://localhost:9000/endpoint1" />
> > </endpoint>
> > </send>
> >
> > AND
> >
> > ..
> > ..
> > <property name="messageType" value="application/xml" scope="axis2"/>
> > <property name="ContentType" value="application/xml" scope="axis2"/>
> > <send>
> > <endpoint>
> > <address uri="http://localhost:9000/endpoint2" />
> > </endpoint>
> > </send>
> >
> > Thanks,
> > Sadeep
> >
> > On Tue, Jan 24, 2012 at 9:47 AM, Hiranya Jayathilaka
> > <hi...@gmail.com>wrote:
> >
> > > I believe these endpoints are being invoked through some proxy service.
> > If
> > > so what is the content type of the requests sent to the proxy service?
> > >
> > > Thanks,
> > > Hiranya
> > >
> > > On Tue, Jan 24, 2012 at 7:03 AM, Abid Khan <Ab...@jeppesen.com>
> > wrote:
> > >
> > > > Hello all,
> > > >
> > > > Please help me in following scenario. (I am using synapse 1.2)
> > > >
> > > > I have two different endpoint, the application on one endpoint
> accepts
> > > > "Content-Type=application/xml", and second application on the other
> > > > endpoint accepts "Content-Type=text/xml".
> > > >
> > > > Those application are external application and are running for
> several
> > > > years, is there any way I can configure Synapse to send content type
> > > > properly to their respective endpoint.
> > > >
> > > > A prompt response will be much appreciated.
> > > >
> > > > Regards,
> > > > Abid
> > > >
> > >
> > >
> > >
> > > --
> > > Hiranya Jayathilaka
> > > Associate Technical Lead;
> > > WSO2 Inc.; http://wso2.org
> > > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > > Blog: http://techfeast-hiranya.blogspot.com
> > >
> >
> >
> >
> > --
> >
> > Sadeep Jayasumana****
> >
> > Email: gayansadeep@gmail.com****
> >
> > Phone: +94-77-2266507
> >
>
>
>
> --
>
> Sadeep Jayasumana****
>
> Email: gayansadeep@gmail.com****
>
> Phone: +94-77-2266507
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
RE: Help needed for endpoint level content type.
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello all,
Please look at the following code and tell me why this code is explicitly changing contentType from "text/xml" to "application/xml"?
This issue is because this kind of code in ApplicationXMLFormatter,
if (contentType == null) {
contentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
} else if (isSOAPContentType(contentType)) {
contentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
if (log.isDebugEnabled()) {
log.debug("contentType is set incorrectly for Application XML.");
log.debug("It is changed to " + contentType);
}
}
Along with function in
private boolean isSOAPContentType(String contentType) {
if (JavaUtils.indexOfIgnoreCase(contentType, SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
return true;
}
// search for "type=text/xml"
else if (JavaUtils.indexOfIgnoreCase(contentType,
SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
return true;
}
return false;
}
This code is explicitly changing the content type to "application/xml" if it is "text/xml"
I would like to know if changing this code would have any negative impacts.
Regards,
Abid
-----Original Message-----
From: Abid Khan
Sent: Friday, January 27, 2012 9:34 AM
To: 'user@synapse.apache.org'
Subject: RE: Help needed for endpoint level content type.
Hello all,
I have tried all options, I do need to change the content-type to "text/xml". And I do neet a quick resolution to this.
Can anyone please point me to right direction.
Thanks in advance,
Abid
-----Original Message-----
From: Abid Khan
Sent: Tuesday, January 24, 2012 4:02 PM
To: user@synapse.apache.org
Subject: RE: Help needed for endpoint level content type.
Hello Sadeep,
I tried this, and several others. It look either synapse or axis2 is completely ignoring those properties. No matter what I set I always get "application/xml".
So there may be a bug somewhere or this is by design. The content type are always posted as "application/xml"
-----Original Message-----
From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
Sent: Tuesday, January 24, 2012 11:23 AM
To: user@synapse.apache.org
Subject: Re: Help needed for endpoint level content type.
Hi,
You can set these properties conditionally within your CBR logic. Please
check whether it works for you.
Eg:
<proxy name="CBRProxy">
<target>
<inSequence>
<switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="
http://services.samples">
<case regex="IBM">
<!-- Send with text/xml content type to endpoint 1 -->
<property name="messageType" value="text/xml"
scope="axis2"/>
<property name="ContentType" value="text/xml"
scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint1" />
</endpoint>
</send>
</case>
<case regex="MSFT">
<!-- Send with application/xml content type to endpoint 2
-->
<property name="messageType" value="application/xml"
scope="axis2"/>
<property name="ContentType" value="application/xml"
scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint2" />
</endpoint>
</send>
</case>
</switch>
</inSequence>
</target>
</proxy>
Thanks,
Sadeep
On Tue, Jan 24, 2012 at 9:14 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello Sadeep,
>
> Thanks for the quicker response.
>
> I actually knew this approach, but my problem is multiple application send
> request to same proxy. That same proxy is delivering message (using content
> based routing) to different endpoints.
>
> One of those endpoint expects "Content-Type=text/xml", where as rest of
> them expect "Content-Type=application/xml".
>
> Having said that I need something in the endpoint not in the proxy.
>
> Thanks,
> Abid
>
>
>
> -----Original Message-----
> From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
> Sent: Tuesday, January 24, 2012 12:52 AM
> To: user@synapse.apache.org
> Subject: Re: Help needed for endpoint level content type.
>
> Hi,
>
> You can force the content type while sending a message out using
> "messageType" and "ContentType" Axis2 level properties. Please check
> whether this works for your scenario. This might not work if the message
> content is not compatible with the formatter associated to the content type
> you are forcibly setting.
>
> ..
> ..
> <property name="messageType" value="text/xml" scope="axis2"/>
> <property name="ContentType" value="text/xml" scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint1" />
> </endpoint>
> </send>
>
> AND
>
> ..
> ..
> <property name="messageType" value="application/xml" scope="axis2"/>
> <property name="ContentType" value="application/xml" scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint2" />
> </endpoint>
> </send>
>
> Thanks,
> Sadeep
>
> On Tue, Jan 24, 2012 at 9:47 AM, Hiranya Jayathilaka
> <hi...@gmail.com>wrote:
>
> > I believe these endpoints are being invoked through some proxy service.
> If
> > so what is the content type of the requests sent to the proxy service?
> >
> > Thanks,
> > Hiranya
> >
> > On Tue, Jan 24, 2012 at 7:03 AM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > Hello all,
> > >
> > > Please help me in following scenario. (I am using synapse 1.2)
> > >
> > > I have two different endpoint, the application on one endpoint accepts
> > > "Content-Type=application/xml", and second application on the other
> > > endpoint accepts "Content-Type=text/xml".
> > >
> > > Those application are external application and are running for several
> > > years, is there any way I can configure Synapse to send content type
> > > properly to their respective endpoint.
> > >
> > > A prompt response will be much appreciated.
> > >
> > > Regards,
> > > Abid
> > >
> >
> >
> >
> > --
> > Hiranya Jayathilaka
> > Associate Technical Lead;
> > WSO2 Inc.; http://wso2.org
> > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > Blog: http://techfeast-hiranya.blogspot.com
> >
>
>
>
> --
>
> Sadeep Jayasumana****
>
> Email: gayansadeep@gmail.com****
>
> Phone: +94-77-2266507
>
--
Sadeep Jayasumana****
Email: gayansadeep@gmail.com****
Phone: +94-77-2266507
Re: Help needed for endpoint level content type.
Posted by Sadeep Jayasumana <ga...@gmail.com>.
Hi,
You can set these properties conditionally within your CBR logic. Please
check whether it works for you.
Eg:
<proxy name="CBRProxy">
<target>
<inSequence>
<switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="
http://services.samples">
<case regex="IBM">
<!-- Send with text/xml content type to endpoint 1 -->
<property name="messageType" value="text/xml"
scope="axis2"/>
<property name="ContentType" value="text/xml"
scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint1" />
</endpoint>
</send>
</case>
<case regex="MSFT">
<!-- Send with application/xml content type to endpoint 2
-->
<property name="messageType" value="application/xml"
scope="axis2"/>
<property name="ContentType" value="application/xml"
scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint2" />
</endpoint>
</send>
</case>
</switch>
</inSequence>
</target>
</proxy>
Thanks,
Sadeep
On Tue, Jan 24, 2012 at 9:14 PM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello Sadeep,
>
> Thanks for the quicker response.
>
> I actually knew this approach, but my problem is multiple application send
> request to same proxy. That same proxy is delivering message (using content
> based routing) to different endpoints.
>
> One of those endpoint expects "Content-Type=text/xml", where as rest of
> them expect "Content-Type=application/xml".
>
> Having said that I need something in the endpoint not in the proxy.
>
> Thanks,
> Abid
>
>
>
> -----Original Message-----
> From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
> Sent: Tuesday, January 24, 2012 12:52 AM
> To: user@synapse.apache.org
> Subject: Re: Help needed for endpoint level content type.
>
> Hi,
>
> You can force the content type while sending a message out using
> "messageType" and "ContentType" Axis2 level properties. Please check
> whether this works for your scenario. This might not work if the message
> content is not compatible with the formatter associated to the content type
> you are forcibly setting.
>
> ..
> ..
> <property name="messageType" value="text/xml" scope="axis2"/>
> <property name="ContentType" value="text/xml" scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint1" />
> </endpoint>
> </send>
>
> AND
>
> ..
> ..
> <property name="messageType" value="application/xml" scope="axis2"/>
> <property name="ContentType" value="application/xml" scope="axis2"/>
> <send>
> <endpoint>
> <address uri="http://localhost:9000/endpoint2" />
> </endpoint>
> </send>
>
> Thanks,
> Sadeep
>
> On Tue, Jan 24, 2012 at 9:47 AM, Hiranya Jayathilaka
> <hi...@gmail.com>wrote:
>
> > I believe these endpoints are being invoked through some proxy service.
> If
> > so what is the content type of the requests sent to the proxy service?
> >
> > Thanks,
> > Hiranya
> >
> > On Tue, Jan 24, 2012 at 7:03 AM, Abid Khan <Ab...@jeppesen.com>
> wrote:
> >
> > > Hello all,
> > >
> > > Please help me in following scenario. (I am using synapse 1.2)
> > >
> > > I have two different endpoint, the application on one endpoint accepts
> > > "Content-Type=application/xml", and second application on the other
> > > endpoint accepts "Content-Type=text/xml".
> > >
> > > Those application are external application and are running for several
> > > years, is there any way I can configure Synapse to send content type
> > > properly to their respective endpoint.
> > >
> > > A prompt response will be much appreciated.
> > >
> > > Regards,
> > > Abid
> > >
> >
> >
> >
> > --
> > Hiranya Jayathilaka
> > Associate Technical Lead;
> > WSO2 Inc.; http://wso2.org
> > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > Blog: http://techfeast-hiranya.blogspot.com
> >
>
>
>
> --
>
> Sadeep Jayasumana****
>
> Email: gayansadeep@gmail.com****
>
> Phone: +94-77-2266507
>
--
Sadeep Jayasumana****
Email: gayansadeep@gmail.com****
Phone: +94-77-2266507
RE: Help needed for endpoint level content type.
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello Sadeep,
Thanks for the quicker response.
I actually knew this approach, but my problem is multiple application send request to same proxy. That same proxy is delivering message (using content based routing) to different endpoints.
One of those endpoint expects "Content-Type=text/xml", where as rest of them expect "Content-Type=application/xml".
Having said that I need something in the endpoint not in the proxy.
Thanks,
Abid
-----Original Message-----
From: Sadeep Jayasumana [mailto:gayansadeep@gmail.com]
Sent: Tuesday, January 24, 2012 12:52 AM
To: user@synapse.apache.org
Subject: Re: Help needed for endpoint level content type.
Hi,
You can force the content type while sending a message out using
"messageType" and "ContentType" Axis2 level properties. Please check
whether this works for your scenario. This might not work if the message
content is not compatible with the formatter associated to the content type
you are forcibly setting.
..
..
<property name="messageType" value="text/xml" scope="axis2"/>
<property name="ContentType" value="text/xml" scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint1" />
</endpoint>
</send>
AND
..
..
<property name="messageType" value="application/xml" scope="axis2"/>
<property name="ContentType" value="application/xml" scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint2" />
</endpoint>
</send>
Thanks,
Sadeep
On Tue, Jan 24, 2012 at 9:47 AM, Hiranya Jayathilaka
<hi...@gmail.com>wrote:
> I believe these endpoints are being invoked through some proxy service. If
> so what is the content type of the requests sent to the proxy service?
>
> Thanks,
> Hiranya
>
> On Tue, Jan 24, 2012 at 7:03 AM, Abid Khan <Ab...@jeppesen.com> wrote:
>
> > Hello all,
> >
> > Please help me in following scenario. (I am using synapse 1.2)
> >
> > I have two different endpoint, the application on one endpoint accepts
> > "Content-Type=application/xml", and second application on the other
> > endpoint accepts "Content-Type=text/xml".
> >
> > Those application are external application and are running for several
> > years, is there any way I can configure Synapse to send content type
> > properly to their respective endpoint.
> >
> > A prompt response will be much appreciated.
> >
> > Regards,
> > Abid
> >
>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.; http://wso2.org
> E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
--
Sadeep Jayasumana****
Email: gayansadeep@gmail.com****
Phone: +94-77-2266507
Re: Help needed for endpoint level content type.
Posted by Sadeep Jayasumana <ga...@gmail.com>.
Hi,
You can force the content type while sending a message out using
"messageType" and "ContentType" Axis2 level properties. Please check
whether this works for your scenario. This might not work if the message
content is not compatible with the formatter associated to the content type
you are forcibly setting.
..
..
<property name="messageType" value="text/xml" scope="axis2"/>
<property name="ContentType" value="text/xml" scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint1" />
</endpoint>
</send>
AND
..
..
<property name="messageType" value="application/xml" scope="axis2"/>
<property name="ContentType" value="application/xml" scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:9000/endpoint2" />
</endpoint>
</send>
Thanks,
Sadeep
On Tue, Jan 24, 2012 at 9:47 AM, Hiranya Jayathilaka
<hi...@gmail.com>wrote:
> I believe these endpoints are being invoked through some proxy service. If
> so what is the content type of the requests sent to the proxy service?
>
> Thanks,
> Hiranya
>
> On Tue, Jan 24, 2012 at 7:03 AM, Abid Khan <Ab...@jeppesen.com> wrote:
>
> > Hello all,
> >
> > Please help me in following scenario. (I am using synapse 1.2)
> >
> > I have two different endpoint, the application on one endpoint accepts
> > "Content-Type=application/xml", and second application on the other
> > endpoint accepts "Content-Type=text/xml".
> >
> > Those application are external application and are running for several
> > years, is there any way I can configure Synapse to send content type
> > properly to their respective endpoint.
> >
> > A prompt response will be much appreciated.
> >
> > Regards,
> > Abid
> >
>
>
>
> --
> Hiranya Jayathilaka
> Associate Technical Lead;
> WSO2 Inc.; http://wso2.org
> E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
--
Sadeep Jayasumana****
Email: gayansadeep@gmail.com****
Phone: +94-77-2266507
Re: Help needed for endpoint level content type.
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
I believe these endpoints are being invoked through some proxy service. If
so what is the content type of the requests sent to the proxy service?
Thanks,
Hiranya
On Tue, Jan 24, 2012 at 7:03 AM, Abid Khan <Ab...@jeppesen.com> wrote:
> Hello all,
>
> Please help me in following scenario. (I am using synapse 1.2)
>
> I have two different endpoint, the application on one endpoint accepts
> "Content-Type=application/xml", and second application on the other
> endpoint accepts "Content-Type=text/xml".
>
> Those application are external application and are running for several
> years, is there any way I can configure Synapse to send content type
> properly to their respective endpoint.
>
> A prompt response will be much appreciated.
>
> Regards,
> Abid
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
Help needed for endpoint level content type.
Posted by Abid Khan <Ab...@jeppesen.com>.
Hello all,
Please help me in following scenario. (I am using synapse 1.2)
I have two different endpoint, the application on one endpoint accepts "Content-Type=application/xml", and second application on the other endpoint accepts "Content-Type=text/xml".
Those application are external application and are running for several years, is there any way I can configure Synapse to send content type properly to their respective endpoint.
A prompt response will be much appreciated.
Regards,
Abid
Re: Custom Mediator
Posted by Ruwan Linton <ru...@gmail.com>.
Ooohh, I'm sorry.
Here is the link.
http://wso2.org/library/2898
Thanks,
Ruwan
On Wed, Aug 3, 2011 at 2:58 PM, De Vleeschauwer Nele <
Nele.DeVleeschauwer@nbb.be> wrote:
> Hi,
>
> I want to use the class mediator... Inside your previous post, there is
> 2 times the same URL... Could you sent also the url for the second
> article ?
>
> Thanks !
>
> -----Original Message-----
> From: Ruwan Linton [mailto:ruwan.linton@gmail.com]
> Sent: woensdag 3 augustus 2011 11:16
> To: user@synapse.apache.org
> Subject: Re: Custom Mediator
>
> The answer to your question depends on how you want the custom mediator
> that
> you wrote to be configured.
>
> That is, if you want a custom configuration for the mediator to be used
> in a
> sequence, like follows;
>
> <foo name="bar" blah="abc"/>
>
> Then you need to write a MediatorFactory and a MediatorSerializer to
> support
> the XML configuration. If not you can use the class mediator in synapse
> to
> call the custom mediator you wrote.
>
> You may find the following 2 articles useful;
>
> http://wso2.org/library/2936
> http://wso2.org/library/2936
>
> While the first one describes the former approach where you can use the
> class mediator to call the custom mediator you wrote, the second article
> walks you through the first approach of giving a custom configuration to
> it.
>
> Ruwan
>
> On Wed, Aug 3, 2011 at 2:19 PM, De Vleeschauwer Nele <
> Nele.DeVleeschauwer@nbb.be> wrote:
>
> > Hi,
> >
> > I've just created my own custom mediator class (based on the
> > org.apache.synapse.Mediator interface), but it's not quite clear to me
> > how I should proceed further. Should I configure this class somewhere
> > before I can use it in one of my proxy services ?
> >
> > Any help is welcome...
> >
> >
> >
> > -----------------------------------------
> > Visit our website! http://www.nbb.be
> >
> > "DISCLAIMER: The content of this e-mail message should not be
> > construed as binding on the part of the National Bank of Belgium
> > (NBB) unless otherwise and previously stated. The opinions
> > expressed in this message are solely those of the author and do not
> > necessarily reflect NBB viewpoints, particularly when the content
> > of this message, or part thereof, is private by nature or does not
> > fall within the professional scope of its author."
>
>
>
>
> --
> Ruwan Linton
> Member, Apache Software Foundation; http://www.apache.org
> <http://wso2.org>
>
> phone: +94 11 282 7532
> email: ruwan@blindvision.org; cell: +94 77 341 3097
> blog: http://blog.ruwan.org
> linkedin: http://www.linkedin.com/in/ruwanlinton
> google: http://www.google.com/profiles/ruwan.linton
> tweet: http://twitter.com/ruwanlinton
>
--
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
<http://wso2.org>
phone: +94 11 282 7532
email: ruwan@blindvision.org; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton
RE: Custom Mediator
Posted by De Vleeschauwer Nele <Ne...@nbb.be>.
Hi,
I want to use the class mediator... Inside your previous post, there is
2 times the same URL... Could you sent also the url for the second
article ?
Thanks !
-----Original Message-----
From: Ruwan Linton [mailto:ruwan.linton@gmail.com]
Sent: woensdag 3 augustus 2011 11:16
To: user@synapse.apache.org
Subject: Re: Custom Mediator
The answer to your question depends on how you want the custom mediator
that
you wrote to be configured.
That is, if you want a custom configuration for the mediator to be used
in a
sequence, like follows;
<foo name="bar" blah="abc"/>
Then you need to write a MediatorFactory and a MediatorSerializer to
support
the XML configuration. If not you can use the class mediator in synapse
to
call the custom mediator you wrote.
You may find the following 2 articles useful;
http://wso2.org/library/2936
http://wso2.org/library/2936
While the first one describes the former approach where you can use the
class mediator to call the custom mediator you wrote, the second article
walks you through the first approach of giving a custom configuration to
it.
Ruwan
On Wed, Aug 3, 2011 at 2:19 PM, De Vleeschauwer Nele <
Nele.DeVleeschauwer@nbb.be> wrote:
> Hi,
>
> I've just created my own custom mediator class (based on the
> org.apache.synapse.Mediator interface), but it's not quite clear to me
> how I should proceed further. Should I configure this class somewhere
> before I can use it in one of my proxy services ?
>
> Any help is welcome...
>
>
>
> -----------------------------------------
> Visit our website! http://www.nbb.be
>
> "DISCLAIMER: The content of this e-mail message should not be
> construed as binding on the part of the National Bank of Belgium
> (NBB) unless otherwise and previously stated. The opinions
> expressed in this message are solely those of the author and do not
> necessarily reflect NBB viewpoints, particularly when the content
> of this message, or part thereof, is private by nature or does not
> fall within the professional scope of its author."
--
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
<http://wso2.org>
phone: +94 11 282 7532
email: ruwan@blindvision.org; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton
Re: Custom Mediator
Posted by Ruwan Linton <ru...@gmail.com>.
The answer to your question depends on how you want the custom mediator that
you wrote to be configured.
That is, if you want a custom configuration for the mediator to be used in a
sequence, like follows;
<foo name="bar" blah="abc"/>
Then you need to write a MediatorFactory and a MediatorSerializer to support
the XML configuration. If not you can use the class mediator in synapse to
call the custom mediator you wrote.
You may find the following 2 articles useful;
http://wso2.org/library/2936
http://wso2.org/library/2936
While the first one describes the former approach where you can use the
class mediator to call the custom mediator you wrote, the second article
walks you through the first approach of giving a custom configuration to it.
Ruwan
On Wed, Aug 3, 2011 at 2:19 PM, De Vleeschauwer Nele <
Nele.DeVleeschauwer@nbb.be> wrote:
> Hi,
>
> I've just created my own custom mediator class (based on the
> org.apache.synapse.Mediator interface), but it's not quite clear to me
> how I should proceed further. Should I configure this class somewhere
> before I can use it in one of my proxy services ?
>
> Any help is welcome...
>
>
>
> -----------------------------------------
> Visit our website! http://www.nbb.be
>
> "DISCLAIMER: The content of this e-mail message should not be
> construed as binding on the part of the National Bank of Belgium
> (NBB) unless otherwise and previously stated. The opinions
> expressed in this message are solely those of the author and do not
> necessarily reflect NBB viewpoints, particularly when the content
> of this message, or part thereof, is private by nature or does not
> fall within the professional scope of its author."
--
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
<http://wso2.org>
phone: +94 11 282 7532
email: ruwan@blindvision.org; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton