NetTalk Central

Author Topic: web service, I can not get the xml string  (Read 3939 times)

ramiro

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
web service, I can not get the xml string
« on: November 26, 2014, 11:55:08 AM »
Hi,
I am creating a web service with C8 and NetTalk 6.08.
No use Xfiles, the problem is I can not get the XML string to parse and generate a response, in the log of the web server the POST full featured, no problem, the source code I have is:

...
  p_web.SetValue('_parentPage','reservaciones')
  p_web.publicpage = 1
  if p_web.sessionId = 0 then p_web.NewSession().
  ! Start of "Before Header"
  ! [Priority 5000]
 
  ! End of "Before Header"
  do Header
! [Priority 1200]
  xmlrequest = p_web.GetValue('xml')
  xmlLenght = len(clip(xmlrequest))
 
  packet = ''
  do ProcesaRequest
  ! envĂ­a resultado
  XmlRespLen = len(clip(XmlResp))
  p_web.ParseHTML(XmlResp,1,XmlRespLen,Net:NoHeader)


to check the contents of the variable XMLRequest find it empty

Thanks
best regards
Ramiro M B

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: web service, I can not get the xml string
« Reply #1 on: November 26, 2014, 09:42:43 PM »
what do all the headers of the POST look like?

And you might want to at least update to the latest build of NT6 - I can imagine there are many bugs in 6.08 that have been fixed since then.

cheers
Bruce

ramiro

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: web service, I can not get the xml string
« Reply #2 on: November 27, 2014, 12:44:40 PM »
Hi Bruce,
Thank You for your replay.
This is the POST as seen in the log, the test was performed with the NetDemo.
With regard to updating NetTalk6,  I pay for it?  Thank You.

POST /reservaciones HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Accept-Language: en
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16 ( .NET CLR 3.5.30729; .NET4.0C)
Host: localhost:2350
Content-Length: 1023
Connection: Close

<?xml version="1.0" encoding="UTF-8" ?> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:htn="http://pms.ihotelier.com/HTNGService/services/HTNG2011BService"> <soapenv:Header>

...
etc.
etc.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: web service, I can not get the xml string
« Reply #3 on: November 28, 2014, 12:39:52 AM »
The Xml value is not being populated because the following header is "wrong".

Content-Type: application/x-www-form-urlencoded

It should be

Content-Type: text/xml
or
Content-Type: application/soap+xml

There is another variable one can use for "non xml" content types;
p_web.GetValue('_postdata_')
But I don't think this is available in NetTalk 6.

>> With regard to updating NetTalk6,  I pay for it?
Yes, NetTalk 8 is a Paid upgrade. And NetTalk now requires Stringtheory as well.
https://www.clarionshop.com/secure/checkout.cfm?pid=1447&q=1

cheers
Bruce