Re: Wanting to return an .XML document for a direct action
Re: Wanting to return an .XML document for a direct action
- Subject: Re: Wanting to return an .XML document for a direct action
- From: email@hidden
- Date: Thu, 6 Oct 2005 09:51:37 +0200
Bill,
appendToResponse
is a control point of the WebObjects request-response loop. You should
not call it yourself.
May I suggest you read up on the request-response
loop. This is really important stuff one needs to master.
Pierre
webobjects-dev-bounces+pierre.bernard=email@hidden
wrote on 10/06/2005 09:08:52 AM:
> Thanks Greg (but now I'm just a tad unclear on where and how to inject
the
> 'append')
>
> After reading a bunch on appendToResponse it looks like a WOComponent
can
> invoke this, so I started crafting my first attempt at appending a
response
> (sample immediately below). But I'm unclear on where to acquire
the current
> response object to pass as a reference to the overridden appendToResponse
> method. Can anyone point me in the right direction? (as always,
greatly
> appreciated!)
>
> -Bill
>
> //my attempt listed immediately below this line...
>
> public class Main extends WOComponent {
>
> public Main(WOContext context) {
> super(context);
> appendToResponse(this.response, context);
> }
>
> public void appendToResponse(WOResponse response, WOContext
context) {
> super.appendToResponse(response, context);
> response.setHeader("text/xml",
"content-type");
> }
>
> }
>
>
> on 10/3/05 03:35, Greg at email@hidden wrote:
>
> > You'll also want to override appendToResponse to set the content
type
> > to text/xml
> >
> > public void appendToResponse(WOResponse response, WOContext context)
{
> > super.appendToResponse(response,
context);
> > response.setHeader("text/xml"),
"content-type");
> > }
> >
> > On 03/10/2005, at 7:42 PM, Blue Moon wrote:
> >
> >> You create a normal WOComponent, say MyComponent, but instead
of
> >> putting HTML in the MyComponent.html you put XML in it. Return
this
> >> component as result of the DirectAction call. That's all.
> >>
> >> E.g.
> >> MyComponent.html file content:
> >> <?xml version="1.0" encoding="windows-1252"?>
> >> <result>
> >> <approvalcode><webobject name=approvalcode></webobject></
> >> approvalcode>
> >> <approvalmsg><webobject name=approvalmsg></webobject></
> >> approvalmsg>
> >> </result>
> >>
> >> MyComponent.wod file content:
> >> approvalcode: WOString {
> >> value = nameOfMyApprovalCodeMethod;
> >> }
> >>
> >> approvalmsg: WOString {
> >> value = nameOfMyApprovalMessageMethod;
> >> }
> >>
> >> Hope this helps.
> >>
> >> Rudi Angela
> >>
> >> On Oct 2, 2005, at 10:21 PM, WebObjects wrote:
> >>
> >>> Trying to establish the best solution to work with the
following
> >>> scenario:
> >>>
> >>> I have a vendor whose application needs to query our
db. We have
> >>> established http as a transport standard, and I have
open rights
> >>> to design whatever WO.app I want on the backend.
> >>> Ideally the 3rd party wants to submit a URL to our application,
> >>> for example something like http://mydomain.com/cgi-bin/WebObjects/
> >>> myapp.woa/wa/myaction?uid=joe?pwd=1234
> >>> and in return I¹m to send back an XML document with elements
like
> >>> Œapprovalcode=1¹, Œapprovalmsg=here is some text¹.
> >>>
> >>> What is the easiest way to return an XML doc?
> >>>
> >>> Naturally I¹ve poked around with the ŒCalculator¹ example
of
> >>> WebServices; but this may mandate that they design their
> >>> application to be a Œconsumer¹ when all they may really
want to do
> >>> is parse a resulting XML document w/out a lot of fuss.
> >>>
> >>> Thanks for any guidance,
> >>>
> >>> -Bill Reynolds
> >> _______________________________________________
> >> Do not post admin requests to the list. They will be ignored.
> >> Webobjects-dev mailing list (email@hidden)
> >> Help/Unsubscribe/Update your Subscription:
> >> 40framedphotographics.com
> >>
> >> This email sent to email@hidden
> >
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden