主要内容:
1.新建web工程,编写程序,包括接口和相应的实现类
2.配置文件
3.web.xml配置
rfidread
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
webAppRootKey
webapp.root
log4jConfigLocation
/WEB-INF/log4j.properties
log4jRefreshInterval
6000
org.springframework.web.util.Log4jConfigListener
XFireServlet
org.codehaus.xfire.transport.http.XFireConfigurableServlet
XFireServlet
/services/*
4.wsdl
http://10.14.251.241:8080/rfidcontrol/services/XfireRfidService?wsdl
rfidcontrol:war包名
services:spring
XfireRfidService:
5.调用
FTPC调用
client = class org.codehaus.xfire.client.Client(class java.net.URL(wsdl));
if (path == null)
{
return false
}
args = Object[path.length]
if (args.length == 0)
{
return false
}
for (i = 0; i < args.length; i++)
{
args[i] = path[i]
}
resultObjArr = client.invoke("getRfidState", args)
vec = vector()
for(obj : resultObjArr)
{
isNormal = obj.toString()
if (isEmptyStr(isNormal))
{
return false
}
isTrue = class net.sf.json.JSONObject::fromObject(isNormal).getBoolean("result")
if (isTrue == false)
{
return false
}
data = class net.sf.json.JSONObject::fromObject(isNormal).getJSONArray("data")
for (i = 0; i < data.size(); i++)
{
tostr = data[i].toString()
result = tostr.substring(1, tostr.length()-1).split(":")
if (result[1] == "false")
{
invokeRfidWebservice("openAlarmResult", result[0].substring(1,result[0].length()-1))
vec.add(result[0])
}
}
}