XML Logging: Difference between revisions

m
mNo edit summary
Line 28: Line 28:
The trick is to make use of a ''client'' of you service ''within'' the service itself.  This in turn makes doing it a multi-stage process, since one can only create a client once the service is published and acessible.
The trick is to make use of a ''client'' of you service ''within'' the service itself.  This in turn makes doing it a multi-stage process, since one can only create a client once the service is published and acessible.


===Step 1===
====Step 1====
First you define your service:
First you define your service:


Line 39: Line 39:
  End_Object  // oLogSample<br />
  End_Object  // oLogSample<br />


===Step 2===
====Step 2====
Next you need to run the Web Service Client Class Generator (in the VDF Studio: File -> New -> Class -> Clint Web Service Class) on the WSDL for your service (Test Page -> Service Name -> Service Description, then copy the browser's Address window to the Web Service Client Class Generator's WSDL URL window and click "Parse", "Generate Class" and "OK" - plus "Yes" to overwrite if it already exists).
Next you need to run the Web Service Client Class Generator (in the VDF Studio: File -> New -> Class -> Clint Web Service Class) on the WSDL for your service (Test Page -> Service Name -> Service Description, then copy the browser's Address window to the Web Service Client Class Generator's WSDL URL window and click "Parse", "Generate Class" and "OK" - plus "Yes" to overwrite if it already exists).


===Step 3===
====Step 3====
Now you need to use and instanciate the client class you have just generated within your service:
Now you need to use and instanciate the client class you have just generated within your service:


Line 56: Line 56:
  End_Object  // oLogSample<br />
  End_Object  // oLogSample<br />


===Step 4===
====Step 4====
Next you need to  
Next you need to create a procedure that will utilise that client to ''reconstitute'' the XML from the data that your published method receives:
 
Object oLogSample is a cWebService<br />
  Use cWSLogSample.pkg
  Object oOwnService is a cWSLogSample
  End_Object  // oOwnService<br />
  // LogMsg:
  Procedure LogMsg Variant Data String sOp String sName Handle hoObj
  End_Procedure  // LogMsg<br />
  { Published = True  }
  { Description = "Interface for sending something to the system" }
  Procedure  SendSomething tSomeDocumentType Doc<br />
      // Code that actually does stuff...<br />
  End_Procedure  // SendSomething<br />
End_Object  // oLogSample<br />


==Replaying logged XML==
==Replaying logged XML==