|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openspml.v2.client.Spml2Client
A class providing a mechanism to send and recieve SPML2 requests using the Spml2Request and Spml2Response classes.
Once the request is formatted as
XML, it uses the SOAPClient
class to handle the actual
communication. When the XML response is received, it is parsed into a
Spml2Response and returned.
Nested Class Summary | |
static interface |
Spml2Client.SOAPClientAdapter
We define one of these so we have a chance of using different Soap Client implementations. |
Field Summary | |
static java.lang.String |
code_id
|
Constructor Summary | |
Spml2Client(java.lang.String url)
|
|
Spml2Client(java.lang.String url,
java.lang.String username,
java.lang.String pwd)
|
Method Summary | |
static void |
println(java.lang.String msg)
|
Response |
send(Request req)
Send an XmlObject as the body of a SOAP request. |
java.lang.String |
send(java.lang.String xml)
Send xml as a payload and return the entire SOAPResponse. |
java.lang.String |
sendRequest(Request req)
Take an object and return the entire SOAP response as xml. |
void |
setBodyAttributes(java.lang.String s)
Set an optional list of attributes for the SOAP Body. |
void |
setHeader(java.lang.String s)
Set an optional SOAP Header. |
void |
setMonitor(RPCRouterMonitor m)
Install a SOAP message monitor. |
void |
setSOAPAction(java.lang.String action)
Use this action in the SOAPClient. |
void |
setTrace(boolean b)
|
void |
throwErrors(Response res)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
Constructor Detail |
public Spml2Client(java.lang.String url) throws Spml2Exception
public Spml2Client(java.lang.String url, java.lang.String username, java.lang.String pwd) throws Spml2Exception
Method Detail |
public void setHeader(java.lang.String s)
public void setSOAPAction(java.lang.String action)
action
- public void setBodyAttributes(java.lang.String s)
public void setTrace(boolean b)
public void setMonitor(RPCRouterMonitor m)
public Response send(Request req) throws Spml2Exception, Spml2ExceptionWithResponse
We use an XmlObject because XmlBeans makes it rather difficult to use anything else (to narrow the type to a particular type in the schema.) You should be passing instances of the 'RequestType' enclosing 'Document' objects, e.g. ListTargetsDocument and AddRequestDocument. (These do NOT have a common base class, and using RequestType sub-interfaces makes for odd tricks... like seeting a requesttype to a Document...)
Not accounting for SOAP faults...
req
- An XmlOBject (*Document interface) that is the body of the
request.
Spml2Exception
Spml2ExceptionWithResponse
public java.lang.String sendRequest(Request req) throws Spml2Exception
req
-
Spml2Exception
public java.lang.String send(java.lang.String xml) throws Spml2Exception
xml
-
Spml2Exception
public static void println(java.lang.String msg)
public void throwErrors(Response res) throws Spml2ExceptionWithResponse
Spml2ExceptionWithResponse
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |