+49 228 5552576-0


Parsing WSDL with Java

The Membrane SOA Model makes it easy to parse a WSDL. See listing 1 for an example. It parses a WSDL document and prints out the interface of the service with its operations.

package sample.wsdl;

import com.predic8.wsdl.*;

public class ListWSDLOperations {

  public static void main(String[] args) {
    WSDLParser parser = new WSDLParser();

    Definitions defs = parser

    for (PortType pt : defs.getPortTypes()) {
      for (Operation op : pt.getOperations()) {
        System.out.println(" -" + op.getName());
Listing 1: ListWSDLOperations.java

In listing 2 you can see the output.

Listing 2: The List of the operation in the WSDL Document