help with SOAP

Brian K. White brian at aljex.com
Tue Nov 14 15:40:47 PST 2006


----- Original Message ----- 
From: "Enrique Arredondo" <henry at vegena.net>
To: <filepro-list at lists.celestial.com>
Sent: Tuesday, November 14, 2006 2:42 PM
Subject: help with SOAP


> Hi,
>
> I'm doing an ACH processing project within filepro with the help of curl 
> command, and now I'm stuck in the parsing of the responce I get from the 
> ACH center. Is there a built in parser in curl ? I tried using "deurl" but 
> no luck.
>
> Here's what I do:
>
> 1. I created the SOAP message in a filepro report:
>
> <?xml version="1.0" encoding="UTF-8" ?>
>    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:xsd=
> schemas.xmlsoap.org/soap/envelope/" 
> xmlns:soapenc="http://schemas.xmlsoap.org/so
> p.org/soap/encoding/" xmlns:ns5="http://test.achex.com" 
> xmlns:ns6="java:com.ache
>    <soap:Body>
>    <ns5:createCheckAuthorization>
>     <credentials href="#id0" />
>
> bla blablablabla.......
>
> 2. After I get the file created with the fields populated , I run this 
> command:
>
> curl --data @request_xml.txt --header 'Content-Type: text/xml' 
> http://blabla.bla.com/soap
>
> NOTE: Once I have this working , I'll run everything internally from the 
> process line. like system noredraw "curl ......" and then read the output
> with "import ascii......."
>
> 3. I get a responce that I have to parse to get the results, I tried 
> changing the </ for a CR+</  but I don't know how to use the tr to do all 
> that. Or is there a parser like "deurl" to work with some xml:sopa like 
> this :
>
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsi="h
> ttp://www.w3.org/2001/XMLSchema-instance" 
> xmlns:soapenc="http://schemas.xmlsoap.
> org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Body 
> env:e
> ncodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><m:createCheckAuthoriza
> tionResponse xmlns:m="http://achex.com"><result 
> xmlns:n1="java:com.achex.webserv
> ices" xsi:type="n1:AuthorizationResponse"><clearerID 
> xsi:type="xsd:string">12251
> </clearerID><details xsi:nil="true"></details><merchantID 
> xsi:type="xsd:string">
> 12251</merchantID><statusCode 
> xsi:type="xsd:string">210</statusCode><statusDispl
> ayDescription xsi:nil="true"></statusDisplayDescription><trackingID 
> xsi:type="xs
> d:string">12251-11140610230000</trackingID></result></m:createCheckAuthorization
> Response></env:Body></env:Envelope>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list


tangental issue: there is a better util now than enurl/deurl for 
encoding/decoding url-encoded text.
enurl/deurl was my first attempt and only took data in the form of a few 
hundred or a few k bytes on the command line.
Now there is urlenc and urldec which work like cat for unlimited size data. 
They also have a command line option to accept a chunk of data as a command 
line argument so they can be dropped in wherever deurl/enurl were already 
being used. There are also options to control the behaviour of how how they 
treat trailing linefeeds and carriage returns on input and output (sometimes 
you want to add it, sometimes you want to strip it, sometimes you want to 
not modify the payload at all whether its in there or not)

http://www.aljex.com/bkw/sco/#urldec

It compiles effortlessly on linux but if you want I can supply linux 
binaries.

Where this relates to your question is that after you parse the xml you 
might need to use urlenc to create chunks of data or urldec to decode them 
but only after parsing (or writing) the xml around the chunks.

And then likely you still wouldn't need them because
A) Likely whatever you use to parse the xml will include a url encode/decode 
function already.
B) Even if you were writing and parsing the xml directly yourself with 
filepro, which is very non-trivial, you'd probably want to write a filepro 
call table library function to do url encode/decode instead of running 
system commands that often. User would be more efficient but no way are you 
going to get that to be reliable.

I have a neat little call table encoder process here:
http://www.aljex.com/bkw/filepro/prc.urlenc.html
just because I realised it could be done in about 3 lines, but I never wrote 
a decoder.

Brian K. White  --  brian at aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



More information about the Filepro-list mailing list