-
Notifications
You must be signed in to change notification settings - Fork 10
HTTP messages sent to ORACC server
Nammu communicates with the ORACC server via both HTTP POST and HTTP GET:
- POST is used when we need to attach an ATF and send a SOAP Envelope (e.g. for requesting a lemmatisation of an ATF file).
- GET is used to check if the server is done processing the ATF file.
The overall format of an HTTP POST request is:
HTTP POST headers (Host, Content-Length, Content-Type, ...)
--==boundary==
HTTP POST Body with its own headers, including the SOAP Envelope and an id pointing to the part
of the message that'll contain the payload (the encoded zipped ATF file)
-==boundary==
Encoded zipped ATF file and some headers.
-==bounday==--
Looking at the steps described in the section [SOAP Asynch Communication Steps](SOAP Asynch Communication Steps), these would be the correspondant HTTP messages sent:
- HTTP POST containing the encoded ATF file as well as a SOAP Envelope describing what command we want to run and what project if belongs to.
Connection': 'close'
'Host': 'http://oracc.museum.upenn.edu:8085'
'MIME-Version': '1.0'
'Content-Length': '2779'
'Content-Type': 'multipart/related; charset="utf-8"; type="application/xop+xml"; start="<SOAP-ENV:Envelope>"; start-info="application/soap+xml"; boundary="==========boundary========"'
--==========boundary========
MIME-Version: 1.0
Content-ID: <SOAP-ENV:Envelope>
Content-Transfer-Encoding: binary
Content-Type: application/xop+xml; charset="utf-8"; type="application/soap+xml"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xop="http://www.w3.org/2004/08/xop/include"
xmlns:xmime5="http://www.w3.org/2005/05/xmlmime"
xmlns:osc-data="http://oracc.org/wsdl/ows.xsd"
xmlns:osc-meth="http://oracc.org/wsdl/ows.wsdl">
<SOAP-ENV:Body>
<osc-meth:Request>
<osc-data:keys>
<osc-data:key>atf</osc-data:key>
<osc-data:key>cams/gkab</osc-data:key>
<osc-data:key>00atf/belsunu.atf</osc-data:key>
</osc-data:keys>
<osc-data:data>
<osc-data:item xmime5:contentType="*/*">
<xop:Include href="cid:request_zip"/>
</osc-data:item>
</osc-data:data>
</osc-meth:Request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--==========boundary========
Content-Type: */*
MIME-Version: 1.0
Content-ID: <request_zip>
Content-Transfer-Encoding: binary
<Encoded ATF file>
--==========boundary========--
- Response from server containing the request id:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:osc-data="http://oracc.org/wsdl/ows.xsd" xmlns:osc-meth="http://oracc.org/wsdl/ows.wsdl">
<SOAP-ENV:Body>
<osc-meth:RequestResponse>
<osc-data:keys>
<osc-data:key>9eju0U</osc-data:key>
</osc-data:keys>
<osc-data:data/>
</osc-meth:RequestResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
- HTTP GET request to ask the server if it's done yet with our
request_id
9eju0U
:
http://oracc.museum.upenn.edu/p/9eju0U
-
We wait until the response from the HTTP GET is a
done
string. Could also beerr_stat
which indicates there's an error, orrun
which indicates it is still working on it. -
Once we know the validation/lemmatisation is ready, send HTTP POST requesting the validation error messages or the lemmatised file:
'Host': 'http://oracc.museum.upenn.edu:8085'
'Content-Transfer-Encoding': '7bit'
'MIME-Version': '1.0'
'Content-Type': 'application/soap+xml'
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xop="http://www.w3.org/2004/08/xop/include"
xmlns:xmime5="http://www.w3.org/2005/05/xmlmime"
xmlns:osc-data="http://oracc.org/wsdl/ows.xsd"
xmlns:osc-meth="http://oracc.org/wsdl/ows.wsdl">
<SOAP-ENV:Body>
<osc-meth:Response>
<osc-data:keys>
<osc-data:key>9eju0U</osc-data:key>
</osc-data:keys>
</osc-meth:Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
- The server will return another HTTP POST message
--==boundary==
Content-Type: application/xop+xml; charset=utf-8; type="application/soap+xml"
Content-Transfer-Encoding: binary
Content-ID: <SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:osc-data="http://oracc.org/wsdl/ows.xsd" xmlns:osc-meth="http://oracc.org/wsdl/ows.wsdl">
<SOAP-ENV:Body>
<osc-meth:ResponseResponse>
<osc-data:keys>
<osc-data:key>done</osc-data:key>
</osc-data:keys>
<osc-data:data>
<osc-data:item xmime5:contentType="*/*">
<xop:Include href="cid:id2"/>
</osc-data:item>
</osc-data:data>
</osc-meth:ResponseResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--== boundary==
Content-Type: */*
Content-Transfer-Encoding: binary
Content-ID: <id2>
<encoded zipped file containing request.log, oracc.log and autolem.atf>
--==boundary==--
At the end of step 6, Nammu unzips the attachment and prints out the contents of:
- oracc.log
- request.log
This will guide the user on how to fix the validation errors of their ATF text.
If it was a lemmatisation, it'll also include the lemmatised version of the ATF sent, which will be displayed in Nammu's text area:
- filename_autolem.atf