Quantcast
Channel: West Wind Message Board Messages
Viewing all 10393 articles
Browse latest View live

Re: Sharing HTML blocks across pages - one best way?

$
0
0
Re: Sharing HTML blocks across pages - one best way?
Web Connection
Re: Sharing HTML blocks across pages - one best way?
Feb. 26, 2015
01:24 am
4AI0312AFShow this entire thread in new window
Gratar Image based on email address
From:Thierry Nivelet (FoxInCloud)
To:Rick Strahl
another question about the same project.

some of the HTML blocks should be in a central 'procedure' file shaped as a template; eg:

<% function xx(parm) if m.parm %><html><% endif endfunc %><% function yy(parm) if m.parm %><html><% endif endfunc %>

In process.onProcessInit, I need to:
(1) turn this file into a regular VFP prg, each function returning an HTML string
(2) compile if .fxp is outdated
(3) set procedure to this prg/fxp

other pages will be able to do this:

<%=xx(parm)%>

how can I do (1) above?


No but remember this is FoxPro so you have LOTS of options:

Import a plain file without:

<%= FILETOSTR(Config.cHtmlPagePath + "LeftSideBar.wws") %>

Import and run as a Template (ie. expand <%= %> expressions)

<%= MergeTextFromFile( Config.cHtmlPagePath + "LeftSideBar.wws" ) %>

Cache included text:

<%= CacheFile( Config.cHtmlPagePath + "Header.wws",0 ) %>

Cache and merge:

<%= CacheFile( MergeTextFromFile( Config.cHtmlPagePath + "LeftSideBar.wws" ),0 ) %>

+++ Rick ---


Hi,

Starting to move a wConnect site from HTML-in-prg style to scripting style (.ExpandTemplate() and/or .ExpandScript() and/or template script-mapped extension).

Purpose: easily share existing HTML with a design agency, and easily integrate new HTML

Wondering how to share HTML code blocks across pages
eg, considering this block of HTML stored in head.htm

<!DOCTYPE html><htmllang="fr"><head><title><%=variable%></title> ....</head>

1/ how to make sure all pages in site include this block?
SSI directives are very handy because supported by all web servers
a typical SSI directive is:

<!--#include virtual=head.htm -->>

Does wConnect support SSI directive?

2/ what is the best practice to make sure 'variable' is available when page is generated?
- use a 'private' variable (.ExpandTemplate() and/or .ExpandScript())
- move all code generating variable into a code block inside head.htm?

Also looking for wConnect user feedback/advice/tricks ...

Thanks,




-- thn (FoxInCloud)


Re: Sharing HTML blocks across pages - one best way?

$
0
0
Re: Sharing HTML blocks across pages - one best way?
Web Connection
Re: Sharing HTML blocks across pages - one best way?
Feb. 26, 2015
12:32 pm
4AI0QVSHDShow this entire thread in new window
Gratar Image based on email address
From:Carl Chambers
To:Thierry Nivelet (FoxInCloud)
Hi Thierry,

I am by no means a seasoned WebConnect developer but this thread caught my attention because I'm doing something similar. If I'm heading down the wrong path on this, hopefully someone will point out the flaw in my thinking.

In the site I am working on, almost all pages are displayed via a Process method called "ShowPage".

http://localhost/mySite/showpage.psp?page=somepage

The page name passed in the querystring is also the file name of the template file - in this case, "somepage.wc".

The ShowPage method looks something like this...

*************************************************************FUNCTION ShowPage(tcPage)*------------------------LOCAL lcPage, lcTemplateFile, llContinue, lcTitleIF NOT EMPTY(m.tcPage) && called internally lcPage = m.tcPageELSE lcPage = REQUEST.QueryString("PAGE")ENDIF lcPage = LOWER(JUSTSTEM(m.lcPage)) lcTemplateFile = ADDBS(THIS.cTemplatesPath) ; + ADDBS(THIS.cLanguage) + m.lcPage + ".wc"IF NOT FILE(m.lcTemplateFile)** Fatal Error.* The Error Page will be output by THIS.ProcessError() called by THIS.FileNotFound()*THIS.FileNotFound(m.lcTemplateFile)RETURNENDIF llContinue = .T. DOCASE*************************************************************CASE m.lcPage = "this" lcTitle = "Title for THIS page"*- set some other memvars *************************************************************CASE m.lcPage = "that" llContinue = THIS.Authenticate() && authentication requiredIF m.llContinue lcTitle = "Title for THAT page"*- set some other memvarsENDIF*************************************************************CASE m.lcPage = "another" lcTitle = "Title for ANOTHER page"*- set some other memvars *************************************************************OTHERWISE lcTitle = CON_DEFAULTTITLE*************************************************************ENDCASEIF m.llContinueLOCAL lcCSS, lcScriptsPRIVATE pcHeader, pcMenu, pcFooter lcCSS = THIS.GetCSS(m.lcPage) lcScripts = THIS.GetScriptsHead(m.lcPage) pcHeader = THIS.GetHeader(m.lcTitle, m.lcCSS, m.lcScripts)** The Header MUST exist.*IF NOT EMPTY(m.pcHeader)** The Menu and Footer are used by almost all pages.* If the following functions return an empty string,* these HTML blocks are not required - carry on.* If these functions return .NULL., an error occurred* (such as a missing template file) and the error* page has already been sent to the browser.* In this case, bail out.* pcMenu = THIS.GetMenu(m.lcPage)IF NOT ISNULL(m.pcMenu) lcScripts = THIS.GetScriptsBody(m.lcPage) pcFooter = THIS.GetFooter(m.lcPage, m.lcScripts)IF NOT ISNULL(m.pcFooter) Response.ExpandTemplate(m.lcTemplateFile)ENDIFENDIFENDIFENDIFENDFUNC* EOF PSPProcess::ShowPage

Each of the "Get" methods builds an HTML fragment according to the page being displayed. These fragments are assigned to PRIVATE MEMVARS in the .WC template file.

My basic template file looks like this...

<!DOCTYPE html><htmllang="en"><%= pcHeader %><body><%= pcMenu %><!-- Wrapper -->><divclass="wrapper"><br /><divclass="container"><!----------------- INSERT CONTENT HERE ----------------->></div><!-- / .container -->></div><!-- / .wrapper -->><!-- Footer -->><%= pcFooter %></body></html>

I design a static HTML file in Visual Studio Express Web with the Header, Menu and Footer hard-coded. Once I have the appearance the way I want it, I copy the HTML content from between the WRAPPER/CONTAINER tags into the bare bones template above, insert any other <%= variables %> as needed, and Save As the final template.

I also use other small HTML fragments stored in separate text files.
For example, here is the GetMenu() method...

FUNCTION GetMenu(tcPage)*------------------------------LOCAL lcTemplateFile tcPage = LOWER(JUSTSTEM(m.tcPage))DOCASE********************************CASE m.tcPage = "login"RETURN""********************************OTHERWISE lcTemplateFile = ADDBS(THIS.cTemplatesPath) ; + ADDBS(THIS.cLanguage) + "mainmenu.wc"********************************ENDCASEIF NOT FILE(m.lcTemplateFile)THIS.FileNotFound(m.lcTemplateFile)** The error page was returned by THIS.ProcessError()*RETURN .NULL.ENDIFLOCAL lcMenuClass, lcTemplateText, lnPos1, lnPos2, lcStringIF"lookup" $ m.tcPage** Any "Lookup" pages have a different class for the* top menu whose position is not fixed on a small device.* lcMenuClass = "navbar navbar-default navbar-lookup-top"ELSE lcMenuClass = "navbar navbar-default navbar-fixed-top"ENDIF lcTemplateText = FILETOSTR(m.lcTemplateFile)* * Find the menu option for the page to be displayed * and add the keyword "active" to the class name * so that it is "highlighted". * lnPos1 = ATC(m.tcPage,m.lcTemplateText)IF m.lnPos1 > 0 lcString = [<li class="dropdown] lnPos2 = RATC(m.lcString,LEFT(m.lcTemplateText,m.lnPos1)) lcTemplateText = STUFF(m.lcTemplateText,m.lnPos2 + LEN(m.lcString),0," active")ENDIF lcTemplateFile = ADDBS(THIS.cTemplatesPath) ; + ADDBS(THIS.cLanguage) ; + IIF(EMPTY(THIS.cAuthenticatedUser), ;"loginmenu.wc","accountmenu.wc") lcAcctMenuText = FILETOSTR(m.lcTemplateFile)* * Merge the text. * The 2nd parameter MUST be passed as .T. because <<tcPage>> * is in lcAcctMenuText and <<lcAcctMenuText>> is in * lcTemplateText. * lcTemplateText = TEXTMERGE(m.lcTemplateText,.T.)RETURN m.lcTemplateTextENDFUNC* EOF PSPProcess::GetMenu

Again, if my approach is asking for trouble, I hope that someone will point it out.
If it gives you any ideas, that's cool.

Carl


Hi,

Starting to move a wConnect site from HTML-in-prg style to scripting style (.ExpandTemplate() and/or .ExpandScript() and/or template script-mapped extension).

Purpose: easily share existing HTML with a design agency, and easily integrate new HTML

Wondering how to share HTML code blocks across pages
eg, considering this block of HTML stored in head.htm

<!DOCTYPE html><htmllang="fr"><head><title><%=variable%></title> ....</head>

1/ how to make sure all pages in site include this block?
SSI directives are very handy because supported by all web servers
a typical SSI directive is:

<!--#include virtual=head.htm -->>

Does wConnect support SSI directive?

2/ what is the best practice to make sure 'variable' is available when page is generated?
- use a 'private' variable (.ExpandTemplate() and/or .ExpandScript())
- move all code generating variable into a code block inside head.htm?

Also looking for wConnect user feedback/advice/tricks ...

Thanks,


Re: Sharing HTML blocks across pages - one best way?

$
0
0
Re: Sharing HTML blocks across pages - one best way?
Web Connection
Re: Sharing HTML blocks across pages - one best way?
Feb. 26, 2015
03:12 pm
4AI0WL0XSShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Carl Chambers
I would probably look into some other way to do this to avoid having to go through ShowPage.psp which is pretty ugly.

Instead if you're handling all your pages this way in this process class you can take over RouteRequest() and put whatever is in ShowPage there. You can override that method and just copy that code into your process class. Most of the code in that method has to do with the Web Control framework which you can leave alone or throw out since you don't use it.

Specifically you can override this behavior:

CASEthis.nPageScriptMode = 1 AND FILE(lcPhysical) Response.ExpandTemplate(lcPhysical)

and you can hook your code into there.

The end result then will be that you can just SomePage.psp instead of ShowPage.psp?page=SomePage.psp, which is much more natural both from the URL and handling of the code.

Looking at the code in RouteRequest() that code sure could use some factoring :-)

+++ Rick ---


Hi Thierry,

I am by no means a seasoned WebConnect developer but this thread caught my attention because I'm doing something similar. If I'm heading down the wrong path on this, hopefully someone will point out the flaw in my thinking.

In the site I am working on, almost all pages are displayed via a Process method called "ShowPage".

http://localhost/mySite/showpage.psp?page=somepage

The page name passed in the querystring is also the file name of the template file - in this case, "somepage.wc".

The ShowPage method looks something like this...

*************************************************************FUNCTION ShowPage(tcPage)*------------------------LOCAL lcPage, lcTemplateFile, llContinue, lcTitleIF NOT EMPTY(m.tcPage) && called internally lcPage = m.tcPageELSE lcPage = REQUEST.QueryString("PAGE")ENDIF lcPage = LOWER(JUSTSTEM(m.lcPage)) lcTemplateFile = ADDBS(THIS.cTemplatesPath) ; + ADDBS(THIS.cLanguage) + m.lcPage + ".wc"IF NOT FILE(m.lcTemplateFile)** Fatal Error.* The Error Page will be output by THIS.ProcessError() called by THIS.FileNotFound()*THIS.FileNotFound(m.lcTemplateFile)RETURNENDIF llContinue = .T. DOCASE*************************************************************CASE m.lcPage = "this" lcTitle = "Title for THIS page"*- set some other memvars *************************************************************CASE m.lcPage = "that" llContinue = THIS.Authenticate() && authentication requiredIF m.llContinue lcTitle = "Title for THAT page"*- set some other memvarsENDIF*************************************************************CASE m.lcPage = "another" lcTitle = "Title for ANOTHER page"*- set some other memvars *************************************************************OTHERWISE lcTitle = CON_DEFAULTTITLE*************************************************************ENDCASEIF m.llContinueLOCAL lcCSS, lcScriptsPRIVATE pcHeader, pcMenu, pcFooter lcCSS = THIS.GetCSS(m.lcPage) lcScripts = THIS.GetScriptsHead(m.lcPage) pcHeader = THIS.GetHeader(m.lcTitle, m.lcCSS, m.lcScripts)** The Header MUST exist.*IF NOT EMPTY(m.pcHeader)** The Menu and Footer are used by almost all pages.* If the following functions return an empty string,* these HTML blocks are not required - carry on.* If these functions return .NULL., an error occurred* (such as a missing template file) and the error* page has already been sent to the browser.* In this case, bail out.* pcMenu = THIS.GetMenu(m.lcPage)IF NOT ISNULL(m.pcMenu) lcScripts = THIS.GetScriptsBody(m.lcPage) pcFooter = THIS.GetFooter(m.lcPage, m.lcScripts)IF NOT ISNULL(m.pcFooter) Response.ExpandTemplate(m.lcTemplateFile)ENDIFENDIFENDIFENDIFENDFUNC* EOF PSPProcess::ShowPage

Each of the "Get" methods builds an HTML fragment according to the page being displayed. These fragments are assigned to PRIVATE MEMVARS in the .WC template file.

My basic template file looks like this...

<!DOCTYPE html><htmllang="en"><%= pcHeader %><body><%= pcMenu %><!-- Wrapper -->><divclass="wrapper"><br /><divclass="container"><!----------------- INSERT CONTENT HERE ----------------->></div><!-- / .container -->></div><!-- / .wrapper -->><!-- Footer -->><%= pcFooter %></body></html>

I design a static HTML file in Visual Studio Express Web with the Header, Menu and Footer hard-coded. Once I have the appearance the way I want it, I copy the HTML content from between the WRAPPER/CONTAINER tags into the bare bones template above, insert any other <%= variables %> as needed, and Save As the final template.

I also use other small HTML fragments stored in separate text files.
For example, here is the GetMenu() method...

FUNCTION GetMenu(tcPage)*------------------------------LOCAL lcTemplateFile tcPage = LOWER(JUSTSTEM(m.tcPage))DOCASE********************************CASE m.tcPage = "login"RETURN""********************************OTHERWISE lcTemplateFile = ADDBS(THIS.cTemplatesPath) ; + ADDBS(THIS.cLanguage) + "mainmenu.wc"********************************ENDCASEIF NOT FILE(m.lcTemplateFile)THIS.FileNotFound(m.lcTemplateFile)** The error page was returned by THIS.ProcessError()*RETURN .NULL.ENDIFLOCAL lcMenuClass, lcTemplateText, lnPos1, lnPos2, lcStringIF"lookup" $ m.tcPage** Any "Lookup" pages have a different class for the* top menu whose position is not fixed on a small device.* lcMenuClass = "navbar navbar-default navbar-lookup-top"ELSE lcMenuClass = "navbar navbar-default navbar-fixed-top"ENDIF lcTemplateText = FILETOSTR(m.lcTemplateFile)* * Find the menu option for the page to be displayed * and add the keyword "active" to the class name * so that it is "highlighted". * lnPos1 = ATC(m.tcPage,m.lcTemplateText)IF m.lnPos1 > 0 lcString = [<li class="dropdown] lnPos2 = RATC(m.lcString,LEFT(m.lcTemplateText,m.lnPos1)) lcTemplateText = STUFF(m.lcTemplateText,m.lnPos2 + LEN(m.lcString),0," active")ENDIF lcTemplateFile = ADDBS(THIS.cTemplatesPath) ; + ADDBS(THIS.cLanguage) ; + IIF(EMPTY(THIS.cAuthenticatedUser), ;"loginmenu.wc","accountmenu.wc") lcAcctMenuText = FILETOSTR(m.lcTemplateFile)* * Merge the text. * The 2nd parameter MUST be passed as .T. because * is in lcAcctMenuText and is in * lcTemplateText. * lcTemplateText = TEXTMERGE(m.lcTemplateText,.T.)RETURN m.lcTemplateTextENDFUNC* EOF PSPProcess::GetMenu

Again, if my approach is asking for trouble, I hope that someone will point it out.
If it gives you any ideas, that's cool.

Carl


Hi,

Starting to move a wConnect site from HTML-in-prg style to scripting style (.ExpandTemplate() and/or .ExpandScript() and/or template script-mapped extension).

Purpose: easily share existing HTML with a design agency, and easily integrate new HTML

Wondering how to share HTML code blocks across pages
eg, considering this block of HTML stored in head.htm

<!DOCTYPE html><htmllang="fr"><head><title><%=variable%></title> ....</head>

1/ how to make sure all pages in site include this block?
SSI directives are very handy because supported by all web servers
a typical SSI directive is:

<!--#include virtual=head.htm -->>

Does wConnect support SSI directive?

2/ what is the best practice to make sure 'variable' is available when page is generated?
- use a 'private' variable (.ExpandTemplate() and/or .ExpandScript())
- move all code generating variable into a code block inside head.htm?

Also looking for wConnect user feedback/advice/tricks ...

Thanks,



Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Re: Sharing HTML blocks across pages - one best way?

$
0
0
Re: Sharing HTML blocks across pages - one best way?
Web Connection
Re: Sharing HTML blocks across pages - one best way?
Feb. 27, 2015
12:54 am
4AJ01YIMXShow this entire thread in new window
Gratar Image based on email address
From:Thierry Nivelet (FoxInCloud)
To:Carl Chambers
Hi Carl,

Thanks for sharing your experience ... obviously we're facing the same issue!

The project is to refresh the design of http://www.machpro.fr/, made 3 year ago. Initial project was kinda 'easy': designer would produce static HTML files with sample assets (texts and images); we could simply cut and paste the HTML fragment into the program, add a couple of <> here and there, some textmerge and we were done.

It's a little more tricky now as we want to preserve the structure of HTML blocks (modeled on the data), data in <> (cursor fields, functions, etc.), and change CSS and/or the way HTML modules are arranged (mainly change the containing blocks and their arrangement, probably insert some <span> here and there to add icons and the like.

What I want to do is: extract HTML from the code we have, store into files so that the design agency can:
(1) view the present site as is on localhost (without wConnect running)
(2) recycle the HTML blocks while changing CSS classes and style sheet
(3) upload the files to a test site (with wConnect) where we can see the live result

what we are doing:
1/ In the existing programs:
- isolate the HTML blocks into separate procedures (typically a page would break into 5-6 procs)
- produce HTML only with text ... endtext
- remove all parameters to procedures, use default instead
- rename the procedures that build HTML using a naming convention (such as 'cHTML_xxx)
- add a 'dynamic' CSS class to any HTML tag having a <> somewhere

2/ write a program that will build HTML templates; for each procedure that builds HTML:
- using aprocinfo(), extract from source code
- copy to a file named the same (encoded in utf-8)
- replace text ... endtext by %> ... <%
- replace by:

<!--#include virtual=[file named the same as procedure] -->>

- replace < ... > by <%= ... %>
- for each tag having a <> somewhere, add a block like
<!-- static -->><!-- /static -->>

- in the page header add:
<!-- static -->><style> .dynamic {display:none;}<style><!-- /static -->>

- in the process class, replace calls to procedure by
this.expandTemplate('file named like previous procedure')

xxxProcess.expandTemplate() does:

&& (pseudo-code) * replace <!--#include virtual=[file named the same as procedure] --> by source file * remove <!-- static --> ... <!-- /static --> blocks * do the regular expandTemplate() job

so far, we've identified over 200 HTML blocks in this site; total is 600 procedures and 25,000 LOC.


Hi Thierry,

I am by no means a seasoned WebConnect developer but this thread caught my attention because I'm doing something similar. If I'm heading down the wrong path on this, hopefully someone will point out the flaw in my thinking.

In the site I am working on, almost all pages are displayed via a Process method called "ShowPage".

http://localhost/mySite/showpage.psp?page=somepage

The page name passed in the querystring is also the file name of the template file - in this case, "somepage.wc".

The ShowPage method looks something like this...

*************************************************************FUNCTION ShowPage(tcPage)*------------------------LOCAL lcPage, lcTemplateFile, llContinue, lcTitleIF NOT EMPTY(m.tcPage) && called internally lcPage = m.tcPageELSE lcPage = REQUEST.QueryString("PAGE")ENDIF lcPage = LOWER(JUSTSTEM(m.lcPage)) lcTemplateFile = ADDBS(THIS.cTemplatesPath) ; + ADDBS(THIS.cLanguage) + m.lcPage + ".wc"IF NOT FILE(m.lcTemplateFile)** Fatal Error.* The Error Page will be output by THIS.ProcessError() called by THIS.FileNotFound()*THIS.FileNotFound(m.lcTemplateFile)RETURNENDIF llContinue = .T. DOCASE*************************************************************CASE m.lcPage = "this" lcTitle = "Title for THIS page"*- set some other memvars *************************************************************CASE m.lcPage = "that" llContinue = THIS.Authenticate() && authentication requiredIF m.llContinue lcTitle = "Title for THAT page"*- set some other memvarsENDIF*************************************************************CASE m.lcPage = "another" lcTitle = "Title for ANOTHER page"*- set some other memvars *************************************************************OTHERWISE lcTitle = CON_DEFAULTTITLE*************************************************************ENDCASEIF m.llContinueLOCAL lcCSS, lcScriptsPRIVATE pcHeader, pcMenu, pcFooter lcCSS = THIS.GetCSS(m.lcPage) lcScripts = THIS.GetScriptsHead(m.lcPage) pcHeader = THIS.GetHeader(m.lcTitle, m.lcCSS, m.lcScripts)** The Header MUST exist.*IF NOT EMPTY(m.pcHeader)** The Menu and Footer are used by almost all pages.* If the following functions return an empty string,* these HTML blocks are not required - carry on.* If these functions return .NULL., an error occurred* (such as a missing template file) and the error* page has already been sent to the browser.* In this case, bail out.* pcMenu = THIS.GetMenu(m.lcPage)IF NOT ISNULL(m.pcMenu) lcScripts = THIS.GetScriptsBody(m.lcPage) pcFooter = THIS.GetFooter(m.lcPage, m.lcScripts)IF NOT ISNULL(m.pcFooter) Response.ExpandTemplate(m.lcTemplateFile)ENDIFENDIFENDIFENDIFENDFUNC* EOF PSPProcess::ShowPage

Each of the "Get" methods builds an HTML fragment according to the page being displayed. These fragments are assigned to PRIVATE MEMVARS in the .WC template file.

My basic template file looks like this...

<!DOCTYPE html><htmllang="en"><%= pcHeader %><body><%= pcMenu %><!-- Wrapper -->><divclass="wrapper"><br /><divclass="container"><!----------------- INSERT CONTENT HERE ----------------->></div><!-- / .container -->></div><!-- / .wrapper -->><!-- Footer -->><%= pcFooter %></body></html>

I design a static HTML file in Visual Studio Express Web with the Header, Menu and Footer hard-coded. Once I have the appearance the way I want it, I copy the HTML content from between the WRAPPER/CONTAINER tags into the bare bones template above, insert any other <%= variables %> as needed, and Save As the final template.

I also use other small HTML fragments stored in separate text files.
For example, here is the GetMenu() method...

FUNCTION GetMenu(tcPage)*------------------------------LOCAL lcTemplateFile tcPage = LOWER(JUSTSTEM(m.tcPage))DOCASE********************************CASE m.tcPage = "login"RETURN""********************************OTHERWISE lcTemplateFile = ADDBS(THIS.cTemplatesPath) ; + ADDBS(THIS.cLanguage) + "mainmenu.wc"********************************ENDCASEIF NOT FILE(m.lcTemplateFile)THIS.FileNotFound(m.lcTemplateFile)** The error page was returned by THIS.ProcessError()*RETURN .NULL.ENDIFLOCAL lcMenuClass, lcTemplateText, lnPos1, lnPos2, lcStringIF"lookup" $ m.tcPage** Any "Lookup" pages have a different class for the* top menu whose position is not fixed on a small device.* lcMenuClass = "navbar navbar-default navbar-lookup-top"ELSE lcMenuClass = "navbar navbar-default navbar-fixed-top"ENDIF lcTemplateText = FILETOSTR(m.lcTemplateFile)* * Find the menu option for the page to be displayed * and add the keyword "active" to the class name * so that it is "highlighted". * lnPos1 = ATC(m.tcPage,m.lcTemplateText)IF m.lnPos1 > 0 lcString = [<li class="dropdown] lnPos2 = RATC(m.lcString,LEFT(m.lcTemplateText,m.lnPos1)) lcTemplateText = STUFF(m.lcTemplateText,m.lnPos2 + LEN(m.lcString),0," active")ENDIF lcTemplateFile = ADDBS(THIS.cTemplatesPath) ; + ADDBS(THIS.cLanguage) ; + IIF(EMPTY(THIS.cAuthenticatedUser), ;"loginmenu.wc","accountmenu.wc") lcAcctMenuText = FILETOSTR(m.lcTemplateFile)* * Merge the text. * The 2nd parameter MUST be passed as .T. because * is in lcAcctMenuText and is in * lcTemplateText. * lcTemplateText = TEXTMERGE(m.lcTemplateText,.T.)RETURN m.lcTemplateTextENDFUNC* EOF PSPProcess::GetMenu

Again, if my approach is asking for trouble, I hope that someone will point it out.
If it gives you any ideas, that's cool.

Carl


Hi,

Starting to move a wConnect site from HTML-in-prg style to scripting style (.ExpandTemplate() and/or .ExpandScript() and/or template script-mapped extension).

Purpose: easily share existing HTML with a design agency, and easily integrate new HTML

Wondering how to share HTML code blocks across pages
eg, considering this block of HTML stored in head.htm

<!DOCTYPE html><htmllang="fr"><head><title><%=variable%></title> ....</head>

1/ how to make sure all pages in site include this block?
SSI directives are very handy because supported by all web servers
a typical SSI directive is:

<!--#include virtual=head.htm -->>

Does wConnect support SSI directive?

2/ what is the best practice to make sure 'variable' is available when page is generated?
- use a 'private' variable (.ExpandTemplate() and/or .ExpandScript())
- move all code generating variable into a code block inside head.htm?

Also looking for wConnect user feedback/advice/tricks ...

Thanks,


-- thn (FoxInCloud)

HTML Help Builder

autoBlurDelay problems

$
0
0
autoBlurDelay problems
FoxInCloud
autoBlurDelay problems
Feb. 27, 2015
05:37 am
4AJ0C1IONShow this entire thread in new window
Gratar Image based on email address
From:James Patterson
To:All
Entering long strings into textboxes can be annoying with the short auto blur settings. After poking about here, I saw mention of the .autoBlurDelay setting and I went about trying to set it. I first tried 0 and then -1, both with no change from the default behavior. I also tried 10 seconds with no change. I then thought .wlValidAutoNot might be overriding the global, but they are .F. I also tried .wlValidAutoNot = .T. but this did not change. Am I missing some other default that is overriding these settings? I have started and stopped programs and services in case it is a cache issue, but no luck so far... Any ideas?

Thanks - James

Follow up this AM. The .autoBlurDelay setting of 10 seconds that I set last night, yes I have no life, is now the global setting. What changed?...Only stopped VFP and IE, not the dev machine, Server 2012. Still does not recognize .autoBlurDelay immediately. Sessions cookie perhaps?

Re: Sharing HTML blocks across pages - one best way?

$
0
0
Re: Sharing HTML blocks across pages - one best way?
Web Connection
Re: Sharing HTML blocks across pages - one best way?
Feb. 27, 2015
07:26 am
4AJ0FYE2MShow this entire thread in new window
Gratar Image based on email address
From:Carl Chambers
To:Thierry Nivelet (FoxInCloud)
Hi Thierry,

Looks like I brought a knife to gunfight <g>.
I wish you the best of success with this - I'm sure it will go well.


Carl

Re: Sharing HTML blocks across pages - one best way?

$
0
0
Re: Sharing HTML blocks across pages - one best way?
Web Connection
Re: Sharing HTML blocks across pages - one best way?
Feb. 27, 2015
07:32 am
4AJ0G6488Show this entire thread in new window
Gratar Image based on email address
From:Carl Chambers
To:Rick Strahl
Thanks Rick,

I have some request validation issues that I need to get my head around before I can make the change you recommend. Still not sure what all I'm in for yet as I continue to learn.
I appreciate your advice.


Carl


I would probably look into some other way to do this to avoid having to go through ShowPage.psp which is pretty ugly.

Instead if you're handling all your pages this way in this process class you can take over RouteRequest() and put whatever is in ShowPage there. You can override that method and just copy that code into your process class. Most of the code in that method has to do with the Web Control framework which you can leave alone or throw out since you don't use it.

Specifically you can override this behavior:

CASEthis.nPageScriptMode = 1 AND FILE(lcPhysical) Response.ExpandTemplate(lcPhysical)

and you can hook your code into there.

The end result then will be that you can just SomePage.psp instead of ShowPage.psp?page=SomePage.psp, which is much more natural both from the URL and handling of the code.

Looking at the code in RouteRequest() that code sure could use some factoring :-)

+++ Rick ---

Re: Collapse TR

$
0
0
Re: Collapse TR
Web Connection
Re: Collapse TR
Feb. 28, 2015
04:31 am
4AK09OUJ5Show this entire thread in new window
Gratar Image based on email address
From:Luca
To:Rick Strahl
Thank you Rick,
it is fantastic to develop with Web Connection!


display:none in css.

+++ Rick ---



Dear friends,
I have a menu page with a Table. In the Table every TR/TD contains links to web pages.
When a user connects to the application, its rights make links visible or not.
However, when a link is not visible I see still the TR/TD empty space.
Please, is there any way to collapse TR and TD programmatically?
I tried to assign ID to TR and TD and to force Style="Visibility: collapse" but it does not work.
Many thanks




Re: autoBlurDelay problems

$
0
0
Re: autoBlurDelay problems
FoxInCloud
Re: autoBlurDelay problems
Mar. 1, 2015
01:00 am
4AL025SK1Show this entire thread in new window
Gratar Image based on email address
From:Thierry Nivelet (FoxInCloud)
To:James Patterson
hi James,

Probable browser cache issue ...
for any change in xxx.css or xxx.js, make sure to force reload the whole page: depending on the browser, hit F5, ctrl+F5 or ctrl+R.


Entering long strings into textboxes can be annoying with the short auto blur settings. After poking about here, I saw mention of the .autoBlurDelay setting and I went about trying to set it. I first tried 0 and then -1, both with no change from the default behavior. I also tried 10 seconds with no change. I then thought .wlValidAutoNot might be overriding the global, but they are .F. I also tried .wlValidAutoNot = .T. but this did not change. Am I missing some other default that is overriding these settings? I have started and stopped programs and services in case it is a cache issue, but no luck so far... Any ideas?

Thanks - James

Follow up this AM. The .autoBlurDelay setting of 10 seconds that I set last night, yes I have no life, is now the global setting. What changed?...Only stopped VFP and IE, not the dev machine, Server 2012. Still does not recognize .autoBlurDelay immediately. Sessions cookie perhaps?


-- thn (FoxInCloud)

Long Type

$
0
0
Long Type
Web Service Proxy Generator
Long Type
Mar. 1, 2015
11:19 am
4AL0OA1MYShow this entire thread in new window
Gratar Image based on email address
From:Xavier Desemberg
To:All

Hello

I am using the web service proxy and so far so good

in the example below I need to pass the storeID as a Long (type)
How do I do that ?

loItem3 = lobridge.createInstance("PosProviderWS.storeTrxDetails")
loitem3.basketId = '12'
loitem3.cashierId = 'ADMIN'
loitem3.posId = '0011'
loitem3.storeId = 1050
loitem3.trxId = '12'

I have tried
loval = loBridge.converttodotnetvalue(1050,"int64")
loBridge.SetProperty(loItem3,"storeId",loVal)

but does not seem to work
Can someone help ?


Question 2
Also how can I read a Long type when returned from the webservice ?

Thanks

Xavier

Soap Upload

$
0
0
Soap Upload
FoxPro Programming
Soap Upload
Mar. 1, 2015
01:33 pm
4AL0T1QYBShow this entire thread in new window
Gratar Image based on email address
From:Edward K. Marois
To:All
Dear Rick:

Please note that I have very little to no experience with SOAP programming.

I bought the "West Wind Web Service Proxy" but I do not think that it is going to be any help since it is the WSDL requests that are making the program crash.

Basically they have removed them from the web site and we are suppose to just 'Hard Code' The entire thing.

I spent 2 days getting the SOAP program to run without the WSDL requests.

We also upgraded to Visual Foxpro 9. which I am keeping regardless because all the 'Bugs' in the Editor have been fixed.

Anyway.

Unless I am missing something there is really only 3 things that have to be configured

The URL
The SOAP REQUEST
The XML Page

Please review the letter that I sent them

I have a feeling that their code samples were not updated since they are pointed back to the same URLs.

Dear Sirs:This is Edward from Realty Information Systems (203-869-8954) SUPPORT@RISSOFT.COM writing. We have been having problems with the SOAP requests to your web site and would liketo request some help. I have removed the WSDL requests to your web site as per your request As announced in November (November 4, 2014 email), a security update has been implemented for our Web Services users that eliminates the ability to access EPS Web Service endpoints in a browser. You will need topoint the system that you use tocreate transactions to the WSDLs that are attached. Please let me know if you have any questions or require additional information. I have reviewed the code samples that have been provided and have attempted the following changes. ************************************************************ I end up with the following Error: “Server did not recognize the valueof HTTP Header SOAPAction: https://ssl.selectpayment.com/PV/AuthorizeTransactionWithCustomer” ************************************************************ Please see below setting and please suggest a solution. “SOAPAction: https://ssl.selectpayment.com/PV/AuthorizeTransactionWithCustomer” this.cServerUrl = "https://ssl.selectpayment.com/PV/PaymentVault.asmx" XMLPAGE <?xml version="1.0" encoding="utf-8"?<soap:Envelope xmlns:s="http://www.w3.org/2001/XMLSchema" mlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="https://ssl.selectpayment.com/PV" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="https://ssl.selectpayment.com/PV" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><soap:Body><AuthorizeTransactionWithCustomer xmlns="https://ssl.selectpayment.com/PV"><storeId>208889</storeId><storeKey>8hzrqteh90D0rsualF/0VBLi0yyk</storeKey><customer><EntityId>64433</EntityId><IsCompany>0</IsCompany><CustomerNumber>CARM-2015-3797903-NON-TENANT_DEPOSIT</CustomerNumber><FirstName>NON-TENANT-DEPOSIT</FirstName><LastName>UNKOWN</LastName></customer><createCustomerIfDoesNotExists>1</createCustomerIfDoesNotExists><updateCustomerIfExists>1</updateCustomerIfExists><transaction><EntityId>64433</EntityId><LocationId>934289</LocationId><PaymentOrigin>Mailed_In</PaymentOrigin><AccountType>Checking</AccountType><OperationType>Sale</OperationType><EffectiveDate>2015-03-01T16:00:57</EffectiveDate><TotalAmount>1.00</TotalAmount><BatchNumber/><TransactionNumber>3797903</TransactionNumber><CheckMICRLine>t021101108t1040088576683o 1477</CheckMICRLine><CheckMICRSymbolSet>TOAD ?</CheckMICRSymbolSet><RoutingNumber>021101108</RoutingNumber><AccountNumber>1040088576683</AccountNumber><CheckNumber>1477</CheckNumber><NameOnAccount>NON-TENANT-DEPOSIT</NameOnAccount><NotificationMethod>Merchant_Notify</NotificationMethod><FaceFeeType>Face</FaceFeeType><CheckFrontImageBytes_TiffG4>SUkqAPYlA …..AAIAA=</CheckFrontImageBytes_TiffG4><CheckRearImageBytes_TiffG4>8CQA….. …AAAGQAAIAA=</CheckRearImageBytes_TiffG4></transaction></AuthorizeTransactionWithCustomer></soap:Body></soap:Envelope>

Problems after installing

$
0
0
Problems after installing
Westwind.Globalization
Problems after installing
Mar. 2, 2015
02:33 am
4AM05HLZXShow this entire thread in new window
Gratar Image based on email address
From:Jacco
To:All
Hi,

I hope someone can help me out here.

I installed the globalization package from nuget. No problems

I connected my database and created a table. Working with some javascript messages.

I enabled globalization and started the admin.

This works, but I get all kind of messages like:
Error: Syntax error, unrecognized expression: div."containercontent
Invalid file name for file monitoring: 'D:\....\App_LocalResources'

I imported existing resources. This works, with messages. Resources are in the database.

I use VS 2013. Implementation will be an Azure website.

It looks like I only get the messages when running from vs, so that makes the problem less urgent. (if not completely un-urgent :)

But still, does anyone know what I can do to get rid of the messages?

Soap Upload

$
0
0
Soap Upload
FoxPro Programming
Soap Upload
Mar. 2, 2015
06:06 am
4AM0D3F69Show this entire thread in new window
Gratar Image based on email address
From:Edward K. Marois
To:All
Dear Rick:

To be completely fair

As mentioned from out web provider

As announced in November (November 4, 2014 email), a security update has been implemented for our Web Services users that eliminates the ability to access EPS Web Service endpoints in a browser.
You will need to point the system that you use to create transactions to the WSDLs that are attached.
Please let me know if you have any questions or require additional information.

Thus

In the ".NET Web Service Proxy Generator"

Web Service WSDL
https://ssl.selectpayment.com/PV/PaymentVault.asmx

I select 'Resolve' and it works

The Next 4 Fields are

AuthorizeTransactionWithCustomer

AuthorizeTransactionWithCustomer

AuthorizeTransactionWithCustomer.dll

AuthorizeTransactionWithCustomerProxy

The Error I get is

WSDL Parsing Error.....

'https://ssl.selectpayment.com/PV/PaymentVault.asmx'
- The HTML document does not contain Web Service discovery information'

With what little I know of the situation. this will NOT work.

Also

Please see previous email about modifying the soap program, which I feel has a lot more promose


Re: Long Type

$
0
0
Re: Long Type
Web Service Proxy Generator
Re: Long Type
Mar. 2, 2015
12:50 pm
4AM0RJFGXShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Xavier Desemberg
Hi Xavier,

Long is a type that FoxPro has no support for directly so special synatax is required to pass Com Values from Fox to .NET and back.

The following code should work:

loVal = loBridge.CreateComValue()** set a long value loVal.SetLong(11)*** use it in .NET - you have to use the indirect methods loBridge.SetProperty(loItems3,"StoreId",loVal)

ComValue works by allowing you to assign the value from FoxPro and then keeping the value inside of .NET until it's unpacked when you call SetProperty() or InvokeMethod().

More info here:
wcdocs:_3481232sd.htm

+++ Rick ---

Hello

I am using the web service proxy and so far so good

in the example below I need to pass the storeID as a Long (type)
How do I do that ?

loItem3 = lobridge.createInstance("PosProviderWS.storeTrxDetails")
loitem3.basketId = '12'
loitem3.cashierId = 'ADMIN'
loitem3.posId = '0011'
loitem3.storeId = 1050
loitem3.trxId = '12'

I have tried
loval = loBridge.converttodotnetvalue(1050,"int64")
loBridge.SetProperty(loItem3,"storeId",loVal)

but does not seem to work
Can someone help ?


Question 2
Also how can I read a Long type when returned from the webservice ?

Thanks

Xavier




Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Re: Problems after installing

$
0
0
Re: Problems after installing
Westwind.Globalization
Re: Problems after installing
Mar. 2, 2015
12:50 pm
4AM0RJFGLShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Jacco
Hi Jacco,

The messages appear to be server error messages that are generating HTML and those are not coming in correctly. Can you open up Fiddler and check the 500 error page and see what the actual server error message is on the yellow screen of death?

When you say runnign from VS, you mean running IIS Express vs. full IIS?

+++ Rick ---



Hi,

I hope someone can help me out here.

I installed the globalization package from nuget. No problems

I connected my database and created a table. Working with some javascript messages.

I enabled globalization and started the admin.

This works, but I get all kind of messages like:
Error: Syntax error, unrecognized expression: div."containercontent
Invalid file name for file monitoring: 'D:\....\App_LocalResources'

I imported existing resources. This works, with messages. Resources are in the database.

I use VS 2013. Implementation will be an Azure website.

It looks like I only get the messages when running from vs, so that makes the problem less urgent. (if not completely un-urgent :)

But still, does anyone know what I can do to get rid of the messages?




Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui


Re: XMLtoCursor : Invalid class string

$
0
0
Re: XMLtoCursor : Invalid class string
FoxPro Programming
Re: XMLtoCursor : Invalid class string
Mar. 2, 2015
12:56 pm
4AM0RR6XAShow this entire thread in new window
Gratar Image based on email address
From:Michael Hogan (Ideate Hosting)
To:Rick Strahl
This is still occurring erratically. SYS(0) is reporting local administrator in all instances.

I have the code trying to use MSXML3, then trying MSXML4 in the CATCH - so both are failing occasionally.

I'm planning to switch to your old EncodeDBF / DecodeDBF to transfer the data. Here's hoping that's not using MSXML in the background...

I cannot think if a way to track down the problem at the os/dll level. I found no info in the event logs but I may not know exactly what to look for.

Michael

I would log user access, and native account information in your app (ie. SYS(0)) on every hit and see if that somehow changes. It sure sounds to me like the impersonation is changing back and forth when people are logged on, and when it does you may not have rights to MSXML anymore.

If that's not the case then you may have some MSXML corruption which is going to be a much bigger and more problematic issue to deal with.

+++ Rick ---



No, it's intermittent. If I reload the COM instances, it will work again for some period of time - even on the xml that failed just moments before (which seems to rule out the formatters idea).

All the msxml3 bits seem to be in their proper places. Checking further...

You might want to make sure you install the latest MsXml bits on the machine. I suspoect the error might be intermittent as certain features are accessed (formatters maybe?)...

Usually Invalid Class string seems to suggest that the COM class is not visible to the client - possibly because permissions have changed? Could it be related to impersonation in your Web application?

+++ Rick ---



I'm getting this same error with a webconnect application, but only after a period of successful operation.

I have a program that sends XML data up to my web site on an hourly basis and at some point (a few days) in time it stops working and returns:

Processing Error - https://www.interlight.biz/OrderImport.int?Error: 1426Message: OLE error code 0x800401f3: Invalid class string. Code: Program: orderimportLine No: 111 Client: 173.150.244.198

... at this line of code: XMLTOCURSOR(lcOrdersXML,"ImportOrders")

If VFP uses MSXML3, is there some way to re-initialize it after each method call? Is there some other methodology I should be using? Perhaps EncodeDBF/DecodeDBF?

It appears that Rick's wwXML also uses MSXML3, so I'm guessing I would have the same problem.

XmlToCursor uses MS Xml 3.0 which should be on every machine you run. XmlAdapter requires MS XML 4.0 and you need to install this if you use it. MS XML 6 will not install 4 so that is separate - post MS XML 3 are all separate side by side versions so they all require specific installation. VFP doesn't use anything past 4 internally.

+++ Rick ---

Hi

We use the native VFP XMLtoCursor function to convert an XML string to a cursor. This is done on a (Win XP SP2) PC with the latest available MS XML installed (6.00.3883.0).

When the code executes - we get the following error message :
Error #1426
OLE error code 0x800401f3 : Invalid class string.

What do I do to correct?

Thanks!
Jan









Michael
www.WebConnectionHosting.com

Re: Soap Upload

$
0
0
Re: Soap Upload
FoxPro Programming
Re: Soap Upload
Mar. 2, 2015
01:00 pm
4AM0RVDW3Show this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Edward K. Marois
Edward,

Sounds to me they sent you the WSDL files as attachments. You can copy those to disk and then import them with the WSDL generator. Click the browse button and navigate to the file system to get them in there.

+++ Rick ---


Dear Rick:

Please note that I have very little to no experience with SOAP programming.

I bought the "West Wind Web Service Proxy" but I do not think that it is going to be any help since it is the WSDL requests that are making the program crash.

Basically they have removed them from the web site and we are suppose to just 'Hard Code' The entire thing.

I spent 2 days getting the SOAP program to run without the WSDL requests.

We also upgraded to Visual Foxpro 9. which I am keeping regardless because all the 'Bugs' in the Editor have been fixed.

Anyway.

Unless I am missing something there is really only 3 things that have to be configured

The URL
The SOAP REQUEST
The XML Page

Please review the letter that I sent them

I have a feeling that their code samples were not updated since they are pointed back to the same URLs.

Dear Sirs:This is Edward from Realty Information Systems (203-869-8954) SUPPORT@RISSOFT.COM writing. We have been having problems with the SOAP requests to your web site and would liketo request some help. I have removed the WSDL requests to your web site as per your request As announced in November (November 4, 2014 email), a security update has been implemented for our Web Services users that eliminates the ability to access EPS Web Service endpoints in a browser. You will need topoint the system that you use tocreate transactions to the WSDLs that are attached. Please let me know if you have any questions or require additional information. I have reviewed the code samples that have been provided and have attempted the following changes. ************************************************************ I end up with the following Error: “Server did not recognize the valueof HTTP Header SOAPAction: https://ssl.selectpayment.com/PV/AuthorizeTransactionWithCustomer” ************************************************************ Please see below setting and please suggest a solution. “SOAPAction: https://ssl.selectpayment.com/PV/AuthorizeTransactionWithCustomer” this.cServerUrl = "https://ssl.selectpayment.com/PV/PaymentVault.asmx" XMLPAGE <?xml version="1.0" encoding="utf-8"?<soap:Envelope xmlns:s="http://www.w3.org/2001/XMLSchema" mlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="https://ssl.selectpayment.com/PV" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="https://ssl.selectpayment.com/PV" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><soap:Body><AuthorizeTransactionWithCustomer xmlns="https://ssl.selectpayment.com/PV"><storeId>208889</storeId><storeKey>8hzrqteh90D0rsualF/0VBLi0yyk</storeKey><customer><EntityId>64433</EntityId><IsCompany>0</IsCompany><CustomerNumber>CARM-2015-3797903-NON-TENANT_DEPOSIT</CustomerNumber><FirstName>NON-TENANT-DEPOSIT</FirstName><LastName>UNKOWN</LastName></customer><createCustomerIfDoesNotExists>1</createCustomerIfDoesNotExists><updateCustomerIfExists>1</updateCustomerIfExists><<span class="commands">transaction><EntityId>64433</EntityId><LocationId>934289</LocationId><PaymentOrigin>Mailed_In</PaymentOrigin><AccountType>Checking</AccountType><OperationType>Sale</OperationType><EffectiveDate>2015-03-01T16:00:57</EffectiveDate><TotalAmount>1.00</TotalAmount><BatchNumber/><TransactionNumber>3797903</TransactionNumber><CheckMICRLine>t021101108t1040088576683o 1477</CheckMICRLine><CheckMICRSymbolSet>TOAD ?</CheckMICRSymbolSet><RoutingNumber>021101108</RoutingNumber><AccountNumber>1040088576683</AccountNumber><CheckNumber>1477</CheckNumber><NameOnAccount>NON-TENANT-DEPOSIT</NameOnAccount><NotificationMethod>Merchant_Notify</NotificationMethod><FaceFeeType>Face</FaceFeeType><CheckFrontImageBytes_TiffG4>SUkqAPYlA …..AAIAA=</CheckFrontImageBytes_TiffG4><CheckRearImageBytes_TiffG4>8CQA….. …AAAGQAAIAA=</CheckRearImageBytes_TiffG4></transaction></AuthorizeTransactionWithCustomer></soap:Body></soap:Envelope>



Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Re: XMLtoCursor : Invalid class string

$
0
0
Re: XMLtoCursor : Invalid class string
FoxPro Programming
Re: XMLtoCursor : Invalid class string
Mar. 2, 2015
01:02 pm
4AM0RYF6LShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:

EncodeDbf and DecodeDbf do not use MSXML since they're just picking up the raw files and putting them into strings.

But... given all that, I run MSXML based data in a number of apps on my server without any issues. There must be some problem with the VFP runtime install or MSXML install? You should consider re-installing the VFP runtimes perhaps and maybe looking for the explicit MSXML installers from Microsoft.

+++ Rick ---



This is still occurring erratically. SYS(0) is reporting local administrator in all instances.

I have the code trying to use MSXML3, then trying MSXML4 in the CATCH - so both are failing occasionally.

I'm planning to switch to your old EncodeDBF / DecodeDBF to transfer the data. Here's hoping that's not using MSXML in the background...

I cannot think if a way to track down the problem at the os/dll level. I found no info in the event logs but I may not know exactly what to look for.

Michael

I would log user access, and native account information in your app (ie. SYS(0)) on every hit and see if that somehow changes. It sure sounds to me like the impersonation is changing back and forth when people are logged on, and when it does you may not have rights to MSXML anymore.

If that's not the case then you may have some MSXML corruption which is going to be a much bigger and more problematic issue to deal with.

+++ Rick ---



No, it's intermittent. If I reload the COM instances, it will work again for some period of time - even on the xml that failed just moments before (which seems to rule out the formatters idea).

All the msxml3 bits seem to be in their proper places. Checking further...

You might want to make sure you install the latest MsXml bits on the machine. I suspoect the error might be intermittent as certain features are accessed (formatters maybe?)...

Usually Invalid Class string seems to suggest that the COM class is not visible to the client - possibly because permissions have changed? Could it be related to impersonation in your Web application?

+++ Rick ---



I'm getting this same error with a webconnect application, but only after a period of successful operation.

I have a program that sends XML data up to my web site on an hourly basis and at some point (a few days) in time it stops working and returns:

Processing Error - https://www.interlight.biz/OrderImport.int?Error: 1426Message: OLE error code 0x800401f3: Invalid class string. Code: Program: orderimportLine No: 111 Client: 173.150.244.198

... at this line of code: XMLTOCURSOR(lcOrdersXML,"ImportOrders")

If VFP uses MSXML3, is there some way to re-initialize it after each method call? Is there some other methodology I should be using? Perhaps EncodeDBF/DecodeDBF?

It appears that Rick's wwXML also uses MSXML3, so I'm guessing I would have the same problem.

XmlToCursor uses MS Xml 3.0 which should be on every machine you run. XmlAdapter requires MS XML 4.0 and you need to install this if you use it. MS XML 6 will not install 4 so that is separate - post MS XML 3 are all separate side by side versions so they all require specific installation. VFP doesn't use anything past 4 internally.

+++ Rick ---

Hi

We use the native VFP XMLtoCursor function to convert an XML string to a cursor. This is done on a (Win XP SP2) PC with the latest available MS XML installed (6.00.3883.0).

When the code executes - we get the following error message :
Error #1426
OLE error code 0x800401f3 : Invalid class string.

What do I do to correct?

Thanks!
Jan











Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Re: Soap Upload

$
0
0
Re: Soap Upload
FoxPro Programming
Re: Soap Upload
Mar. 2, 2015
02:19 pm
4AM0UPLWXShow this entire thread in new window
Gratar Image based on email address
From:Edward K. Marois
To:Rick Strahl
Dear Rick:

I struggled with this all day yesterday and today and was about to give up hope.

Then I got your latest email and it worked and now there is hope.

You get the official "Your the Man" for today


Edward,

Sounds to me they sent you the WSDL files as attachments. You can copy those to disk and then import them with the WSDL generator. Click the browse button and navigate to the file system to get them in there.

+++ Rick ---


Dear Rick:

Please note that I have very little to no experience with SOAP programming.

I bought the "West Wind Web Service Proxy" but I do not think that it is going to be any help since it is the WSDL requests that are making the program crash.

Basically they have removed them from the web site and we are suppose to just 'Hard Code' The entire thing.

I spent 2 days getting the SOAP program to run without the WSDL requests.

We also upgraded to Visual Foxpro 9. which I am keeping regardless because all the 'Bugs' in the Editor have been fixed.

Anyway.

Unless I am missing something there is really only 3 things that have to be configured

The URL
The SOAP REQUEST
The XML Page

Please review the letter that I sent them

I have a feeling that their code samples were not updated since they are pointed back to the same URLs.

Dear Sirs:This is Edward from Realty Information Systems (203-869-8954) SUPPORT@RISSOFT.COM writing. We have been having problems with the SOAP requests to your web site and would liketo request some help. I have removed the WSDL requests to your web site as per your request As announced in November (November 4, 2014 email), a security update has been implemented for our Web Services users that eliminates the ability to access EPS Web Service endpoints in a browser. You will need topoint the system that you use tocreate transactions to the WSDLs that are attached. Please let me know if you have any questions or require additional information. I have reviewed the code samples that have been provided and have attempted the following changes. ************************************************************ I end up with the following Error: “Server did not recognize the valueof HTTP Header SOAPAction: https://ssl.selectpayment.com/PV/AuthorizeTransactionWithCustomer” ************************************************************ Please see below setting and please suggest a solution. “SOAPAction: https://ssl.selectpayment.com/PV/AuthorizeTransactionWithCustomer” this.cServerUrl = "https://ssl.selectpayment.com/PV/PaymentVault.asmx" XMLPAGE <?xml version="1.0" encoding="utf-8"?<soap:Envelope xmlns:s="http://www.w3.org/2001/XMLSchema" mlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="https://ssl.selectpayment.com/PV" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="https://ssl.selectpayment.com/PV" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><soap:Body><AuthorizeTransactionWithCustomer xmlns="https://ssl.selectpayment.com/PV"><storeId>208889</storeId><storeKey>8hzrqteh90D0rsualF/0VBLi0yyk</storeKey><customer><EntityId>64433</EntityId><IsCompany>0</IsCompany><CustomerNumber>CARM-2015-3797903-NON-TENANT_DEPOSIT</CustomerNumber><FirstName>NON-TENANT-DEPOSIT</FirstName><LastName>UNKOWN</LastName></customer><createCustomerIfDoesNotExists>1</createCustomerIfDoesNotExists><updateCustomerIfExists>1</updateCustomerIfExists><<span class="commands">transaction><EntityId>64433</EntityId><LocationId>934289</LocationId><PaymentOrigin>Mailed_In</PaymentOrigin><AccountType>Checking</AccountType><OperationType>Sale</OperationType><EffectiveDate>2015-03-01T16:00:57</EffectiveDate><TotalAmount>1.00</TotalAmount><BatchNumber/><TransactionNumber>3797903</TransactionNumber><CheckMICRLine>t021101108t1040088576683o 1477</CheckMICRLine><CheckMICRSymbolSet>TOAD ?</CheckMICRSymbolSet><RoutingNumber>021101108</RoutingNumber><AccountNumber>1040088576683</AccountNumber><CheckNumber>1477</CheckNumber><NameOnAccount>NON-TENANT-DEPOSIT</NameOnAccount><NotificationMethod>Merchant_Notify</NotificationMethod><FaceFeeType>Face</FaceFeeType><CheckFrontImageBytes_TiffG4>SUkqAPYlA …..AAIAA=</CheckFrontImageBytes_TiffG4><CheckRearImageBytes_TiffG4>8CQA….. …AAAGQAAIAA=</CheckRearImageBytes_TiffG4></transaction></AuthorizeTransactionWithCustomer></soap:Body></soap:Envelope>



Re: Soap Upload

$
0
0
Re: Soap Upload
FoxPro Programming
Re: Soap Upload
Mar. 2, 2015
03:58 pm
4AM0Y8DZFShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Edward K. Marois
Edward,

You know if you're still stuck it might help to spent hour on consulting time with me to get this set up. I can take a look and make sure it'll work the way you expect it to and get you over the hump to start using the service instead of struggling with getting the calls to go through.

Web Services tend to be finicky and it can be tricky at times, especially if you're unfamiliar with the terminology. And to be sure some services just don't work period due to vendor incompatibilities. However seeing this is a .NET service on the other end I'm pretty sure this service will work jsut fine.

http://west-wind.com/contact.aspx

+++ Rick ---



Dear Rick:

I struggled with this all day yesterday and today and was about to give up hope.

Then I got your latest email and it worked and now there is hope.

You get the official "Your the Man" for today


Edward,

Sounds to me they sent you the WSDL files as attachments. You can copy those to disk and then import them with the WSDL generator. Click the browse button and navigate to the file system to get them in there.

+++ Rick ---


Dear Rick:

Please note that I have very little to no experience with SOAP programming.

I bought the "West Wind Web Service Proxy" but I do not think that it is going to be any help since it is the WSDL requests that are making the program crash.

Basically they have removed them from the web site and we are suppose to just 'Hard Code' The entire thing.

I spent 2 days getting the SOAP program to run without the WSDL requests.

We also upgraded to Visual Foxpro 9. which I am keeping regardless because all the 'Bugs' in the Editor have been fixed.

Anyway.

Unless I am missing something there is really only 3 things that have to be configured

The URL
The SOAP REQUEST
The XML Page

Please review the letter that I sent them

I have a feeling that their code samples were not updated since they are pointed back to the same URLs.

Dear Sirs:This is Edward from Realty Information Systems (203-869-8954) SUPPORT@RISSOFT.COM writing. We have been having problems with the SOAP requests to your web site and would liketo request some help. I have removed the WSDL requests to your web site as per your request As announced in November (November 4, 2014 email), a security update has been implemented for our Web Services users that eliminates the ability to access EPS Web Service endpoints in a browser. You will need topoint the system that you use tocreate transactions to the WSDLs that are attached. Please let me know if you have any questions or require additional information. I have reviewed the code samples that have been provided and have attempted the following changes. ************************************************************ I end up with the following Error: “Server did not recognize the valueof HTTP Header SOAPAction: https://ssl.selectpayment.com/PV/AuthorizeTransactionWithCustomer” ************************************************************ Please see below setting and please suggest a solution. “SOAPAction: https://ssl.selectpayment.com/PV/AuthorizeTransactionWithCustomer” this.cServerUrl = "https://ssl.selectpayment.com/PV/PaymentVault.asmx" XMLPAGE <?xml version="1.0" encoding="utf-8"?<soap:Envelope xmlns:s="http://www.w3.org/2001/XMLSchema" mlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="https://ssl.selectpayment.com/PV" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="https://ssl.selectpayment.com/PV" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><soap:Body><AuthorizeTransactionWithCustomer xmlns="https://ssl.selectpayment.com/PV"><storeId>208889</storeId><storeKey>8hzrqteh90D0rsualF/0VBLi0yyk</storeKey><customer><EntityId>64433</EntityId><IsCompany>0</IsCompany><CustomerNumber>CARM-2015-3797903-NON-TENANT_DEPOSIT</CustomerNumber><FirstName>NON-TENANT-DEPOSIT</FirstName><LastName>UNKOWN</LastName></customer><createCustomerIfDoesNotExists>1</createCustomerIfDoesNotExists><updateCustomerIfExists>1</updateCustomerIfExists><<span class="commands">transaction><EntityId>64433</EntityId><LocationId>934289</LocationId><PaymentOrigin>Mailed_In</PaymentOrigin><AccountType>Checking</AccountType><OperationType>Sale</OperationType><EffectiveDate>2015-03-01T16:00:57</EffectiveDate><TotalAmount>1.00</TotalAmount><BatchNumber/><TransactionNumber>3797903</TransactionNumber><CheckMICRLine>t021101108t1040088576683o 1477</CheckMICRLine><CheckMICRSymbolSet>TOAD ?</CheckMICRSymbolSet><RoutingNumber>021101108</RoutingNumber><AccountNumber>1040088576683</AccountNumber><CheckNumber>1477</CheckNumber><NameOnAccount>NON-TENANT-DEPOSIT</NameOnAccount><NotificationMethod>Merchant_Notify</NotificationMethod><FaceFeeType>Face</FaceFeeType><CheckFrontImageBytes_TiffG4>SUkqAPYlA …..AAIAA=</CheckFrontImageBytes_TiffG4><CheckRearImageBytes_TiffG4>8CQA….. …AAAGQAAIAA=</CheckRearImageBytes_TiffG4></transaction></AuthorizeTransactionWithCustomer></soap:Body></soap:Envelope>






Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Viewing all 10393 articles
Browse latest View live