Use the createWSGWGatewayService command to create a new gateway service configuration.
You can create a new gateway service configuration by using the wsadmin tool as described in this topic, or by using the administrative console as described in Creating a new gateway service configuration.
To run the command, use the AdminTask object of the wsadmin scripting client.
The wsadmin scripting client is run from Qshell. For more information, see Configuring Qshell to run WebSphere scripts using wsadmin scripting.
print AdminTask.help('WSGateway')
print AdminTask.help('command_name')
AdminConfig.save()
Before you use this command, you might want to use service integration bus-enabled web services commands to create a new outbound service and add an outbound port. For more information, see the worked example at the end of this topic.
This command creates a new GatewayService with associated InboundService and TargetService objects.
ObjectName of the gateway instance within which the gateway service is created.
The command creates the gateway request destination and corresponding reply destination. The gateway request destination is configured to update the reply path to add the reply destination. If a destination with the specified or default names already exists, the command fails.
If a gateway service or proxy service with the same name already exists, the command fails.
The command always creates an InboundService object with the same name as the gateway service. The command fails if an inbound service with that name already exists.
The WSDL location from the OutboundService object or specified on the command is used as the template WSDL location for the inbound service. If the WSDL is to be retrieved through a proxy, the server on which the command is running must have the system properties that identify the proxy server set correctly. If the proxy requires authentication, then the user ID and password can be set as parameters on the command.
The TargetService object created by this command is set as the default for the gateway service, and the default forward routing path on the gateway destination is set to point at the target destination. The gateway destination com.ibm.websphere.wsgw.targets property is set to contain the target destination or destination associated with the outbound service. The com.ibm.websphere.wsgw.gatewayService and com.ibm.websphere.wsgw.gatewayInstance properties on the gateway destination are set appropriately.
This is either a web address or the service-specific part of a UDDI service key. If you specify a UDDI reference, the WSDL location is assumed to be a UDDI service key.
uddi:blade108node01cell:blade108node01:server1:default:6e3d106e-5394-44e3-be17-aca728ac1791
The
service-specific part of this key is the final part: 6e3d106e-5394-44e3-be17-aca728ac1791
gwService = AdminTask.createWSGWGatewayService(wsgw, ["-name",
"MyGatewayService", "-targetService", "MyService"])
set gwService [$AdminTask createWSGWGatewayService $wsgw {-name
"MyGatewayService" -targetService "MyService"}]
outService = AdminTask.createSIBWSOutboundService(bus, ["-name",
"StockQuoteService",
"-wsdlLocation", "http://myserver.com/wsdl/StockQuoteService.wsdl"])
set outService [$AdminTask createSIBWSOutboundService $bus {-name
"StockQuoteService"
-wsdlLocation "http://myserver.com/wsdl/StockQuoteService.wsdl"}]
outPort = AdminTask.addSIBWSOutboundPort(outService, ["-name", "SOAPHTTPPort",
"-node", "MyNode", "-server", "server1"])
set outPort [$AdminTask addSIBWSOutboundPort $outService {-name "SOAPHTTPPort"
-node "MyNode" -server "server1"}]
gwService = AdminTask.createWSGWGatewayService(wsgw, ["-name",
"StockQuoteGatewayService", "-targetService", "StockQuoteService"])
set gwService [$AdminTask createWSGWGatewayService $wsgw {-name
"StockQuoteGatewayService" -targetService "StockQuoteService"}]
inServiceName = AdminConfig.showAttribute(gwService, "inboundServiceName")
inService = AdminConfig.getid(
"/SIBus:"+busName+"/SIBWSInboundService:"+inServiceName+"/" )
set inServiceName [$AdminConfig showAttribute $gwService "inboundServiceName"]
set inService [$AdminConfig getid
/SIBus:$busName/SIBWSInboundService:$inServiceName/]
inPort = AdminTask.addSIBWSInboundPort(inPort, ["-name", "SOAPHTTPPort",
"-endpointListener", "soaphttp1", "-node", "MyNode", "-server", "server1"])
set inPort [$AdminTask addSIBWSInboundPort $inPort {-name "SOAPHTTPPort"
-endpointListener "soaphttp1" -node "MyNode" -server "server1"}]