XML Logging: Difference between revisions

From DataFlex Wiki
Jump to navigationJump to search
mNo edit summary
Line 46: Line 46:


  Object oLogSample is a cWebService<br />
  Object oLogSample is a cWebService<br />
   ''Use cWSLogSample.pkg''
   <font color="blue">Use cWSLogSample.pkg''
   ''Object oOwnService is a cWSLogSample''
   Object oOwnService is a cWSLogSample''
   ''End_Object  // oOwnService''<br />
   End_Object  // oOwnService</fount><br />
   { Published = True  }
   { Published = True  }
   { Description = "Interface for sending something to the system" }
   { Description = "Interface for sending something to the system" }
Line 63: Line 63:
   Object oOwnService is a cWSLogSample
   Object oOwnService is a cWSLogSample
   End_Object  // oOwnService<br />
   End_Object  // oOwnService<br />
   ''// LogMsg: The arguments are - 1 Data passed to the method''
   <font color="blue">// LogMsg: The arguments are - 1 Data passed to the method
   ''//                            2 Name of the method (literal)''
   //                            2 Name of the method (literal)
   ''//                            3 Name of the variable (literal)''
   //                            3 Name of the variable (literal)
   ''//                            4 Object handle for type - which will be named "oWS{typeName}"''
   //                            4 Object handle for type - which will be named "oWS{typeName}"
   ''Procedure LogMsg Variant Data String sOp String sName Handle hoObj''
   Procedure LogMsg Variant Data String sOp String sName Handle hoObj
       ''tSoapParameter Param''
       tSoapParameter Param
       ''Handle  hoXML hoDoc''
       Handle  hoXML hoDoc
       ''String  sXML
       String  sXML
       ''Boolean bOK''<br />
       Boolean bOK<br />
       ''Get Create of Desktop U_cXmlDomDocument to hoXML''
       Get Create of Desktop U_cXmlDomDocument to hoXML
       ''Get CreateDocumentElement of hoXML sOp  to hoDoc''<br />
       Get CreateDocumentElement of hoXML sOp  to hoDoc<br />
       ''Get DefineStructParameter of oOwnService hoObj 1 1 sName (psServiceURI(Self)) to Param.SoapParamDef''
       Get DefineStructParameter of oOwnService hoObj 1 1 sName (psServiceURI(Self)) to Param.SoapParamDef
       ''ValueTreeSerializeParameter Data to Param.ValueTree''
       ValueTreeSerializeParameter Data to Param.ValueTree
       ''Get ValueTreeToXml of oOwnService Param.SoapParamDef Param.ValueTree hoDoc to bOK''<br />
       Get ValueTreeToXml of oOwnService Param.SoapParamDef Param.ValueTree hoDoc to bOK<br />
       ''Get psXML of hoXml to sXML
       Get psXML of hoXml to sXML
       ''Send Destroy of hoDoc
       Send Destroy of hoDoc
       ''Send Destroy of hoXML<br />
       Send Destroy of hoXML<br />
       ''// Now you can log sXML in some way...<br />
       // Now you can log sXML in some way...<br />
   ''End_Procedure  // LogMsg''<br />
   End_Procedure  // LogMsg</font><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
   Procedure  SendSomething tSomeDocumentType Doc
       ''Send LogMsg Doc "SendSomething" "Doc" (oWStSomeDocumentType(oOwnService(Self)))''<br />
       <font color="blue">Send LogMsg Doc "SendSomething" "Doc" (oWStSomeDocumentType(oOwnService(Self)))</font><br />
       // Code that actually does stuff...<br />
       // Code that actually does stuff...<br />
   End_Procedure  // SendSomething<br />
   End_Procedure  // SendSomething<br />