本文整理汇总了Java中javax.wsdl.Message.addPart方法的典型用法代码示例。如果您正苦于以下问题:Java Message.addPart方法的具体用法?Java Message.addPart怎么用?Java Message.addPart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.wsdl.Message
的用法示例。
在下文中一共展示了Message.addPart方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addWsdlMessage
import javax.wsdl.Message; //导入方法依赖的package包/类
private static void addWsdlMessage(Definition definition, QName messageQName, QName partElementQName) {
Message message = definition.createMessage();
message.setQName(messageQName);
message.setUndefined(false);
Part part = definition.createPart();
part.setName("parameters");
part.setElementName(partElementQName);
message.addPart(part);
definition.addMessage(message);
}
示例2: addRequestMessage
import javax.wsdl.Message; //导入方法依赖的package包/类
private Message addRequestMessage(Definition localDef, OperationDeclaration op) {
Message inputMessage = localDef.createMessage();
inputMessage.setUndefined(false);
Part inputPart = localDef.createPart();
inputPart.setName("body");
try {
// adding wsdl_types related to this message
if (op instanceof OneWayOperationDeclaration) {
OneWayOperationDeclaration op_ow = (OneWayOperationDeclaration) op;
// set the message name as the name of the jolie request message type
inputMessage.setQName(new QName(tns, op_ow.requestType().id()));
addMessageType(op_ow.requestType(), op_ow.id());
} else {
RequestResponseOperationDeclaration op_rr = (RequestResponseOperationDeclaration) op;
// set the message name as the name of the jolie request message type
inputMessage.setQName(new QName(tns, op_rr.requestType().id()));
addMessageType(op_rr.requestType(), op_rr.id());
}
// set the input part as the operation name
inputPart.setElementName(new QName(tns_schema, op.id()));
inputMessage.addPart(inputPart);
inputMessage.setUndefined(false);
localDef.addMessage(inputMessage);
} catch (Exception e) {
e.printStackTrace();
}
return inputMessage;
}
示例3: addResponseMessage
import javax.wsdl.Message; //导入方法依赖的package包/类
private Message addResponseMessage(Definition localDef, OperationDeclaration op) {
Message outputMessage = localDef.createMessage();
outputMessage.setUndefined(false);
Part outputPart = localDef.createPart();
outputPart.setName("body");
// adding wsdl_types related to this message
try {
RequestResponseOperationDeclaration op_rr = (RequestResponseOperationDeclaration) op;
String outputPartName = op_rr.id() + "Response";
// set the message name as the name of the jolie response message type
outputMessage.setQName(new QName(tns, op_rr.responseType().id()));
addMessageType(op_rr.responseType(), outputPartName);
outputPart.setElementName(new QName(tns_schema, outputPartName));
outputMessage.addPart(outputPart);
outputMessage.setUndefined(false);
localDef.addMessage(outputMessage);
} catch (Exception e) {
e.printStackTrace();
}
return outputMessage;
}
示例4: addFaultMessage
import javax.wsdl.Message; //导入方法依赖的package包/类
private Message addFaultMessage(Definition localDef, OperationDeclaration op, TypeDefinition tp, String faultName) {
Message faultMessage = localDef.createMessage();
faultMessage.setUndefined(false);
// set the fault message name as the name of the fault jolie message type
faultMessage.setQName(new QName(tns, tp.id()));
Part faultPart = localDef.createPart();
faultPart.setName("body");
String faultPartName = tp.id();
try {
// adding wsdl_types related to this message
addMessageType(tp, faultPartName);
faultPart.setElementName(new QName(tns_schema, faultPartName));
faultMessage.addPart(faultPart);
faultMessage.setUndefined(false);
localDef.addMessage(faultMessage);
} catch (Exception e) {
e.printStackTrace();
}
return faultMessage;
}
示例5: getWSDLInputMessage
import javax.wsdl.Message; //导入方法依赖的package包/类
/**
* creates the corresponding wsdl message for input
*
* @param definition
* @return input message
*/
public Message getWSDLInputMessage(Definition definition,
Operation operation) {
Message inputMessage = definition.createMessage();
inputMessage.setUndefined(false);
inputMessage.setQName(new QName(operation.getNamespace(), operation.getName() + "RequestMessage"));
Part part = definition.createPart();
part.setName("input");
part.setElementName(new QName(operation.getInputElement().getNamespace(), operation.getInputElement().getName()));
inputMessage.addPart(part);
return inputMessage;
}
示例6: getWSDLOutputMessage
import javax.wsdl.Message; //导入方法依赖的package包/类
/**
* creates the corresponding wsdl message for output
*
* @param definition
* @return output message
*/
public Message getWSDLOutputMessage(Definition definition,
Operation operation) {
Message outputMessage = definition.createMessage();
outputMessage.setUndefined(false);
outputMessage.setQName(new QName(operation.getNamespace(), operation.getName() + "ResponseMessage"));
Part part = definition.createPart();
part.setName("output");
part.setElementName(new QName(operation.getOutPutElement().getNamespace(), operation.getOutPutElement().getName()));
outputMessage.addPart(part);
return outputMessage;
}
示例7: addXroadHeaderPart
import javax.wsdl.Message; //导入方法依赖的package包/类
private void addXroadHeaderPart(Definition definition, Message message, QName partName) {
Part part = definition.createPart();
part.setElementName(partName);
part.setName(partName.getLocalPart());
message.addPart(part);
}
示例8: generateOperationsAndMessages
import javax.wsdl.Message; //导入方法依赖的package包/类
private void generateOperationsAndMessages()
throws SchemaGenerationException {
org.apache.axis2.rmi.metadata.Operation operation;
Message inputMessage;
Message outputMessage;
javax.wsdl.Operation wsdlOperation;
BindingOperation bindingOperation;
//generate messages for exceptions
Map exceptionMessagesMap = new HashMap();
Class exceptionClass;
Parameter parameter;
Message faultMessage;
String messageName;
Part part;
for (Iterator iter = this.service.getExceptionClassToParameterMap().keySet().iterator(); iter.hasNext();) {
exceptionClass = (Class) iter.next();
parameter = (Parameter) this.service.getExceptionClassToParameterMap().get(exceptionClass);
messageName = exceptionClass.getName();
messageName = messageName.substring(messageName.lastIndexOf(".") + 1);
faultMessage = this.wsdlDefinition.createMessage();
faultMessage.setUndefined(false);
faultMessage.setQName(new QName(this.service.getNamespace(), messageName));
part = this.wsdlDefinition.createPart();
part.setName("fault");
// add this element namespace to the definition
if (this.wsdlDefinition.getPrefix(parameter.getElement().getNamespace()) == null) {
this.wsdlDefinition.addNamespace(Util.getNextNamespacePrefix(), parameter.getElement().getNamespace());
}
part.setElementName(parameter.getElement().getType().getQname());
faultMessage.addPart(part);
exceptionMessagesMap.put(exceptionClass, faultMessage);
this.wsdlDefinition.addMessage(faultMessage);
}
for (Iterator iter = this.service.getOperations().iterator(); iter.hasNext();) {
operation = (org.apache.axis2.rmi.metadata.Operation) iter.next();
// add input and out put messages
inputMessage = getWSDLInputMessage(this.wsdlDefinition, operation);
outputMessage = getWSDLOutputMessage(this.wsdlDefinition, operation);
this.wsdlDefinition.addMessage(inputMessage);
this.wsdlDefinition.addMessage(outputMessage);
wsdlOperation = getWSDLOperation(this.wsdlDefinition,
inputMessage,
outputMessage,
exceptionMessagesMap,
operation);
this.portType.addOperation(wsdlOperation);
bindingOperation = getWSDLBindingOperation(this.wsdlDefinition,
wsdlOperation,
operation);
this.httpSoapBinding.addBindingOperation(bindingOperation);
}
}