Closed theirish81 closed 7 years ago
Now I realize I'm doing something terribly wrong, sorry for that.
Hi, How did you fix this issue?
Now I realize I'm doing something terribly wrong, sorry for that.
I want to print the input message, I get the same error, and how to fix this issue?
by the way, I write the code like your code:
SoapContext context = SoapContext.builder()
.alwaysBuildHeaders(true)
.buildOptional(true)
.exampleContent(true)
.typeComments(true)
.build();
Wsdl wsdl = Wsdl.parse("http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl");
List<QName> bindings = wsdl.getBindings();
for (QName binding : bindings) {
SoapBuilder builder = wsdl.getBuilder(binding, context);
List<SoapOperation> operations = builder.getOperations();
for (SoapOperation operation : operations) {
String inputMessage = builder.buildInputMessage(operation, context);
System.out.println("[binding] = " + binding.getLocalPart() + " ,[inputMessage] = " + inputMessage);
}
}
I use this way to temporary solve this error
SoapContext context = SoapContext.builder()
.alwaysBuildHeaders(true)
.buildOptional(true)
.exampleContent(false)
.typeComments(true)
.build();
Wsdl wsdl = Wsdl.parse("http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl");
List<QName> bindings = wsdl.getBindings();
System.out.println("bindings = " + bindings);
for (QName binding : bindings) {
SoapBuilder builder = wsdl.getBuilder(binding, context);
List<SoapOperation> operations = builder.getOperations();
System.out.println("operations = " + operations);
for (SoapOperation operation : operations) {
try {
String inputMessage = builder.buildInputMessage(operation, context);
System.err.println("【binding】= " + binding.getLocalPart() + "【operation】= " + operation.getOperationName() + "【inputMessage】= \n" + inputMessage);
} catch (SoapBuilderException e) {
// ignore
}
}
}
Hello, so what I'm trying to do is browsing through a WSDL file and print all input messages.
With some WSDLs, it just works, but for some others I get:
Am I doing something terribly wrong or is it a bug?