Re: Inter Server Communications
Peter Sparkes <[email protected]>
| Newsgroups | gmane.text.xml.cocoon.user |
|---|---|
| Message-ID | <[email protected]> |
Now working. Thanks to all. I used xslt to generate the cinclude, to insert the variables Regards Peter On 17/05/2013 23:53, Thorsten Scherler wrote: > On 05/17/2013 05:20 PM, Peter Sparkes wrote: >> Hi >> >> I have an application in which I require to send a POST request from >> the server to another non Cocoon website ( to set parameters for a >> newsletter which uses phplist newsletter software) and the response >> would be in JSON > Highly depends on your underlying usecase what to do with the response > and further the cocoon version you are using. I lately use the REST-way > in c3 but you can post anything with cinclude in 2.1.x like: > > <cinclude:includexml> > <cinclude:src>http://10.231.27.63/sql_templates/</cinclude:src> > <cinclude:configuration> > <cinclude:parameter> > <cinclude:name>method</cinclude:name> > <cinclude:value>POST</cinclude:value> > </cinclude:parameter> > </cinclude:configuration> > <cinclude:parameters> > <cinclude:parameter> > <cinclude:name>text</cinclude:name> > <cinclude:value> > <ROOT xmlns:sql="urn:schemas-microsoft-com:xml-sql"> > <sql:xpath-query xmlns:lsa="blah" > mapping-schema="schema/address.xsd">(/lsa:Address)</sql:xpath-query> > </ROOT> > </cinclude:value> > </cinclude:parameter> > </cinclude:parameters> > </cinclude:includexml> > > as described in http://mail-archives.apache.org/mod_mbox/cocoon-users/200512.mbox/%3C06B403677C41D51194550002A55107D2057B8993@s5-stf1-r1.nrn.nrcan.gc.ca%3E > > >> This would be server to server without any client browser being involved > Actually if I understand your usecase that is not 100% needed. The user > has the newsletter form generated by cocoon and the result has to go to > the php server. IF the php is reachable form the "outside" then a simple > javascript would do to treat the response. If not I recommend a httpd in > front and there just proxy/rewrite the request to the different server. > > salu2 > >> How do I do this? >> >> Help please >> >> Peter >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >