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

Re: Post Buffer too Big

$
0
0
Re: Post Buffer too Big
Web Connection
Re: Post Buffer too Big
Mar. 4, 2015
02:15 pm
4AO0UKA2IShow this entire thread in new window
Gratar Image based on email address
From:Bob Lucas
To:Rick Strahl
Hi Rick;

I do have this boosted.

The problem is that there are probably 50 or more pdf files uploaded daily.
Most are between 200KB and 600KB. There may be some over a MB on occasion (although it is possible from some other web page to upload a larger file).

However, when the office staff get this message, they can't upload any more files of any size until the server is reboot.
Now, this might not happen for a couple of months or a couple of weeks, although it seems to be a little more regular now (every week or so). No stats kept really.

Even restarting IIS doesn't solve the issue (so reloading the wc.dll doesn't fix the problem). But I think it is some IIS related component. I think I may at one time have tested a .aspx page when the issue surfaced and it also had an issue. Or maybe it didn't, I don't remember!

But this is from a web connect page, at least, once the query hits the wc.dll.
So I am kind of perplexed on what is happening!

Bob



Hi Bob,

There's a post buffer limit flag in wc.ini that you can set. I think the default is 2 megs or somewhere in that range. set the number to 0 or a large number to account for your largest upload.

;*** Limits the sizeof data posted to the Web Server ;*** In bytes. 0 means allow any size. Note: Oversize ;*** buffers result in Server 500 errors. PostBufferLimit=0

+++ Rick ---



I have a website that occasionally generates an error:

Request data conversion failed or the POST buffer was too big.

This happens with the uploading of PDF files which is a big part of the internal side of the website.
The pdf files are not too big, generally under a MB in size.

I think it is a message from the web connection dll and when this happens the only solution is to reboot the server.

Restarting IIS does not make a difference.
The server is IIS6 on windows server 2006.

I'd like to find a solution beyond a server reboot.
So if anyone has some idea of the cause of this, I am all ears!

Bob




Re: Post Buffer too Big

$
0
0
Re: Post Buffer too Big
Web Connection
Re: Post Buffer too Big
Mar. 4, 2015
02:20 pm
4AO0UQF44Show this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Bob Lucas
There are also POST buffer limits in IIS.

I don't recall what those settings are in IIS 6/Server 2003 though.

On IIS7 and later it's on the <httpRuntime> configuration item and maxRequestLength. I think it's similar in IIS 6 but in application host.config and in the admin UI somewhere.

+++ Rick ---



Hi Rick;

I do have this boosted.

The problem is that there are probably 50 or more pdf files uploaded daily.
Most are between 200KB and 600KB. There may be some over a MB on occasion (although it is possible from some other web page to upload a larger file).

However, when the office staff get this message, they can't upload any more files of any size until the server is reboot.
Now, this might not happen for a couple of months or a couple of weeks, although it seems to be a little more regular now (every week or so). No stats kept really.

Even restarting IIS doesn't solve the issue (so reloading the wc.dll doesn't fix the problem). But I think it is some IIS related component. I think I may at one time have tested a .aspx page when the issue surfaced and it also had an issue. Or maybe it didn't, I don't remember!

But this is from a web connect page, at least, once the query hits the wc.dll.
So I am kind of perplexed on what is happening!

Bob



Hi Bob,

There's a post buffer limit flag in wc.ini that you can set. I think the default is 2 megs or somewhere in that range. set the number to 0 or a large number to account for your largest upload.

;*** Limits the sizeof data posted to the Web Server ;*** In bytes. 0 means allow any size. Note: Oversize ;*** buffers result in Server 500 errors. PostBufferLimit=0

+++ Rick ---



I have a website that occasionally generates an error:

Request data conversion failed or the POST buffer was too big.

This happens with the uploading of PDF files which is a big part of the internal side of the website.
The pdf files are not too big, generally under a MB in size.

I think it is a message from the web connection dll and when this happens the only solution is to reboot the server.

Restarting IIS does not make a difference.
The server is IIS6 on windows server 2006.

I'd like to find a solution beyond a server reboot.
So if anyone has some idea of the cause of this, I am all ears!

Bob






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. 4, 2015
11:25 pm
4AO1E7OWDShow this entire thread in new window
Gratar Image based on email address
From:Jacco
To:Rick Strahl
Hi Rick,

The strangest thing, but if I use dbresourceprovider instead of dbsimpleresourceprovider, it looks like it is working.

I did a test on the production site, which is azure, just to check.
With dbsimpleresource provider it did not work at all.
With dbresourceprovider it works.

Note: the script to create the table won' t work on an azure db because of the 'on primary' indicators.

For now this solves my problem I think.


If it's empty that means it's not set which means you're using Resx.

I tried this and added this as a LocalizationService method:

[CallbackMethod()]publicobject GetLocalizationInfo() {// Get the Web application configuration object.var config = WebConfigurationManager.OpenWebConfiguration("~/web.config");// Get the section related object. GlobalizationSection configSection = (GlobalizationSection)config.GetSection("system.web/globalization");string providerFactory = configSection.ResourceProviderFactoryType;if (string.IsNullOrEmpty(providerFactory)) providerFactory = "Resx provider";returnnew { ProviderUsed = providerFactory }; }

and it correctly returns the DbSimpleResourceProvider.

You do need to have permissions to read the config file I believe and you can't read these settings in medium trust. You'd get an exception though if it doesn't work so I think in your case the key is simply not set.

+++ Rick ---



I think you're right with your last suggestion.
Is there an easy way to check this, weather the provider is enabled?
Or better, find out which providerfactory is used. I am trying to figure this out with no success. Using code below gives me an empty value for providerfactory (even if translation works).

// Get the Web application configuration object.
var config = WebConfigurationManager.OpenWebConfiguration(configPath);

// Get the section related object.
GlobalizationSection configSection =
(GlobalizationSection)config.GetSection("system.web/globalization");

Console.WriteLine("factory: {0}",
configSection.ResourceProviderFactoryType);


Jacco,

It's either the configuration or you have different databases in different places. The database used can't just randomly switch. Either that namespaces and resources names are different in different places - or the provider isn't enable in one place and not the other and you're actually load RESX.

Not sure... but doesn't make sense to me.

+++ Rick ---



Hi Rick,

No, it is not that. I checked it. Web.config is the same in debug and release mode. I did the import. Problem is that behaviour is different with different browsers and also if compiled in debug vs release mode.

In none of the situations both forms work (my form and localizationadmin), but each one is working in different situations.

Also I think the problem is somewhere in my solution, but I cannot find it. Is there any way to debug the process of retrieving resource values? (I'm using implicit keys using meta tags).

Note (I updated my previous post with the web.config. Didn't know you would answer so quickly :)


Jacco,

It sounds like you're running with two different connection strings! If your resources are used - did you import the localization admin form resources into your database? If not the form won't be localized. The resources have to be there and all in a single database/table.

FWIW, I've also released a beta of the new version (2.0) of the library. There are a host of improvements and updates. One of them is that the admin form is a self-contained HTML page instead of an ASP.NET page. However, at this point it's not localized yet.

+++ Rick ---



Hi Rick,

Well, the div error message is solved :) It was a missing closing quote in : <div class="containercontent">

The 500 errors is also fixed, by setting the managed pipeline mode to integrated (instead of classic).

There is still an error about codegen.png which is missing. It is missing from the install from nuget, so this has to be added, but it is not a problem.

So, this solves a lot of error messages.

I still have 2 major problems:

1)
When I run in debug mode the localizationadmin will be translated, but my application doesn't.
When I run in release mode, my application will be translated, but the localizationadmin doesn't. Here it gives also the message about resources not being available on the admin page.

2)
When I run in debug mode, the lolocalizationadmin will be translated.
But when I press 'edit page resources' I get a popup with the admin which is not translated.

I will continue to debug. If I cannot find my problem I will post my web.config.

Thanks sofar.



Can you post your Web.config (remove or change anything sensitive).

This all sounds like a configuration problem in the .config file. Possibly you are running different versions of IIS/IIS Express in dev and production and that might account for the difference. I know Server 2008 has a number of differences in default handlers that are installed. I suspect you need to remove a handler before you can add it again. ManagedPipelineHandler sounds like a classic pipeline handler as opposed to integrated pipeline. It's an IIS module not one of ours. The configuration is set up for integrated pipeline.

If you see difference with what gets served I suspect you do have different connectionstrings or some settings that vary between production and dev installs.


+++ Rick ---


Hi Rick,

The 500 error expands to:
Handler "JavaScriptResourceHandler" has a bad module "ManagedPipelineHandler" in its module list
Requested URL: http://localhost:80/cisweb/JavaScriptResourceHandler.axd?ResourceSet=LocalizationAdmin/LocalizationAdmin.aspx&LocaleId=nl&VarName=localRes&ResourceType=resdb&ResourceMode=0


But I still have other strange behaviour.
Running from VS means, running from visual studio, with the VS debugger on. When I do this I keep getting the message:
Error: Syntax error, unrecognized expression: div."containercontent
After continuing the page functions normally. So, as said, this is not a big problem for me.

But.....

When I run in debug mode the localizationadmin will be translated, but my application doesn't.
When I run in release mode, my application will be translated, but the localizationadmin doesn't. Here it gives also the message about resources not being available on the admin page.

There are no differences between the web.config.release and web.config.debug.

FYI, i added westwind globalization in an existing solution.

Probably something simple, but I don't know where to look.


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?














Re: What to use of the big variaty of methods :-)?

$
0
0
Re: What to use of the big variaty of methods :-)?
FoxPro Programming
Re: What to use of the big variaty of methods :-)?
Mar. 4, 2015
11:46 pm
4AO1EYHINShow this entire thread in new window
Gratar Image based on email address
From:Stefan Zehner
To:Rick Strahl
Hi Rick,

no I haven't got. But I have the wsdl itself. The service providor wants all custumers to use the local wsdl. I don't know why, may be, they have several services (methods) and I get a wsdl with onle that service i booked? Anywa. I'll send u an email with the package I got.
Thanks for having a look on it!

Stefan


Stefan,

Do you have a WSDL URL for the service you can share I can take a quick look.

You can use wwSoap, but I won't be much help trying to figure out issues with the service if there are any. I can tell you if the proxy generator is failing on it that it's most likely a fairly off standard service you're dealing with (or a WS* service) so you are also going to have issues with wwSOAP which expects a fairly common structure.

But wwSoap works the way it always has it just requires a lot of manual tweaking of namespaces/headers etc. to get it to work if the service doesn't 'just work'. This is the primary reason I stopped officially supporting it - too many variations and tedious configuration.

+++ Rick ---



Hi Rick,

thanks for your answer.
I wanted to try your generator, but get errors:

---------------------------
West Wind Web Service Proxy Generator
---------------------------
Service Generation failed:
WSDL Parsing Error: Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: Die OrderCheckServiceBinding-Bindung von Namespace 'http://www.deltavista.com/dspone/ordercheck_V001' kann nicht importiert werden.
- Der orderCheck-Vorgang kann nicht importiert werden.
- Das Element 'http://www.deltavista.com/dspone/ordercheck-if/V001:messageContext' ist nicht vorhanden.
If you would like more help, please type "wsdl /?".

But anyway, why can't I use wwSoap?

Thanks a lot!
Stefan


Stefan,

Since you're just starting out with this could I suggest you take a look at the West Wind Web Service Proxy generator instead? wwSoap has been deprecated years ago in favor of this approach that's more automated and much more complete in support of a variety of services.

http://west-wind.com/WsdlGenerator/

+++ Rick ---





Stefan

Re: How to update my app

$
0
0
Re: How to update my app
FoxInCloud
Re: How to update my app
Mar. 5, 2015
05:17 am
4AP0BCWNUShow this entire thread in new window
Gratar Image based on email address
From:Tuvia Vinitsky
To:LLS

This was very much just thrown together, but if any of it is usefull here it is:

I have a table like this:
CLIENT C 10
UPDATE_DIR C 60
MAIN_DIR C 60
LACTIVE L

Then in the form.Init

WITH THISFORMSELECT update_ver5COUNTFOR lactive AND NOT DELETED() TO lnRecDIMENSION .aproj[lnRec,3] AS CHARACTERCOPYTOarray thisform.aproj FIELDS client, update_dir, main_dir FOR lactive = .t. FOR j = 1 TOALEN(.aproj, 1) .aproj[j,1] = ALLTRIM(.aproj[j,1]) .aproj[j,2] = ALLTRIM(.aproj[j,2]) .aproj[j,3] = ALLTRIM(.aproj[j,3])endfor* example:*.aproj[1,1] = "myclient"*.aproj[1,2] = "q:\clients\myclient\update\"*.aproj[1,3] = "http://myclient.vmanager.org"ENDWITH* get current version of executable =AGETFILEVERSION(aTempFile, "vman5.exe") thisform.vmctxt6.value = ALLTRIM(aTempFile[11])

Button to distribute updated exe's .Click

LPARAMETERS nButton, nShift, nXcoord, nYcoordFOR j = 1 TOALEN(thisform.aproj,1)CD c:\vman5 z = thisform.aproj[j,1] + ".exe" q = thisform.aproj[j,2] + zWAITWINDOW'copying ' + z + ' to ' + q nowaitCOPYFILE&z TO&q WAITclearENDFOR

Button to distribute updates .css etc .click

LPARAMETERS nButton, nShift, nXcoord, nYcoordFOR j = 1 TOALEN(thisform.aproj,1)CD c:\vman5 * find site folder r = STRTRAN(thisform.aproj[j,2], "update\", "site\*.*")WAITWINDOW'copying css files to' + r nowaitCOPYFILE c:\vman5\site\awdefault*.css to&rCOPYFILE c:\vman5\site\vm5*.css to&rCOPYFILE c:\vman5\site\*.inc to&rCOPYFILE c:\vman5\site\men*.css to&rCOPYFILE c:\vman5\site\vm5*.js to&rWAITclearENDFOR


Button to compare copied files and validate:

LPARAMETERS nButton, nShift, nXcoord, nYcoordLOCAL oXML lOK = ALEN(thisform.aproj,1)FOR j = 1 TOALEN(thisform.aproj,1)CD c:\vman5 =ADIR(aold, "c:\vman5\update_site\*.*") =ADIR(anew, STRTRAN(thisform.aproj[j,2], "update\", "site\*.*")) lOK2 = ALEN(aold,1)FOR i = 1 TOALEN(aold,1) w1 = ASCAN(anew, aold[i,1],-1,-1,1,9) IF w1 > 0 d1 = FILETOSTR("c:\vman5\update_site\" + aold[i,1]) d2 = FILETOSTR(STRTRAN(thisform.aproj[j,2], "update\", "site\" + aold[i,1]))if d1 == d2 lok2= lok2 -1ELSE =MESSAGEBOX('File mismatch: ' + thisform.aproj[j,1],0)ENDIFRELEASE d1, d2ENDIFENDFORIF lOK2 > 0LOOPENDIF z = thisform.aproj[j,1] + ".exe" q = thisform.aproj[j,2] + zWAITWINDOW'checking ' + q nowait a = FILETOSTR(z) b = FILETOSTR(q)CD c:\vman5 m1 = STRTRAN(thisform.aproj[j,2], "update\", "vmancloud\data\vman4.dbc") m2 = STRTRAN(thisform.aproj[j,2], "update\", "vmancloud\data\vman4.dct") m3 = STRTRAN(thisform.aproj[j,2], "update\", "vmancloud\data\vman4.dcx")IF'vman5' $ LOWER(thisform.aproj[j,1]) m1 = STRTRAN(thisform.aproj[j,2], "update\", "data\vman4.dbc") m2 = STRTRAN(thisform.aproj[j,2], "update\", "data\vman4.dct") m3 = STRTRAN(thisform.aproj[j,2], "update\", "data\vman4.dcx")ENDIF a1 = FILETOSTR("c:\vman5\update_data\vman4.dbc") a2 = FILETOSTR("c:\vman5\update_data\vman4.dct") a3 = FILETOSTR("c:\vman5\update_data\vman4.dcx") b1 = FILETOSTR(m1) b2 = FILETOSTR(m2) b3 = FILETOSTR(m3)IF a == b AND a1 == b1 AND a2 == b2 AND a3 == b3 lOK = lOK -1endifRELEASE a1, a2, a3, b1, b2, b3, m1, m2, m3 , a, bWAITclearENDFORWAITclear =MESSAGEBOX(STR(lOK) + " bad comparisons")

Button to update sites:

LPARAMETERS nButton, nShift, nXcoord, nYcoordLOCAL oXMLFOR j = 1 TOALEN(thisform.aproj,1) lcURL = tcURL + '/bin/wc.dll?_maintain~UpdateExe' oXml = CreateObject("Microsoft.XMLHTTP") oxml.open( "POST", lcURL , .f., "login", "password") oxml.send()IF oxml.status<> 200 OR oxml.statustext <> "OK" OR NOT ("the exe file has been update" $ LOWER(oxml.responsetext)) =MESSAGEBOX(STR(oXml.Status) + oXML.Statustext + oXml.Responsetext)ENDIFrelease oXMLENDFORWAITclear

Button to validate that site exe's were really updated:

LPARAMETERS nButton, nShift, nXcoord, nYcoordLOCAL oXML lOK = ALEN(thisform.aproj,1)FOR j = 1 TOALEN(thisform.aproj,1)CD c:\vman5 z = thisform.aproj[j,1] + ".exe" q = thisform.aproj[j,2] + z x = "c:\vman5\" + z p = STRTRAN(q, "\update\", "\vmancloud\")WAITWINDOW'checking ' + q nowait a = FILETOSTR(x) b = FILETOSTR(q) c = FILETOSTR(p)IF a == b AND b == c lOK = lOK -1ELSE =MESSAGEBOX(thisform.aproj[j,1] + "mismatch")endifRELEASE A RELEASE BRELEASE C WAITclearENDFORWAITclear =MESSAGEBOX(STR(lOK) + " bad comparisons")


Hi Tuvia

Can you, please, provide us with a copy of the source code?
I can adapt, with your agreement and that of Thierry, the general needs of users FoxInCloud.

best regard
Gilles


We actually created a form that does all this with various options. It is set to our specific needs but probably could be more generalized.


In this way i update the exe file, but how can i update the wwwroot folder where i have all js and html files ?


Ciao Michele,

This is documented in <VFP9>\tools\ab\aw\app\site\bin\wc.ini:

	ExeFile=
; {en} Full path to your xxx[Test|Prod].exe 
; {en} wc.dll uses this key to:
; {en} - DEVELOPMENT: launch your xxx[Test|Prod].exe in file mode
; {en}   (not really useful in development as you can simply double click your .exe in Windows Explorer)
; {en} - PRODUCTION: update your xxx[Test|Prod].exe with a new version specified in the 'UpdateFile' key below. 
; {en}   Crucial when using awStart.prg!awServerUpload() to upload a your FoxInCloud server to a production server. 

	UpdateFile=
; {en} Full path to the new version of your xxx[Test|Prod].exe
; {en} This path usually points to a secured directory shared on FTP where you upload 
; {en}  new versions after full testing in your development environment.
; {en} We encourage developers to use awStart.prg!awServerUpload which fully
; {en}  automates this update process.

so, in short, you need to:
- create a secured FTP directory on your production server
- fill UpdateFile= with the physical address of your update exe in this folder
- fill ExeFile= with the physical address of your live exe
- complete the settings in xxx[Test|Prod]ServerUpdate.prg (derived from awStart.prg!awServerUpload())
- run xxx[Test|Prod]ServerUpdate.prg from your development machine


Sorry, but i don't understand the correct procedure.
In the Ini file whic data i have to insert into these parameters ?

ExeFile=c:\program files (x86)\Abaque\ttWeb\TTWeb.exe
UpdateFile=C:\temp\Upload\TTWeb.exe

Make an example if, like in my case, i have these params:
AppName = MobTest.Exe
App Folder Name = c:\program files (x86)\AcutMobile\Mobtest.Exe
Web Folder Name = C:\inetpub\wwwroot\Acutmobile
AdminAccount = Fic
Password = 1234

The app that makes the update is called "WebUpdate.Exe" and it is positioned in c:\temp\upload\



Ciao Michele,

in VFP9/Tools/AB/AW/App/ you'll will find a program named xxxTestUpdate.prg:

* {en} Builds xxxTest.exe and updates to your production server running in COM mode * {fr} Met à jour xxxTest.exe sur votre serveur de production fonctionnant en mode COM && {en} this program is for use by licenced users only, against a production FoxInCloud Application&& {en} Keep excluded from project!&& {fr} ce programme est destiné à l'usage des utilisateurs avec licence, pour une application FoxInCloud en production && {fr} Garder exclus du projet !LPARAMETERS tlBuildExe && [.T.] {en} Build xxxTest.exe in production mode {fr} Régénérer xxxTest.exe en mode production IFPCOUNT() = 0CLEAR ALLLOCAL tlBuildExe tlBuildExe = .T.ELSE tlBuildExe = VARTYPE(m.tlBuildExe) == 'L' AND m.tlBuildExeENDIF AW() LOCAL loDefault loDefault = CreateObject('abSet', 'DEFAULT', ADDBS(JustPath(Sys(16))))RETURN awServerUpload(;[xxxTest.exe]; && {en} Name of the executable to be refreshed to the production server {fr} Nom de l'exécutable à rafraîchir sur le serveur de production , [http://(xxxTest.)<IP or domain of your production server>/(xxxTest/)]; && {en} Application's site URL {fr} URL du site de l'application cible , m.tlBuildExe;&& {en} Build xxxTest.exe in production mode {fr} Régénérer xxxTest.exe en mode production , [yourAdminAccountInWC.ini]; &&&& {en} Admin account on server allowed to perform wConnect maintenance tasks (see 'admin' in wc.ini) and to write into FTP directory {fr} Compte administrateur du serveur autorisé à réaliser des opérations de maintenance wwConnect (voir 'admin' dans wc.ini) et à écrire dans le répertoire d'upload , [yourAdminAccountPassWord]; && {en} Account account password {fr} Mot du passe du compte administrateur , [/Upload/]; && {en} FTP directory where xxxTest.exe uploads; must match 'UpdateExe' in wc.ini {fr} Répertoire FTP où xxxTest.exe est téléchargé; doit correspondre à l'entrée 'UpdateExe' de wc.ini )

you need to adapt this program to you server(s)

You can either have one program per server, or have a loop inside your program to address all servers, and maybe have an additional parameter to update only one server.

on your server's wc.ini, you need to set these 2 parameters (eg on our server):

ExeFile=c:\program files (x86)\Abaque\ttWeb\TTWeb.exe
UpdateFile=C:\temp\Upload\TTWeb.exe

C:\temp\Upload\ is the physical directory on the server where the /Upload/ ftp virtual directory is mapped to.


Hi. Now that i begin to have a good number of foxincloud app installed i have a new problem.
How to update my app. Or better how to automatically update my app.
Normally i have a zip that contains my .Exe some other files to install in my program files folder and the i have the web files, those files that i have to copy in wwwroot folder. Finally sometimes i have even the awscripts folder to update and so i have also these folder..All these things in one zip file....

Normally i manually stop the server and then always manually i copy new files in all requested folders and then i restart the server.

Is it possible to automate this operation ? In the Ini file of my app i have sseen a key for update, but i don't understand how it works and if it can solve my problem.

Some suggests

Thanks







Re: What to use of the big variaty of methods :-)?

$
0
0
Re: What to use of the big variaty of methods :-)?
FoxPro Programming
Re: What to use of the big variaty of methods :-)?
Mar. 5, 2015
06:27 pm
4AP13K5DRShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Rick Strahl
Tried importing the service from the WSDL file on disk. Worked for me. Created a massive service definition in the .NET assembly and a single method in the service class.

Not sure why you would see something different. Make sure you have rights to write out the assemblies - if you rn from fox run as administrator. The standalone Wizard should ask to elevate.

+++ Rick ---



Stefan,

Do you have a WSDL URL for the service you can share I can take a quick look.

You can use wwSoap, but I won't be much help trying to figure out issues with the service if there are any. I can tell you if the proxy generator is failing on it that it's most likely a fairly off standard service you're dealing with (or a WS* service) so you are also going to have issues with wwSOAP which expects a fairly common structure.

But wwSoap works the way it always has it just requires a lot of manual tweaking of namespaces/headers etc. to get it to work if the service doesn't 'just work'. This is the primary reason I stopped officially supporting it - too many variations and tedious configuration.

+++ Rick ---



Hi Rick,

thanks for your answer.
I wanted to try your generator, but get errors:

---------------------------
West Wind Web Service Proxy Generator
---------------------------
Service Generation failed:
WSDL Parsing Error: Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: Die OrderCheckServiceBinding-Bindung von Namespace 'http://www.deltavista.com/dspone/ordercheck_V001' kann nicht importiert werden.
- Der orderCheck-Vorgang kann nicht importiert werden.
- Das Element 'http://www.deltavista.com/dspone/ordercheck-if/V001:messageContext' ist nicht vorhanden.
If you would like more help, please type "wsdl /?".

But anyway, why can't I use wwSoap?

Thanks a lot!
Stefan


Stefan,

Since you're just starting out with this could I suggest you take a look at the West Wind Web Service Proxy generator instead? wwSoap has been deprecated years ago in favor of this approach that's more automated and much more complete in support of a variety of services.

http://west-wind.com/WsdlGenerator/

+++ Rick ---






Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Re: What to use of the big variaty of methods :-)?

$
0
0
Re: What to use of the big variaty of methods :-)?
FoxPro Programming
Re: What to use of the big variaty of methods :-)?
Mar. 5, 2015
06:28 pm
4AP13LTNNShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Stefan Zehner
Worked for me when I imported your WDSL files from disk. Created huge .NET and a single method FoxPro proxy.

What exactly doesn't work?

+++ Rick ---



Hi Rick,

no I haven't got. But I have the wsdl itself. The service providor wants all custumers to use the local wsdl. I don't know why, may be, they have several services (methods) and I get a wsdl with onle that service i booked? Anywa. I'll send u an email with the package I got.
Thanks for having a look on it!

Stefan


Stefan,

Do you have a WSDL URL for the service you can share I can take a quick look.

You can use wwSoap, but I won't be much help trying to figure out issues with the service if there are any. I can tell you if the proxy generator is failing on it that it's most likely a fairly off standard service you're dealing with (or a WS* service) so you are also going to have issues with wwSOAP which expects a fairly common structure.

But wwSoap works the way it always has it just requires a lot of manual tweaking of namespaces/headers etc. to get it to work if the service doesn't 'just work'. This is the primary reason I stopped officially supporting it - too many variations and tedious configuration.

+++ Rick ---



Hi Rick,

thanks for your answer.
I wanted to try your generator, but get errors:

---------------------------
West Wind Web Service Proxy Generator
---------------------------
Service Generation failed:
WSDL Parsing Error: Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: Die OrderCheckServiceBinding-Bindung von Namespace 'http://www.deltavista.com/dspone/ordercheck_V001' kann nicht importiert werden.
- Der orderCheck-Vorgang kann nicht importiert werden.
- Das Element 'http://www.deltavista.com/dspone/ordercheck-if/V001:messageContext' ist nicht vorhanden.
If you would like more help, please type "wsdl /?".

But anyway, why can't I use wwSoap?

Thanks a lot!
Stefan


Stefan,

Since you're just starting out with this could I suggest you take a look at the West Wind Web Service Proxy generator instead? wwSoap has been deprecated years ago in favor of this approach that's more automated and much more complete in support of a variety of services.

http://west-wind.com/WsdlGenerator/

+++ Rick ---







Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Re: What to use of the big variaty of methods :-)?

$
0
0
Re: What to use of the big variaty of methods :-)?
FoxPro Programming
Re: What to use of the big variaty of methods :-)?
Mar. 5, 2015
11:19 pm
4AP1E0560Show this entire thread in new window
Gratar Image based on email address
From:Stefan Zehner
To:Rick Strahl
Hi Rick,

I'll try it again. But I got en error, I posted you already.

I can make it, if I upload my wdsl to the internet and put the URL into the generator. So, thats OK now :-).

After browsing with the reflector and coding as documented, I got an error back, similar with that one I got with wwsoap:

"The method "OrderCheckService.OrderCheckService.orderCheck" could not been found..."

With wwSOAP the text is a little different:

Error validating 'orderCheck' body element: cvc-elt.1: Cannot find the declaration of element 'orderCheck'.


But browsing in the reflector shows the way:

OrderCheckServiceProxy.dll
-> OrderCheckService
-> OrderCheckService
->orderCheck(OrderCheckRequest)


Spelling of the method, case sensitive, and Parameter is correct.

In the FoxPro-Code in the method "orderCheck", it sais this.oBridge.InvokeMethod(THIS.OSERVICE....
THIS.OSERVISE has only ONE method: httplogin. Nothing else. I am confused...


Thanks,
Stefan



Worked for me when I imported your WDSL files from disk. Created huge .NET and a single method FoxPro proxy.

What exactly doesn't work?

+++ Rick ---



Re: What to use of the big variaty of methods :-)?

$
0
0
Re: What to use of the big variaty of methods :-)?
FoxPro Programming
Re: What to use of the big variaty of methods :-)?
Mar. 6, 2015
03:12 am
4AQ06VFULShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Stefan Zehner
Not sure really - I suspect it's a permissions problem. You have to have both the WSDL and the XSD file in the same folder as well...

As to the error it means you're not passing the right type for the parameter. Please post your relevant code...

+++ Rick ---


Hi Rick,

I'll try it again. But I got en error, I posted you already.

I can make it, if I upload my wdsl to the internet and put the URL into the generator. So, thats OK now :-).

After browsing with the reflector and coding as documented, I got an error back, similar with that one I got with wwsoap:

"The method "OrderCheckService.OrderCheckService.orderCheck" could not been found..."

With wwSOAP the text is a little different:

Error validating 'orderCheck' body element: cvc-elt.1: Cannot find the declaration of element 'orderCheck'.


But browsing in the reflector shows the way:

OrderCheckServiceProxy.dll
-> OrderCheckService
-> OrderCheckService
->orderCheck(OrderCheckRequest)


Spelling of the method, case sensitive, and Parameter is correct.

In the FoxPro-Code in the method "orderCheck", it sais this.oBridge.InvokeMethod(THIS.OSERVICE....
THIS.OSERVISE has only ONE method: httplogin. Nothing else. I am confused...


Thanks,
Stefan



Worked for me when I imported your WDSL files from disk. Created huge .NET and a single method FoxPro proxy.

What exactly doesn't work?

+++ Rick ---



Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Re: What to use of the big variaty of methods :-)?

$
0
0
Re: What to use of the big variaty of methods :-)?
FoxPro Programming
Re: What to use of the big variaty of methods :-)?
Mar. 6, 2015
03:58 am
4AQ08IJ3RShow this entire thread in new window
Gratar Image based on email address
From:Stefan Zehner
To:Rick Strahl
OK, here is the code for testing. wsdl and xsd files are in the same folder. In the current folder. The generatet files are in program-folder (prg) and current folder (dll), as well as the code in aprg file:

DO program\ordercheckserviceproxy.PRGLOCAL loProxy loProxy = CREATEOBJECT("OrderCheckServiceProxy") llOK = loProxy.HttpLogin("interfina_test_xml","q@Y8tmru",.T.)IF !llOKMESSAGEBOX("Anmeldung fehl geschlagen!") loProxy = nullRETURNENDIFTEXTTO m.lcString ADDITIVE TEXTMERGE NOSHOW <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Header> <messageContext xmlns="http://www.deltavista.com/dspone/ordercheck-if/V001"> <credentials> <user>interfina_test_xml</user> <password>q@Y8tmru</password> </credentials> <correlationID>DE-456321</correlationID> </messageContext> </SOAP-ENV:Header> <SOAP-ENV:Body> <orderCheckRequest xmlns="http://www.deltavista.com/dspone/ordercheck-if/V001"> <product> <name>IdentCheckConsumer</name> <country>DEU</country> <proofOfInterest>ABI</proofOfInterest> </product> <searchedAddress> <legalForm>PERSON</legalForm> <address> <name>Falk</name> <firstName>Quintus</firstName> <gender>MALE</gender> <dateOfBirth>19680414</dateOfBirth> <location> <street>Rathausstrasse</street> <house>2</house> <city>Glücksburg</city> <zip>24960</zip> <country>DEU</country> </location> </address> </searchedAddress> <clientData> <reference>Test_Ident_01</reference> <order> <contact> <item>email</item> <value>f.quintus@deltavista.com</value> </contact> </order> </clientData> </orderCheckRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ENDTEXT loResponse = loProxy.ordercheck(m.lcString) IF loResponse = .T.MESSAGEBOX(":-)")ELSEMESSAGEBOX(":-(" + CHR(13) + loProxy.CERRORMSG)ENDIF loService = null


Not sure really - I suspect it's a permissions problem. You have to have both the WSDL and the XSD file in the same folder as well...

As to the error it means you're not passing the right type for the parameter. Please post your relevant code...

+++ Rick ---

Stefan

User Login

$
0
0
User Login
FoxInCloud
User Login
Mar. 6, 2015
01:05 pm
4AQ0S2CGUShow this entire thread in new window
Gratar Image based on email address
From:James Patterson
To:All
Most of the time I can lurk here and pickup the info I need, but I need a bit of help on this one. I am working on website security and have a few questions before I open this site to the WORLD. I feel naked! Anyway, I know you guys have been doing this a long time and have an elegant solution and I don't need to "reinvent the wheel". The steps as I see them:

1. I need to direct all traffic to the default index.htm via IIE, no problem. This index page can be a VFP form via FIC as in your sampleindex.scx. Need to set wlAnonymousAllowed = .T. or it will ignore all requests. Seem fine so far?

2. On said form, I need to use the login logic of my choice. In this case I am authenticating against an LDAP dir and now have confirmation of the user name and permissions. FIC does NOT care if my user name is char or numeric as FIC never uses this info, correct?

3. Once authenticated, pass form.wUserLogIn() the value chosen for the user, char or numeric. Which appears to pass this to awProcess.wUserLogIn() which calls wUserSet(). Here is the point of some confusion. I think xxxServer.wUserSet() is a placeholder where I can code in a method of retaining the login name, permissions, etc... But, is there more? Does FIC use the user ID passed to wUserSet() in the Session?

4. At this point, authenticated and wUserSet(), is a good time to call the main form. Even though I know I am authenticated, FIC will NOT(?) display the main form UNLESS(?) I create some method in the main form that checks for authentication? I am assuming this is why in the sampleindex.scx the wFormMaster() is called with a form name AND the user ID. Somewhere in the main form init(), the user ID is used to determine if the main form can be displayed?

5. When the main form is displayed, menu or button choices are provided for navigation. This is a good place to discuss global vs form security. I assume global would store authentication and authorization info in main form properties. These can be accessed by the called forms to determine whether to display? This seems to be a mix of global and form, so I guess I really am a bit lost at this point.

6. With wlAnonymousAllowed = .f., how to allow the form to display, or did calling wUserSet() do this?

I apparently know just enough to be dangerous! I know I am missing just one or two pieces somewhere.

Thanks in advance - James

Replacing null in JSON

$
0
0
Replacing null in JSON
ASP.NET
Replacing null in JSON
Mar. 6, 2015
02:45 pm
4AQ0VMK3IShow this entire thread in new window
Gratar Image based on email address
From:Erwin
To:Rick Strahl
Rick,

Thanks for your response. The best way for me was to deal with the JSON after getting it from the controller, as follows:

var oldstr = JSON.stringify(data).replace(/null/g, '"#"');


You can't assign a default value of a string to an int or int? value so this will silently fail.

The only way you can do this is to build custom JSON.NET converter that handles the object and specific value explicitly. Not a trivial thing to do.

One thing you can also do is use LINQ or an Anonymous object to project to a new anonymous type to export:

var obj = <yourobject>;
returnnew { name = obj.name, company = obj.company, parent = obj.parent == null ? "#" : obj.parent.Value.ToString() };

Essentially what you're doing is exporting your data model and what this does is expose a view model to what's required on the client.

+++ Rick ---



I have a view that uses an ApiController to return the following JSON from an ADO.Net class. Column name 'parent' is an optional int value, but I want to return it as string when it is null.
How can I replace the entry in the JSON result before it is sent back to the view?
"parent":null
with
"parent":"#"
in the JSON?

The column "parent"

[System.ComponentModel.DefaultValue("#")]publicint? parent { get; set; }

The JSON

[{"id":2,"text":"PROG","parent":null},{"id":3,"text":"STAGE ONE","parent":2},{"id":4,"text":"INFRA","parent":2},{"id":5,"text":"SYSTEM","parent":3},{"id":6,"text":"STOCK","parent":3},{"id":7,"text":"DPT","parent":3},{"id":8,"text":"SUPPLIES","parent":2}]


Thanks for your help



Re: Stuck on Deployment

$
0
0
Re: Stuck on Deployment
Web Connection
Re: Stuck on Deployment
Mar. 7, 2015
11:58 am
4AR0PNRYKShow this entire thread in new window
Gratar Image based on email address
From:Russell Campbell
To:Rod
Reading this whole thread, this looks like a solved issue, however it's my understanding that in later versions of IIS, you can't run WC.DLL out of the BIN folder.



I've chosen a Virtual Private Server (2008/IIS7) for deploying my Web app, so I have full access and control. I'm in WWC 5.43.

I've followed the instructions to copy every thing up to the server. I'm running the server configuration with Console.exe, creating a virtual "wconnect" as suggested because the apps just running out of the c:\wconnect root. But I keep running into "unable to copy wc.dll to \bin, the file may be in use, shut down the server, etc." I assume that means the WC server, but I'm not running it.

I start up my EXE, but its clear the site is just not mapped to it. I hit the web page, but nothings happening in the WC console. And I get "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed" on the browser.

I've tried turning off "Copying Separate version of wc.dll", and then I don't get the copy error, but it still won't run. I still get the 500 error.

I'm running everything as Administrator, though I don't think its necessary as I'm logged in as Administrator and I can freely copy files wherever I want. I've checked permissions on folders, which seems fine for Administrator.

It was all working fine on my test server.

I've looked at the Manual Server Configuration Topic, but the dialog screen shots look nothing like what I'm seeing in 2008/IIS7.

What am I missing?

Thanks for any help.


Re: Stuck on Deployment

$
0
0
Re: Stuck on Deployment
Web Connection
Re: Stuck on Deployment
Mar. 7, 2015
12:21 pm
4AR0QHYYOShow this entire thread in new window
Gratar Image based on email address
From:Russell Campbell
To:Russell Campbell
Hmm, researching this a little further, I guess that's when you don't use scriptmaps and use IIS 7+. I have always used scriptmaps, but it seems the admin page had some code that still called WC.DLL directly and so that may have been causing me issues. I just never put WC.DLL in the BIN folder to avoid the issue.



Reading this whole thread, this looks like a solved issue, however it's my understanding that in later versions of IIS, you can't run WC.DLL out of the BIN folder.



I've chosen a Virtual Private Server (2008/IIS7) for deploying my Web app, so I have full access and control. I'm in WWC 5.43.

I've followed the instructions to copy every thing up to the server. I'm running the server configuration with Console.exe, creating a virtual "wconnect" as suggested because the apps just running out of the c:\wconnect root. But I keep running into "unable to copy wc.dll to \bin, the file may be in use, shut down the server, etc." I assume that means the WC server, but I'm not running it.

I start up my EXE, but its clear the site is just not mapped to it. I hit the web page, but nothings happening in the WC console. And I get "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed" on the browser.

I've tried turning off "Copying Separate version of wc.dll", and then I don't get the copy error, but it still won't run. I still get the 500 error.

I'm running everything as Administrator, though I don't think its necessary as I'm logged in as Administrator and I can freely copy files wherever I want. I've checked permissions on folders, which seems fine for Administrator.

It was all working fine on my test server.

I've looked at the Manual Server Configuration Topic, but the dialog screen shots look nothing like what I'm seeing in 2008/IIS7.

What am I missing?

Thanks for any help.



Unable to register COM object

$
0
0
Unable to register COM object
Web Connection
Unable to register COM object
Mar. 7, 2015
02:10 pm
4AR0UDAQIShow this entire thread in new window
Gratar Image based on email address
From:Russell Campbell
To:All
CONSOLE.EXE does not want to register the COM object <AppName>.<AppName>Server and says to register it manually and run CONSOLE again (I did run CONSOLE as administrator). So I try to do that using REGSVR32 <AppName>.EXE and that fails and doing a little research I was reminded that for EXE files, it's <AppName>.EXE /regserver

Well, that runs with no complaints (and no confirmation, either), but when I look in DCOMCNFG, I don't see my app. And when I run CONSOLE again, it still will not register the COM server. Any suggestions to correct this problem would be appreciated.

And, as an aside (and I realize this may be fixed in the latest version), the bug that incorrectly alters WC.INI still exists in the version I'm using.


Re: What to use of the big variaty of methods :-)?

$
0
0
Re: What to use of the big variaty of methods :-)?
FoxPro Programming
Re: What to use of the big variaty of methods :-)?
Mar. 8, 2015
05:41 am
4AS0A20U7Show this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Stefan Zehner
Stefan,

I think you're not understanding how the proxy generator works. You have to pass an object not XML to this function...

Please review the basic documentation for the proxy generator or watch the video to understand how this works. You don't pass XML - you use objects to fill the data and then pass that object to the method.

+++ Rick ---



OK, here is the code for testing. wsdl and xsd files are in the same folder. In the current folder. The generatet files are in program-folder (prg) and current folder (dll), as well as the code in aprg file:

DO program\ordercheckserviceproxy.PRGLOCAL loProxy loProxy = CREATEOBJECT("OrderCheckServiceProxy") llOK = loProxy.HttpLogin("interfina_test_xml","q@Y8tmru",.T.)IF !llOKMESSAGEBOX("Anmeldung fehl geschlagen!") loProxy = nullRETURNENDIFTEXTTO m.lcString ADDITIVE TEXTMERGE NOSHOW <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Header> <messageContext xmlns="http://www.deltavista.com/dspone/ordercheck-if/V001"> <credentials> <user>interfina_test_xml</user> <password>q@Y8tmru</password> </credentials> <correlationID>DE-456321</correlationID> </messageContext> </SOAP-ENV:Header> <SOAP-ENV:Body> <orderCheckRequest xmlns="http://www.deltavista.com/dspone/ordercheck-if/V001"> <product> <<span class="properties">name>IdentCheckConsumer</name> <country>DEU</country> <proofOfInterest>ABI</proofOfInterest> </product> <searchedAddress> <legalForm>PERSON</legalForm> <address> <<span class="properties">name>Falk</name> <firstName>Quintus</firstName> <gender>MALE</gender> <dateOfBirth>19680414</dateOfBirth> <location> <street>Rathausstrasse</street> <house>2</house> <city>Glücksburg</city> <zip>24960</zip> <country>DEU</country> </location> </address> </searchedAddress> <clientData> <reference>Test_Ident_01</reference> <<span class="functions">order> <contact> <<span class="methods">item>email</item> <<span class="properties">value>f.quintus@deltavista.com</value> </contact> </order> </clientData> </orderCheckRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ENDTEXT loResponse = loProxy.ordercheck(m.lcString) IF loResponse = .T.MESSAGEBOX(":-)")ELSEMESSAGEBOX(":-(" + CHR(13) + loProxy.CERRORMSG)ENDIF loService = null


Not sure really - I suspect it's a permissions problem. You have to have both the WSDL and the XSD file in the same folder as well...

As to the error it means you're not passing the right type for the parameter. Please post your relevant code...

+++ Rick ---



Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Re: Stuck on Deployment

$
0
0
Re: Stuck on Deployment
Web Connection
Re: Stuck on Deployment
Mar. 8, 2015
05:41 am
4AS0A20TYShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Russell Campbell

You can run the DLL out of bin, but you have to configure IIS to allow it. There's Url restriction rule that disallows direct access to DLLs out of the bin folder.

There's absolutely no reason anybody should be using DLLs anymore. Even if apps have .dll links those links can be easily ported to scriptmaps with simple search and replace for wc.dll -> wc.wc in both code and HTML/Templates. Scriptmaps are so much cleaner and avoid a host of problems you have to deal with when using a hardcoded dll path.

+++ Rick ---


Hmm, researching this a little further, I guess that's when you don't use scriptmaps and use IIS 7+. I have always used scriptmaps, but it seems the admin page had some code that still called WC.DLL directly and so that may have been causing me issues. I just never put WC.DLL in the BIN folder to avoid the issue.



Reading this whole thread, this looks like a solved issue, however it's my understanding that in later versions of IIS, you can't run WC.DLL out of the BIN folder.



I've chosen a Virtual Private Server (2008/IIS7) for deploying my Web app, so I have full access and control. I'm in WWC 5.43.

I've followed the instructions to copy every thing up to the server. I'm running the server configuration with Console.exe, creating a virtual "wconnect" as suggested because the apps just running out of the c:\wconnect root. But I keep running into "unable to copy wc.dll to \bin, the file may be in use, shut down the server, etc." I assume that means the WC server, but I'm not running it.

I start up my EXE, but its clear the site is just not mapped to it. I hit the web page, but nothings happening in the WC console. And I get "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed" on the browser.

I've tried turning off "Copying Separate version of wc.dll", and then I don't get the copy error, but it still won't run. I still get the 500 error.

I'm running everything as Administrator, though I don't think its necessary as I'm logged in as Administrator and I can freely copy files wherever I want. I've checked permissions on folders, which seems fine for Administrator.

It was all working fine on my test server.

I've looked at the Manual Server Configuration Topic, but the dialog screen shots look nothing like what I'm seeing in 2008/IIS7.

What am I missing?

Thanks for any help.






Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Re: Stuck on Deployment

$
0
0
Re: Stuck on Deployment
Web Connection
Re: Stuck on Deployment
Mar. 8, 2015
05:41 am
4AS0A20TQShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Russell Campbell

You probably have an old admin page. The most recent admin page uses wc.wc links for everything (or it should at least - let me know if it doesn't if you are running 5.5x and later).

+++ Rick ---



Hmm, researching this a little further, I guess that's when you don't use scriptmaps and use IIS 7+. I have always used scriptmaps, but it seems the admin page had some code that still called WC.DLL directly and so that may have been causing me issues. I just never put WC.DLL in the BIN folder to avoid the issue.



Reading this whole thread, this looks like a solved issue, however it's my understanding that in later versions of IIS, you can't run WC.DLL out of the BIN folder.



I've chosen a Virtual Private Server (2008/IIS7) for deploying my Web app, so I have full access and control. I'm in WWC 5.43.

I've followed the instructions to copy every thing up to the server. I'm running the server configuration with Console.exe, creating a virtual "wconnect" as suggested because the apps just running out of the c:\wconnect root. But I keep running into "unable to copy wc.dll to \bin, the file may be in use, shut down the server, etc." I assume that means the WC server, but I'm not running it.

I start up my EXE, but its clear the site is just not mapped to it. I hit the web page, but nothings happening in the WC console. And I get "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed" on the browser.

I've tried turning off "Copying Separate version of wc.dll", and then I don't get the copy error, but it still won't run. I still get the 500 error.

I'm running everything as Administrator, though I don't think its necessary as I'm logged in as Administrator and I can freely copy files wherever I want. I've checked permissions on folders, which seems fine for Administrator.

It was all working fine on my test server.

I've looked at the Manual Server Configuration Topic, but the dialog screen shots look nothing like what I'm seeing in 2008/IIS7.

What am I missing?

Thanks for any help.






Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Re: Unable to register COM object

$
0
0
Re: Unable to register COM object
Web Connection
Re: Unable to register COM object
Mar. 8, 2015
05:41 am
4AS0A20THShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Russell Campbell
Hi Russell,

Two things:

1. Make sure you run under an Admin account (Run As Administrator when you launch VFP or open a Windows Command Prompt). Even if you are an Admin user under Windows you are actually not due to User Account Control. Make sure you actually run as an admin.

COM Registration requires admin rights because it rights to the machine registry - so there's no way around that. YourExe /regserver will always run. It just may not actually work if you are not an admin - it'll silently fail.

2. If you manually register on a 64 bit machine running the default DCOMCNFG brings up the 64 bit DCOMCNFG while VFP registers in the 32 bit DCOMCNFG registry. You need to launch the 32 bit DCOMCNFG view and you can configure your server there (assuming it registered).

If you register your component through CONSOLE.EXE it'll do the right thing and put it in both registries so it's found either way.

All this is described in the help file:
wcdocs:_s901dvuwg.htm

and in this blog post:

http://www.west-wind.com/wconnect/WebLog/ShowEntry.blog?id=887

+++ Rick ---



CONSOLE.EXE does not want to register the COM object <AppName>.<AppName>Server and says to register it manually and run CONSOLE again (I did run CONSOLE as administrator). So I try to do that using REGSVR32 <AppName>.EXE and that fails and doing a little research I was reminded that for EXE files, it's <AppName>.EXE /regserver

Well, that runs with no complaints (and no confirmation, either), but when I look in DCOMCNFG, I don't see my app. And when I run CONSOLE again, it still will not register the COM server. Any suggestions to correct this problem would be appreciated.

And, as an aside (and I realize this may be fixed in the latest version), the bug that incorrectly alters WC.INI still exists in the version I'm using.




Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Replacing null in JSON

$
0
0
Replacing null in JSON
ASP.NET
Replacing null in JSON
Mar. 8, 2015
05:41 am
4AS0A20T4Show this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Erwin
Yup that works, but not the path I'd choose. It's really bad form to post process your data like this - it's much better to build models to use in the UI coming from the server that contain the data in the format you need it similar to what I showed, or better yet with official model processing in the server.

Alternately your client code and/or bindings could also deal with the nulls more elegantly.

But... whatever works :-)

+++ Rick ---



Rick,

Thanks for your response. The best way for me was to deal with the JSON after getting it from the controller, as follows:

var oldstr = JSON.stringify(data).replace(/null/g, '"#"');


You can't assign a default value of a string to an int or int? value so this will silently fail.

The only way you can do this is to build custom JSON.NET converter that handles the object and specific value explicitly. Not a trivial thing to do.

One thing you can also do is use LINQ or an Anonymous object to project to a new anonymous type to export:

var obj = <yourobject>;
returnnew { name = obj.name, company = obj.company, parent = obj.parent == null ? "#" : obj.parent.Value.ToString() };

Essentially what you're doing is exporting your data model and what this does is expose a view model to what's required on the client.

+++ Rick ---



I have a view that uses an ApiController to return the following JSON from an ADO.Net class. Column name 'parent' is an optional int value, but I want to return it as string when it is null.
How can I replace the entry in the JSON result before it is sent back to the view?
"parent":null
with
"parent":"#"
in the JSON?

The column "parent"

[System.ComponentModel.DefaultValue("#")]publicint? parent { get; set; }

The JSON

[{"id":2,"text":"PROG","parent":null},{"id":3,"text":"STAGE ONE","parent":2},{"id":4,"text":"INFRA","parent":2},{"id":5,"text":"SYSTEM","parent":3},{"id":6,"text":"STOCK","parent":3},{"id":7,"text":"DPT","parent":3},{"id":8,"text":"SUPPLIES","parent":2}]


Thanks for your help






Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Viewing all 10393 articles
Browse latest View live