我运行之后没有任何反应
我访问这个http://localhost:8080/TestRWebService/services/dataService?wsdl一点反应没有直接就跳到了index.jspweb.xml是这样的<servlet>
<servlet-name>XFireServlet</servlet-name>
<servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>XFireServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
在spring中的配置如下
<bean id="educate" class="com.aozer.arms.service.impl.DataServiceImpl" /> 
<bean name="dataService" class="org.codehaus.xfire.spring.ServiceBean"> 
<property name="serviceBean" ref="educate"/> 
   <property name="serviceClass" value="com.aozer.arms.service.IDataService"/> 
   <property name="inHandlers" ref="addressingHandler" /> 
</bean> 
<bean id="addressingHandler" class="org.codehaus.xfire.addressing.AddressingInHandler"/> 
这个是xfire的配置文件<?xml version="1.0" encoding="UTF-8"?>
<beans>
<service xmlns="http://xfire.codehaus.org/config/1.0">
<name>dataService</name>
<implementationClass>com.aozer.arms.service.impl.DataServiceImpl</implementationClass><!-- 实现类 -->
<serviceClass>com.aozer.arms.service.IDataService</serviceClass><!-- 接口 -->
<style>wrapped</style> 
<use>literal</use> 
<scope>application</scope> 

</service>
</beans>这个是启动的log...2010-12-13 15:50:36 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: F:\Genuitec\Common\binary\com.sun.java.jre.win32.x86_1.5.0.011\bin;f:\Tomcat 6.0\bin
2010-12-13 15:50:36 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2010-12-13 15:50:36 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 400 ms
2010-12-13 15:50:36 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-12-13 15:50:36 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.16
2010-12-13 15:50:36 org.apache.catalina.core.StandardContext addApplicationListener
信息: The listener "org.springframework.web.context.ContextLoaderListener" is already configured for this context. The duplicate definition has been ignored.
2010-12-13 15:50:37,171  INFO ContextLoader:174 - Root WebApplicationContext: initialization started
2010-12-13 15:50:37 org.apache.catalina.core.ApplicationContext log
信息: Loading Spring root WebApplicationContext
2010-12-13 15:50:37,281  INFO CollectionFactory:76 - JDK 1.4+ collections available
2010-12-13 15:50:37,328  INFO XmlBeanDefinitionReader:347 - Loading XML bean definitions from class path resource [cngrideye-config.xml]
2010-12-13 15:50:37,468  INFO XmlBeanDefinitionReader:347 - Loading XML bean definitions from class path resource [applicationContext-action.xml]
2010-12-13 15:50:37,531  INFO XmlBeanDefinitionReader:347 - Loading XML bean definitions from class path resource [applicationContext-beans.xml]
2010-12-13 15:50:37,578  INFO XmlBeanDefinitionReader:347 - Loading XML bean definitions from class path resource [applicationContext-mail.xml]
2010-12-13 15:50:37,656  INFO XmlWebApplicationContext:100 - Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,jmailAction,showAction,imgAction,baseDao,userDao,dataDao,currentDao,alertDao,imageDao,currentManager,dataManager,userManager,limitManager,jmailManager,siteManager,showManager,alertManager,colorMake,imagesBiz,mailSender,mailMessage]; root of BeanFactory hierarchy
2010-12-13 15:50:37,671  INFO XmlWebApplicationContext:324 - 22 beans defined in application context [Root WebApplicationContext]
2010-12-13 15:50:37,890  INFO PropertyPlaceholderConfigurer:175 - Loading properties file from class path resource [addconfig.properties]
2010-12-13 15:50:37,906  INFO XmlWebApplicationContext:475 - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@1a4eb56]
2010-12-13 15:50:37,906  INFO XmlWebApplicationContext:497 - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@b44eb4]
2010-12-13 15:50:37,921  INFO UiApplicationContextUtils:83 - Unable to locate ThemeSource with name 'themeSource': using default [org.springframework.ui.context.support.ResourceBundleThemeSource@5f1c48]
2010-12-13 15:50:37,921  INFO DefaultListableBeanFactory:278 - Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,jmailAction,showAction,imgAction,baseDao,userDao,dataDao,currentDao,alertDao,imageDao,currentManager,dataManager,userManager,limitManager,jmailManager,siteManager,showManager,alertManager,colorMake,imagesBiz,mailSender,mailMessage]; root of BeanFactory hierarchy]
2010-12-13 15:50:38,218  INFO ContextLoader:189 - Using context class [org.springframework.web.context.support.XmlWebApplicationContext] for root WebApplicationContext
2010-12-13 15:50:38,218  INFO ContextLoader:199 - Root WebApplicationContext: initialization completed in 1047 ms
2010-12-13 15:50:38,453  INFO XmlConfigurationProvider:31 - Parsing configuration file [struts-default.xml]
2010-12-13 15:50:38,781  INFO XmlConfigurationProvider:31 - Parsing configuration file [struts-plugin.xml]
2010-12-13 15:50:38,812  INFO XmlConfigurationProvider:31 - Parsing configuration file [struts.xml]
2010-12-13 15:50:39,125  INFO StrutsSpringObjectFactory:31 - Initializing Struts-Spring integration...
2010-12-13 15:50:39,125  INFO SpringObjectFactory:31 - Setting autowire strategy to name
2010-12-13 15:50:39,140  INFO StrutsSpringObjectFactory:31 - ... initialized Struts-Spring integration successfully
2010-12-13 15:50:39,812  INFO StartupUtil:51 - DWR Version 2.0.5 starting.
2010-12-13 15:50:39,812  INFO StartupUtil:51 - - Servlet Engine: Apache Tomcat/6.0.16
2010-12-13 15:50:39,812  INFO StartupUtil:51 - - Java Version:   1.5.0_11
2010-12-13 15:50:39,812  INFO StartupUtil:51 - - Java Vendor:    Sun Microsystems Inc.
2010-12-13 15:50:40,078  INFO DefaultConverterManager:51 - Probably not an issue: org.jdom.Document is not available so the jdom converter will not load. This is only an problem if you wanted to use it.
2010-12-13 15:50:40,078  INFO DefaultConverterManager:51 - Probably not an issue: org.jdom.Element is not available so the jdom converter will not load. This is only an problem if you wanted to use it.
2010-12-13 15:50:40,093  WARN DefaultConverterManager:59 - Clash of converters for java.lang.Double. Using org.directwebremoting.convert.BeanConverter in place of org.directwebremoting.convert.PrimitiveConverter
[INFO] Clustering has been disabled
[INFO] Deploying module: addressing-1.5.2 - file:/f:/Tomcat 6.0/webapps/axis2/WEB-INF/modules/addressing-1.5.2.mar
[INFO] Deploying module: jaxws-1.5.2 - file:/f:/Tomcat 6.0/webapps/axis2/WEB-INF/modules/axis2-jaxws-mar-1.5.2.mar
[INFO] Deploying module: metadataExchange-1.5.2 - file:/f:/Tomcat 6.0/webapps/axis2/WEB-INF/modules/mex-1.5.2.mar
[INFO] Deploying module: mtompolicy-1.5.2 - file:/f:/Tomcat 6.0/webapps/axis2/WEB-INF/modules/mtompolicy-1.5.2.mar
[INFO] Deploying module: ping-1.5.2 - file:/f:/Tomcat 6.0/webapps/axis2/WEB-INF/modules/ping-1.5.2.mar
[INFO] Deploying module: script-1.5.2 - file:/f:/Tomcat 6.0/webapps/axis2/WEB-INF/modules/scripting-1.5.2.mar
[INFO] Deploying module: soapmonitor-1.5.2 - file:/f:/Tomcat 6.0/webapps/axis2/WEB-INF/modules/soapmonitor-1.5.2.mar
[INFO] Deploying Web service: version-1.5.2.aar - file:/f:/Tomcat 6.0/webapps/axis2/WEB-INF/services/version-1.5.2.aar
2010-12-13 15:50:42 org.apache.catalina.core.StandardContext addApplicationListener
信息: The listener "listeners.ContextListener" is already configured for this context. The duplicate definition has been ignored.
2010-12-13 15:50:42 org.apache.catalina.core.StandardContext addApplicationListener
信息: The listener "listeners.SessionListener" is already configured for this context. The duplicate definition has been ignored.
2010-12-13 15:50:42 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2010-12-13 15:50:42 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2010-12-13 15:50:42 org.apache.catalina.core.StandardContext addApplicationListener
信息: The listener "org.springframework.web.context.ContextLoaderListener" is already configured for this context. The duplicate definition has been ignored.
log4j:WARN No such property [conversionPattern] in org.apache.log4j.HTMLLayout.
2010-12-13 15:50:43 org.apache.catalina.core.ApplicationContext log
信息: Loading Spring root WebApplicationContext
Init System~!!!
2010-12-13 15:50:46 org.apache.catalina.core.StandardContext addApplicationListener
信息: The listener "org.springframework.web.context.ContextLoaderListener" is already configured for this context. The duplicate definition has been ignored.
log4j:WARN No such property [conversionPattern] in org.apache.log4j.HTMLLayout.
2010-12-13 15:50:47 org.apache.catalina.core.ApplicationContext log
信息: Loading Spring root WebApplicationContext
Init System~!!!
2010-12-13 15:50:51 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2010-12-13 15:50:51 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2010-12-13 15:50:51 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/47  config=null
2010-12-13 15:50:51 org.apache.catalina.startup.Catalina start
信息: Server startup in 15584 ms

解决方案 »

  1.   

    Available Services:dataService [wsdl]
    IDataService [wsdl]
    Generated by XFire ( http://xfire.codehaus.org ) 我改了配置之后出来这个``但是我点wsdl超链接又跑到index.jsp去了
      

  2.   

    http://localhost:7000/工程名/services/dataService?wsdl
      

  3.   


    我试过了没有xml显示出来出来的index.jsp
      

  4.   


    package net.bingosoft.bignessmatterpiece;import java.util.Date;
    import java.util.List;
    import java.util.Locale;
    import javax.servlet.http.HttpServletRequest;import net.bingosoft.common.bo.BignessMatterPieceCount;
    import net.bingosoft.common.bo.Info;
    import net.bingosoft.common.bo.ProblemList;
    import net.bingosoft.common.bo.RecordList;public interface IProblemListService {

    public int[] queryBignessMatterPieceCount( String workId); 

    public String[][] queryBignessMatterPieceList(String workId,int type); public String[] queryBignessMatterPieceListInfo (long Id);

    }
      

  5.   


    http://localhost:8080/TestRWebService/services/dataService.ws?wsdl这么访问呢会出来可用的service但是呢
    http://localhost:8080/TestRWebService/services/dataService?wsdl这样就不行了```.ws  或者在dataService  随便加上一个.的话就ok
    不带.就不行
      

  6.   


    package net.bingosoft.bignessmatterpiece;import java.util.Date;
    import java.util.List;
    import java.util.Map;import net.bingosoft.common.ObjectRegistry;
    import net.bingosoft.common.bo.ProblemList;
    import net.bingosoft.common.data.BaseDao;
    import net.bingosoft.common.service.BaseService;public class ProblemListServiceImpl extends BaseService implements IProblemListService {
    private BaseDao dao = ObjectRegistry.getBaseDao();
    public int[] queryBignessMatterPieceCount (String workId){

    String sql1="select bmp.type,count(bmp.id) as count from bigness_matter_piece bmp,bigness_matter_track bmt where to_char(bmp.id) = bmt.app_id and bmt.node = 'MP_PUBLISHED' ";
    String sql2 = "and (bmp.responemancode1 = '"+workId+"' or bmp.responemancode2= '"+workId+"' or bmp.responemancode3 = '"+workId+"' or bmp.responemancode4 ='"+workId;
    String sql3= "'or bmp.responemancode5 = '"+workId+"' or bmp.responemancode6= '"+workId+"' or bmp.responemancode7 = '"+workId+"' or bmp.responemancode8 ='"+workId+"')";
    String sql4= "and (bmp.type=1 or bmp.type=2 or bmp.type=3 or bmp.type=58)";
    String sql5="and trunc(last_day(add_months(sysdate, -1)) + 1) <= bmt.HANDLE_TIME and bmt.HANDLE_TIME < trunc(sysdate + 1)";
    String sql6="and rownum < 100 group by bmp.type order by bmp.type";
    String sql=sql1+sql2+sql3+sql4+sql5+sql6;
    List<Map<String, Object>> list = dao.list(sql,null);
    int[] result = new int[4];
    for(int i = 0; i < list.size(); i++){
    Map<String, Object> map = list.get(i);
    String t = map.get("TYPE").toString();
    int i2 = Integer.parseInt(map.get("COUNT").toString());
    if("1".equals(t)){
    result[0]=i2;
    }else if("2".equals(t)){
    result[1]=i2;
    }else if("3".equals(t)){
    result[2]=i2;
    }else if("58".equals(t)){
    result[3]=i2;
    }
    }

    return result;

    }
    public String[][] queryBignessMatterPieceList(String workId,int type){
    String sql1="select bmp.id,bmp.type,bmp.carry_id,bmp.COMPLAIN_REASON,bmp.PARTYRESPONSIBLE_ONE_LEVEL,bmp.PARTYRESPONSIBLE_ONE_TYPE,bmp.RAPIDPIECE_TYPE,bmp.MANGLE_REASON from bigness_matter_piece bmp,bigness_matter_track bmt where to_char(bmp.id) = bmt.app_id and bmt.node = 'MP_PUBLISHED' ";
    String sql2 = "and (bmp.responemancode1 = '"+workId+"' or bmp.responemancode2= '"+workId+"' or bmp.responemancode3 = '"+workId+"' or bmp.responemancode4 ='"+workId;
    String sql3= "'or bmp.responemancode5 = '"+workId+"' or bmp.responemancode6= '"+workId+"' or bmp.responemancode7 = '"+workId+"' or bmp.responemancode8 ='"+workId+"')";
    String sql4= "and bmp.type='"+type+"'";
    String sql5="and trunc(last_day(add_months(sysdate, -1)) + 1) <= bmt.HANDLE_TIME and bmt.HANDLE_TIME < trunc(sysdate + 1) order by bmp.id";
    String sql="";
    if(type!=0){
    sql = sql1+sql2+sql3+sql4+sql5;
    }else{sql = sql1+sql2+sql3+sql5;}
    List<Map<String, Object>> list = dao.list(sql,null);
    String[][] result = new String[list.size()][8];
    for(int i = 0; i < list.size(); i++){
    Map<String, Object> map = list.get(i);
    result[i][0] = ""+map.get("ID");
    result[i][1] = ""+map.get("TYPE");
    result[i][2] = ""+map.get("CARRY_ID");
    result[i][3] = ""+map.get("COMPLAIN_REASON");
    result[i][4] = ""+map.get("PARTYRESPONSIBLE_ONE_LEVEL");
    result[i][5] = ""+map.get("PARTYRESPONSIBLE_ONE_TYPE");
    result[i][6] = ""+map.get("RAPIDPIECE_TYPE");
    result[i][7] = ""+map.get("MANGLE_REASON");
    }
    return result;
    }
    public String[] queryBignessMatterPieceListInfo(long Id){
    ProblemList recordList = null;
    try{
    String sql1="select bmp.carry_id,bmp.SEND_DATE,bmp.RECE_NET_NAME,bmp.COMPLAIN_REASON,bmp.CREATE_TIME,bmp.LOSE_DESC,bmp.PARTYRESPONSIBLE_ONE_LEVEL||bmp.PARTYRESPONSIBLE_ONE_TYPE as LEVEL_AND_TYPE,bmp.PARTYRESPONSIBLE_ONE_TYPE,bmp.MANGLE_DESC from bigness_matter_piece bmp where ";
    String sql2="bmp.id="+Id;
    String sql=sql1+sql2;
    List<Map<String, Object>> list = dao.list(sql,null);
    java.text.DateFormat df = new java.text.SimpleDateFormat("yyyy-MM-dd");
    String[] result = new String[9];
    Map<String, Object> map = list.get(0);
    if(list.size() != 1){
    throw new RuntimeException("data not only");
    }
    result[0] = ""+map.get("CARRY_ID");
    result[1] = ""+map.get("SEND_DATE");
    result[2] = ""+map.get("RECE_NET_NAME");
    result[3] = ""+map.get("COMPLAIN_REASON");
    result[4] = df.format(map.get("CREATE_TIME"));
    result[5] = ""+map.get("LOSE_DESC");
    result[6] = ""+map.get("LEVEL_AND_TYPE");
    result[7] = ""+map.get("PARTYRESPONSIBLE_ONE_TYPE");
    result[8] = ""+map.get("MANGLE_DESC");
    //System.out.println("result[1]..."+result[1]);
    return result;
    }catch(Exception e){
    e.printStackTrace();
    return null;
    }

    }

    public static void main(String args[]) {
    ProblemListServiceImpl bmpcl = new ProblemListServiceImpl();
    String workId ="198311";
    int type =2;
    long Id= 10005041;
    int[] result = bmpcl.queryBignessMatterPieceCount(workId);
    System.out.print("result0:..."+result[0]+".   ");
    System.out.print("result1:..."+result[1]+".   ");
    System.out.print("result2:..."+result[2]+".   ");
    System.out.println("result3:..."+result[3]+".   ");
    String [] [] ss =bmpcl.queryBignessMatterPieceList(workId,type);
    System.out.print("result0:..."+ss[0][0]+".   ");
    System.out.print("result1:..."+ss[0][1]+".   ");
    System.out.print("result2:..."+ss[0][2]+".   ");
    System.out.print("result3:..."+ss[0][3]+".   ");
    System.out.print("result4:..."+ss[0][4]+".   ");
    System.out.print("result5:..."+ss[0][5]+".   ");
    System.out.print("result6:..."+ss[0][6]+".   ");
    System.out.println("result7:..."+ss[0][7]+".   ");
    String [] s = bmpcl.queryBignessMatterPieceListInfo(Id);
    System.out.print("result0:..."+s[0]+".   ");
    System.out.print("result1:..."+s[1]+".   ");
    System.out.print("result2:..."+s[2]+".   ");
    System.out.print("result3:..."+s[3]+".   ");
    System.out.print("result4:..."+s[4]+".   ");
    System.out.print("result5:..."+s[5]+".   ");
    System.out.print("result6:..."+s[6]+".   ");
    System.out.print("result7:..."+s[7]+".   ");
    System.out.println("result8:..."+s[8]+".   ");

    }

    }
      

  7.   


    <!-- XFireServlet -->
      <servlet>
      <servlet-name>XFireServlet</servlet-name>
      <servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet</servlet-class>
      <load-on-startup>0</load-on-startup>
      </servlet>
      <servlet>
        <description>This is the description of my J2EE component</description>
        <display-name>This is the display name of my J2EE component</display-name>
        <servlet-name>TestWS</servlet-name>
        <servlet-class>test.TestWS</servlet-class>
      </servlet>
      <servlet-mapping>
      <servlet-name>XFireServlet</servlet-name>
      <url-pattern>/services/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>TestWS</servlet-name>
        <url-pattern>/TestWS</url-pattern>
      </servlet-mapping>
      

  8.   


    <service xmlns="http://xfire.codehaus.org/config/1.0">
    <name>ProblemListService</name>
    <serviceClass>
    net.bingosoft.bignessmatterpiece.IProblemListService
    </serviceClass>
    <implementationClass>
    net.bingosoft.bignessmatterpiece.ProblemListServiceImpl
    </implementationClass>
    <style>wrapped</style>
    <use>literal</use>
    <scope>application</scope>
    </service>
      

  9.   


    package test;import java.io.IOException;
    import java.io.PrintWriter;
    import java.net.MalformedURLException;import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;import net.bingosoft.bignessmatterpiece.IBignessMatterPieceCount;
    import net.bingosoft.bignessmatterpiece.IProblemListService;
    import net.bingosoft.common.bo.BignessMatterPieceCount;import org.codehaus.xfire.XFire;
    import org.codehaus.xfire.XFireFactory;
    import org.codehaus.xfire.client.XFireProxyFactory;
    import org.codehaus.xfire.service.Service;
    import org.codehaus.xfire.service.binding.ObjectServiceFactory;public class TestWS extends HttpServlet { @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException { response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out
    .println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
    out.println("<HTML>");
    out.println("  <HEAD><TITLE>A Servlet</TITLE></HEAD>");
    out.println("  <BODY>");
    out.print("    out is ");
    int[] i= new int[4];
    try {
    String workId = request.getParameter("workId");
    if("".equals(workId)){workId ="198311";}
    if(workId==null){workId ="198311";}
    if(workId.equals("") || workId == null){workId ="198311";}
    IProblemListService client = null;
    Service serviceModel = new ObjectServiceFactory().create(IProblemListService.class);        
            XFire xfire = XFireFactory.newInstance().getXFire();
            XFireProxyFactory factory = new XFireProxyFactory(xfire);      
            String serviceUrl = "http://localhost:8080/cos_webservice/services/ProblemListService";;
            
            try {
            
             client =  (IProblemListService) factory.create(serviceModel, serviceUrl);
              i= client.queryBignessMatterPieceCount(workId);
             System.out.print("result0:..."+i[0]+"....");
         System.out.print("result0:..."+i[1]+"....");
         System.out.print("result0:..."+i[2]+"....");
         System.out.println("result0:..."+i[3]+"....");
            } catch (MalformedURLException e) {
             e.printStackTrace();
            }    

    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    out.println("operator:..."+i[0]+",");
    out.println("bad:..."+i[1]+",");
    out.println("");
    out.println("</BODY>");
    out.println("</HTML>");
    out.flush();
    out.close();

    } @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {
    // TODO Auto-generated method stub
    doGet(req, resp);
    }}
      

  10.   

    别人的webservice看的话能看见xml文件我的怎么看不到啊??
      

  11.   

    会不会跟struts2 冲突啊我的struts2  是用 /*   匹配的
      

  12.   

    ..肯定有些小问题你没注意了
    你照着人家的步骤用Eclipse搞下
    或者,直接复制配置文件过去
      

  13.   


    我在试试我感觉会跟struts2的匹配会冲突struts2  匹配是  /*
    webservice  是   /services/*
      

  14.   

    我的设想没有错``就是因为这个匹配原则上的问题```
    谢谢serisboy  全力支持啊(*^__^*) 嘻嘻……http://topic.csdn.net/u/20100126/16/c5c19ad9-611a-4877-b39c-efc2085eed0d.html