Brian, The tried what the document described by specifiying a client-config.wsdd file and also using the following code, EngineConfiguration clientConfig=getClientConfig(); XYServiceLocator service=new XYServiceLocator(); service.setEngineConfiguration(clientConfig); service.setEngine(new AxisClient(clientConfig)); XY myservice=service.getmyservice();
In both cases it threw the ClassCastException AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.apache.axis.ConfigurationException: java.lang.ClassCastException java.lang.ClassCastException at org.apache.axis.deployment.wsdd.WSDDDeployableItem.makeNewInstance(WSDDDeployableIte m.java:338) at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.j ava:310) at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java: 296) at org.apache.axis.deployment.wsdd.WSDDDeployment.getHandler(WSDDDeployment.java: 455) at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.j ava:312) at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java: 296) at org.apache.axis.deployment.wsdd.WSDDChain.makeNewInstance(WSDDChain.java:164) at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.j ava:310) at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java: 296) at org.apache.axis.deployment.wsdd.WSDDTargetedChain.makeNewInstance(WSDDTargetedChain. java:190) at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.j ava:310) at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java: 296) at org.apache.axis.deployment.wsdd.WSDDDeployment.getTransport(WSDDDeployment.java:470) at org.apache.axis.configuration.FileProvider.getTransport(FileProvider.java:282) at org.apache.axis.AxisEngine.getTransport(AxisEngine.java:283) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:179) at org.apache.axis.client.Call.invokeEngine(Call.java:2564) at org.apache.axis.client.Call.invoke(Call.java:2553) at org.apache.axis.client.Call.invoke(Call.java:2248) at org.apache.axis.client.Call.invoke(Call.java:2171) at org.apache.axis.client.Call.invoke(Call.java:1691) at com.micros.webservices.og._4_2.Name_wsdl.NameServiceSoapStub.newProfile(NameServiceSoa pStub.java:739) at mf.ors.client.ORSClient.insertProfile(ORSClient.java:194) at mf.ors.client.ORSClient.main(ORSClient.java:62) I am not sure where is there a ClassCastException occuring? Is it my handler class that looks odd: package mf.ors.client; /** * @author kapilkhanna * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class SimpleHandler implements javax.xml.rpc.handler.Handler { public SimpleHandler() { } public boolean handleRequest(javax.xml.rpc.handler.MessageContext context) { System.out.println("ClientHandler: In handleRequest"); return true; } public boolean handleResponse(javax.xml.rpc.handler.MessageContext context) { System.out.println("ClientHandler: In handleResponse"); return true; } public boolean handleFault(javax.xml.rpc.handler.MessageContext context) { System.out.println("ClientHandler: In handleFault"); return true; } public void init(javax.xml.rpc.handler.HandlerInfo config) { System.out.println("Inside init()"); } public void destroy() { } public javax.xml.namespace.QName[] getHeaders() { return null; } } Does the following help? [How do I setup handlers in Axis clients?] \ http://nagoya.apache.org/wiki/apachewiki.cgi?AxisProjectPages/AxisClientConfiguration I ran across it this morning, -brian -----Original Message----- From: Kapil Khanna [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 4:44 PM To: [EMAIL PROTECTED] Subject: Re: How to get a MessageContext from a client I defined a simple Handler class and tried to set up the handler in the client-config.wsdd file. I am using the following client-config.wsdd file <?xml version="1.0" encoding="UTF-8"?> <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apac he.org/axis/wsdd/providers/java"> <handler name="Simple" type="mf.ors.client.SimpleHandler"/> <!--globalConfiguration> <requestFlow> <handler type="Simple"/> </requestFlow> </globalConfiguration--> <service name="NameService"> <requestFlow> <handler type="Simple"/> </requestFlow> </service> <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/> <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/> <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/> </deployment> When i try to execute the SOAP client i get the following exception : Exception in thread "main" java.lang.NullPointerException at org.apache.axis.client.Stub.extractAttachments(Stub.java:331) at com.micros.webservices.og._4_2.Name_wsdl.NameServiceSoapStub.newProfile(NameServiceSoa \ pStub.java:745) at mf.ors.client.ORSClient.insertProfile(ORSClient.java:186) at mf.ors.client.ORSClient.main(ORSClient.java:59) Any clues? You can setup client side handlers in client-config.wsdd. Just place it on your clients classpath. --m Kapil Khanna wrote: > I am consuming an external web service and am trying to get a handle to the > MessageContext via MessageContext.getCurrentContext(). Unfortunately the > MessageContext i > get is always null. > The purpose of getting to the MessageContext is to get to the SOAPRequest and > SOAPResponse > messages. There have been numerous posts regarding this but i have not seen > any concrete > solution. I have heard about Handlers. My question is how do i configure a > Handler, cause i am > running AXIS outside a web container, i.e from command line? > Per the users guide, handlers have been setup for a web service that is > running in the axis > server. > Thanks. > > > > >