本文整理汇总了Java中javax.wsdl.Part类的典型用法代码示例。如果您正苦于以下问题:Java Part类的具体用法?Java Part怎么用?Java Part使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Part类属于javax.wsdl包,在下文中一共展示了Part类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParameter
import javax.wsdl.Part; //导入依赖的package包/类
private XmlSchemaObject getParameter(Part part) {
XmlSchemaObject parameter;
QName elementName = part.getElementName();
if (elementName != null) {
parameter = schemas.getElementByQName(elementName);
if (parameter == null) {
logger.log(Level.WARNING, "can't find a global element: {0} trying with type...", elementName);
parameter = schemas.getTypeByQName(elementName);
}
} else {
QName typeName = part.getTypeName();
if (typeName != null) {
parameter = schemas.getTypeByQName(typeName);
} else {
return null;
}
}
return parameter;
}
示例2: getWrapperNamespace
import javax.wsdl.Part; //导入依赖的package包/类
private String getWrapperNamespace(String operationName, boolean input) {
String ns = null;
if (_wsdlPort != null) {
Operation operation = WSDLUtil.getOperationByName(_wsdlPort, operationName);
if (!_documentStyle) {
ns = input ? operation.getInput().getMessage().getQName().getNamespaceURI()
: operation.getOutput().getMessage().getQName().getNamespaceURI();
} else {
// Note: WS-I Profile allows only one child under SOAPBody.
Part part = input ? (Part)operation.getInput().getMessage().getParts().values().iterator().next()
: (Part)operation.getOutput().getMessage().getParts().values().iterator().next();
if (part.getElementName() != null) {
ns = part.getElementName().getNamespaceURI();
} else if (part.getTypeName() != null) {
ns = part.getTypeName().getNamespaceURI();
}
}
}
return ns;
}
示例3: getOperationByElement
import javax.wsdl.Part; //导入依赖的package包/类
/**
* Get the SOAP {@link Operation} instance for the specified message element.
*
* @param port The WSDL port.
* @param elementName The SOAP Body element QName.
* @param documentStyle true if it is 'document', false if 'rpc'.
* @return The Operation instance, or null if the operation was not found on the port.
*/
public static Operation getOperationByElement(Port port, QName elementName, Boolean documentStyle) {
List<Operation> operations = port.getBinding().getPortType().getOperations();
for (Operation operation : operations) {
if (!documentStyle && (elementName.getLocalPart().equals(operation.getName()))) {
return operation;
} else {
if ((operation.getInput() != null)
&& (operation.getInput().getMessage() != null)
&& (operation.getInput().getMessage().getParts() != null)
&& !operation.getInput().getMessage().getParts().isEmpty()) {
// Note: WS-I Profile allows only one child under SOAPBody.
Part part = (Part)operation.getInput().getMessage().getParts().values().iterator().next();
if ((part.getElementName() != null) && elementName.equals(part.getElementName())
|| (part.getTypeName() != null) && elementName.equals(part.getTypeName())) {
return operation;
} else if (elementName.getLocalPart().equals(operation.getName())) {
return operation;
}
// }
}
}
}
return null;
}
示例4: getMessageParts
import javax.wsdl.Part; //导入依赖的package包/类
private static List<QName> getMessageParts(Message msg) {
@SuppressWarnings("unchecked")
Collection<Part> values = msg.getParts().values();
if (values == null || values.isEmpty()) {
return null;
}
List<QName> result = new ArrayList<QName>();
Iterator<Part> iterator = values.iterator();
while (iterator.hasNext()) {
Part part = iterator.next();
if (part.getElementName() != null) {
result.add(part.getElementName());
} else if (part.getTypeName() != null) {
result.add(part.getTypeName());
}
}
return result;
}
示例5: parseSoapFault
import javax.wsdl.Part; //导入依赖的package包/类
public static Fault parseSoapFault(Element odeMsgEl, SOAPEnvelope envelope, Operation operation)
throws AxisFault {
SOAPFault flt = envelope.getBody().getFault();
SOAPFaultDetail detail = flt.getDetail();
Fault fdef = inferFault(operation, flt);
if (fdef == null) {
return null;
}
Part pdef = (Part) fdef.getMessage().getParts().values().iterator().next();
Element partel = odeMsgEl.getOwnerDocument().createElementNS(null, pdef.getName());
odeMsgEl.appendChild(partel);
if (detail.getFirstChildWithName(pdef.getElementName()) != null) {
partel.appendChild(odeMsgEl.getOwnerDocument().importNode(
OMUtils.toDOM(detail.getFirstChildWithName(pdef.getElementName())), true));
} else {
partel.appendChild(odeMsgEl.getOwnerDocument().importNode(OMUtils.toDOM(detail), true));
}
return fdef;
}
示例6: findHeaderPartName
import javax.wsdl.Part; //导入依赖的package包/类
private String findHeaderPartName(List<SOAPHeader> headerDefs, QName elementName) {
for (SOAPHeader headerDef : headerDefs) {
Message hdrMsg = wsdlDef.getMessage(headerDef.getMessage());
for (Object o : hdrMsg.getParts().values()) {
Part p = (Part) o;
if (p.getElementName().equals(elementName)) {
return p.getName();
}
}
}
//The following commented fix, avoids adding any of the headers. So that reverting back to old fix
return elementName.getLocalPart();
// // Fix to avoid unwanted headers getting copied to input Message to ODE.
// // JIRA - https://wso2.org/jira/browse/CARBON-5499
// return null;
}
示例7: createSoapBody
import javax.wsdl.Part; //导入依赖的package包/类
public void createSoapBody(org.apache.axiom.soap.SOAPBody sb, SOAPBody soapBody, Message msgDef,
Element message, String rpcWrapper) throws AxisFault {
OMElement partHolder = isRPC ? soapFactory
.createOMElement(new QName(soapBody.getNamespaceURI(), rpcWrapper, "odens"), sb) : sb;
List<Part> parts = msgDef.getOrderedParts(soapBody.getParts());
for (Part part : parts) {
Element srcPartEl = DOMUtils.findChildByName(message, new QName(null, part.getName()));
if (srcPartEl == null) {
throw new AxisFault("Missing required part in ODE Message");
}
OMElement omPart = OMUtils.toOM(srcPartEl, soapFactory);
if (isRPC) {
partHolder.addChild(omPart);
} else {
for (Iterator<OMNode> i = omPart.getChildren(); i.hasNext(); ) {
partHolder.addChild(i.next());
}
}
}
}
示例8: createPart
import javax.wsdl.Part; //导入依赖的package包/类
public Part createPart() {
if (isDebugEnabled) {
log.debug(myClassName + ".createPart()");
}
getWrappedDefinitionForUse();
Part results = null;
if (wsdlDefinition != null) {
if (hasBeenSaved) {
hasBeenUpdatedSinceSaving = true;
}
results = wsdlDefinition.createPart();
}
doneUsingWrappedDefinition();
return results;
}
示例9: getFault
import javax.wsdl.Part; //导入依赖的package包/类
/**
* Create a WsdlOpFault from the Fault.
*
* @param fault Fault to process.
* @return WsdlOpFault Result of processing.
*/
@SuppressWarnings("unchecked")
private WsdlOpFault getFault(Fault fault) {
Message m = fault.getMessage();
// a fault should only have one message part.
Map<?, Part> partMap = m.getParts();
if (partMap.size() != 1)
{
throw new IllegalArgumentException("Invalid part count for fault!!");
}
Part faultPart = partMap.values().iterator().next();
boolean complexType = false;
// type of fault is specified either in Part's type or element attribute.
QName type = faultPart.getTypeName();
if (type == null) {
type = faultPart.getElementName();
Element schemaElement = _wsdlTypes.findNamedElement(type);
type = _wsdlTypes.getTypeQName(schemaElement.getAttribute("type"));
complexType = true;
}
return new WsdlOpFault(fault.getName(), type, complexType, _wsdlTypes);
}
示例10: add
import javax.wsdl.Part; //导入依赖的package包/类
/**
* Add a parameter to this list.
*
* @param p Message part defining the parameter.
* @param requestPart tue if this parameter is part of an reqest message.
* @return true if this collection was modified as a result of this call.
*/
protected boolean add(Part p, boolean requestPart) {
List<WsdlOpParameter> params = getParameter(p, requestPart);
for (WsdlOpParameter op : params) {
if (_headerNames.contains(op.getName().getLocalPart())) {
op.setHeader();
}
if (requestPart) {
// just set mode and add
op.setMode(op.getMode()); // TODO: WTF??
add(op);
}
else {
addOutputParameter(op);
}
}
return true;
}
示例11: getParameter
import javax.wsdl.Part; //导入依赖的package包/类
/**
* Generate a WsdlOpParameter from the message part.
*
* @param part A list of message part.
* @param requesPart true if part from request message.
*/
private List<WsdlOpParameter> getParameter(Part part, boolean requesPart) {
List<WsdlOpParameter> params = new ArrayList<WsdlOpParameter>();
if (part.getElementName() != null) {
if (WsdlUtils.isWrappedParameterStyle(_operation.getName(), !requesPart, part.getName())) {
_parameterStyle = WsdlOperation.SOAPParameterStyle.WRAPPED;
}
params.addAll(resolvePartElement(part));
}
else {
params.add(new WsdlOpParameter(part.getName(), part.getTypeName(), _wsdlTypes.findNamedType(part.getTypeName()), _wsdlTypes));
}
return params;
}
示例12: getFault
import javax.wsdl.Part; //导入依赖的package包/类
/**
* Create a WsdlOpFault from the Fault.
*
* @param fault Fault to process.
* @return WsdlOpFault Result of processing.
*/
@SuppressWarnings("unchecked")
private WsdlOpFault getFault(Fault fault)
throws KettleStepException {
Message m = fault.getMessage();
// a fault should only have one message part.
Map<?, Part> partMap = m.getParts();
if (partMap.size() != 1)
{
throw new IllegalArgumentException("Invalid part count for fault!!");
}
Part faultPart = partMap.values().iterator().next();
boolean complexType = false;
// type of fault is specified either in Part's type or element attribute.
QName type = faultPart.getTypeName();
if (type == null) {
type = faultPart.getElementName();
Element schemaElement = _wsdlTypes.findNamedElement(type);
type = _wsdlTypes.getTypeQName(schemaElement.getAttribute("type"));
complexType = true;
}
return new WsdlOpFault(fault.getName(), type, complexType, _wsdlTypes);
}
示例13: add
import javax.wsdl.Part; //导入依赖的package包/类
/**
* Add a parameter to this list.
*
* @param p Message part defining the parameter.
* @param requestPart tue if this parameter is part of an reqest message.
* @return true if this collection was modified as a result of this call.
*/
protected boolean add(Part p, boolean requestPart)
throws KettleStepException {
List<WsdlOpParameter> params = getParameter(p, requestPart);
for (WsdlOpParameter op : params) {
if (_headerNames.contains(op.getName().getLocalPart())) {
op.setHeader();
}
if (requestPart) {
// just set mode and add
op.setMode(op.getMode()); // TODO: WTF??
add(op);
}
else {
addOutputParameter(op);
}
}
return true;
}
示例14: getParameter
import javax.wsdl.Part; //导入依赖的package包/类
/**
* Generate a WsdlOpParameter from the message part.
*
* @param part A list of message part.
* @param requesPart true if part from request message.
*/
private List<WsdlOpParameter> getParameter(Part part, boolean requesPart)
throws KettleStepException {
List<WsdlOpParameter> params = new ArrayList<WsdlOpParameter>();
if (part.getElementName() != null) {
if (WsdlUtils.isWrappedParameterStyle(_operation.getName(), !requesPart, part.getName())) {
_parameterStyle = WsdlOperation.SOAPParameterStyle.WRAPPED;
}
params.addAll(resolvePartElement(part));
}
else {
params.add(new WsdlOpParameter(part.getName(), part.getTypeName(), _wsdlTypes.findNamedType(part.getTypeName()), _wsdlTypes));
}
return params;
}
示例15: getWrapperChild
import javax.wsdl.Part; //导入依赖的package包/类
private XmlElementInfo getWrapperChild(Part part, String wsdlMessagePartName) throws OpenEJBException {
// get the part name
QName elementName = part.getElementName();
wrapperElementQNames.add(elementName);
// get the wrapper element
XmlElementInfo wrapperElement = schemaInfo.elements.get(elementName);
if (wrapperElement == null) {
throw new OpenEJBException("No global element named " + elementName + " for operation " + operationName);
}
// get the wrapper type
XmlTypeInfo wrapperType = schemaInfo.types.get(wrapperElement.xmlType);
if (wrapperType == null) {
throw new OpenEJBException("Can not find type " + wrapperElement.xmlType + " for element " + wrapperElement.qname + ", known types: " + schemaInfo.types.keySet());
}
// get the part type
for (XmlElementInfo wrapperChild : wrapperType.elements.values()) {
if (wrapperChild.qname.getLocalPart().equals(wsdlMessagePartName)) {
return wrapperChild;
}
}
throw new OpenEJBException("Global element named " + elementName + " does not define a child element named " + wsdlMessagePartName + " required by the operation " + operationName);
}