A web service alias can be used effectively to manage the endpoints and the credentials for a web service outside of the code. Using web service aliases will remove the need for code changes or property file changes while pointing the web services to different environments.
As long as the WSDL context remains the same and only the endpoint or the port changes between different environments of the Consumer WSDL, the aliases can be used to re-point the web service from the IS Admin page with out a need for a deployment.
Steps for HTTP web service alias:
1. Create a consumer HTTP web service alias on the IS Admin page with the endpoint settings from the consumer WSDL.
2. Consume a WSDL on to the webMethods Developer and open the WSD. Click on the binders tab and select the binder.
3. In the properties pane click on the drop down for port alias and select the port alias created in step 1. If it does not show up then reload the package and try again.
4. Now save the consumer WSD and start calling the web service connector. The connection details for this WSD will be taken from the web service alias.
Steps for HTTP web service alias:
1. Create a Keystore alias and a key alias with the client certificate configured.
2. Create a HTTPS web service alias with the end point details from the WSDL. Use the keystore and key alias created in step1 while configuring the HTTPS alias.
3. Consume the WSDL on to the webMethods Developer and open the WSD. Click on the binders tab and select the binder.
4. In the properties pane click on the drop down for the port alias and select the port alias created in step 2. If it does not show up then reload the package and try again.
5. Now save the consumer WSD and start calling the web service connector. The connection details for thisWSD will be takem from the web service alias.
Note:
For ex:
If the WSDL has an endpoint defined as below, IS will create a HTTP WSD.
<service name="CreditScoreWebService">
<port name=" CreditScoreEndpointPort" binding="tns: CreditScoreServiceEndpointPortBinding">
<soap:address location="http://test.google.com:5555/creditscore/ CreditScoreWebService"/>
</port>
</service>
If the same WSDL has an endpoint defined as below, IS will create a HTTPS WSD.
<service name="CreditScoreWebService">
<port name=" CreditScoreEndpointPort" binding="tns: CreditScoreServiceEndpointPortBinding">
<soap:address location="https://test.google.com:5555/creditscore/ CreditScoreWebService"/>
</port>
</service>
"A Web service endpoint alias represents the network address and, optionally, any
security credentials to be used with Web services. The network address properties can be
used to enable dynamic addressing for Web services. The security credentials can be used
to control both transport-level and message-level security for Web services."
- Administering_Integration_Server.pdf
As long as the WSDL context remains the same and only the endpoint or the port changes between different environments of the Consumer WSDL, the aliases can be used to re-point the web service from the IS Admin page with out a need for a deployment.
Steps for HTTP web service alias:
1. Create a consumer HTTP web service alias on the IS Admin page with the endpoint settings from the consumer WSDL.
2. Consume a WSDL on to the webMethods Developer and open the WSD. Click on the binders tab and select the binder.
3. In the properties pane click on the drop down for port alias and select the port alias created in step 1. If it does not show up then reload the package and try again.
4. Now save the consumer WSD and start calling the web service connector. The connection details for this WSD will be taken from the web service alias.
Steps for HTTP web service alias:
1. Create a Keystore alias and a key alias with the client certificate configured.
2. Create a HTTPS web service alias with the end point details from the WSDL. Use the keystore and key alias created in step1 while configuring the HTTPS alias.
3. Consume the WSDL on to the webMethods Developer and open the WSD. Click on the binders tab and select the binder.
4. In the properties pane click on the drop down for the port alias and select the port alias created in step 2. If it does not show up then reload the package and try again.
5. Now save the consumer WSD and start calling the web service connector. The connection details for thisWSD will be takem from the web service alias.
Note:
- A HTTP web service alias will not show up as an available port alias for a HTTPS WSD and vice versa.
- IS will interpret the WSDL as-is and generate a HTTP or HTTPS WSD based on the endpoint definition in the WSDL. If you want to generate a HTTPS WSD for a HTTP WSDL then edit the WSDL and change the address location to HTTPS.
For ex:
If the WSDL has an endpoint defined as below, IS will create a HTTP WSD.
<service name="CreditScoreWebService">
<port name=" CreditScoreEndpointPort" binding="tns: CreditScoreServiceEndpointPortBinding">
<soap:address location="http://test.google.com:5555/creditscore/ CreditScoreWebService"/>
</port>
</service>
If the same WSDL has an endpoint defined as below, IS will create a HTTPS WSD.
<service name="CreditScoreWebService">
<port name=" CreditScoreEndpointPort" binding="tns: CreditScoreServiceEndpointPortBinding">
<soap:address location="https://test.google.com:5555/creditscore/ CreditScoreWebService"/>
</port>
</service>