
This procedure enables you to create inside-out Web services from Enterprise JavaBean 3.0 (EJB).
When creating an inside-out Web service, you can use a service endpoint interface (SEI) to expose some or all methods of the implementation bean as a Web service.
More information: Service Endpoint Interface .
You have created an EJB project 3.0. More information: Creating EJB 3.0 Projects in the Developer Studio .
You have created an Enterprise Application Project and the EJB project 3.0 is added to it.
You have created an EJB session bean which you want to expose as a Web service and all its business methods are implemented.
If you want to use an existing Java interface as an SEI, it has to be available in the project.
You have configured the AS Java settings in .
More information: Configuring the Application Server in the Developer Studio .
You have configured the application server and Web service runtime in the SAP NetWeaver Developer Studio in . In the Server field, choose SAPServer , and in the Web serviceruntime field, choose SAP NetWeaver .
Optionally, you can configure resource management settings of the SAP NetWeaver Developer Studio.
More Information: Configuring Resource Management Settings .
In the Package Explorer of the Java EE perspective, open the project and select the EJB you created.
From the context menu, choose .
The Web Services wizard opens.
Move the slider to the Develop service position.
From Configuration , select SAP server and SAP NetWeaver Web service runtime.
It is essential that you configure SAP server and runtime settings in prior to creating a Web service. For more information, see the prerequisites section.
Make sure that the service project and service EAR project are set correctly.
To set the name of the service EAR project, proceed as follows:
Under Configuration , choose Service EAR project.
The Specify Service Project Settings dialog box opens.
In the Service EAR project field, choose the correct service EAR project, and then choose OK .
If you have added the EJB project to a service EAR project, the name of the EJB project appears in the Service EAR project field.
Choose Next .
When you want to use a SEI you have to configure it. For more information, see Choosing a Service Endpoint Interface Options .
Depending on the settings, which you provided in the window, the tools prompt you to confirm creation of resources or check out of updated existing resources.
Choose Finish .
The Developer Studio adds Java EE 5 annotations for Web services to the implementation bean, as well as to the service endpoint interface, if applicable.
You can use annotations to configure the Web service.
More information: Configuring Web Services at Design Time .
Build and deploy the Enterprise Application Project of the Web service on the SAP NetWeaver Application Server.
More Information: Building, Publishing and Removing Published Java EE Applications ..
You can view the WSDL by entering the WSDL URL in a Web browser.
The WSDL URL comprises:
http://<host>:<http _ port>/<Service _ Name>/<Bean _ Name>?wsdl
A Web service whose EJB name is MyTestBean , has the following WSDL URL:
http://<host>:<http port>/MyTestService/MyTestBean?wsdl
As a next step, you can generate a proxy for the Web service client and implement the client application.
More information:
More Information
More information about the mapping of the Java types to WSDL 1.1 documents or XML schemas is available in the following standard specifications:
For Java WSDL mapping, see the JAX-WS 2.0 specification, Chapter 3: Java to WSDL 1.1 Mapping: http://jcp.org/aboutJava/communityprocess/pfd/jsr224/index.html
For Java Schema mapping, see the JAXB 2.0 specification, Chapter 8: Java Types to XML: http://jcp.org/aboutJava/communityprocess/final/jsr222/index.html