Home Forum Download/Upload Links Search

NetTalk User Group

NetTalk User Group Meeting!
Live Webinar!
Saturday Nov. 16 
7am PST
Click Here To Register!
Home arrow Forum arrow NetTalk E-Mailarrow E-Mail - Ask For Helparrow manually creating a SOAP response
NetTalk Central
April 23, 2014, 03:21:55 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the NetTalk Central Forums!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: manually creating a SOAP response  (Read 475 times)
JPMacDonald
Jr. Member
**
Posts: 72


View Profile Email
« on: May 16, 2012, 12:23:54 PM »

I have been building upon the SOAP web server example and am in a situation where I need to build the SOAP response myself rather than using xFIles and data from a queue, which works quite well by the way. In the example application after populating the queue a call is made to:

Xml.Save(StudentResult)

Which seems to populate the reference field xml.xmlData and xml.xmlDatalen

Armed with that little bit of information I used this code to try and put my SOAP response in play:

   xml.xmlData    &= myXmlString[1: LEN(Clip(myXmlString))]
   xml.xmlDataLen = LEN(Clip(myXmlString))

I can see that xml.xmlData does reference my content but after this next line of code is executed I get a Memory Block Free’d Twice error.

    p_web.ParseHTML(Xml.XmlData,1,Xml.XmlDataLen,Net:NoHeader)

Can anyone help me to get around this hurdle?

Thanks

Parker
Logged
Bruce
Global Moderator
Hero Member
*****
Posts: 6394



View Profile
« Reply #1 on: May 16, 2012, 09:10:32 PM »

Hi Parker,

If you don't want to use the xFiles string, then don't use it. You have a couple simple options;

str   string(16000)

  code
  str = whatever
  p_web.ParseHTML(str,1,len(clip(str)),Net:NoHeader)

This is fine if you're pretty sure the string will be less than the size you declared. (you can make the declaration bigger if you like).

Indeed in your code;
    p_web.ParseHTML(myXmlString,1,LenClip(myXmlString)),Net:NoHeader)


If you must have a dynamic length string then perhaps use StringTheory;

str   StringTheory
  code
  str.SetValue(whatever)
  p_web.ParseHTML(str.GetValue(),1,str.Length(),Net:NoHeader)

The reason it gives the error BTW is because you've not cleared xml.xmlData after using it. ie

  xml.xmlData &= NULL

after the ParseHTML will probably do the trick.

cheers
Bruce



Logged
JPMacDonald
Jr. Member
**
Posts: 72


View Profile Email
« Reply #2 on: May 17, 2012, 03:56:06 AM »

Hey Bruce,

I like xFiles just fine, in fact it is used for 90% of the SOAP responses in this particular application. The one odd-ball is a complicated (for me anyway) nested structure that I needed to return but I don't have enough grey cells to make it work with xFiles.

This statement on its own still causes the Memory Block Free'd Twice error:

p_web.ParseHTML(myXmlString,1,LEN(Clip(myXmlString)),Net:NoHeader)

but putting the xml.xmlData &= NULL after the ParseHtml works just fine.

Thanks for the help and ideas, much appreciated as always.

Regards

Parker
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Login Form

Welcome Guest.






Lost Password?
No account yet? Register
home contact search contact search