Topic
  • 2 replies
  • Latest Post - ‏2008-07-25T12:37:51Z by SystemAdmin
SystemAdmin
SystemAdmin
9029 Posts

Pinned topic REST Call Builder with Process Server Integration (JSON)

‏2008-07-25T06:30:40Z |
Hi,

I need to ask for some data to the Process Server and I found that it publish some REST APIs ( http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r1mx/index.jsp?topic=/com.ibm.websphere.bpc.612.doc/doc/bpc/rbpc_restapis_overview.html ). So, I'm trying to consume that but I have some errors (see the bottom of this message).

I'm using WebSphere Dashboard Framework (as if it's WebSphere Portlet Factory because I'm using the basic features) 6.1.0 and the WebSphere Integration Developer 6.1.2 (with the integrated test environments : WebSphere Application Server 6.1.0.17, WebSphere Process Server 6.1.2.0 and WebSphere Business Monitor 6.1.2.0). I attached to this message (in the files.zip) the WID project interchange (simplepi2.zip) and the WebSphere Portlet Factory Archive (wdf_rest.zip). I think it doesn't work because the REST API's in process specification gives me JSON and the builder is waiting for XML.. so, how can I receive JSON or convert that to XML in a previous stage??.

Thanks a lot for your time guys.

Edwin Anaya.<hr />
ERROR # 1 :

java.io.IOException - Error parsing XML. No parent node for text: {"identifier":"tkiid","items":}.

<hr />

ERROR # 2 :

This Builder Call caused the following exception: Error parsing XML. No parent node for text: {"identifier":"tkiid","items":}.
java.io.IOException: Error parsing XML. No parent node for text: {"identifier":"tkiid","items":}.

at com.bowstreet.util.xml.XmlElement.setFromReader(XmlElement.java:216)

at com.bowstreet.util.xml.XmlElement.setFromReader(XmlElement.java:190)

at com.bowstreet.util.HTTPRequest.getOutput(HTTPRequest.java:996)

at com.bowstreet.util.HTTPRequest.invoke(HTTPRequest.java:527)

at com.bowstreet.builders.webapp.RestCallBuilder.fetchSchema(RestCallBuilder.java:728)

at com.bowstreet.builders.webapp.RestCallBuilder.doBuilderCall(RestCallBuilder.java:154)

at com.bowstreet.builders.webapp.foundation.WebAppGenHandler.doBuilderCall(WebAppGenHandler.java:405)

at com.bowstreet.generation.implementation.BaseGenContext.internalInvokeBuilder(BaseGenContext.java(Compiled Code))

at com.bowstreet.generation.implementation.BaseGenContext.performGenerationPhase(BaseGenContext.java(Compiled Code))

at com.bowstreet.generation.GenerationManager.generate(GenerationManager.java:161)

at com.bowstreet.generation.GenerationManager.generate(GenerationManager.java:62)

at com.bowstreet.designer.model.ModelAccess.generate(ModelAccess.java:265)

at com.bowstreet.designer.model.ModelContext.generate(ModelContext.java:364)

at com.bowstreet.designer.model.ModelContext.builderInputsChanged(ModelContext.java:512)

at com.bowstreet.designer.model.ModelContext.builderCallEnablementChanged(ModelContext.java:529)

at com.bowstreet.designer.eclipse.views.EnableBuilderAction.run(EnableBuilderAction.java:73)

at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)

at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)

at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)

at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled Code))

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined Compiled Code))

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code))

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)

at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)

at java.lang.reflect.Method.invoke(Method.java:391)

at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)

at org.eclipse.core.launcher.Main.basicRun(Main.java:280)

at org.eclipse.core.launcher.Main.run(Main.java:977)

at org.eclipse.core.launcher.Main.main(Main.java:952)

<hr />

Attachments

Updated on 2008-07-25T12:37:51Z at 2008-07-25T12:37:51Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: REST Call Builder with Process Server Integration (JSON)

    ‏2008-07-25T06:34:21Z  
    I'm adding the errors in a text file because it seems to be partially erased. Thanks for your time.

    Edwin Anaya

    Attachments

  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: REST Call Builder with Process Server Integration (JSON)

    ‏2008-07-25T12:37:51Z  
    I'm adding the errors in a text file because it seems to be partially erased. Thanks for your time.

    Edwin Anaya
    The REST Service Call builder doesn’t actually assume it’s getting back XML. The way it works is it uses the Content-Type sent in the response. I have seen some servers send back the incorrect Content-Type. You can however override how the builder handles this by setting the Force Content Type in the Advanced section of the builder inputs.
    If you change this to text/plain the builder won’t try to parse the results as XML.

    You will have to manually process the JSON string, and convert it to XML. To build up the XML you can use the IXml API’s, but there is no direct support for doing the JSON to XML conversion.

    You may want to post a question to the Business Process Choreographer group to see if they can return XML in place of JSON. They do mention it as one of the Data Formats.

    Another option is to use the Business Process Integration Extension for IBM WebSphere Portlet Factory. You can find out more information at the following URL.
    http://catalog.lotus.com/wps/portal/soa/details?catalog.label=1IW10046T
    Tom