Forums Register Login

NEWBIE - Webservice code question

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
This tiny ad is suggesting that maybe she should go play in traffic.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 970 times.
Similar Threads
struts2 + Json and JQuery.
Change rows property of ADF Table
Passing values into the SQL connection class?
Unreachable code question
HELP - newbie question on JDBC
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:18:44.