Menu

#4 WSDL2Java

open
nobody
None
5
2006-06-06
2006-06-06
Jim Redman
No

Uses Axis WSDL2Java to build Soap Objects that provide
data access to the WSDL.

There are many (MANY) things that I don't understand
about the Axis implementation and so the code has hack
(typically String related) that could really be
improved if anyone understands WSDL.

For example, using
http://opcfoundation.org/webservices/XMLDA/1.0/

GetStatus:

public void test1ServiceGetStatus() throws Exception {
try {
GetStatus getStatus = new GetStatus ("en-us",
"MyClientHandle");
envelope.bodyOut = getStatus.getSoapObject();

HttpTransportSE ht = new
HttpTransportSE("http://localhost:7226/servlets/XMLOPCDA");
ht.debug = true;
System.out.println ("Request: " + envelope);

ht.call("http://opcfoundation.org/webservices/XMLDA/1.0/#GetStatus",
envelope);

GetStatusResponse result = new
GetStatusResponse((SoapObject)envelope.bodyIn);
System.out.println ("Result: " + result);

[...]

}

/** Respond to the "getStatus" request. */
public GetStatusResponse GetStatus(SoapObject in) {
GetStatus getStatus = new GetStatus(in);

ServerStatus serverStatus = new
ServerStatus(HeadlessController.serverStartTime,
productVersion, "running", vendorInfo, new String[]
{"us"}, SUPPORTED_INTERFACE_VERSION);
ReplyBase replyBase = new ReplyBase( new Date(),
new Date(), getStatus.getClientRequestHandle(),
Locale.getDefault().getCountry().toLowerCase(),
"running" );
GetStatusResponse getStatusResponse = new
GetStatusResponse(replyBase, serverStatus);
return getStatusResponse;
}

Discussion


Log in to post a comment.