cancel
Showing results for 
Search instead for 
Did you mean: 

Rest API BI Platform 4.2 SP06 Publication error

0 Kudos

Hello,

I am trying to create a publication through Rest API method by following the document "Business Intelligence Platform RESTful Web Service Developer Guide".

First I send a get request : http://<host>/biprws/v1/publications/publication and the response is:

<entry>
<content type="application/xml">
<attrs>
<attr name="keywords" type="string" />
<attr name="name" type="string" />
<attr name="description" type="string" />
<attr name="parentid" type="string" />
</attrs>
</content>
</entry>

So I copy it into the body and fill it that way to use it with a Post request:

<entry>
<content type="application/xml">
<attrs>
<attr name="keywords" type="string">test</attr>
<attr name="name" type="string">Test</attr>
<attr name="description" type="string"test></attr>
<attr name="parentid" type="string">1965299</attr>
</attrs>
</content>
 </entry>

But I get this an error 400:

<error><error_code>RWS 000019
</error_code>
<message>Illegal Argument: <entry><content type="application/xml"><attrs><attr name="keywords" type="string"></attr><attr name="name" type="string">Test</attr><attr name="description" type="string"></attr><attr name="parentid" type="string">1965299</attr></attrs></content></entry> (RWS 000019)
</message>
</error>

I tried on several BI platform, with the same result.

Am I missing something?

Regards,

Jean-Guillaume Kramarz

Accepted Solutions (1)

Accepted Solutions (1)

daniel_paulsen
Active Contributor
0 Kudos

The error indicates a problem with interpreting the XML sent in the POST.
Can you try copy the response from the initial GET, paste into Notepad to remove any possible encoding and then copy from notepad to the BODY of your POST to see if that changes anything? The XML in your original post looks fine if the problem with the Description attribute was simply a typo.

You can also get a more detailed error by enabling the Stack Trace on the Web Application Container server (assuming you are using WACS and not Tomcat for your restful service)

A sample test script for creating a publication can be found here: https://wiki.scn.sap.com/wiki/display/BOBJ/RESTful+samples+for+SAP+BusinessObjects+Enterprise+using+...


Dan

0 Kudos

Thanks Dan,

I tried what you wrote without success:

<entry>
<content type="application/xml">
<attrs>
<attr name="keywords" type="string" />
<attr name="name" type="string" >test9</attr>
<attr name="description" type="string" />
<attr name="parentid" type="string" >1965299</attr>
 </attrs>
</content>
</entry

I got this response with Stack trace, but I am not able to interpret it:

<error><error_code>RWS 000019

</error_code>
<message>Illegal Argument: <entry><content type="application/xml"><attrs><attr name="keywords" type="string" /><attr name="name" type="string" >test9</attr><attr name="description" type="string" /><attr name="parentid" type="string" >1965299</attr></attrs></content></entry> (RWS 000019)

</message>
<stack_trace>com.sap.bip.rs.exceptions.CodecException
at com.sap.bip.rs.exceptions.CodecException.illegalArgument(CodecException.java:46)
at com.sap.bip.rs.publication.PublicationCreateResource.PublicationCreateForm(PublicationCreateResource.java:108)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:188)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:104)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:204)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:270)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:270)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:101)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:249)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:249)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:223)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)
at com.sap.bip.rs.server.servlet.BIPServletController.invoke(BIPServletController.java:103)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:289)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:209)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.businessobjects.sdk.actionfilter.WorkflowFilter.doFilter(WorkflowFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:808)

 </stack_trace>

 </error>

Regards,

Jean-Guillaume

0 Kudos

Hi Daniel,

Thanks to the sample you provided, I was able to create a publication!

The working code is :

<entry xmlns="http://www.w3.org/2005/Atom">
	<content type="application/xml">
	<attrs xmlns="http://www.sap.com/rws/bip">
		<attr name="keywords" type="string">Restpub</attr>
		<attr name="name" type="string">New REST Publication 2</attr>
		<attr name="description" type="string">Publication created using REST APIs</attr>
		<attr name="parentid" type="string">1965299</attr>
	</attrs>
	</content>
</entry>

The error came from the missing property

xmlns="http://www.w3.org/2005/Atom"

Regards,

Jean-Guillaume

Answers (3)

Answers (3)

daniel_paulsen
Active Contributor

Hi,

Your Description attribute is incorrect. You have the word "test" inside of the tag and not between the >< tags.

Dan

0 Kudos

My bad!

It's a typo I made when posting my question.

In the error response we can see that the attributes construction seems correct.

Jena-Guillaume

ayman_salem
Active Contributor
0 Kudos

In the body text there is a typo in the line for <attr name = "description"

<attr name="description" type="string"test></attr>

it should be

<attr name="description" type="string">test</attr>