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 6123023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:58:02+00:00 2026-05-23T15:58:02+00:00

I have been tasked with making an existing Java program available via a web

  • 0

I have been tasked with making an existing Java program available via a web service that will be invoked through a PHP form.

The program performs biological simulations and takes a large number of input parameters (around 30 different double, double[], and String fields). These parameters are usually setup as instance variables for an “Input” class which is passed into the the program, which in turn produces an “Output” class (which itself has many important fields). For example, this is how they usually call the program:


Input in = new Input();
in.a = 3.14;
in.b = 42;
in.c = 2.71;
Output out = (new Program()).run(in);

I am looking for a way to turn this into a web service in the easiest way possible. Ideally, I would want it to work like this:

1) The PHP client form formats an array containing the input data and sends it to the service.
2) The Java web service automatically parses this data and uses it to populate an Input instance.
3) The web service invokes the program and produces an Output instance, which is is formatted and sent back to the client.
4) The client retrieves the input formatted as an associative array.

I have already tried a few different methods (such as a SOAP operation and wrapping the data in XML), but nothing seems as elegant as I would like. The problem is that the program’s Input variable specifications are likely to change, and I would prefer the only maintenance for such changes to be on the PHP form end.

Unfortunately, I don’t have enough experience with web services to make an educated decision on what my setup should be like. Does anyone have any advice for what the most effective solution would be?

  • 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-05-23T15:58:02+00:00Added an answer on May 23, 2026 at 3:58 pm

    If your program is stand alone java use jetty as an embedded web server.
    If the application is already running as a web application skip this.

    The second phase is creating web service. I’d recommend you restful web service. It is easier to implement and maintain than SOAP. You can use XML or JSON format for data. I’d probably recommend you JSON.

    Now it is up to you. If you already use some kind of web framework, check whether it supports REST. If you do not use any framework you can implement some kind of REST API using simple servlet that implements doPost(), parses input (JSON) and calls implementation.

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

Sidebar

Related Questions

I have been tasked with creating a program that will generate an amortization schedule.
I have been tasked with going through a number of ColdFusion sites that have
I have been tasked with creating a program what will create take files in
I have been tasked with decrypting a file in Java that has been encrypted
I have been tasked with developing a solution that tracks changes to a database.
I have been tasked with converting several php classes into java classes, which is
I've been tasked with making an already existing e-commerce site SE friendly - which
I inherited a Drupal5 site and have been tasked with making some changes, but
I have been tasked to look after an ASP.Net WebForms application that communicates with
I have been tasked with building a simple web based system for managing a

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.