Creating Web Service Proxies
Use
You can create two types of proxies in the SAP NetWeaver Developer Studio:
-
Deployable proxy
A Web service client, which can and has to be deployed on the application server to be operational. A deployable proxy is consumed from an Enterprise Java Bean or a servlet and is created and configured by the responsible managing container of the application server. Deployable proxies are used through the Java EE 5 injection mechanism. You generate a deployable proxy in an Enterprise Java Bean project, or in a Dynamic Web Project in the Developer Studio.
-
Standalone proxy
A Web service client, which can be instantiated by application code. The application code can run in a standalone program. The standalone proxy can be used mainly for test purposes from within the SAP NetWeaver Developer Studio. You generate a standalone proxy in a Java project. The standalone proxies are restricted to synchronous services only. If you want to use asynchronous or WS-RM enabled services, you have to create a deployable proxy.
Basically, the procedure of creation of standalone and deployable proxies differs only in the target project in which you create the proxy. The procedure steps are the same for both proxy types.
You generate proxies using a WSDL document as a basis. You can use a WSDL document located in the Services Registry, the Enterprise Services Repository, or on a file system, or at a remote location (such as a URL). Some WSDL documents, such as those for Service Interfaces (SI) modeled in the ESR may not contain service, port, and/or binding information. When the framework generates a proxy, it updates the WSDL document with the necessary information. By default, when the WSDL document does not contain binding information, the Web service framework updates the WSDL and sets the binding to SOAP over HTTP. You cannot change this default setting.
The Web service client and the Web service proxy must be in the same EAR and in the same module (EJB or Dynamic Web module).
More information: Collision Resolution and Global Customizations
Prerequisites
-
Generating a deployable proxy
You can generate deployable proxies in an Enterprise Java Bean project, or in a Dynamic Web Project. Depending on your scenario, the respective project has to be available in the SAP NetWeaver Developer Studio:
-
An EJB project is created. The EJB module in the project is version 3.0. More information: Creating EJB 3.0 Projects in the Developer Studio
-
A Dynamic Web Project is created. The Dynamic Web Module in the project is version 2.5. More information: Creating Dynamic Web Projects
-
-
Generating a standalone proxy
-
A Java project is created
-
-
An enterprise application project is created. The Enterprise Java Bean project or the Dynamic Web project is added to the enterprise application project.
-
The AS Java settings are configured in .
-
The application server and Web service runtime are set in the SAP NetWeaver Developer Studio from . In the Server field, choose SAP Server , and in the Web service runtime , choose SAP NetWeaver .
-
If you want to use the WSDL of a Service Interface modeled in the ESR, open the Enterprise Service Browser.
-
If you want to use customization files, you should have them available in advance.
Procedure
-
Import the WSDL document, which you want to use to generate a proxy. More information: Importing WSDL Documents in the SAP NetWeaver Developer Studio .
-
In the Project Explorer of the Java EE perspective, choose the WSDL document, and then from the context menu choose .
-
On the Web Services screen, proceed as follows:
-
Move the slider to the Develop Client position.
In this case, the Web service framework only generates the relevant artifacts (it does not deploy them on the application server).
-
Under Configuration , choose Client EAR Project, and make sure that the correct service EAR project is selected in the Client project field.
-
Choose Next .
-
-
If the imported WSDL document does not contain a service endpoint, the Update WSDL window opens.
-
To update the WSDL document with a service endpoint or binding, choose Update WSDL . At a later stage, the system overwrites the WSDL document using the values that you provide.
-
To preserve the original WSDL document, choose Do not update WSDL . At a later stage, the system creates a new WSDL document using the values that you provide.
-
-
On the Client GenerationConfiguration screen, proceed as follows:
-
If necessary, specify the output folder in which you want the Java artifacts to be generated.
-
Choose the way in which you want to resolve the possible collisions in the WSDL to Java mapping during the conversion of the WSDL document to Java artifacts.
The table below provides information about the separate options and their meaning:
-
|
Option |
Meaning |
|---|---|
|
Resolve collisions interactively |
The Web service framework resolves collisions based on input from you. More information: Using Interactive Conflict Resolution |
|
Resolve collisions automatically |
The Web service framework resolves collisions compliant with a predefined algorithm. More information: Using Automatic Conflict Resolution |
|
Specify JAX-WS customization files |
You can use JAX-WS 2.0-compliant customization files prepared in advance to apply customizations. This option is available only when the WSDL document is imported in the SAP NetWeaver Developer Studio. More information: Using JAX-WS Customization Files |
|
Apply WSDL without customizations |
The Web service framework processes the WSDL document as it is. If the WSDL document itself contains customizations in that, for example, it was manually edited, the framework will process these customizations. More information: Using No Customizations |
Depending on the customizations level you choose on this screen, the wizard provides different options on the subsequent screens.
Result
-
The framework generates the service endpoint interface, reference classes and the service class in the output folder.
-
The class path is updated with additional JAR files.
Next Steps
-
Create the Web service client application. More information: Creating Web Service Client Applications
-
Deploy the Web service client on the application server (for deployable proxies only). More information: Building, Publishing and Removing Published Java EE Applications .
-
Configure the Web service client in the SAP NetWeaver Administrator. More information: Configuring Web Services and Web Service Clients in the SAP NetWeaver Administrator .

