}
public static SOAPEnvelope getPreviousRequestEnvelope(String operationName,
int param, String groupContextId) {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
SOAPEnvelope envelope = fac.getDefaultEnvelope();
OMNamespace namespace = fac.createOMNamespace(
"http://axis2/test/namespace1", "ns1");
OMElement params = fac.createOMElement(operationName, namespace);
OMElement paramOM = fac.createOMElement("param", namespace);
paramOM.setText(Integer.toString(param));
params.addChild(paramOM);
envelope.getBody().setFirstChild(params);
if (groupContextId != null) {
OMNamespace axis2Namespace = fac.createOMNamespace(
Constants.AXIS2_NAMESPACE_URI,
Constants.AXIS2_NAMESPACE_PREFIX);
SOAPHeaderBlock soapHeaderBlock = envelope.getHeader()
.addHeaderBlock(Constants.SERVICE_GROUP_ID, axis2Namespace);
soapHeaderBlock.setText(groupContextId);
}
return envelope;