Current location: Hot Scripts Forums » Programming Languages » Other Languages » Visual DataFlex: using Web Service


Visual DataFlex: using Web Service

Reply
  #1 (permalink)  
Old 12-03-09, 05:54 AM
x_globus x_globus is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Visual DataFlex: using Web Service

I have the web service and generated class for it. I can use this generated class in windows application as it described in Help. The question is: how can I use this generated class in the web project? (the analogous actions - creating object and use its functions -, as it was in windows app, are not worked)

Last edited by x_globus; 12-03-09 at 06:03 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 12-03-09, 07:26 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
Please post your code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 12-04-09, 07:00 AM
x_globus x_globus is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Code of Web Service object:

Code:
Use cWebService.pkg

Object oTest is a cWebService
    
    // psDocumentation provides high level documentation of your web service. 
    // Clients using this service will see and use this documentation. 
    Set psDocumentation to ;
        ("Visual DataFlex Web Service .... " +;
          " ... " +  ;
          "documentation")
    
    { Published = True  }
    { Description = ""  }
    Function Message String sText Returns String    
        String sMessage    
        Move ("Message: " * sText) to sMessage    
        Function_Return sMessage   
    End_Function
    
    
End_Object
Generated class:
Code:
// cWStempService.pkg
// Class:   cWStempService
// Created: 12/1/2009 2:54:17.767 PM
// 

Use cClientWebService.pkg

// 
// Class:   cWStempService
// 
// Interface:
// 
// Function wsMessage string llsText Returns string
// 
// 

Class cWStempService is a cClientWebService

    Procedure Construct_object
        Forward send Construct_object
        Set psServiceLocation     to 'http://localhost/WebServiceTest/tempService.wso'
        Set psWSDLLocation        to 'http://localhost/WebServiceTest/tempService.wso?WSDL'
    End_Procedure // Construct_object

    // 
    // Function wsMessage
    // 
    // 
    Function wsMessage string llsText Returns string
        string llMessageResult
        tSoapParameter[] spParameters
        tSoapParameter[] spReturnParameters
        integer eStatus

        Send Reset
        Set psSOAPAction           to ""
        Set peSoapStyle            to ssDocument

        Set psRequestNSURI         to "http://tempuri.org/"
        Set peSoapEncoding         to seLiteral
        Set psMethodRequest        to "Message"
        Set pbRequestBare          to false

        Set psResponseNSURI        to "http://tempuri.org/"
        Set peResponseSoapEncoding to seLiteral
        Set psMethodResponse       to "MessageResponse"
        Set pbResponseBare         to false

        // Parameter 0
        Get DefineParameter xsString 1 1 "sText" "http://tempuri.org/" to spParameters[0].SoapParamDef 
        ValueTreeSerializeParameter llsText to spParameters[0].ValueTree

        Set pspParameters to spParameters

        // Return Parameter
        Get DefineParameter xsString 1 1 "MessageResult" "http://tempuri.org/" to spReturnParameters[0].SoapParamDef
        Set pspReturnParameters to spReturnParameters

        Get DoInvokeService to eStatus
        If (eStatus=wssOK) Begin
            Get pspReturnParameters   to spReturnParameters
            ValueTreeDeserializeParameter spReturnParameters[0].ValueTree to llMessageResult
        end
        Else Begin
            Send LastError
        end

        Function_return llMessageResult
    End_Function // wsMessage

End_Class // cWStempService
Code of web browser object:
Code:
Use cWebBusinessProcess.pkg
Use cWStempService

Object oWebClient is a cWebBusinessProcess
    { Published = True  }
    { Description = ""  }
    Function SayHello String sName Returns String
        String sReply
        Move ("Hello" * sName) to sReply
        Function_Return sReply
    End_Function
    
    { Published = True  }
    { Description = ""  }
    Function GetMsg String sText Returns String
        String sMsg
        Get wsMessage of oWStempService2 sText to sMsg
        Function_Return sMsg        
    End_Function

End_Object




Object oWStempService2 is a cWStempService

    //
    // Interface:
    //
    // Function wsMessage string llsText Returns string
    //


    // phoSoapClientHelper
    //     Setting this property will pop up a view that provides information
    //     about the Soap (xml) data transfer. This can be useful in debugging.
    //     If you use this you must make sure you USE the test view at the top
    //     of your program/view by adding:   Use WebClientHelper.vw // oClientWSHelper
    //Set phoSoapClientHelper to oClientWSHelper

End_Object
the way I tried to call method of wbo object, which (I suppose) can return result of web call:
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="VDF Studio">
<title>Web Server Application Content</title>
</head>
<body bgcolor="#FFFFFF">       
<%=oWebClient.call("get_GetMsg", "test")%>
</body>
</html>
Error message:
Soap Fault error Server Responded with a Soap Fault Error
Fault Code: soap:Server
Fault String: Error during Web Application Server session initialization, please try again later. The application is currently running in the debugger using another session Please check the Windows event log for further information about the problem.

MSG_ERROR_REPORT (433) - OWEBAPPERROR (4) - at address 4510
MSG_LASTERROR (5551) - OWSTEMPSERVICE2 (34) - at address 14305
GET_WSMESSAGE (5683) - OWSTEMPSERVICE2 (34) - at address 14753
GET_GETMSG (5685) - OWEBCLIENT (31) - at address 14770
GET_DOCALL (1284) - OCALLINTERFACE (32) - in native code
GET_DOCALL (1284) - OWEBCLIENT (31) - at address 8637
MSG_ONDFFUNC (4880) - OVDFINETSESSION (21) - at address 7213
MSG_STARTWEBAPP (5240) - OWEBAPP (19) - at address 11395
[start] - at address 14778

I also tried to make call as:
Code:
<%=oWStempService2.call("get_wsMessage", "test")%>
where oWStempService2 is declared in WebClient.wo - but in this case, page even is not displayed.

The only way it works for me when I have:
Code:
<form action="/WebServiceTest/tempService.wso/Message">
But it returns xml, and I wish to get a value using generated class. So, I need client web service in the web application. In the VDF documentation I found client web service example only for windows application
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 12-04-09, 07:12 AM
x_globus x_globus is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Is it possible that client web service exists only for windows application?

Last edited by x_globus; 12-04-09 at 07:17 AM. Reason: correcting post
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 12-05-09, 06:54 PM
DennisPic DennisPic is offline
New Member
 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Hi,

if you take a closer look at the error message:

Quote:
Originally Posted by x_globus View Post
Error message:
Soap Fault error Server Responded with a Soap Fault Error
Fault Code: soap:Server
Fault String: Error during Web Application Server session initialization, please try again later. The application is currently running in the debugger using another session Please check the Windows event log for further information about the problem.

MSG_ERROR_REPORT (433) - OWEBAPPERROR (4) - at address 4510
MSG_LASTERROR (5551) - OWSTEMPSERVICE2 (34) - at address 14305
GET_WSMESSAGE (5683) - OWSTEMPSERVICE2 (34) - at address 14753
GET_GETMSG (5685) - OWEBCLIENT (31) - at address 14770
GET_DOCALL (1284) - OCALLINTERFACE (32) - in native code
GET_DOCALL (1284) - OWEBCLIENT (31) - at address 8637
MSG_ONDFFUNC (4880) - OVDFINETSESSION (21) - at address 7213
MSG_STARTWEBAPP (5240) - OWEBAPP (19) - at address 11395
[start] - at address 14778
you will see that it tells you what is happening. You are running this through the debugger and it cannot debug both processes (which are actually the same process) in the same web application at once. Normally, the web service you are calling and the program that calls it would be 2 separate applications, thus eliminating this problem.

If you run this application (by opening your web page) outside the debugger, it should just work. I tried this here using your code and it works just fine.

You may want to consider posting questions about Visual DataFlex in the Data Access Worldwide (the makers of VDF) forums: Data Access Worldwide Forums

Dennis Piccioni
Data Access Worldwide
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
The Following User Says Thank You to DennisPic For This Useful Post:
x_globus (12-07-09)
  #6 (permalink)  
Old 12-08-09, 03:34 AM
x_globus x_globus is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Thanks a lot - it works.
But I have a question. In visual data flex studio studio when press f5 in case of web app - what does it run? (I mean if we already can work with the app on localhost) Is it run debbuger?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks

Tags
dataflex


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outsourcing web design to Bulgaria - Marin Todorov gal_flower Job Offers & Assistance 4 02-14-06 09:05 PM
Using Web Service without Visual Studio mahdigreen ASP.NET 0 01-11-06 01:04 PM


All times are GMT -5. The time now is 01:28 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.