Raritan Computer CC-WSAPI-0B-v5.1.0-E Marine Radio User Manual


 
Appendix B: Web Services Development in Java
31
Setting the CCSG Address
Downloading the WSDL files from port 8080 of the CC-SG is the default
source of the WSDL files, however, their contents will reflect port 8080 of
your CC-SG. Further, you might wish to use your WS client with a
different CC-SG or you might change the CC-SG's address.
Each WSDL file contains an element like the following:
<soap:address
location="https://10.0.0.101:9443/CommandCenterWebSer
vices/AuthenticationAndAuthorizationServicePort"/>
Before generating the stubs, you can edit this address within each file to
reflect the WS port of 9443, the WS protocol of HTTPS, and the address
of your CC-SG. After generating and building the source, your client will
already know the address, protocol, and port to use to access WS on
your CC-SG.
Manually editing the WSDL files requires less coding. Or, you can tell
your WS stubs the URL of your own choice at run time.
Sample method to create a URL to access a CC'-SGs web
services:
public static void set_service_end_point( Service
service, BindingProvider port )
{
Pattern pattern = Pattern.compile( "CC_SG_" );
Matcher matcher = pattern.matcher(
service.getServiceName().getLocalPart() );
String service_name = matcher.replaceFirst( "" );
String ccsg_port = "9443";
String ccsg_address = "10.0.0.101";
port.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"https://" + ccsg_address + ":" + ccsg_port +
"/CommandCenterWebServices/" +
service_name + "Port?wsdl" );
}