try
{
webMetaDataModifier.modifyMetaData(dep);
String contextRoot = dep.getService().getContextRoot();
AbstractDeployment deployment = createSimpleDeployment("http://jaxws-endpoint-api" + contextRoot);
MutableAttachments mutableAttachments = (MutableAttachments)deployment.getPredeterminedManagedObjects();
mutableAttachments.addAttachment(WebMetaDataModifier.PROPERTY_GENERATED_WEBAPP, Boolean.TRUE);
mutableAttachments.addAttachment("org.jboss.web.explicitDocBase", "/", String.class);
mutableAttachments.addAttachment(ClassLoaderFactory.class, new ContextClassLoaderFactory(epLoader));
mutableAttachments.addAttachment(JBossWebMetaData.class, jbwmd);
mutableAttachments.addAttachment(Module.class, ClassLoading.getModuleForClassLoader(epLoader));