XML Logging: Difference between revisions

Line 57: Line 57:


====Step 4====
====Step 4====
Next you need to create a procedure that will utilise that client to ''reconstitute'' the XML from the data that your published method receives:
Next you need to create a procedure that will utilise that client to ''reconstitute'' the XML from the data that your published method receives and call that as the first thing each of your published methods does:


  Object oLogSample is a cWebService<br />
  Object oLogSample is a cWebService<br />
Line 64: Line 64:
   End_Object  // oOwnService<br />
   End_Object  // oOwnService<br />
   // LogMsg:  
   // LogMsg:  
   Procedure LogMsg Variant Data String sOp String sName Handle hoObj
   ''Procedure LogMsg Variant Data String sOp String sName Handle hoObj''
   End_Procedure  // LogMsg<br />
      ''tSoapParameter Param''
      ''Handle  hoXML hoDoc''
      ''String  sXML
      ''Boolean bOK''<br />
      ''Get Create of Desktop U_cXmlDomDocument to hoXML''
      ''Get CreateDocumentElement of hoXML sOp  to hoDoc''<br />
      ''Get DefineStructParameter of oOwnService hoObj 1 1 sName ;''
                                  ''(psServiceURI(Self)) to Param.SoapParamDef''
      ''ValueTreeSerializeParameter Data to Param.ValueTree''
      ''Get ValueTreeToXml of oOwnService Param.SoapParamDef ;''
                                  ''Param.ValueTree hoDoc to bOK''<br />
      ''Get psXML of hoXml to sXML
      ''Send Destroy of hoDoc
      ''Send Destroy of hoXML<br />
      ''// Now you can log sXML in some way...<br />
   ''End_Procedure  // LogMsg''<br />
   { Published = True  }
   { Published = True  }
   { Description = "Interface for sending something to the system" }
   { Description = "Interface for sending something to the system" }
   Procedure  SendSomething tSomeDocumentType Doc<br />
   Procedure  SendSomething tSomeDocumentType Doc
      ''Send LogMsg Doc "SendSomething" "Doc" (oWStSomeDocumentType(oOwnService(Self)))''<br />
       // Code that actually does stuff...<br />
       // Code that actually does stuff...<br />
   End_Procedure  // SendSomething<br />
   End_Procedure  // SendSomething<br />