Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8939261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:47:16+00:00 2026-06-15T10:47:16+00:00

I am new with Java EE and SOAP. I have tried to create a

  • 0

I am new with Java EE and SOAP. I have tried to create a simple web service application and its client (environment: NetBeans 7.2.1 IDE, GlassFish Server 3.1, Java 1.6).

Web service code:

package simplews;

import javax.jws.*;

@WebService(serviceName = "SimpleWebService")
public class SimpleWebService {

    String something = null;

    @WebMethod(operationName = "setSomething")
    @Oneway
    public void setSomething(@WebParam(name = "smth") String smth) {
        something = smth;
    }

    @WebMethod(operationName = "getSomething")
    public String getSomething() {
        return something;
    }

}

Client application code:

package simpleclientapp;

import simplews.*;

public class SimpleClientApp {

    public static void main(String[] args) {

        SimpleWebService_Service service = new SimpleWebService_Service();
        SimpleWebService port = service.getSimpleWebServicePort();

        port.setSomething("trololo");
        String smth = port.getSomething();

        System.out.println(smth);
    }
}

Unfortunately, the client application printed out null. After short investigation I have realised, that on the server side a new SimpleWebService object is created for each client call (sounds like stateless approach).

What is wrong here? Why the client port does not refer to the same WS object for each call?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:47:17+00:00Added an answer on June 15, 2026 at 10:47 am

    Web services are stateless by nature. In order to keep state between requests, you have to persist the data (in a file,database etc.).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SOAP web service written in java communicating via XML-utf-8. My produced
I have a WCF client connecting to a Java based Axis2 web service (outside
I am tasked to create a simple tool, invoking a specific, SOAP-based web service.
I am creating a client to a Java soap web service, but am having
I have a simple web service method that returns a simple java class as
I am trying to create a quick sample Java client for a SOAP web
I have a android webservice client application. I am trying to use the java
For a new project, we want to build a web service in Java using
I have a soap web service that is connected to mySQL database. It has
I have implemented an Android code that calls a SOAP web service. The web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.