You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Soactive Inc <so...@gmail.com> on 2007/04/19 09:44:28 UTC

Axis2 dispatcher and receiver

I am trying to use axis2 to dispatch all requests to a particular service.
This service also has a registered receiver which executes the appropriate
business logic (essentially calling other external services). All logic is
currently within the receiver and there is not much to be done in the actual
service invoked by the dispatcher. I am faced with an issue where the
receiver is being called but not the service. Is there a particular
signature for the service operation that I need to use. Currently I use the
following:

public boolean mediate(MessageContext synCtx) {...}

I am wondering why the receiver is invoked but not the actual service. Is
there a way to return / truncate processing directly from the receiver back
to the caller?

Thanks in advance,
Ron

Re: Axis2 dispatcher and receiver

Posted by Paul Fremantle <pz...@gmail.com>.
Ron

Can you explain what you mean? I don't quite get the meaning of
"without hardwiring any service information".

I can see several possible interpretations:

1) You want all service requests to go to a single external service
independent of the incoming request
2) You want requests to go to external services based on something in
the message (maybe a header?) but not hardwired in the synapse config.
3) probably some other options I havent thought of!

Paul

On 4/20/07, Soactive Inc <so...@gmail.com> wrote:
> Can you or someone else provide a step by step approach (concrete example)
> to use Synapse to route to a simple external service without hardwiring any
> service information within the Synapse configuration.
>
> I have tried to use Synapse but so far it doesn't seem to work for me.
>
>
> On 4/20/07, Paul Fremantle <pz...@gmail.com> wrote:
> >
> > Ron
> >
> > You might like to take a look at Apache Synapse
> > (http://ws.apache.org/synapse) which is build on top of Axis2 and does
> > exactly that.
> >
> > We have a flexible model where you can deploy any mediation before
> > routing the message on to an external service.
> >
> > Paul
> >
> > On 4/19/07, Soactive Inc <so...@gmail.com> wrote:
> > > I am trying to use axis2 to dispatch all requests to a particular
> service.
> > > This service also has a registered receiver which executes the
> appropriate
> > > business logic (essentially calling other external services). All logic
> is
> > > currently within the receiver and there is not much to be done in the
> actual
> > > service invoked by the dispatcher. I am faced with an issue where the
> > > receiver is being called but not the service. Is there a particular
> > > signature for the service operation that I need to use. Currently I use
> the
> > > following:
> > >
> > > public boolean mediate(MessageContext synCtx) {...}
> > >
> > > I am wondering why the receiver is invoked but not the actual service.
> Is
> > > there a way to return / truncate processing directly from the receiver
> back
> > > to the caller?
> > >
> > > Thanks in advance,
> > > Ron
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>


-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Fwd: Axis2 dispatcher and receiver

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Martin

The 'ant stockquote' is a much used and tested sample client in Synapse. 
So I am wondering if the error you encountered was due to something else 
going wrong (say on the server side)? Could you let me know the server 
configuration you were using (i.e. was is ./synapse.sh or did you 
specify a "-sample n" option etc) and did your sample Axis2 server start 
correctly etc.. also let me know your OS & JDK versions and Ant version 
just incase...

asankha

Paul Fremantle wrote:
> Forwarding from axis-user
>
> ---------- Forwarded message ----------
> From: Martin Gainty <mg...@hotmail.com>
> Date: Apr 20, 2007 7:20 PM
> Subject: Re: Axis2 dispatcher and receiver
> To: axis-user@ws.apache.org
>
>
>
>
> Ron/Paul--
>
> are you verified synapse has run thru all the published SI testcases
> with AXIS2 ?
>
> (I did a quick run and see this displayed)
>
> C:\Synapse\synapse-0.91\samples\axis2Client>ant stockquote
>
> Buildfile: build.xml
> init:
>    [mkdir] Created dir:
> C:\Synapse\synapse-0.91\samples\axis2Client\target\classes
>
> compile:
>    [javac] Compiling 10 source files to 
> C:\Synapse\synapse-0.91\samples\axis2Cl
> ient\target\classes
> stockquote:
>     [java] org.apache.axis2.AxisFault: SOAP message MUST NOT contain a 
> Document
> Type Declaration(DTD); nested exception is:
>     [java]     org.apache.axiom.om.OMException: SOAP message MUST NOT 
> contain a
> Document Type Declaration(DTD)
>
> ???
> I assume synapse is still in alpha ?
>
> M--
>

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Fwd: Axis2 dispatcher and receiver

Posted by Paul Fremantle <pz...@gmail.com>.
Forwarding from axis-user

---------- Forwarded message ----------
From: Martin Gainty <mg...@hotmail.com>
Date: Apr 20, 2007 7:20 PM
Subject: Re: Axis2 dispatcher and receiver
To: axis-user@ws.apache.org




Ron/Paul--

are you verified synapse has run thru all the published SI testcases
with AXIS2 ?

(I did a quick run and see this displayed)

C:\Synapse\synapse-0.91\samples\axis2Client>ant stockquote

Buildfile: build.xml
init:
    [mkdir] Created dir:
C:\Synapse\synapse-0.91\samples\axis2Client\target\classes

compile:
    [javac] Compiling 10 source files to C:\Synapse\synapse-0.91\samples\axis2Cl
ient\target\classes
stockquote:
     [java] org.apache.axis2.AxisFault: SOAP message MUST NOT contain a Document
 Type Declaration(DTD); nested exception is:
     [java]     org.apache.axiom.om.OMException: SOAP message MUST NOT contain a
 Document Type Declaration(DTD)

???
I assume synapse is still in alpha ?

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.


----- Original Message -----
From: Soactive Inc
To: axis-user@ws.apache.org
Sent: Friday, April 20, 2007 1:00 PM
Subject: Re: Axis2 dispatcher and receiver

Can you or someone else provide a step by step approach (concrete
example) to use Synapse to route to a simple external service without
hardwiring any service information within the Synapse configuration.

I have tried to use Synapse but so far it doesn't seem to work for me.


On 4/20/07, Paul Fremantle <pz...@gmail.com> wrote:
> Ron
>
> You might like to take a look at Apache Synapse
> (http://ws.apache.org/synapse) which is build on top of Axis2 and does
> exactly that.
>
> We have a flexible model where you can deploy any mediation before
> routing the message on to an external service.
>
> Paul
>
> On 4/19/07, Soactive Inc <so...@gmail.com> wrote:
> > I am trying to use axis2 to dispatch all requests to a particular service.
> > This service also has a registered receiver which executes the appropriate
> > business logic (essentially calling other external services). All logic is
> > currently within the receiver and there is not much to be done in the actual
> > service invoked by the dispatcher. I am faced with an issue where the
> > receiver is being called but not the service. Is there a particular
> > signature for the service operation that I need to use. Currently I use the
> > following:
> >
> > public boolean mediate(MessageContext synCtx) {...}
> >
> > I am wondering why the receiver is invoked but not the actual service. Is
> > there a way to return / truncate processing directly from the receiver back
> > to the caller?
> >
> > Thanks in advance,
> > Ron
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>



-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Re: Axis2 dispatcher and receiver

Posted by Martin Gainty <mg...@hotmail.com>.
Ron/Paul--

are you verified synapse has run thru all the published SI testcases with AXIS2 ?

(I did a quick run and see this displayed)

C:\Synapse\synapse-0.91\samples\axis2Client>ant stockquote

Buildfile: build.xml
init:
    [mkdir] Created dir: C:\Synapse\synapse-0.91\samples\axis2Client\target\classes

compile:
    [javac] Compiling 10 source files to C:\Synapse\synapse-0.91\samples\axis2Cl
ient\target\classes
stockquote:
     [java] org.apache.axis2.AxisFault: SOAP message MUST NOT contain a Document
 Type Declaration(DTD); nested exception is:
     [java]     org.apache.axiom.om.OMException: SOAP message MUST NOT contain a
 Document Type Declaration(DTD)

???
I assume synapse is still in alpha ?

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

  ----- Original Message ----- 
  From: Soactive Inc 
  To: axis-user@ws.apache.org 
  Sent: Friday, April 20, 2007 1:00 PM
  Subject: Re: Axis2 dispatcher and receiver


  Can you or someone else provide a step by step approach (concrete example) to use Synapse to route to a simple external service without hardwiring any service information within the Synapse configuration.

  I have tried to use Synapse but so far it doesn't seem to work for me. 


  On 4/20/07, Paul Fremantle <pz...@gmail.com> wrote:
    Ron

    You might like to take a look at Apache Synapse
    (http://ws.apache.org/synapse) which is build on top of Axis2 and does
    exactly that.

    We have a flexible model where you can deploy any mediation before 
    routing the message on to an external service.

    Paul

    On 4/19/07, Soactive Inc <so...@gmail.com> wrote:
    > I am trying to use axis2 to dispatch all requests to a particular service. 
    > This service also has a registered receiver which executes the appropriate
    > business logic (essentially calling other external services). All logic is
    > currently within the receiver and there is not much to be done in the actual 
    > service invoked by the dispatcher. I am faced with an issue where the
    > receiver is being called but not the service. Is there a particular
    > signature for the service operation that I need to use. Currently I use the 
    > following:
    >
    > public boolean mediate(MessageContext synCtx) {...}
    >
    > I am wondering why the receiver is invoked but not the actual service. Is
    > there a way to return / truncate processing directly from the receiver back 
    > to the caller?
    >
    > Thanks in advance,
    > Ron
    >


    --
    Paul Fremantle
    VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

    http://bloglines.com/blog/paulfremantle 
    paul@wso2.com

    "Oxygenating the Web Service Platform", www.wso2.com

    --------------------------------------------------------------------- 
    To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
    For additional commands, e-mail: axis-user-help@ws.apache.org 




Re: Axis2 dispatcher and receiver

Posted by Soactive Inc <so...@gmail.com>.
Can you or someone else provide a step by step approach (concrete example)
to use Synapse to route to a simple external service without hardwiring any
service information within the Synapse configuration.

I have tried to use Synapse but so far it doesn't seem to work for me.

On 4/20/07, Paul Fremantle <pz...@gmail.com> wrote:
>
> Ron
>
> You might like to take a look at Apache Synapse
> (http://ws.apache.org/synapse) which is build on top of Axis2 and does
> exactly that.
>
> We have a flexible model where you can deploy any mediation before
> routing the message on to an external service.
>
> Paul
>
> On 4/19/07, Soactive Inc <so...@gmail.com> wrote:
> > I am trying to use axis2 to dispatch all requests to a particular
> service.
> > This service also has a registered receiver which executes the
> appropriate
> > business logic (essentially calling other external services). All logic
> is
> > currently within the receiver and there is not much to be done in the
> actual
> > service invoked by the dispatcher. I am faced with an issue where the
> > receiver is being called but not the service. Is there a particular
> > signature for the service operation that I need to use. Currently I use
> the
> > following:
> >
> > public boolean mediate(MessageContext synCtx) {...}
> >
> > I am wondering why the receiver is invoked but not the actual service.
> Is
> > there a way to return / truncate processing directly from the receiver
> back
> > to the caller?
> >
> > Thanks in advance,
> > Ron
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Axis2 dispatcher and receiver

Posted by Paul Fremantle <pz...@gmail.com>.
Ron

You might like to take a look at Apache Synapse
(http://ws.apache.org/synapse) which is build on top of Axis2 and does
exactly that.

We have a flexible model where you can deploy any mediation before
routing the message on to an external service.

Paul

On 4/19/07, Soactive Inc <so...@gmail.com> wrote:
> I am trying to use axis2 to dispatch all requests to a particular service.
> This service also has a registered receiver which executes the appropriate
> business logic (essentially calling other external services). All logic is
> currently within the receiver and there is not much to be done in the actual
> service invoked by the dispatcher. I am faced with an issue where the
> receiver is being called but not the service. Is there a particular
> signature for the service operation that I need to use. Currently I use the
> following:
>
> public boolean mediate(MessageContext synCtx) {...}
>
> I am wondering why the receiver is invoked but not the actual service. Is
> there a way to return / truncate processing directly from the receiver back
> to the caller?
>
> Thanks in advance,
> Ron
>


-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 dispatcher and receiver

Posted by Soactive Inc <so...@gmail.com>.
Here's my code. For some reason, I am still getting an exception when
calling my service:

Here are the relevant code snippets. Any inputs appreciated:

axis2.xml
---------
.......
   <phaseOrder type="inflow">
        <!--  System pre defined phases       -->
         <phase name="Transport">
            <!--<handler name="RequestURIBasedDispatcher"
                     class="
org.apache.axis2.engine.RequestURIBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>-->
            <!--<handler name="SOAPActionBasedDispatcher"-->
                     <!--class="
org.apache.axis2.engine.SOAPActionBasedDispatcher">-->
                <!--<order phase="Dispatch"/>-->
            <!--</handler>-->
        </phase>
        <phase name="Security"/>
        <phase name="PreDispatch"/>
        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase
">
            <handler name="SoapDispatcher"
                     class="com.myco.framework.service.SoapDispatcher">
                <order phase="Dispatch"/>
            </handler>
.......

dispatcher
----------

public class SoapDispatcher extends AbstractDispatcher {

    private static final long serialVersionUID = -6970206989111592645L;

    private static final String myco_SERVICE_NAME = "SoapGateway";

    private static final QName MEDIATE_OPERATION_NAME = new
QName("mediate");

    public void initDispatcher() {
        QName qn = new QName("http://service.framework.myco.com",
                "SoapDispatcher");
        HandlerDescription hd = new HandlerDescription(qn);
        super.init(hd);
    }

    public AxisService findService(MessageContext mc) throws AxisFault {
        AxisConfiguration ac = mc.getConfigurationContext()
                .getAxisConfiguration();
        AxisService as = ac.getService(myco_SERVICE_NAME);
        return as;
    }

    public AxisOperation findOperation(AxisService svc, MessageContext mc)
            throws AxisFault {
        AxisOperation ao = svc.getOperation(MEDIATE_OPERATION_NAME);
        return ao;
    }
}

services.xml
-------------

<!-- Can be used if the mediator is to be provided as an axis2 service -->
<service name="SoapGateway">
    <parameter name="ServiceClass" locked="false">
com.myco.framework.service.SoapGateway</parameter>
    <operation name="mediate">
    <messageReceiver class="com.myco.framework.service.SoapMessageReceiver"
/>
    </operation>
</service>


service (please note that this is meant to be a gateway to other service
endpoints and the receiver has the appropriate logic to invoke the
endpoints)
-------

public class SoapGateway {
    private static Logger logger = LogMgr.getLogger(LogComponent.SERVICE);

    public boolean mediate(MessageContext synCtx)
        throws AxisFault {
        try {
            System.out.println("Entered the mediator code..");
            return false;
        } catch (Exception e) {
            return false;
        }
    }


message receiver
-----------------

public class SoapMessageReceiver extends RawXMLINOutMessageReceiver {

    private static ServiceRegistryConnector serviceRegistryConnector =
ServiceMgr
            .getServiceRegistryConnector();

    private static Logger logger = LogMgr.getLogger(LogComponent.SERVICE);

    public void invokeBusinessLogic(MessageContext inMessage,
            MessageContext outMessage) throws AxisFault {
        logger.log(Level.INFO, "Begin SoapMessageReceiver logic...");
        .......

        // set the response SOAP message of an endpoint service to gateway
to outMessage
    }

.......

Exception trace when calling service
---------------------------------------------
INFO: Request SOAP Envelope:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body>
<getAirport xmlns="http://services.myco.com/xsd">
<airportCode>LAX</airportCode>
</getAirport>
</soapenv:Body>
</soapenv:Envelope>

### Sending back response from SoapMessagereceiver: <?xml version='1.0'
encoding='utf-8'?><soapenv:E
nvelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header
/><soapenv:Body><n
s:getAirportResponse
xmlns:ns="http://services.myco.com/xsd"><ns:return><airportCode
xmlns="htt
p://services.myco.com/xsd">LAX</airportCode><airportName xmlns="
http://services.myco.com/x
sd">Los Angeles International Apt</airportName><cityCode xmlns="
http://services.myco.com/xsd">L
AX</cityCode><cityName xmlns="http://services.myco.com/xsd">Los
Angeles</cityName><countryCode
xmlns="http://services.myco.com/xsd">US</countryCode><countryName xmlns="
http://services.gridsc
ope.com/xsd">USA</countryName><gmtVar xmlns="http://services.myco.com/xsd
">-0800
</gmtVar><latitudeAsDecimal xmlns="http://services.myco.com/xsd">33.933334
</latitudeAsDecimal><
latitudeInDegrees xmlns="http://services.myco.com/xsd">33.56.00N
</latitudeInDegrees><longitudeA
sDecimal xmlns="http://services.myco.com/xsd">-118.4</longitudeAsDecimal><longitudeInDegrees
xm
lns="http://services.myco.com/xsd">118.24.00W</longitudeInDegrees><oagRegionCode
xmlns="http://
services.myco.com/xsd">NA1</oagRegionCode><oagRegionName xmlns="
http://services.myco.com/x
sd">North America</oagRegionName><stateCode xmlns="
http://services.myco.com/xsd">CA</stateCode>
<stateName xmlns="http://services.myco.com/xsd
">California</stateName></ns:return></ns:getAirpo
rtResponse></soapenv:Body></soapenv:Envelope>
Apr 20, 2007 12:43:02 AM com.myco.framework.service.WebServiceInvokerinvokeSoap
SEVERE: Error when invoking service via SOAP message
javax.xml.soap.SOAPException: org.xml.sax.SAXException: Bad envelope tag:
getAirportResponse
        at org.apache.axis.soap.SOAPConnectionImpl.call(
SOAPConnectionImpl.java:95)
        at com.myco.framework.service.WebServiceInvoker.invokeSoap(Unknown
Source)
        at com.myco.admin.CallServiceDirectAction.execute(Unknown Source)
        at org.apache.struts.action.RequestProcessor.processActionPerform(
RequestProcessor.java:484)

        at org.apache.struts.action.RequestProcessor.process(
RequestProcessor.java:274)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java
:1480)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java
:524)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.j
ava:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)

        at org.displaytag.filter.ResponseOverrideFilter.doFilter(
ResponseOverrideFilter.java:125)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.j
ava:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)

        at net.sf.jguard.filters.AccessFilter.doFilter(AccessFilter.java
:288)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.j
ava:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)

        at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(
Http11Processor.java:869)
        at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Htt
p11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.ja
va:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.xml.sax.SAXException: Bad envelope tag:  getAirportResponse
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2785)
        at org.apache.axis.client.Call.invoke(Call.java:2748)
        at org.apache.axis.client.Call.invoke(Call.java:1862)
        at org.apache.axis.soap.SOAPConnectionImpl.call(
SOAPConnectionImpl.java:90)
        ... 28 more
Caused by: org.xml.sax.SAXException: Bad envelope tag:  getAirportResponse
        at org.apache.axis.message.EnvelopeBuilder.startElement(
EnvelopeBuilder.java:70)
        at org.apache.axis.encoding.DeserializationContext.startElement(
DeserializationContext.java:
1048)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook
(U
nknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
(
Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
        at org.apache.axis.encoding.DeserializationContext.parse(
DeserializationContext.java:227)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
        ... 33 more
com.myco.framework.service.ServiceException: org.xml.sax.SAXException: Bad
envelope tag:  getAi
rportResponse
        at com.myco.framework.service.WebServiceInvoker.invokeSoap(Unknown
Source)
        at com.myco.admin.CallServiceDirectAction.execute(Unknown Source)
        at org.apache.struts.action.RequestProcessor.processActionPerform(
RequestProcessor.java:484)

        at org.apache.struts.action.RequestProcessor.process(
RequestProcessor.java:274)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java
:1480)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java
:524)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.j
ava:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)

        at org.displaytag.filter.ResponseOverrideFilter.doFilter(
ResponseOverrideFilter.java:125)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.j
ava:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)

        at net.sf.jguard.filters.AccessFilter.doFilter(AccessFilter.java
:288)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.j
ava:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)

        at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(
Http11Processor.java:869)
        at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Htt
p11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.ja
va:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: javax.xml.soap.SOAPException: org.xml.sax.SAXException: Bad
envelope tag:  getAirportResp
onse
        at org.apache.axis.soap.SOAPConnectionImpl.call(
SOAPConnectionImpl.java:95)
        ... 28 more
Caused by: org.xml.sax.SAXException: Bad envelope tag:  getAirportResponse
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2785)
        at org.apache.axis.client.Call.invoke(Call.java:2748)
        at org.apache.axis.client.Call.invoke(Call.java:1862)
        at org.apache.axis.soap.SOAPConnectionImpl.call(
SOAPConnectionImpl.java:90)
        ... 28 more
Caused by: org.xml.sax.SAXException: Bad envelope tag:  getAirportResponse
        at org.apache.axis.message.EnvelopeBuilder.startElement(
EnvelopeBuilder.java:70)
        at org.apache.axis.encoding.DeserializationContext.startElement(
DeserializationContext.java:
1048)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook
(U
nknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
(
Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
        at org.apache.axis.encoding.DeserializationContext.parse(
DeserializationContext.java:227)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
        ... 33 more


============

Any inputs for resolving this would be appreciated.

Thanks!
Ron






On 4/19/07, Deepal Jayasinghe <de...@opensource.lk> wrote:
>
> Hi Soactive;
>
> > I am trying to use axis2 to dispatch all requests to a particular
> > service. This service also has a registered receiver which executes
> > the appropriate business logic (essentially calling other external
> > services).
>
> I think you are talking abt a Message receiver .
>
> > All logic is currently within the receiver and there is not much to be
> > done in the actual service invoked by the dispatcher. I am faced with
> > an issue where the receiver is being called but not the service.
>
> If you have register a receiver then the receiver need to call the
> service. Axis2 is not going to call the service for you.
>
> > Is there a particular signature for the service operation that I need
> > to use. Currently I use the following:
> >
> > public boolean mediate(MessageContext synCtx) {...}
>
> Nope , you can implement you MR the way you want.
>
> >
> > I am wondering why the receiver is invoked but not the actual service.
> > Is there a way to return / truncate processing directly from the
> > receiver back to the caller?
> >
> > Thanks in advance,
> > Ron
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Axis2 dispatcher and receiver

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Soactive;

> I am trying to use axis2 to dispatch all requests to a particular
> service. This service also has a registered receiver which executes
> the appropriate business logic (essentially calling other external
> services). 

I think you are talking abt a Message receiver .

> All logic is currently within the receiver and there is not much to be
> done in the actual service invoked by the dispatcher. I am faced with
> an issue where the receiver is being called but not the service.

If you have register a receiver then the receiver need to call the
service. Axis2 is not going to call the service for you.

> Is there a particular signature for the service operation that I need
> to use. Currently I use the following:
>
> public boolean mediate(MessageContext synCtx) {...}

Nope , you can implement you MR the way you want.

>
> I am wondering why the receiver is invoked but not the actual service.
> Is there a way to return / truncate processing directly from the
> receiver back to the caller?
>
> Thanks in advance,
> Ron



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org