標籤:config pat namespace frame bpa ati space package cat
1.先導spring包
2.首先配置spring.xml的監聽web.xml配置。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:Spring-Context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
3.配置spring.xml檔案
//掃描的包(就是類的包名)
<context:component-scan base-package="infis"/>
<bean class="org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter">
//要暴露的介面
<property name="baseAddress" value="http://192.168.10.183:8800/services/"/>
</bean>
4.就是實體類了
@Component
@WebService(serviceName="lmtService",targetNamespace="lmtCore")
public class LmtList {
@WebMethod
public String getLmtList(@WebParam(name="lmt",targetNamespace="lmtList")String lmtXml) {
System.out.println(lmtXml);
return "YES";
}
}
5.提供者時要加上實體類的serviceName 例如以上訪問地址:http://192.168.10.183:8800/services/lmtService (把上面代碼複製就可以運行)
java寫介面