Listing 17. Method to publish sample binding tModels
private static void publishBindingTModels(Publish publish)
throws UDDIException, TransportException
{
TModelDetail tModelDetail = null;
Vector v = null;
TModel tModel = null;
TModel initialTModel = null;
CategoryBag wsiCategoryBag = null;
// This keyedReference can be reused each time.
KeyedReference wsiKeyedReference =
new KeyedReference(
"ws-I_conformance:BasicProfile1.0",
"http://ws-i.org/profiles/basic/1.0",
"uuid:65719168-72c6-3f29-8c20-62defb0961c0");
// As the publish_binding_tModel method updates the tModel that is
// passed in, we must create it from scratch each time.
// ConfiguratorBinding tModel
wsiCategoryBag = new CategoryBag();
wsiCategoryBag.add(wsiKeyedReference);
initialTModel = new TModel();
initialTModel.setTModelKey("");
initialTModel.setCategoryBag(wsiCategoryBag);
tModelDetail =
publish.publish_binding_tModel(
initialTModel,
"http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Configurator.wsdl",
"ConfiguratorBinding",
"http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Configurator.wsdl",
configuratorPortTypeKey,
SOAP_PROTOCOL_KEY,
HTTP_TRANSPORT_KEY);
v = tModelDetail.getTModelVector();
tModel = (TModel)v.elementAt(0);
configuratorBindingKey = tModel.getTModelKey();
System.out.println(
"ConfiguratorBinding key is " + configuratorBindingKey);
// LoggingFacilitySoapBinding tModel
wsiCategoryBag = new CategoryBag();
wsiCategoryBag.add(wsiKeyedReference);
initialTModel = new TModel();
initialTModel.setTModelKey("");
initialTModel.setCategoryBag(wsiCategoryBag);
tModelDetail =
publish.publish_binding_tModel(
initialTModel,
"http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/LoggingFacility.wsdl",
"LoggingFacilitySoapBinding",
"http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/LoggingFacility.wsdl",
loggingFacilityPortTypeKey,
SOAP_PROTOCOL_KEY,
HTTP_TRANSPORT_KEY);
v = tModelDetail.getTModelVector();
tModel = (TModel)v.elementAt(0);
loggingFacilityBindingKey = tModel.getTModelKey();
System.out.println(
"LoggingFacilitySoapBinding key is " + loggingFacilityBindingKey);
// ManufacturerSoapBinding tModel
wsiCategoryBag = new CategoryBag();
wsiCategoryBag.add(wsiKeyedReference);
initialTModel = new TModel();
initialTModel.setTModelKey("");
initialTModel.setCategoryBag(wsiCategoryBag);
tModelDetail =
publish.publish_binding_tModel(
initialTModel,
"http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-10/Manufacturer.wsdl",
"ManufacturerSoapBinding",
"http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-10/Manufacturer.wsdl",
manufacturerPortTypeKey,
SOAP_PROTOCOL_KEY,
HTTP_TRANSPORT_KEY);
v = tModelDetail.getTModelVector();
tModel = (TModel)v.elementAt(0);
manufacturerBindingKey = tModel.getTModelKey();
System.out.println(
"ManufacturerSoapBinding key is " + manufacturerBindingKey);
// RetailerSoapBinding tModel
wsiCategoryBag = new CategoryBag();
wsiCategoryBag.add(wsiKeyedReference);
initialTModel = new TModel();
initialTModel.setTModelKey("");
initialTModel.setCategoryBag(wsiCategoryBag);
tModelDetail =
publish.publish_binding_tModel(
initialTModel,
"http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Retailer.wsdl",
"RetailerSoapBinding",
"http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Retailer.wsdl",
retailerPortTypeKey,
SOAP_PROTOCOL_KEY,
HTTP_TRANSPORT_KEY);
v = tModelDetail.getTModelVector();
tModel = (TModel)v.elementAt(0);
retailerBindingKey = tModel.getTModelKey();
System.out.println("RetailerSoapBinding key is " + retailerBindingKey);
// WarehouseSoapBinding tModel
wsiCategoryBag = new CategoryBag();
wsiCategoryBag.add(wsiKeyedReference);
initialTModel = new TModel();
initialTModel.setTModelKey("");
initialTModel.setCategoryBag(wsiCategoryBag);
tModelDetail =
publish.publish_binding_tModel(
initialTModel,
"http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Warehouse.wsdl",
"WarehouseSoapBinding",
"http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Warehouse.wsdl",
warehouseShipmentsPortTypeKey,
SOAP_PROTOCOL_KEY,
HTTP_TRANSPORT_KEY);
v = tModelDetail.getTModelVector();
tModel = (TModel)v.elementAt(0);
warehouseShipmentsBindingKey = tModel.getTModelKey();
System.out.println(
"warehouseSoapBinding key is " + warehouseShipmentsBindingKey);
}
|
