-1
抛出异常,我正在学习如何编写使用JDK7,AXIS 2.的Http://..../mywebservice WSDL使用Axis2
在Java的web服务我复制一个非常简单的HelloWorld示例。
package example;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
@WebService()
public class HelloWorld implements IHelloWorld {
@WebMethod
public String sayHelloWorldFrom(String from) {
String result = "Hello, world, from " + from;
System.out.println(result);
return result;
}
public static void main(String[] argv) {
Object implementor = new HelloWorld();
String address = "http://localhost:9001/HelloWorld";
Endpoint.publish(address, implementor);
}
}
我的服务,XML看起来像:
<serviceGroup>
<service name="HelloWorld" targetNamespace="http://example">
<Description>Hi</Description>
<parameter name="ServiceClass" locked="false">example.HelloWorld</parameter>
<operation name="*">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
</service>
</serviceGroup>
当我尝试看看使用
http://localhost:9001/services/HelloWorldService?wsdl
我看到WSDL: 问题是什么?
- 谢谢
我发现我正在开发Axis2应用程序不正确。我应该开发一个.aar应用程序并将其部署到Axis2.war文件中的services目录。 Axis2.war文件可以在[link](http://axis.apache.org/axis2/java/core/download.cgi)找到。下载二进制文件或WAR文件。 –
btw:您可以将aar或jar部署到服务目录中... – Oli