Hi all
When I try creating a web service client using CXF's dynamic client api to
invoke a wsdl on server side (see the following), an exception was thrown
complaining the operation already exists. All what I'm trying to do here is
simply creating a client, why could this exception be triggered?
*Code:*
import java.net.URL;
import java.net.URLClassLoader;
import javax.xml.namespace.QName;
import org.apache.cxf.endpoint.dynamic.*;
import org.apache.cxf.endpoint.Client;
public class DynamicClient
{
public static void main(String[] args)
{
try
{
DynamicClientFactory dcf = DynamicClientFactory.newInstance();
Client client = dcf.createClient("*http://servicehost?wsdl*");
}
catch (Exception e)
{...}
}
}
*Output
*log4j:WARN Continuable parsing error 2 and column 69
log4j:WARN Document root element "log4j:configuration", must match DOCTYPE
root "null".
log4j:WARN Continuable parsing error 2 and column 69
log4j:WARN Document is invalid: no grammar found.
log4j:WARN No appenders could be found for logger
(org.apache.cxf.bus.spring.BusApplicationContext).
log4j:WARN Please initialize the log4j system properly.
26-Jun-2008 09:47:17 org.apache.cxf.bus.spring.BusApplicationContext
getConfigResources
INFO: No cxf.xml configuration file detected, relying on defaults.
java.lang.IllegalArgumentException: An operation with name [*operation name*]
already exists in this service
at
org.apache.cxf.service.model.InterfaceInfo.addOperation(InterfaceInfo.java:71)
at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterfaceOperation(WSDLServiceBuilder.java:498)
at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterface(WSDLServiceBuilder.java:492)
at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:286)
at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:156)
at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:138)
at
org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:94)
at org.apache.cxf.endpoint.ClientImpl.<init>(ClientImpl.java:129)
at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:174)
at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:157)
at
com.idna.wsconsumer.cxf.dynamic.DynamicClient.main(DynamicClient.java:20)
Many thanks
--
Kan