Web Connection
Web connection 7.15 and wwresposeFile class
Gravatar is a globally recognized avatar based on your email address. Web connection 7.15 and wwresposeFile class
  Kuzma Karbachinskiy
  All
  Dec 7, 2020 @ 01:41pm

Hi Rick,

I do migration from web connection 6.20 to web connection 7.15. Application is very old (over 20 years) and worked with wwresponseFile and wwresponse classes. I have 'No output' problem if I use wwresponseFile and wwresponse classes. If I use wwpageresponse40 class I have styles problem in output because wwresponse class old application has coded style theaters. I investigated it in debugging mode for 6.20 and 7.15 web connections and found very different processHit methods.
Is it possible to use wwresponseFile wwresponse classes in web connection 7.15?

Thank you, Kuzma Karbachinskiy kkarbachinskiy@oneworldonestop.com

Gravatar is a globally recognized avatar based on your email address. re: Web connection 7.15 and wwresposeFile class
  Rick Strahl
  Kuzma Karbachinskiy
  Dec 7, 2020 @ 02:15pm

Kuzma,

Depends on what you're doing with it. Why do you need to use wwResponseFile specifically?

Newer versions pretty much have to use the wwPageResponse or wwPageResponse40 classes as they have different interfaces. There's no inheritance between these classes.

If you want to use wwResponseFile, you can instantiate that class and then assign the output to the wwPageResponse.

In a process method:

FUNCTION ProcessMethod()

loOldResponse = Response
Response = CREATEOBJECT("wwResponse")

* do whatever you have to do

*** Before you're done
loOldResponse.Write( Response.GetOutput() )
Response = loOldResponse

ENDFUNC

Note if you need to write headers or other non-content related things (like cookies) you need to use the new class to do so.

I assume you need to use the old Response HTML generation routines? One way you can do this without too much effort is to start with wwPageResponse40 (which already includes a bunch of the old routines), then add or modify the existing methods with the code from wwResponse.

DEFINE CLASS myPageResponse as wwPageResponse40

* Add new or modify existing methods

ENDDEFINE

You can then specify:

#UNDEFINE WWC_PAGERESPONSE
#DEFINE WWC_PAGERESPONSE      	myPageResponse

in wconnect_override.h. This then uses the your custom page response class.

There are options but at the end of the day you'll want to update your code the more modern class interface, or preferrably using Scripts and Templates. The big benefit of those is that you control the output, so there's no compatibility issue going forward.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Web connection 7.15 and wwresposeFile class
  Kuzma Karbachinskiy
  Rick Strahl
  Dec 14, 2020 @ 08:55am

Hi Rick,

Thank you for the idea. I'll go with.

Thank you, Kuzma Karbachinskiy kkarbachinskiy@oneworldonestop.com

© 1996-2024