use of com.twinsoft.convertigo.beans.common.XmlQName in project convertigo by convertigo.
the class Migration7_0_0 method handleRequestableVariable.
private static void handleRequestableVariable(List<RequestableVariable> variables) {
for (RequestableVariable variable : variables) {
QName qName = XmlSchemaUtils.getSchemaDataTypeName(variable.getSchemaType());
variable.setXmlTypeAffectation(new XmlQName(qName));
}
}
use of com.twinsoft.convertigo.beans.common.XmlQName in project convertigo by convertigo.
the class ElementStep method toString.
@Override
public String toString() {
String label = "";
try {
label += " " + getLabel();
} catch (EngineException e) {
}
XmlQName xmlQName = getXmlElementRefAffectation();
xmlQName = xmlQName.isEmpty() ? getXmlComplexTypeAffectation() : xmlQName;
return "<" + getStepNodeName() + ">" + label + " " + xmlQName.getQName();
}
use of com.twinsoft.convertigo.beans.common.XmlQName in project convertigo by convertigo.
the class XmlHttpTransaction method writeSchemaToFile.
/*
private void dumpByteArray(byte[] data)
{
byte c[] = new byte[1];
for (int j=0; j <data.length; j+= 80) {
String displayH ="";
String displayC ="";
for (int i=0; i < 80; i++) {
if ((i+j) < data.length) {
byte b = data[i+j];
if (b < 16) {
displayH += "0" + Integer.toHexString(b) + " ";
} else {
displayH += Integer.toHexString(b) + " ";;
}
c[0] = b;
displayC += new String(c) + " ";
}
}
Engine.logBeans.debug(displayH);
Engine.logBeans.debug(displayC);
}
}
*/
@Override
public void writeSchemaToFile(String xsdTypes) {
XmlQName xmlQName = getXmlElementRefAffectation();
boolean bRPC = getResponseElementQName().indexOf(";") != -1;
if (!xmlQName.isEmpty() || bRPC) {
try {
XmlSchema xmlSchema = createSchema();
String ns = getElementRefAffectation().getNamespaceURI();
XmlSchemaCollection collection = Engine.theApp.schemaManager.getSchemasForProject(getProject().getName());
XmlSchema referenced = collection.schemaForNamespace(ns);
if (referenced != null) {
if (ns.equals(xmlSchema.getTargetNamespace())) {
XmlSchemaInclude xmlSchemaInclude = new XmlSchemaInclude();
xmlSchemaInclude.setSchemaLocation(referenced.getSourceURI());
xmlSchemaInclude.setSchema(referenced);
XmlSchemaUtils.add(xmlSchema, xmlSchemaInclude);
} else {
XmlSchemaImport xmlSchemaImport = new XmlSchemaImport();
xmlSchemaImport.setNamespace(referenced.getTargetNamespace());
xmlSchemaImport.setSchemaLocation(referenced.getSourceURI());
xmlSchemaImport.setSchema(referenced);
XmlSchemaUtils.add(xmlSchema, xmlSchemaImport);
}
}
new File(getSchemaFileDirPath()).mkdirs();
SchemaUtils.saveSchema(getSchemaFilePath(), xmlSchema);
} catch (Exception e) {
e.printStackTrace();
}
} else {
super.writeSchemaToFile(xsdTypes);
}
}
use of com.twinsoft.convertigo.beans.common.XmlQName in project convertigo by convertigo.
the class XmlHttpTransaction method addSchemaResponseDataType.
@Override
protected XmlSchemaComplexType addSchemaResponseDataType(XmlSchema xmlSchema) {
XmlSchemaComplexType xmlSchemaComplexType = super.addSchemaResponseDataType(xmlSchema);
XmlQName xmlQName = getXmlElementRefAffectation();
boolean bRPC = getResponseElementQName().indexOf(";") != -1;
if (!xmlQName.isEmpty() || bRPC) {
XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) xmlSchemaComplexType.getParticle();
if (xmlSchemaSequence == null)
xmlSchemaSequence = new XmlSchemaSequence();
XmlSchemaElement xmlSchemaElement = new XmlSchemaElement();
if (bRPC) {
// response is based on an element defined with a type
// operationResponse element name; element name; element type
String reqn = getResponseElementQName();
String opName = getName() + "Response", eltName = "response", eltType = "{" + Constants.URI_2001_SCHEMA_XSD + "}string";
QName typeName = Constants.XSD_STRING;
int i, j, k, z;
if ((i = reqn.indexOf(";")) != -1) {
opName = reqn.substring(0, i);
if ((j = reqn.indexOf(";", i + 1)) != -1) {
eltName = reqn.substring(i + 1, j);
eltType = reqn.substring(j + 1);
if ((k = eltType.indexOf("{")) != -1) {
if ((z = eltType.indexOf("}")) != -1) {
String ns = eltType.substring(k + 1, z);
String local = eltType.substring(z + 1);
typeName = new QName(ns, local);
}
}
}
}
xmlSchemaElement.setName(opName);
XmlSchemaComplexType cType = new XmlSchemaComplexType(xmlSchema);
XmlSchemaSequence seq = new XmlSchemaSequence();
XmlSchemaElement elem = new XmlSchemaElement();
elem.setName(eltName);
elem.setSchemaTypeName(typeName);
seq.getItems().add(elem);
cType.setParticle(seq);
xmlSchemaElement.setSchemaType(cType);
} else {
xmlSchemaElement.setName("");
xmlSchemaElement.setRefName(xmlQName.getQName());
xmlSchemaElement.setMinOccurs(0);
}
if (isErrorOnSoapFault()) {
xmlSchemaElement.setMinOccurs(0);
}
xmlSchemaSequence.getItems().add(xmlSchemaElement);
xmlSchemaComplexType.setParticle(xmlSchemaSequence);
}
return xmlSchemaComplexType;
}
use of com.twinsoft.convertigo.beans.common.XmlQName in project convertigo by convertigo.
the class XMLComplexStep method toString.
@Override
public String toString() {
XmlQName xmlQName = getXmlElementRefAffectation();
xmlQName = xmlQName.isEmpty() ? getXmlComplexTypeAffectation() : xmlQName;
String tag = "<" + getStepNodeName() + "> " + xmlQName.getQName();
return tag;
}
Aggregations