dep.setRuntimeClassLoader(unit.getClassLoader());
dep.setType(getDeploymentType());
Service service = dep.getService();
WebServiceDeployment webServiceDeployment = unit.getAttachment(WebServiceDeployment.class);
if (webServiceDeployment == null)
throw new IllegalStateException("Deployment unit does not contain webServiceDeployment");
// Copy the attachments
dep.addAttachment(WebServiceDeployment.class, webServiceDeployment);
Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
while (it.hasNext())
{
WebServiceDeclaration container = it.next();
if (isWebServiceBean(container))
{