Hi Paul, My sequence is like below:
[belcon@localhost sequences]$ cat response.xml <?xml version="1.0" encoding="UTF-8"?> <sequence xmlns="http://ws.apache.org/ns/synapse" name="response"> <log/> <payloadFactory> <format> <ResponseMessage message="response" /> </format> </payloadFactory> <property name="RESPONSE" value="true" scope="default"/> <send/> </sequence> My proxy configuration is like below: [belcon@localhost sequences]$ cat ../proxy-services/myecho.xml <?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="myecho" transports="https http" startOnLoad="true" trace="disable"> <target> <inSequence> <sequence key="response"/> </inSequence> <outSequence> <send/> </outSequence> </target> <publishWSDL uri=" http://64.104.170.63:8080/cesium/services/FPAVService?wsdl"/> </proxy> What I got is like below: [belcon@localhost sequences]$ cat /tmp/tmp.txt <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>502 Proxy Error</title> </head><body> <h1>Proxy Error</h1> <p>The proxy server received an invalid response from an upstream server.<br /> The proxy server could not handle the request <em><a href="/myecho/">POST /myecho/</a></em>.<p> Reason: <strong>Error reading from remote server</strong></p></p> <hr> <address>Apache/2.2.3 (Red Hat) Server at 64.104.170.63 Port 4433</address> </body></html> Did I make any mistakes? Thanks, Bin On Tue, Sep 18, 2012 at 1:50 PM, Paul Fremantle <[email protected]> wrote: > Maeglin > > Its not the Fault mediator that changes the direction :-) That just > creates the message. I misremembered that sample. > > If you look here: > http://synapse.apache.org/Synapse_Configuration_Language.html > > There are some well-defined properties that you can get/set on the Synapse > message context scope: > > - RESPONSE - 'true' means the message is to be marked as a response > message > > so if you use the following in the <in> sequence. > <property name="RESPONSE" value="true"/> > <send/> > That will send the current "in message" back to the client. > Paul > > On 18 September 2012 06:34, Maeglin Vardamir <[email protected]> wrote: > >> Hi Paul, >> >> I had already found that sample. I guess that FAULT mediator can change >> the direction of the message. But I want to compose a rest xml before send >> it back to the requester. I doubt that FAULT mediator can do that. So the >> question is how I can redirect the message without FAULT mediator. Or how >> can I compose a formatted XML in FAULT mediator? >> >> Thanks a lot. >> >> Regards, >> Bin >> >> >> On Tue, Sep 18, 2012 at 1:26 PM, Paul Fremantle <[email protected]> wrote: >> >>> Maeglin >>> >>> You need to follow this sample: >>> >>> http://synapse.apache.org/Synapse_Samples.html#Sample5 >>> >>> Hope this helps! >>> >>> Paul >>> >>> On 18 September 2012 06:07, Maeglin Vardamir <[email protected]> wrote: >>> >>>> Hi guys, >>>> >>>> I want to check some conditions in the in-sequence. Replay a >>>> warning/error message when any illegal message were found. Before send any >>>> messages to the requester, I use payloadFactory mediator to form the xml >>>> error message. Then send it back to the requester. How can I do that? I >>>> tried to add >>>> >>>> <send/> >>>> <sequence>out</sequence> >>>> >>>> below the payloadFactory mediator but it didn't work. >>>> >>>> Thanks, >>>> Bin >>>> >>>> _______________________________________________ >>>> User mailing list >>>> [email protected] >>>> http://wso2.org/cgi-bin/mailman/listinfo/user >>>> >>>> >>> >>> >>> -- >>> Paul Fremantle >>> CTO and Co-Founder, WSO2 >>> OASIS WS-RX TC Co-chair, VP, Apache Synapse >>> >>> UK: +44 207 096 0336 >>> US: +1 646 595 7614 >>> >>> blog: http://pzf.fremantle.org >>> twitter.com/pzfreo >>> [email protected] >>> >>> wso2.com Lean Enterprise Middleware >>> >>> Disclaimer: This communication may contain privileged or other >>> confidential information and is intended exclusively for the addressee/s. >>> If you are not the intended recipient/s, or believe that you may have >>> received this communication in error, please reply to the sender indicating >>> that fact and delete the copy you received and in addition, you should not >>> print, copy, retransmit, disseminate, or otherwise use the information >>> contained in this communication. Internet communications cannot be >>> guaranteed to be timely, secure, error or virus-free. The sender does not >>> accept liability for any errors or omissions. >>> >>> >> > > > -- > Paul Fremantle > CTO and Co-Founder, WSO2 > OASIS WS-RX TC Co-chair, VP, Apache Synapse > > UK: +44 207 096 0336 > US: +1 646 595 7614 > > blog: http://pzf.fremantle.org > twitter.com/pzfreo > [email protected] > > wso2.com Lean Enterprise Middleware > > Disclaimer: This communication may contain privileged or other > confidential information and is intended exclusively for the addressee/s. > If you are not the intended recipient/s, or believe that you may have > received this communication in error, please reply to the sender indicating > that fact and delete the copy you received and in addition, you should not > print, copy, retransmit, disseminate, or otherwise use the information > contained in this communication. Internet communications cannot be > guaranteed to be timely, secure, error or virus-free. The sender does not > accept liability for any errors or omissions. > >
_______________________________________________ User mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/user
