File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes NEWBIE - Webservice code question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "NEWBIE - Webservice code question" Watch "NEWBIE - Webservice code question" New topic

NEWBIE - Webservice code question

Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 387

I am trying to create a webservice in the where I am coding for the REQUEST and RESPONSE pieces.

From the code:

public class ReadResponse {
private org.texashealth.www.SCM.Common.Header header;
private org.texashealth.www.SCM.DataTier.Common.FieldValue[][][] rows;

public ReadResponse() {

public org.texashealth.www.SCM.Common.Header getHeader() {
return header;

public void setHeader(org.texashealth.www.SCM.Common.Header header) {
this.header = header;

public org.texashealth.www.SCM.DataTier.Common.FieldValue[][][] getRows() {
return rows;

public void setRows(org.texashealth.www.SCM.DataTier.Common.FieldValue[][][] rows) {
this.rows = rows;

public org.texashealth.www.SCM.DataTier.Common.FieldValue[][] getRows(int i) {
return this.rows[i];

public void setRows(int i, org.texashealth.www.SCM.DataTier.Common.FieldValue[][] value) {
this.rows[i] = value;

I am trying to utilize the "setRows" method to populate the RESPONSE Parameters which is as follows:

Response Parameters
Version: The schema version number for the XML
Status: The status of the request.
Rows: This is a list of database rows being returned.
Row: This is a list of FieldValues.
Name: Name of the field
Value: The contents of the field as a string.

I got the HEADER, VERSION and STATUS already initialized and here is what I have put together in my code:

public class ReadSOAPImpl implements org.tempuri.Read_PortType{
public org.texashealth.www.SCM.DataTier.ReadResponse.ReadResponse read(
org.texashealth.www.SCM.DataTier.BTResponse.ReadRequest readRequest
) throws java.rmi.RemoteException {

// Create the ReadResponse and Header objects.
ReadResponse response = new ReadResponse();
Header responseheader = new Header();

// Initialize the responseheader with the hardcoded VERSION and STATUS.

// Initialize the response object by passing in the responseheader object.

// Initialize the response object by passing in the rows.

return null;


Being new to Java I'm lost as to how to respond with the correct ROWS information. Any direction or help would be appreciated.

Thank you.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
You're using SOAP on a very low level, creating requests and responses your self. Is it not feasible to program to a higher-level API live JAX-RPC? Those would let you deal just with the parameters you're sending and the actual Java objects; the minutiae of transferring them over the wire via SOAP would be hidden from you.
As to your actual question, I have no clue.
I agree. Here's the link:
subject: NEWBIE - Webservice code question
jQuery in Action, 3rd edition