cancel
Showing results for 
Search instead for 
Did you mean: 

Building WS

former_member203861
Participant
0 Kudos

Hi all ,

I need to create a WS which connects to database ( Sql Anywhere 11 / MsSql 2005/2008 )

The connections is via ODBC and all parameters for connection in an INI file on the machine's hard disk .

I have build a WS with 3 functions ,two of them  are connect and disconnect ,and 1 is for retrieve data and returns it .

For  Retrieve Function :  I put uf_connect() at start , and uf_disconnect() at the end.

uf_connect() returns -99 if connection has been failed .

I deployed it to my local machine's IIS ( Running on WS 2008 with IIS 7 )

Questions :

1. Is that wright ? that's how connect / disconnect should be when building WS ?

2. Trying the WS,  I always get error code = -99 meaning connect to the data base failed , Why is that ?

3. The ini file with the connections parameters placed in directory under c: drive . How should I refer to it in the WS code ?

    as : c:\directory name \ *.ini ?

4. Can I use MessageBox() in code or messagebox would not show all ?

working with Pb classic 12.5 build 4015

Thanks

Moshe

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Moshe;

1) I have a Web Service framework for PB Classic that contains lots of features to extend your WebService's functionality plus make WS development exponentially easier.

2) I also have a some WS examples built from the framework & PB Classic as well. You can download them by clicking here.

3) I also have a Web Service presentation that walks you through PB Classic WebService's from both the client & server perspective. Send me an email if you would like a copy ... cpollach.at.travel-net.dot.com (edit accordingly)

Regards ... Chris

former_member203861
Participant
0 Kudos

Hi Chris

If I run the WS and the ODBC is configured as client it works fine ( the database is running under the same machine with Sybase Sql server instance )

As stand alone is does not work

Did not understand why

Former Member
0 Kudos

What do you mean by "As stand alone is does not work"?

What errors are you getting & where?

former_member203861
Participant
0 Kudos

Hi Chris

I meant if WS needs to "start" Database as a stand alone engine Vs a client ( data base running under ASA instance )

I need some help here :

Step 1 :

     I have deployed my WS to the  local IIS , 

     checking it ( click the invoke button in the IE ) ,

      it works fine.

Step 2 :

Now , I need the customer's machine to be the server to this WS .

1. I need to deploy it as MSI file , right ?

    runs MSI on customer's machine as admin ?

2. The customer's machine is the server now ( after 1 ).

    A third party needs the WSDL file from me ( since I am the ws vendor ) ,

    I should give him the file in the customers machine , right ?

    ( the msi file creates all needed files under customer's machine's IIS , right ? )

Thanks a lot ,

Moshe

Former Member
0 Kudos

Hi Moshe;

1) Yes, create an install MSI from your PB IDE's Project.

    Note: Make sure that you direct the MSI installer to install your WS

            under the c:inetpub/wwwroot folder.

2) After installing the WS from Step #1, you should see the WSDL file.

    -  For example your MSI created c:inetpub/wwwroot/moshe

    -  Under the Moshe folder, you should see file "TestWebService.htm" - double-click it

    -  Click on the WS name

    -  In the next screen, click on service description link.

    -  This should give you the WSDL link ...

          (ie: http://localhost/moshe/nc_my_webservice.asmx?WSDL )

HTH

Regards ... Chris

Former Member
0 Kudos

1.  That should be OK.  Once you start experiencing some load on your service, you may want to explore pooled components/connections. 

2.  Why is your connection failing?  That's for you to discover...  I'm guessing you don't have the ODBC connectionstring parameters correct.

3.  Don't put anything your service/app needs outside the folder that is the webroot.  Your service will not have the authority to read from the C:/ drive.  All references to files in the file system should be relative to the webroot.  In other words, /myfiles/connection.ini will map to C:\inetpub\wwwroot\[your service name]\myfiles\connection.ini

4.  Do not ever use visual feedback in a non-visual app.  No messageboxes inside services.  Write to a log file...