Thanks Deepal.
Attached is my axis2.xml and module.xml file and also
the client java code.
Regards,
Navin
--- Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
> Sure I can help you , but I did not get the
> axis2.xml and module.xml please
> send them to me then I will help you to find the
> problem.
>
> Thanks,
> Deepal
>
................................................................
> ~Future is Open~
>
>
>
> ----- Original Message -----
> From: "Navinkumar Shetty"
> <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Sunday, July 31, 2005 7:27 AM
> Subject: Re: [Axis2] Question about Handlers-
> getting errors
>
>
> > Hello Deepal,
> >
> > Thank You for the quick response.
> > I already have modified the axis2.xml, but still
> get
> > the same error.
> >
> > I am attaching the module.xml and axis2.xml file
> for
> > your reference. Can you please take a look at
it?
> >
> > I have verified, that it take the correct
> axis2.xml
> > file.
> > Can you please help me debug this issue?
> > Thanks and Regards,
> > Navin
> >
> >
> > --- Deepal Jayasinghe <[EMAIL PROTECTED]>
> wrote:
> >
> >> Hi ;
> >>
> >> You have to do simple modification to your
> axis2.xml
> >> in order to overcome
> >> this error .
> >>
> >> in axis2.xml you can see
> >> <phaseOrder type="inflow">
> >> add an entry to that (i mean the phase that you
> are
> >> going to use)
> >> <phase name="loggingPhase"/>
> >>
> >> if you are going to put the handlers in all the
> >> flows then add the same
> >> entry to each flow's phaseOrder
> >>
> >> Thanks,
> >> Deepal
> >>
> >
>
................................................................
> >> ~Future is Open~
> >>
> >>
> >>
> >> ----- Original Message -----
> >> From: "Navinkumar Shetty"
> >> <[EMAIL PROTECTED]>
> >> To: <[email protected]>
> >> Sent: Saturday, July 30, 2005 1:17 PM
> >> Subject: RE: [Axis2] Question about Handlers-
> >> getting errors
> >>
> >>
> >> > Hello Ashutosh,
> >> >
> >> > I am trying the use the Logging module from
the
> >> client
> >> > side and I am getting the following error -
> >> > adding new module
> >> >
org.apache.axis2.phaseresolver.PhaseException:
> >> Invalid
> >> > Phase ,loggingPhasefor the handler
> >> InFlowLogHandler
> >> > dose not exit in axis2.xml or refering to
phase
> in
> >> > diffrent flow
> >> > at
> >> >
> >>
> >
>
org.apache.axis2.phaseresolver.PhaseHolder.addHandler(PhaseHolder.java:67)
> >> > at
> >> >
> >>
> >
>
org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToServiceFromGlobal(PhaseResolver.java:415)
> >> > at
> >> >
> >>
> >
>
org.apache.axis2.phaseresolver.PhaseResolver.engageModuleGlobally(PhaseResolver.java:333)
> >> > at
> >> >
> >>
> >
>
org.apache.axis2.engine.AxisConfigurationImpl.engageModule(AxisConfigurationImpl.java:329)
> >> > at
> >> >
> >>
> >
>
org.apache.axis2.clientapi.InOutMEPClient.engageModule(InOutMEPClient.java:307)
> >> > at
> >> >
> >>
> >
>
userguide.clients.ClientForWebServiceWithModule.main(ClientForWebServiceWithModule.java:41)
> >> >
> >> > I tried debugging and it looks like it is
> picking
> >> up
> >> > the correct axis2.xml.
> >> >
> >> > Can you please let me know how you got the
> client
> >> > running?
> >> >
> >> > Thanks and Regards,
> >> > Navin
> >> >
> >> > --- "Shahi, Ashutosh" <[EMAIL PROTECTED]>
> >> wrote:
> >> >
> >> >>
> >> >> Hi Suvanam,
> >> >> The way to do it is: use the call()
> constructor
> >> >> which takes the client repository as
parameter
> >> and
> >> >> then call, call.engageModule(moduleName).
The
> >> client
> >> >> repository should contain the archive
> file(.mar)
> >> >> containing module and handlers.
> >> >>
> >> >> Thanks,
> >> >> Ashutosh
> >> >>
> >> >> -----Original Message-----
> >> >> From: SUVANAN DUTTA
[mailto:[EMAIL PROTECTED]
> >> >> Sent: Wed 7/27/2005 11:13 PM
> >> >> To: [email protected]
> >> >> Cc:
> >> >> Subject: [Axis2] Question about Handlers
> >> >> Hi,
> >> >> I was looking at the AXIS2 samples and found
> out
> >> the
> >> >> LoggingModule sample which illustrates the
way
> to
> >> >> write a custom handler. The samples tells me
> how
> >> to
> >> >> deploy the module on AXIS2.
> >> >>
> >> >> Now, how do I point to and use the same
> Logging
> >> >> Module
> >> >> from client side?
> >> >>
> >> >> Can someone pl. let me know.
> >> >>
> >> >> Thanks,
> >> >> - Suvanan.
> >> >>
> >> >>
> >>
> __________________________________________________
> >> >> Do You Yahoo!?
> >> >> Tired of spam? Yahoo! Mail has the best
spam
> >> >> protection around
> >> >> http://mail.yahoo.com
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
>
____________________________________________________
> >> > Start your day with Yahoo! - make it your
home
> >> page
>
=== message truncated ===
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
> <axisconfig name="AxisJava2.0">
<!--
=================================================
-->
<!-- Parameters -->
<!--
=================================================
-->
<parameter name="hotdeployment"
locked="xsd:false">true</parameter>
<parameter name="hotupdate"
locked="xsd:false">false</parameter>
<!-- Uncomment this to enable REST support -->
<!-- <parameter name="enableREST"
locked="xsd:false">true</parameter>-->
<parameter name="userName"
locked="xsd:false">admin</parameter>
<parameter name="password"
locked="xsd:false">axis2</parameter>
<!--
=================================================
-->
<!-- Message Receivers -->
<!--
=================================================
-->
<!-- This is the Deafult Message Receiver for
the Request Response style Operations -->
<messageReceiver mep="INOUT"
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
<!--
=================================================
-->
<!-- Transport Ins -->
<!--
=================================================
-->
<transportReceiver name="http"
class="org.apache.axis2.transport.http.SimpleHTTPServer">
<parameter name="port"
locked="xsd:false">6060</parameter>
</transportReceiver>
<!-- Uncomment this one with the appropriate
papameters to enable the SMTP transport Receiver
<transportReceiver name="mail"
class="org.apache.axis2.transport.mail.SimpleMailListener">
<parameter name="transport.mail.pop3.host"
locked="xsd:false">127.0.0.1</parameter>
<parameter name="transport.mail.pop3.user"
locked="xsd:false">axis2</parameter>
<parameter
name="transport.mail.pop3.password"
locked="xsd:false">axis2</parameter>
<parameter name="transport.mail.pop3.port"
locked="xsd:false">110</parameter>
<parameter
name="transport.mail.replyToAddress"
locked="xsd:false">[EMAIL PROTECTED]</parameter>
</transportReceiver> -->
<transportReceiver name="tcp"
class="org.apache.axis2.transport.tcp.TCPServer">
<parameter name="port"
locked="xsd:false">6060</parameter>
</transportReceiver>
<!--
=================================================
-->
<!-- Transport Outs -->
<!--
=================================================
-->
<transportSender name="http"
class="org.apache.axis2.transport.http.HTTPTransportSender"/>
<transportSender name="tcp"
class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
<transportSender name="local"
class="org.apache.axis2.transport.local.LocalTransportSender"/>
<!-- Uncomment this one with the appropriate
papameters to enable the SMTP transport Receiver
<transportSender name="mail"
class="org.apache.axis2.transport.mail.MailTransportSender">
<parameter name="transport.mail.smtp.host"
locked="xsd:false">127.0.0.1</parameter>
<parameter name="transport.mail.smtp.user"
locked="xsd:false">axis2</parameter>
<parameter
name="transport.mail.smtp.password"
locked="xsd:false">axis2</parameter>
<parameter name="transport.mail.smtp.port"
locked="xsd:false">25</parameter>
</transportSender>
-->
<!--
=================================================
-->
<!-- Global Modules -->
<!--
=================================================
-->
<!-- Uncomment this to enable Addressing
<module ref="addressing"/> -->
<!--
=================================================
-->
<!-- Phases -->
<!--
=================================================
-->
<phaseOrder type="inflow">
<!-- System pre defined phases -->
<phase name="TransportIn"/>
<phase name="PreDispatch"/>
<phase name="Dispatch"/>
<phase name="PostDispatch"/>
<!-- System pre defined phases -->
<!-- After Postdispatch phase module
author or or service author can add any phase he
want -->
<phase name="loggingPhase"/>
</phaseOrder>
<phaseOrder type="outflow">
<!-- user can add his own phases to
this area -->
<phase name="loggingPhase"/>
</phaseOrder>
<phaseOrder type="INfaultflow">
<!-- user can add his own phases to
this area -->
<phase name="loggingPhase"/>
</phaseOrder>
<phaseOrder type="Outfaultflow">
<!-- user can add his own phases to
this area -->
<phase name="loggingPhase"/>
</phaseOrder>
</axisconfig>
> package userguide.clients;
import org.apache.axis2.Constants;
import
org.apache.axis2.addressing.AddressingConstants;
import
org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.clientapi.Call;
import org.apache.axis2.engine.AxisFault;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.OMOutput;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.namespace.QName;
import java.io.StringWriter;
/*
* Copyright 2001-2004 The Apache Software
Foundation.
*
* Licensed under the Apache License, Version 2.0
(the "License");
* you may not use this file except in compliance
with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in
writing, software
* distributed under the License is distributed on
an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied.
* See the License for the specific language
governing permissions and
* limitations under the License.
*/
public class ClientForWebServiceWithModule {
private static EndpointReference targetEPR = new
EndpointReference(AddressingConstants.WSA_TO,
"http://127.0.0.1:5309/axis2/services/MyServiceWithModule/echo");
public static void main(String[] args) {
try {
OMElement payload =
ClientUtil.getEchoOMElement();
Call call = new
Call("D:\\Apache\\axis2-0.9-bin\\samples\\userguide\\src\\userguide\\clients\\bin\\handler");
call.engageModule(new QName("loggingPhase"));
call.setTo(targetEPR);
call.setTransportInfo(Constants.TRANSPORT_HTTP,
Constants.TRANSPORT_HTTP, false);
//Blocking invocation
OMElement result = (OMElement)
call.invokeBlocking("echo", payload);
StringWriter writer = new
StringWriter();
result.serializeWithCache(new
OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
writer.flush();
System.out.println(writer.toString());
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
} catch (XMLStreamException e) {
e.printStackTrace();
}
}
}
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
<axisconfig name="AxisJava2.0">
<!-- ================================================= -->
<!-- Parameters -->
<!-- ================================================= -->
<parameter name="hotdeployment" locked="xsd:false">true</parameter>
<parameter name="hotupdate" locked="xsd:false">false</parameter>
<!-- Uncomment this to enable REST support -->
<!-- <parameter name="enableREST"
locked="xsd:false">true</parameter>-->
<parameter name="userName" locked="xsd:false">admin</parameter>
<parameter name="password" locked="xsd:false">axis2</parameter>
<!-- ================================================= -->
<!-- Message Receivers -->
<!-- ================================================= -->
<!-- This is the Deafult Message Receiver for the Request Response
style Operations -->
<messageReceiver mep="INOUT"
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
<!-- ================================================= -->
<!-- Transport Ins -->
<!-- ================================================= -->
<transportReceiver name="http"
class="org.apache.axis2.transport.http.SimpleHTTPServer">
<parameter name="port" locked="xsd:false">6060</parameter>
</transportReceiver>
<!-- Uncomment this one with the appropriate papameters to enable the
SMTP transport Receiver
<transportReceiver name="mail"
class="org.apache.axis2.transport.mail.SimpleMailListener">
<parameter name="transport.mail.pop3.host"
locked="xsd:false">127.0.0.1</parameter>
<parameter name="transport.mail.pop3.user"
locked="xsd:false">axis2</parameter>
<parameter name="transport.mail.pop3.password"
locked="xsd:false">axis2</parameter>
<parameter name="transport.mail.pop3.port"
locked="xsd:false">110</parameter>
<parameter name="transport.mail.replyToAddress"
locked="xsd:false">[EMAIL PROTECTED]</parameter>
</transportReceiver> -->
<transportReceiver name="tcp"
class="org.apache.axis2.transport.tcp.TCPServer">
<parameter name="port" locked="xsd:false">6060</parameter>
</transportReceiver>
<!-- ================================================= -->
<!-- Transport Outs -->
<!-- ================================================= -->
<transportSender name="http"
class="org.apache.axis2.transport.http.HTTPTransportSender"/>
<transportSender name="tcp"
class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
<transportSender name="local"
class="org.apache.axis2.transport.local.LocalTransportSender"/>
<!-- Uncomment this one with the appropriate papameters to enable the
SMTP transport Receiver
<transportSender name="mail"
class="org.apache.axis2.transport.mail.MailTransportSender">
<parameter name="transport.mail.smtp.host"
locked="xsd:false">127.0.0.1</parameter>
<parameter name="transport.mail.smtp.user"
locked="xsd:false">axis2</parameter>
<parameter name="transport.mail.smtp.password"
locked="xsd:false">axis2</parameter>
<parameter name="transport.mail.smtp.port"
locked="xsd:false">25</parameter>
</transportSender>
-->
<!-- ================================================= -->
<!-- Global Modules -->
<!-- ================================================= -->
<!-- Uncomment this to enable Addressing
<module ref="addressing"/> -->
<!-- ================================================= -->
<!-- Phases -->
<!-- ================================================= -->
<phaseOrder type="inflow">
<!-- System pre defined phases -->
<phase name="TransportIn"/>
<phase name="PreDispatch"/>
<phase name="Dispatch"/>
<phase name="PostDispatch"/>
<!-- System pre defined phases -->
<!-- After Postdispatch phase module author or or service author
can add any phase he want -->
<phase name="loggingPhase"/>
</phaseOrder>
<phaseOrder type="outflow">
<!-- user can add his own phases to this area -->
<phase name="loggingPhase"/>
</phaseOrder>
<phaseOrder type="INfaultflow">
<!-- user can add his own phases to this area -->
<phase name="loggingPhase"/>
</phaseOrder>
<phaseOrder type="Outfaultflow">
<!-- user can add his own phases to this area -->
<phase name="loggingPhase"/>
</phaseOrder>
</axisconfig>
package userguide.clients;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.clientapi.Call;
import org.apache.axis2.engine.AxisFault;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.OMOutput;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.namespace.QName;
import java.io.StringWriter;
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class ClientForWebServiceWithModule {
private static EndpointReference targetEPR = new
EndpointReference(AddressingConstants.WSA_TO,
"http://127.0.0.1:5309/axis2/services/MyServiceWithModule/echo");
public static void main(String[] args) {
try {
OMElement payload = ClientUtil.getEchoOMElement();
Call call = new
Call("D:\\Apache\\axis2-0.9-bin\\samples\\userguide\\src\\userguide\\clients\\bin\\handler");
call.engageModule(new QName("loggingPhase"));
call.setTo(targetEPR);
call.setTransportInfo(Constants.TRANSPORT_HTTP,
Constants.TRANSPORT_HTTP, false);
//Blocking invocation
OMElement result = (OMElement) call.invokeBlocking("echo",
payload);
StringWriter writer = new StringWriter();
result.serializeWithCache(new
OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
writer.flush();
System.out.println(writer.toString());
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
} catch (XMLStreamException e) {
e.printStackTrace();
}
}
}