Web Services with Complex Objects (Urgent !!)

Hi,
My last post was on a problem using IBM-RAD (Service) and AXIS2 (Client) in "New to Java" Forum. That is one of the trial scenarios I'm working on nowadays. Hope, I'll get some useful reply soon.
Now, I need a suggestion about the application I'm working upon. It is as follows:
(i) The application (i.e. Service Class) takes some primitive,String and/or some bean object as input
(ii) It returns a bean object [or an array (can use collection class also if possible) of bean objects].
(iii) The bean properties are primitive,String , other bean objects, and/or some collection object(Vector / ArrayList etc.) i.e. it should handle complex objects.
(iv) The Service should run on Websphere and Client on Tomcat.
A pictorial representation is given below:
[primitive/String/bean object (Input arg)]
[(Contains  primitive/String/other bean objects/collection class)] Bean <---------> Service <----------------------- Client
[Calls bean] |===============> Client
[Returns bean (or array of beans / collection object)]
I'm now trying (by building test applications) a combination of IBM-RAD (Service) and AXIS2 (Client), but facing problems in handling array of beans and/or collection classes either on Service or on the Client side.
So, I need some suggestions on whether I'm going the right way, or need to change my approach (or technology). Any suggestion would be appreciated.
Please reply ASAP, it is urgent.
Thanks in advance,
Suman

no problem for me, so it's not urgent.
Request for help denied.

Similar Messages

  • How to create web services with complex objects as parameters

    Hi,
    Not sure if this is the right place, but...
    I'm using Netbeans 5.5 and trying to learn web services.
    Creating a simple web service with simple parameters like strings and integers is nice and easy. I'm now trying to take the next step, and create a web service with a more complex schema as a parameter.
    I've tried two approaches, and hit dead ends on both:
    (1) Define my complex schema as an xsd file, and then create a WSDL file. Creating the schema and saving it in my EFB project works fine; when I try to create a new WSDL file, the IDE gives me a button to import external schemas - which is where the problem is: the Browse simply won't find my newly created schema file.
    (2) Define a Java class (in this case, it's a fairly simple example containing a single ArrayList), and then use the IDE to generate a web service from Java. The IDE does this fine, but I now have no idea how to consume or test the web service - I don't know where to look for the WSDL that has presumably been generated, and I'm also a bit iffy over what answers to give the WSDL creator about port names etc.
    Ideally, I'd prefer to get approach 1 to work - can someone point me in the direction of a sensible tutorial for these things?
    (Happy to carry on using Netbeans 5.5 or to revert to Sun Studio Enterprise, which I was playing with before.)
    All help appreciated, Thanks

    - For NetBeans related questions, nbusers mailing list is more suited. It is often visited by NetBeans experts.
    http://www.netbeans.org/community/lists/top.html
    ...[email protected]
    The NetBeans users mailing list. General discussion of NetBeans use, this is the place to ask for help and to help others.... (There is a 'Subscribe' button next to the above that you can use to subscribe to the list).
    Can you try posting this question on nbusers list?
    - SJSE 8.1 is based on an older version of NB (NB5.0).
    You should definitely continue with NetBeans, since all development is now being done in NetBeans; all the major JSE modules have been moved to opensource at netbeans.org and are all being developed there. There are as yet no future plans to work on further releases for JSE.
    Please check out http://www.netbeans.org for more details.

  • Web service with complex java type

    Hi,
    I create a web service method with String o with Array of Strings without problem. Now I nedd to create a ws that return a table, so I create a class like this:
    public class User {
         private String Name;
         private String.Surname;
         public void setName(String setName){
              Name= setName;
         public void setSurname(String setSurname){
              Surname=setSurname;
    In my ws class I use this object:
    public User[] getUser(String a){
              User[] user = new User[10];
              for (int i=0;i<10;i++){
                   User<i>.setName("aaa");
                   User<i>.setSurname("bbb");
              return user;
    When in WebService Perspective I try to create my ws in wizard mode I see method getUser but I can't check it
    Where is error?
    Thanks
    Andrea

    HI Andrea,
        I think with present netweaver developer studio , we can create Web services with end points as simple data types in java and the array of that simple data types.
        not sure whether it support our own custom developed classes as end points.
         just go through these links.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
    from this we will get Restrictions for WS Endpoints.
                             Regards
                              Kishor Gopinathan

  • Web Service with Complex Results and Flex

    I have created a Enterprise Java Bean that has one "test" method that returns a String[]. I have compiled, deployed and registered this bean in Sun's Application Server 8.1. I am using NetBeans 5.0 to develop this project.
    I try to load this web service into Flex and I get a fault thrown: TypeError: Error #1034: Type Coercion failed: cannot convert []@29e5d06 to XMLList. I have set the returnType in Flex as "e4X.". Do I need to do this in my webservice.
    Any help would be appreciated.

    HI Andrea,
        I think with present netweaver developer studio , we can create Web services with end points as simple data types in java and the array of that simple data types.
        not sure whether it support our own custom developed classes as end points.
         just go through these links.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
    from this we will get Restrictions for WS Endpoints.
                             Regards
                              Kishor Gopinathan

  • Web Services with Complex Data Types in ADF 11g

    Shay Shmeltzer's following blogpost can answer my questions but all the links there
    http://blogs.oracle.com/shay/2009/09/web_services_with_complex_data.html
    Can you please point us to the correct links for the following documents?
    http://www.oracle.com/technology/tech/fmw4apps/agile/pdf/adf11g-agile.pdf
    http://www.oracle.com/technology/products/jdev/tips/fnimphius/wsdccomplexinputtype/index.html

    Thanks. We are using a Java Proxy to consume the web service as we need to use JAX-WS handlers. We created data control from the service stub that was created by the proxy. Our issue is with the response XML which comes as a complex type. Also, the data control is understanding the complex type and is creating the structure right. The problem is when we drag that control on a JSF page. No data is displayed. We think that we are not traversing the complex object properly which is creating the issue.
    I understand that you answer related to the input is applicable to output as well. We can change the structure by flattening it but we thought that in 11G there is some new features where we can use the complex types out of the box without any change. Is that true? Also, any luck in finding the documents (broken links) on your blog page?

  • Web Services with complext objects as method parameters

    Can anyone point me to an example of web services that accept complex objects as parameters, using annotations?
    Appreciate it.

    - For NetBeans related questions, nbusers mailing list is more suited. It is often visited by NetBeans experts.
    http://www.netbeans.org/community/lists/top.html
    ...[email protected]
    The NetBeans users mailing list. General discussion of NetBeans use, this is the place to ask for help and to help others.... (There is a 'Subscribe' button next to the above that you can use to subscribe to the list).
    Can you try posting this question on nbusers list?
    - SJSE 8.1 is based on an older version of NB (NB5.0).
    You should definitely continue with NetBeans, since all development is now being done in NetBeans; all the major JSE modules have been moved to opensource at netbeans.org and are all being developed there. There are as yet no future plans to work on further releases for JSE.
    Please check out http://www.netbeans.org for more details.

  • EJB3 Creating Web Services with Complex Return Types

    Hi
    Not sure if this is the right place, but hoping someone can help!
    I have an entity bean that has a collection (list<Address>) of sub-entities. I have then created a session bean to retrieve the Business and populate it's children.
    I then expose this as a web service and although it works and I get appropriate XML out, the WSDL of the deployed service is not as I would like.
    For example:
    The return type is
    <complextype name="Business">
    <sequence>
    <element name="id" type="int"/>
    <element name="addresses" type="ns1:list"/>
    </sequence>
    </complextype>
    <complextype name="Address">
    <sequence>
    <element name="id" type="int"/>
    <element name="addresses1" type="string"/>
    <element name="addresses2" type="string"/>
    <element name="addresses3" type="string"/>
    </sequence>
    </complextype>
    ns1:list is included as a separate schema as a complex extension of the base "collection"
    So, even though the Address type is there it is not referenced from Business.
    So, when I'm calling the Web Service from BPEL or ESB, I have not got the ability to map adequately back from the response.
    I have tried a whole bunch of ways of getting this to work, but so far to no avail...
    Has anyone seen this before, or can I somehow override the mapping from the Entity to the WSDL?
    Any help would be most appreciated.
    Thanks
    Chris

    Thanks. We are using a Java Proxy to consume the web service as we need to use JAX-WS handlers. We created data control from the service stub that was created by the proxy. Our issue is with the response XML which comes as a complex type. Also, the data control is understanding the complex type and is creating the structure right. The problem is when we drag that control on a JSF page. No data is displayed. We think that we are not traversing the complex object properly which is creating the issue.
    I understand that you answer related to the input is applicable to output as well. We can change the structure by flattening it but we thought that in 11G there is some new features where we can use the complex types out of the box without any change. Is that true? Also, any luck in finding the documents (broken links) on your blog page?

  • Accessing a web service with complex types

    Hi I have been struggling with this web service for a while
    now....
    I am trying to send input parameters that are composed by :
    applicant name( name, surname, .....) and applicant input address(
    hse no, street, postcode...) Applicant dob(dob)....I am using
    <cfscript> tag to pass these parameters...Now my problem is
    do i need to put each complex type inside its own <cfscript>
    tag???
    ie:
    stName = structNew();
    stName.Title = "#Mr#";
    stName.forename = "Man";
    stName.othernames = " NA";
    stName.Applicant = "Yellow";
    stName.suffix="";
    stName.dob = createDate(1972,06,05);
    and do this for applicant address? or could i enclose this in
    under the same cfscript tag??
    Any help would be appreciated...thanks
    critical

    Check out
    http://hcc.musc.edu/research/shared_resources/xml_complex_types_to_cf_structure_notes.cfm
    The last part of that link is .cfm - not sure why its getting
    cut off.

  • Consuming Java Web Service with complex return types

    Hi,
    I'm consuming a Java Web Service and the return I get in
    ColdFusion is a typed Java Object (with custom Java classes like
    com.company.project.JavaClass ...)
    Within this object I don't get direct accessible properties
    as when I'm consuming ColdFusion Web Services, instead I get a
    getPROPERTYNAME and setPROPERTYNAME method for each property.
    How can I handle this? I don't want to call this methods for
    each property (and there are nested objects with arrays of custom
    classes below, which would really make this complicated).
    What's the best way to cope up with this?
    Thanks a lot,
    Fritz

    The web service is actually the function, not the cfc and you
    didn't show a function.
    My own opinion is that since webservices by definition should
    be available to any calling app (cold fusion, .net, flash, etc),
    whatever gets returned from the method should be as universally
    recognizable as possible. This generally means text, numbers,
    boolean, or xml.

  • Pl Help......Web services with complex types

    Hi,
    I have deployed a web service on OC4J (9.02) having a complex type input and a complex type return. The web service is implemented as a stateless session bean and
    the relevant web.xml for the deployment is:
    <servlet>
    <servlet-name>ZipLookupManager</servlet-name>
    <servlet-class>oracle.j2ee.ws.SessionBeanWebService</servlet-class>
    <init-param>
    <param-name>jndi-name</param-name>
    <param-value>ZipLookupManagerBean</param-value>
    </init-param>
    <init-param>
    <param-name>class-name</param-name>
    <param-value>com.indus.banner.components.cdyne.ZipLookupManagerBean</param-va
    lue>
    </init-param>
    <init-param>
    <param-name>interface-name</param-name>
    <param-value>com.indus.banner.components.cdyne.IZipLookupManager</param-value
    >
    </init-param>
    <init-param>
    <param-name>custom-bean-qname</param-name>
    <param-value>
    com.indus.banner.components.cdyne.LatLongReturn,
    http://cdyne.components.banner.indus.com,
    LatLongReturn,
    org.apache.soap.encoding.soapenc.BeanSerializer,
    org.apache.soap.encoding.soapenc.BeanSerializer
    </param-value>
    </init-param>
    <init-param>
    <param-name>custom-bean-qname</param-name>
    <param-value>
    com.indus.banner.components.cdyne.ZipState,
    http://cdyne.components.banner.indus.com,
    ZipState,
    org.apache.soap.encoding.soapenc.BeanSerializer,
    org.apache.soap.encoding.soapenc.BeanSerializer
    </param-value>
    </init-param>
    </servlet>
    The web service deploys correct. I have all the relevant jars in the %J2EE_HOME%\lib folder. However, when I call the web service from a standalone client I get the following error:
    java.lang.ClassNotFoundException:
    org.apache.soap.encoding.soapenc.BeanSerializer
    at
    oracle.j2ee.ws.GeneratedClassLoader.findClass(GeneratedClassLoader.ja
    va:48)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
    at oracle.j2ee.ws.BaseWebService.initQnameMap(BaseWebService.java:602)
    at oracle.j2ee.ws.RpcWebService.init(RpcWebService.java:453)
    at
    oracle.j2ee.ws.SessionBeanRpcWebService.init(SessionBeanRpcWebService
    .java:54)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at
    com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.
    java:1956)
    at
    com.evermind.server.http.HttpApplication.findServlet(HttpApplication.
    java:4355)
    at
    com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApp
    lication.java:2484)
    Please advise!
    Rizwan

    Hi all,
    I haven't heard back from anyone. Is this forum alive still? I have entered a TAR on metalink on this issue but they say that apparently this was a defect under 9.02 and has been fixed under 9.04.
    Please help.
    Many thanks in advance.
    Rizwan

  • Publish ColdFusion Web Service with Complex Return Type

    Hi,
    I am working on a project to publish couple ColdFusion
    webservices. The cosumer of those webservices is a Java
    application.
    One of my webservice need return an object. Here are demo
    codes:
    The returned ojbect is AddressRespond
    AddressRespond.cfc:
    <cfcomponent>
    <cfproperty name="addresses" type="Address[]" />
    <cfproperty name="myLearnException" type="MyException"
    />
    </cfcomponent>
    Address.cfc:
    <cfcomponent>
    <cfproperty name="city" type="string" />
    <cfproperty name="state" type="string" />
    </cfcomponent>
    MyException.cfc:
    <cfcomponent>
    <cfproperty name="code" type="string" />
    <cfproperty name="reason" type="string" />
    </cfcomponent>
    If the webservice "cosumer" is a ColdFusion application,
    there is no any problems. But the Java application doesn't
    understand the type of addresses in the WSDL file which is
    gernerated by ColdFusion:
    <complexType name="Address">
    <sequence>
    <element name="city" nillable="true"
    type="xsd:string"/>
    <element name="state" nillable="true"
    type="xsd:string"/>
    </sequence>
    </complexType>
    <complexType name="MyException">
    <sequence>
    <element name="code" nillable="true"
    type="xsd:string"/>
    <element name="reason" nillable="true"
    type="xsd:string"/>
    </sequence>
    </complexType>
    <complexType name="AddressRespond">
    <sequence>
    <element name="addresses" nillable="true"
    type="tns1:ArrayOf_xsd_anyType"/>
    <element name="MyException" nillable="true"
    type="impl:MyException"/>
    </sequence>
    </complexType>
    Could anybody give me any idea on how to resolve this
    problem?
    Thanks!

    The web service is actually the function, not the cfc and you
    didn't show a function.
    My own opinion is that since webservices by definition should
    be available to any calling app (cold fusion, .net, flash, etc),
    whatever gets returned from the method should be as universally
    recognizable as possible. This generally means text, numbers,
    boolean, or xml.

  • Apex, Web Services, and complex data types?

    Hi all,
    I was wondering if somebody could explain to me what sort of support apex has for using web services with complex data types, and how data returned like this could be interpreted and stored in the database.
    Any help would be aprreciated.
    Thankyou in advance

    Hi can anyone help me with this?

  • Weblogic - a web service with java.lang.Object parameter

    hi all,
    i'm creating a web service with a java.lang.Object parameter.
    my question is as follows:
    when a client calls the web service, how to i get the soap message object and convert it to soap message string using the parameter?
    thanks,
    alex

    Here's some code from one of the Axis samples, this shows the basic process of making a call:
    package samples.message;
    import org.apache.axis.client.Service;
    import org.apache.axis.client.Call;
    import org.apache.axis.message.SOAPBodyElement;
    import org.apache.axis.utils.Options;
    import org.apache.axis.utils.XMLUtils;
    import org.w3c.dom.Element;
    import java.net.URL;
    import java.util.Vector;
    public class TestMsg {
    public String doit(String[] args) throws Exception {
    Options opts = new Options(args);
    opts.setDefaultURL("http://localhost:8080/axis/services/MessageService");
    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress( new URL(opts.getURL()) );
    SOAPBodyElement[] input = new SOAPBodyElement[2];
    input[0] = new SOAPBodyElement(XMLUtils.StringToElement("urn:foo",
    "e1", "Hello"));
    input[1] = new SOAPBodyElement(XMLUtils.StringToElement("urn:foo",
    "e1", "World"));
    Vector elems = (Vector) call.invoke( input );
    SOAPBodyElement elem = null ;
    Element e = null ;
    elem = (SOAPBodyElement) elems.get(0);
    e = elem.getAsDOM();
    String str = "Res elem[0]=" + XMLUtils.ElementToString(e);
    elem = (SOAPBodyElement) elems.get(1);
    e = elem.getAsDOM();
    str = str + "Res elem[1]=" + XMLUtils.ElementToString(e);
    return( str );
    public static void main(String[] args) throws Exception {
    String res = (new TestMsg()).doit(args);
    System.out.println(res);

  • XDB Native Web Services - Collection of object types

    Hello,
    my DB 11g (11.1.0.6.0) is enabled to use XDB Native Web Services, everything works as it should. I already use it successfully to publish a web service with object types as OUT parameter. They are created as complex types in the XML response as described here: [http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_web_services.htm#CHDGBFID]
    But what I need is a collection of these object types, e.g.
    I have a type FLIGHT with some information elements (departure, arrival, date, time, price) and I have a web service function GET_AVAILABILITY with parameters departure, arrival and date. What I want is to return a collection of FLIGHT objects, it could be none, one or many flights for a request.
    For the moment I create another object type which contains a fix number of FLIGHT objects to work around the collection issue:
    create flight_tab_typ as object (
    fl1 flight_typ
    ,fl2 flight_typ
    ,fl3 flight_typ
    I tried to build a PL/SQL table of object type and also a VARRAY of object type but for both the WSDL of the web service cannot be build up correctly in the web browser. For me it seems that this is not supported by the Native Web Services.
    I know I can build up my own XMLTYPE with XML structure as OUT parameter but to use object types is much easier and it builds up the XML structure automatically.
    Does anybody know how to use collections (VARRAY or PL/SQL Tables) with the Native XML DB Web Services?
    Thanks,
    Andreas

    Hi flea,
    I use complex types with XDB native webservices. Here is an example. Using people/groups objects. I haven't compiled this so there may be some typos etc, but it should give you the idea.
    Beware!I have had problems with the created WSDL file in that it doesn't always include the namespace from all types. In many client packages ( JDevloper , SOAPUI etc) this causes a wsdl import failure.
    You can add the missing namespace by hand a load the WSDL file locally and then it should work. I haven't raised an SR with Oracle about this yet.
    Assume you create the following under SCoTT schema on machine host.com on port 8080.
    The webservice[WSDL] will be available from
    http://host.com:8080/orawsv/SCOTT/WEBSERVCIES/GET_GROUP[?wsdl]
    For other peoples sanity it took me a little while to realise the WSDL url is case specific. E.g. the schema, package and functions have to be UPPER case.
    create table people_groups_tab (group_name varchar2(40 char),first_name varchar2(40 char),last_name varchar2(40 char))
    insert into people_groups_tab values ('FINANCE','Joe','Bloggs')
    insert into people_groups_tab values ('FINANCE','Bob','Jones')
    insert into people_groups_tab values ('IT','Alan','Andrews')
    create or replace type person_obj
    as object
         first_name people_groups_tab.first_name%type
         ,last_name people_groups_tab.last_name%type
    create or replace type people_obj
    as table of person_obj
    create or replace type people_groups_obj
    as object
    group_name varchar2(40 char)
    people people_obj
    create or replace package webservices
    as
              function get_group
         p_group_name varchar2
              ) return people_groups_obj;
    end;
    create or replace package body webservices
    as
              function get_group
         p_group_name varchar2
              ) return people_groups_obj
    as
    l_group people_groups_obj;
              l_people people_obj;
    begin
              select person_obj
                        first_name
                        ,last_name
              bulk collect into l_people
              from people_groups_tab
              where group_name p_group_name;
              l_group := people_groups_obj(p_group_name,l_people);
              return l_group;
    end;
    end;
    /

  • Call ABAP Web Service with Java code only

    Hi all,
    First of all, I am writing script in Adobe form but am not using the one in SAP.
    I am trying to call the web service and process the result with script open (i.e. no dataconnection created), because I am trying to do that in a dialog.
    I can call a non-SAP web service without problem, but I am not able to call a simple web service with only a single string input, anyone have any example?
    Here is the SOAP for input:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:rfc:functions">
       <soapenv:Header/>
       <soapenv:Body>
          <urn:Z_RFC_GET_STAFF_BANK_INFO>
             <A_STAFF_ID>0123456</A_STAFF_ID>
          </urn:Z_RFC_GET_STAFF_BANK_INFO>
       </soapenv:Body>
    </soapenv:Envelope>
    Here is my code to call:
         var cURL = "http://some-host-name:port/sap/bc/srt/wsdl/bndg_DEDB492BB032E7F1B09F001CC4FBCEC9/wsdl11/allinone/ws_policy/document?sap-client=300";
         var response = SOAP.request(
              cURL: cURL,
              oRequest: {
                   "urn:sap-com:document:sap:rfc:functions:Z_RFC_GET_STAFF_BANK_INFO": {
                        A_STAFF_ID: "0123456"
    Regards
    Bill

    Hello I have the same problem, were you able to execute the WS through the JS code now?
    I would like to call an ABAP WS using JavaScript to return complex structures that I would like to manage directly with JS.
    I tried with this code and I get the error "RaiseError: Acrobat Raise." when the request is executed:
    var WSUrl = "http://<server>:<port>/sap/bc/srt/wsdl/bndg_4D15C75529330AF1E10000000A150429/wsdl11/allinone/ws_policy/document?sap-client=500";
    var VendorNumber = xfa.form.DATA.DATAFLOW.SF_HEADER.VENDOR_NUMBER.rawValue;
    try {
    // Create request structure, read Input out of text field
    var request = {
              "urn:sap-com:document:sap:soap:functions:mc-style:ZWsTest" : {ILifnr: VendorNumber}
    SOAP.wireDump = true;
    // Call web service using SOAP object
    var response = SOAP.request ({
            cURL: WSUrl,
            oRequest: request
    //        cAction: "urn:sap-com:document:sap:soap:functions:mc-style"
    } catch (e) {
        xfa.host.messageBox(e.toString()); //pop-up "TypeError:service.CelsiusToFahrenheit is not a funciton"
    with this other code I get the error "SOAPError: CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'ILifnr'":
    try {
        var myProxy = SOAP.connect(WSUrl);
        var result = myProxy.ZWsTest( { ILifnr: VendorNumber } );
        xfa.form.DATA.DATAFLOW.SF_HEADER.E_DESCRIPTION.rawValue = result;
    // Display the response in the console:
       console.println("Result is " + result);
    } catch (e) {
        xfa.host.messageBox(e.toString()); //pop-up "TypeError:service.CelsiusToFahrenheit is not a funciton"
    in the second option, if I make the field ILifnr optional the call is succesfully performed but the parameter is not passed to the WS. So the call is working.
    Using stand-alone LiveCycle designer 8.1 and Adobe Reader 8
    Any suggestions?
    Many thanks,
    G.
    Edited by: Guillem Mateu Navalón on Jan 13, 2011 1:13 PM

Maybe you are looking for