Webservice + axis

3 respostas
G

Segui um tutorial e nao deu certo sou novo. alguem pode me ajudar?

log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.net.ConnectException: Connection refused: connect
 faultActor: 
 faultNode: 
 faultDetail: 
	{http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
	at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
	at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
	at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
	at org.apache.axis.client.Call.invoke(Call.java:2767)
	at org.apache.axis.client.Call.invoke(Call.java:2443)
	at org.apache.axis.client.Call.invoke(Call.java:2366)
	at org.apache.axis.client.Call.invoke(Call.java:1812)
	at br.com.Noticia.server.BuscaNoticiaSoapBindingStub.teste(BuscaNoticiaSoapBindingStub.java:173)
	at br.com.Noticia.Cliente.ExecutaCliente.teste2(ExecutaCliente.java:31)
	at br.com.Noticia.Cliente.ExecutaCliente.main(ExecutaCliente.java:23)

	{http://xml.apache.org/axis/}hostname:Carlos-PC

java.net.ConnectException: Connection refused: connect
	at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
	at org.apache.axis.client.Call.invoke(Call.java:2767)
	at org.apache.axis.client.Call.invoke(Call.java:2443)
	at org.apache.axis.client.Call.invoke(Call.java:2366)
	at org.apache.axis.client.Call.invoke(Call.java:1812)
	at br.com.Noticia.server.BuscaNoticiaSoapBindingStub.teste(BuscaNoticiaSoapBindingStub.java:173)
	at br.com.Noticia.Cliente.ExecutaCliente.teste2(ExecutaCliente.java:31)
	at br.com.Noticia.Cliente.ExecutaCliente.main(ExecutaCliente.java:23)
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
	at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
	at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
	at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
	... 12 more
package br.com.Noticia.Cliente;

import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;

import javax.xml.rpc.ServiceException;

import br.com.Noticia.server.BuscaNoticia;
import br.com.Noticia.server.BuscaNoticiaService;
import br.com.Noticia.server.BuscaNoticiaServiceLocator;

public class ExecutaCliente {

	/**
	 * @param args
	 * @throws ServiceException
	 * @throws RemoteException
	 */
	public static void main(String[] args) throws RemoteException,
			ServiceException {
		// TODO Auto-generated method stub
		teste2();

	}

	public static void teste2() {
		try {
			BuscaNoticiaService service = new BuscaNoticiaServiceLocator();
			BuscaNoticia buscaNoticia = service.getBuscaNoticia();
			 Object[] busca =  buscaNoticia.teste();

			for(Object o : busca)
				System.out.println("teste" + o.toString());
		} catch (ServiceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (RemoteException x) {
			// TODO Auto-generated catch block
			x.printStackTrace();
		}

	}
}

3 Respostas

G

Alguem pode me ajudar? por favor ajudaaaa … :smiley:

alvimar_henrique

Cara…
Tô com o mesmo problema…
Conseguiu resolver??

alvimar_henrique

O meu foi resolvido.
Eu tinha esquecido de colocar alguns jars necessários (commons collections e dom4j).

Criado 24 de fevereiro de 2011
Ultima resposta 10 de mar. de 2011
Respostas 3
Participantes 2