Hi Paul,
I added another line to the sequence "response".
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
Now error message was gone. But I only got Response Headers like below:
Status Code: 200 OK
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate
Cache-Control: no-cache
Connection: close
Content-Type: text/plain; charset=UTF-8
Cookie: JSESSIONID=BDC13D45CBE780E9C43FB6DC7BF05A80;
requestedURI=../../carbon/admin/index.jsp; Modernizr=;
current-breadcrumb=%23sequences+design_sequence.jsp*;
MSG13475236189200.47831456482532164=true;
MSG13475236419320.4023509058969713=true; MSG
13475236709970.3215811755231146=true
Date: Mon, 17 Sep 2012 09:44:20 GMT
Host: 64.104.170.65:8243
Pragma: no-cache
SSL_CLIENT_CERT: *********
SSL_CLIENT_I_DN: *********
SSL_CLIENT_S_DN: *************
SSL_CLIENT_S_DN_CN: ***************
SSL_CLIENT_VERIFY: SUCCESS
SSL_SERVER_S_DN_OU: Autotest
Server: Synapse-HttpComponents-NIO
Transfer-Encoding: chunked
X-Forwarded-For: 64.104.170.63
X-Forwarded-Host: 64.104.170.63:4433
X-Forwarded-Server: localhost.localdomain
But nothing was showed in Response Body. Any advise?
Regards,
Bin
On Tue, Sep 18, 2012 at 4:49 PM, Maeglin Vardamir <[email protected]> wrote:
> Hi Paul,
>
> It didn't work. From the console what I ran ./wso2server.sh, I got below
> error messages:
>
> [2012-09-17 16:37:50,658] DEBUG - LogMediator End : Log mediator
> [2012-09-17 16:37:50,659] DEBUG - PropertyMediator Start : Property
> mediator
> [2012-09-17 16:37:50,659] DEBUG - PropertyMediator Setting property :
> RESPONSE at scope : default to : true (i.e. constant : true)
> [2012-09-17 16:37:50,660] DEBUG - PropertyMediator End : Property mediator
> [2012-09-17 16:37:50,660] DEBUG - SendMediator Start : Send mediator
> [2012-09-17 16:37:50,700] DEBUG - SendMediator Sending response message
> using implicit message properties..
> Sending To: /services/myecho/FPAVResponse
> SOAPAction: null
> [2012-09-17 16:37:50,702] ERROR - HttpCoreNIOSender Malformed destination
> EPR : /services/myecho/FPAVResponse
> java.net.MalformedURLException: no protocol: /services/myecho/FPAVResponse
> at java.net.URL.<init>(URL.java:583)
> at java.net.URL.<init>(URL.java:480)
> at java.net.URL.<init>(URL.java:429)
> at
> org.apache.synapse.transport.nhttp.HttpCoreNIOSender.sendAsyncRequest(HttpCoreNIOSender.java:370)
> at
> org.apache.synapse.transport.nhttp.HttpCoreNIOSender.invoke(HttpCoreNIOSender.java:303)
> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
> at
> org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:159)
> at
> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:265)
> at
> org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:84)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:170)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> at
> org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMediator.java:30)
> at org.apache.synapse.config.xml.SwitchCase.mediate(SwitchCase.java:66)
> at
> org.apache.synapse.mediators.filters.SwitchMediator.mediate(SwitchMediator.java:116)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
> at
> org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:154)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
> at
> org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
> at
> org.apache.axis2.transport.http.util.RESTUtil.processXMLRequest(RESTUtil.java:89)
> at
> org.apache.synapse.transport.nhttp.util.RESTUtil.processPOSTRequest(RESTUtil.java:188)
> at
> org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:404)
> at
> org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)
> at
> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:679)
> [2012-09-17 16:37:50,708] ERROR - Axis2Sender Unexpected error sending
> message back
> org.apache.axis2.AxisFault: Malformed destination EPR :
> /services/myecho/FPAVResponse
> at
> org.apache.synapse.transport.nhttp.HttpCoreNIOSender.handleException(HttpCoreNIOSender.java:823)
> at
> org.apache.synapse.transport.nhttp.HttpCoreNIOSender.sendAsyncRequest(HttpCoreNIOSender.java:452)
> at
> org.apache.synapse.transport.nhttp.HttpCoreNIOSender.invoke(HttpCoreNIOSender.java:303)
> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
> at
> org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:159)
> at
> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:265)
> at
> org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:84)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:170)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> at
> org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMediator.java:30)
> at org.apache.synapse.config.xml.SwitchCase.mediate(SwitchCase.java:66)
> at
> org.apache.synapse.mediators.filters.SwitchMediator.mediate(SwitchMediator.java:116)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
> at
> org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:154)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
> at
> org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
> at
> org.apache.axis2.transport.http.util.RESTUtil.processXMLRequest(RESTUtil.java:89)
> at
> org.apache.synapse.transport.nhttp.util.RESTUtil.processPOSTRequest(RESTUtil.java:188)
> at
> org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:404)
> at
> org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)
> at
> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:679)
> Caused by: java.net.MalformedURLException: no protocol:
> /services/myecho/FPAVResponse
> at java.net.URL.<init>(URL.java:583)
> at java.net.URL.<init>(URL.java:480)
> at java.net.URL.<init>(URL.java:429)
> at
> org.apache.synapse.transport.nhttp.HttpCoreNIOSender.sendAsyncRequest(HttpCoreNIOSender.java:370)
> ... 25 more
> [2012-09-17 16:37:50,712] WARN - ProxyServiceMessageReceiver Exception
> encountered but no fault handler found - message dropped
>
> Maybe it is helpful for debugging.
>
> Thanks,
> Bin
>
> On Tue, Sep 18, 2012 at 4:23 PM, Anjana Fernando <[email protected]> wrote:
>
>> Hi,
>>
>> Also try putting "<header name="To" action="remove"/>" with the
>> "<property name="RESPONSE" value="true" scope="default"/>" and see.
>>
>> Cheers,
>> Anjana.
>>
>>
>> On Tue, Sep 18, 2012 at 1:40 PM, Maeglin Vardamir <[email protected]>wrote:
>>
>>> 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
>>>
>>>
>>
>>
>> --
>> *Anjana Fernando*
>> Associate Technical Lead
>> WSO2 Inc. | http://wso2.com
>> lean . enterprise . middleware
>>
>
>
_______________________________________________
User mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/user