XML Logging: Difference between revisions
From DataFlex Wiki
Jump to navigationJump to search
m
no edit summary
mNo edit summary |
|||
Line 46: | Line 46: | ||
Object oLogSample is a cWebService<br /> | Object oLogSample is a cWebService<br /> | ||
<font color="blue">Use cWSLogSample.pkg'' | |||
Object oOwnService is a cWSLogSample'' | |||
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 /> | ||
<font color="blue">// LogMsg: The arguments are - 1 Data passed to the method | |||
// 2 Name of the method (literal) | |||
// 3 Name of the variable (literal) | |||
// 4 Object handle for type - which will be named "oWS{typeName}" | |||
Procedure LogMsg Variant Data String sOp String sName Handle hoObj | |||
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</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 | ||
<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 /> |