Jul 21, 2014; 16:44
F R Alston
incoming soap request
Hello List,
I'm working on an incoming SOAP request project using Lasso 8.5 and Filemaker 11. I initially thought that the client could send the XML in a request that I could setup to be received as a REST request. I made a sample page for this, tested it with SoupUI (smartbear.com) and it worked for what I needed.
The client now wants to send as a SOAP request. I know nothing about SOAP with Lasso other than an older TOTW project and the reference in the Lasso 8.5 manual.
The XML that I will receive is pretty big and I will only be reading it into a new Filemaker 11 record with each request -- parsing only the bits that I need before sending it to Filemaker through an inline. The page code that I put together (sample below) takes the incoming request (to myurl.com/mypage.lasso), parses it into variables, creates a record and works for what I need. My question to the list: is there a way to integrate what I have already created into a received SOAP request through rpc.lassoapp? If I can accept and parse the XML with this code, as a REST request, is there a way to do the same with an incoming SOAP request?
Some of my page code is below, having edited out most of the content variables for this email. // for my own notes.
<?xml version='1.0' encoding='UTF-8'?>
<?LassoScript
// Protect from posting Lasso errors in the SOAP/REST reply
Protect;
// Cast the XML into a variable. Parse out the prj namespace.
var:'SOAPEnvelope' = (Client_PostArgs);
var:'XMLEnvelope' = (XML: $SOAPEnvelope);
var:'prj' = (String_Replace: ($XMLEnvelope), -Find='prj:', -Replace='');
var:'lt' = (String_Replace: ($prj), -Find='<', -Replace='<');
var:'gt' = (String_Replace: ($lt), -Find='>', -Replace='>');
// Extract some data that I need to populate the database.
var:'StandardAttributes' = (XML: $gt)->(Extract: '//Project/StandardAttributes/ProjectDescription');
var:'Status' = (XML: $gt)->(Extract: '//SubProjects/SubProject/StandardAttributes/Status/text()');
var:'Status' = $Status->(Get:1);
var:'CSRName' = (XML: $gt)->(Extract: '//SubProjects/SubProject/StandardAttributes/CSRName/text()');
var:'CSRName' = $CSRName->(Get:2);
var:'TimeStamp' = (Date_Format:(Date_GetCurrentDate), -DateFormat='%m/%d/%Y %H:%M:%S');
// Create and populate a record in the database
Inline: -Database= 'test', -Table='xml',=85=85....'Status'=($Status), 'CSR'=($CSRName), 'DateImport'=($TimeStamp), -add;
/Inline;
/Protect;
?>
// Reply to the request
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<Time><?LassoScript Date_Format:(Date_GetCurrentDate), -DateFormat='%m/%d/%Y %H:%M'; ?></Time>
<ns1:jobnumber.lasso>
<SubProjID><?LassoScript protect; $SubProjID; /protect; ?></SubProjID>
<looptest><?LassoScript protect; Loop:($StandardAttributes->Size); $StandardAttributes->(Get:(Loop_Count)); /Loop;/protect; ?></looptest>
</ns1:jobnumber.lasso>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Thanks for the input,
Rolando
#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jul 21, 2014; 14:07
Steve Piercy - Website Builder
Re: incoming soap request