[ 
https://issues.apache.org/jira/browse/SYNAPSE-365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614594#action_12614594
 ] 

keitha commented on SYNAPSE-365:
--------------------------------

If I may add a comment on this issue has I have a very simple test case that 
does not work and is easy to reproduce.

The background to this is I wish to proxy and transform some xml that is 
accessed in normal RESTful manner (GET). However the actual server is not 
available to me all the time for development, so I thought to use some static 
xml pages in place of the actual server.

The environment I am working in is XP Pro - everything is on the local machine.

In place of the actual server application I deployed an xml file to IIS 5.1. 
This can easily be viewed in a web browser at the address 
http://localhost/fdc-xml/test.xml

Here is the response headers for my GET request from firebug:

Response Headers
Server  Microsoft-IIS/5.1
X-Powered-By    ASP.NET
Date    Fri, 18 Jul 2008 00:35:40 GMT
Content-Type    text/xml
Accept-Ranges   bytes
Last-Modified   Thu, 17 Jul 2008 11:25:17 GMT
Etag    "25f6dcaffe7c81:f6b"
Content-Length  173


And here is the actual response (again from firebug. I use a very simple 
example here):

<docroot>
  <parent>parent 1
    <child>child 1</child>
    <child>child 2</child>
  </parent>
  <parent>parent 2
    <child>child 3</child>
  </parent>
</docroot>

So, if I am correct although it is a trivial example of a static xml file, this 
is also a perfectly valid RESTful web service.

Now I set up a proxy in Synapse:

<?xml version="1.0" encoding="UTF-8"?>
<syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse";>
    <syn:registry provider="org.wso2.esb.registry.WSO2Registry"/>
    <syn:proxy name="xmltest" startOnLoad="true" statistics="enable" 
trace="enable">
        <syn:target>
            <syn:endpoint>
                <syn:address uri="http://localhost/fdc-xml/test.xml"; 
format="get"/>
            </syn:endpoint>
            <syn:outSequence>
                <syn:send/>
            </syn:outSequence>
        </syn:target>
    </syn:proxy>
    <syn:sequence name="fault"/>
    <syn:sequence name="main"/>
</syn:definitions>

I then try and access the proxied service from the following address:

http://localhost:8280/soap/xmltest/mediate (I hope this bit is correct, could 
not find good documentation).

I have run this test for both 1.7 and ESB-NIGHTLY-82 and neither works, 
although the results are different:

In the 1.7 release the error is an http 500 in the browser. In the log:

    ERROR [18 Jul 2008 00:38:56] ServerWorker - Error processing GET request 
for: /soap/xmltest/mediate

In ESB-NIGHTLY-82 there is an http 404 in the browser. In the log:

    WARN [18 Jul 2008 00:46:20] ClientHandler - Unexpected HTTP status code 
received : 404 :: Object Not Found  

    WARN [18 Jul 2008 00:46:20] ClientHandler - Received an unexpected response 
- of content type : text/html and status code : 404 with reason : Object Not 
Found  

    WARN [18 Jul 2008 00:46:20] ClientWorker - Unexpected response received : 
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 
34) in DOCTYPE declaration; expected a space between public and system 
identifiers at [row,col {unknown-source}]: [1,55]  


For the nightly build here is the response header from firebug:
Content-Type    application/xml; charset=UTF-8
Date    Fri, 18 Jul 2008 00:53:27 GMT
Server  Synapse-HttpComponents-NIO
Transfer-Encoding       chunked
Connection      keep-alive

And here is the response:
<Exception>Unexpected response received : 
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 
34) in DOCTYPE declaration; expected a space between public and system 
identifiers&#xd; at [row,col {unknown-source}]: [1,55]</Exception>


I hope this is clear enough that you can reproduce (or, if my mistake in 
configuration or access please let me know).

Thanks, Keith


> REST support not working in synapse 1.2
> ---------------------------------------
>
>                 Key: SYNAPSE-365
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-365
>             Project: Synapse
>          Issue Type: Bug
>          Components: Endpoints, Proxy Services, Transports
>            Reporter: Jasper Spoel
>            Assignee: Asankha C. Perera
>             Fix For: NIGHTLY
>
>
> When submitting a GET request to a synapse proxy service that points to a 
> REST webservice
> AND Content-Type is not text/xml or application/xml the error: "Cannot create 
> DocumentElement without destination EPR" comes out. (e.g try to approach the 
> service proxy with a webbrowers and it will do this)
> configuration is as follows:
> <definitions xmlns="http://ws.apache.org/ns/synapse";>
>   <proxy name="Forwarder">
>       <target>
>           <endpoint>
>               <address uri="http://localhost:11111/MyService/echo"; 
> format="get"/>
>           </endpoint>
>           <outSequence>
>               <send/>
>           </outSequence>
>       </target>
>   </proxy>
> </definitions>
> If the message is send with the 'correct' content-type like for example so: 
> curl -G -H "Content-Type: text/xml" http://localhost:8280/Forwarder/mediate
> Synapse gives me the following output:
> 2008-06-18 15:10:59,714 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG ServerHandler HTTP connection [/0:0:0:0:0:0:0:1%0:56697]: Connected
> 2008-06-18 15:10:59,732 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG ServerHandler HTTP connection [/0:0:0:0:0:0:0:1%0:56697]: GET 
> /soap/Forwarder/mediate HTTP/1.1
> 2008-06-18 15:10:59,780 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG headers >> GET /soap/Forwarder/mediate HTTP/1.1
> 2008-06-18 15:10:59,780 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG headers >> User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) 
> libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
> 2008-06-18 15:10:59,780 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG headers >> Host: localhost:8280
> 2008-06-18 15:10:59,780 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG headers >> Accept: */*
> 2008-06-18 15:10:59,780 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG headers >> Content-Type:application/xml
> 2008-06-18 15:10:59,797 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG TransportUtils createSOAPEnvelope using Builder (class 
> org.apache.axis2.builder.ApplicationXMLBuilder) selected from type 
> (application/xml)
> 2008-06-18 15:10:59,841 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG SynapseMessageReceiver Synapse received a new message for message 
> mediation...
> 2008-06-18 15:10:59,841 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG SynapseMessageReceiver Received To: null
> 2008-06-18 15:10:59,841 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG SynapseMessageReceiver SOAPAction: null
> 2008-06-18 15:10:59,843 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG SynapseMessageReceiver WSA-Action: null
> 2008-06-18 15:10:59,845 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG Axis2SynapseEnvironment Injecting MessageContext
> 2008-06-18 15:10:59,845 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG Axis2SynapseEnvironment Using Main Sequence for injected message
> 2008-06-18 15:10:59,845 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG SequenceMediator Start : Sequence <main>
> 2008-06-18 15:10:59,845 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG SequenceMediator Sequence <SequenceMediator> :: mediate()
> 2008-06-18 15:10:59,846 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG LogMediator Start : Log mediator
> 2008-06-18 15:10:59,846 [10.0.0.12-equilibrium.local] [HttpServerWorker-1]  
> INFO LogMediator To: , MessageID: urn:uuid:27AA6F4DF24676A7641213794659778, 
> Direction: request
> 2008-06-18 15:10:59,846 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG LogMediator End : Log mediator
> 2008-06-18 15:10:59,846 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG DropMediator Start : Drop mediator
> 2008-06-18 15:10:59,852 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG DropMediator End : Drop mediator
> 2008-06-18 15:10:59,852 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG SequenceMediator End : Sequence <main>
> 2008-06-18 15:10:59,853 [10.0.0.12-equilibrium.local] [HttpServerWorker-1] 
> DEBUG ServerWorker Sending 202 Accepted response for MessageID : 
> urn:uuid:27AA6F4DF24676A7641213794659778 response written : null response 
> will follow : true acked : false forced ack : false
> 2008-06-18 15:10:59,862 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG ServerHandler HTTP connection [localhost/0:0:0:0:0:0:0:1%0:56697]: 
> Output ready
> 2008-06-18 15:10:59,863 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG ServerHandler HTTP connection [localhost/0:0:0:0:0:0:0:1%0:56697]: 
> Content encoder [chunk-coded; completed: true]
> 2008-06-18 15:10:59,864 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG ServerHandler HTTP connection [localhost/0:0:0:0:0:0:0:1%0:56697]: 
> Response ready
> 2008-06-18 15:10:59,865 [10.0.0.12-equilibrium.local] [I/O dispatcher 5] 
> DEBUG ServerHandler HTTP connection [closed]: Closed

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to