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

Asankha C. Perera commented on SYNAPSE-365:
-------------------------------------------

Hi Jasper

I got the latest Synapse build today (r 674403) and did the following:

1) Edit 
synapse-1.3-SNAPSHOT/samples/axis2Server/src/SimpleStockQuoteService/build.xml
2) Comment the following line as shown below
<!--copy file="wsdl/SimpleStockQuoteService.wsdl" 
tofile="${SSQ.dir}/META-INF/service.wsdl"/-->
3) Build the sample service, and deploy
4) Try to access this service from Firefox as follows:
http://localhost:9000/services/SimpleStockQuoteService/getSimpleQuote?symbol=IBM
5) Access from curl as follows:

You should get successful responses for both FF and curl

6) Now deploy the following synapse.xml and start Synapse
<definitions xmlns="http://ws.apache.org/ns/synapse";>
  <proxy name="Forwarder">
      <target>
          <endpoint>
              <address 
uri="http://localhost:9000/services/SimpleStockQuoteService"; format="get"/>
          </endpoint>
          <outSequence>
              <send/>
          </outSequence>
      </target>
  </proxy>
</definitions>

7) Access from browser
http://localhost:8280/services/Forwarder/SimpleStockQuoteService/getSimpleQuote?symbol=IBM

8) Access from curl
[EMAIL PROTECTED]:~/java/synapse-1.3-SNAPSHOT/bin$ curl -G -H "Content-Type: 
text/xml" 
http://localhost:8280/services/Forwarder/SimpleStockQuoteService/getSimpleQuote?symbol=IBM
<ns:getSimpleQuoteResponse xmlns:ns="http://services.samples";><ns:return 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:ax21="http://services.samples/xsd"; 
xsi:type="ax21:GetQuoteResponse"><ax21:change>-2.635855611254778</ax21:change><ax21:earnings>-9.211125187115655</ax21:earnings><ax21:high>70.98113922972296</ax21:high><ax21:last>67.67509318952094</ax21:last><ax21:lastTradeTimestamp>Mon
 Jul 07 16:55:56 IST 
2008</ax21:lastTradeTimestamp><ax21:low>70.58750010990072</ax21:low><ax21:marketCap>5.301255985996598E7</ax21:marketCap><ax21:name>IBM
 
Company</ax21:name><ax21:open>-66.1434053235991</ax21:open><ax21:peRatio>-19.06391318879267</ax21:peRatio><ax21:percentageChange>3.9306430170962074</ax21:percentageChange><ax21:prevClose>-67.05914527954351</ax21:prevClose><ax21:symbol>IBM</ax21:symbol><ax21:volume>18504</ax21:volume></ns:return></ns:getSimpleQuoteResponse>

Can you let me know if you encounter any problems running this now?

asankha

> 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