You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jennifer Yip <je...@hotmail.com> on 2004/08/20 16:42:10 UTC

Dont let it spoil my weekend

Guys,

Please help:

Is there a standard approach to dealing with Soap-Env:Fault in Cocoon 
pipelines

Ok I think I understand the error handling aspects, when an exception is 
thrown, but picture this XSP file using the built in logic sheet:

referencedata.xsp

<xsp:page language="java"
  xmlns:xsp="http://apache.org/xsp"
  xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  xmlns:soap="http://apache.org/xsp/soap/3.0"
  xmlns:xscript="http://apache.org/xsp/xscript/1.0"
  xmlns:log="http://apache.org/xsp/log/2.0">
<page>
  <soap:call url="http://localhost:9999/axis/ReferenceService.jws" 
method="http://localhost/axis/getReferenceItems" >
   <s0:getReferenceItems xmlns:s0="http://localplace.com/">
     <s0:key><xsp-request:get-parameter name="key" /></s0:key>
   </s0:getReferenceItems>
  </soap:call>
</page>
</xsp:page>

The request etc works fine but I have just started testing exceptions in the 
soap service and these get transformed to soap-env:faults when response is 
received above.

The pipeline I currently have is

    <map:match pattern="referenceData.xsp">
      <map:generate type="serverpages" src="referenceData.xsp"/>
      <!--<map:transform src="refTest.xsl"/>-->
      <map:serialize type="xml"/>
    </map:match>

So guys of the development group HELP

do I xpath match in the transformer and then do what? use 1.4 Java Xalan 
extension to throw real exception.. putting in domain of error handler?

do I somehow switch on xpath test of output of referenceData.xsp? HOW?

or is there a 3rd place :)

Help guys

Jenny ... 2 week old cocooner...

_________________________________________________________________
Want to block unwanted pop-ups? Download the free MSN Toolbar now!  
http://toolbar.msn.co.uk/


Re: Dont let it spoil my weekend

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Jennifer Yip wrote:

> The request etc works fine but I have just started testing exceptions in 
> the soap service and these get transformed to soap-env:faults when 
> response is received above.

If you want to throw an exception when web service faults, I personally 
would use axis webservice client from the flowscript - and axis client 
will throw an exception (which you can either catch in flowscript or it 
will get propagated to the error handler).

If you don't want to use flowscript, you can write an action.

If do *not* want to throw exception but rather just display different 
result depending on the response, do it in xslt...

<xsl:choose>
   <xsl:when test="Soap-Env:Fault">
...

Pick right tool for the job...

Vadim