
You can configure the URL on which Web service endpoints are exposed and receive SOAP message requests. This new URL can differ from the URL on which the Web service is available by default.
In a WSDL document, the URL on which SOAP messages are sent is reflected in the <soap: location="http(s)://<host>:<port>/<alias>"/> property.
The SOAP messages are sent directly to the provider system on which the Web service is running. This set-up is operational when you call the Web service from within the local network, for example. However, you have to explicitly configure the URL when the Web service you provide is behind a firewall, or a reverse proxy.
The URL generated by the framework complies with the following pattern http(s)://<host>:<port>/<alias> . You can override each of these three default values by configuring a URL address using the runtime annotation @TransportBindingRT . The names of the respective attributes are provided in brackets:
Hostname (AltHost)
The name of the host which is used in the new URL address.
Port number (AltPort)
The port number which is used in the new URL address.
Alias (AltPath)
The alias which is used in the new URL address.
The alias is an additional identifier in the URL address. By default, it is constructed by a preset algorithm. If you want the Web service to be available at a custom alias, you have to explicitly specify it.
The Web service implementation bean is available.
The code sample below shows the usage of the @TransportBindingRT annotation and its attributes. The new URL address specified is http://MyHost:33333/MyTestBean .
package com.sap.example;
import javax.ejb.Stateless;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import com.sap.engine.services.webservices.espbase.configuration.ann.rt.TransportBindingRT
@WebService(targetNamespace="http://sap.com/example/", serviceName="MyOnewayMEPImplementationClassService",
name="MyOnewayMEPImplementationClass", portName="MyOnewayMEPImplementationClassBeanPort")
@Stateless
@TransportBindingRT(AltHost="MyHost",AltPort="33333",AltPath="MyTestBean")
public class MyOnewayMEPImplementationClassBean {
//Set the a one way message exchange pattern for MyMethod1
@WebMethod(exclude=false, operationName="MyMethod1")
@Oneway()
public void MyMethod1 (@WebParam(name="newValue1")
int newValue1)
{
//MyMethod1 implementation
}
@WebMethod(exclude=false, operationName="MyMethod2")
public int MyMethod2 (@WebParam(name="arg")
int arg)
{
return arg;
}
}