EJB QL array parameters

Hello,
Whats the deal with these array parameters?
I posted a similar comment to the conversation at:
http://forum.java.sun.com/thread.jspa?threadID=484953&tstart=0
Basically I would like to pass an array of integers to a "WHERE IN (?1)" clause of my EJB QL query and have it retrieve EJBs for each of the integer PKs. I used regular sql call to get a list of items that the user wishes to see, but I am struggling with rendering them on the results page without calling a finder method n times where n is the number of found items.
I'm using Rational Application Developer 6.0.1 w/ WebSphere App Server 6.0. In the ejb-ql descriptor page I am able to define my queries and even the parameters too. It even has a checkbox whether or not the param is infact an array. When I check it, I get java.lang.int[][]: doesn't two sets of square brackets like that indicate a multi-dimensional array? I would have expected it to have simply done a single box like java.lang.int[]. Am I overlooking something obvious here (or not so obvious!)?
Here is the code it generates that it is unable to work with (complains about not being able to find the query):
  <query>
     <description></description>
     <query-method>
     <method-name>findByIds</method-name>
     <method-params>
          <method-param>java.lang.int[][]</method-param>
     </method-params>
  </query-method>
  <ejb-ql>select object(o) from Hproblog o where  o.probtrakno in (?1)</ejb-ql>
</query>

Thx for your put :)
I tried that out, and as far as I can tell I don't think I can even put arrays in as params!
I tried java.lang.Integer[], int[], and even java.lang.String[] and I always got the same error generating the query:
Error=unknown EJB or ASN name: java.lang.int[]
Error=unknown EJB or ASN name: java.lang.Integer[]
Error=unknown EJB or ASN name: java.lang.String[]I wonder if there is simply an error in the EJB editor in RAD 6.0.1? It appears the intended to support arrays but something I'm either doing wrong or how I've gotten setup is not allowing me to generate any queries with arrays :(
Hmm somehow in retesting those three to be sure that those errors did occur, I failed to reproduce the double [][] multi-dimensional parameter (unfortunately I think I did the Refresh Update 6.0.0.1 --> 6.0.1 right in the middle, so I don't know exactly know if that is still an issue).
I looked up ASN and it means Abstract Schema Name, so I'm not entirely sure how to apply that in this context, any ideas?
Thx for your comments.

Similar Messages

  • Problems with Array-Parameters when using Document-Binding

    Hi,
    I use the following environment:
    JDeveloper 11.1.1.3.0
    WLS 10.3.3.0
    I created a small EJB (2.1), containing a simple method, which is using arrays as parameters:
    public String doTestArray(String[] aStringArray, int[] aIntArray)
    throws RemoteException;
    I exposed this EJB as a Webservice using JDev's Webservice wizard. I choosed Document/Wrapped-Binding. WSDL and mapping file are being generated. Made an EAR-Deployment-Profile and deployed the application to Integrated-WLS.
    I tried to test the Webservice with the WLS integrated test client, which is generating the following request:
    <doTestArrayElement xmlns="http://model/types/">
    <!--Zero or more repetitions:-->
    <arrayOfString_1>string</arrayOfString_1>
    <!--Zero or more repetitions:-->
    <arrayOfint_2>3</arrayOfint_2>
    </doTestArrayElement>
    Unfortunately, the invokation fails. WLS returns
    weblogic.wsee.codec.CodecException: Failed to decode message
    at weblogic.wsee.codec.soap11.SoapCodec.decode(SoapCodec.java:188)
    at weblogic.wsee.ws.dispatch.server.CodecHandler.decode(CodecHandler.java:139)
    That only happens in methods, which use array-parameters. Simple parameters are no problem.
    However, when I use RPC/Encoded as Webservice-Binding, everything seems to be fine.
    Does WLS have problems in general using array-parameters and Document-Binding?
    Any help would be appreciated.
    Thanks,
    Stefan

    Hi Josko,
    Where do you have this problem 3.5 or 7.0 BexAnalyzer.
    When ever heirarchy icons are created in BEx, respective hyperlink is assigned to each of them, Make sure that you dont manipulate with them,,
    If you still have problem then create OSS message.
    Regards,
    Vinay

  • OSB java call out with array parameters

    Hi all,
    I have a java call out with array parameters, follow the firm of java method:
    logBody2(String category, XmlObject headerXml, String[] level, XmlObject[] xml)
    The java call out have String[] and XmlObject[] arrays in intput, my question is how I can pass these arrays of values at java call out?
    Thk
    L.

    For array, comma-separated values should be passed. For e.g. -
    If input parameter is of type String[] then passed values should be comma-separated strings like - 'Anuj','Dwivedi'
    If input parameter is of type XmlObject[] then passed values should be comma-separated XmlObject like - <anuj/>,<dwivedi/>
    Regards,
    Anuj

  • Oracle 7 & JDBC - array parameters

    I wonder if anybody can tell me whether and how it is possible to pass array parameters to & from Oracle 7.3.4 stored procedures via JDBC.
    All the documentation I have found on the subject relates to Oracle 8, and I know the implementation of arrays/tables/collections in PL/SQL changed substantially between Oracle 7 and 8. My client isn't upgrading to Oracle 8 until later this year.

    In the 8.1.7 JDBC documentation it at http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83724/indexby.htm
    it talks about the OCI driver being able to bind some PL/SQL index by tables of simple types.
    For more help, you may want to repost your question on the SQLJ/JDBC forum.
    Hope this helps,
    Rob
    null

  • PLS-00306:NET to call Oracle stored procedure,Use Array parameters

    Development Environment:Windows 2003 SP2+Oracle 10g
    . NET to call Oracle stored procedure, use an array of types of parameters
    Step1:(In the Oracle database define an array of types)
    CREATE OR REPLACE TYPE STRING_VARRAY AS VARRAY (1000) OF NVARCHAR2(255)
    OR
    CREATE OR REPLACE type string_array is table of nvarchar2(255)
    Step2:
    CREATE OR REPLACE PROCEDURE Test
    (i_test in string_varray,o_result out int)
    IS
    BEGIN
    o_result:=i_test.count;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    WHEN OTHERS
    THEN
    o_result:=0;
    END arraytest;
    Step3:
    ODP.NET(Oracle 10g)
    OracleConnection conn = new OracleConnection("User Id=test;Password=test;Data Source=test");
    OracleCommand cmd = new OracleCommand("Test", conn);
    cmd.CommandType = CommandType.StoredProcedure;
    string[] str = new string[2] { "11", "222" };
    cmd.ArrayBindCount=2;
    OracleParameter p1 = new OracleParameter("i_test", OracleDbType.NVarChar);
    p1.Direction = ParameterDirection.Input;
    p1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
    p1.Value = str;
    p1.ArrayBindSize=new int[2]{2,3};
    p1.ArrayBindStatus = new OracleParameterStatus[2]{
    OracleParameterStatus.Success,
    OracleParameterStatus.Success
    cmd.Parameters.Add(p1);
    OracleParameter p2 = new OracleParameter("o_result", OracleDbType.Int32);
    p2.Direction = ParameterDirection.Output;
    P2.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
    p2.Value=0;
    cmd.Parameters.Add(p2);
    int i = 0;
    try
    conn.Open();
    cmd.ExecuteNonQuery();
    i =(int) p2.Value;
    catch (Exception ex)
    finally
    conn.Close();
    Error:
    Execution Failed:ORA-06550:Line 1,Column 7:
    PLS-00306:Test parameters when calling the number or types of errors
    ORA-06550:Line 1,Column 7:
    PL/SQL:Statement ignored

    Hi,
    See the answer in [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=909564&tstart=0]
    Hope it helps,
    Greg

  • Call stored procedure in JDBC passing Array parameters

    Hi all,
    Im trying to call an Oracle Stored Procedure with JDBC. The problem is
    that my parameter is an Array (PL/SQL Type is "Table Of").
    How can i call this procedure by passing right Java parameters to
    the Callable statement ??
    In the Documentation, all samples don't work ! it's possible to
    call a procedure that return Array Type but when we need to pass an Array as
    a parameter we have a DataType exception.
    Any idea ?
    thanx in advance
    Sam.

    Hi Sam,
    I don't have an answer to your question, just some suggestions as to
    where else you may find help.
    Do you know about the "Ask Tom" website:
    http://asktom.oracle.com
    Also, you may find something in the comp.databases.oracle.* newsgroups:
    http://groups.google.com
    I found this article there -- but it's not exactly what you're looking
    for:
    http://groups.google.com/groups?q=array+group:comp.databases.oracle.server+author:Thomas+author:Kyte&hl=iw&as_qdr=w&selm=a9sg06027kf%40drn.newsguy.com&rnum=1
    Good Luck,
    Avi.

  • Passing array parameters to Stored procedure

    Hi,
    I need to call a procedure repeatedly with different set of parameters. Instead To do this, I can form a parameter arrays and pass it to the procedure. This is working fine with Oracle 8.1.7 database and Oracle 8.1.7 odbc driver.
    Is there any difference in the way 8.1.6 Oracle ODBC driver behave? When we use the same code with 8.1.6 ODBC driver (with either 8.1.6 database or 8.1.7 database), and pass an array of n elements to the stored procedure, first elemet in the array is processed correctly and for the remaining n-1 times the same value is getting used (which leades to a unique constraint violation since procedure in this case does an insert). Soem of our clients are on 8.1.6 and so we need to get this working on it too.
    Also are you aware if Microsoft ODBC driver implements this correctly. When we traced with ODBC trace, it was executing the procedure n times one after the other thereby simulating the effect but poor performance. (MDAC 2.6).
    Is there any extra settings to be done?
    Thanks
    Sree

    Hi Justin,
    When I installed 8.1.6.6 ODBC driver this problem went off, but I recieved another problem.
    I am getting
    "ORA-01460 unimplemented or unreasonable conversion requested"
    on execution of some procedures with parameter arrays. They work fine with 8.1.7.0.
    Any idea? Is it suggested that I use 8.1.7 ODBC driver with 8.1.6 server/client? Will it create some other problem?
    Thanks
    Sree

  • Best practice question - elipsis or array parameters?

    When I design APIs I have the choice between something like
        public static void foo(String[] params)
            // do stuff
        }or
        public static void foo(String... params)
            // do stuff
        }If I have both declarations I get the following error (which I can understand):
    "cannot declare both foo(java.lang.String...) and foo(java.lang.String[]) in blablabla.Main
    public static void foo(String... params)"
    So I can use one or the other. The question is: What is "better"?
    The elipsis version (with ...) looks nicer because I don't have to build an array prior to calling foo if my params do come from separate sources and I can pass them both separately.

    But isn't this the same as a call to foo(null) if I would have used the array version?Depends on how you implemented your method. Example:
    public static void foo1(String[] params) {
      for(String param: params) {
        System.out.println(param.length());
    public static void foo2(String... params) {
      for(String param: params) {
        System.out.println(param.length());
    public static void main(String[] args) {
      foo1(null);
      foo2();
    }The call foo1(null) would fail for obvious reasons, whereas foo2() would be valid.
    Lesson: an empty array is different from a null array.
    However, is there any other consideration I should do - performance for instance? Forget about performance: ellipsis is just a convenient way to overload a method for the no-arg case, so use it if you have a no arg-case, else use the array version.

  • 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

  • PHP using soap to call EJB

    Hello everybody,
    I've a problem to call a EJB form a PHP script.
    There is a Apache with PHP 5.2.0 and a SAP NetWeaver Application Server 7.10 / AS Java 7.10 running on the system.
    I wanted to use soap to call a method in an EJB. It's only a test EJB:
    [code]
    package beans;
    import javax.ejb.Stateless;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    @WebService(name="HelloWorldEARBean",serviceName="HelloWorldEARBeanService",targetNamespace="http://beans/",portName="HelloWorldEARBeanPort") @Stateless public class HelloWorldEARBean {
      @WebMethod public String sayHello(String testStr){
                return "Hello Mr. "+testStr;
      @WebMethod public String getReturn(String inputStr){
                return "the return value is"+inputStr;
    [/code]
    I tried it with the PEAR SOAP in the following script:
    [code]
    <?php
    require_once 'SOAP/Client.php';
    $wsdl_url     = 'http://localhost:50000/HelloWorldEARBeanService/HelloWorldEARBean?wsdl';
    $WSDL = new SOAP_WSDL($wsdl_url);
    $client = $WSDL->getProxy();
    $client->__trace(1);
    $options=array('namespace' => 'http://beans/',
      'style' => 'rpc',
      'soapaction' => 'sayHello');
    $NAME = "Bob"; 
    $parameters=array(
         'parameters', $NAME
    $result = $client->getReturn($parameters);
    echo "<pre>";
    print_r($params);
    echo "</pre>";
    echo "<h2>return</h2>";
    echo "<pre>";
    print_r($result);
    echo "</pre>";
    echo '<h2>Request</h2>';
    echo '<pre>' . htmlspecialchars($client->__getlastrequest(), ENT_QUOTES) . '</pre>';
    echo '<h2>Response</h2>';
    echo '<pre>' . htmlspecialchars($client->__getlastresponse(), ENT_QUOTES). '</pre>';
    ?>
    [/code]
    The AS distributes the following WSDL:
    [code]
    - <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://beans/" xmlns:tns="http://beans/">
    - <wsdl:types>
    - <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://beans/">
      <xs:element name="getReturn" type="tns:getReturn" />
      <xs:element name="getReturnResponse" type="tns:getReturnResponse" />
      <xs:element name="sayHello" type="tns:sayHello" />
      <xs:element name="sayHelloResponse" type="tns:sayHelloResponse" />
    - <xs:complexType name="sayHello">
    - <xs:sequence>
      <xs:element name="arg0" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
    - <xs:complexType name="sayHelloResponse">
    - <xs:sequence>
      <xs:element name="return" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
    - <xs:complexType name="getReturn">
    - <xs:sequence>
      <xs:element name="arg0" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
    - <xs:complexType name="getReturnResponse">
    - <xs:sequence>
      <xs:element name="return" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
      </xs:schema>
      </wsdl:types>
    - <wsdl:message name="sayHelloIn">
      <wsdl:part name="parameters" element="tns:sayHello" />
      </wsdl:message>
    - <wsdl:message name="sayHelloOut">
      <wsdl:part name="sayHelloResponse" element="tns:sayHelloResponse" />
      </wsdl:message>
    - <wsdl:message name="getReturnIn">
      <wsdl:part name="parameters" element="tns:getReturn" />
      </wsdl:message>
    - <wsdl:message name="getReturnOut">
      <wsdl:part name="getReturnResponse" element="tns:getReturnResponse" />
      </wsdl:message>
    - <wsdl:portType name="HelloWorldEARBean">
    - <wsdl:operation name="sayHello" parameterOrder="parameters">
      <wsdl:input message="tns:sayHelloIn" />
      <wsdl:output message="tns:sayHelloOut" />
      </wsdl:operation>
    - <wsdl:operation name="getReturn" parameterOrder="parameters">
      <wsdl:input message="tns:getReturnIn" />
      <wsdl:output message="tns:getReturnOut" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="HelloWorldEARBeanBinding" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" type="tns:HelloWorldEARBean">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="sayHello">
      <soap:operation soapAction="" />
    - <wsdl:input>
      <soap:body parts="parameters" use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="getReturn">
      <soap:operation soapAction="" />
    - <wsdl:input>
      <soap:body parts="parameters" use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="HelloWorldEARBeanService">
    - <wsdl:port name="HelloWorldEARBeanPort" binding="tns:HelloWorldEARBeanBinding">
      <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://localhost:50000/HelloWorldEARBeanService/HelloWorldEARBean" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    [/code]
    By the following output it's obvious that the AS or the EJB (webservice) doesn't receive the parameter send by the PHP script. Look at the output:
    return value:
    the return value is null
    [code]
    Request:
    POST /HelloWorldEARBeanService/HelloWorldEARBean HTTP/1.0
    User-Agent: PEAR-SOAP 0.8.0RC4-devel
    Host: localhost
    Content-Type: text/xml; charset=UTF-8
    Content-Length: 438
    SOAPAction: ""
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    >
    <SOAP-ENV:Body>
    <getReturn xmlns="http://beans/">
    <item>parameters</item>
    <item>Bob</item></getReturn>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Response:
    HTTP/1.1 200 OK
    server: SAP NetWeaver Application Server 7.10 / AS Java 7.10
    content-type: text/xml; charset=utf-8
    date: Wed, 14 Feb 2007 15:51:53 GMT
    connection: close
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsu:Created>2007-02-14T15:51:53Z</wsu:Created>
    <wsu:Expires>2007-02-14T15:52:23Z</wsu:Expires></wsu:Timestamp></wsse:Security></SOAP-ENV:Header>
    <SOAP-ENV:Body><ns2:getReturnResponse xmlns:ns2='http://beans/'>
    <return>the return value is null</return></ns2:getReturnResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
    [/code]
    I used different soap interfaces for PHP like nusoap and the integrated soap interface of PHP 5.
    Further I experimented with different parameters inside the function call
    that results in small differencies at the xml-request.
    Thanks.

    Hi
    I've solved the problem now. I just have to add
    @SOAPBinding(style=SOAPBinding.Style.RPC)
    in the EJB, that's all.
    Here is the complete code, ... maybe some other guys have this problem too, so I will post the working code:
    At first the EJB:
    package beans;
    import javax.ejb.Stateless;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import javax.jws.soap.SOAPBinding;
    import beans.HelloWorldEARBean;
    @WebService(name="HelloWorldEARBean",serviceName="HelloWorldEARBeanService",targetNamespace="http://beans/",portName="HelloWorldEARBeanPort")
    @SOAPBinding(style=SOAPBinding.Style.RPC)
    @Stateless public class HelloWorldEARBean {
         @WebMethod public String sayHello(@WebParam(name="testStr") String testStr){
                return "Hello Mr. "+testStr;
    2. the local XML:
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://beans/" xmlns:tns="http://beans/">
      <wsdl:types>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://beans/">
          <xs:element name="sayHello" type="tns:sayHello"/>
          <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
          <xs:complexType name="sayHello">
              <xs:element name="testStr" type="xs:string" minOccurs="0"/>
          </xs:complexType>
          <xs:complexType name="sayHelloResponse">
              <xs:element name="return" type="xs:string" minOccurs="0"/>
          </xs:complexType>
        </xs:schema>
      </wsdl:types>
      <wsdl:message name="sayHelloIn">
        <wsdl:part name="parameters" element="tns:sayHello"/>
      </wsdl:message>
      <wsdl:message name="sayHelloOut">
        <wsdl:part name="sayHelloResponse" element="tns:sayHelloResponse"/>
      </wsdl:message>
      <wsdl:portType name="HelloWorldEARBean">
        <wsdl:operation name="sayHello" parameterOrder="parameters">
          <wsdl:input message="tns:sayHelloIn"/>
          <wsdl:output message="tns:sayHelloOut"/>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="HelloWorldEARBeanBinding" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" type="tns:HelloWorldEARBean">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="sayHello">
          <soap:operation soapAction=""/>
          <wsdl:input>
            <soap:body parts="parameters" use="literal"/>
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="HelloWorldEARBeanService">
        <wsdl:port name="HelloWorldEARBeanPort" binding="tns:HelloWorldEARBeanBinding">
          <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://localhost:50000/HelloWorldEARBeanService/HelloWorldEARBean"/>
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>
    3. the PHP script:
    see next post
    Thank you very much for your help.

  • Passing array to pl/sql procedure - pls-00306 wrong number/types of args

    its oracle 10.2 database;
    I have a procedure with array parameters based on simple sql types.
    eg
    create or replace type vt_attrname is table of varchar2(50);
    Now my call to the procedure works when the array is empty;
    as soon as I bulk collect into my local array, I get a compilation error.
    eg
    declare
    my_array  vt_attrname;
    begin
    select label
      bulk collect
      into my_array
      from table_name
    where 1=1;
    my_proc(p_array=>my_array);  -- syntax error
    end;if I pass null the call works but obviously array is empty.
    I have read something about varray's being incompatible between sqltypes and pl/sql.
    How do I get around this problem?
    The bulk collect is working okay.
    A small example would be appreciated.

    Yep, I spotted the syntax error earlier.
    However even though that seems to compile ok, I still get the problem with my package call.
    heres the actual call from the code
    vt_attrname and vt_attrvalues are types declared on another schema.
    I have redeclared them on the current schema now.
    create or replace type vt_attrname is table of varchar2(50);
    create or replace type vt_attrvalue is table of varchar2(500);
    create procedure <name>
    as
    v_cardapplattrtag   vt_attrname;
    v_cardapplattrvalue vt_attrvalue;
      for cardappl_cur in
        (select cardappl_id 
           from ci_cardappl
          where custcard_id = cur.document_logical_number)
        loop
        select label
          bulk collect
          into v_cardapplattrtag
          from ci_applver_attribute
          where applver_id = v_applver_id;
          v_array_size := v_cardapplattrtag.count;
        -- populate this array
        -- ppt_cardapplattrtag comes from ci_pplver_attribute
        --ppt_cardapplattrvalue -- various
    cci_setcardappl.SetCardApplAttrValue(
              pn_cardappl_id                 =>     cardappl_cur.cardappl_id,
              ppt_cardapplattrtag     =>      v_cardapplattrtag, -- works when null
              ppt_cardapplattrvalue   =>     NULL,
              pn_cardapplattrsize     =>     v_array_size,
              pv_arn                  =>     cur.application_request_id,
              pv_commit               =>    'FALSE');and the procedure protototype is
    PROCEDURE SetCardApplAttrValue(
              pn_cardappl_id           IN     NUMBER,
              ppt_cardapplattrtag     IN     VT_BPATTRNAME DEFAULT NULL,
              ppt_cardapplattrvalue   IN     VT_BPATTRVALUE DEFAULT NULL,
              pn_cardapplattrsize     IN     NUMBER,
              pv_arn                  IN     VARCHAR2,
              pv_commit               IN     VARCHAR2 DEFAULT 'FALSE');Edited by: Keith Jamieson on Sep 23, 2009 10:42 AM

  • EJB 3.0 Web Service

    Hi!
    I tried to create a Web Service (through wizard) from existing EJB 3.0 Session Bean. Basicly, the wizard just added @WebService annotation to my existing code...
    Now, the problem is that simple methods like:
    @WebMethod
    public String helloWorld() {
      return "Hello World!";
    }works fine. Expect that if I use Local Interface for this Session Bean, the WSDL shows two helloWorld methods (and one is with exclamation icon showing some kind of problem with multiple methods with same name - but it is not true, I have one and the other one is just interface).
    But, when I want to expose my real business service methods like:
    @WebMethod
    public List<Employee> getEmployees() {
      return (List<Employee>)q.getResultList();
    }it doesn't work (the Web Service create wizard finishes ok but service doesn't work)! When I try "Test Web Service" (from Session Bean context-menu) or "Show WSDL for Web Service annotations" the error is thrown (Null pointer exception in WSDL).
    Basically, it looks to me that Web Service cannot use EJB Entities as parameters or results. Is this correct? I saw some examples on EJB 3.0 web services and there are entities routinely used as both input and output parameters.
    Can someone, please, explain me what I'm doing wrong here.
    Thanks in advance,
    Pedja
    P.S. In Web Service wizard, only SOAP 1.1 is enabled. How can I choose SOAP 1.2? And what EJB 3.0 bindings are in same context (SOAP 1.2 or EJB 3.0 bindings?)?

    Hi Frank,
    Most of those problems are resolved (NPE was due to Timestamp field, and two methods with the same name in WSDL because of not choosing to generate SEI in wizard, so the generated WSDL had one method from the Session bean and the other from it's Local interface). But, the errors should DEFINITELY be more descriptive.
    Does the wizard work correctly? I noticed plenty of "bug like" details. For example, if I choose to create asynchronous web service, later when I go to Properties the "Asynchronous Web Service" checkbox isn't checked. Also, the @WebMethod annotations are sometimes generated and sometimes not (even if the method is checked to be exposed).
    I am also getting these exceptions when I create a proxy for the asynchronous web service (I selected "Generate asynchronous methods for all operations"), could be I'm doing something wrong:
    WARNING: The parameter/return type "java.util.concurrent.Future" in the method
    "public abstract java.util.concurrent.Future<?>
    view.proxy.MyAsyncWebService1.queryDepartmentFindAllAsync(javax.xml.ws.AsyncHandler<view.proxy.types.QueryDepartmentFindAllResponse>)"
    is not supported. This method will not be exposed.
    WARNING: The parameter/return type "java.util.concurrent.Future" in the method
    "public abstract java.util.concurrent.Future<?>
    view.proxy.MyAsyncWebService1.returnEmployeeAsync(javax.xml.ws.AsyncHandler<view.proxy.types.ReturnEmployeeResponse>)"
    is not supported. This method will not be exposed.
    Exception in thread "main" java.lang.NullPointerException
         at com.sun.xml.bind.v2.runtime.Coordinator.popCoordinator(Coordinator.java:122)
         at com.sun.xml.bind.v2.runtime.XMLSerializer.close(XMLSerializer.java:823)
         at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:310)
         at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:230)
         at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:87)
         at oracle.j2ee.ws.common.databinding.runtime.jaxb20.Jaxb20Serializer.serialize(Jaxb20Serializer.java:218)
         at oracle.j2ee.ws.common.databinding.runtime.SerializerBase.serializeSequenceWrapper(SerializerBase.java:80)
         at oracle.j2ee.ws.client.jaxws.SoapRequestorSerializer.populateSoapMessage(SoapRequestorSerializer.java:89)
         at oracle.j2ee.ws.client.jaxws.WsClientProxyInvocationHandler.invoke(WsClientProxyInvocationHandler.java:184)
         at $Proxy11.returnEmployee(Unknown Source)
         at MyAsyncWebService1SoapHttpPortClient.main(MyAsyncWebService1SoapHttpPortClient.java:22)
    Process exited with exit code 1.Can anyone throw some light on this?
    Thanks,
    Pedja

  • Using XSLT "adapter" for invoking a WS with SOAP-ENC array type param.

    Hello,
    I had to write a BPEL process that calls inside it a web service which has as an input an array parameter and as an output, also an array. I already know that BPEL has limitations regarding using the SOAP-ENC Array type. I tried to rewrite the web service in order to use a literal encoding of the array parameters (using "maxOccurs" attribute), but unfortunately, the OC4J container 9.0.4 that I have to use doesn't allow this. It only allows the SOAP-ENC types for array types.
    I started to write, inside the BPEL process, some "adapters" XSLT transformations before and after the invoking of the web service that uses SOAP-ENC array. The XSLT transformation before the web service invoking will translate the input array parameter defined with no SOAP encoding types (based on "maxOccurs" attribute) into a SOAP-ENC type, as it is expected by the web service. The XSLT transformation after the web service invoking will translate the returned array SOAP-ENC type into a data type defined with no SOAP encoding types (based on "maxOccurs" attribute).
    The approach is pretty hairy, from the XSLT point of view and it introduces a supplementary delay due to the XSLT processing needed, but it works. The only think is that when I build the service, I obtain the following error message:
    [bpelc] [Error] GCDBWebservice?WSDL:30:42: src-resolve.4.2: Error resolving component 'SOAP-ENC:Array'. It was detected that 'SOAP-ENC:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema ...
    But in spite of this, the process is built and deployed successfully and I was able to run it from the BPEL console.
    Do you think that this approach could hide some other future problems that I can't see in this moment?
    Thanks,
    Marinel

    Please help me for this.
    I am new to Webservices and SOAP.
    I am facing problem when i am calling a "add" method in the .net webservices with the following code but it gives correct result when i'm calling the "HelloWorld" method present in the webservice.
    I think it will happening because, when i'm going to pass any parameter to the "add method , it does not process it.It will return me 0.
    Please help me in this.
    The code is:
    import java.io.*;
    import java.util.*;
    import java.net.*;
    import org.w3c.dom.*;
    import org.apache.soap.util.xml.*;
    import org.apache.soap.*;
    import org.apache.soap.encoding.*;
    import org.apache.soap.encoding.soapenc.*;
    import org.apache.soap.encoding.literalxml.*;
    import org.apache.soap.rpc.*;
    import org.apache.soap.transport.http.SOAPHTTPConnection;
    import org.apache.soap.transport.*;
    import org.apache.soap.messaging.*;
    import org.apache.xerces.parsers.*;
    import org.apache.xerces.dom.DocumentImpl;
    public class testClient {
    public static void main(String[] args) throws Exception {
    URL url = new URL ("http://Eurotele-it3/webService1/Service1.asmx");
    //Map the Types.
    SOAPMappingRegistry smr = new SOAPMappingRegistry ();
    StringDeserializer sd = new StringDeserializer ();
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,new QName("http://Eurotele-it3/WebService1/Service1","addResult"),Integer.class,null,sd);
    // create the transport and set parameters
    SOAPHTTPConnection st = new SOAPHTTPConnection();
    // build the call.
    Call call = new Call();
    call.setSOAPTransport(st);
    call.setSOAPMappingRegistry(smr);
    call.setTargetObjectURI ("http://Eurotele-it3/WebService1/Service1/add");
    call.setMethodName("add");
    //call.setEncodingStyleURI("http://schemas.xmlsoap.org/soap/encoding/");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    Vector params = new Vector();
    params.addElement(new Parameter("x",Integer.class,"10",null));
    params.addElement(new Parameter("y",Integer.class,"20",null));
    call.setParams(params);
    Response resp = null;
    try {
    resp = call.invoke (url,"http://Eurotele-it3/WebService1/Service1/add");
    catch (SOAPException e) {
    System.err.println("Caught SOAPException (" + e.getFaultCode () + "): " +e.getMessage ());
    return;
    // check response
    if (resp != null && !resp.generatedFault()) {
    Parameter ret =resp.getReturnValue();
    Object value =ret.getValue();
    System.out.println ("Answer--> " +value );
    else {
    Fault fault = resp.getFault ();
    System.err.println ("Generated fault: ");
    System.out.println (" Fault Code = " + fault.getFaultCode());
    System.out.println (" Fault String = " + fault.getFaultString());
    This is the complete WSDL format:
    <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://Eurotele-it3/WebService1/Service1" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://Eurotele-it3/WebService1/Service1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    - <wsdl:types>
    - <s:schema elementFormDefault="qualified" targetNamespace="http://Eurotele-it3/WebService1/Service1">
    - <s:element name="HelloWorld">
    <s:complexType />
    </s:element>
    - <s:element name="HelloWorldResponse">
    - <s:complexType>
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="HelloWorldResult" type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    - <s:element name="add">
    - <s:complexType>
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="x" type="s:int" />
    <s:element minOccurs="1" maxOccurs="1" name="y" type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    - <s:element name="addResponse">
    - <s:complexType>
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="addResult" type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:schema>
    </wsdl:types>
    - <wsdl:message name="HelloWorldSoapIn">
    <wsdl:part name="parameters" element="tns:HelloWorld" />
    </wsdl:message>
    - <wsdl:message name="HelloWorldSoapOut">
    <wsdl:part name="parameters" element="tns:HelloWorldResponse" />
    </wsdl:message>
    - <wsdl:message name="addSoapIn">
    <wsdl:part name="parameters" element="tns:add" />
    </wsdl:message>
    - <wsdl:message name="addSoapOut">
    <wsdl:part name="parameters" element="tns:addResponse" />
    </wsdl:message>
    - <wsdl:portType name="Service1Soap">
    - <wsdl:operation name="HelloWorld">
    <wsdl:input message="tns:HelloWorldSoapIn" />
    <wsdl:output message="tns:HelloWorldSoapOut" />
    </wsdl:operation>
    - <wsdl:operation name="add">
    <wsdl:input message="tns:addSoapIn" />
    <wsdl:output message="tns:addSoapOut" />
    </wsdl:operation>
    </wsdl:portType>
    - <wsdl:binding name="Service1Soap" type="tns:Service1Soap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <wsdl:operation name="HelloWorld">
    <soap:operation soapAction="http://Eurotele-it3/WebService1/Service1/HelloWorld" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="add">
    <soap:operation soapAction="http://Eurotele-it3/WebService1/Service1/add" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:service name="Service1">
    <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
    - <wsdl:port name="Service1Soap" binding="tns:Service1Soap">
    <soap:address location="http://eurotele-it3/webService1/Service1.asmx" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

  • How i can get a array in the current page?

    Can i send a array parameters from previous page to current page?
    the coding like below:
    // the coding in the previous page
    String[] strSend = {"a", "b", "c"};
    HashMap map = new HashMap(2);
    map.put("array", strSend);
    pageContext.setForwardURL(
    "OA.jsp?OAFunc=XXFMSRHISQF",
    null,
    KEEP_MENU_CONTEXT,
    null,
    map,
    true,
    ADD_BREAD_CRUMB_NO,
    IGNORE_MESSAGES );
    //the coding in the processRequest of the current pageCO.
    String strParam = pageContext.getParameter("array");
    the problem is that the type of "strParam" is a String.
    it's not a array of String. So it is not the parameter what i need.
    can u tell me how to get the array parameter from previous page. thanks.

    This cannot be achieved directly while using the setForwardURL method, all values that are there in the Hashmap will be appended when the redirection is done, so you cannot get the values that are there in the array object directly.
    Workaround that I can think of, put all the array values in a String object, appended by a delimiter, in the second page, after you do a getParameter(String), recover the values using a StringTokenizer and the delimiter that you used while appending the string values and store the values in a Array.
    Thanks
    Tapash

  • JDev 9.0.3 can't generate stored procedure wrapper for ARRAY java type

    Hi,
    I have a java stored procedure which looks like this:
    public static void CurveFit(ARRAY in_x_y, ARRAY[] in_out_param) {
    I had no problem to generate a PL/SQL wrapper using JDev 3.2 mapping the ARRAY parameters to user-defined Oracle types. Here is the code JDev 3.2 generated:
    PROCEDURE curvefit(in_x_y IN fit_data, in_out_param IN OUT fit_params) AS
    LANGUAGE JAVA
    NAME 'CurveFitWrapper.CurveFit(oracle.sql.ARRAY, oracle.sql.ARRAY[])';
    Now I use JDev 9.0.3, but it refuses to add my function to the deployment profile. "Why not?" gives the following explanation: "Parameter #1 is of type oracle.sql.ARRAY which doesn't map to any PL/SQL data type". That's wrong! If I create the wrapper myself it works just fine.
    How to get around this situation? I don't want to go back to JDev 3.2...
    Regards,
    Plamen

    I have tried a disconnect/reconnect from within Jdev without success. First, I have to choose "disconnect" twice from the file->source control menu. (The first time I click it does nothing). Then during reconnect I choose my SCM connection, then I choose my workarea and get a pop up that says, "Failed to set my_workarea as the active workarea". I click "OK". Choose my workarea again and get another popup that is blank. Then I click "OK". Now I see a list of SCM connections. I keep getting the blank popup until I hit cancel. Now the overlay icons appear and it seems that I am in fact connected. But I still get the checkin/checkout exceptions. So I have to restart Jdev to get back to normal.
    I also tried executing the sql in the exception from SQL*Plus and it works perfectly.

Maybe you are looking for

  • Straight talk MMS will not work on iPhone 5 purchased from Apple

    Just purchased an iPhone 5 from Apple and activated on Straight Talk. Used the BYOD ( bring your own device ) option and purchased a SIM from ST. Everything works fine except my MMS. I even went and purchased a nano SIM from Tmobile. I have tried eve

  • Do the MacBook Pros have a different battery than PowerBooks?

    I have a 17" PowerBook G4. Bought a 2nd battery for it a few months ago to get more battery life and have a spare for flights. Just ordered a new MacBook Pro and will sell my PowerBook afterwards. I'm assuming I cannot use the new battery from the Po

  • Export DV to H.264 via 'Apple TV'

    I exported a DV (not HDV) movie from FCP X for use on my iPod. It converted a 720*576 movie to 768*576. Why? We all like slim people, but I'd like my aspect ratio to remain intact. Is there a better way of compressing a DV movie?

  • How to configure Share Button in Mountain Lion?

    I have just updated my MBP to Mountain Lion. Going to give Safari a bash as I liked the look of some of the new features, for one the Share Button. However, when I try to share something by email it opens Chrome and shares it using a Gmail account I

  • In Design won't export PDF

    Help, two of us in the office attempt to export PDF to the desktop and get a "Failed to Export the PDF file" error. Also tried saving into the file folder and it failed as well.