protected void addReferencedTypeDefinitions( WebMethod webMethod, LinkedList<Element> contextStack) { contextStack.push(webMethod); try { WebResult result = webMethod.getWebResult(); this.jaxbModule .getJaxbContext() .addReferencedTypeDefinitions( result.isAdapted() ? result.getAdapterType() : result.getType(), contextStack); for (WebParam webParam : webMethod.getWebParameters()) { this.jaxbModule .getJaxbContext() .addReferencedTypeDefinitions( webParam.isAdapted() ? webParam.getAdapterType() : webParam.getType(), contextStack); } for (WebFault webFault : webMethod.getWebFaults()) { addReferencedTypeDefinitions(webFault, contextStack); } } finally { contextStack.pop(); } }