Hi Ruwan,
Thanks again for all your help. I built from the trunk and re-ran my
configuration and the sample #50 configuration with the change you
suggested. Initially, sample #50 succeeds, and my configuration fails.
In addition to using sample #50 with the axis2Client ant task to post
the XML and the axis2Server as the service, I also tried a different
client and server implementations and configurations. For example, I
created a mock server in php on apache that returns the stock quote
xml, and i used curl to send the XML (removing the soap-centric
"SOAPAction: urn:getQuote" header). I tried several different
permutations, and the ultimate result is that nothing really works
reliably except the implementations shipped with synapse. The most
common exceptions I see are:
1) org.apache.axis2.AxisFault: Cannot create DocumentElement without
destination EPR
2) ClientWorker Fault creating response SOAP envelope org.apache.axis2.AxisFault
Caused by: java.nio.channels.ClosedChannelException

If you want to try supplementing different implementations for the
ones shipped with synapse, you can try the ones I used:
For the stock quote service:
http://tunnel19.com/synapseStockQuote.php
For the client:
curl -d "<m0:getQuote
xmlns:m0=\"http://services.samples/xsd\";><m0:request><m0:symbol>IBM</m0:symbol></m0:request></m0:getQuote>"
http://localhost:8080/soap/StockQuote

In any case, I'll wait until the release comes out and test again.
Best,
Garth


On Fri, May 2, 2008 at 11:25 PM, Ruwan Linton <[EMAIL PROTECTED]> wrote:
> Garth,
>
>  OK, I got the point. I think POX support in synapse-1.1.1 release was not
>  that solid. But now all it is fixed and if you could build synapse from the
>  trunk, you will be able to get this working without any issue. We are
>  planing to do a release in the middle of this month, so if you can wait for
>  this release, or build synapse from the svn trunk this is already fixed.
>  Unfortunately we do not have a nightly build setup yet. So if you have any
>  trouble in building synapse, I would like to make a build available to you
>  to test this?
>
>  What do you prefer?
>
>  PS: You don't have to use the format="POX" in the latest build, if the
>  request from the client is POX and also you want to send POX to the actual
>  service and all the response will be identified by synapse as POX messages
>  and forwarded back to the client as POX.
>
>  Thanks,
>  Ruwan
>
>
>
>  On Sat, May 3, 2008 at 7:24 AM, Garth Patil <[EMAIL PROTECTED]> wrote:
>
>  > Hi Ruwan,
>  > I'm using synapse-1.1.1. If I remove the format="pox" from my original
>  > configuration, or use your filter configuration (both attached), I get
>  > a new series of errors. Synapse now wraps the request to the remote
>  > server in a soap envelope, instead of leaving it unadulterated. The
>  > request gets turned from this:
>  >
>  > <?xml version="1.0" ?>
>  > <request>
>  >  <message>
>  >   <recipient>abc1234</recipient>
>  >   <text>Test message.</text>
>  >  </message>
>  > </request>
>  >
>  > into this:
>  >
>  > <?xml version='1.0' encoding='utf-8'?>
>  > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
>  > ">
>  >  <soapenv:Body>
>  >     <request>
>  >      <message>
>  >        <recipient>abc1234</recipient>
>  >        <text>Test message.</text>
>  >      </message>
>  >    </request>
>  >   </soapenv:Body>
>  > </soapenv:Envelope>
>  >
>  > Then, because the remote server cannot understand the xml, it produces
>  > a validation error that looks like this:
>  >
>  > <?xml version="1.0" ?>
>  > <response>
>  >   <status>4</status>
>  > </response>
>  >
>  > Synapse is unhappy with that response and throws the following
>  > exception in the debug logs, probably because it is expecting some
>  > kind of SOAP response:
>  >
>  > 2008-05-02 18:39:02,985 [172.22.1.144-garth.corp.4info.net]
>  > [HttpClientWorker-3] ERROR ClientWorker Unexpected response received
>  > org.apache.axiom.soap.SOAPProcessingException: First Element must
>  > contain the local name, Envelope , but found response
>  >        at
>  > 
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:219)
>  >        at
>  > 
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:177)
>  >        at
>  > org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:163)
>  >        at
>  > 
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:161)
>  >        at
>  > 
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:110)
>  >        at
>  > org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:53)
>  >        at
>  > 
> org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:160)
>  >        at
>  > 
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:111)
>  >        at
>  > org.apache.synapse.transport.nhttp.ClientWorker.run(ClientWorker.java:160)
>  >        at
>  > 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>  >        at
>  > 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>  >        at java.lang.Thread.run(Thread.java:595)
>  >
>  > Synapse then responds to the client with a SOAP fault:
>  >
>  > <?xml version='1.0' encoding='utf-8'?>
>  > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
>  > ">
>  >  <soapenv:Body>
>  >    <soapenv:Fault>
>  >      <faultcode>200</faultcode>
>  >      <faultstring>OK</faultstring>
>  >      <detail>Unexpected response received : First Element must
>  > contain the local name, Envelope , but found response</detail>
>  >    </soapenv:Fault>
>  >  </soapenv:Body>
>  > </soapenv:Envelope>
>  >
>  > Thanks,
>  > Garth
>  >
>  > On Fri, May 2, 2008 at 6:27 PM, Ruwan Linton <[EMAIL PROTECTED]>
>  > wrote:
>  > > Hi Garth,
>  > >
>  > >  I just checked this with our sample client and it seems to work fine. I
>  > sent
>  > >  a XML payload to the proxy on Synapse and forwarded that message to the
>  > >  sample service (SimpleStockQuoteService) and send back the response.
>  > (You
>  > >  don't need to use the format="pox" in the endpoint because you are
>  > sending a
>  > >  POX payload) You may verify this by running the sample 50 [1] after
>  > changing
>  > >  the address endpoint to remove the format="soap11".
>  > >
>  > >
>  > >  <definitions xmlns="http://ws.apache.org/ns/synapse";>
>  > >     <!-- filtering of messages with XPath and regex matches -->
>  > >     <filter source="get-property('To')" regex=".*/StockQuote.*">
>  > >         <send>
>  > >             <endpoint>
>  > >                 <address
>  > >  uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
>  > >             </endpoint>
>  > >         </send>
>  > >         <drop/>
>  > >     </filter>
>  > >     <send/>
>  > >  </definitions>
>  > >
>  > >
>  > >  BTW: what is the version of synapse that you are using?
>  > >
>  > >  [1] - http://synapse.apache.org/Synapse_Samples.html#Sample50
>  > >
>  > >  Thanks,
>  > >  Ruwan
>  > >
>  > >
>  > >
>  > >  On Fri, May 2, 2008 at 11:23 PM, Garth Patil <[EMAIL PROTECTED]>
>  > wrote:
>  > >
>  > >  > log4j.category.org.apache.synapse=DEBUG
>  > >  > log attached.
>  > >  > Thanks,
>  > >  > Garth
>  > >  >
>  > >  > On Fri, May 2, 2008 at 10:37 AM, Ruwan Linton <[EMAIL PROTECTED]
>  > >
>  > >  > wrote:
>  > >  > > Hi Garth,
>  > >  > >
>  > >  > >  Thanks for the information, could you please send us the synapse
>  > DEBUG
>  > >  > log
>  > >  > >  as well. You can change the log level by editing the
>  > >  > lib/log4j.properties
>  > >  > >  file to enable DEBUG logs.
>  > >  > >
>  > >  > >  Thanks,
>  > >  > >  Ruwan
>  > >  > >
>  > >  > >
>  > >  > >
>  > >  > >  On Fri, May 2, 2008 at 10:56 PM, Garth Patil <[EMAIL PROTECTED]
>  > >
>  > >  > wrote:
>  > >  > >
>  > >  > >  > The request and response from the actual service is not SOAP. It
>  > is
>  > >  > >  > just XML. While I understand that synapse is very SOAP-centric,
>  > in
>  > >  > >  > this case, I want to use synapse to proxy the request for
>  > logging.
>  > >  > >  > The request to synapse looks like this:
>  > >  > >  >
>  > >  > >  > <?xml version="1.0" ?>
>  > >  > >  > <request>
>  > >  > >  >  <message>
>  > >  > >  >    <recipient>abc1234</recipient>
>  > >  > >  >    <text>Test message.</text>
>  > >  > >  >  </message>
>  > >  > >  > </request>
>  > >  > >  >
>  > >  > >  > Synapse passes the request on to the actual service without
>  > changing
>  > >  > >  > the XML. The request to the actual service looks exactly the
>  > same
>  > >  > >  > The response from the actual service looks like this:
>  > >  > >  >
>  > >  > >  > <?xml version="1.0" ?>
>  > >  > >  > <response>
>  > >  > >  >  <requestId>F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6</requestId>
>  > >  > >  >  <status>1status>
>  > >  > >  > </response>
>  > >  > >  >
>  > >  > >  > But the response returned by synapse adds the soapenv:Body and
>  > >  > >  > soapenv:Envelope tags to the response:
>  > >  > >  >
>  > >  > >  > <?xml version="1.0" ?>
>  > >  > >  > <soapenv:Envelope>
>  > >  > >  >  <soapenv:Body>
>  > >  > >  >    <response>
>  > >  > >  >      <requestId>F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6</requestId>
>  > >  > >  >      <status>1status>
>  > >  > >  >    </response>
>  > >  > >  >  </soapenv:Body>
>  > >  > >  > </soapenv:Envelope>
>  > >  > >  >
>  > >  > >  > Thanks to everyone for the help.
>  > >  > >  > Best,
>  > >  > >  > Garth
>  > >  > >  >
>  > >  > >  > On Thu, May 1, 2008 at 10:11 PM, Asankha C. Perera <
>  > [EMAIL PROTECTED]>
>  > >  > >  > wrote:
>  > >  > >  > > Garth
>  > >  > >  > >
>  > >  > >  > >  Could you post a sample request sent to Synapse? I think the
>  > >  > problem
>  > >  > >  > here
>  > >  > >  > > is that Synapse "detects" your original request as SOAP.
>  > Probably
>  > >  > this
>  > >  > >  > is
>  > >  > >  > > due to the content type of the message. Is there a possibility
>  > for
>  > >  > you
>  > >  > >  > to
>  > >  > >  > > use the TCPMon to capture an input message and post it here?
>  > >  > >  > >
>  > >  > >  > >  asankha
>  > >  > >  > >
>  > >  > >  > >
>  > >  > >  > >
>  > >  > >  > >
>  > >  > >  > >  Ruwan Linton wrote:
>  > >  > >  > >
>  > >  > >  > > > Hi Garth,
>  > >  > >  > > >
>  > >  > >  > > > Is it the actual web service which returns SOAP as the
>  > response
>  > >  > for
>  > >  > >  > POX
>  > >  > >  > > > (XML/HTTP) request, or Synapse. If it is the former you need
>  > to
>  > >  > ask
>  > >  > >  > this
>  > >  > >  > > > question from the web service container guys...
>  > >  > >  > > >
>  > >  > >  > > > If the request you send to synapse is POX then synapse will
>  > >  > respond to
>  > >  > >  > you
>  > >  > >  > > > as POX regardless of whether it receives a SOAP or POX..
>  > >  > >  > > >
>  > >  > >  > > > Could you please clarify the problem a little bit more?
>  > >  > >  > > >
>  > >  > >  > > > Thanks,
>  > >  > >  > > > Ruwan
>  > >  > >  > > >
>  > >  > >  > > > On Fri, May 2, 2008 at 3:04 AM, Garth Patil <
>  > [EMAIL PROTECTED]
>  > >  > >
>  > >  > >  > wrote:
>  > >  > >  > > >
>  > >  > >  > > >
>  > >  > >  > > >
>  > >  > >  > > > > Hi All,
>  > >  > >  > > > > I'm using synapse to proxy a web service that uses XML
>  > over
>  > >  > HTTP. My
>  > >  > >  > > > > configuration looks like this:
>  > >  > >  > > > > <definitions xmlns= "http://ws.apache.org/ns/synapse";>
>  > >  > >  > > > >  <proxy name="TestProxy">
>  > >  > >  > > > >   <target>
>  > >  > >  > > > >     <endpoint>
>  > >  > >  > > > >       <address uri="http://someremoteservice.com/msg";
>  > >  > format="pox"
>  > >  > >  > />
>  > >  > >  > > > >     </endpoint>
>  > >  > >  > > > >     <inSequence>
>  > >  > >  > > > >       <log level= "full" />
>  > >  > >  > > > >     </inSequence>
>  > >  > >  > > > >     <outSequence>
>  > >  > >  > > > >       <log level= "full" />
>  > >  > >  > > > >       <send />
>  > >  > >  > > > >     </outSequence>
>  > >  > >  > > > >   </target>
>  > >  > >  > > > >  </proxy>
>  > >  > >  > > > > </definitions>
>  > >  > >  > > > >
>  > >  > >  > > > > I post XML to localhost:8080/soap/TestProxy, and synapse
>  > passes
>  > >  > it
>  > >  > >  > to
>  > >  > >  > > > > the specified endpoint without changing it. The remote
>  > service
>  > >  > >  > returns
>  > >  > >  > > > > XML which is wrapped in soapenv:Body and soapenv:Envelope
>  > tags.
>  > >  > Is
>  > >  > >  > > > > there a way to specify that the response (like the
>  > request)
>  > >  > remain
>  > >  > >  > > > > unadulterated by SOAP tags?
>  > >  > >  > > > > Thanks,
>  > >  > >  > > > > Garth
>  > >  > >  > > > >
>  > >  > >  > > > >
>  > >  > >  > > > >
>  > >  > >  > > >
>  > >  > >  > > >
>  > >  > >  > > >
>  > >  > >  > > >
>  > >  > >  > > >
>  > >  > >  > >
>  > >  > >  >
>  > >  > >
>  > >  > >
>  > >  > >
>  > >  > >
>  > >  > >
>  > >  > > --
>  > >  > >  Ruwan Linton
>  > >  > >  http://www.wso2.org - "Oxygenating the Web Services Platform"
>  > >  > >
>  > >  >
>  > >
>  > >
>  > >
>  > >  --
>  > >
>  > >
>  > > Ruwan Linton
>  > >  http://www.wso2.org - "Oxygenating the Web Services Platform"
>  > >
>  >
>
>
>
>  --
>
>
> Ruwan Linton
>  http://www.wso2.org - "Oxygenating the Web Services Platform"
>

Reply via email to