import javax
@WebService
public interface HelloWorld {
public String sayHello(String text);
}
import javax
@WebService(endpointInterface=
public class HelloWorldImpl implements HelloWorld {
public String sayHello(String text) {
return
}
}
@WebService 注解表示是要發布的web 服務
<?xml version=
<beans xmlns=
xmlns:xsi=
xmlns:jaxws=
xsi:schemaLocation=
<import resource=
<import resource=
<import resource=
<bean id=
<jaxws:endpoint id=
address=
</beans>
注意
address=
id
Implementor:指明具體的實現類
Address:指明這個web service的相對地址
<?xml version=
<web
xmlns:xsi=
xsi:schemaLocation=
<context
<param
<param
</context
<listener>
<listener
org
</listener
</listener>
<servlet>
<servlet
<servlet
org
</servlet
<load
</servlet>
<servlet
<servlet
<url
</servlet
</web
注意
<url
則訪問地址為
public interface HelloWorld {
public String sayHello(String text);
}
<beans xmlns=
xmlns:xsi=
xmlns:jaxws=
xsi:schemaLocation=
<bean id=
factory
<bean id=
<property name=
<property name=
<!
</bean>
</beans>
import orgntext
import orgntext
import test
public class Test {
public static void main(String[] args) {
ApplicationContext ctx = new ClassPathXmlApplicationContext(
HelloWorld client = (HelloWorld) ctx
String result = client
System
}
}
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28940.html