public OMElement setupGetMetadataRequest(String dialect,
String identifier) throws AxisFault {
// Attempt to engage MEX module
/* try{
super.engageModule("metadataExchange");
}
catch (Exception e){
throw new AxisFault ("Unable to proceed with GetMetadata Request!", e);
} */
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(DRConstants.SPEC.NS_URI,
DRConstants.SPEC.NS_PREFIX);
OMElement method = fac.createOMElement(DRConstants.SPEC.GET_METADATA, omNs);
if (dialect != null) {
OMElement dialectElem = fac.createOMElement(DRConstants.SPEC.DIALECT, omNs);
dialectElem.setText(dialect);
method.addChild(dialectElem);
}
// create Identifier element
if (identifier != null) {
OMElement id_Elem = fac.createOMElement(DRConstants.SPEC.IDENTIFIER, omNs);
id_Elem.setText(identifier);
method.addChild(id_Elem);
}
return method;
}
Builds OMElement that makes up of SOAP body. |