boolean isDoclit = binding.isDocLit();
// Message message = portDefinitions.message().name(method.getOperation().getName().getLocalPart());
Message message = portDefinitions.message().name(method.getRequestMessageName());
extension.addInputMessageExtension(message, method);
com.sun.xml.internal.ws.wsdl.writer.document.Part part;
JAXBRIContext jaxbContext = model.getJAXBContext();
boolean unwrappable = true;
for (ParameterImpl param : method.getRequestParameters()) {
if (isDoclit) {
if (isHeaderParameter(param))
unwrappable = false;
if (param.isWrapperStyle()) {
part = message.part().name(PARAMETERS);
part.element(param.getName());
} else {
part = message.part().name(param.getPartName());
part.element(param.getName());
}
} else {
if (param.isWrapperStyle()) {
for (ParameterImpl childParam : ((WrapperParameter)param).getWrapperChildren()) {
part = message.part().name(childParam.getPartName());
part.type(jaxbContext.getTypeName(childParam.getBridge().getTypeReference()));
}
} else {
part = message.part().name(param.getPartName());
part.element(param.getName());
}
}
}
if (method.getMEP() != MEP.ONE_WAY) {
// message = portDefinitions.message().name(method.getOperation().getName().getLocalPart()+RESPONSE);
message = portDefinitions.message().name(method.getResponseMessageName());
extension.addOutputMessageExtension(message, method);
if (unwrappable) {
for (ParameterImpl param : method.getResponseParameters()) {
if (isHeaderParameter(param))
unwrappable = false;
}
}
for (ParameterImpl param : method.getResponseParameters()) {
if (isDoclit) {
if (param.isWrapperStyle()) {
// if its not really wrapper style dont use the same name as input message
if (unwrappable)
part = message.part().name(RESULT);
else
part = message.part().name(UNWRAPPABLE_RESULT);
part.element(param.getName());
} else {
part = message.part().name(param.getPartName());
part.element(param.getName());
}
} else {
if (param.isWrapperStyle()) {
for (ParameterImpl childParam : ((WrapperParameter)param).getWrapperChildren()) {
part = message.part().name(childParam.getPartName());
part.type(jaxbContext.getTypeName(childParam.getBridge().getTypeReference()));
}
} else {
part = message.part().name(param.getPartName());
part.element(param.getName());
}