public abstract class SOAPConnection extends Object
SOAPConnection级是可选的。一些实现可能无法实现,在这种情况下,调用SOAPConnectionFactory.newInstance()
这个接口(见下图)将抛出一个UnsupportedOperationException
。
客户端可以使用SOAPConnectionFactory
对象作为在下面的例子中得到SOAPConnection
对象:
soapconnectionfactory厂= soapconnectionfactory。newinstance();createconnection() SOAPConnection CON =工厂;一
SOAPConnection
对象可以直接发送消息到一个URL的请求/响应模式。即使用方法
call
发送消息,发送消息,然后等待,直到它得到一个答复。
Constructor and Description |
---|
SOAPConnection() |
Modifier and Type | Method and Description |
---|---|
abstract SOAPMessage |
call(SOAPMessage request, Object to)
将给定的消息发送到指定的端点和块,直到它返回响应为止。
|
abstract void |
close()
关闭
SOAPConnection 对象。
|
SOAPMessage |
get(Object to)
从一个特定的端点和块获取一个消息,直到它接收到,
|
public abstract SOAPMessage call(SOAPMessage request, Object to) throws SOAPException
request
-发来的
SOAPMessage
对象
to
-
Object
标识应当发送消息。它所支持的类型
java.lang.String
,
java.net.URL
对象,当JAXM是目前
javax.xml.messaging.URLEndpoint
SOAPMessage
对象
SOAPException
-如果有一个SOAP错误
public SOAPMessage get(Object to) throws SOAPException
to
-
Object
标识请求应该发送。
java.lang.String
型和
java.net.URL
对象必须支持。
SOAPMessage
对象
SOAPException
-如果有一个SOAP错误
public abstract void close() throws SOAPException
SOAPConnection
对象。
SOAPException
-如果有一个SOAP错误
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.