Show TOC

Setting the Transport Guarantee LevelLocate this document in the navigation structure

Use

You can set a transport guarantee level to a Web service to secure the data transfer between the Web service and the Web service client.

By using the @ TransportGuaranteeDT annotation, you can set any of the transport guarantee levels listed below:

  • NONE

    The Web service does not require a security constraint. By default, all Web service you create have transport guarantee level NONE.

  • INTEGRITY_AND_CONFIDENTIALITY

    The Web service requires data transmission that prevents data from being changed in transit, and also prevents other entities from observing the transmitted content.

Procedure

The code sample below shows the use of the annotation to set the transport guarantee level to INTEGRITY_AND_CONFIDENTIALITY:

            package com.sap.example;

import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import com.sap.engine.services.webservices.espbase.configuration.ann.dt.TransportGuaranteeDT;
import com.sap.engine.services.webservices.espbase.configuration.ann.dt.TransportGuaranteeEnumsLevel;

@WebService(name="MyStatefulImplementationClass", serviceName="MyStatefulImplementationClassService", 
        targetNamespace="http://sap.com/example/", portName="MyStatefulImplementationClassPort")
@Stateless
//Set transport guarantee level to INTEGRITY_AND_CONFIDENTIALITY for the whole class
@TransportGuaranteeDT(level=TransportGuaranteeEnumsLevel.INTEGRITY_AND_CONFIDENTIALITY)
public class MyStatefulImplementationClass {
                @WebMethod(operationName="MyMethod1", exclude=false)
                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;
                }
}

         

If you want to set the NONE transport guarantee level, you have to use the @ TransportGuaranteeDT annotation in the following way: @TransportGuaranteeDT(level=TransportGuaranteeEnumsLevel.NONE)