Problema com WebServices

1 resposta
V

Olá,

Configurei o eclipse para trabalhar com WebServices utilizando Axis 1.4

Mas não printar alguns dados q estou enviando para o servidor.

Exemplo simples que está funcionando.

Celular:
public void testWSFramework()
	{
		ChessPort_Stub stub = new ChessPort_Stub();
		try {
			boolean result = false;

			//createPlayer test
			result = stub.createPlayer("nickName", "name", "country", "email");
			System.out.println("createPlayer = " + result);

			
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}


Servidor:
public BooleanValue createPlayer(PlayerPersonalInfo createPlayerRequest) throws java.rmi.RemoteException {
		
		BooleanValue result = new BooleanValue(true);
		return result;
		
	}

O resultado é esse: createPlayer = true

Mas gostaria de saber como eu faço para nesse método printar esses dados (Strings) que estou enviando.

Métodos auxiliares:

public boolean createPlayer(java.lang.String nickName, java.lang.String name, java.lang.String country, java.lang.String email) throws java.rmi.RemoteException {
		// Copy the incoming values into an Object array if needed.
		Object[] inputObject = new Object[4];
		inputObject[0] = nickName;
		inputObject[1] = name;
		inputObject[2] = country;
		inputObject[3] = email;

		Operation op = Operation.newInstance(_qname_createPlayer, _type_playerPersonalInfo, _type_booleanValue);
		_prepOperation(op);
		op.setProperty(Operation.SOAPACTION_URI_PROPERTY, "");
		Object resultObj;
		try {
			resultObj = op.invoke(inputObject);
		} catch (JAXRPCException e) {
			Throwable cause = e.getLinkedCause();
			if (cause instanceof java.rmi.RemoteException) {
				throw (java.rmi.RemoteException) cause;
			}
			throw e;
		}
		boolean result;
		// Convert the result into the right Java type.
		// Unwrapped return value
		Object valueObj = ((Object[])resultObj)[0];
		result = ((java.lang.Boolean)valueObj).booleanValue();
		return result;
	}

1 Resposta

A

Kra eu acharia melhor se tu usasse a biblioteca Ksoap e a Kxml!!!É bem mais simplificado e seguro

Criado 13 de setembro de 2006
Ultima resposta 3 de out. de 2006
Respostas 1
Participantes 2