Skip to end of metadata
Go to start of metadata

Part 1: Browse ES Workplace and select ECC_CUSTOMER002QR WSDL
The tutorial is developed with SAP NetWeaver Java EE 5. To retrace this blog you need to install the SAP NetWeaver Application Server, Java EE 5 Edition and you need a access to the ES Workplace.

Part 1:

For detailled and pictured descritption see the following weblog .

1. Navigate to SDN ES Workplace homepage

2. Click the link Enterprise Service Index.

3. In the browser window insert the name of the Enterprise Service: Find Customer by Address into the field Search and click Search in Enterprise Service Index.

4. In the browser window you get the result of the search. Click the link Find Customer by Address.
5. Now you can get detailed information about the Enterprise Service.
6. To open the WSDL file click the link on Related Web Service Definition.
7. Logon with your user.

8 Copy the link to your clipboard. Otionally you may save the WSDL locally in your file system. Eclipse based NetWeaver Developer Studio NWDS can handle both ways.

Part 2: Test the WSDL

1. Open theES Workplace in your Browser and click on Web Service Navigator.

2. Enter the WSDL, click next and logon with your credentials.

3. Click on "Test" in the navigation pane.

4. You see the Request Test Page for the wsdl:portType name="CustomerSimpleByNameAndAddressQueryResponse_In"

5. Enter e.g. "Julia" into xsd:element name="FirstLineName" and click "Send" button.

6. You will receive a Response list of customers. Look carefully at the nested structure of the Web Service reuest and response. We will need it for programming in the next part.

Part 3: Creating a standalone proxy


This procedure enables you to generate a standalone Web Service proxy for consuming a Web Service using the Web Service Client wizard.

Creating a Java project


1. Choose File -> New -> Project.

2. In the pop-up window choose Java Project and click Next.
3. Enter the project name: Customer.
4. Choose Finish.

As a Result a new Java Project (for JDK 1.5) is created.

5. Create a new Web Service Client. Choose File -> New -> Other --> Web Service Client.

6. In the popup wizard enter the WSDL-URL and choose "Deploy Client" in the slider on the left (however you may choose whatever you like, it has no influence in this project type.

7. Choose "SAP NetWeaver" as Web Service Runtime instead of "Apache Axis". Otherwise you will not be able to "SAP Global datatypes", You will need them for the rather complex business data types.

8. Choose finish, a Java Proxy is generated.

Part 4: Creating a Web Service Client Application

Creating a new class


To invoke the standalone proxy you need a new class with a main method.


1. Choose File -> New -> Class.

2. In the popup-window enter the class name: MyCustomer.
3. Insert the name of the package: . You may also choose This has the advantage, that you do not need to import the generated SAP Java Proxy by import statement.
4. Select the checkbox public static void main(String[] args) to create a main method in the class.
5. Click Finish.

Creating source code


To invoke the standalone proxy you have to create instances, insert authentication and set the values for the request. The complete source code of the class is also available at the end of this chapter.


import java.util.List;



* @author
public class MyECCCustomer {
* Author: Oliver Stiefbold, NetWeaver Product Management
public static void main(String[] args) {
try {
// create service: CustomerSimpleByNameAndAddressQueryResponse_In
CustomerSimpleByNameAndAddressQueryResponseInService service = new CustomerSimpleByNameAndAddressQueryResponseInService();
// create SOAP binding
CustomerSimpleByNameAndAddressQueryResponseIn binding = service
// JAX-WS - set username and password in Binding Provider
((BindingProvider) binding).getRequestContext().put(
BindingProvider.USERNAME_PROPERTY, "user");
((BindingProvider) binding).getRequestContext().put(
BindingProvider.PASSWORD_PROPERTY, "password");
// create parameters (test.types.CustomerSimpleByNameAndAddressQueryMessageSync)
CustomerSimpleByNameAndAddressQueryMessage_SyncType parameters = new CustomerSimpleByNameAndAddressQueryMessage_SyncType();
//CustomerSimpleSelectionByNameAndAddress (test.types.CustomerSimpleSelectionByNameAndAddress)
CustomerSimpleSelectionByNameAndAddressAnonymous selection = new CustomerSimpleSelectionByNameAndAddressAnonymous();
// set selection in paramters
// CustomerName (test.types.OrganisationName)
OrganisationNameType customerName = new OrganisationNameType();
// set customername in selection

// call the service
System.out.println("Calling web service.....");
// response (test.types.CustomerSimpleByNameAndAddressResponseMessageSync)
CustomerSimpleByNameAndAddressResponseMessage_SyncType response = binding

// create some output
List<CustomerAnonymous> customers = response.getCustomer();
for (CustomerAnonymous customer : customers)

Unknown macro: {System.out.println(customer.getBasicData().getCommon().getName().getFirstLineName());} }

catch (Exception e)

Unknown macro: {e.printStackTrace(System.err);} }


Optional: Proxy Settings in NWDS

in Eclipse NWDS 

  -Dhttp.proxyHost=proxy  -Dhttp.proxyPort=8080

  • No labels