Re: [WebDNA] xmlparse of POST

This WebDNA talk-list message is from

2014


It keeps the original formatting.
numero = 111547
interpreted = N
texte = --Apple-Mail=_C377C233-05EA-41B9-9B5D-26A2022F9331 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 That looks like it should work, I don't know why you are doing the = 'actualresponse'. Just do [xmlparse var=3Dxml_var1][RESPONSE][/xmlparse] Just parse out the XML, if your response is all on one level, what you = have will work but if it is layered you will have to go deeper. Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 29 Aug 2014, at 2:15 pm, Diane Blackmore = wrote: > Hi >=20 > I=92m ok with parsing a bunch of XML whereby the XML comes from a POST = request on the page itself (ie. the WebDNA code is generating the = request for the XML via a TCP/IP POST). >=20 > But what happens when the XML code is POST=92d at it from somewhere = else? How do I grab the XML to put it into a variable that can then be = parsed, nodes etc?? >=20 > Using WebDNA unix-Linux Intel Apache Module version 6.2.1 >=20 > Code I would usually use is (assume all variables have been assigned = before snip) >=20 > [text]crlf=3D[unurl]%0D%0A[/unurl][/text] > = [text]the_variables=3Dpaystation=3D_empty&pstn_pi=3D[pstn_pi]&pstn_gi=3D[p= stn_gi]&pstn_ms=3D[pstn_ms]&pstn_am=3D[pstn_am]&website=3D[justdomain][/te= xt] >=20 > [text]Response=3D[TCPConnect = host=3Dwww.paystation.co.nz&port=3DXXX&ssl=3DT][tcpsend skipheader=3DT][!]= > [/!]POST /direct/paystation.dll HTTP/1.1[crlf][!] > [/!]Referer: http://[justdomain][thisURL][crlf][!] > [/!]Host: www.paystation.co.nz[crlf][!] > [/!]Content-Type: application/x-www-form-urlencoded[crlf][!] > [/!]Content-length: [countchars][the_variables][/countchars][crlf][!] > [/!]Connection: close[crlf][!] > [/!][crlf][!] > [/!][the_variables][crlf][!] > [/!][/tcpsend][/TCPConnect][/text] >=20 >=20 > [text show=3Dt]actualresponse=3D[listwords = words=3D[response]&delimiters=3D<][showif = [index]>1][delimiter][word][/showif][/listwords][/text] > =09 > [xmlparse var=3Dxml_var1][actualresponse][/xmlparse] >=20 > [xmlnodes ref=3Dxml_var1&path=3Dnamed:InitiationRequestResponse] > [text secure=3Df][name]=3D[value][/text] > [/xmlnodes] >=20 >=20 > So that=92s all fine, as long as I initiate from the page - I need to = know how to grab the xml contents if its POST=92d from somewhere else. >=20 > My thanks in advance. >=20 > Cheers, >=20 > >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --Apple-Mail=_C377C233-05EA-41B9-9B5D-26A2022F9331 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 That = looks like it should work, I don't know why you are doing the = 'actualresponse'.

Just do [xmlparse = var=3Dxml_var1][RESPONSE][/xmlparse]

Just parse = out the XML, if your response is all on one level, what you have will = work but if it is layered you will have to go = deeper.



Regards

Stuart = Tremain
IDFK Web Developments
AUSTRALIA




On 29 Aug 2014, at 2:15 pm, Diane Blackmore <diane@cohesion.co.nz> = wrote:

Hi

I=92m ok with parsing a bunch = of XML whereby the XML comes from a POST request on the page itself (ie. = the WebDNA code is generating the request for the XML via a TCP/IP = POST).

But what happens when the XML code is = POST=92d at it from somewhere else? How do I grab the XML to put it into = a variable that can then be parsed, nodes = etc??

Using WebDNA unix-Linux Intel = Apache Module version 6.2.1

Code I would = usually use is (assume all variables have been assigned before = snip)

[text]crlf=3D[unurl]%0D%0A[/unurl][/te= xt]
[text]the_variables=3Dpaystation=3D_empty&pstn_pi=3D[pst= n_pi]&pstn_gi=3D[pstn_gi]&pstn_ms=3D[pstn_ms]&pstn_am=3D[pstn_= am]&website=3D[justdomain][/text]

[text]Respo= nse=3D[TCPConnect host=3Dwww.paystation.co.nz&port=3D= XXX&ssl=3DT][tcpsend skipheader=3DT][!]
[/!]POST = /direct/paystation.dll HTTP/1.1[crlf][!]
[/!]Host: www.paystation.co.nz[crlf][!]
[/!]Content-Type: = application/x-www-form-urlencoded[crlf][!]
[/!]Content-length: = [countchars][the_variables][/countchars][crlf][!]
[/!]Connection= : = close[crlf][!]
[/!][crlf][!]
[/!][the_variables][crlf]= [!]
[/!][/tcpsend][/TCPConnect][/text]

=
[text show=3Dt]actualresponse=3D[listwords = words=3D[response]&delimiters=3D<][showif = [index]>1][delimiter][word][/showif][/listwords][/text]
=
[xmlparse = var=3Dxml_var1][actualresponse][/xmlparse]

[xmlno= des = ref=3Dxml_var1&path=3Dnamed:InitiationRequestResponse]
[text= = secure=3Df][name]=3D[value][/text]
[/xmlnodes]
<= br>

So that=92s all fine, as long as I initiate = from the page - I need to know how to grab the xml contents if its = POST=92d from somewhere else.

My thanks in = advance.

Cheers,

<CohesionSig_Diane12.gif>

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Apple-Mail=_C377C233-05EA-41B9-9B5D-26A2022F9331-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] xmlparse of POST (Diane Blackmore 2014)
  2. Re: [WebDNA] xmlparse of POST (Tom Duke 2014)
  3. Re: [WebDNA] xmlparse of POST (Stuart Tremain 2014)
  4. Re: [WebDNA] xmlparse of POST (Diane Blackmore 2014)
  5. Re: [WebDNA] xmlparse of POST (Stuart Tremain 2014)
  6. Re: [WebDNA] xmlparse of POST (Diane Blackmore 2014)
  7. Re: [WebDNA] xmlparse of POST (Stuart Tremain 2014)
  8. [WebDNA] xmlparse of POST (Diane Blackmore 2014)
--Apple-Mail=_C377C233-05EA-41B9-9B5D-26A2022F9331 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 That looks like it should work, I don't know why you are doing the = 'actualresponse'. Just do [xmlparse var=3Dxml_var1][RESPONSE][/xmlparse] Just parse out the XML, if your response is all on one level, what you = have will work but if it is layered you will have to go deeper. Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 29 Aug 2014, at 2:15 pm, Diane Blackmore = wrote: > Hi >=20 > I=92m ok with parsing a bunch of XML whereby the XML comes from a POST = request on the page itself (ie. the WebDNA code is generating the = request for the XML via a TCP/IP POST). >=20 > But what happens when the XML code is POST=92d at it from somewhere = else? How do I grab the XML to put it into a variable that can then be = parsed, nodes etc?? >=20 > Using WebDNA unix-Linux Intel Apache Module version 6.2.1 >=20 > Code I would usually use is (assume all variables have been assigned = before snip) >=20 > [text]crlf=3D[unurl]%0D%0A[/unurl][/text] > = [text]the_variables=3Dpaystation=3D_empty&pstn_pi=3D[pstn_pi]&pstn_gi=3D[p= stn_gi]&pstn_ms=3D[pstn_ms]&pstn_am=3D[pstn_am]&website=3D[justdomain][/te= xt] >=20 > [text]Response=3D[TCPConnect = host=3Dwww.paystation.co.nz&port=3DXXX&ssl=3DT][tcpsend skipheader=3DT][!]= > [/!]POST /direct/paystation.dll HTTP/1.1[crlf][!] > [/!]Referer: http://[justdomain][thisurl][crlf][!] > [/!]Host: www.paystation.co.nz[crlf][!] > [/!]Content-Type: application/x-www-form-urlencoded[crlf][!] > [/!]Content-length: [countchars][the_variables][/countchars][crlf][!] > [/!]Connection: close[crlf][!] > [/!][crlf][!] > [/!][the_variables][crlf][!] > [/!][/tcpsend][/TCPConnect][/text] >=20 >=20 > [text show=3Dt]actualresponse=3D[listwords = words=3D[response]&delimiters=3D<][showif = [index]>1][delimiter][word][/showif][/listwords][/text] > =09 > [xmlparse var=3Dxml_var1][actualresponse][/xmlparse] >=20 > [xmlnodes ref=3Dxml_var1&path=3Dnamed:InitiationRequestResponse] > [text secure=3Df][name]=3D[value][/text] > [/xmlnodes] >=20 >=20 > So that=92s all fine, as long as I initiate from the page - I need to = know how to grab the xml contents if its POST=92d from somewhere else. >=20 > My thanks in advance. >=20 > Cheers, >=20 > >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --Apple-Mail=_C377C233-05EA-41B9-9B5D-26A2022F9331 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 That = looks like it should work, I don't know why you are doing the = 'actualresponse'.

Just do [xmlparse = var=3Dxml_var1][RESPONSE][/xmlparse]

Just parse = out the XML, if your response is all on one level, what you have will = work but if it is layered you will have to go = deeper.



Regards

Stuart = Tremain
IDFK Web Developments
AUSTRALIA




On 29 Aug 2014, at 2:15 pm, Diane Blackmore <diane@cohesion.co.nz> = wrote:

Hi

I=92m ok with parsing a bunch = of XML whereby the XML comes from a POST request on the page itself (ie. = the WebDNA code is generating the request for the XML via a TCP/IP = POST).

But what happens when the XML code is = POST=92d at it from somewhere else? How do I grab the XML to put it into = a variable that can then be parsed, nodes = etc??

Using WebDNA unix-Linux Intel = Apache Module version 6.2.1

Code I would = usually use is (assume all variables have been assigned before = snip)

[text]crlf=3D[unurl]%0D%0A[/unurl][/te= xt]
[text]the_variables=3Dpaystation=3D_empty&pstn_pi=3D[pst= n_pi]&pstn_gi=3D[pstn_gi]&pstn_ms=3D[pstn_ms]&pstn_am=3D[pstn_= am]&website=3D[justdomain][/text]

[text]Respo= nse=3D[TCPConnect host=3Dwww.paystation.co.nz&port=3D= XXX&ssl=3DT][tcpsend skipheader=3DT][!]
[/!]POST = /direct/paystation.dll HTTP/1.1[crlf][!]
[/!]Referer: [thisurl][crlf][">http://[justdomain][thisurl][= crlf][!]
[/!]Host: www.paystation.co.nz[crlf][!]
[/!]Content-Type: = application/x-www-form-urlencoded[crlf][!]
[/!]Content-length: = [countchars][the_variables][/countchars][crlf][!]
[/!]Connection= : = close[crlf][!]
[/!][crlf][!]
[/!][the_variables][crlf]= [!]
[/!][/tcpsend][/TCPConnect][/text]

=
[text show=3Dt]actualresponse=3D[listwords = words=3D[response]&delimiters=3D<][showif = [index]>1][delimiter][word][/showif][/listwords][/text]
=
[xmlparse = var=3Dxml_var1][actualresponse][/xmlparse]

[xmlno= des = ref=3Dxml_var1&path=3Dnamed:InitiationRequestResponse]
[text= = secure=3Df][name]=3D[value][/text]
[/xmlnodes]
<= br>

So that=92s all fine, as long as I initiate = from the page - I need to know how to grab the xml contents if its = POST=92d from somewhere else.

My thanks in = advance.

Cheers,

<CohesionSig_Diane12.gif>

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Apple-Mail=_C377C233-05EA-41B9-9B5D-26A2022F9331-- Stuart Tremain

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebDNA Solutions ... sorry! (1997) URL too Long? (1997) Error: Too many nested [xxx] contexts (1997) Emailer setup (1997) RequiredFields template (1997) Secure Server basic question... (1997) shipping code (1998) [WebDNA] Acceleratin Search / Index Performance in a Formum Service (2013) Submit buttons not working.... (1999) MasterCounter Weirdness (1997) Empty Shopping Carts? (1998) POP Mail Server Reseting (1998) Code to convert relative to absolute URLs in HTML files (2004) Formatting ModDate (2000) using showpage and showcart commands (1996) Showing unopened cart (1997) unable to launch acgi in WebCat (1997) Help!!!! (1997) Music in background (2000) Emailer on NT! (1998)