1. Sudeep Pandey
  2. PowerBuilder
  3. Friday, 15 March 2019 07:17 AM UTC

Hello,

I have 4 web services which was build in PB .NET 12.5. Now I am converting those services in PB2017 r3. I am unable to find database name from web.config file. "web.config" is automatically created after Install web service msi.

File location: "C:\inetpub\wwwroot\TestWebService03132019\web.config"

In previous code: I was getting value through GetConfigSettings() to get Database name, DBParm and other information.

However this function is working in PB2017r3.(May function obsolete).

Please give your valuable suggestion.

 

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 19 March 2019 15:14 PM UTC
  2. PowerBuilder
  3. # 1

Hi Sudeep;

   When running the example Web Service that uses my framework, take note that the "Controller" and "Interface" objects have an "is_Workspace_Path" property. The framework uses this at run time under IIS to locate the INI or any other supporting deployed files.

  The "is_Workspace_Path" property value must be the same as the Web Services development location, as follows:

 

  When you deploy a PB Web Service, the WS Project will create a sub-folder structure that mirrors the developer's work folder structure within the IIS based WS, as follows:

 

HTH

Regards ... Chris

Comment
  1. Sudeep Pandey
  2. Wednesday, 20 March 2019 11:35 AM UTC
Hello Chris,

Thank you to helped me on this issue.



I did the same even I can get proper path of webservices.ini but I am unable to read this file. the FileExists() and ProFileString() function not working.

File path during debug: "C:\inetpub\wwwroot\UMWebService_PB2017R3_03132019_root\file\common\c\Dev\CCNX-UMWebServices\WebService.ini"

Whenever I am trying to get DB information from same webservices.ini through other PB application then it is working. I don't know wrong with this INI file.



When I deployed my web service in other location like D drive then it is working. it seem's some right issue while trying to read file through PB. I applied setfileattributes() function before read file but not working.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 20 March 2019 17:18 PM UTC
Ahhh .. it could also be that the WWWROOT folder of IIS does not have the "IIS_USRS" user assigned to that folder or the UserID is assigne but does not have full permissions (at the very least "Read&Execute", "Read" & "List Folder Contents").
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 15 March 2019 15:07 PM UTC
  2. PowerBuilder
  3. # 2

Hi Sudeep;

  The current Web Service feature of PB017Rx is based on part from the WebForms feature. Thus, the GetConfigSettings command could be used on either type of IIS base application. However, Sybae removed the Webforms feature (and thus inadvertently the GetConfigSettings command) in PB 12.5.2.

  My suggestion would be to replace the use of the Web.config file with your own INI file. INI files are universal and can work in native, web, mobile and Web services.You can see how INI files are used in my web service framework. Check out the example OrderEntry application and its related Web Service:  https://sourceforge.net/projects/stdfndclass/files/Applications/PowerBuilder/OrderEntry

Other alternatives to INI that would also work would be XML and/or JSON. These files can also be easily read - especially by DataWindows using the ImportFile() command.

Food for thought.

Regards ... Chris

 

 

Comment
  1. Sudeep Pandey
  2. Tuesday, 19 March 2019 08:53 AM UTC
Thank you for sharing source code.

I downloaded and used the code, now I am getting correct file location. However here I am struck in other issue. I am getting the file location “C:\inetpub\wwwroot\TestWebService03132019_v1_root\file\common\C\Dev\TestWebService\WebService.ini”. While I am trying validate the file is exists or not through FileExists() function, then this is returning FALSE.

I debug you shared source code and getting file location is “C:\inetpub\wwwroot\LDAP_root\file\common\C\Sudeep\Active_Dir\WebService.ini”. But here is also FileExists() function returning FALSE value.

Code Details: Line number 55 and 73 the constructor of nc_business_master user object. FileExists() is returning FALSE value.

NOTE: When I follow file location manually then I can see file is exists.

Please suggest, am I missing something?



Regards

Sudeep
  1. Helpful
  1. Sudeep Pandey
  2. Tuesday, 19 March 2019 14:11 PM UTC
Hello Chris,

Not only FileExists() function even FileLength() function also not working for .NET Web Service project.

I just created one test project with target "application type" and use the same file (WebServices.ini) then it is working fine.

Not sure but I doubt these functions are not applicable for .NET Web Service project.



Can you please give me any other suggestion to get Run time Database Information for .Net Web Service project.



Regards

Sudeep

  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 19 March 2019 16:00 PM UTC
FYI: Make sure that in the "is_Workspace_Path" property that you do *NOT* use a ":" (colon) in that property's path. That would cause the FileExists and FileLength commands to fail.
  1. Helpful
There are no comments made yet.
Sudeep Pandey Accepted Answer Pending Moderation
  1. Friday, 15 March 2019 08:04 AM UTC
  2. PowerBuilder
  3. # 3

Hi Marco,

Thank you for reply.

I don't know about the "Web Forms" but I am asking from Web Services. Third party application is using this service through URL: This is SOAP services.

http://localhost/testWebService03132019/n_testwebservice.asmx?op=GetData.

can you please suggest me any way how can I get value from web.config file?

Comment
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Friday, 15 March 2019 07:25 AM UTC
  2. PowerBuilder
  3. # 4

Hi Sudeep,
I think you have 4 "Web Forms" and not "Web Services".
PB 12.x Web Forms had GetConfigSettings(), but Web Forms are not supported anymore in PB2017.
Best,
.m

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.