本文整理汇总了Java中org.apache.axis.message.MessageElement类的典型用法代码示例。如果您正苦于以下问题:Java MessageElement类的具体用法?Java MessageElement怎么用?Java MessageElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageElement类属于org.apache.axis.message包,在下文中一共展示了MessageElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMessageElementArray
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
public final static MessageElement[] createMessageElementArray(final ScribeObject cADbject) throws Exception {
logger.debug("----Inside createMessageElementArray size of input Object:" + cADbject.getXmlContent().size());
MessageElement[] messageElementArray = null;
/* Start the index from 0 */
int index = 0;
/* Create array with number of elements count from ScribeObject */
messageElementArray = new MessageElement[cADbject.getXmlContent().size()];
/* Iterate on the Element list and create SOAP object */
for (final Element element : cADbject.getXmlContent()) {
messageElementArray[index] = createMessageElement(element.getNodeName(), element.getTextContent());
index++;
}
logger.debug("----Inside createMessageElementArray size of Sales Force Object:" + messageElementArray.length);
return messageElementArray;
}
示例2: createElementArray
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
public final static Element[] createElementArray(final MessageElement[] messageElementArray) throws Exception {
logger.debug("----Inside createElementArray");
final Element[] elementArray = new Element[messageElementArray.length];
final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
docFactory.setNamespaceAware(true);
docFactory.setValidating(false);
final DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
/* Create new document */
final Document document = docBuilder.newDocument();
/* Start the index from 0 */
int index = 0;
/* Iterate over messageElementArray and create Element array */
for (final MessageElement messsageElement : messageElementArray) {
final Element randomElement = document.createElement(messsageElement.getNodeName());
randomElement.setNodeValue(messsageElement.getNodeValue());
elementArray[index] = randomElement;
index++;
}
return elementArray;
}
示例3: run
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
public void run() throws Exception {
FileWriter writer = null;
this.factoryClient = new WorkflowFactoryServiceClient(url);
WMSInputType input = createInput(null, "AnnualDemo.bpel");
WMSOutputType output = this.factoryClient.createWorkflow(input);
this.epr = output.getWorkflowEPR();
writer = new FileWriter("workflow_" + input.getWorkflowName() + "_epr");
writer.write(
ObjectSerializer.toString(epr, new QName("", "WMS_EPR")));
this.serviceClient = new WorkflowServiceImplClient(this.epr);
StartInputType startInput = new StartInputType();
WorkflowInputType inputArgs = new WorkflowInputType();
FileInputStream in = new FileInputStream("input11.xml");
Element e2 = XmlUtils.newDocument(in).getDocumentElement();
System.out.println(XmlUtils.toString(e2));
MessageElement anyContent = AnyHelper.toAny(new MessageElement(e2));
inputArgs.set_any(new MessageElement[] {anyContent});
startInput.setInputArgs(inputArgs);
WorkflowStatusType status = this.serviceClient.start(startInput);
//status = this.serviceClient.getStatus();
System.out.println(status.getValue());
}
示例4: run1
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
public void run1() throws Exception {
FileWriter writer = null;
this.factoryClient = new WorkflowFactoryServiceClient(url);
WMSInputType input = createInput1(null, "geWorkBench.bpel");
WMSOutputType output = this.factoryClient.createWorkflow(input);
this.epr = output.getWorkflowEPR();
writer = new FileWriter("workflow_" + input.getWorkflowName() + "_epr");
writer.write(
ObjectSerializer.toString(epr, new QName("", "WMS_EPR")));
this.serviceClient = new WorkflowServiceImplClient(this.epr);
StartInputType startInput = new StartInputType();
WorkflowInputType inputArgs = new WorkflowInputType();
FileInputStream in = new FileInputStream("input10.xml");
Element e2 = XmlUtils.newDocument(in).getDocumentElement();
System.out.println(XmlUtils.toString(e2));
MessageElement anyContent = AnyHelper.toAny(new MessageElement(e2));
inputArgs.set_any(new MessageElement[] {anyContent});
startInput.setInputArgs(inputArgs);
WorkflowStatusType status = this.serviceClient.start(startInput);
//status = this.serviceClient.getStatus();
System.out.println(status.getValue());
}
示例5: run2
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
public void run2() throws Exception {
FileWriter writer = null;
this.factoryClient = new WorkflowFactoryServiceClient(url);
WMSInputType input = createInput2(null, "genepattern.bpel");
WMSOutputType output = this.factoryClient.createWorkflow(input);
this.epr = output.getWorkflowEPR();
writer = new FileWriter("workflow_" + input.getWorkflowName() + "_epr");
writer.write(
ObjectSerializer.toString(epr, new QName("", "WMS_EPR")));
this.serviceClient = new WorkflowServiceImplClient(this.epr);
StartInputType startInput = new StartInputType();
WorkflowInputType inputArgs = new WorkflowInputType();
FileInputStream in = new FileInputStream("input3.xml");
Element e2 = XmlUtils.newDocument(in).getDocumentElement();
System.out.println(XmlUtils.toString(e2));
MessageElement anyContent = AnyHelper.toAny(new MessageElement(e2));
inputArgs.set_any(new MessageElement[] {anyContent});
startInput.setInputArgs(inputArgs);
WorkflowStatusType status = this.serviceClient.start(startInput);
//status = this.serviceClient.getStatus();
System.out.println(status.getValue());
}
示例6: run3
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
public void run3() throws Exception {
FileWriter writer = null;
this.factoryClient = new WorkflowFactoryServiceClient(url);
WMSInputType input = createInput3(null, "PreProp.bpel");
WMSOutputType output = this.factoryClient.createWorkflow(input);
this.epr = output.getWorkflowEPR();
writer = new FileWriter("workflow_" + input.getWorkflowName() + "_epr");
writer.write(
ObjectSerializer.toString(epr, new QName("", "WMS_EPR")));
this.serviceClient = new WorkflowServiceImplClient(this.epr);
StartInputType startInput = new StartInputType();
WorkflowInputType inputArgs = new WorkflowInputType();
FileInputStream in = new FileInputStream("input6.xml");
Element e2 = XmlUtils.newDocument(in).getDocumentElement();
System.out.println(XmlUtils.toString(e2));
MessageElement anyContent = AnyHelper.toAny(new MessageElement(e2));
inputArgs.set_any(new MessageElement[] {anyContent});
startInput.setInputArgs(inputArgs);
WorkflowStatusType status = this.serviceClient.start(startInput);
//status = this.serviceClient.getStatus();
System.out.println(status.getValue());
}
示例7: getCachedResults
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
private CQLQueryResultsType getCachedResults()
throws Exception
{
File[] files = dataDir.listFiles(new FileFilter() {
public boolean accept(File file) {
return file.isFile();
}
});
CQLQueryResultType[] results = new CQLQueryResultType[files.length];
for (int i = 0; i < files.length; i++) {
System.out.println("RPDataImpl reading file: " + files[i]);
String xml = Utils.fileToStringBuffer(files[i]).toString();
Document doc = XMLUtils.newDocument(new InputSource(new StringReader(xml)));
MessageElement msg = new MessageElement(doc.getDocumentElement());
msg.setType(new QName("rproteomics.cabig.duke.edu/1/scanFeatures", "scanFeatures"));
results[i] = new CQLQueryResultType(new MessageElement[]{msg});
}
return new CQLQueryResultsType(results);
}
示例8: checkForObjectResults
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
private void checkForObjectResults(CQLQueryResults results) throws Exception {
CQLObjectResult[] objResults = results.getObjectResult();
if (objResults == null || objResults.length == 0) {
fail("No object results returned");
}
for (int i = 0; i < objResults.length; i++) {
MessageElement[] elements = objResults[i].get_any();
if (elements == null) {
fail("Object result returned with null object contents");
}
if (elements.length != 1) {
fail("Object result returned with number of object contents != 1 ("
+ elements.length + " found!)");
}
}
}
示例9: verifyResults
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
private void verifyResults(List<SOAPElement> results) {
LOG.debug("Verifying test results");
LOG.debug("Loading gold results from " + getGoldFilenname());
DCQLQueryResultsCollection goldResults = loadGoldDcqlResults();
// convert the list of elements into DCQL results
DCQLQueryResultsCollection testResults = new DCQLQueryResultsCollection();
DCQLResult testResult = new DCQLResult();
testResult.setTargetServiceURL("http://fake.service");
CQLQueryResults cqlResults = new CQLQueryResults();
// what's the target classname supposed to be?
String targetName = deserializeQuery().getTargetObject().getName();
LOG.debug("Setting test results target classname to " + targetName);
cqlResults.setTargetClassname(targetName);
CQLObjectResult[] objectResults = new CQLObjectResult[results.size()];
for (int i = 0; i < results.size(); i++) {
CQLObjectResult obj = new CQLObjectResult();
obj.set_any(new MessageElement[] {new MessageElement(results.get(i))});
objectResults[i] = obj;
}
cqlResults.setObjectResult(objectResults);
testResult.setCQLQueryResultCollection(cqlResults);
testResults.setDCQLResult(new DCQLResult[] {testResult});
QueryResultsVerifier.verifyDcqlResults(testResults, goldResults);
}
示例10: getAuthorizationExtensionData
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
@Override
public ExtensionType getAuthorizationExtensionData() throws Exception {
CSMAuthorizationDescription desc = getCsmAuthorizationPanel().getAuthorization();
ExtensionType extension = new ExtensionType();
extension.setExtensionType(ExtensionsLoader.AUTHORIZATION_EXTENSION);
extension.setName(getAuthorizationExtensionDescriptionType().getName());
StringWriter sw = new StringWriter();
Utils.serializeObject(desc, desc.getTypeDesc().getXmlType(), sw);
Document doc = XMLUtilities.stringToDocument(sw.toString());
Element el = (Element)doc.getRootElement().detach();
MessageElement elem = AxisJdomUtils.fromElement(el);
ExtensionTypeExtensionData data = new ExtensionTypeExtensionData();
data.set_any(new MessageElement[] {elem});
extension.setExtensionData(data);
return extension;
}
示例11: storeExtensionDataElement
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
private void storeExtensionDataElement(ExtensionTypeExtensionData extensionData, Element elem) throws Exception {
MessageElement[] anys = extensionData.get_any();
for (int i = 0; (anys != null) && (i < anys.length); i++) {
if (anys[i].getQName().equals(Data.getTypeDesc().getXmlType())) {
// remove the old extension data
anys = (MessageElement[]) Utils.removeFromArray(anys, anys[i]);
break;
}
}
// create a message element from the JDom element
MessageElement data = null;
try {
data = AxisJdomUtils.fromElement(elem);
} catch (JDOMException ex) {
throw new Exception(
"Error converting extension data to Axis message element: " + ex.getMessage(), ex);
}
anys = (MessageElement[]) Utils.appendToArray(anys, data);
extensionData.set_any(anys);
}
示例12: serializeObject
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
private static String serializeObject(Object obj, MessageContext context, QName targetQName) throws Exception {
StringWriter writer = new StringWriter();
// derive a message element for the object
MessageElement element = (MessageElement) ObjectSerializer.toSOAPElement(obj, targetQName);
// create a serialization context to use the new message context
SerializationContext serializationContext = new SerializationContext(writer, context) {
public void serialize(QName elemQName, Attributes attributes, Object value)
throws IOException {
serialize(elemQName, attributes, value, null, Boolean.FALSE, null);
}
};
serializationContext.setPretty(true);
// output the message element through the serialization context
element.output(serializationContext);
writer.write("\n");
writer.flush();
return writer.getBuffer().toString();
}
示例13: serializeAttibuteResult
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
private String serializeAttibuteResult(CQLAttributeResult result) throws Exception {
StringWriter writer = new StringWriter();
// derive a message element for the object
MessageElement element = (MessageElement) ObjectSerializer.toSOAPElement(result, CQL2_ATTRIBUTE_RESULT_QNAME);
// create a serialization context to use the new message context
SerializationContext serializationContext = new SerializationContext(writer, getMessageContext()) {
public void serialize(QName elemQName, Attributes attributes, Object value)
throws IOException {
serialize(elemQName, attributes, value, null, Boolean.FALSE, null);
}
};
serializationContext.setPretty(true);
// output the message element through the serialization context
element.output(serializationContext);
writer.write("\n");
writer.flush();
return writer.getBuffer().toString();
}
示例14: getResponse
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
/**
* Private method to create the enumeration resource in the enum resource home
*
* @param iter
* The enum iter instance to use
* @param persist
* True to use the enumeration impl's persistance (mostly broken)
* @param expiration
* Resource expiration information
* @return
* The enumerate response
* @throws EnumerationCreationException
*/
private static EnumerateResponse getResponse(EnumIterator iter, boolean persist, ExpirationType expiration)
throws EnumerationCreationException {
try {
EnumResourceHome resourceHome = EnumResourceHome.getEnumResourceHome();
EnumResource resource = resourceHome.createEnumeration(iter, persist);
ResourceKey key = resourceHome.getKey(resource);
EnumerationContextType enumContext =
EnumProvider.createEnumerationContextType(key);
EnumerateResponse response = new EnumerateResponse(new MessageElement[] {}, enumContext, expiration);
return response;
} catch (Exception ex) {
throw new EnumerationCreationException(ex.getClass().getName() + " -- " + ex.getMessage(), ex);
}
}
示例15: discoverByFilter
import org.apache.axis.message.MessageElement; //导入依赖的package包/类
/**
* Applies the specified predicate to the common path in the Index Service's
* Resource Properties to return registered services' EPRs that match the
* predicate.
*
* @param xpathPredicate
* predicate to apply to the "Entry" in Index Service
* @return EndpointReferenceType[] of matching services @
* @throws ResourcePropertyRetrievalException
* @throws QueryInvalidException
* @throws RemoteResourcePropertyRetrievalException
*/
protected EndpointReferenceType[] discoverByFilter(String xpathPredicate)
throws RemoteResourcePropertyRetrievalException, QueryInvalidException, ResourcePropertyRetrievalException {
EndpointReferenceType[] results = null;
// query the service and deser the results
MessageElement[] elements = ResourcePropertyHelper.queryResourceProperties(this.indexEPR,
translateXPath(xpathPredicate));
Object[] objects = null;
try {
objects = ObjectDeserializer.toObject(elements, EndpointReferenceType.class);
} catch (DeserializationException e) {
throw new ResourcePropertyRetrievalException("Unable to deserialize results to EPRs!", e);
}
// if we got results, cast them into what we are expected to return
if (objects != null) {
results = new EndpointReferenceType[objects.length];
System.arraycopy(objects, 0, results, 0, objects.length);
}
return results;
}