createWSGWGatewayService command
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.
如果要執行這個指令,請使用 wsadmin Scripting 用戶端的 AdminTask 物件。
wsadmin Scripting 用戶端是從 Qshell 執行.
如需相關資訊,請參閱利用 wsadmin Script 配置 Qshell 來執行 WebSphere Script.
- 如需可用的閘道指令清單,以及每個指令的簡要說明,請在 wsadmin 提示下,輸入下列指令:
print AdminTask.help('WSGateway')
- 如需給定指令的概觀說明,請在 wsadmin 提示下,輸入下列指令:
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.
Purpose
This command creates a new GatewayService with associated InboundService and TargetService objects.
Target object
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.
Required parameters
- -name
- The gateway service name.
Conditional parameters
- -wsdlLocation
- The location of the template WSDL file.
這是網址或是 UDDI 服務金鑰的服務專屬組件。如果您指定了 UDDI 參照,就會將 WSDL 位置假設為 UDDI 服務金鑰。
以下是完整 UDDI 服務金鑰的範例:
這個金鑰的服務專屬組件是最後一個部分:uddi:blade108node01cell:blade108node01:server1:default:6e3d106e-5394-44e3-be17-aca728ac1791
6e3d106e-5394-44e3-be17-aca728ac1791
- If this parameter is not specified, then the WSDL location from the OutboundService object is used as the template WSDL location.
- -wsdlServiceName
- The name of the service within the WSDL. Only required if the template WSDL contains more than one service, or the WSDL is located through a UDDI registry.
- -wsdlServiceNamespace
- The namespace of the service within the WSDL. Only required if the template WSDL contains more than one service, or the WSDL is located through a UDDI registry, or the service is not in the default namespace for the WSDL document.
- -targetDestination
- The name of the target destination, which might be within the same service integration bus as the gateway destination or in another bus (in which case the -targetBus must also be specified).
- Specify either the -targetDestination or the -targetService parameter.
- -targetBus
- The name of the service integration bus that hosts the target destination.
- Specify this parameter if the -targetDestination parameter has been specified and the target destination is not within the same service integration bus as the gateway destination.
- -targetService
- The name of the target outbound service.
- Specify either the -targetDestination or the -targetService parameter.
Optional parameters
- -requestDestination
- The name of the gateway request destination.
- -replyDestination
- The name of the gateway reply destination.
- -uddiReference
- If you specified a UDDI service key as the WSDL location, supply the UDDI reference for the target UDDI registry.
- -userId
- The user ID that you use to retrieve the WSDL.
- -password
- The password that you use to retrieve the WSDL.
Example
- Using Jython:
gwService = AdminTask.createWSGWGatewayService(wsgw, ["-name", "MyGatewayService", "-targetService", "MyService"])
- Using Jacl:
set gwService [$AdminTask createWSGWGatewayService $wsgw {-name "MyGatewayService" -targetService "MyService"}]
- Create the outbound service
that represents the service provider,
where bus is the service integration bus:
- Using
Jython:
outService = AdminTask.createSIBWSOutboundService(bus, ["-name", "StockQuoteService", "-wsdlLocation", "http://myserver.com/wsdl/StockQuoteService.wsdl"])
- Using Jacl:
set outService [$AdminTask createSIBWSOutboundService $bus {-name "StockQuoteService" -wsdlLocation "http://myserver.com/wsdl/StockQuoteService.wsdl"}]
- Using
Jython:
- Add a SOAP over HTTP port as defined in the service
provider WSDL:
- Using Jython:
outPort = AdminTask.addSIBWSOutboundPort(outService, ["-name", "SOAPHTTPPort", "-node", "MyNode", "-server", "server1"])
- Using
Jacl:
set outPort [$AdminTask addSIBWSOutboundPort $outService {-name "SOAPHTTPPort" -node "MyNode" -server "server1"}]
- Using Jython:
- Create
the gateway service, where wsgw is the
gateway instance:
- Using Jython:
gwService = AdminTask.createWSGWGatewayService(wsgw, ["-name", "StockQuoteGatewayService", "-targetService", "StockQuoteService"])
- Using Jacl:
set gwService [$AdminTask createWSGWGatewayService $wsgw {-name "StockQuoteGatewayService" -targetService "StockQuoteService"}]
- Using Jython:
- Get the inbound service for the gateway service, where busName is
the name of the service integration bus:
- Using Jython:
inServiceName = AdminConfig.showAttribute(gwService, "inboundServiceName")
inService = AdminConfig.getid( "/SIBus:"+busName+"/SIBWSInboundService:"+inServiceName+"/" )
- Using Jacl:
set inServiceName [$AdminConfig showAttribute $gwService "inboundServiceName"]
set inService [$AdminConfig getid /SIBus:$busName/SIBWSInboundService:$inServiceName/]
- Using Jython:
- Add a SOAP over HTTP port, where the SOAP over HTTP
1 endpoint
listener is already configured:
- Using Jython:
inPort = AdminTask.addSIBWSInboundPort(inPort, ["-name", "SOAPHTTPPort", "-endpointListener", "soaphttp1", "-node", "MyNode", "-server", "server1"])
- Using Jacl:
set inPort [$AdminTask addSIBWSInboundPort $inPort {-name "SOAPHTTPPort" -endpointListener "soaphttp1" -node "MyNode" -server "server1"}]
- Using Jython:
- Complete the configuration of the inbound and outbound services and ports. For example, apply JAX-RPC handlers or WS-Security.