axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Aggarwal" <>
Subject RE: [Axis1.4] Problems with ChannelAdvisor WSDL
Date Wed, 11 May 2011 05:54:35 GMT

I found some code on the Internet about adding
the handler to my client.  Here is what I did:

    List<HandlerInfo> handlerChain = new ArrayList<HandlerInfo>();
    HandlerInfo handlerInfo = new
    AdminServiceLocator locator = new AdminServiceLocator();
    HandlerRegistry registry = locator.getHandlerRegistry();
    QName serviceName = new
QName("", "AdminServiceSoap");
    registry.setHandlerChain(serviceName, handlerChain);

When I run this, I get this exception:

Unable to create handler of type class

I am attaching the AuthenticationHandler class, everything looks correct
to me.

Any ideas why this is not working?


Neil Aggarwal, (972)834-1565,
Virtual private server with CentOS 5.5 preinstalled
Unmetered bandwidth = no overage charges 

-----Original Message-----
From: Neil Aggarwal [] 
Sent: Tuesday, May 10, 2011 11:43 PM
Subject: [Axis1.4] Problems with ChannelAdvisor WSDL


I am trying to process the ChannelAdvisor WSDL for their
AdminService.  They have posted their WSDL here:

I used WSDL2Java to create the client classes, but
it does not generate a class for APICredentials.

If I add the --all switch, it generates an APICredentials
class but then there is no way to attach the credentials
to the service call.

Here is a page with the desired XML request:

Here is a page with sample code in C# and other languages: 
Unfortunately, none of their example include Java and their
support staff has no knowledge of Java or Axis so I am left
on my own to figure this out.

I have found some postings on the Internet with people having
similar problems as I am.  They point to using a BasicHandler 
to manually insert the APICredentials into the SOAP header.

I found some code for a handler:

public class AuthenticationHandler extends BasicHandler {
  /** Invoke this hander */
  public void invoke(MessageContext context) throws AxisFault {
    try {
      SOAPMessageContext smc = (SOAPMessageContext) context;
      SOAPMessage message = smc.getMessage();
      QName APICredentialsName = new
      QName DeveloperKeyName = new
      QName PasswordName = new
QName("", "Password");

      SOAPHeader header = message.getSOAPHeader();
      SOAPHeaderElement cred = new SOAPHeaderElement(APICredentialsName);
      SOAPHeaderElement key = new SOAPHeaderElement(DeveloperKeyName);
      SOAPHeaderElement pw = new SOAPHeaderElement(PasswordName);
    } catch (Exception e) {
      throw new AxisFault("Error during authentication", e);

But, I am not sure how to use it to insert the credentials into
the service call.

If anyone has some insight, I would appreciate it.

Thank you,

Neil Aggarwal, (972)834-1565,
Virtual private server with CentOS 5.5 preinstalled
Unmetered bandwidth = no overage charges 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message