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:

WebCat2b12 CGI Mac - [shownext] problem (1997) emailer on Windows Beta 18 (1997) Interfacing WebMerchant to www.fedex.com (1997) Return records from another (1997) Uppdate Qty (2000) WC2b15 - [HTMLx]...[/HTMLx] problems (1997) WCS Newbie question (1997) HELP WITH DATES (1997) [WebDNA] some tests (2011) Replacing a Word (1999) Summing fields (1997) Browser Check for WebDNA compatability (1999) Printing a final order (1997) MacWorld NY (2000) Test .... (2002) Problems with [Applescript] (1997) Reverse WHOIS (2003) [WebDNA] Advice required (2009) Generating unique SKU from [cart] (1997) Email/Sendmail in WEBDNA has stopped... (2004)