Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]RESTful Web Services

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]RESTful Web Services
 Login/Join
 
Member
posted
We just got licensed for this and I'm trying to figure out how to create a small Visual Basic program that can be run from the Windows command line to run a report by passing the path/filename of the .FEX. Has anyone done this? I found the example in the documentation but that doesn't really tell me how to create the actual .NET executable. I've got Visual Studio installed, but I'm no programmer.

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8
Windows, All Outputs
 
Posts: 5 | Registered: August 20, 2015Report This Post
Virtuoso
posted Hide Post
I suggest you baby step this one. Forget about WF Services, focus on building your VB knowledge first. You need to figure out how to consume a URL using VB, including HTTP request headers. Then you will have to figure out how to process the response - including the HTTP response headers.

Once you figured that out, then you can apply that knowledge to WF ReST Services.

This forum isn't the most appropriate for VB questions, but you can get lots of help with the WF Services that you would then need to consume.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Master
posted Hide Post
File --> New --> Project

Visual Basic --> Windows --> Console Application

Module Module1

    Sub Main()
        For Each argument As String In My.Application.CommandLineArgs
            Process.Start(argument)
            Exit For
        Next
    End Sub

End Module

Build --> Build Solution

Your executable will be in one of two places, depending on whether you have selected "Debug" or "Release" mode:

C:\Visual Studio 20XX\Projects\ConsoleApplicationX\ConsoleApplicationX\bin\Debug\ConsoleApplicationX.exe

or

C:\Visual Studio 20XX\Projects\ConsoleApplicationX\ConsoleApplicationX\bin\Release\ConsoleApplicationX.exe

Then from a Windows command line in that directory:

ConsoleApplicationX.exe http://www.google.com


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Master
posted Hide Post
You will need to put the FEX under the Reporting Server area to avoid signing in to the WebFOCUS system.

Here is a real life hyperlink that runs a FEX I created. I pass two dates and a report title to the FEX:

http://webfocusdev/ibi_apps/WF...2016&WF_TITLE=Report

(Point your mouse at it to see the entire hyperlink, or click on it to see the hyperlink in your browser.)


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Master
posted Hide Post
I forgot to mention that you will need to put double quotes around the hyperlink if you are passing parameters to the FEX:

ConsoleApplicationX.exe "http://webfocusdev/ibi_apps/WFServlet?IBIF_ex=cherwell/first_call_resolution/first_call_resolution_graph.fex&startDate=07142016&endDate=07142016&WF_TITLE=Report"

(The command line doesn't process the ampersands very well in this situation.)


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Member
posted Hide Post
Thanks Squatch. That seems to be what I'm looking for. I'd like to see your actual VB code though. Mine seems to run the report just fine since I can see the agent start in the Reporting Console workspace, but I get an exception thrown on the very last line of code where the browser is supposed to open.

Here is my code:

Imports System.IO
Imports System.Net
Imports System.Text

Module Module1
Private cookies As CookieContainer
Private postData As String
Public WebBrowser As New Object
Public Property DocumentText As String

Sub Main()
Dim request2 As HttpWebRequest
Dim response2 As HttpWebResponse
Dim webStream2 As Stream
Dim webResponse2 As String = ""
request2 = WebRequest.Create("https://webfocus.simplot.com/ibi_apps/rs/ibfs/WFC/Repository/food_group/Customer_Service/Open_Orders.fex")
request2.UseDefaultCredentials = True
request2.PreAuthenticate = True
request2.Credentials = CredentialCache.DefaultCredentials
request2.Method = "POST"
'cookies is defined as CookieContainer in the Signing-On to WebFOCUS example
request2.CookieContainer = cookies
postData = "IBIRS_action=run"
Dim byteArray2 As Byte() = Encoding.UTF8.GetBytes(postData)
request2.ContentType = "application/x-www-form-urlencoded"
request2.ContentLength = byteArray2.Length
Dim dataStream2 As Stream = request2.GetRequestStream()
dataStream2.Write(byteArray2, 0, byteArray2.Length)
dataStream2.Close()
response2 = request2.GetResponse()
webStream2 = response2.GetResponseStream()
Dim webStreamReader2 As New StreamReader(webStream2)
While webStreamReader2.Peek >= 0
webResponse2 = webStreamReader2.ReadToEnd()
End While
WebBrowser.DocumentText = webResponse2
End Sub

End Module


WebFOCUS 8
Windows, All Outputs
 
Posts: 5 | Registered: August 20, 2015Report This Post
Master
posted Hide Post
quote:
Originally posted by Brian Garland:
I'd like to see your actual VB code though.

There isn't any more code. What I posted is all there is. It isn't RESTful, but it meets the requirements you laid out:

1. It's code in Visual Basic created from Visual Studio.
2. It runs from the Windows command line.
3. It accepts a path/filename of a FEX to run a report.

I tested it today and it ran the FEX file I wrote about earlier. It opens a browser and displays a chart.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]RESTful Web Services

Copyright © 1996-2020 Information Builders