Annotation Type XmlType , WebServices

hello
i've an sql/plsql web service that return complex data type as xml
in order to access the webservice in my application i generate webservice cproxy clinet java class
untill no all thing is ok
now i go the proxyclinet.java class to execute the web service method the result is returned as string which is need to be parsed as xml nodes which is ok
now suppose that i want to do another solution that is based on the Annotation Type XmlType to define a class to store the return data type as java object fro the xml data
the
java code as follow
package TestWebService;
import java.lang.annotation.ElementType;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorOrder;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
<xs:complexType name="Employee">
   <xs:sequence>
       <xs:element name="EMPNO" type="xs:int" minOccurs="0"/>
        <xs:element name="ENAME" type="xs:string" minOccurs="0"/>
        <xs:element name="JOB" type="xs:string" minOccurs="0"/>
        <xs.element name="SAL" typr="xs:anytype" minOccurs="0"/>
   </xs:sequence>
</xs:complexType>
@XmlType(propOrder = { "Number", "ENAME" ,"JOB","SAL"})
public class WebServiceDataType {
    public WebServiceDataType() {
        super();
    private int empno;
    private String ename;
    private String Job;
    private double sal;
    public int getEmpno() {
        return empno;
    public void setEmpno(int Number) {
        this.empno = Number;
    public String getEname() {
        return ename;
    public void setEname(String ENAME) {
        this.ename = ENAME;
    public String getJob() {
        return Job;
    public void setJob(String JOB) {
        this.Job = JOB;
    public double getSal() {
        return sal;
    public void setSal(double SAL) {
        this.sal = SAL;
}How i can make the return service data type to be converted to this class data type rather than string !!!
Mohammad
Edited by: mohammad.j.b.yaseen on Jan 24, 2012 12:54 PM

All are supported by Sun. http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html

Similar Messages

  • PDF Custom Annotations Types?

    Can some kind reader comment and/or point to documentation on PDF's Custom Annotation Types?
    I was first introduced to those by Aandi Inston's reply to my "Click to Dial Plugin" posting.
    Unfortunately, such posting seems to have been pulled (lost?, relocated?, bitbucketed?) from the forum.
    My objective is to programmatically insert several links of different types in my PDF files. I intend to have a type for voice phone numbers, another for fax numbers, and yet another company or client ID, etc.
    The part below refers to a plugin (to be written).
    Later on, when the user clicks on a phone number, a call will be placed, clicks on a fax number will result in the document being faxed, while a click on an ID will result on a database lookup.
    I don't want to go through the hassle of studying the page's geometry to determine whether a phone number is voice or fax. I am just looking for a way to mark the different links, giving each one of them a type, which will be passed to the plugin upon a link being clicked.
    I recall that Aandi's explanation made an exact match for my application, but as I said before, his posting is gone.
    -Ramon

    Perhaps the use Custom Annotation Types (CAT) is an overkill? It seems that when a CAT is defined, an annotation handler has to be registered, and such handler provides the drawing. In my case I don't need any custom drawing. I just need to mark somehow the different links, assigning a type to each.
    Thanks for sharing your expertise, and helping the PDF format to become more useful and widespread...
    -Ramon

  • The argument does not represent an annotation type

    Hello, i stated getting this exception today:
    java.lang.IllegalArgumentException: The argument does not represent an annotation type: <MyAnnotationType>
    even if <MyAnnotationType> is an annotation and the processor used to work unmodified.
    Is there a way to check if the TypeElement before calling roundEnv.getElementsAnnotatedWith(annotation) ?
    The code in question is:
         @Override
         public boolean process(Set<? extends TypeElement> annotations,
                   RoundEnvironment roundEnv) {
              for (TypeElement annotation : annotations) {
                   for (Element el : roundEnv.getElementsAnnotatedWith(annotation)) {
              return true;

    Julio.Faerman wrote:
    Hello, i stated getting this exception today:
    java.lang.IllegalArgumentException: The argument does not represent an annotation type: <MyAnnotationType>
    even if <MyAnnotationType> is an annotation and the processor used to work unmodified.So is there something else that changed today in your environment?

  • Indexing XMLDB table of type XMLType

    Hi
    I have created an table in XML DB of type XMLType.
    Can anyone tell me how I can index this table?
    Oracle version is 9.2.0.3.0

    You should ask this question in teh Oracle XMLDB forum, or perhaps the Oracle Text forum (formerly interMedia Text).
    You will get a better, quicker answer there.

  • Predefined annotation type

    Hi,
    Is @Overrride or any other predefined annotation types a compiler directive?
    Thanks,

    All are supported by Sun. http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html

  • Annotation Type Declaration

    Why in anno type declaration some types look like methods ?
    Example:
    public @interface MyAnnotation {
       String doSomething();                   //HERE
       int count; String date();                 // int is fine but , String , why its a method ?
    Usage:
    @MyAnnotation (doSomething="What to do", count=1,
                   date="09-09-2005")
    public void mymethod() {
    }

    ya ..
    it says
    "The annotation type definition looks somewhat like an interface definition where the keyword interface is preceded by the @ character (@ = "AT" as in Annotation Type). Annotation types are, in fact, a form of interface, which will be covered in a later lesson. For the moment, you do not need to understand interfaces.
    +The body of the annotation definition above contains annotation type element declarations, which look a lot like methods. Note that they may define optional default values.+ "
    But does not explain why they are metods , observe in the above example that ,
    primitive int is directly declared , not as a method ,
    Then all should be methods ..

  • Annotation Type SuppressWarnings

    In [Sun doc] "Compiler vendors should document the warning names they support in conjunction with this annotation type"
    Where I can find the list of warning of compiler of Sun?

    All are supported by Sun. http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html

  • Complex Types in Webservices

    Hi,
    I'm trying to make a call to a web service method which takes a complex type as a parameter.
    I'm using an object of type Object and setting two properties of the object called name and body then passing the object as the parameter of the webservice method.  The problem that I'm seeing is that the name property doesn't seem to be getting set.  I'm using Wireshark to packet sniff the SOAP request Flex sends to the webservice and I never see the name property in the request (but I do see the body property every time).
    Please note that this is not a connectivity issue as I am able to successfully make several other methods which do not take parameters with complex types.
    Does anybody know what I need to do to get this name property to show up properly in the complex type?
    Here is my Flex code:
    </mx:Script>
    <![CDATA[
    public function init() : void {
         var mb : Object;
         mb = new Object();
         mb.name = "inputMsg";
         mb.body = "foo";
         service.setMessage.send(mb);
    ]]>
    </mx:Script>
    <mx:WebService
      id="service"
      result="onResult(event)"
      fault="onFault(event)"
      wsdl="http://FOOBAR:8282/EngineService/engine?wsdl">
      </mx:WebService>
    Here is the SOAP request I picked up in Wireshark:
    O@8qE2@g@t@F#H"P0<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">
      <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <ns0:setMessage xmlns:ns0="http://isws.pervasive.com">
          <mb xsi:type="intf:Message" xmlns:intf="http://isws.pervasive.com/">
            <body xsi:type="xsd:string">foo</body>
          </mb>
        </ns0:setMessage>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Thanks,
    Dan

    user10455639 wrote:
    So I think you are right that I messed it up, So let me explain -
    Using JAXB -
    1. You can use Types annotation and Hence also specify what all your class can return. For example -
    public void saveAlert(Alert alert)
    so we can say using types something like -
    public void saveAlert(@Types({"com.businessobject.BalanceThreshold"}) Alert alert)
    indicating that your inout can also be a balanceThrshold object
    or something like -
    (@Types({"com.businessobject.BalanceThreshold"})
    public Alert getAlert()
    indicating that your ouput can also be a balanceThrshold object
    However with JAXB I get stuck with when the return type internally has a complext data type.
    using JAXWS-
    I donot know if there is a way to specify those extension as described above
    But you are right that the return type gets automatically taken care of with JAX-WS
    can you suggest similar notation to Types in JAXWS?
    On JAXB - I didnt understand your comment of "My suggestion is that you should try start from WSDL"
    Your comments are very helpful.
    thanksI assume that you mean JAX-RPC, not JAXB. According to link, @Types should only be used on WebMethod or the WebMethod parameter. So it wouldn't work if you specify it on complex data type.
    Start from WSDL is so called top down WebServices, it assumes that you have a WSDL as contract first, then you can generate the JWS from this WSDL.

  • Questions on the @ServiceClient annotation and Asynchronous webservices

    1. Is their a way to invoke a webservice in an asynchronous manner without using the @ServiceClient annotation? I’ve tried a few things to get access to the async versions of the web methods and each time I get an exception stating “java.rmi.RemoteException: Asynchronous methods can only be invoked from stubs with the ServiceClient annotation”.
    2. Is their anyway to generate a dynamically sized array of service port variables with the @ServiceClient annotation? All the examples that I have seen only have a single port variable annotated with @ServiceClient. I’ve tried creating a class that uses the @ServiceClient annotation, and while it does compile it fails when I try to invoke the services methods. I also found in some documentation a restriction that the @ServiceClient annotation can only be used in the core java (jws) webservice class.
    3. Is their a way to use a single service port variable with the @SeriviceClient annotation to invoke multiple calls to an asynchronous web method if that web method is part of a conversation? When I tried this I found that even though the asynchrounous calls were going out with any problems they were being processed serially on the target services side (I assume due to the conversation).
    The problem I am trying to solve is I need to invoke a stateful webservice in an asynchronous manner multiple times from the same starting service.

    Hi
    That is how I understand that document:
    Locking: Forms, by default, locks a row as soon as the user starts modifying the data. That is pessimistic locking. Apex, on other hand (and optionally forms also) do not lock the record, but before applying any changes checks if the data has changed since the user queried it (what for some reason is called optimistic "locking")
    DB connections: I am not sure why they used the terms synchronous/asynchronous, but the difference is that Forms, by default, keeps an permanent DB connection while the user is using the application, while Apex gets a connection from a connection pool every time a page is requested/submitted.
    Architecture: Forms (in its web version at least) has 3 tiers: the browser, the appserver where the forms service runs and the database. As Apex runs inside the database, there are only 2 tiers: the browser and the database (though you still may need an http server in between which serves static content, I don't think it is considered part of the application in this context). If you are talking about client/server forms, then there are only 2 tiers.
    I hope this helps!
    Luis

  • Defining input message Type for webservice interface with out input

    Hi all,
    I am configuring a scenario RFC -> XI -> Webservice. My sync webservice doesnot need any input. it genrates a random number which needs to be sent back to the RFC. How can i define an input message data type with out any data? As the interface requires both input and output data types in XI?
    I tried a dummy data type with a single string input and didn't map it. but its not working because of name space issues. i specified a seperate XML name space in Message Type but i get a Target URL as the name space in the request which i provided in the SOAP reciever adapter.
    Any help will be appriciated
    Thanks and best regards,
    Kulwant Singh

    Hi
    Can u chk the webservice request using test tools like stylus studio or xml spy and ensure that the same request is going out of XI .
    make sure that you have changed the default xml namesapce in the target MT.
    rgds
    Arun

  • Component define data types for Webservices [Incomplete Documentation]

    I been looking around the web and in safari for a good answer to this question I have about the documentation found at
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=webservices_20.html
    When I try and recreate these examples I get this error.
    The component definition file for component 'name[]' cannot be found on this server.
    Does anyone know where I can find a zip file of this example. I am having a bear of time getting array of types to return from a coldfusion webservice and hope to at the very least recreate what is found in the documentation. I know it must be something very simple that isn't clear in the documentation so any help would be great.
    -Luke

    Ok, So I got simple with this.
    I made a directory called dashboardwebservice/testme
    and I put in there two files.
    <!--- webservice2.cfc --->
    <cfcomponent style="document">   
      <cffunction
    name="allNames" returnType="name[]" access="remote" output="false">
        <cfset var returnarray = ArrayNew(1)>
        <cfset var temp = "">
        <cfloop index="loopi" from="1" to="5">
           <cfobject component="name" name="tempname">
           <cfset tempname.Firstname = "Firstname">
           <cfset tempname.Lastname = "LastName#loopi#">
           <cfset temp = ArrayAppend(returnarray, tempname)>
         </cfloop>
         <cfreturn returnarray>
        </cffunction>
    </cfcomponent>
    and
    <!--- webservice2.cfc --->
    <cfcomponent>
        <cfproperty name="Firstname" type="string">
        <cfproperty name="Lastname" type="string">
    </cfcomponent>
    This creates the error.
    Component not found
    The component definition file for component 'dashboardwebservice.testme.name[]' cannot be found on this server.
    I don't think it knows how to create the description for the web request because it is looking for a array of that object.

  • Error: "cannot be resolved or is not a type" of webservice proxy class

    Hello I'm novice in Web Dyn Pro, could you please assist me.
    I have project that was developed before by others, now I encountered with errors during compilation of web service project based on ejb. If more concretely, problems occured in one auto-generated proxy class that refer to another proxy class that I don't know why was absent.
    Problems occures in lines like this
    com.accenture.mdp.company.model.companybasic.proxies.DefaultServiceImpl service = com.accenture.mdp.company.model.companybasic.CompanyBasic. getServiceImpl ();
    Error com.accenture.mdp.company.model.companybasic.proxies.DefaultServiceImpl cannot be resolved or is not a type     Request_CompanyServiceViDocument_addCompany.java
    I suppose that exists the way to generate absented proxies automaticaly, may be by using wizards, but I don't know how.
    Could anybody help me ?

    Hi Sergy,
    Welcome to SDN!
    Did you try Repair, Reload and Rebuild options?
    (Right click on the project, you will get the options)
    If still the problem exists, Close and Open the project.
    Check the versions of your NWDS and the project developed NWDS are same?
    Regards,
    Siva

  • How  i will find the type of webservice ?

    Hi ,
    I am getting the all webservices and webservice id's using Remote server API.
    How i will differentiate the webservice like a
    AWS, PWS, SWS , Remote Portlet Web Service and Intrinsic Portlet web serve?.
    So , please tell me query on this.
    Regards
    Dheeraj SAI

    Normally if you select a song and click get info you get this info. So you data should be in Album field or the Composer should be Bach.
    If these data are inout correctly at the time of file generation, you can choose View, View Option in the Itunes Menu, Tick the Composer and the Album.
    Have a nice day!

  • XMLTYPE vs normal data type

    Hi,
    what is the difference between OF XMLTYPE and normal data type.
    I am asked to find the features of xml(load the data from xml to oracle and oracle to xml) in normal data type.

    XMLType is simply another storage option for data, with a certain set of restrictions. Similar in concept to DATE or NUMBER.
    There are different underlying storage options for XMLType, dependent upon which version of Oracle you are on. You can read up about XMLType via this post {thread:id=1035284}

  • Map xsd complex type to existing java class without adding JAXB annotations

    Hello
    I've got a case where I should map an xsd complex type to an existing Java class without modifying that class, i.e. without adding JAXB annotations to that class.
    Is this possible somehow?
    As far as I've understood, the <javaType> declaration (adapter, parse/print methods) can only be used for xsd simple types.
    Thanks, Tom

    It should be possible to implement an XmlAdapter<...,...> which performs the required conversion between the original type and a JAXB-annotated type. Then, at the places where the original type is used, the @XmlJavaTypeAdapter annotation would be used.
    The xjc compiler supports this for xsd simple types (xjc:javaType annotation), but not for complex types.
    Any idea why this is restricted to simple types?
    Would it be possible to implement a xjc plugin which does this for complex types?
    Thanks Tom.

Maybe you are looking for

  • Forcing files out of a tar

    Hello, I have a tar file that I created that is over 19gb in size. I can open the file in File Roller and I can see the contents with tar -tvf filename.tar however, when I try to extract the files from the tar, I get no output, and the command comple

  • MacBook won't fully boot and shows caution icon ??

    I have just applied some updates to my MacBook air from the Apple support site. Now my MacBook air boots with a caution icon showing briefly and then you shuts down. This booting process cycles three times and then my MacBook air shuts down for good.

  • Apps that use non-public APIs will be rejected

    Hi guys Just reading the iOS guidelines before I get too deep into making the native version of a web app. I was wondering what: Apps that use non-public APIs will be rejected means when submitting an app made in AIR - does it mean you can't use your

  • Auto mounting different network volumes

    I have a MacBook Pro. I use it at the office and at home. When I am in the office, I have one set of network volumes that I mount. At home, I have another (e.g. Airdisk, iMac HD, etc.) I would like to figure out a way to have the right drives mounted

  • Paid product activation problem ! (Premiere Pro CC)

    I was using the trial version of Premiere Pro CC.The trial ended  and I bought the monthly subscription with my credit card.I just receive an email from adobe about my subscription but I can't activate adobe premiere !