1

您好我有这个问题,我正在尝试从我的 Jax-WS Web 服务动态调用 Web 服务。我试过玻璃鱼,效果很好。但现在我对 apache 感到厌烦,它给了我例外

javax.xml.rpc.ServiceException:java.lang.ClassNotFoundException:org.apache.axis.client.ServiceFactory

**注意:我添加了 **jaxrpc.iar****

代码如图所示:

enter code here
    ServiceFactory factory = ServiceFactory.newInstance();

  Service service = factory.createService(serviceName);


call = service.createCall();


QName operationName = new QName(TargetNamesSpace,strOperationName,"");

call.setOperationName(operationName);


call.addParameter(
    "arg0",                 // parameter name
    XMLType.XSD_LONG,       // parameter XML type QName
    Long.class,             // parameter Java type class
    ParameterMode.IN);      // parameter mode
//  set the the return type.

call.setReturnType(XMLType.XSD_DOUBLE);

//call.setProperty( Call.OPERATION_STYLE_PROPERTY,"");



call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,"");

call.setTargetEndpointAddress(endpoint);


Object[] actualArgs={entityId};

Double computedRating =(Double)call.invoke(operationName,actualArgs);

我有一个疑问,服务器更改是否有任何区别,因为我在 glassfish 上尝试此操作时没有添加任何罐子。

谢谢。:)

4

2 回答 2

0

尝试同时添加commons-discovery-0.2.jar和axis.jar,可以在eclipse中作为插件找到

于 2010-04-30T11:19:45.807 回答
0

有时玻璃鱼可能与tomcat端口地址冲突,因此关闭netbeans并刷新然后在Tomcat服务器中打开你的项目或关闭端口或更改tomcat服务器的端口地址。

于 2011-01-13T05:43:25.783 回答