Grzegorz Ukleja

Grzegorz Ukleja Sollers Consulting -
Manager

Temat: Problem z Web Service

Witam.
Próbuję napisać klienta do mojego web serwisu, korzystając z dynamic invocation. Korzystam z tego tutoriala:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXRPC5...

Konfiguracja web serwisu:
<?xml version="1.0" encoding="UTF-8" ?>
<webServices xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/dd" version="1.0" targetNamespaceBase="http://www.eps.uam.es/si2lab/wsdl" typeNamespaceBase="http://www.eps.uam.es/si2lab/types" urlPatternBase="/communication">
<endpoint name="CommunicationWebService" displayName="Servicio de comunicacion" description="Servicio para comunicacion entre la sede central y local" interface="communication.CommunicationIF" implementation="communication.CommunicationImpl" />
<endpointMapping endpointName="CommunicationWebService" urlPattern="/communication" />
</webServices>

Klient:
public class WebServiceBean {
private static String qnameService = "CommunicationWebService";
private static String qnamePort = "communication.CommunicationIF";

private static String BODY_NAMESPACE_VALUE = "http://www.eps.uam.es/si2lab/wsdl";
private static String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
private static String NS_XSD = "http://www.w3.org/2001/XMLSchema";
private static String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";

/** Creates a new instance of UserBean */
public WebServiceBean() {
}

public String addUser (String ip, String email){
int result = -1;
try {
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(new QName(qnameService));
QName port = new QName(qnamePort);
Call call = service.createCall(port);
call.setTargetEndpointAddress("http://localhost:8080/communication-jaxrpc/communication");
call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
call.setProperty(Call.SOAPACTION_URI_PROPERTY,"");
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_INTEGER);
call.setOperationName(new QName(BODY_NAMESPACE_VALUE,"addUser"));
call.addParameter("String_1", QNAME_TYPE_STRING, ParameterMode.IN);
call.addParameter("String_2", QNAME_TYPE_STRING, ParameterMode.IN);
String[] params = new String[2];
params[0] = ip;
params[1] = email;
result = (Integer)call.invoke(params);
} catch(Exception e){
return e.toString();
}
return null;
}
}

Przy próbie wywołania metody otrzymuję wyjątek:
org.apache.jasper.JasperException: can't parse argument number http://www.eps.uam.es/si2lab/wsdl

W czym może być problem?