POST /astrogrid-vospace/vospace-1.1/03efc4cd1c0a3e3c011c0a418d15000b HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.2.1
Host: vospace.metagrid.co.uk:8080
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://www.ivoa.net/xml/VOSpaceContract-v1.1-rc3:CreateNode"
Content-Length: 549
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope>
<soapenv:Body>
<CreateNode>
<node
uri="vos://org.astrogrid.test!vospace-service/.auto"
xsi:type="ns1:ContainerNodeType">
<properties/>
</node>
</CreateNode>
</soapenv:Body>
</soapenv:Envelope>
The HTTP specification defines the format of a HTTP request.
The first line of a HTTP request contains the verb, POST, followed by the path from the request URL and the protocol version, HTTP/1.0
POST /astrogrid-vospace/vospace-1.1/03efc4cd1c0a3e3c011c0a418d15000b HTTP/1.0
The next lines contain the HTTP headers, formatted as 'name: value' pairs, upto the first blank line.
....
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.2.1
Host: vospace.metagrid.co.uk:8080
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://www.ivoa.net/xml/VOSpaceContract-v1.1-rc3:CreateNode"
Content-Length: 549
Everything after the first blank line is the request body, in this example it contains our SOAP XML message.
....
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope>
<soapenv:Body>
<CreateNode>
<node
uri="vos://org.astrogrid.test!vospace-service/.auto"
xsi:type="ns1:ContainerNodeType">
<properties/>
</node>
</CreateNode>
</soapenv:Body>
</soapenv:Envelope>
POST /astrogrid-vospace/vospace-1.1/03efc4cd1c0a3e3c011c0a418d15000b HTTP/1.0
Content-Type: text/xml; charset=utf-8
....
POST /astrogrid-vospace/.....
....
This matches the 'context' or webapp name used to deploy the AstroGrid VOSpace web application in Tomcat.
See webapp deployment.
POST /astrogrid-vospace/vospace-1.1/03efc4cd1c0a3e3c011c0a418d15000b
....
The VOSpace web application is a little unusual in that it does not pass the request direct to the Axis Servlet.
The 'vospace-1.1' part of the URL is mapped to an intermediate servlet that logs the request, grabs the identifier from the end of the URL, and then passes
the request on to the Axis SOAP servlet.
The net effect is the same as a normal SOAP service, the URL path is matched within the web application, and the request is passed to the Axis servlet.
So far only the first part of the HTTP request has been processed, upto and including the headers.
The message body has not been read yet.
....
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope>
<soapenv:Body>
<CreateNode>
<node
uri="vos://org.astrogrid.test!vospace-service/.auto"
xsi:type="ns1:ContainerNodeType">
<properties/>
</node>
</CreateNode>
</soapenv:Body>
</soapenv:Envelope>
The Axis servlet processes the outer SOAP envelope elements
....
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope>
<soapenv:Body>
....
</soapenv:Body>
</soapenv:Envelope>
and then converts the VOSpace message elements into a set of Java Beans that represent the message
....
<CreateNode>
<node
uri="vos://org.astrogrid.test!vospace-service/.auto"
xsi:type="ns1:ContainerNodeType">
<properties/>
</node>
The resulting Java Beans are passed to the createNode method on the VOSpace SOAP service.
....
<CreateNode>
<node
uri="vos://org.astrogrid.test!vospace-service/.auto"
xsi:type="ns1:ContainerNodeType">
<properties/>
</node>
into a call to the createNode method on the service implementation
/**
* Create a new node.
* @param request The Axis request message bean.
*
*/
public CreateNodeResponseType createNode(CreateNodeRequestType request)
throws LinkFoundFaultType ....
{
....
}
Most of the createNode() method involves converting request the parameters into something that can be passed to the back-end server,
and converting the results or exceptions back into their SOAP equivalents.
The VOSpace web application needs to support three SOAP web interfaces, the original AstroGrid MySpace service, and two versions of the VOSpace service (VOSpace-1.0 and VOSpace 1.1).
It may also need to support the new VOSpace-2.x REST web interface when that comes online.
In order to do this, the back-end VOSpace server is defined as an abstract server interface that is used by all the web services.
The actual web service components act as a translation layer, implementing the web service methods defined in the service specification by calling methods on the back-end server interface.
The inner part of the createNode() method checks what type of node is being requested, and then calls the corresponding method on the back-end server (represented by the session).
/**
* Create a new node.
* @param request The Axis request message bean.
*
*/
public CreateNodeResponseType createNode(CreateNodeRequestType request)
throws LinkFoundFaultType ....
{
....
//
// Create our service session.
Session session = factory.create();
....
//
// Check the node type
switch (this.type(request.getNode()))
{
//
// Container node.
case TREE_NODE :
{
node = session.createTreeNode(
base.ident(),
request.getNode().getUri().getPath()
);
}
break ;
....
}
....
}
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope>
<soapenv:Body>
<CreateNodeResponse>
<node
uri="vos://org.astrogrid.test!vospace-service/03efc4cd1cd81b01011eaab1a84a1988"
xsi:type="ns1:ContainerNodeType">
<properties/>
</node>
</CreateNodeResponse>
</soapenv:Body>
</soapenv:Envelope>
| I | Attachment | Action | Size | Date | Who | Comment |
|---|---|---|---|---|---|---|
| |
vospace-request.odg | manage | 39.2 K | 2009-01-06 - 09:14 | DaveMorris | OpenOffice diagram |
| |
vospace-request.pdf | manage | 97.9 K | 2009-01-06 - 09:14 | DaveMorris | PDF version |
![]() |
Click here for the AstroGrid Service Web |
This is the AstroGrid Development Wiki |
|