NetTalk Central

Author Topic: SOAP ACTION - does it have to be a GROUP?  (Read 3837 times)

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
SOAP ACTION - does it have to be a GROUP?
« on: November 03, 2014, 03:56:12 AM »
Hello again,

another question....

The Web77 example has the SOAPACTION stored ina GROUP.

Does it mandatory have to be a GROUP?
Code: [Select]
Action_Group    GROUP
Customer_Action   STRING(20)
                END

The table, which will be written to, has also the name CUSTOMER.

In the "AutoService:<filename>  ROUTINE" I see that the server seems to expect a Value names "LOWER(<filename>_Action)". Those variable are all declared in source by the template.

As I have several NetWebServerMethods on several Tables, I then would need
Customer_Action
Product_Action
Employee_Action
whatever_Action each?

However, when I add them all to a GROUP, the server then every whatever_Action, none execpt one is needed.

Code: [Select]
  ! End of "Start of AutoService: Routine"
  case lower(<filename>_Action)
  of 'insert'
  orof 'add'
    ! Start of "Before Insert AutoService: Routine"
    ! [Priority 4000]
    dbgView('AutoService:<filename> We just received ' & records(q:<filename>) & '  Records in records(q:<filename>) from Client ')
    ! End of "Before Insert AutoService: Routine"
    Loop x = 1 to records(q:<filename>)
      get(q:<filename>,x)
      do InsertRecord:<filename>
    end
  of 'update'
   ...... etc

I assume, that everything you do, Bruce, has some deeper reason. So - what is the reason behind this stuffing into a GROUP?

Or can we have simple local (global?) variables for each action, adding them as a STRING to the Parameters, without causing harm?

Thanks so far,
Wolfgang





Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: SOAP ACTION - does it have to be a GROUP?
« Reply #1 on: November 03, 2014, 10:59:32 PM »
>> The Web77 example has the SOAPACTION stored in a GROUP.

where?
I'm not seeing that myself....

cheers
Bruce

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
Re: SOAP ACTION - does it have to be a GROUP?
« Reply #2 on: November 04, 2014, 02:25:47 AM »
see this screenshot from the DataPad of Client.APP in WebServiceRequiresXFiles (77)





[attachment deleted by admin]

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
Re: SOAP ACTION - does it have to be a GROUP?
« Reply #3 on: November 04, 2014, 05:16:15 AM »
Bruce,
I got it now.....

You made it a GROUP, because you can easily append it value into the XML.

Code: [Select]
   xml.append = 1
    xml.DontCloseTags = 1
    Inventory_Action = 'insert'
    xml.save(InventoryAction_Group,'','')      

My solution is now to have one Action_Group per Table / Method.

However..... XML is case-sensitive.....

The Client sends INVENTORY_ACTION, while the Server expects AsIs-CASE: p_web.Nocolon('<Inventory_Action>

Code: [Select]
   Clear(InventoryAction_Action)
    InventoryAction_Action = strxml.between(p_web.Nocolon('<Inventory_Action>',
                                                                            Net:SingleUnderscore+Net:NoSpaces),
                                            p_web.Nocolon('</Inventory_Action>',
                                                                            Net:SingleUnderscore+Net:NoSpaces)
                                           )

My workaround is to repeat that particular line inthe next embed, but with p_web.Nocolon('<INVENTORY_ACTION>)  etc.

For now it works.
If this is not changeable, because ot the nature of XML, you may add a note into the manual.

bye
Wolfgang
« Last Edit: November 04, 2014, 05:18:31 AM by Wolfgang Orth »