The Artima Developer Community
Sponsored Link

Web Services Forum
Problems with web services (org.apache.axis.client.Service.getAxisClient)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
leugim leugim

Posts: 1
Nickname: leugim
Registered: Jun, 2006

Problems with web services (org.apache.axis.client.Service.getAxisClient) Posted: Jun 28, 2006 4:31 AM
Reply to this message Reply
Advertisement
I have a problem in my webapplication axis. I try to access a web service...

/***********************CLIENT***********************/
package ejercicio1;

import java.net.MalformedURLException;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;


public class ClienteWSDD_2 {

public static void main(String[] args) throws ServiceException, RemoteException, MalformedURLException{

String endpoint = "http://localhost:" + 8080 + "/axis/services/Hola_D";
Service service = new Service();//the problem starts at this line
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );

Object ret = call.invoke("sayHelloTo", new Object [] {});
System.out.println(ret);

/*****************************************************/

But I can't run it:

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.axis.client.Service.getAxisClient(Service.java:103)
at org.apache.axis.client.Service.<init>(Service.java:112)
at ejercicio1.ClienteWSDD_2.main(ClienteWSDD_2.java:26)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.get(Unknown Source)
at org.apache.commons.logging.LogFactory.getCachedFactory(LogFactory.java:495)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:264)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:394)
at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:37)
at org.apache.axis.handlers.BasicHandler.<clinit>(BasicHandler.java:43)
... 3 more



- The service is very simple...

/***********Server****Hola_D.java*****************/
package deploy_1;
public class Hola_D{
public static void main(String[] args)
{
System.out.println("Hoolaaaaaaaaaaaaa");
}
public String sayHelloTo()
{
return "Hello";
}
}
/**********************************/
And to deploy the service:

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="Hola_D" provider="java:RPC">
<parameter name="className" value="deploy_1.Hola_D"/>
<parameter name="allowedMethods" value="*"/>
</service>
</deployment>

I can see "http://localhost:8080/axis/services/Hola_D?wsdl" without any problem.


Thanks in advance!

Topic: Make your e-services delivery convenient Previous Topic   Next Topic Topic: Microsoft Virtual Earth V's Google Earth

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use