[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.webtools] Re: Serializing Documenation elements
|
Thanks for the reply Gabriel.
That's the piece I have in my code to add a documentation element to the
wsdlelement.
public static void createDocElement(Object definitionObj,
Object wsdlElementObj, String elementName, String attrib,
String val) {
if (definitionObj instanceof Definition) {
Definition definition = (Definition) definitionObj;
if (wsdlElementObj instanceof ExtensibleElement) {
WSDLElement wsdlElement = (WSDLElement) wsdlElementObj;
Attr attr =
definition.getDocument().createAttribute("ProcessInfo");
attr.setValue(elementName + ":::" + val);
Element documentationElement =
wsdlElement.getDocumentationElement();
if (documentationElement == null) {
documentationElement =
definition.getDocument()
.createElement("DocumentationElement");
}
documentationElement.setAttributeNode(attr);
wsdlElement.setDocumentationElement(documentationElement);
try {
definition.eResource().save(null);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Document##"
+ wsdlElement.getDocumentationElement());
}
}
However, the wsdl fragment for which i run the code against still looks
like this
<wsdl:portType name="RTestW">
<wsdl:operation name="NewOperation">
<wsdl:input message="tns:NewOperationRequest"/>
<wsdl:output message="tns:NewOperationResponse"/>
</wsdl:operation>
</wsdl:portType>
and I would expect
<wsdl:portType name="RTestW">
<wsdl:documentation>ProcessInfo=elementName:::value</wsdl:documentation>
<wsdl:operation name="NewOperation">
<wsdl:documentation>ProcessInfo=elementName:::value</wsdl:documentation>
<wsdl:input message="tns:NewOperationRequest"/>
<wsdl:output message="tns:NewOperationResponse"/>
</wsdl:operation>
</wsdl:portType>
Gabriel Indik wrote:
Ravi,
To better understand the problem, could you please paste a small code
fragment/snippet that shows the API calls you are making to incorporate
the documentation elements as well as the document serialization?