Return-Path: Delivered-To: apmail-synapse-dev-archive@www.apache.org Received: (qmail 2998 invoked from network); 23 May 2008 10:09:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 May 2008 10:09:11 -0000 Received: (qmail 96306 invoked by uid 500); 23 May 2008 10:09:12 -0000 Delivered-To: apmail-synapse-dev-archive@synapse.apache.org Received: (qmail 96280 invoked by uid 500); 23 May 2008 10:09:12 -0000 Mailing-List: contact dev-help@synapse.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@synapse.apache.org Delivered-To: mailing list dev@synapse.apache.org Received: (qmail 96269 invoked by uid 99); 23 May 2008 10:09:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 May 2008 03:09:12 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of eric.hubert@jamba.net designates 81.19.200.43 as permitted sender) Received: from [81.19.200.43] (HELO r2d2.jamba.net) (81.19.200.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 May 2008 10:08:22 +0000 Received: from BERWNEXCN01.jcorp.ad.jamba.net (berwnexcn01.jcorp.ad.jamba.net [10.35.12.217]) by r2d2.jamba.net (Postfix) with ESMTP id A84E2D95C9F for ; Fri, 23 May 2008 12:08:35 +0200 (CEST) Received: from berwnexmb01.jcorp.ad.jamba.net ([10.35.12.221]) by BERWNEXCN01.jcorp.ad.jamba.net with Microsoft SMTPSVC(6.0.3790.3959); Fri, 23 May 2008 12:10:36 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C8BCBD.3E4C6D1F" Subject: RE: How to send back a fault from an in-sequence Date: Fri, 23 May 2008 12:10:37 +0200 Message-ID: In-Reply-To: <672a01200805230214y4381156eked95f64a2c83931d@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to send back a fault from an in-sequence Thread-Index: Aci8tcoJB87H0GP0RGyyBxLuJtRLWwABwPSw References: <672a01200805220851v5629ce76w42fc594daf494b0d@mail.gmail.com> <672a01200805220856s22b4090et6b2327201c3aedbf@mail.gmail.com> <672a01200805230214y4381156eked95f64a2c83931d@mail.gmail.com> From: "Hubert, Eric" To: X-OriginalArrivalTime: 23 May 2008 10:10:36.0166 (UTC) FILETIME=[3E644A60:01C8BCBD] X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C8BCBD.3E4C6D1F Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Hi Ruwan, =20 Thanks for your cross test! No, we didn't change any of the libraries. If I find the time, I'll try the sample on my own and contact the developer to find out more about his testing environment. I guess he was testing locally. So maybe he uses another Java-Version or something like that. If the problem does not happen in the integration environment we may try to narrow it down. =20 Regards, Eric =20 ________________________________ From: Ruwan Linton [mailto:ruwan.linton@gmail.com]=20 Sent: Friday, May 23, 2008 11:15 AM To: dev@synapse.apache.org Subject: Re: How to send back a fault from an in-sequence =20 Hi Eric, I just tried the sample 352 and was working fine for me. May be this is a scripting problem. Are you using some other scripting jar than what we ship with Synapse/ESB? Thanks, Ruwan On Fri, May 23, 2008 at 1:43 PM, Hubert, Eric wrote: Hi Ruwan, =20 It seems to me as we have been on the right track on this. We will check to use this way, which looks more or less like we tried to achieve using the scripting approach. We followed synapse example 352, but there we always received an exception. I'll go and grep it. Yes, here it is: =20 2008-05-23 10:41:04,358 [127.0.0.1-berjbolle-lx1] [I/O dispatcher 5] INFO PipeImpl Using native OS Pipes for event-driven to stream IO bridging 2008-05-23 10:41:04,451 [127.0.0.1-berjbolle-lx1] [HttpServerWorker-1] ERROR ScriptMediator The script engine returned an error executing the inlined js script function mediate com.sun.phobos.script.util.ExtendedScriptException: org.mozilla.javascript.EvaluatorException: The choice of Java constructor setTo matching JavaScript argument types (null) is ambiguous; candidate constructors are: void setTo(java.lang.String) void setTo(org.apache.axis2.addressing.EndpointReference) (#2)in: at line no: 2 at com.sun.phobos.script.javascript.RhinoCompiledScript.eval(RhinoCompiledS cript.java:68) at javax.script.CompiledScript.eval(CompiledScript.java:64) at org.apache.synapse.mediators.bsf.ScriptMediator.mediateForInlineScript(S criptMediator.java:248) at org.apache.synapse.mediators.bsf.ScriptMediator.invokeScript(ScriptMedia tor.java:195) at org.apache.synapse.mediators.bsf.ScriptMediator.mediate(ScriptMediator.j ava:168) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMe diator.java:58) at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java: 60) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMe diator.java:58) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMedia tor.java:125) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis 2SynapseEnvironment.java:176) at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMess ageReceiver.java:89) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReques t(HTTPTransportUtils.java:275) at org.apache.synapse.transport.nhttp.ServerWorker.processPost(ServerWorker .java:238) at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:19 4) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto r.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:675) at java.lang.Thread.run(Thread.java:595) Caused by: org.mozilla.javascript.EvaluatorException: The choice of Java constructor setTo matching JavaScript argument types (null) is ambiguous; candidate constructors are: void setTo(java.lang.String) void setTo(org.apache.axis2.addressing.EndpointReference) (#2) at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorRep orter.java:98) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:966) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1022) at org.mozilla.javascript.Context.reportRuntimeError3(Context.java:1000) at org.mozilla.javascript.NativeJavaMethod.findFunction(NativeJavaMethod.ja va:385) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:156) at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66) at org.mozilla.javascript.gen.c3._c0(:2) at org.mozilla.javascript.gen.c3.call() at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758) at org.mozilla.javascript.gen.c3.call() at org.mozilla.javascript.gen.c3.exec() at com.sun.phobos.script.javascript.RhinoCompiledScript.eval(RhinoCompiledS cript.java:55) ... 17 more =20 So while looking at this stack it seems as if the replyTo would be null. Maybe this is only some scripting problem. Could someone please check the example. If it is also not working for someone else, we should file a JIRA. Or can this not work from within the main-sequence for some reason? Basically it is the same as your decribed mediator sequence but with scripting, or am I wrong? =20 =20 Regards, Eric =20 ________________________________ Small modification; On Thu, May 22, 2008 at 9:21 PM, Ruwan Linton wrote: Hi Eric, Please see my comments in line; On Thu, May 22, 2008 at 8:53 PM, Hubert, Eric wrote: Hi, how can we send back a fault from an in-sequence? Regarding the Hessian support, is there a way to generate a Hessian fault? If the incoming message is a hessian message and if you=20 * create a SOAP fault,=20 * set the RESPONSE=3Dtrue property and=20 * copy the ReplyTo as To=20 I forgot to mention that you will obviously need to send as well to send back the generated response, So the set of mediators required are [makefault, property, header, send] Thanks, Ruwan=20 * =20 as described in the Sample 5 then you will be able to send back a hessian fault. =09 =09 Background: 1) In a switch mediator within the in-sequence we want to send back a fault for the default case and log this. =09 Can be easily done as described above. =20 =09 =09 2) If the requested URL does not match with any proxy service definitions, Synapse sends back a 202 response to the client. If we got it right synapse always uses the main-sequence if no other sequence matches. So also for this case we would like to send back a fault from within the in-sequence of the main-sequence. A minor correction to this at first, if the message is not dispatched to any of the proxy services on Synapse then the message will be directed to the main sequence of synapse. (synapse dose not match over any other sequences but just the proxy services for incoming messages) If you just have proxy services (service mediation only) and no message mediation (messages coming into main sequence), then you can assume a message reaching the main sequence as a fault message and send back a fault, using the same strategy as described above inside the main sequence. --=20 Ruwan Linton http://www.wso2.org - "Oxygenating the Web Services Platform"=20 ------_=_NextPart_001_01C8BCBD.3E4C6D1F Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hi Ruwan,

 

=

Thanks for your cross test! No, we didn’t change any of the libraries. If = I find the time, I’ll try the sample on my own and contact the developer = to find out more about his testing environment. I guess he was testing locally. = So maybe he uses another Java-Version or something like that. If the = problem does not happen in the integration environment we may try to narrow it = down.

 

=

Regards,

   Eric

 


From: Ruwan Linton [mailto:ruwan.linton@gmail.com]
Sent: Friday, May 23, = 2008 11:15 AM
To: dev@synapse.apache.org
Subject: Re: How to send = back a fault from an in-sequence

 

Hi Eric,

I just tried the sample 352 and was working fine for me. May be this is = a scripting problem.

Are you using some other scripting jar than what we ship with = Synapse/ESB?

Thanks,
Ruwan

On Fri, May 23, 2008 at 1:43 PM, Hubert, Eric <eric.hubert@jamba.net> = wrote:

Hi = Ruwan,

 

=

It seems to me as we have been on = the right track on this. We will check to use this way, which looks more or less = like we tried to achieve using the scripting approach. We followed synapse = example 352, but there we always received an exception. I'll go and grep it. Yes, = here it is:

 

=

2008-05-23 10:41:04,358 = [127.0.0.1-berjbolle-lx1] [I/O dispatcher 5]  INFO PipeImpl Using native OS Pipes for = event-driven to stream IO bridging

2008-05-23 10:41:04,451 = [127.0.0.1-berjbolle-lx1] [HttpServerWorker-1] ERROR ScriptMediator The script engine returned an = error executing the inlined js script function = mediate

com.sun.phobos.script.util.ExtendedScriptEx= ception: org.mozilla.javascript.EvaluatorException: The choice of Java = constructor setTo matching JavaScript argument types (null) is ambiguous; candidate = constructors are:

    void = setTo(java.lang.String)

    void = setTo(org.apache.axis2.addressing.EndpointReference) (<Unknown Source>#2)in: <Unknown Source>at line no: = 2

        = at com.sun.phobos.script.javascript.RhinoCompiledScript.eval(RhinoCompiledSc= ript.java:68)

        = at javax.script.CompiledScript.eval(CompiledScript.java:64)

        = at org.apache.synapse.mediators.bsf.ScriptMediator.mediateForInlineScript(Sc= riptMediator.java:248)

        = at org.apache.synapse.mediators.bsf.ScriptMediator.invokeScript(ScriptMediat= or.java:195)

        = at org.apache.synapse.mediators.bsf.ScriptMediator.mediate(ScriptMediator.ja= va:168)

        = at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMed= iator.java:58)

        = at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:6= 0)

        = at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMed= iator.java:58)

        = at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediat= or.java:125)

        = at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2= SynapseEnvironment.java:176)

        = at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessa= geReceiver.java:89)

        = at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)

        = at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest= (HTTPTransportUtils.java:275)

        = at org.apache.synapse.transport.nhttp.ServerWorker.processPost(ServerWorker.= java:238)

        = at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:194= )

        = at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor= .java:650)

        = at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.jav= a:675)

        = at java.lang.Thread.run(Thread.java:595)

Caused by: org.mozilla.javascript.EvaluatorException: The choice of Java = constructor setTo matching JavaScript argument types (null) is ambiguous; candidate = constructors are:

    void = setTo(java.lang.String)

    void setTo(org.apache.axis2.addressing.EndpointReference) (<Unknown = Source>#2)

        = at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorRepo= rter.java:98)

        = at org.mozilla.javascript.Context.reportRuntimeError(Context.java:966)

        = at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1022)

        = at org.mozilla.javascript.Context.reportRuntimeError3(Context.java:1000)

        = at org.mozilla.javascript.NativeJavaMethod.findFunction(NativeJavaMethod.jav= a:385)

        = at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:156)

        = at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)

        = at org.mozilla.javascript.gen.c3._c0(<Unknown = Source>:2)

        = at org.mozilla.javascript.gen.c3.call(<Unknown = Source>)

        = at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340)<= /span>

        = at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758)

        = at org.mozilla.javascript.gen.c3.call(<Unknown = Source>)

        = at org.mozilla.javascript.gen.c3.exec(<Unknown = Source>)

        = at com.sun.phobos.script.javascript.RhinoCompiledScript.eval(RhinoCompiledSc= ript.java:55)

        = ... 17 more

 

=

So while looking at this stack it = seems as if the replyTo would be null. Maybe this is only some scripting problem. = Could someone please check the example. If it is also not working for someone = else, we should file a JIRA. Or can this not work from within the = main-sequence for some reason? Basically it is the same as your decribed mediator sequence = but with scripting, or am I wrong?

 

=

 

=

Regards,

   = Eric

 


Small = modification;

On Thu, May 22, 2008 at 9:21 PM, Ruwan Linton <ruwan.linton@gmail.com> wrote:

Hi Eric,

Please see my comments in line;

On Thu, May 22, 2008 at 8:53 PM, Hubert, Eric <eric.hubert@jamba.net> = wrote:

Hi,

how can we send back a fault from an in-sequence? Regarding the = Hessian
support, is there a way to generate a Hessian = fault?


If the incoming message is a hessian message and if you =

  • create a SOAP fault, =
  • set the RESPONSE=3Dtrue property and =
  • copy the ReplyTo as = To 

I forgot to mention that you will obviously need to send as well to send back the generated response,

So the set of mediators required are [makefault, property, header, = send]

Thanks,
Ruwan

  •  

as described in the Sample 5 then you will be able to send back a hessian = fault.



Background:
1) In a switch mediator within the in-sequence we want to send back = a
fault for the default case and log this.


Can be easily done as described above.
 



2) If the requested URL does not match with any proxy service
definitions, Synapse sends back a 202 response to the client. If we = got
it right synapse always uses the main-sequence if no other sequence
matches. So also for this case we would like to send back a fault = from
within the in-sequence of the = main-sequence.


A minor correction to this at first, if the message is not dispatched to = any of the proxy services on Synapse then the message will be directed to the = main sequence of synapse. (synapse dose not match over any other sequences = but just the proxy services for incoming messages)

If you just have proxy services (service mediation only) and no message mediation (messages coming into main sequence), then you can assume a = message reaching the main sequence as a fault message and send back a fault, = using the same strategy as described above inside the main = sequence.




--
Ruwan Linton
http://www.wso2.org - = "Oxygenating the Web Services Platform"

------_=_NextPart_001_01C8BCBD.3E4C6D1F--