Using methods with refrence parameters

I'm having problems completing this program I'm writing for class. I must use the setNum and getNum methods. and its must read input files as such:
John Smith
9.45 40 15
Jane Doe
12.50 45 15
I'm keep getting a boolean identifier error. Are there any examples that anyone can give me to make my program work?
import java.io.*;
import java.util.*;
public class Payroll3
     static final double FULL_TIME = 40.0;
     public static void main (String[] args)
                                                  throws FilesNotFoundException
          Scanner inFile = new Scanner(new FileReader("payroll.dat"));
          StringBuffer employeeName = new StringBuffer("");
          DoubleClass hourlyRate = new DoubleClass();
          DoubleClass hoursWorked = new DoubleClass();
          DoubleClass taxRate = new DoubleClass();
          double grossAmount = 0.0;
          double netAmount = 0.0;
          instructions();
          reportTitle();
          inputData();
          while(inFile.hasNext())
               employeeName = inFile.nextLine();
               hourlyRate = inFile.nextDouble();
               hoursWorked = inFile.nextInt();
               taxRate = inFile.nextInt();
          printEmployeeInfo(employeeName, hourlyRate, hoursWorked, taxRate, grossAmount, netAmount);
          inFile.close();     
     public static void instructions()
          System.out.println("               Instructions for Payroll Report Program              \n");
          System.out.println("This program calculates a paycheck for each employess.\n"
                                   + "A text file containing the following information will be created:\n"
                                   + "name, payrate, hours worked, and tax percentage to be deducted.\n");
          System.out.println("The program will create a report in columar format showing the \n"
                                   + "employee name, hourly rate, number of hours worked, tax rate,\n"
                                   + "gross pay, and net pay.\n");
          System.out.println("After all employees are processed, totals will be displayed,\n"
                                   + "including total gross amount and total net pay.\n");
     public static void reportTitle()
          System.out.println("                              Payroll Report                  \n"
                                        + "\n");
          System.out.println("Employee             Hourly      Hours   Tax     Gross     Net     ");
          System.out.println("Name                 Rate       Worked   Rate    Amount   Amount    ");
          System.out.println("----------------     -------   -------  -----  -------   -------");
     public static void printEmployeeInfo(StringBuffer employeeName, Doubleclass hourlyRate, Doubleclass hoursWorked, Doubleclass taxRate, Doubleclas grossAmount, Doubleclass netAmount)
     System.out.printf("%-20s%8.2f%9.2f%8.2f%9.2f%10.2f%n", employeeName, hourlyRate, hoursWorked, taxRate, grossAmount, netAmount);
          if (hoursWorked > FULL_TIME)
                System.out.println("OT");
          else
               System.out.println();
     public static void boolean inputData(StringBuffer employeeName, Doubleclass hourlyRate, Doubleclass hoursWorked, Doubleclass taxRate)
          if (
          hourlyRate.getNum();
          hoursWorked.getNum();
          taxRate.getNum());
          return true;
          else
           return false;
}

I had FilesNotFoundException in the code but I corrected the other issues. my main problem now is the DoubleClass methods. here are the errors that came up now.
Payroll3.java:31: incompatible types
found : double
required: DoubleClass
               taxRate = inFile.nextDouble();
^
Payroll3.java:34: printEmployeeInfo(java.lang.StringBuffer,DoubleClass,DoubleClass,DoubleClass,DoubleClass,DoubleClass) in Payroll3 cannot be applied to (java.lang.StringBuffer,DoubleClass,DoubleClass,DoubleClass,double,double)
          printEmployeeInfo(employeeName, hourlyRate, hoursWorked, taxRate, grossAmount, netAmount);
^
Payroll3.java:63: operator > cannot be applied to DoubleClass,double
          if (hoursWorked > FULL_TIME)
^
Payroll3.java:73: cannot find symbol
symbol : method getNum()
location: class DoubleClass
          hourlyRate.getNum();
^
Payroll3.java:74: cannot find symbol
symbol : method getNum()
location: class DoubleClass
          hoursWorked.getNum();
^
Payroll3.java:75: cannot find symbol
symbol : method getNum()
location: class DoubleClass
          taxRate.getNum();
^
11 errors
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
----jGRASP exec: javac -g E:\Chapter 7 Source Code\Payroll3.java
Payroll3.java:9: cannot find symbol
symbol : class FilesNotFoundException
location: class Payroll3
                                                  throws FilesNotFoundException
^
Payroll3.java:24: inputData(java.lang.StringBuffer,DoubleClass,DoubleClass,DoubleClass) in Payroll3 cannot be applied to ()
          inputData();
^
Payroll3.java:28: incompatible types
found : java.lang.String
required: java.lang.StringBuffer
               employeeName = inFile.nextLine();
^
Payroll3.java:29: incompatible types
found : double
required: DoubleClass
               hourlyRate = inFile.nextDouble();
^
Payroll3.java:30: incompatible types
found : int
required: DoubleClass
               hoursWorked = inFile.nextInt();
^
Payroll3.java:31: incompatible types
found : int
required: DoubleClass
               taxRate = inFile.nextInt();
^
Payroll3.java:34: printEmployeeInfo(java.lang.StringBuffer,DoubleClass,DoubleClass,DoubleClass,DoubleClass,DoubleClass) in Payroll3 cannot be applied to (java.lang.StringBuffer,DoubleClass,DoubleClass,DoubleClass,double,double)
          printEmployeeInfo(employeeName, hourlyRate, hoursWorked, taxRate, grossAmount, netAmount);
^
Payroll3.java:63: operator > cannot be applied to DoubleClass,double
          if (hoursWorked > FULL_TIME)
^
Payroll3.java:73: cannot find symbol
symbol : method getNum()
location: class DoubleClass
          hourlyRate.getNum();
^
Payroll3.java:74: cannot find symbol
symbol : method getNum()
location: class DoubleClass
          hoursWorked.getNum();
^
Payroll3.java:75: cannot find symbol
symbol : method getNum()
location: class DoubleClass
          taxRate.getNum();
^
11 errors

Similar Messages

  • How to use Count with Date Parameters

    Hello,
    I am having issues using the Count() function in conjunction with date parameters.
    This is a Siebel report and in my report I have 2 date parameters(From Date, To Date). In a nutshell I am basically trying to count Opportunities that has a start date within the given date period. However I don't see a reasonable way to put my date parameters within the Count() function. The reason being is that I need to have a huge chunk of code to convert the dates into a common format that can be compared, and it won't even fit within the code block in my rtf template. I am not even sure how to put multiple conditional statements inside a Count() function since all the examples I have seen are very simple.
    Anyone have a suggestion on how to use Count() with date parameters?
    Thanks.

    Any chance you can get the date formats in the correct format from siebel?
    I don't know Siebel - so I can't help you with that. If you get the correct format it is just
    <?count(row[(FromDate>=date) and  (date<=ToDate))?>
    Otherwise the approach would probably need to use string function to get year/monthd/day from the date
    and store it into a varialbe and compare later the same way
    <?variable@incontext:from; ....?>
    <?variable@incontext:to; ...?>
    <?count(row[($from>=date) and  (date<=$to))?>
    Potentially you can use the date functions such as xdofx:to_date to do the conversion
    [http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481158.htm]
    But I am not sure if they are available in your siebel implementation.
    Hope that helps

  • Using methods with links

    Hi all !
    Can i call a jsp-method by clicking on a html-link ??
    The method:
    <%!
        int month=2;
        public void forward() {
            month++;
    %>And now i want to call the method with a link.
    Something like this:
    <a href="..." onclick="forward()">Click</a>Is there a possibility to use methodes out of the html-code.

    I don't think u can call a method, but u can call the jsp page by using the "action"
    so u can soemthing like this
    document.formname.action = '*.jsp';
    Hi all !
    Can i call a jsp-method by clicking on a html-link ??
    The method:
    <%!
    int month=2;
    public void forward() {
    month++;
    %>And now i want to call the method with a link.
    Something like this:
    <a href="..." onclick="forward()">Click</a>Is there a possibility to use methodes out of the
    html-code.

  • Rhino calling overloaded Java methods with Array parameters

    Has anyone had any problems writing JavaScript code that calls overloaded Java methods?
    I have two Java defined methods that differ in the arguments, one takes a string the other takes an array of strings. The problem is calling Java methods within the JavaScript always calls the method with the String argument...
    /* Java Code Here */
    public void function(String s) { /* Function A */ }
    public void function(String[] sa) { /* Function B */ }
    /* JavaScript  Code Here */
    param = java.lang.reflect.Array.newInstance(java.lang.String, 2);
    param[0] = "test";
    param[1] = "test2";
    stringParam = "test3";
    /* Both function calls below end up calling the Function A from above */
    function(param);
    function(stringParam);PS...in case you're not familiar with Rhino,
    It is a mozilla package that embeds a JavaScript interpreter within a Java application...
    http://www.mozilla.org/rhino/

    haha...I can't even find my other thread :(
    Sorry about the double post...I'll go look for my other thread now

  • SSO to BSP using NTLM with application parameters

    Hi all,
    As part of the CRM activity, the customer's system sends out an email to a user with a link pointing to a bsp. Part of the url is the call id which the bsp needs to display.
    The customer does not wish for the users to input user/pass when accessing the bsp.
    According to documentation, NetWeaver supports only SAP logon tickets and X.509 SSO methods(http://help.sap.com/saphelp_nw04/helpdata/en/02/
    d4d53aa8a9324de10000000a114084/content.htm).
    Found this thread that suggest a workaround:
    BSP without logon?
    Seems like it should work, but ITS forwards to a static URL.
    Any ideas on how I can make sure that after the whole sso process is complete, the bsp will still remember which call-id it needs to display?
    Regards,
    Eric

    The goal is to have the changes made inside the bsp recorded to the logged in user. So one user for all is not applicable.
    After fiddlig around with the forwarding settings and the ITS, I managed to get this thing working. Almost.
    When I access the BSP url, it gets forwarded to and from the ITS and I get a SSO2 ticket. However, when it comes back from the ITS I get a http 404 error page. If I refresh that page, the BSP loads fine, with the transferred parameters and the correct user.
    Can't get my head around why it gives me a 404.
    Eric
    Message was edited by: Eric Labiner

  • Protected scope - how to use methods with it

    I'm trying to use the method removeRange():
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html#removeRange(int,%20int)
    From the ArrayList class, but it won't let me as it calls protected void. Is there any way around this so I can use the method?
    Edited by: Chris123 on May 3, 2008 6:03 PM

    class Testing
      MyArrayList<String> list = new MyArrayList<String>();
      public Testing()
        for(int x = 0; x < 10; x++) list.add(""+x);
        printList();
        list.removeRange(2,5);
        printList();
      public void printList()
        for(int x = 0, y = list.size(); x < y; x++) System.out.println(list.get(x));
        System.out.println("===");
      public static void main(String[] args){new Testing();}
    class MyArrayList<E> extends java.util.ArrayList<E>
      protected void removeRange(int fromIndex,int toIndex) {super.removeRange(fromIndex,toIndex);}
    }

  • USING DBMS_SQL WITH A PARAMETERIZED DML STATEMENT

    create or replace procedure insert_row ( table_name varchar2, id varchar2,name varchar2, region number) is
    csr_id integer;
    stmt varchar2(200);
    rows_added number;
    begin
    stmt := ' INSERT INTO ' || table_name || ' VALUES ( :cid , :cname, :rid ) ' ;
    csr_id := dbms_sql.open_cursor ;
    dbms_sql.parse( csr_id , stmt , dbms_sql.native) ;
    dbms_sql.bind_variable( csr_id , ' :cid ' , id );
    dbms_sql.bind_variable ( csr_id , ' :cname ' , name) ;
    dbms_sql.bind_variable( csr_id , ' :rid ' , region );
    rows_added := dbms_sql.execute ( csr_id);
    dbms_sql.close_cursor( csr_id);
    dbms_output.put_line( rows_added);
    end;
    execute insert_row( ' countries ' , ' ZA ', ' SOUTH AFRICA ', 4);
    Procedure created.
    BEGIN insert_row( ' countries ' , ' ZA ', ' SOUTH AFRICA ', 4); END;
    ERROR at line 1:
    ORA-01006: bind variable does not exist
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 923
    ORA-06512: at "SYS.DBMS_SQL", line 51
    ORA-06512: at "HR.INSERT_ROW", line 9
    ORA-06512: at line 1
    THE PROCEDURE IS GETTING CREATED BUT WHEN I EXECUTE THE PROCEDURE THEN THIS ERROR COMES IN ..

    891794 wrote:
    Thank you all , see I am new to this database field , I am not a pro.Not a problem. However, one of the very first things you should learn is that dynamic SQL is seldom needed and invariably just plain wrong.
    If a table name is dynamic, or a column name is dynamic - then chances are excellent that your data model is already fubar'ed (or malema'ed to put it in a za.org perspective).
    And even when you are in the very exceptional situation where dynamic SQL is needed, SQL injection is a MAJOR security concern.. and almost always ignored by implementing shoddy code to create and execute the dynamic SQL.

  • Trouble invoking Axis service with multiple parameters

    Hallo Java experts,
    I have a problem with Axis 1.2RC2 (and Tomcat 5.0.19, JDK 1.5, Win XP) that might be quite simple, but I'm not so experienced and running out of ideas.
    Everything works fine as long as I use a single Parameter. But I can't invoke service methods with more parameters, independent of the parameters' (simple) types! Different exceptions are thrown, depending on the way I invoke the service. It's either ...
    - a java.lang.IllegalArgumentException (case 1)
    "Tried to invoke method public java.lang.String test.server.TestSoapBindingImpl.printLongs(long,long) with arguments java.lang.Long,null. The arguments do not match the signature."
    - or an org.xml.sax.SAXException (case 2)
    "SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize."
    Here's an example of a simple web service, that takes two longs and should return a string. In case 1 the service is invoked using a service locator in case 2 with a 'Call' object and explicitly set parameter types.
    Thanks in advance for your help!
    Dave
    service[b]
    public class TestSoapBindingImpl implements test.server.Test{
      public String printLongs(long long_1, long long_2){
        return "long_1 = " +long_1 +", long_2 = " +long_2;
    [b]case 1
    client
    public class TestClient {
      public static void main (String[] args) throws Exception {     
        TestService service = new TestServiceLocator();
        Test testProxy = service.gettest();     
        long longVal = 1L; 
        response = testProxy.printLongs(longVal, longVal);
        System.out.println(response);
    SOAP messsage
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
          <in6 xmlns="urn:TestNS">1</in6>
          <in7 xmlns="urn:TestNS">1</in7>
       </soapenv:Body>
    </soapenv:Envelope>
    Axis' log file
    Part of the log, where only the first argument of 'printLongs' is properly converted before the exception is thrown.
    17886  org.apache.axis.utils.JavaUtils
            - Trying to convert java.lang.Long to long
    17886  org.apache.axis.i18n.ProjectResourceBundle
            - org.apache.axis.i18n.resource::handleGetObject(value00)
    17886  org.apache.axis.providers.java.RPCProvider
            -   value:  1
    17886  org.apache.axis.i18n.ProjectResourceBundle
            - org.apache.axis.i18n.resource::handleGetObject(dispatchIAE00)
    17986  org.apache.axis.providers.java.RPCProvider
            - Tried to invoke method public java.lang.String test.server.TestSoapBindingImpl.printLongs(long,long) with arguments java.lang.Long,null.  The arguments do not match the signature.
    java.lang.IllegalArgumentException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:384)
          at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:281)
         at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:319)
         at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
         at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
         at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:450)
         at org.apache.axis.server.AxisServer.invoke(AxisServer.java:285)
         at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:653)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:301)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    case 2
    client
    public class TestClient2
      public static void main(String [] args) {
        try {
           String endpoint =
             "http://localhost:1234/axis1.2rc2/services/test";
           Service  service = new Service();
           Call     call    = (Call) service.createCall();
           call.setTargetEndpointAddress( new java.net.URL(endpoint) );
           call.setOperationName(new QName("urn:TestNS", "printLongs") );
           call.addParameter("in6",
                             org.apache.axis.Constants.XSD_LONG,
                             javax.xml.rpc.ParameterMode.IN);
           call.addParameter("in7",
                             org.apache.axis.Constants.XSD_LONG,
                             javax.xml.rpc.ParameterMode.IN);
           call.setReturnType(org.apache.axis.Constants.XSD_STRING);
           String response = (String) call.invoke( new Object[] { 1L, 1L } );
           System.out.println(response);
        } catch (Exception e) {
           System.err.println(e.toString());
    SOAP messsage
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
          <ns1:printLongs soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:TestNS">
             <in6 href="#id0"/>
             <in7 href="#id0"/>
          </ns1:printLongs>
          <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef>
       </soapenv:Body>
    </soapenv:Envelope>
    Exception
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
    faultActor:
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
      at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:143)
      at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1031)
      at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
      at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1140)
      at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:238)
      at org.apache.axis.message.RPCElement.getParams(RPCElement.java:386)
      at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:148)
      at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:319)
      at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
      at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
      at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
      at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:450)
      at org.apache.axis.server.AxisServer.invoke(AxisServer.java:285)
      at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:653)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
      at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:301)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      ....

    Dave, not sure if you still are looking for an answer but i hate seeing unreplied posts so i felt i needed to post something. I'm just beginning with this stuff as well so take my suggestions with a grain of salt....or a beer. Anyways, case 2 would show that you are getting your parameters through properly because the "deserialization" errror is targetted towards the soap reply. Most likely you are trying to receive back a none primitive type. :-D i.e. such as the problem that i'm having.
    hope that helps somewhat.
    graeme.

  • How use proxyclient with Reportexecution2005?

    Hi,
    I want to run a report from a SSRS-server in my C# code (i want to export the report in a 2007-2010 excel format).
    I know that I need to use the Reportexecution2005 WCF-service but I have never done this before and I can't find any nice examples on the web...
    The most examples doesn't deal with a "Soap-client" (they seems to use the webservice-class) and use another kind of Reder-method (with differende parameters).
    Here is my beginning:
    varclient =
    newReportExecutionServiceSoapClient();     
    var  result = client.Render(???)
    Hope someone can help me to with the code...
    regards,
    Marius H Enerud

    Hi Marius,
    On the basis of the description, I understand that you intend to use ReportExecution2005 web service to render reports in Excel format.
    The Reporting Services Execution Web service allows developers to programmatically process and render reports from report server. To process a specific report and render it in the specified format, we can use the “Render” method in the ReportExecutionService.
    Here, you can see these steps below to render the report:
    1. In the custom application, add a web service reference. The endpoint should be:http://<servername>/reportserver/ReportExecution2005.asmx
    2. Use the following code to render the report in the specified format:
    using System;
    using System.IO;
    using System.Web.Services.Protocols;
    using myNamespace.MyReferenceName; 
    class Sample{   
    static void Main(string[] args)   
    ReportExecutionService rs = new ReportExecutionService();       
    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;        rs.Url= "http://myserver/reportserver/ReportExecution2005.asmx";         // Render arguments       
    byte[] result = null;       
    string reportPath = "/AdventureWorks Sample Reports/Employee Sales Summary";     
    string format = "Excel";       
    string historyID = null;       
    string devInfo = null; // Prepare report parameter.       
    ParameterValue[] parameters = new ParameterValue[3];       
    parameters[0] = new ParameterValue();       
    parameters[0].Name = "EmpID";       
    parameters[0].Value = "288";       
    parameters[1] = new ParameterValue();       
    parameters[1].Name = "ReportMonth";       
    parameters[1].Value = "6";  // June       
    parameters[2] = new ParameterValue();       
    parameters[2].Name = "ReportYear";       
    parameters[2].Value = "2004";       
    DataSourceCredentials[] credentials = null;       
    string showHideToggle = null;       
    string encoding;       
    string mimeType;       
    string extension;       
    Warning[] warnings = null;       
    ParameterValue[] reportHistoryParameters = null;        string[] streamIDs = null;               
    ExecutionInfo execInfo = new ExecutionInfo();        ExecutionHeader execHeader = new ExecutionHeader();        rs.ExecutionHeaderValue = execHeader;       
    execInfo = rs.LoadReport(reportPath, historyID);        rs.SetExecutionParameters(parameters, "en-us");         String SessionId = rs.ExecutionHeaderValue.ExecutionID;        Console.WriteLine("SessionID: {0}", rs.ExecutionHeaderValue.ExecutionID);       
    try       
    result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);           
    execInfo = rs.GetExecutionInfo();            Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime);
    catch (SoapException e)       
    Console.WriteLine(e.Detail.OuterXml);       
    }        // Write the contents of the report to an PDF file.       
    try       
    FileStream stream = File.Create("report.pdf", result.Length);           
    Console.WriteLine("File created."); 
               stream.Write(result, 0, result.Length);           
    Console.WriteLine("Result written to the file.");           
    stream.Close();      
    catch (Exception e)       
    Console.WriteLine(e.Message);       
    For more information, please see:
    ReportExecutionService.Render Method
    ReportExecution2005 Namespace
    If I have any misunderstanding, please feel free to contact me.
    Regards,
    Heidi Duan
    If you have any feedback on our support, please click
    here.
    Heidi Duan
    TechNet Community Support

  • Using Reporting Services Web Service methods to run a report with query parameters

    I'm attempting to use the ReportExecutionService methods to process a report that contains four parameters,  two of them query parameters. In total, the report must execute two queries. The two query parameters are determined by the execution of
    the second query.
    So, I've read about GetExecutionInfo and SetExecutionParams. To quote the MSDN page for GetExecutionInfo, "Use this method iteratively with the SetExecutionParameters method to evaluate parameters that have query- or expression-based defaults."
    Can anybody explain how to use this, or any other method, to execute a report such as mine? The first query gets the rows of the report; the second query gets the row count. LoadReport does not seem to do the trick by itself. I need to use the technique
    described in the quote above, I think.
    I could really use some help. Thanks!

    Hello,
    If I understand correctly, you create a local report which choose report from Report Server. You have two query parameters in the report which are returned by stored procedure. Currently, you cannot get default values for these parameters when run the report.
    Based on my test, if we haven’t configure these parameter with Available Values, we can reproduce the same issue. Also, caching issue may cause the same issue. If the issue is persist, please delete the corresponding report in the report server. Then, redeploy
    it to check.
    There is a similar issue, you can refer to it.
    http://social.msdn.microsoft.com/Forums/en-US/6a548d65-35d0-4a3e-8b64-3b7b655c76ee/ssrs-2008-report-parameter-default-value-doesnt-work-when-deployed
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Calling a method with parameters in jstl?

    i need to call a method with a series of String parameters what am i doing wrong?
    the java
        public ArrayList getEmployeeSkills(String ename, String snmae, String yearsexp)the jstl
        <jsp:useBean id="empskill" class="com.Database.EmployeeSkill"/>
        <c:forEach var="emp" items="${empskill.EmployeeSkills(null, null, null)}">
        </c:forEach>

    this works:
         <jsp:useBean id="empskill" class="com.Database.EmployeeSkill" scope="page">
             <jsp:setProperty name="empskill" property="ename" value="Helen Smith"/>
             <jsp:setProperty name="empskill" property="sname" value="Java"/>
         </jsp:useBean>but this part isnt:
         <c:forEach var="empskill" items="${empskill.EmployeeSkillsReport}">
         </c:forEach>ive removed the get part from the method as i have done before from the java class it is calling:
    public ArrayList getEmployeeSkillsReport()
    but it produces:
    org.apache.jasper.JasperException: Exception in JSP: /main.jsp:146
    143:      </jsp:useBean>
    144:      
    145:
    146:      <c:forEach var="empskill" items="${empskill.EmployeeSkillsReport}">
    147:      </c:forEach>
    148:                          
    149:    
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:506)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.ServletException: An error occurred while evaluating custom action attribute "items" with value "${empskill.EmployeeSkillsReport}": Unable to find a value for "EmployeeSkillsReport" in object of class "com.Database.EmployeeSkill" using operator "." (null)
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:843)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:776)
         org.apache.jsp.main_jsp._jspService(main_jsp.java:244)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "items" with value "${empskill.EmployeeSkillsReport}": Unable to find a value for "EmployeeSkillsReport" in object of class "com.Database.EmployeeSkill" using operator "." (null)
         org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:109)
         org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:129)
         org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:75)
         org.apache.taglibs.standard.tag.el.core.ForEachTag.evaluateExpressions(ForEachTag.java:155)
         org.apache.taglibs.standard.tag.el.core.ForEachTag.doStartTag(ForEachTag.java:66)
         org.apache.jsp.main_jsp._jspx_meth_c_forEach_3(main_jsp.java:590)
         org.apache.jsp.main_jsp._jspService(main_jsp.java:232)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  • Best practice for calling an AM method with parameters

    Which will be the best way to call an AM method with parameters from a backing bean.
    I usually use the BindingContainer to get the operation binding and then call execute function. But when the method have parameters, how to do it?
    Thanks

    Hi,
    same:
    operationBinding.getParamMap().put("argument1Name", argument1Value);
    operationBinding.getParamMap().put("argument2Name", argument2Value);
    operationBinding.execute();
    Frank

  • WSDL for web method with parameters from different namespaces

    I'm trying to create a web service that exposes a method that accepts a JAXB XML object and a timestamp as parameters and returns another JAXB XML object. I've tried to follow the contract-first method by creating the schema and WSDLs first. I've created the schemas for the XML and deployed them on a web server and I've written the following WSDL:
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:tns="http://bar.org"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MyWebService"
         xmlns:ns0="http://foo.org/Transaction"
         xmlns:ns1="http://bar.org/TransactionResponse"
         targetNamespace="http://bar.org">
         <!-- T Y P E S -->
         <wsdl:types>
              <xsd:schema targetNamespace="http://bar.org"
                  xmlns:ns0="http://foo.org/Transaction"
                  xmlns:ns1="http://bar.org/TransactionResponse"
                  xmlns="http://bar.org">
                   <xsd:import namespace="http://foo.org/Transaction" schemaLocation="http://myHost/schemas/Transaction.xsd"/>
                   <xsd:import namespace="http://bar.org/TransactionResponse" schemaLocation="http://myHost/schemas/TransactionResponse.xsd"/>
                   <xsd:element name="ProcessTransactionRequest">
                       <xsd:complexType>
                           <xsd:sequence>
                               <xsd:element ref="ns0:Transaction"/>
                               <xsd:element name="TransactionTime" type="xsd:dateTime"/>
                           </xsd:sequence>
                       </xsd:complexType>
                   </xsd:element>
              </xsd:schema>
         </wsdl:types>
         <!-- M E S S A G E S -->
         <wsdl:message name="ProcessTransactionRequest">
              <wsdl:part element="tns:ProcessTransactionRequest" name="parameters" />
         </wsdl:message>
         <wsdl:message name="ProcessTransactionResponse">
              <wsdl:part element="ns1:TransactionResponse" name="parameters" />
         </wsdl:message>
         <!-- P O R T   T Y P E -->
         <wsdl:portType name="MyWebServicePortType">
              <wsdl:operation name="ProcessTransaction">
                   <wsdl:input message="tns:ProcessTransactionRequest" />
                   <wsdl:output message="tns:ProcessTransactionResponse" />
              </wsdl:operation>
         </wsdl:portType>
         <!-- B I N D I N G -->
         <wsdl:binding name="MyWebServiceSOAP" type="tns:MyWebServicePortType">
              <soap:binding style="document"
                   transport="http://schemas.xmlsoap.org/soap/http" />
              <wsdl:operation name="ProcessTransaction">
                   <soap:operation soapAction=""/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
                   <wsdl:output>
                        <soap:body use="literal"/>
                   </wsdl:output>
              </wsdl:operation>
         </wsdl:binding>
         <!-- S E R V I C E -->
         <wsdl:service name="MyWebService">
              <wsdl:port binding="tns:MyWebServiceSOAP" name="MyWebServiceSOAP">
                   <soap:address location="http://www.example.org/"/>
              </wsdl:port>
         </wsdl:service>
    </wsdl:definitions>However when I run the WsImport tool bundled with JAX-WS RI 2.1.1, I get the following interface:
    public interface MyWebServicePortType {
         * @param parameters
         * @return
         *     returns org.bar.transactionresponse.TransactionResponse
        @WebMethod(operationName = "ProcessTransaction")
        @WebResult(name = "TransactionResponse", targetNamespace = "http://bar.org/TransactionResponse", partName = "parameters")
        public TransactionResponse processTransaction(
            @WebParam(name = "ProcessTransactionRequest", targetNamespace = "http://bar.org", partName = "parameters")
            ProcessTransactionRequest parameters);
    }Which is workable, but I was wondering how to modify the WSDL to get a web method signature similar to:
    public TransactionResponse processTransaction(
            @WebParam(name = "Transaction", targetNamespace = "http://foo.org/Transaction", partName = "transaction")
            Transaction transaction,
            @WebParam(name = "TransactionTime", targetNamespace = "http://bar.org", partName = "transactionTime")
            XMLGregorianCalendar transactionTime);With two parameters in the parameter list instead of one. Is there a way to do this?

    Try changing the <xsd:element name="ProcessTransactionRequest"> element name to: <xsd:element name="ProcessTransaction"> and update the reference to it in the <wsdl:message name="ProcessTransactionRequest"> message.
    In order to use wrapper style, your WSDL needs to have the following characteristics:
    1) The operation's input and output messages (if present) each contain a single part
    2) The input message part refers to a global element declaration whose localname is equal to the operation name
    3) The output message refers to a global element declaration
    4) The elements referred to by the input and output message parts (henceforth referred to as wrapper elements) are both complex types defined using the xsd:sequence compositor
    5 The wrapper elements only contain child elements, they must not contain other structures such as wildcards...

  • Issue with SharePoint foundation 2010 to use Claims Based Auth with Certificate authentication method with ADFS 2.0

    I would love some help with this issue.  I have configured my SharePoint foundation 2010 site to use Claims Based Auth with Certificate authentication method with ADFS 2.0  I have a test account set up with lab.acme.com to use the ACS.
    When I log into my site using Windows Auth, everything is great.  However when I log in and select my ACS token issuer, I get sent, to the logon page of the ADFS, after selected the ADFS method. My browser prompt me which Certificate identity I want
    to use to log in   and after 3-5 second
     and return me the logon page with error message “Authentication failed” 
    I base my setup on the technet article
    http://blogs.technet.com/b/speschka/archive/2010/07/30/configuring-sharepoint-2010-and-adfs-v2-end-to-end.aspx
    I validated than all my certificate are valid and able to retrieve the crl
    I got in eventlog id 300
    The Federation Service failed to issue a token as a result of an error during processing of the WS-Trust request.
    Request type: http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue
    Additional Data
    Exception details:
    Microsoft.IdentityModel.SecurityTokenService.FailedAuthenticationException: MSIS3019: Authentication failed. ---> System.IdentityModel.Tokens.SecurityTokenValidationException:
    ID4070: The X.509 certificate 'CN=Me, OU=People, O=Acme., C=COM' chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. 'A certification chain processed
    correctly, but one of the CA certificates is not trusted by the policy provider.
    at Microsoft.IdentityModel.X509CertificateChain.Build(X509Certificate2 certificate)
    at Microsoft.IdentityModel.Tokens.X509NTAuthChainTrustValidator.Validate(X509Certificate2 certificate)
    at Microsoft.IdentityModel.Tokens.X509SecurityTokenHandler.ValidateToken(SecurityToken token)
    at Microsoft.IdentityModel.Tokens.SecurityTokenElement.GetSubject()
    at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.GetOnBehalfOfPrincipal(RequestSecurityToken request, IClaimsPrincipal callerPrincipal)
    --- End of inner exception stack trace ---
    at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.GetOnBehalfOfPrincipal(RequestSecurityToken request, IClaimsPrincipal callerPrincipal)
    at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.BeginGetScope(IClaimsPrincipal principal, RequestSecurityToken request, AsyncCallback callback, Object state)
    at Microsoft.IdentityModel.SecurityTokenService.SecurityTokenService.BeginIssue(IClaimsPrincipal principal, RequestSecurityToken request, AsyncCallback callback, Object state)
    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.DispatchRequestAsyncResult..ctor(DispatchContext dispatchContext, AsyncCallback asyncCallback, Object asyncState)
    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.BeginDispatchRequest(DispatchContext dispatchContext, AsyncCallback asyncCallback, Object asyncState)
    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.ProcessCoreAsyncResult..ctor(WSTrustServiceContract contract, DispatchContext dispatchContext, MessageVersion messageVersion, WSTrustResponseSerializer responseSerializer, WSTrustSerializationContext
    serializationContext, AsyncCallback asyncCallback, Object asyncState)
    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.BeginProcessCore(Message requestMessage, WSTrustRequestSerializer requestSerializer, WSTrustResponseSerializer responseSerializer, String requestAction, String responseAction, String
    trustNamespace, AsyncCallback callback, Object state)
    System.IdentityModel.Tokens.SecurityTokenValidationException: ID4070: The X.509 certificate 'CN=Me, OU=People, O=acme., C=com' chain building
    failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. 'A certification chain processed correctly, but one of the CA certificates is not trusted by the policy provider.
    at Microsoft.IdentityModel.X509CertificateChain.Build(X509Certificate2 certificate)
    at Microsoft.IdentityModel.Tokens.X509NTAuthChainTrustValidator.Validate(X509Certificate2 certificate)
    at Microsoft.IdentityModel.Tokens.X509SecurityTokenHandler.ValidateToken(SecurityToken token)
    at Microsoft.IdentityModel.Tokens.SecurityTokenElement.GetSubject()
    at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.GetOnBehalfOfPrincipal(RequestSecurityToken request, IClaimsPrincipal callerPrincipal)
    thx
    Stef71

    This is perfectly correct on my case I was not adding the root properly you must add the CA and the ADFS as well, which is twice you can see below my results.
    on my case was :
    PS C:\Users\administrator.domain> $root = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\
    cer\SP2K10\ad0001.cer")
    PS C:\Users\administrator.domain> New-SPTrustedRootAuthority -Name "domain.ad0001" -Certificate $root
    Certificate                 : [Subject]
                                    CN=domain.AD0001CA, DC=domain, DC=com
                                  [Issuer]
                                    CN=domain.AD0001CA, DC=portal, DC=com
                                  [Serial Number]
                                    blablabla
                                  [Not Before]
                                    22/07/2014 11:32:05
                                  [Not After]
                                    22/07/2024 11:42:00
                                  [Thumbprint]
                                    blablabla
    Name                        : domain.ad0001
    TypeName                    : Microsoft.SharePoint.Administration.SPTrustedRootAuthority
    DisplayName                 : domain.ad0001
    Id                          : blablabla
    Status                      : Online
    Parent                      : SPTrustedRootAuthorityManager
    Version                     : 17164
    Properties                  : {}
    Farm                        : SPFarm Name=SharePoint_Config
    UpgradedPersistedProperties : {}
    PS C:\Users\administrator.domain> $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\
    cer\SP2K10\ADFS_Signing.cer")
    PS C:\Users\administrator.domain> New-SPTrustedRootAuthority -Name "Token Signing Cert" -Certificate $cert
    Certificate                 : [Subject]
                                    CN=ADFS Signing - adfs.domain
                                  [Issuer]
                                    CN=ADFS Signing - adfs.domain
                                  [Serial Number]
                                    blablabla
                                  [Not Before]
                                    23/07/2014 07:14:03
                                  [Not After]
                                    23/07/2015 07:14:03
                                  [Thumbprint]
                                    blablabla
    Name                        : Token Signing Cert
    TypeName                    : Microsoft.SharePoint.Administration.SPTrustedRootAuthority
    DisplayName                 : Token Signing Cert
    Id                          : blablabla
    Status                      : Online
    Parent                      : SPTrustedRootAuthorityManager
    Version                     : 17184
    Properties                  : {}
    Farm                        : SPFarm Name=SharePoint_Config
    UpgradedPersistedProperties : {}
    PS C:\Users\administrator.PORTAL>

  • How to call a AM method with parameters from Managed Bean?

    Hi Everyone,
    I have a situation where I need to call AM method (setDefaultSubInv) from Managed bean, under Value change Listner method. Here is what I am doing, I have added AM method on to the page bindings, then in bean calling this
    Class[] paramTypes = { };
    Object[] params = { } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    This works and able to call this method if there are no parameters. Say I have to pass a parameter to AM method setDefaultSubInv(String a), i tried calling this from the bean but throws an error
    String aVal = "test";
    Class[] paramTypes = {String.class };
    Object[] params = {aVal } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    I am not sure this is the right way to call the method with parameters. Can anyone tell how to call a AM method with parameters from Manage bean
    Thanks,
    San.

    Simply do the following
    1- Make your Method in Client Interface.
    2- Add it to Page Def.
    3- Customize your Script Like the below one to Achieve your goal.
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("GetUserRoles");
    operationBinding.getParamsMap().put("username", "oracle");
    operationBinding.getParamsMap().put("role", "F1211");
    operationBinding.getParamsMap().put("Connection", "JDBC");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    i hope it help you
    thanks

Maybe you are looking for