This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "NEWBIE - Webservice code question" Watch "NEWBIE - Webservice code question" New topic
Author

NEWBIE - Webservice code question

Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 386

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

From the READRESPONSE.java 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
Header
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.
FieldValue:
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 READSOAPIMPL.java 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.
responseheader.setVersion(BigInteger.valueOf(1));
responseheader.setStatus(Status.fromString("OK"));

// Initialize the response object by passing in the responseheader object.
response.setHeader(responseheader);

// 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
Marshal

Joined: Mar 22, 2005
Posts: 41132
    
  45
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.


Ping & DNS - my free Android networking tools app
 
Don't get me started about those stupid light bulbs.
 
subject: NEWBIE - Webservice code question
 
Similar Threads
Unreachable code question
struts2 + Json and JQuery.
HELP - newbie question on JDBC
Passing values into the SQL connection class?
Change rows property of ADF Table