[Carbon-dev] R: R: R: R: R: R: WSO2 component to deploy a simple servlet?
Sanjiva Weerawarana
sanjiva at wso2.com
Thu Mar 18 21:07:25 PDT 2010
Supun, first of all, s/Cappa/Roberto/ :-). My fault for starting to call
Roberto wrong! Apologies :-(.
Second the issue here is the default builder - Roberto's GET doesn't have a
content type .. and I guess we default to XML builder in that case? What we
need to do is to say to use the BinaryRelayBuilder as the default builder.
Sanjiva.
On Fri, Mar 19, 2010 at 9:32 AM, Supun Kamburugamuva <supun at wso2.com> wrote:
> Hi Cappa,
>
> Handling application/x-www-form-urlencoded was not supported with the
> message relay in 2.1.3 release. It is supported with the upcoming
> 3.0.0 release.
>
> Thanks,
> Supun..
>
> On Thu, Mar 18, 2010 at 4:33 PM, Cappa Roberto
> <roberto.cappa at guest.telecomitalia.it> wrote:
> > Now, POST works but GET doesn't work anymore...
> >
> > I've changed the messagebuilder for incoming x-www-form-urlencoded
> requests (POST):
> >
> > <messageBuilder contentType="application/x-www-form-urlencoded"
> > class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
> >
> > now, POST parameters are correctly encoded and used in my custom logic
> after based-64 decoding.
> >
> > I've also changed the corresponding messageFormatter:
> >
> > <messageFormatter contentType="application/x-www-form-urlencoded"
> >
> class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
> >
> > When I try for GET requests, in SOAP monitor the incoming message is
> shown as:
> >
> > "Error occurred while pretty printing message.
> org.apache.axiom.om.OMException: Cannot get InputStream from
> DataHandler.java.io.IOException: Input stream has being already consumed "
> >
> > My question is: since GET requests don't have a Content-Type, which
> message builder is chosen? Why changing the
> application/x-www-form-urlencoded message builder affects also GET requests?
> >
> > ________________________________________
> > Da: carbon-dev-bounces at wso2.org [carbon-dev-bounces at wso2.org] per conto
> di Ruwan Linton [ruwan at wso2.com]
> > Inviato: mercoledì 17 marzo 2010 20.00
> > A: carbon-dev at wso2.org
> > Oggetto: Re: [Carbon-dev] R: R: R: R: R: WSO2 component to deploy a
> simple servlet?
> >
> > Hi Roberto,
> >
> > So the log mediator tries to extract the content type header, whcih
> > could be different from the actual content type that is going out, just
> > try using the following get-property instead;
> >
> > get-property('axis2', 'ContentType')
> >
> > Except for that are there any issues in the REST invocation?
> >
> > Thanks,
> > Ruwan
> >
> > Cappa Roberto wrote:
> >> Hi, we are trying the BinaryRelay solution. We have a problem. In proxy
> like this:
> >>
> >> <syn:proxy xmlns:syn="http://ws.apache.org/ns/synapse" name="RestTest"
> transports="https,http" statistics="disable" trace="disable"
> startOnLoad="true">
> >> <syn:target>
> >> <syn:inSequence>
> >> <syn:property name="RESPONSE" value="true" />
> >> <syn:class
> name="it.telecomitalia.ictlab.rest.identity.ip2cli.mediator.Ip2CliIdentityMediator"/>
> >> <syn:header name="To" expression="get-property('ReplyTo')" />
> >> <syn:log level="full">
> >> <syn:property name="CONTENT-TYPE"
> expression="get-property('transport','Content-Type')" />
> >> </syn:log>
> >> <syn:send />
> >> </syn:inSequence>
> >> </syn:target>
> >> </syn:proxy>
> >>
> >> The log prints: CONTENT-TYPE=application/xml but the returned packet to
> client is application/x-www-form-urlencoded. Does the content-type is
> altered during call <send/>? For what reason?
> >>
> >> Thanks.
> >>
> >>
> >> ________________________________________
> >> Da: carbon-dev-bounces at wso2.org [carbon-dev-bounces at wso2.org] per conto
> di Ruwan Linton [ruwan at wso2.com]
> >> Inviato: mercoledì 17 marzo 2010 13.01
> >> A: carbon-dev at wso2.org
> >> Oggetto: Re: [Carbon-dev] R: R: R: R: WSO2 component to deploy a simple
> servlet?
> >>
> >> Yes basically what you need to do is, to add the following builder and
> >> formatter declarations to the axis2.xml and try.
> >>
> >> <messageBuilder contentType="text/html"
> >> class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
> >> <messageFormatter contentType="text/html"
> >> class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
> >>
> >> Please note that, if you need to do any transformations touching the
> >> payload, you need to use a <build/> mediator.
> >>
> >> Thanks,
> >> Ruwan
> >>
> >> Cappa Roberto wrote:
> >>
> >>> The second one, we need to mediate requests going into RESTfull
> service, obviously incoming requests in ESB are also generic HTTP GET/POST,
> not SOAP. Thanks for the advice, we will analyze the relay solution you have
> suggested. Is that a good article to start with?
> http://wso2.org/library/articles/binary-relay-efficient-way-pass-both-xml-non-xml-content-through-apache-synapse
> >>> ________________________________________
> >>> Da: carbon-dev-bounces at wso2.org [carbon-dev-bounces at wso2.org] per
> conto di Ruwan Linton [ruwan at wso2.com]
> >>> Inviato: mercoledì 17 marzo 2010 12.24
> >>> A: carbon-dev at wso2.org
> >>> Oggetto: Re: [Carbon-dev] R: R: R: WSO2 component to deploy a simple
> servlet?
> >>>
> >>> Cappa Roberto wrote:
> >>>
> >>>
> >>>> You are absolutely right, but our time-to-market needs a temporary
> solution, because in current conditions we cannot offer a working solution
> for our REST services based only on ESB.
> >>>>
> >>>>
> >>>>
> >>> Hi Roberto,
> >>>
> >>> So, do you want to host RESTfull services on ESB or do you want to
> >>> mediate the requests going into a RESTfull service??
> >>>
> >>> If it is the later, you could use the message relay and pass the
> >>> messages using a binary stream to the actual service.
> >>>
> >>> Thanks,
> >>> Ruwan
> >>>
> >>>
> >>>> ________________________________________
> >>>> Da: carbon-dev-bounces at wso2.org [carbon-dev-bounces at wso2.org] per
> conto di Sanjiva Weerawarana [sanjiva at wso2.com]
> >>>> Inviato: mercoledì 17 marzo 2010 10.29
> >>>> A: carbon-dev
> >>>> Oggetto: Re: [Carbon-dev] R: R: WSO2 component to deploy a simple
> servlet?
> >>>>
> >>>> Cappa, we're going to fix the issues in the REST routing stuff - that
> stuff needs to work perfectly. If its an option it'll be great to have you
> keep pushing us to get that part right instead of taking over and writing
> your servlet!
> >>>>
> >>>> Sanjiva.
> >>>>
> >>>> On Wed, Mar 17, 2010 at 2:47 PM, Cappa Roberto <
> roberto.cappa at guest.telecomitalia.it<mailto:
> roberto.cappa at guest.telecomitalia.it>> wrote:
> >>>> No, we are talking about the possibility to deploy an external
> non-SOAP service, like a simple servlet (my original mail
> http://wso2.org/mailarchive/carbon-dev/2010-March/040154.html).
> >>>>
> >>>> Thanks
> >>>> ________________________________________
> >>>> Da: carbon-dev-bounces at wso2.org<mailto:carbon-dev-bounces at wso2.org> [
> carbon-dev-bounces at wso2.org<mailto:carbon-dev-bounces at wso2.org>] per conto
> di Paul Fremantle [paul at wso2.com<mailto:paul at wso2.com>]
> >>>> Inviato: mercoledì 17 marzo 2010 9.55
> >>>> A: carbon-dev
> >>>> Oggetto: Re: [Carbon-dev] R: WSO2 component to deploy a simple
> servlet?
> >>>>
> >>>> Roberto
> >>>>
> >>>> Are you asking if you can deploy WSAS services in the ESB? The answer
> is most definitely yes. You can use p2 to install the Service Hosting
> feature and then you have all the WSAS service types (POJO, AAR, JAXWS etc)
> available to deploy in the ESB.
> >>>>
> >>>> Paul
> >>>>
> >>>> 2010/3/17 Cappa Roberto <roberto.cappa at guest.telecomitalia.it<mailto:
> roberto.cappa at guest.telecomitalia.it><mailto:
> roberto.cappa at guest.telecomitalia.it<mailto:
> roberto.cappa at guest.telecomitalia.it>>>
> >>>> It could be a solution, the problem in this case is that we cannot
> visualize the component in any way in the admin console and we have to
> develop an administration page from scratch. This can be quite simple for a
> simple services list visualizator, more complex if we want have at least
> "deploy" and "undeploy" functions. For this reason we asked for the
> possibility to use an existing carbon component from other products.
> >>>>
> >>>> In relation to your proposal, what is the difference between deploying
> a .war file and a OSGi bundle? Is there an example where is explained how to
> create a simple web bundle and how to install it in carbon?
> >>>>
> >>>> Thanks
> >>>>
> >>>> ________________________________________
> >>>> Da: carbon-dev-bounces at wso2.org<mailto:carbon-dev-bounces at wso2.org
> ><mailto:carbon-dev-bounces at wso2.org<mailto:carbon-dev-bounces at wso2.org>>
> [carbon-dev-bounces at wso2.org<mailto:carbon-dev-bounces at wso2.org><mailto:
> carbon-dev-bounces at wso2.org<mailto:carbon-dev-bounces at wso2.org>>] per
> conto di Afkham Azeez [azeez at wso2.com<mailto:azeez at wso2.com><mailto:
> azeez at wso2.com<mailto:azeez at wso2.com>>]
> >>>> Inviato: mercoledì 17 marzo 2010 6.11
> >>>> A: carbon-dev at wso2.org<mailto:carbon-dev at wso2.org><mailto:
> carbon-dev at wso2.org<mailto:carbon-dev at wso2.org>>
> >>>> Oggetto: Re: [Carbon-dev] WSO2 component to deploy a simple servlet?
> >>>>
> >>>> You could deploy normal webapps on the ESB. Just drop the .war file
> into the webapps directory. If that approach doesn't work for you, you could
> even create an OSGi bundle which registers your servlet with the OSGi
> framework.
> >>>>
> >>>> Thanks
> >>>> Azeez
> >>>>
> >>>> _______________________________________________
> >>>> Carbon-dev mailing list
> >>>> Carbon-dev at wso2.org<mailto:Carbon-dev at wso2.org><mailto:
> Carbon-dev at wso2.org<mailto:Carbon-dev at wso2.org>>
> >>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Paul Fremantle
> >>>> CTO and Co-Founder, WSO2
> >>>> OASIS WS-RX TC Co-chair, VP, Apache Synapse
> >>>>
> >>>> Office: +44 844 484 8143
> >>>> Cell: +44 798 447 4618
> >>>>
> >>>> blog: http://pzf.fremantle.org
> >>>> twitter.com/pzfreo<http://twitter.com/pzfreo><
> http://twitter.com/pzfreo>
> >>>> paul at wso2.com<mailto:paul at wso2.com><mailto:paul at wso2.com<mailto:
> paul at wso2.com>>
> >>>>
> >>>> wso2.com<http://wso2.com><http://wso2.com> Lean Enterprise Middleware
> >>>>
> >>>> _______________________________________________
> >>>> Carbon-dev mailing list
> >>>> Carbon-dev at wso2.org<mailto:Carbon-dev at wso2.org>
> >>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Sanjiva Weerawarana, Ph.D.
> >>>> Founder, Chairman & CEO; WSO2, Inc.; http://wso2.com/
> >>>> email: sanjiva at wso2.com<mailto:sanjiva at wso2.com>; phone: +1 408 754
> 7388 x51726; cell: +94 77 787 6880
> >>>> blog: http://sanjiva.weerawarana.org/
> >>>>
> >>>> Lean . Enterprise . Middleware
> >>>>
> >>>> _______________________________________________
> >>>> Carbon-dev mailing list
> >>>> Carbon-dev at wso2.org
> >>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> >>>>
> >>>>
> >>>>
> >>>>
> >>> --
> >>> Ruwan Linton
> >>> Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
> >>> WSO2 Inc.; http://wso2.org
> >>> phone: +1 408 754 7388 ext 51789
> >>> email: ruwan at wso2.com; cell: +94 77 341 3097
> >>> blog: http://blog.ruwan.org
> >>>
> >>> Lean . Enterprise . Middleware
> >>>
> >>>
> >>> _______________________________________________
> >>> Carbon-dev mailing list
> >>> Carbon-dev at wso2.org
> >>> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> >>>
> >>> _______________________________________________
> >>> Carbon-dev mailing list
> >>> Carbon-dev at wso2.org
> >>> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> >>>
> >>>
> >>>
> >>
> >>
> >> --
> >> Ruwan Linton
> >> Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
> >> WSO2 Inc.; http://wso2.org
> >> phone: +1 408 754 7388 ext 51789
> >> email: ruwan at wso2.com; cell: +94 77 341 3097
> >> blog: http://blog.ruwan.org
> >>
> >> Lean . Enterprise . Middleware
> >>
> >>
> >> _______________________________________________
> >> Carbon-dev mailing list
> >> Carbon-dev at wso2.org
> >> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> >>
> >> _______________________________________________
> >> Carbon-dev mailing list
> >> Carbon-dev at wso2.org
> >> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> >>
> >>
> >
> >
> > --
> > Ruwan Linton
> > Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
> > WSO2 Inc.; http://wso2.org
> > phone: +1 408 754 7388 ext 51789
> > email: ruwan at wso2.com; cell: +94 77 341 3097
> > blog: http://blog.ruwan.org
> >
> > Lean . Enterprise . Middleware
> >
> >
> > _______________________________________________
> > Carbon-dev mailing list
> > Carbon-dev at wso2.org
> > https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> >
> > _______________________________________________
> > Carbon-dev mailing list
> > Carbon-dev at wso2.org
> > https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
> >
>
> _______________________________________________
> Carbon-dev mailing list
> Carbon-dev at wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
--
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.; http://wso2.com/
email: sanjiva at wso2.com; phone: +1 408 754 7388 x51726; cell: +94 77 787
6880
blog: http://sanjiva.weerawarana.org/
Lean . Enterprise . Middleware
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.wso2.org/pipermail/carbon-dev/attachments/20100319/7443cab0/attachment-0001.htm
More information about the Carbon-dev
mailing list