Package com.sun.xml.ws.client.sei
Class ResponseBuilder
- java.lang.Object
-
- com.sun.xml.ws.client.sei.ResponseBuilder
-
- Direct Known Subclasses:
ResponseBuilder.AttachmentBuilder,ResponseBuilder.Body,ResponseBuilder.Composite,ResponseBuilder.DocLit,ResponseBuilder.Header,ResponseBuilder.NullSetter,ResponseBuilder.RpcLit
public abstract class ResponseBuilder extends Object
Reads a responseMessage, disassembles it, and moves obtained Java values to the expected places.- Author:
- Kohsuke Kawaguchi, Jitendra Kotamraju
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResponseBuilder.AttachmentBuilderReads an Attachment into a Java parameter.static classResponseBuilder.BodyReads the whole payload into a single JAXB bean.static classResponseBuilder.CompositeResponseBuilderthat is a composition of multipleResponseBuilders.static classResponseBuilder.DocLitTreats a payload as multiple parts wrapped into one element, and processes all such wrapped parts.static classResponseBuilder.HeaderReads a header into a JAXB object.static classResponseBuilder.NullSetterResponseBuilderthat sets the VM uninitialized value to the type.static classResponseBuilder.RpcLitTreats a payload as multiple parts wrapped into one element, and processes all such wrapped parts.
-
Field Summary
Fields Modifier and Type Field Description static ResponseBuilderNONEThe singleton instance that produces null return value.protected Map<QName,com.sun.xml.ws.client.sei.ResponseBuilder.WrappedPartBuilder>wrappedPartsResponseBuilder.PartBuilderkeyed by the element name (inside the wrapper element.)protected QNamewrapperName
-
Constructor Summary
Constructors Constructor Description ResponseBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ObjectgetVMUninitializedValue(Type type)Returns the 'uninitialized' value for the given type.static StringgetWSDLPartName(Attachment att)Gets the WSDL part name of this attachment.abstract ObjectreadResponse(Message reply, Object[] args)Reads a responseMessage, disassembles it, and moves obtained Java values to the expected places.protected ObjectreadWrappedResponse(Message msg, Object[] args)
-
-
-
Field Detail
-
wrappedParts
protected Map<QName,com.sun.xml.ws.client.sei.ResponseBuilder.WrappedPartBuilder> wrappedParts
ResponseBuilder.PartBuilderkeyed by the element name (inside the wrapper element.)
-
wrapperName
protected QName wrapperName
-
NONE
public static final ResponseBuilder NONE
The singleton instance that produces null return value. Used for operations that doesn't have any output.
-
-
Method Detail
-
readResponse
public abstract Object readResponse(Message reply, Object[] args) throws javax.xml.bind.JAXBException, XMLStreamException
Reads a responseMessage, disassembles it, and moves obtained Java values to the expected places.- Parameters:
reply- The replyMessageto be de-composed.args- The Java arguments given to the SEI method invocation. Some parts of the reply message may be set toHolders in the arguments.- Returns:
- If a part of the reply message is returned as a return value from the SEI method, this method returns that value. Otherwise null.
- Throws:
javax.xml.bind.JAXBException- if there's an error during unmarshalling the reply message.XMLStreamException- if there's an error during unmarshalling the reply message.
-
readWrappedResponse
protected Object readWrappedResponse(Message msg, Object[] args) throws javax.xml.bind.JAXBException, XMLStreamException
- Throws:
javax.xml.bind.JAXBExceptionXMLStreamException
-
getVMUninitializedValue
public static Object getVMUninitializedValue(Type type)
Returns the 'uninitialized' value for the given type.For primitive types, it's '0', and for reference types, it's null.
-
getWSDLPartName
public static final String getWSDLPartName(Attachment att)
Gets the WSDL part name of this attachment.According to WSI AP 1.0
3.8 Value-space of Content-Id Header Definition: content-id part encoding The "content-id part encoding" consists of the concatenation of: The value of the name attribute of the wsdl:part element referenced by the mime:content, in which characters disallowed in content-id headers (non-ASCII characters as represented by code points above 0x7F) are escaped as follows: o Each disallowed character is converted to UTF-8 as one or more bytes. o Any bytes corresponding to a disallowed character are escaped with the URI escaping mechanism (that is, converted to %HH, where HH is the hexadecimal notation of the byte value). o The original character is replaced by the resulting character sequence. The character '=' (0x3D). A globally unique value such as a UUID. The character '@' (0x40). A valid domain name under the authority of the entity constructing the message.So a wsdl:part fooPart will be encoded as:- Returns:
- null if the parsing fails.
-
-