If you want to list all operations from a specific WSDL 1.1 file and its input/output, you have to:
# follow the [How to read the WSDL 1.1 definitions|easywsdl:How to read a WSDL 1.1 definitions]
# write the code below (and adapt it if you want to treat those informations):
{code:lang=java|title=ExtractHelper.java}
public final class ExtractHelper {
public static void extractOperations(Definitions def) {
for (PortType portType : def.getPortTypes()) {
System.out.println("++++++++++++++++++++++");
System.out.println("PortType: " + portType.getName());
for (Operation op : portType.getOperations()) {
System.out.println("--------------------------");
System.out.println("Operation: " + op.getName());
extractIO(op.getInput());
extractIO(op.getOutput());
System.out.println("--------------------------");
}
System.out.println("++++++++++++++++++++++");
}
}
private static void extractIO(TParam param) {
String prefix = (param instanceof Input) ? "\tInput: " : "\tOutput: ";
System.out.println(prefix + param.getName());
Message message = param.findMessage();
if (message != null) {
for (Part part : message.getParts()) {
Element element = part.findElement();
if (element != null) {
System.out.println("\t\tElement: " + element.getName());
}
}
}
}
}
{code}
# follow the [How to read the WSDL 1.1 definitions|easywsdl:How to read a WSDL 1.1 definitions]
# write the code below (and adapt it if you want to treat those informations):
{code:lang=java|title=ExtractHelper.java}
public final class ExtractHelper {
public static void extractOperations(Definitions def) {
for (PortType portType : def.getPortTypes()) {
System.out.println("++++++++++++++++++++++");
System.out.println("PortType: " + portType.getName());
for (Operation op : portType.getOperations()) {
System.out.println("--------------------------");
System.out.println("Operation: " + op.getName());
extractIO(op.getInput());
extractIO(op.getOutput());
System.out.println("--------------------------");
}
System.out.println("++++++++++++++++++++++");
}
}
private static void extractIO(TParam param) {
String prefix = (param instanceof Input) ? "\tInput: " : "\tOutput: ";
System.out.println(prefix + param.getName());
Message message = param.findMessage();
if (message != null) {
for (Part part : message.getParts()) {
Element element = part.findElement();
if (element != null) {
System.out.println("\t\tElement: " + element.getName());
}
}
}
}
}
{code}