Re: TRIM SDK & Java (836 Views)
Reply
Occasional Advisor
muhammadmahdi
Posts: 11
Registered: ‎04-27-2010
Message 1 of 7 (1,476 Views)
Accepted Solution

TRIM SDK & Java

Hello,

 

Recently me and my team trying develop custom application interface using .NET TRIMSDK (C# ASP.NET) and succeed, but the problem just occur when our IT Division manager ask if we can develop using JAVA (J2SE 1.4 compliant - JSP support), here is my question :

 

1. Does TRIMSDK (COM) support JAVA ?, if yes how to add the reference from trimsdk.dll, cause what i know JAVA cannot load COM DLL (trimsdk.dll) directly, means you must wrap the COM first (using JNI or bridge2java maybe ?) CMIW.

 

2. I know TRIM has webservice (trimws) but when i try to add webservice reference from JAVA it says not valid WSDL ? any solution ?

 

The point is how to develop custom application using TRIM SDK on JAVA, thank you.

 

PS: Pardon my english and knowledge, I'm not too familiar with JAVA programming, just know a little bit. :smileytongue:

Advisor
christopher crispin_2
Posts: 22
Registered: ‎11-17-2009
Message 2 of 7 (1,476 Views)

Re: TRIM SDK & Java

Hi,

       TRIM can work with Java, but you've got a few difficulties to overcome first. TRIM offers a COM based API, a .NET based API and a WebService. Most Java developers use the WebService.

 

The WebService

You can get this to work, plenty of sites around the world use the TRIM webService with Java.

It doesn't work with all Java IDE's, does work with Eclipse. One reason is inconsistent definitions:- As an example - some IDE's define a long as a 32bit integer where TRIM's WSDL expects long to be 64bit. TRIM WebServices' WSDL is Microsoft centric and isn't usually acceptable to Java. The WSDL may need to be reordered for Java. I think Java expects it to be in alphabetic order. You need to see why Java thinks the WSDL is invalid and fix it, If you persist you can get it to work. The WebService is not very fast (SOAP based) and not all of the feature's of TRIM are available. You may also have some trouble with passing credentials. Some people have no problem here, some do. The WebService uses IIS to handle security and communications. Googling 'IIS and Java' will give you more than you can read.

 

The COM API.

It's great, you can do heaps and it's straight forward. From Java you have to use a COM bridge (as with any COM based software). I don't know anyone who uses this but it should work OK. JNI or bridge2java should do what you need.

 

The .NET API (only in TRIM 7)

I haven't ever thought about this. But now I am I think 'no'. There may be some Java .NET bridges out there but they would have to be pretty awful. There would be some weird interactions, I can't even think about how it would work.

 

All the best with the project, look at it as a challenge, it might even be fun!        

Occasional Advisor
muhammadmahdi
Posts: 11
Registered: ‎04-27-2010
Message 3 of 7 (1,476 Views)

Re: TRIM SDK & Java

Hello,

 

Thank you for the answer, yup you right, i try using Netbeans 6.5 and TRIM webservices but fail (invalid WSDL it says), and then i try using the SDK, here i try using bridge2java (OLEJA - product of JAVAinTM), when generate the classes it gives me error but when i checked in the destination folder its there (a lot of files with .java extension) and the build.xml but the Netbeans won't recognize the classes, i'm not familiar with JNI so i must look for tutorial first. BTW i'm using TRIM 7 Server 64-bit and TRIM 7 client 32-bit.

 

I will try using Eclipse as you suggest, i will let you know the result ASAP, can you recommend me better COM bridges ? it will be helpful.

 

Thank you.

Advisor
christopher crispin_2
Posts: 22
Registered: ‎11-17-2009
Message 4 of 7 (1,476 Views)

Re: TRIM SDK & Java

Hi,

          I think every IDE will give you the invalid WSDL error, you will need to manually edit it to fix the errors. I've got no experience with COM bridges. I guessed they would be easy to use, maybe I'm wrong there. If you Google JNI or "COM Java bridge" you will find plenty of discussion and ideas.

 

Regards

Occasional Advisor
muhammadmahdi
Posts: 11
Registered: ‎04-27-2010
Message 5 of 7 (1,476 Views)

Re: TRIM SDK & Java

Hello,

 

yup you're right again, it still gives me the same error, i guess there's no other way but to fix the TRIM webservice if i want to use it, meanwhile i'll focus to COM java bridge for the start, thanks for the answer, you help me alot.

Occasional Visitor
Mark_W
Posts: 1
Registered: ‎12-06-2010
Message 6 of 7 (1,476 Views)

Re: TRIM SDK & Java

Hi

 

Just thought i'd add maybe another idea...

 

Grab Visual Studio, add a reference to the TRIM Com or .NET api and create a new web service of your own to meet the needs of your situation.

 

Writing web services in Visual Studio is pretty much child's play these days and you can tailor the web service interface to be Java friendly and expose the methods you need in a far more concise manner.

 

I've done it many times now when working with Java consumer apps and had no issues so far.

 

Mark

Occasional Visitor
Taxman2020
Posts: 1
Registered: ‎07-31-2013
Message 7 of 7 (836 Views)

Re: TRIM SDK & Java

Does HP have any plans to make the Trim web service schema valid? One of the key points of XML schema is the interoperability that comes from standard data types. Given the XML Schema datatype for long is a 32 bit integer (http://www.w3.org/TR/xmlschema-2/#long), surely it can be made XML schema compliant with only a little effort?

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.