JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java & XML、Web Service » Web Services  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
作者 JSF调用web service 的wsdl文件生成bean的问题
cqian59420





發文: 1
積分: 0
於 2011-01-23 18:20 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
已有可以使用的web service 的Wsdl,通过Eclipse Web Service client 生成了一些bean.
我知道可以使用 RegionServiceProxy server = new RegionServiceProxy();,然后server. 可以调用方法。我现在写了一个bean ,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
public class RegionFunUnits {   
    static RegionServiceProxy server = new RegionServiceProxy();   
//  static RegionServiceProxy server ;   
//  private Region region;   
//  private Esregion esregion;   
//  private Pgsregion pgsregion;   
//  private Essubregion essubregion;   
//  private Pgssubregion pgssubregion;   
//  private Country country;   
//  private Subregion subregion;   
//  private ResponseMessage responseMessage;   
    private String name;   
    private String regionname;   
    private String subregionname;   
    public String getName() {   
        return name;   
    }   
  
    public void setName(String name) {   
        this.name = name;   
    }   
  
    private String countryname;   
    private String searchName;   
    private String searchType;   
  
  
    public String getname() throws RegionError, RemoteException {   
        String regn = "";   
        regn = server.getRegion(regionname)[1].getName();   
        return regn;   
    }   
  
    public String search() {   
        if (searchType == "getRegion") {   
               
        }   
        return null;   
    }   
  
/*  public static void main(String[] args) throws RegionError, RemoteException {  
        System.out.println(server.getRegion("")[1].getName());  
        System.out.println(server.getRegion("")[1].getCategory());  
        List regionlist = Arrays.asList(server.getRegion(""));  
        List subregionlist = Arrays.asList(server.getSubRegion(""));  
        Iterator itosub = subregionlist.iterator();  
        Iterator ito = regionlist.iterator();  
        while (ito.hasNext()) {  
            System.out.println(((Region) ito.next()).getName());  
        }  
        System.out.println("=================================");  
        while (itosub.hasNext()) {  
            System.out.println(((Subregion) itosub.next()).getName());  
        }  
 
    }  
*/   
  
    public String getRegionname() {   
        return regionname;   
    }   
  
    public void setRegionname(String regionname) {   
        this.regionname = regionname;   
    }   
  
    public String getSubregionname() {   
        return subregionname;   
    }   
  
    public void setSubregionname(String subregionname) {   
        this.subregionname = subregionname;   
    }   
  
    public String getCountryname() {   
        return countryname;   
    }   
  
    public void setCountryname(String countryname) {   
        this.countryname = countryname;   
    }   
       
    public String getSearchName() {   
        return searchName;   
    }   
  
    public void setSearchName(String searchName) {   
        this.searchName = searchName;   
    }   
  
    public String getSearchType() {   
        return searchType;   
    }   
  
    public void setSearchType(String searchType) {   
        this.searchType = searchType;   
    }   
  
  
}

[color=DeepPink]但是这个bean 不能在faces-config里面注册,
1
2
3
4
5
6
   <managed-bean>
      <description></description>
      <managed-bean-name>regionFunUnits</managed-bean-name>
      <managed-bean-class>com.gepower.gees.nti.regionservice.rest.soapwrapper.RegionFunUnits</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>

提示[/color],前台jsp页面老是
1
2
3
4
5
6
7
javax.servlet.ServletException: Could not retrieve value of component with path : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /pages/regionSearch.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp0][Class: javax.faces.component.html.HtmlInputText,Id: name]}   
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:154)   
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)   
    org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)   
    org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)   
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)   
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)   


reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
1237 JSF调用web service 的wsdl文件生成bean的问题 cqian59420 4493 2011-01-23 18:20
» JWorld@TW »  Java & XML、Web Service » Web Services

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8