Highlighted
Tumatawhero Absent Member.
Absent Member.
2153 views

Any TRIM Webservice examples?

Jump to solution
I would like to know if there are any code examples to use the TRIM web service please.
0 Likes
1 Solution

Accepted Solutions
Established Member.. Jason Boswell
Established Member..

Re: Any TRIM Webservice examples?

Jump to solution
Here is the documentation and how to reference the web service to make the engine object available.

Damn, the attachment is too large, send me an email to boswell@hp.com and I will send it to you or you can find it with the software downloads in the full ISO image.
12 Replies
Established Member.. Jason Boswell
Established Member..

Re: Any TRIM Webservice examples?

Jump to solution
I do have a number of examples, here is a sample to test a connection. I have others which do searches, create records etc.

private void btnTestConnection_Click(object sender, EventArgs e)
{
// Construct the engine to perform requests on change the URL
// to your URL
txtConsole.Text = "Constructing engine...\r\n";

//TRIMWebService.Engine engine = new TRIMWebService.Engine();
EngineWse engine = new EngineWse();

// Set the login credentials on the engine (change this to
// your username and password)
txtConsole.Text += "Setting credentials ...\r\n";

if (chkCreds.Checked == true)
{
engine.Credentials = System.Net.CredentialCache.DefaultCredentials;
}
else
{
engine.Credentials = new System.Net.NetworkCredential(txtUsername.Text, txtPassword.Text);
}

// Construct a request object
txtConsole.Text += "Constructing TrimRequest \r\n";
TRIMWebService.TrimRequest request = new TRIMWebService.TrimRequest();

splitxmlout(engine.ConvertToXml(request));

// Perform the request (no operations have been added, so
// nothing much will happen, but we should be able to see if
// we can connect to the server)
txtConsole.Text += "Executing TrimRequest...\r\n";
//TRIMWebService.TrimResponse response = engine.Execute(request);
//txtXMLIn.Text = engine.ExecuteXml(engine.ConvertToXml(request));
txtConsole.Text += "Done.\r\n";

// string seperated by colons ';'
splitxmlin(engine.ExecuteXml(engine.ConvertToXml(request)));


// Loop over our response, we should simply get one
// EndResult
//foreach (TRIMWebService.Result result in response.Items)
//{
// textBox1.Text += "Got result:" +
// result.GetType().ToString() + "\r\n";
//
//}

}
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Any TRIM Webservice examples?

Jump to solution
Hi Tumatawhero,

There is a lot of useful information in the standard TRIM documentation. TRIMContextWebService.pdf for your version of TRIM would be the place to start.

Neil

Neil

Note: Any posts I make on this forum are my own personal opinion, and unless stated otherwise do not constitute a formal commitment on behalf of Micro Focus.

(Please state the version of CM you're using in all posts.)

MySupport: https://softwaresupport.softwaregrp.com/
0 Likes
Tumatawhero Absent Member.
Absent Member.

Re: Any TRIM Webservice examples?

Jump to solution
Thanks Jason, but i am using 6R2 and my webservice does not have the Engine method you have mentioned.
0 Likes
Tumatawhero Absent Member.
Absent Member.

Re: Any TRIM Webservice examples?

Jump to solution
Neil I can not find the pdf in my TRIM Context folder on my machine. 😞 Any ideas where I could find this doco, sory for the lame question.
0 Likes
Established Member.. Jason Boswell
Established Member..

Re: Any TRIM Webservice examples?

Jump to solution
Here is the documentation and how to reference the web service to make the engine object available.

Damn, the attachment is too large, send me an email to boswell@hp.com and I will send it to you or you can find it with the software downloads in the full ISO image.
Micro Focus Expert
Micro Focus Expert

Re: Any TRIM Webservice examples?

Jump to solution
Samples can be found on the SSO/HP Passport site at the following link:
http://support.openview.hp.com/selfsolve/document/KM510759

EngineWSE is only available if the WSE is installed on older versions of Visual Studio, as I understand it. WSE offered the additional upload attachment/dime objects. Those are now pretty much outdated as going forward developers use MTOM. There are a number of MTOM samples in the forum as well.
Jack Choy Absent Member.
Absent Member.

Re: Any TRIM Webservice examples?

Jump to solution
So I am able to figure out how to put a document into TRIM via Web Services and do some simple searches, but how does one tie a document to a classification? Neither the web services reference manual nor the web services examples provided in the link above have a classification example.
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Any TRIM Webservice examples?

Jump to solution
This sounds like a new thread, but I'll answer the question 🙂

You'd have to search out the record needing update. You'd then have to create an input property for recClassification. The value would need to match an existing classification. If you know the uri, use that. If you don't, use name injection for the classification's name. The record will need to be set to update with the IsForUpdate set to true, whether you do a Shortcut Record Uri or a Record Search. See example below:

InputProperty recClass = new InputProperty();
recClass.Name = "recClassification";
recClass.Val = "name:Test - Free-for-all";

ShortcutRecordUri sru = new ShortcutRecordUri();
sru.Uri = "3133";
sru.IsForUpdate = true;

Update update = new Update();
update.Items = new InputProperty[] {recClass};

TrimRequest request = new TrimRequest();
request.Items = new Operation[] { sru, update };

executeEngine(request);
0 Likes
Mehul Mehta_1 Absent Member.
Absent Member.

Re: Any TRIM Webservice examples?

Jump to solution

Hi Jason,

Wondering if you can help here?? I have a requirement to set SecurityLevel and SecurityCaveat using TRIM Web Service while creating TRIM Folder. Do you have some kind of example to show me how to do that or some reference doc where i can have a look?

 

Thanks in advance,

 

Regards,

Mehul Mehta

0 Likes
Established Member.. Jason Boswell
Established Member..

Re: Any TRIM Webservice examples?

Jump to solution

There is an input property for security. I think it includes a combined value for security level and caveat. Maybe try to query the value first to find the correct format.

 

Something like this .....

 

InputProperty sec = new InputProperty();
sec.Name = "recsecurity";
sec.Val = txtSecurityLevel.Text + ", " + txtCaveats.Text;

Mehul Mehta_1 Absent Member.
Absent Member.

Re: Any TRIM Webservice examples?

Jump to solution

Thanks heaps Jason, it works now 🙂 after implementing exactly as you mentioned.

 

Thanks Again.

 

Regards,

Mehul Mehta

0 Likes
Super Contributor.. AldoH Super Contributor..
Super Contributor..

Re: Any TRIM Webservice examples?

Jump to solution

I know that I am answering an old post, but I have not got information and examples to create a web service that works with Records Manager.I am a beginner in this topic of web services and the use of sdk and I urgently need to get examples of a web service that allows me to search, create and start workflows. You can help?I've got examples but not from a complete web service or just small code segments.Beforehand thank you very much.

 

Aldo

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.