i have written a dii client. when running i get the following error:
java.rmi.RemoteException: JAXRPC.TIE.01: caught exception while handling request
: deserialization error: deserialization error: java.lang.NumberFormatException:
For input
string: ""
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:462)
at websrv.TestClient.main(TestClient.java:68)
the code for the client is given below.sorry for the way it looks, i treied everything with it in the last hours
package websrv;
import java.util.*;
//import ejb.*;
//import javax.naming.*;
import javax.rmi.PortableRemoteObject;
//import javax.ejb.EJBHome;
import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.ParameterMode;
import java.rmi.RemoteException;
import javax.xml.rpc.Stub;
//import websrv.*;
public class TestClient {
static Integer a = new Integer(12);
static Integer b = new Integer(24);
private static String qnameService = "CartWebService";
private static String qnamePort = "CartWebFace";
private static String BODY_NAMESPACE_VALUE =
"urn:Foo";
private static String ENCODING_STYLE_PROPERTY =
"javax.xml.rpc.encodingstyle.namespace.uri";
private static String NS_XSD = "http://www.w3.org/2001/XMLSchema";
//"http://java.sun.com/xml/ns/jax-rpc/ri/config";
//"http://www.w3.org/2001/XMLSchema";
private static String URI_ENCODING =
"http://schemas.xmlsoap.org/soap/encoding/";
public static void main(String[] args) throws RemoteException
{
//String str = "";
// Get an initial context
System.out.println("Endpoint address =
http://192.168.0.1:8080/cart-web/cart"); String result = "";
Integer params[] = new Integer[2];
try
{
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(new QName(qnameService));
System.out.println("sunt la 1");
QName port = new QName(qnamePort);
Call call = service.createCall(port);
call.setTargetEndpointAddress("http://192.168.0.1:8080/cart-web/cart");
System.out.println("sunt la 2");
call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
System.out.println("sunt la 3");
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
System.out.println("sunt la 4");
call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
QName QNAME_TYPE_INTEGER = new QName(NS_XSD, "integer");
QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
call.setReturnType(QNAME_TYPE_STRING);
call.setOperationName(new QName(BODY_NAMESPACE_VALUE,"add"));
call.addParameter("Integer_1", QNAME_TYPE_INTEGER, ParameterMode.IN);
call.addParameter("Integer_2", QNAME_TYPE_INTEGER, ParameterMode.IN);
System.out.println("sunt la 5");
params[0] = a;
params[1] = b;
System.out.println("sunt la 6");
result = (String)call.invoke(params);
System.out.println(result);
System.out.println("sunt la 7");
//System.out.println("sunt la 8");
}
catch (Exception ex)
{
ex.printStackTrace();
System.exit(1);
}
//System.out.println("ejb calling web service");
}
}