Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6620D605F for ; Fri, 24 Jun 2011 17:05:45 +0000 (UTC) Received: (qmail 36750 invoked by uid 500); 24 Jun 2011 17:05:44 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 36461 invoked by uid 500); 24 Jun 2011 17:05:43 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 36453 invoked by uid 99); 24 Jun 2011 17:05:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jun 2011 17:05:43 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of amilasuriarachchi@gmail.com designates 209.85.218.45 as permitted sender) Received: from [209.85.218.45] (HELO mail-yi0-f45.google.com) (209.85.218.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jun 2011 17:05:39 +0000 Received: by yia25 with SMTP id 25so1568593yia.32 for ; Fri, 24 Jun 2011 10:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=2o4MpJ/iin4YOsZYuEe3bGfYbgkTJ9lU+JPDx28mxic=; b=gwdJGwBlFREP6p4VieoQlVoXUu8JIaaeuedk7y75yOpJZHoqs3/X4J854n5ISmqkRO CibS0eeh6jQ/cPrZ1hTD/NsSU0dMLOqKDoDt46iGGuQhCOlFZecrtK12lk7C1R+0c1bD 1me2P67fB8FfwMDfhnZHhFdRVeD2BVSF2MedI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KZk9IE5X5hoEbOnCUzmNwx/r+KXTOOMYxu7VFe+Zw3gVJjC05TXA6XKGTbw7uRmO6t haj9uMz1snoT0wf/yZI6++BQ9l2uFc2N9mmaN4ToOXr59btwe8wr1vXTBC+jbjvJnaec i90y8AxHn4p8byLJR8Wg8Q25DnmU1WFcKP0cA= MIME-Version: 1.0 Received: by 10.236.200.167 with SMTP id z27mr5817977yhn.109.1308935117770; Fri, 24 Jun 2011 10:05:17 -0700 (PDT) Received: by 10.236.202.4 with HTTP; Fri, 24 Jun 2011 10:05:17 -0700 (PDT) In-Reply-To: References: Date: Fri, 24 Jun 2011 22:35:17 +0530 Message-ID: Subject: Re: WSDL generation for the services exposed only in local transport From: Amila Suriarachchi To: java-dev@axis.apache.org Content-Type: multipart/alternative; boundary=20cf305641f3ba8e3104a67834fc --20cf305641f3ba8e3104a67834fc Content-Type: text/plain; charset=ISO-8859-1 On Mon, Jun 20, 2011 at 10:36 PM, Hiranya Jayathilaka wrote: > Well to be honest I don't really see a strong use case in Synapse for this > (perhaps we should first discuss this on synapse-dev). Why do we need to > expose a service only over local transport? What does that give us in > addition to what we already have? What problem are we trying to solve here? Security. Out side users are only give access the parent proxy service and hence only have to secure that proxy service. > > A service by its very definition is a reusable entity that can be consumed > by any user or system. But services exposed only on local transport are > hidden from the rest of the world. They are like little internal > modules/components that provide some functionality which cannot be reused > outside Axis2. > > I know that the idea of proxy services invoking other proxy service through > JVM calls (local transport) indeed sounds cool. But can't we get the same > behavior by properly organizing services and sequences? > There are many ways of doing one thing. So it does not mean we need only looking into one path. Think about a scenario where you need to iterate over a service integration (which uses a service chaining). In that case iterate mediator can be in the parent proxy service and it can simply invoke the proxy service with service chaining using local transport for performance and security. you may be able to write this using one proxy service with sequence. But it may not be easy for some one else not much familiar with synapse. But the original problem of this problem still remain and I'll see what can we do for that. thanks, Amila. > > Thanks, > Hiranya > > > On Mon, Jun 20, 2011 at 10:55 AM, Heshan Suriyaarachchi < > heshan.suriyaarachchi@gmail.com> wrote: > >> Hi Andreas, >> >> So, in that case does that mean, we are going to >> 1) revert all the improvements did to the local transport OR >> 2) just remove the NonBlockingTransportListener class only? >> >> If it is the first option, then we have to improve the local transport in >> such a way that a user should be able to extended the local transport >> implementation and write a custom implementation. That will help us to move >> the Synapse specific local transport to Synapse itself. >> >> If it is the second option, then we wont have to change that much of code >> level change. >> >> Although we have discussed about local transport here, my original >> question still remains ie. improving WSDL generation logic to support WSDL >> generation for serivces that is only exposed in local transport. >> >> On Thu, Jun 16, 2011 at 1:09 PM, Andreas Veithen < >> andreas.veithen@gmail.com> wrote: >> >>> Since there is a consensus that NonBlockingLocalTransportSender >>> doesn't work with a pure Axis2 setup, is not unit testable and is only >>> relevant for Synapse, the logical conclusion would be that it should >>> not be included in Axis2 but in Synapse. >>> >>> Andreas >>> >>> On Thu, Jun 16, 2011 at 08:43, Heshan Suriyaarachchi >>> wrote: >>> > >>> > >>> > On Wed, Jun 15, 2011 at 1:27 AM, Andreas Veithen < >>> andreas.veithen@gmail.com> >>> > wrote: >>> >> >>> >> On Tue, Jun 14, 2011 at 08:48, Heshan Suriyaarachchi >>> >> wrote: >>> >> > Hi Devs, >>> >> > I am opening up this thread to discuss $subject. >>> >> > Recently, I did some improvements [1] to the Axis2 local transport, >>> >> > inorder >>> >> > to get it working against Synapse nhttp transport. Now the local >>> >> > transport >>> >> > is working fine against the nhttp transport. >>> >> >>> >> To me the statement "getting transport A working against transport B" >>> >> doesn't make sense. Two distinct transports A and B never interact >>> >> directly. Each of them interacts with the Axis2 engine through (in >>> >> principle) well defined APIs. If a component (Synapse in this case) >>> >> based on Axis2 has an issue when using A and B together, then either >>> >> transport A, transport B, the component or the Axis2 engine has an >>> >> issue (or multiple components have an issue), but saying that >>> >> transport A needs to be fixed to work with transport B doesn't make >>> >> sense and is an indication that the fundamental issue has not been >>> >> identified properly. >>> >> >>> >> At this point, what we know is this: >>> >> * NHTTP doesn't work as a transport sender in a standard Axis2 setup >>> >> [1]. It only works in Synapse. That means that from the point of view >>> >> of Axis2, the NHTTP transport is broken. That is of course OK, because >>> >> NHTTP is shipped with Synapse and nobody claims that it is supported >>> >> in a plain Axis2 setup. >>> >> * At some point I tried to figure out what would need to be changed to >>> >> make the NHTTP transport work in Axis2. IIRC the conclusion was that >>> >> one can make it work in Axis2, but then it no longer works in Synapse. >>> >> This would indicate that Synapse actually uses the transport API in a >>> >> way it was not designed for. >>> >> * As indicated in AXIS2-4944, the current version of >>> >> NonBlockingLocalTransportSender doesn't work in Axis2. Unless somebody >>> >> can come up with a valid unit test that exercises this piece of code, >>> >> this would mean that we introduced a broken piece of code in Axis2 in >>> >> order to work around another broken piece of code in a downstream >>> >> project. That is of course not OK. >>> >> >>> >> Note that the issue with NonBlockingLocalTransportSender is also >>> >> blocking the review of other issues such as AXIS2-4991, because it is >>> >> not possible to construct a unit test that validates (or invalidates) >>> >> the proposed patch. That is BTW a general issue with the recent >>> >> patches for the local transport. As far as I can tell, none of them >>> >> added any new unit tests. >>> >> >>> >> [1] At least that was my conclusion when I last looked at it. I'm >>> >> ready to retract that claim if somebody comes up with an example that >>> >> shows how to set up a simple Axis2 client that uses NHTTP as outgoing >>> >> transport. >>> > >>> > As Amila has pointed out earlier, NonBlockingLocalTransportSender is >>> used to >>> > talk to a proxy service from another proxy service. Since the nhttp >>> > transport is written in a non blocking manner, >>> NonBlockingLocalTransport >>> > will work seamlessly against nhttp transport. Since, we are using this >>> > TransportSender to talk between proxy services, it's difficult to come >>> up >>> > with a test case (test client) for this particular usecase. >>> > >>> >> >>> >> > Now, my requirement is to expose an Synapse Proxy Service only in >>> local >>> >> > transport. The reason behind is that, these proxy services which are >>> >> > exposed >>> >> > only in local transport will be used by other proxy services and >>> will >>> >> > not be >>> >> > available for outside parties. Earlier, axis2 local transport did >>> not >>> >> > have a >>> >> > TransportListener. >>> >> > With a TransportListener >>> >> > ==================== >>> >> > I introduced [2] a TransportListener to the local transport. The >>> >> > transport >>> >> > listener's methods are used to calculate the endpoints for the >>> service >>> >> > which >>> >> > will be used in generating the WSDL for the service. Therefore, now >>> if >>> >> > the >>> >> > service exposed in the local transport, the local endpoint is also >>> shown >>> >> > in >>> >> > the WSDL. Although the local endpoints are shown in the WSDL, >>> outside >>> >> > parties can not access the local endpoint. >>> >> > The problem this patch introduce is, now the WSDL shows the local >>> >> > transport >>> >> > endpoints. Which is wrong since external users can not access local >>> >> > transport. >>> >> > So the solution is not to show the local transport endpoints in >>> >> > generated >>> >> > wsdl. For that we may have to change Axis2 code. >>> >> > eg: As an example, I am attaching the following resources to prove >>> my >>> >> > point. >>> >> > The synapse-config.xml is the Synapse Configuration and the attached >>> >> > WSDLs >>> >> > are for the proxy servivces, LocalTransportProxy and SecondProxy. >>> The >>> >> > SecondProxy is exposed only via the local transport and the local >>> >> > endpoints >>> >> > are shown in the WSDL which is wrong IMV. >>> >> > Without a TransportListener >>> >> > ====================== >>> >> > If we did not have a LocalTransportListener and if a service is >>> exposed >>> >> > through local transport only, the WSDL for the service will not be >>> >> > generated. The reason behind is that; inorder to generate the WSDL, >>> >> > there >>> >> > should be a mechanism to derive the endpoints for the service. >>> Since, >>> >> > the >>> >> > TransportListener is not there, there is no mechanism to derive the >>> >> > endpoints for the service(which is only exposed through the local >>> >> > transport). >>> >> > In case the service exposed through http,https,local transports; >>> this >>> >> > wont >>> >> > be the case. Then the WSDL will be generated and only the http,https >>> >> > endpoints will be shown. >>> >> > Without the listener, if we expose a service only in local >>> transport, >>> >> > WSDL >>> >> > generation fails since the endpoints can not be derived for that >>> >> > particular >>> >> > service. >>> >> > >>> >> > Your ideas and feedback on $subject is much appreciated. >>> >> > [1] - https://issues.apache.org/jira/browse/AXIS2-4944 >>> >> > [2] - https://issues.apache.org/jira/browse/AXIS2-5043 >>> >> > >>> >> > >>> >> > -- >>> >> > Regards, >>> >> > Heshan Suriyaarachchi >>> >> > >>> >> > http://heshans.blogspot.com/ >>> >> > >>> >> > >>> >> > >>> --------------------------------------------------------------------- >>> >> > To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org >>> >> > For additional commands, e-mail: java-dev-help@axis.apache.org >>> >> > >>> >> >>> >> --------------------------------------------------------------------- >>> >> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org >>> >> For additional commands, e-mail: java-dev-help@axis.apache.org >>> >> >>> > >>> > >>> > >>> > -- >>> > Regards, >>> > Heshan Suriyaarachchi >>> > >>> > http://heshans.blogspot.com/ >>> > >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org >>> For additional commands, e-mail: java-dev-help@axis.apache.org >>> >>> >> >> >> -- >> Regards, >> Heshan Suriyaarachchi >> >> http://heshans.blogspot.com/ >> > > > > -- > Hiranya Jayathilaka > Senior Software Engineer; > WSO2 Inc.; http://wso2.org > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491 > Blog: http://techfeast-hiranya.blogspot.com > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/ --20cf305641f3ba8e3104a67834fc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Jun 20, 2011 at 10:36 PM, Hirany= a Jayathilaka <hiranya911@gmail.com> wrote:
Well to be honest I don't really see a strong use case in Synapse for t= his (perhaps we should first discuss this on synapse-dev). Why do we need t= o expose a service only over local transport? What does that give us in add= ition to what we already have? What problem are we trying to solve here?=A0=

Security. Out side users are only give access the parent proxy ser= vice and hence only have to secure that proxy service.
=A0

A service by its very definition is a reusable entity that c= an be consumed by any user or system. But services exposed only on local tr= ansport are hidden from the rest of the world. They are like little interna= l modules/components that provide some functionality which cannot be reused= outside Axis2.=A0

I know that the idea of proxy services invoking other p= roxy service through JVM calls (local transport) indeed sounds cool. But ca= n't we get the same behavior by properly organizing services and sequen= ces?

There are many ways of doing one thing. So it does no= t mean we need only looking into one path.

Think about a scenario wh= ere you need to iterate over a service integration (which uses a service ch= aining). In that case iterate mediator can be in the parent proxy service a= nd it can simply invoke the proxy service with service chaining using local= transport for performance and security.

you may be able to write this using one proxy service with sequence. Bu= t it may not be easy for some one else not much familiar with synapse.
<= br>But the original problem of this problem still remain and I'll see w= hat can we do for that.

thanks,
Amila.


=A0

Thanks,
Hiranya


On Mon, Jun 20, 2011 at 10:55 AM, He= shan Suriyaarachchi <heshan.suriyaarachchi@gmail.com>= wrote:
Hi Andreas,= =A0

So, in that case does that mean, we are going = to=A0
1) revert all the improvements did to the local transport OR
2) just remove the NonBlockingTransportListener class only?=A0

If it is the first option, then we have to improve the = local transport in such a way that a user should be able to extended the lo= cal transport implementation and write a custom implementation. That will h= elp us to move the Synapse specific local transport to Synapse itself.=A0

If it is the second option, then we wont have to change= that much of code level change.=A0

Although we ha= ve discussed about local transport here, my original question still remains= ie. improving WSDL generation logic to support WSDL generation for serivce= s that is only exposed in local transport.=A0

On Thu, Jun 16, 2011 at 1:09 PM, Andreas Vei= then <andreas.veithen@gmail.com> wrote:
Since there is a consensus that NonBlockingLocalTransportSender
doesn't work with a pure Axis2 setup, is not unit testable and is only<= br> relevant for Synapse, the logical conclusion would be that it should
not be included in Axis2 but in Synapse.

Andreas

On Thu, Jun 16, 2011 at 08:43, Heshan Suriyaarachchi
<heshan.suriyaarachchi@gmail.com> wrote:
>
>
> On Wed, Jun 15, 2011 at 1:27 AM, Andreas Veithen <andreas.veithen@gmail.com= >
> wrote:
>>
>> On Tue, Jun 14, 2011 at 08:48, Heshan Suriyaarachchi
>> <heshan.suriyaarachchi@gmail.com> wrote:
>> > Hi Devs,
>> > I am opening up this thread to discuss $subject.
>> > Recently, I did some improvements [1] to the Axis2 local tran= sport,
>> > inorder
>> > to get it working against Synapse nhttp transport. Now the lo= cal
>> > transport
>> > is working fine against the nhttp transport.
>>
>> To me the statement "getting transport A working against tran= sport B"
>> doesn't make sense. Two distinct transports A and B never inte= ract
>> directly. Each of them interacts with the Axis2 engine through (in=
>> principle) well defined APIs. If a component (Synapse in this case= )
>> based on Axis2 has an issue when using A and B together, then eith= er
>> transport A, transport B, the component or the Axis2 engine has an=
>> issue (or multiple components have an issue), but saying that
>> transport A needs to be fixed to work with transport B doesn't= make
>> sense and is an indication that the fundamental issue has not been=
>> identified properly.
>>
>> At this point, what we know is this:
>> * NHTTP doesn't work as a transport sender in a standard Axis2= setup
>> [1]. It only works in Synapse. That means that from the point of v= iew
>> of Axis2, the NHTTP transport is broken. That is of course OK, bec= ause
>> NHTTP is shipped with Synapse and nobody claims that it is support= ed
>> in a plain Axis2 setup.
>> * At some point I tried to figure out what would need to be change= d to
>> make the NHTTP transport work in Axis2. IIRC the conclusion was th= at
>> one can make it work in Axis2, but then it no longer works in Syna= pse.
>> This would indicate that Synapse actually uses the transport API i= n a
>> way it was not designed for.
>> * As indicated in AXIS2-4944, the current version of
>> NonBlockingLocalTransportSender doesn't work in Axis2. Unless = somebody
>> can come up with a valid unit test that exercises this piece of co= de,
>> this would mean that we introduced a broken piece of code in Axis2= in
>> order to work around another broken piece of code in a downstream<= br> >> project. That is of course not OK.
>>
>> Note that the issue with NonBlockingLocalTransportSender is also >> blocking the review of other issues such as AXIS2-4991, because it= is
>> not possible to construct a unit test that validates (or invalidat= es)
>> the proposed patch. That is BTW a general issue with the recent >> patches for the local transport. As far as I can tell, none of the= m
>> added any new unit tests.
>>
>> [1] At least that was my conclusion when I last looked at it. I= 9;m
>> ready to retract that claim if somebody comes up with an example t= hat
>> shows how to set up a simple Axis2 client that uses NHTTP as outgo= ing
>> transport.
>
> As Amila has pointed out earlier, NonBlockingLocalTransportSender is u= sed to
> talk to a proxy service from another proxy service. Since the nhttp > transport is written in a non blocking manner, NonBlockingLocalTranspo= rt
> will work seamlessly against nhttp transport. Since, we are using this=
> TransportSender to talk between proxy services, it's difficult to = come up
> with a test case (test client) for this particular usecase.
>
>>
>> > Now, my requirement is to expose an Synapse Proxy Service onl= y in local
>> > transport. The reason behind is that, these proxy services wh= ich are
>> > exposed
>> > only in local transport will be used by other proxy services = and will
>> > not be
>> > available for outside parties. Earlier, axis2 local transport= did not
>> > have a
>> > TransportListener.
>> > With a TransportListener
>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<= br> >> > I introduced [2] a TransportListener to the local transport. = The
>> > transport
>> > listener's methods are used to calculate the endpoints fo= r the service
>> > which
>> > will be used in generating the WSDL for the service. Therefor= e, now if
>> > the
>> > service exposed in the local transport, the local endpoint is= also shown
>> > in
>> > the WSDL. Although the local endpoints are shown in the WSDL,= outside
>> > parties can not access the local endpoint.
>> > The problem this patch introduce is, now the WSDL shows the l= ocal
>> > transport
>> > endpoints. Which is wrong since external users can not access= local
>> > transport.
>> > So the solution is not to show the local transport endpoints = in
>> > generated
>> > wsdl. For that we may have to change Axis2 code.
>> > eg: As an example, I am attaching the following resources to = prove my
>> > point.
>> > The synapse-config.xml is the Synapse Configuration and the a= ttached
>> > WSDLs
>> > are for the proxy servivces, LocalTransportProxy and SecondPr= oxy. The
>> > SecondProxy is exposed only via the local transport and the l= ocal
>> > endpoints
>> > are shown in the WSDL which is wrong IMV.
>> > Without a TransportListener
>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
>> > If we did not have a LocalTransportListener and if a service = is exposed
>> > through local transport only, the WSDL for the service will n= ot be
>> > generated. The reason behind is that; inorder to generate the= WSDL,
>> > there
>> > should be a mechanism to derive the endpoints for the service= . Since,
>> > the
>> > TransportListener is not there, there is no mechanism to deri= ve the
>> > endpoints for the service(which is only exposed through the l= ocal
>> > transport).
>> > In case the service exposed through http,https,local transpor= ts; this
>> > wont
>> > be the case. Then the WSDL will be generated and only the htt= p,https
>> > endpoints will be shown.
>> > Without the listener, if we expose a service only in local tr= ansport,
>> > WSDL
>> > generation fails since the endpoints can not be derived for t= hat
>> > particular
>> > service.
>> >
>> > Your ideas and feedback on $subject is much appreciated.
>> > [1] - https://issues.apache.org/jira/browse/AXIS2-4944
>> > [2] -
https://issues.apache.org/jira/browse/AXIS2-5043
>> >
>> >
>> > --
>> > Regards,
>> > Heshan Suriyaarachchi
>> >
>> >
ht= tp://heshans.blogspot.com/
>> >
>> >
>> > -------------------------------------------------------------= --------
>> > To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
>> > For additional commands, e-mail:
java-dev-help@axis.apache.org >> >
>>
>> ------------------------------------------------------------------= ---
>> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org >> For additional commands, e-mail: java-dev-help@axis.apache.org
>>
>
>
>
> --
> Regards,
> Heshan Suriyaarachchi
>
> http://hesh= ans.blogspot.com/
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org




--
Regards,
Heshan Suriyaarachchi

http://heshans.blogspot.com/=



-- Hiranya Jayathilaka
Senior Software Engineer;
WSO2 Inc.;=A0 http://wso2.org
E-mail: hiranya@wso2.com;=A0 M= obile: +94 77 633 3491
Blog: h= ttp://techfeast-hiranya.blogspot.com



--
Amila Suriarachchi
W= SO2 Inc.
blog: http://am= ilachinthaka.blogspot.com/
--20cf305641f3ba8e3104a67834fc--