× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have been asked to see if I can call a web service provided by our Document Management vendor. They have provided me with a simple C# sample, that I've been looking at to see if I can create something similar in RPG. I think I need to use SOAP(examples 16/17 in Scott's HTTPLIB) but I'm not sure. I don't see any reference to SOAP in the C# program, but if I look at the operations available in the WebService the always show a Soap 1.1 and Soap 1.2 request/response.

The idea is to search for a document and download it to a specific folder
I'm including a snippet of the C# code below.

Am I on the right path in looking at examples 16/17? Is there a better alternative?


Thanks Mike



using System;
using System.Collections.Generic;
using System.Text;
using FNSearchAndDownload.FNWebService7_10;

namespace FNSearchAndDownload
{
class FN7_10 : FNBase
{

/// <summary>
/// Example function, which connects to FileNexus does a search and downloads the first document found.
/// </summary>
public override string Execute(string aAddress, string aAccessPassword, string aUserName, string aPassword, int aFolderID, int aIndexID, string aIndexValue)
{
string lResult = string.Empty;
//Create the webservice object and set the address to the specified address.
FileNexusWebService7_10 lFNWebService = new FileNexusWebService7_10();
lFNWebService.Url = aAddress;
int lConnectionHandle = 0;
try
{
//Connect to the webservice, this doesn't authenticate us against the FileNexus database
//it just establishes communication channel for us to talk to FileNexus.
lConnectionHandle = lFNWebService.Connect("WEB:" + aAccessPassword, System.Environment.MachineName);
//Connect the specified user to FileNexus. If the connection was successful then proceed,
//otherwise display the error to the user.
string lError;
bool lConnected = ConnectUser(lFNWebService, lConnectionHandle, aUserName, aPassword, out lError);
if (lConnected == true)
{
//Conduct the search and download the first document found.
bool lDownloaded = SimpleSearchAndDownloadDocument(lFNWebService, lConnectionHandle, aFolderID, aIndexID, aIndexValue, out lError);
if (lDownloaded == true)
{
lResult = "Document saved to temporary folder: " + System.IO.Path.GetTempPath();
}
else
{
lResult = lError;
}
}
else
{
lResult = lError;
}
}
catch (Exception lException)
{
//Catch any unhandled exception and display the error to the user.
lResult = "Error: " + lException.Message;
}
finally
{
//Disconnect from FileNexus regardless of the success of the above operations.
Disconnect(ref lFNWebService, lConnectionHandle, ref lResult);
}
return lResult;
}
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.