title: How to consume web-service in JSF2 Netbeans project?
body: <p>I know that this question was asked many times, I read many of them but I think I'm missing sth basic, so it doesn't work for me.. </p>
  
  <p>(Project is in JSF2, Netbeans 7.3beta, Glassfish3.. and web-services written in WCF) 
  What have I already done: </p>
  
  <ol>
  <li>Create a JSF2 project. </li>
  <li>Right click on the project, new web service client. Fill WSDL URL. Finish</li>
  <li>Create ManagedBean, open it.. drag and drop "DoWork" method from my webservice. </li>
  <li><p>Look at my simple code (I've got index.html, where I display DataTable, that is created in my managedbean) 
  index.html</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"&gt;     
      &lt;h:head&gt;&lt;title&gt;IGNORED&lt;/title&gt;&lt;/h:head&gt;
      &lt;h:body&gt;
          &lt;ui:composition template="/templates/masterPage.xhtml"&gt;         
              &lt;ui:define name="content"&gt;
                  &lt;h:form&gt;
                     &lt;h3&gt;and #{bean.tst}!&lt;/h3&gt;                           
                     &lt;p:dataTable value="#{bean.rows}" var="row"&gt;
                         &lt;p:columns value="#{bean.columns}" var="column" headerText="#{bean.headers[column]}"&gt;
                         #{row[column]}
                         &lt;/p:columns&gt;
                     &lt;/p:dataTable&gt;  
                  &lt;/h:form&gt;
              &lt;/ui:define&gt;                        
          &lt;/ui:composition&gt;
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre></li>
  </ol>
  
  <p>and.. bean.java</p>
  
  <pre><code>    @Named(value = "bean")
      @SessionScoped
      public class Bean implements Serializable {  
          @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_62599/TestService.svc.wsdl")
          private TestService service;
  
          ... // list, maps.. not important for this example
  
          public Bean() {
              columns = new ArrayList&lt;String&gt;();  
              rows = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();         
              headers = new HashMap&lt;String,String&gt;();
  
              // Columns:
              for(int i = 0 ; i &lt; 4 ; i++)  
              {
                  String column_id = "c" + i;
                  String column_name = "Column name " + i;           
                  columns.add(column_id);                                    
                  headers.put(column_id, column_name);            
              }
  
              // Rows:
              for(int i = 0 ; i &lt; 100 ; i++)  
              {               
                  Map&lt;String,Object&gt; m = new HashMap&lt;String,Object&gt;();
                  m.clear();          
                  for(int j = 0 ; j &lt; 4 ; j++)  
                  {
  **// HERE IT DOESNT WORK in table i've got Content:Null**
                      m.put("c" + j, "Content:" + Tst); 
                  }                                               
                  rows.add(m);
              }       
          }
  
          private String Tst;
          public String getTst() {
              return doWork("Test");
          }
  
          private String doWork(java.lang.String str) {
              DataTable.ITestService port = service.getBasicHttpBindingITestService();
              return port.doWork(str);
          } 
      }
  </code></pre>
  
  <p>Why I can't use it inside my managed bean? What have I done wrong? I want to use it in bean so I could fill my DataTable...</p>