The implementation bean of the Web service is available in the SAP NetWeaver Developer Studio.
When you create an inside-out or an outside-in Web service, you can configure it at design time (in the SAP NetWeaver Developer Studio) to customize the Web service's behavior at runtime. You configure a Web service at design time by using a set of annotations, which SAP provides. You add the annotations manually in the Web service implementation bean.
In this release, you can use annotations to configure Web services only. You cannot configure Web service clients in the SAP NetWeaver Developer Studio.
Using annotations, you can configure design time properties of Web service features. In this way, you apply a minimal set of abstract configuration settings to the Web service, such as the relevant authentication level, or enabling Web services reliable messaging. The configuration you apply via annotations in the SAP NetWeaver Developer Studio serves as the basis for the runtime configuration settings you can apply in the SAP NetWeaver Administrator. For simplicity, we refer to the SAP-specific annotations you can use to configure design time properties of features as design time annotations .
Using a design time annotation, you enable WS-RM for a Web service. Then, in the SAP NetWeaver Administrator, you finish the configuration of WS-RM to set the exact behavior of the Web service with regard to WS-RM at runtime.
Configuring Web services at design time by using annotations is optional:
You can leave the Web service with no custom configuration in the SAP NetWeaver Developer Studio and deploy the Web service. In this case, it will run with the default settings for every feature that can be configured via annotations. Then, you can configure the Web service at runtime from the SAP NetWeaver Administrator.
If you do not configure the Web service during the design time, the Web service is automatically callable after you deploy it on the provider system. SAP NetWeaver Administrator creates a service endpoint according to the Java EE specification. By default, no security settings are configured to the service endpoint.
You can configure the design time properties of features for a Web service in the SAP NetWeaver Developer Studio. For example, it is possible that you just enable reliable messaging for the Web service and then deploy it on the application server. In this case, you have to apply runtime configuration settings to the Web service in the SAP NetWeaver Administrator to finish the configuration of reliable messaging.
If you configure the Web service during design time, after you deploy it on the provider system, you have to create a service endpoint to it in SAP NetWeaver Administrator.
More information: Configuring Web Services
The guidelines outlined below are applicable to the usage of the SAP-specific design time annotations:
You can use the annotations only in conjunction with classes exposed as a Web service ( @WebService ) and methods exposed as Web service methods ( @WebMethod ). When you are using a service endpoint interface (SEI) to expose a Web service, the @WebService and @WebMethod annotations are declared in the SEI. In this case, you can declare the SAP-specific annotations in the implementation bean, although only the @WebService annotation is explicitly declared in it.
If the whole class in the implementation bean is exposed as a Web service while the methods are not explicitly exposed as Web service methods, then all the methods are processed as Web service methods. In this case, you can use the SAP-specific annotations in conjunction with methods, which are not explicitly exposed as Web service methods via the @WebMethod annotation.
Annotations configure the behavior either of a whole Web service (class level annotations), or of individual operations of a Web service (method level annotations). An annotation cannot be both a class level and a method level one.
You declare SAP-specific annotations in the Web service implementation bean. You cannot declare annotations in the SEI.
The only exception to this rule is in the usage of the standard @Oneway() annotation from the JAX-WS specification, which allows you to set a one-way message exchange pattern.
The attributes of SAP-specific design time annotations have default values.
You do not have to explicitly declare an annotation to set, or keep, the default value of its attributes. For example, by default all Web services you create are stateless. You do not have to explicitly use the corresponding annotation, @SessionHandlingDT (enableSession = false) , to keep the Web service configured as stateless.
To set the default value of an attribute, you do not need to explicitly specify this value in the annotation. For example, the default value for the level attribute of the @TransportGuaranteeDT annotation is TransportGuaranteeEnumsLevel.NONE . The meaning of @TransportGuaranteeDT() is the same as that of @TransportGuaranteeDT(level = TransportGuaranteeEnumsLevel.NONE) .
To use an annotation, you have to import the class of the respective annotation by using an import clause:
Imports the class of a design time annotation. <design_time_annotation> is the name of the respective design time annotation.
Allows you to set an authentication level, which the Web service requires from the Web service client.
Allows you to secure the data transfer between the Web service and Web service client.
Enables you to set the message exchange pattern from request-response to one-way.
Allows you to enable Web services reliable messaging for one or more Web service operations.
Allows you to configure a new URL address for the Web service on which the the service can be consumed.
Allows you to enable stateful communication for a Web service.