NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

unused classes in web service

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
netci



Joined: 20 Feb 2011
Posts: 7

PostPosted: Sat Apr 30, 2011 8:20 pm    Post subject: unused classes in web service Reply with quote

Hi,
i have to use a web service with some classes and methods.
I automatically generate the web service code using netbeans, but there are some unused classes. I can do everything that i was told without using some classes.

To demonstrate the problem to you i am going to use an app in NetBeans 6.9 sample apps.

I created a project using New Project->Samples->Java Web Services->Calculator

In CalculatorClientApp, there are Add, AddResponse, CalculatorWS classes.
There are lines in ClientServer.java(servlet)

Code:
org.me.calculator.client.CalculatorWS port = service.getCalculatorWSPort();

                int i = Integer.parseInt(request.getParameter("value1"));
                int j = Integer.parseInt(request.getParameter("value2"));

                int result = port.add(i, j);


these lines do everything needed to adding operation.
BUT what do the Add and AddResponse classes do?
This is my question. Thanks
Back to top
netci



Joined: 20 Feb 2011
Posts: 7

PostPosted: Mon May 02, 2011 4:59 pm    Post subject: Reply with quote

hi again,
i want to clear the topic.
in the project that i generated using netbeans samples;
there are two classes named: Add and AddResponse.

Add.java

Code:

package org.me.calculator.client;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "add", propOrder = {
    "i",
    "j"
})
public class Add {

    protected int i;
    protected int j;

    /**
     * Gets the value of the i property.
     *
     */
    public int getI() {
        return i;
    }

    /**
     * Sets the value of the i property.
     *
     */
    public void setI(int value) {
        this.i = value;
    }

    /**
     * Gets the value of the j property.
     *
     */
    public int getJ() {
        return j;
    }

    /**
     * Sets the value of the j property.
     *
     */
    public void setJ(int value) {
        this.j = value;
    }

}


AddResponse.java

Code:
package org.me.calculator.client;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "addResponse", propOrder = {
    "_return"
})
public class AddResponse {

    @XmlElement(name = "return")
    protected int _return;

    /**
     * Gets the value of the return property.
     *
     */
    public int getReturn() {
        return _return;
    }

    /**
     * Sets the value of the return property.
     *
     */
    public void setReturn(int value) {
        this._return = value;
    }

}



As i wrote in previous post the servlet does not use the Add or AddResponse class.
I wonder if i must use these classes to generate a more SOA specific application?
thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo