org.apache.muse.ws.resource.properties.impl
Class WsrpUtils

java.lang.Object
  extended by org.apache.muse.ws.resource.properties.impl.WsrpUtils

public class WsrpUtils
extends Object

WsrpUtils is a set of convenience methods related to WS-RP v1.2.

Author:
Dan Jemiolo (danj)

Constructor Summary
WsrpUtils()
           
 
Method Summary
static Element convertToElement(Object property, Class type, QName qname)
          Uses one of Muse's registered Serializers to convert the given object into an XML element.
static Element[] convertToElements(Object[] properties, Class type, QName qname)
          Uses Muse's registered Serializers to convert the given objects into XML elements.
static Object convertToObject(Element property, Class type)
          Uses one of Muse's registered Serializers to convert the given Element into an instance of the given type.
static Object convertToObjects(Element[] properties, Class type)
          Uses Muse's registered Serializers to convert the given Elements into instances of the given type.
static QName getPropertiesName(Node wsdl, QName portType)
          Searches a WSDL document for the schema element name of a resource's WS-RP document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsrpUtils

public WsrpUtils()
Method Detail

convertToElement

public static Element convertToElement(Object property,
                                       Class type,
                                       QName qname)
                                throws SoapFault
Uses one of Muse's registered Serializers to convert the given object into an XML element.

Parameters:
property - The property value to serialize.
type - The type whose registered Serializer will be used to parse the property value.
qname - The QName of the XML element that will represent the property value.
Returns:
The POJO representation of the given property value.
Throws:
SoapFault -
  • If the value could not be serialized.

convertToElements

public static Element[] convertToElements(Object[] properties,
                                          Class type,
                                          QName qname)
                                   throws SoapFault
Uses Muse's registered Serializers to convert the given objects into XML elements.

Parameters:
properties - The property values to serialize.
type - The type whose registered Serializer will be used to parse the property values.
qname - The QName of the XML elements that will represent the property values.
Returns:
An array with the POJO representation of the given property values. The array will be the same length as the one given. The order of the objects will be the same as the order of the values.
Throws:
SoapFault -
  • If any of the values could not be serialized.

convertToObject

public static Object convertToObject(Element property,
                                     Class type)
                              throws SoapFault
Uses one of Muse's registered Serializers to convert the given Element into an instance of the given type.

Parameters:
property - The property value to deserialize.
type - The type whose registered Serializer will be used to parse the property value.
Returns:
The POJO representation of the given property value.
Throws:
SoapFault -
  • If the value could not be deserialized.

convertToObjects

public static Object convertToObjects(Element[] properties,
                                      Class type)
                               throws SoapFault
Uses Muse's registered Serializers to convert the given Elements into instances of the given type.

Parameters:
properties - The property values to deserialize.
type - The type whose registered Serializer will be used to parse the property values.
Returns:
An array with the POJO representation of the given property values. The array will be the same length as the one given. The order of the objects will be the same as the order of the values.
Throws:
SoapFault -
  • If any of the values could not be deserialized.

getPropertiesName

public static QName getPropertiesName(Node wsdl,
                                      QName portType)
Searches a WSDL document for the schema element name of a resource's WS-RP document. The WS-RP document is defined in the WSDL's types section and is an aggregate properties defined in other schemas (all properties listed in the WS-RP definition use the ref attribute to refer to their complete type definitions).

Parameters:
wsdl - The WSDL document that contains the WS-RP definition.
portType - The WSDL portType that has the name of the WS-RP definition.
Returns:
The QName of the WS-RP document element in . This element is a sequence of other XSD elements that use the ref attribute to define their types.
See Also:
WsdlUtils.getElementDeclaration(Node, QName)


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.