LogicalMessage (Java EE 5)

Java EE API


javax.xml.ws Interface LogicalMessage


public interface LogicalMessage


LogicalMessage 接口表示协议无关的 (protocol agnostic) XML 消息,并包含一些方法提供对消息负载的访问。
英文文档:

The LogicalMessage interface represents a protocol agnostic XML message and contains methods that provide access to the payload of the message.

Since:
JAX-WS 2.0

Method Summary
 Source
 Object
 void
 void
 

Method Detail

public javax.xml.transform.Source getPayload()
以 XML 源的形式获取消息负载,可以在相同的 LogicalMessage 实例上多次调用,总是返回可以用来检索整个消息负载的新的 Source。

如果返回的 Source 是 DOMSource 的实例,则对封装的 DOM 树的修改现场更改消息负载,不需要随后调用 setPayload。其他类型的 Source 只提供对消息负载的读取访问。

return 所含的消息负载;如果此消息中没有净荷,则返回 null。

英文文档:

getPayload

Source getPayload()
Gets the message payload as an XML source, may be called multiple times on the same LogicalMessage instance, always returns a new Source that may be used to retrieve the entire message payload.

If the returned Source is an instance of DOMSource, then modifications to the encapsulated DOM tree change the message payload in-place, there is no need to susequently call setPayload. Other types of Source provide only read access to the message payload.

Returns:
The contained message payload; returns null if no payload is present in this message.

public void setPayload(javax.xml.transform.Source payload)
设置消息负载
payload 消息负载
ThrowsWebServiceException: 如果在此消息中设置净荷过程中发生任何错误
ThrowsUnsupportedOperationException: 如果此操作不受支持
英文文档:

setPayload

void setPayload(Source payload)
Sets the message payload

Parameters:
payload - message payload
Throws:
WebServiceException - If any error during the setting of the payload in this message
UnsupportedOperationException - If this operation is not supported

public Object getPayload(JAXBContext context)
以 JAXB 对象的形式获取消息负载。注意,返回的对象和消息负载之间没有任何连接,更改净荷需要调用 setPayload
context 应该用来解组消息负载的 JAXBContext
return 所含的消息负载;如果此消息中没有净荷,则返回 null
ThrowsWebServiceException: 如果使用提供的 JAXBContext 解组净荷时发生错误。WebServiceException 的 cause 是初始 JAXBException。
英文文档:

getPayload

Object getPayload(JAXBContext context)
Gets the message payload as a JAXB object. Note that there is no connection between the returned object and the message payload, changes to the payload require calling setPayload.

Parameters:
context - The JAXBContext that should be used to unmarshall the message payload
Returns:
The contained message payload; returns null if no payload is present in this message
Throws:
WebServiceException - If an error occurs when using a supplied JAXBContext to unmarshall the payload. The cause of the WebServiceException is the original JAXBException.

public void setPayload(Object payload, JAXBContext context)
设置消息负载
payload 消息负载
context 应该用来对净荷进行编组的 JAXBContext
ThrowsUnsupportedOperationException: 如果此操作不受支持
ThrowsWebServiceException: 如果在使用提供的 JAXBContext 对净荷进行编组时发生错误。WebServiceException 的 cause 是初始 JAXBException。
英文文档:

setPayload

void setPayload(Object payload,
                JAXBContext context)
Sets the message payload

Parameters:
payload - message payload
context - The JAXBContext that should be used to marshall the payload
Throws:
UnsupportedOperationException - If this operation is not supported
WebServiceException - If an error occurs when using the supplied JAXBContext to marshall the payload. The cause of the WebServiceException is the original JAXBException.


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!