serviceMapping.addPortMapping(portMapping);
javaWsdlMapping.addServiceInterfaceMappings(serviceMapping);
String interfaceName = endpoint.getPortTypeName().getLocalPart();
ServiceEndpointInterfaceMapping seiMapping = new ServiceEndpointInterfaceMapping(javaWsdlMapping);
seiMapping.setServiceEndpointInterface(endpoint.getServiceEndpointInterfaceName());
seiMapping.setWsdlPortType(new QName(wsdl.getTargetNamespace(), interfaceName, "portTypeNS"));
seiMapping.setWsdlBinding(new QName(wsdl.getTargetNamespace(), interfaceName + "Binding", "bindingNS"));
for (OperationMetaData operation : endpoint.getOperations())
{
ServiceEndpointMethodMapping methodMapping = new ServiceEndpointMethodMapping(seiMapping);
methodMapping.setJavaMethodName(operation.getJavaName());
methodMapping.setWsdlOperation(operation.getQName().getLocalPart());
boolean isWrapped = operation.isDocumentWrapped();
methodMapping.setWrappedElement(isWrapped);
int i = 0;
for (ParameterMetaData param : operation.getParameters())
{
if (isWrapped && param.isInHeader() == false)
{
List<WrappedParameter> wrappedParameters = param.getWrappedParameters();
for (WrappedParameter wrapped : wrappedParameters)
{
String type = JavaUtils.convertJVMNameToSourceName(wrapped.getType(), endpoint.getClassLoader());
String name = wrapped.getName().getLocalPart();
buildParamMapping(methodMapping, interfaceName, operation, name, type, "IN", false, i++);
}
}
else
{
String name = param.getXmlName().getLocalPart();
String type = JavaUtils.convertJVMNameToSourceName(param.getJavaTypeName(), endpoint.getClassLoader());
buildParamMapping(methodMapping, interfaceName, operation, name, type, param.getMode().toString(), param.isInHeader(), i++);
}
}
ParameterMetaData returnParam = operation.getReturnParameter();
if (returnParam != null && ((! isWrapped) || (! returnParam.getWrappedParameters().isEmpty())))
{
String name, type;
if (isWrapped)
{
WrappedParameter wrappedParameter = returnParam.getWrappedParameters().get(0);
name = wrappedParameter.getName().getLocalPart();
type = wrappedParameter.getType();
}
else
{
name = returnParam.getXmlName().getLocalPart();
type = returnParam.getJavaTypeName();
}
type = JavaUtils.convertJVMNameToSourceName(type, endpoint.getClassLoader());
buildReturnParamMapping(methodMapping, interfaceName, operation, name, type);
}
seiMapping.addServiceEndpointMethodMapping(methodMapping);
for(FaultMetaData fmd : operation.getFaults())
{
String ns = getNamespace(fmd.getJavaType(), fmd.getXmlType().getNamespaceURI());
QName newXmlType = new QName(ns, fmd.getXmlType().getLocalPart());