Java application getting projects and their associations from MS Project Server 2013 - rest

I want to use the REST api of a locally installed MS Project Server 2013 in order to get all projects and their associations(tasks, deliverables and resources) so that I will bind them with the business model of my custom J2ee application. So, I have 2 questions:
According to what I've read so far in MS Project Server documentation, I can use either ProjectData service or ProjectServer resource. What is considered more appropriate for my case?
Can anyone give me a simple example of getting projects and their associations using a Jersey client? Would something like the below be correct using the ProjectData service?
String url = "http://<pwa_site>/_api/ProjectData/$metadata";
Client client = Client.create();
WebResource webResource = client.resource(url);
ClientResponse response=webResource.accept("application/xml")
.get(ClientResponse.class);
String output = response.getEntity(String.class);
Any help would be appreciated.

ProjectData provides OData read-only access to the 38 entities for reporting. ProjectServer provides the main functionality of the Project Server Interface (PSI) for the primary entities.
For OData service, I use Apache Olingo library:
https://olingo.apache.org/doc/odata2/index.html

Related

Marklogic : JAVA API - Dynamic Database and REST Server

I am trying to see whether MarkLogic Java API can be used to create a content database and REST Server?
I went through te Java API but I dont see any reference.
Is it possible to create a REST Server through MarkLogic Java API?
I appreciate any links or pointers regarding this.
No, that's beyond the scope of the Java Client API. The Java Client API must connect to a REST Server after it's already created. You can, however, use the /rest-apis service on port 8002 via your favorite generic REST client API for Java. To see an example of how to do this with Apache HttpClient, see Bootstrapper.java. You can use it directly like the unit tests setup util TestServerBootstrapper.java does with this code:
Bootstrapper.main(new String[] {
"-configuser", username,
"-configpassword", password,
"-confighost", host,
"-restserver", "java-unittest",
"-restport", ""+port,
"-restdb", "java-unittest"});

Agile Classes.jar file

I am using Agile PLM Version: 9.3.0.2 (Build 20). I am on the client side. I'm trying to use Eclipse to interact with Agile's API features. According to the Agile SDK Developer Guide I need both:
AgileAPI.jar
agileclasses.jar
I have the AgileAPI.jar file, but I don't have the agileclasses.jar file.
Any suggestions/links/ methods in which I can obtain this file!
AgileAPI.jar, contains the factories and interfaces used by the Agile EJB on server side.
If you have an Agile instance on a server, you don't need to have agileclasses.jar (unofficial API) but creating an IAgileSession using AgileSessionFactory, all the implementation of interfaces (IChange, IPrograms, IItem. etc) are retrieved using it.
session.getObject(IChange.OBJECT_TYPE, "ChangeNumber123");
where did you find that agileclasses.jar is required?
However, you can find them in the Weblogic Server shared lib folder.
EDIT
Eclipse interacts with an Agile Server using AgileAPI.jar.
String server = "http://myServer:7001/Agile";
HashMap<Integer,String> params = new HashMap<Integer, String>();
AgileSessionFactory instance = AgileSessionFactory.getInstance(server);
params.put(AgileSessionFactory.USERNAME, "myUsername");
params.put(AgileSessionFactory.PASSWORD, "myPassword");
IAgileSession session=instance.createSession(params);
IItem item = (IItem) session.getObject(IItem.OBJECT_TYPE, "ITEMID1234");
item.setValue("Page Two.MYFIELD", "Value");
The example above, connect to an instance of Agile (server) already started up and get the item with number ITEMID1234. Then it sets the value of a field (MYFIELD) with "Value"

XDS.b testing with SoapUI

I have to implement a simple client to a XDS.b server (SubmitObjectRequest and RetrieveDocumentSetRequest operations), but I'm struggling to get even a simple example of use to work.
I've tried using Mirth Connect's Channel for XDS.b also, but with no use. I even tried to copy its SOAP envelope to use with SoapUI. Didn't work.
I'm using HIEOS deployed on Glassfish as my XDS.b server.
I'm lost and confused. Could anyone give me a guidance on how to make this work?
If the HIEOS is deployed correctly within the Glassfish the service endpoint provides a wsdl definition where the interface is specified. Check the Glassfish for the wsdl of the service.
http://localhost:8080/my-ws/simple?WSDL
Quelle: docs.oracle.com/cd/E18930_01/html/821-2418/gbiyw.html
The list of provided endpoints you can see here:
https://kenai.com/projects/hieos/pages/WebServices
So to retrieve the wsdl you should use for example:
http://localhost:8080/axis2/services/xdsrepositoryb?wsdl
which applies for the ProvideAndRegisterDocumentSet-b transaction of the XDS Repository actor.
You can use the WSDL definition to create a WS request using SOAP UI at first.
SOAP UI creates a request based upon the wsdl definition which can be used to
test a against your XDS repo.
When you know how a SOAP request must be constructed you can try it using Mirth or
create your own client using Apache CXF http://cxf.apache.org/ for example.
Or you use AXIS2 to create a client from the WSDL. Of course does Visual Studio and C# also offer mechanisms to create a WS client directly from a WSDL definition.

Can ASP.NET Web API methods be called from a Windows CE app / CF 3.5?

We were thinking about doing something like WCF / REST - I think the techn[ique,ology] was called ADO.NET Data Services in VS 2008 / .NET 3.5 - anyway, something like a RESTful receiving and transmitting of data from a CF 3.5 app and a desktop .NET 4 app to simplify the client / Windows CE app so that it simply sends and receives XML or JSON data, rather than connecting to a remote database or so.
However, according to Where to start REST web service in C# or ASP.Net:
"REST in WCF no longer supported - now it points to ASP"
From the same link:
"ASP.NET Web API is now the Microsoft framework for creating RESTful services.
http://www.asp.net/web-api"
Okay, I think we can do that (WebAPI) - the plan is to host the server/service in IIS; however: Can ASP.NET Web API methods be called from CF 3.5? Does anybody have examples of such?
As long as CF 3.5 can make http requests, then you should be able to make rest calls. Look for HttpWebRequest in CF.
http://msdn.microsoft.com/en-us/library/aa446517.aspx
Look at Microsoft's article Calling WCF Services.
To create your service, you are going to need to Power Toys for .NET Compact Framework 3.5, then turn around after installing that to Download the New NetCFSvcUtil (that is a direct download).
I've created Batch files that I store in my Services folder of my Windows Mobile Project (that way, I can't lose them). The batch file is like this:
** create.bat **
NetCFSvcUtil.exe /l:cs /o:Employee.cs /cb:ServiceModelBase http://cpweb2/mainframe/AcpEmployee.svc?wsdl
pause
NetCFSvcUtil.exe /l:cs /o:Packout.cs /cb:ServiceModelBase http://cpweb2/mainframe/AcpPackout.svc?wsdl
pause
That creates 2 Proxy files for me: One for Employees and one for my Packout service. They both create the same base file, ServiceModelBase, which is just a way for services to throw exceptions.
Adding the pause between steps enables you to read any error messages that are thrown up on the screen before running the next command.

WSO2 Data Services Server - Adding a new Database support

How do I add new Database support (MongoDB) in 2.6.3 version of WSO2 Data Service Server.
You can use DSS (2.6.3) with any database type if the database connectivity is exposed via JDBC. In other words, if your preferred database type exposes a JDBC driver/adapter for the users to connect to it via JDBC then you can use DSS to expose your data stored in your data store as a web service. Similarly, if MongoDB too has a JDBC adapter you wouldn't have any (or too many :) ) issues integrating that with DSS. However, there are some exceptions when it comes to exposing flat files such as google spreadsheeets, excel sheets, csv files as DSS uses the relevant client APIs such as Google gdate client API, Apache POI, etc to connect to those datasources and extract data. However, if we consider the general case is you need to have an adapter or a similar mechanism to connect to your datasource via JDBC.
But in the upcoming version of DSS (v3.0.0), it is planned to introduce custom datasource support so you can easily write an adapter to any datasource and use it with DSS.
Regards,
Prabath
I am not sure about this, but I suppose that if is not supported by default you can always download the jar library for MongoDB and put it in CARBON_HOME\repository\components\lib and restart. For example for mysql I have the mysql-connector-java-5.1.7-bin.jar in that folder.
Hope this help