SOAPConnection (Java EE 5)

Java EE API


javax.xml.soap Class SOAPConnection

java.lang.Object
  extended by javax.xml.soap.SOAPConnection

public abstract class SOAPConnection
extends Object


客户端可以用于直接将消息发送到(例如,用 URL 表示的)远程方的点对点连接。

SOAPConnection 类是可选的。某些实现可能无法实现此接口,在这种情况下,调用 SOAPConnectionFactory.newInstance()(参见以下内容)将抛出 UnsupportedOperationException

客户端可以使用 SOAPConnectionFactory 对象获取 SOAPConnection 对象,如下例所示:

SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();
SOAPConnection con = factory.createConnection();
 
SOAPConnection 对象可用来将消息直接发送到请求/响应范例后面的 URL。也就是说,使用方法 call 来发送消息,该方法发送消息并等到收到应答为止。
英文文档:

A point-to-point connection that a client can use for sending messages directly to a remote party (represented by a URL, for instance).

The SOAPConnection class is optional. Some implementations may not implement this interface in which case the call to SOAPConnectionFactory.newInstance() (see below) will throw an UnsupportedOperationException.

A client can obtain a SOAPConnection object using a SOAPConnectionFactory object as in the following example:

      SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();
      SOAPConnection con = factory.createConnection();
 
A SOAPConnection object can be used to send messages directly to a URL following the request/response paradigm. That is, messages are sent using the method call, which sends the message and then waits until it gets a reply.


Constructor Summary
 
Method Summary
abstract  SOAPMessage
abstract  void
 SOAPMessage
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public SOAPConnection()
英文文档:

SOAPConnection

public SOAPConnection()
Method Detail

abstract public SOAPMessage call(SOAPMessage request, Object to) throws SOAPException
将给定消息发送到指定端点,在返回应答前将一直阻塞。
request 要发送的 SOAPMessage 对象
to 标识消息发送目的地的 Object。必须支持 java.lang.Stringjava.net.URL,以及 javax.xml.messaging.URLEndpoint 类型(JAXM 存在时)的 Object。
return 响应已发送消息的 SOAPMessage 对象
ThrowsSOAPException: 如果存在 SOAP 错误
英文文档:

call

public abstract SOAPMessage call(SOAPMessage request,
                                 Object to)
                          throws SOAPException
Sends the given message to the specified endpoint and blocks until it has returned the response.

Parameters:
request - the SOAPMessage object to be sent
to - an Object that identifies where the message should be sent. It is required to support Objects of type java.lang.String, java.net.URL, and when JAXM is present javax.xml.messaging.URLEndpoint
Returns:
the SOAPMessage object that is the response to the message that was sent
Throws:
SOAPException - if there is a SOAP error

public SOAPMessage get(Object to) throws SOAPException
从特定端点获取消息,在收到消息前将一直阻塞。
to 标识请求发送目的地的 Object。必须支持 java.lang.Stringjava.net.URL 类型的 Object。
return 响应获取消息请求的 SOAPMessage 对象
ThrowsSOAPException: 如果存在 SOAP 错误
sinceSAAJ 1.3
英文文档:

get

public SOAPMessage get(Object to)
                throws SOAPException
Gets a message from a specific endpoint and blocks until it receives,

Parameters:
to - an Object that identifies where the request should be sent. Objects of type java.lang.String and java.net.URL must be supported.
Returns:
the SOAPMessage object that is the response to the get message request
Throws:
SOAPException - if there is a SOAP error
Since:
SAAJ 1.3

abstract public void close() throws SOAPException
关闭此 SOAPConnection 对象。
ThrowsSOAPException: 如果存在 SOAP 错误
英文文档:

close

public abstract void close()
                    throws SOAPException
Closes this SOAPConnection object.

Throws:
SOAPException - if there is a SOAP error


Submit a bug or feature

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

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

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