XML Logging: Difference between revisions

Line 26: Line 26:
There is a very real difficulty regarding accessing the XML which is passed it a VDF Web Service (at least so far as revisions up to VDF 12.1 are concerned).  The problem is that the original XML is nowhere available to the VDF program.  One possible solution would be to employ some kind of HTTP proxy on the server involved, which would receive the XML (actually the HTTP within which the XML is wrapped) ''before'' it reached IIS, log that, then pass it on to IIS.  However here we are going to concern ourselves only with the best that can be managed from within the VDF programming environment at the moment (November 2007).
There is a very real difficulty regarding accessing the XML which is passed it a VDF Web Service (at least so far as revisions up to VDF 12.1 are concerned).  The problem is that the original XML is nowhere available to the VDF program.  One possible solution would be to employ some kind of HTTP proxy on the server involved, which would receive the XML (actually the HTTP within which the XML is wrapped) ''before'' it reached IIS, log that, then pass it on to IIS.  However here we are going to concern ourselves only with the best that can be managed from within the VDF programming environment at the moment (November 2007).


The trick is to make use of a ''client'' of you service ''within'' the service itself.  This in turn makes doing it a two-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:


  Object oLogSample is a cWebService<br />
  Object oLogSample is a cWebService<br />
Line 40: Line 41:
===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===
Now you need to use and instanciate the client class you have just generated within your service:
Object oLogSample is a cWebService<br />
  Use cWSoLogSample.pkg
  Object oOwnService is a cWSMyWebService
  End_Object  // oOwnService<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==