Annotating the service endpoint interface with @SOAPBinding

This recipe explains how to annotate the SEI with the @SOAPBinding annotation in order to support various transport styles. We will also show how to configure the @SOAPBinding annotation with JDeveloper.

Getting ready

In this recipe, we will configure the web service from the Annotating the service endpoint interface with @WebService recipe in this chapter.

How to do it…

The steps involved in annotating a web service with @SOAPBinding from JDeveloper are as follows:

  1. Right-click on the web service class (org.packt.cc.business.CCGateSvc) and select the Properties… option in JDeveloper to open the Java Web Service Editor.
  2. Select the Message Format node to configure the transport style and binding.
    How to do it…
  3. Select the RPC/Literal option and click on the OK button.

How it works…

The default SOAP message binding and style combination is document/wrapped, and as such it does not need the @SOAPBinding annotation for the web service.

When setting other binding and style combinations for the web service, we get the web service with the @SOAPBinding annotation. For RPC/literal binding style, we get the following annotation generated in CCGatePortType.java:

@SOAPBinding(style = SOAPBinding.Style.RPC)

Note

We have described the @SOAPBinding annotation in detail in the Creating LITERAL and ENCODED web services recipe in Chapter 8, Exposing Java Code as a SOAP Service.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset