|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.muse.ws.addressing.soap.SimpleSoapClient
public class SimpleSoapClient
SimpleSoapClient is and implementation of SoapClient that relies on the java.net.HttpURLConnection API to send and receive SOAP messages. It provides complete WS-Addressing (WS-A) support, so that all requests are routed with WS-A EPRs and Actions. Messages are sent with valid reply and fault EPRs so that responses can be redirected if desired.
Constructor Summary | |
---|---|
SimpleSoapClient()
|
Method Summary | |
---|---|
protected Element |
createMessage(EndpointReference source,
EndpointReference destination,
String action,
Element[] bodyElements,
Element[] extraHeaders)
Creates a valid SOAP message, including WS-A headers that specify the destination and operation (action). |
protected URL |
getDestinationURL(EndpointReference destination)
|
int |
getSoapMonitorPort()
|
PrintWriter |
getTraceWriter()
|
boolean |
isUsingSoapMonitor()
The default value is 'false'. |
boolean |
isUsingTrace()
The default value is 'false'. |
Element[] |
send(EndpointReference src,
EndpointReference dest,
String wsaAction,
Element[] body)
Sends a SOAP envelope with the given body to the given destination. |
Element[] |
send(EndpointReference src,
EndpointReference dest,
String wsaAction,
Element[] body,
Element[] extraHeaders)
Sends a SOAP envelope with the given body to the given destination. |
void |
setTrace(boolean trace)
|
void |
setTraceWriter(PrintWriter writer)
Note that there is a default PrintWriter set at instantiation - it wraps the System.out stream. |
void |
startSoapMonitor(int monitorPort)
Causes the SoapClient to send messages to the given port. |
void |
stopSoapMonitor()
If SOAP monitoring was in use, the client will revert back to sending the messages to the port in the EPR's wsa:Address. |
protected void |
trace(Element xml,
boolean incoming)
|
protected void |
trace(String message)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleSoapClient()
Method Detail |
---|
protected Element createMessage(EndpointReference source, EndpointReference destination, String action, Element[] bodyElements, Element[] extraHeaders)
source
- destination
- action
- bodyElements
- extraHeaders
-
protected URL getDestinationURL(EndpointReference destination)
destination
-
public int getSoapMonitorPort()
getSoapMonitorPort
in interface SoapMonitor
public PrintWriter getTraceWriter()
getTraceWriter
in interface Traceable
public boolean isUsingSoapMonitor()
isUsingSoapMonitor
in interface SoapMonitor
public boolean isUsingTrace()
isUsingTrace
in interface Traceable
public Element[] send(EndpointReference src, EndpointReference dest, String wsaAction, Element[] body)
SoapClient
send
in interface SoapClient
src
- The EPR of the service sending the message.dest
- The EPR of the service that will receive the message.wsaAction
- The WS-A Action that specifies the operation to be invoked on
the destination service.body
- The contents of the SOAP body.
public Element[] send(EndpointReference src, EndpointReference dest, String wsaAction, Element[] body, Element[] extraHeaders)
SoapClient
send
in interface SoapClient
src
- The EPR of the service sending the message.dest
- The EPR of the service that will receive the message.wsaAction
- The WS-A Action that specifies the operation to be invoked on
the destination service.body
- The contents of the SOAP body.extraHeaders
- SOAP header elements that should be added to the outgoing message.
These headers must not use the WS-Addressing namespace.
public void setTrace(boolean trace)
setTrace
in interface Traceable
trace
- If 'true', tracing is turned on and messages sent to the trace log.public void setTraceWriter(PrintWriter writer)
setTraceWriter
in interface Traceable
writer
- The trace log - note that you can make a PrintWriter from
System.out and System.err by wrapping these fields in an
instance of PrintWriter.public void startSoapMonitor(int monitorPort)
SoapMonitor
startSoapMonitor
in interface SoapMonitor
monitorPort
- A positive integer - 0 to 65535.public void stopSoapMonitor()
SoapMonitor
stopSoapMonitor
in interface SoapMonitor
protected void trace(Element xml, boolean incoming)
xml
- An XML fragment that will be sent to the trace log.incoming
- True if the message was part of an incoming SOAP message. This
merely provides some context in the trace log.protected void trace(String message)
message
- The message to print to the trace log.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |