use of org.apache.axis2.transport.testkit.message.AxisMessage in project wso2-axis2-transports by wso2.
the class XMPPSender method getParameterListForOperation.
/**
* Retrieves list of parameter names & their type for a given operation
* @param operation
*/
private static String getParameterListForOperation(AxisOperation operation) {
// Logic copied from BuilderUtil.buildsoapMessage(...)
StringBuffer paramList = new StringBuffer();
AxisMessage axisMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
XmlSchemaElement xmlSchemaElement = axisMessage.getSchemaElement();
if (xmlSchemaElement != null) {
XmlSchemaType schemaType = xmlSchemaElement.getSchemaType();
if (schemaType instanceof XmlSchemaComplexType) {
XmlSchemaComplexType complexType = ((XmlSchemaComplexType) schemaType);
XmlSchemaParticle particle = complexType.getParticle();
if (particle instanceof XmlSchemaSequence || particle instanceof XmlSchemaAll) {
XmlSchemaGroupBase xmlSchemaGroupBase = (XmlSchemaGroupBase) particle;
Iterator iterator = xmlSchemaGroupBase.getItems().getIterator();
while (iterator.hasNext()) {
XmlSchemaElement innerElement = (XmlSchemaElement) iterator.next();
QName qName = innerElement.getQName();
if (qName == null && innerElement.getSchemaTypeName().equals(org.apache.ws.commons.schema.constants.Constants.XSD_ANYTYPE)) {
break;
}
long minOccurs = innerElement.getMinOccurs();
boolean nillable = innerElement.isNillable();
String name = qName != null ? qName.getLocalPart() : innerElement.getName();
String type = innerElement.getSchemaTypeName().toString();
paramList.append("," + type + " " + name);
}
}
}
}
// remove first ","
String list = paramList.toString();
return list.replaceFirst(",", "");
}
use of org.apache.axis2.transport.testkit.message.AxisMessage in project wso2-axis2-transports by wso2.
the class AxisAsyncEndpoint method receive.
void receive(MessageContext messageCtx) throws AxisFault {
log.debug("MessageReceiver has been invoked");
final AxisMessage messageData;
try {
Assert.assertTrue(messageCtx.isServerSide());
TransportInDescription transportIn = messageCtx.getTransportIn();
Assert.assertNotNull("transportIn not set on message context", transportIn);
Assert.assertEquals(context.getTransportName(), transportIn.getName());
Assert.assertEquals(context.getTransportName(), messageCtx.getIncomingTransportName());
for (MessageContextValidator validator : validators) {
validator.validate(messageCtx, false);
}
messageData = new AxisMessage(messageCtx);
} catch (Throwable ex) {
support.putException(ex);
return;
}
support.putMessage(null, messageData);
}
Aggregations