cancel
Showing results for 
Search instead for 
Did you mean: 

Using Restful api and open document?

vitran23
Active Participant
0 Kudos

is it possible to use the RESTFul api to do a post to a opendocument URL to bypass IE's 2083 character limit?

I'm what my end goal is we have a URL that can be extremely long due to variable selections needed for our crystal report that could exceed IEs 2083 character limit for URLs.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member197386
Active Contributor
0 Kudos

Hello Vi Tran,

As Dan said, OpenDocument and RESTful API are two separate products.

Depending on what is your real final goal, RESTful API might fit.

For instance, it's possible, through Raylight (Webi RESTful webservice, to get a PDF output of a Webi document very simply.

Best regards,

Anthony

Former Member
0 Kudos

Hi Vi Tran,

what I think you can do is "mix" the RestFul API with OpenDocument in the following way :

1 - logon to the API;

2 - set the query parameters of the document (your LOV);

3 - refresh the document ;

4 - save the document

5 - logoff

6 - use OpenDocument, without the parameters to open your document;

Steps 1 to 5 use RestFul API calls.

The tough step would be step 2, finding a way to pass the parameters, depending on how you intend to call OpenDocument

Cheers,

Rogerio

vitran23
Active Participant
0 Kudos

Rogerio, I'm new to the API so I'm not sure what you mean by "Logon to the API."

I've got the URL from CMC > Application > Web Service.

Former Member
0 Kudos

Hi again Vi,

each task you want to perform with the Restful API is an HTTP request you have to do (see SAP BusinessObjects Business Intelligence platform 4.1 – SAP Help Portal Page ) for further information.

These calls are GETs PUTs or POSTs to the URL.

So, to get the logon token (which is the authentication to BO server is :

GET http://localhost:6405/biprws/logon/long, passing your user, password and authentication tyoe (Enterprise, LDAP, ...)

to refresh the document with the parameters see Refreshing Documents in the documentation,

to save the document, take a look at Managing Documents - Updating  the state of a Document, and finally to logoff , use POST http://<baseURL>/logoff.

Cheers,

Rogerio

vitran23
Active Participant
0 Kudos

Rogerio, thanks for the direction.  Looks like something isn't setup correctly in our system since I get a page can not be found error.  Do you know what needs to be turned on?

former_member197386
Active Contributor
0 Kudos

The RESTful service are activated by default. From which technology are you working with?

Regards,

Anthony

vitran23
Active Participant
0 Kudos

I Was just trying to access the link that Rogerio provided using the URL I found in the CMC. It would give me a page not found so I was curious if some thing wasn't active.

http://localhost:6405/biprws/logon/long

Former Member
0 Kudos

HI, the correct URL should be :

http://<server><port>/biprws/logon/long

vitran23
Active Participant
0 Kudos

correct that's the same URL.  Our port is set to 6405.

daniel_paulsen
Active Contributor
0 Kudos

Hi Vi,

the URL you found in the CMC should have the server name, not "Localhost".  Is the Web Application Container Service (WACS) installed on the same machine as the CMC/BILaunchpad or is it on a different web server?

If you are using webi reports, then the information provided by Rogerio and Anthony applies in that you could pass paramenters using the REST APIs, but for Crystal Reports, the rest APIs will only work with a "Crystal Reports For Enterprise" report and not a standard Crystal Report created in the CR designer (crw32.exe).  For that you will need to use opendocument or the .NET/Java SDKs to set the parameters.

to POST to Opendocument, sample code is provided below for the case where the serialized session (serSes) exceeds the URL limit for IE.

<%@ page contentType="text/html; charset=UTF-8" %>

<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr" %>
<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>
<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>
<%@ page import="com.crystaldecisions.sdk.occa.security.ILogonTokenMgr" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="java.net.URLEncoder" %>

<%
String cms = "localhost:6400";
String username = "administrator";
String password = "";
String authentication" = "secEnterprise";

String serSession = "";

IEnterpriseSession enterpriseSession; 
try
{
ISessionMgr sm = CrystalEnterprise.getSessionMgr();
enterpriseSession = sm.logon(username, password, cms, authentication);
serSession = enterpriseSession.getSerializedSession();
  }
catch(SDKException e)
{
     out.println("An error has occured: " + e.getMessage());
}
%>

<HTML>
<HEAD>
<TITLE>

</TITLE>
</HEAD>
<BODY>
<form method="post" id="applyForm" name="applyForm" action="http://localhost:8080/BOE/OpenDocument/opendoc/openDocument.jsp">
 
<input type="text" name="iDocID" value="AXpyoryP_Z5BoXVoM2_3kWQ" />

<input type="text" name="sIDType" value="CUID" />
<input type="text" name="serSes" value='<%= serSession%>' />
   
<input type="submit" value="Get" /> 
</form>

</br>
</br>
serSession.length     <%= serSession.length()%>
</br>
</br>

<script>

     function apply(){

     var aa=document.getElementById("applyForm");
     document.getElementById("applyForm").submit();
    }
apply();
</script>

    </BODY>
</HTML>

I hope this helps,

Dan

vitran23
Active Participant
0 Kudos

Daniel, thanks for the information.  Correct it doesn't state localhost, but for privacy purposed I just reposted it as "localhost".  I believe the issue is that the "WACS" is not activated but is installed.  I'll have to work with our BOE person to see if we can activate this on our test system.

Thanks for the code snippet.  Is it possible to do this with straight HTML5 / UI5 and not via .net?

former_member197386
Active Contributor
0 Kudos

Hi Vi,

Maybe you should check too with your administrator that the HTTP port 6405 is opened (if you're behind a corporate firewall).

Or maybe your BOE administrator changed the default port...

Regards,

Anthony

vitran23
Active Participant
0 Kudos

Yeah, I'll need to check on that also but 6405 is what's set in the CMC for RESTful Web Service URL.

If I visit the following URL in the web browser: http://localhost:6405/biprws/logon/long what comes up?  Just wanted to know so I can show my BOE admin what's supposed to appear.

former_member197386
Active Contributor
0 Kudos

You should see something like:


<attrs xmlns="http://www.sap.com/rws/bip">

<attr name="userName" type="string"/>

<attr name="password" type="string"/>

<attr name="auth" type="string" possibilities="secEnterprise,secLDAP,secWinAD,secSAPR3">secEnterprise</attr>

</attrs>

Regards,

Anthony

vitran23
Active Participant
0 Kudos

Thanks, the page should display that xml data.

former_member197386
Active Contributor
0 Kudos

Hi Vi,

Do you need additional help? Can you login into RESTful webservices now?

Best regards,

Anthony

vitran23
Active Participant
0 Kudos

Thanks for checking up.  Haven't had time to dedicated to it here lately.

daniel_paulsen
Active Contributor
0 Kudos

There's no restful call,  but you can do an HTTP POST to Opendocument.

Have a look at the following knowledgebase article for an example,

https://i7p.wdf.sap.corp/sap/support/notes/1842106

Dan

vitran23
Active Participant
0 Kudos

Daniel that link doesn't work.