NetTalk Central

Author Topic: Web Service method XML tags  (Read 2542 times)

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Web Service method XML tags
« on: September 24, 2014, 03:58:14 PM »
I'm setting up a client to send xml data to my web app. I put the client data into a group in order to generate xml for the Soap methods. No problems there.

However in my web app, I'm receiving this data not as a group but as individual String fields (there are good reasons for this). I discovered that if the XML tags are not the same case, the data is not read in the app's web service method. For example, if the local variable name is Proper case, setting the XML Case option to Upper on the Parameters tab does not correctly generate Upper tags in the PrimeParameters routine (see example below) and therefore the incoming data is not read.

My local variable name is GuidHash.
In PrimeParameters, this is what's generated:
GuidHash = strxml.between(p_web.Nocolon('<GuidHash>',Net:SingleUnderscore+Net:NoSpaces),p_web.Nocolon('</GuidHash>',Net:SingleUnderscore+Net:NoSpaces))

With Upper set as the Parameter's XML Case option, it should be:
GuidHash = strxml.between(p_web.Nocolon('<GUIDHASH>',Net:SingleUnderscore+Net:NoSpaces),p_web.Nocolon('</GUIDHASH>',Net:SingleUnderscore+Net:NoSpaces))

Regards,

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11182
    • View Profile
Re: Web Service method XML tags
« Reply #1 on: September 25, 2014, 06:36:12 AM »
Hi Mark,

so sure if there is a question here, but yes, XML tags are case sensitive.

cheers
Bruce

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Web Service method XML tags
« Reply #2 on: September 25, 2014, 07:55:57 AM »
I don't have a question, I'm reporting a bug. If you set the XML tags to Upper in the Parameters tab option, they are being displayed as UPPER on the WebMethod page, but they are not being generated and searched for as UPPER in the PrimeParameters routine and therefore the incoming data is not found.

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11182
    • View Profile
Re: Web Service method XML tags
« Reply #3 on: September 25, 2014, 10:12:52 PM »
ahh - I understand...


-- fixed for 8.28
« Last Edit: September 25, 2014, 10:33:02 PM by Bruce »

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Web Service method XML tags
« Reply #4 on: September 26, 2014, 01:56:16 PM »
Thanks! FYI, an alternate solution may be to allow editing of the XML Tag field on the Parameters tab when specifying a string. It's currently disabled.

I've found that if you create a parameter and select a field from Local Data, then subsequently change the field name in Local Data, the XML tag text is not updated. The only way currently to correct that is to delete the Parameter and reenter it, selecting the updated name from Local Data.

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11182
    • View Profile
Re: Web Service method XML tags
« Reply #5 on: September 28, 2014, 10:47:52 PM »
I'm not seeing that Mark.
On my side if I change the variable name in the Data pad then the tag changes as well.

Any ideas?

cheers
Bruce

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Web Service method XML tags
« Reply #6 on: September 29, 2014, 08:42:01 AM »
I loaded up the web77 example app and went into the dbCustomer NetWebServiceMethod. I navigated to the Parameters tab and Inserted a new String parameter from a local variable that I created called String1. The Field XML Tag field remains blank until the Paramaters input screen is completed, but eventually the Field XML Tag field displays when you reselect Properties. It shows as String1 and is disabled.

Now if you change the Field Parameter by clicking on the ... box and selecting a different local variable--I created one called String2--the Field XML Tag is neither updated to the new String name nor enabled for editing. The old, invalid Tag (String1) is what displays on the WebService page when the app is running in the browser, but incoming data in the PrimeParameters routine is being scanned for using the correct tag (String2).

The only way to fix all this that I see is to delete the old Parameter and re-enter it from scratch.

I've posted a couple of screen shots after doing the above data entry.

Mark


[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11182
    • View Profile
Re: Web Service method XML tags
« Reply #7 on: November 26, 2014, 12:42:43 AM »
The Field XML Tag field was only supposed to apply to complex types, like Tables, Queues and Groups.
There was however a place where it was misused (and your sequence of events sniffed that out.)

Rather than correct that though - I've just extended the field so it can be used on simple data types as well.

8.33

cheers
Bruce

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Web Service method XML tags
« Reply #8 on: November 26, 2014, 08:53:24 AM »
Sounds good.

Thanks,

Mark