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

Similar Messages

  • 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.

  • 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?

  • 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?

  • 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?

  • 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 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

  • Invoking a AXIS Web Service with a Java object as input argument

    Hi
    I've been trying to execute a bpel process that invokes a web service deployed through axis.
    This web service takes a java object as input argument as opposed to data types that are directly mapped to java types through the SOAP engine.
    I deployed and tested the service outside of BPEL using a test client class. Everything works well.
    When I try to configure the "Assign" and "Invoke" activities so that service can be invoked, I cannot see the data structure through the variable picker and I see the following message:
    "The element {urn:ComplexTypeWebService}TimeSheetBean is not know to the schema container. Perhaps a schema file that uses it needs to include or import its definition.There mat also be an XML schema issue (non resolvable schema) which prevents {urn:ComplexTypeWebService}TimeSheetBean from being seen by the schema processor."
    Is there any example that demonstrates how to invoke an axis web service in such scenario? What am I doing wrong?
    Please, let me know.

    The passing of Java objects in and out of a web service is NOT supported. variables must be xml documents defined by a XML schema. In my opinion, missing Java object and WSDL is not a good idea. -Edwin

  • Consuming web services with a java application

    Hello,
    I want to consume an ABAP generated web service with a stand-alone Java application. I am very new to this topic and need some hints how this functionality could be achieved.
    How is the web service accessed by the Java application? What about security issues?
    Thank you in advance for your replies! They will be appreciated.
    Kindest regards

    Hi
    See this Help and Examples
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e2/36a53dc1204c64e10000000a114084/frameset.htm
    Kind Regards
    Mukesh

  • 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

  • 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 a web service with a java client

    hello
    wanted to consume the following web service:
    http://www.dataaccess.com/webservicesserver/numberconversion.wso
    http://www.dataaccess.com/webservicesserver/numberconversion.wso?op=NumberToWords
    so i used WSDL2Java to create client stubs n then followed it with a client program
    public class XmethodsAccessor {
    public static void main(String[] args) throws Exception{
    org.apache.axis2.databinding.types.UnsignedLong x = new org.apache.axis2.databinding.types.UnsignedLong(10000L);
    NumberConversionStub stub = new NumberConversionStub();
    NumberConversionStub.NumberToWords request = new NumberConversionStub.NumberToWords();
    request.setUbiNum(x);
    NumberToWordsResponse response = stub.NumberToWords(request);
    System.out.println("answer is : " + response.getNumberToWordsResult());
    Upon running the program i get error
    Exception in thread "main" org.apache.axis2.AxisFault: Connection reset
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:221)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:452)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
    at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
    at com.dataaccess.www.webservicesserver.NumberConversionStub.NumberToWords(NumberConversionStub.java:162)
    at com.dataaccess.www.webservicesserver.XmethodsAccessor.main(XmethodsAccessor.java:19)
    Caused by: org.apache.axis2.AxisFault: Connection reset
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:314)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:201)
    ... 5 more
    Caused by: org.apache.axis2.AxisFault: Connection reset
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
    at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:305)
    ... 6 more
    Caused by: java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:168)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
    at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77)
    at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)
    at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1115)
    at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832)
    at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
    at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
    at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
    ... 8 more
    Can any one please tell me what im doin wrong and why is it not working.
    Thanks
    PS: am using Eclipse 3.2/Axis2 Eclipse plugin .. there were no compilation errors

    Hi steve_224,
    Would be extremely grateful if you could post the answer when you get a chance, have this problem too and haven't managed to resolve it yet...
    Thanks in advance...
    Kind regards,
    DJ

  • How to call Web Services with Sun Java Studio Creator?

    Can someone from Sun please explain how to use the sample Web Services USWeather and GoogleSearch in Sun Java Studio Creator (no Portlet Application)?
    I read the Web Service Tutorial Accessing Web Services (http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/webservices.html) and this blog entry: http://blogs.sun.com/roller/page/winston?entry=code_google_search_in_no .
    But the proposed solutions do not work with the services USWeather and GoogleSearch.
    Thank you.

    Thank you for your answer, dongmei.
    It seems that the MethodResultTableDataProvider does not return the response of the web service as a value field if the WSDL contains only one result element.
    E.g. from WSDL of the USWeather Web Service which returns theGetWeatherReportResult string:
    <?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://www.webserviceX.NET" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www.webserviceX.NET" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET">
          <s:element name="GetWeatherReport">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="GetWeatherReportResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="GetWeatherReportResult" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="string" nillable="true" type="s:string" />
        </s:schema>If I drag the web service method on the page and I should be able to select the response value in the Bind to Data dialog box. But there is no value field. Value fields only occur if the web service returns more than one value.
    The question is how can I get the response GetWeatherReportResult from the service.

  • 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.

Maybe you are looking for

  • How to find out where an alias is defined

    How can I find out where an alias is defined on my system? I am referring to the kind of alias that is used within a Terminal session launched from Mac OS X (10.6.3). For example, if I enter the alias command with no parameters at a Terminal command

  • XSLT transformation in BPEL

    Hi all How come most of the BPEL XPath expressions can't be used in a stylesheet, with a PerformXSLT()? It would be nice if you could read preference values from bpel.xml within a stylesheet. Also, the xslt mapper in JDeveloper is a bit limited, many

  • CS6 Applescript open in Camera Raw

    I'd like some advice on the precise Applescript commands to open JPG or TIF files with the Camera Raw dialogue. I have Photoshop CS6 set to open JPG and TIF files by default as the camera raw setting. However, I've tried various Applescript commands

  • Recover Application

    Hi all, Please help. I had an HTMLDB application running on my local PC (development was practically finished), but now had a harddisk crash. I only have a full Oracle database export of it (no HTML DB application export). Is it possible to recover t

  • Batch determination using BDC is not same as CO02 - any suggestions

    Hi We are usiing custom program to update the quantities in Production Order after Potency Calc. and subsequently execute the Batch determination. due to new component quantities, if New Batch to be added for the component during Batch Determination