Topic
  • 4 replies
  • Latest Post - ‏2012-05-06T15:05:07Z by SystemAdmin
SystemAdmin
SystemAdmin
9029 Posts

Pinned topic Service Test Builder gets NullPointerException

‏2012-05-04T18:43:35Z |
Hi,

I'm completely new to WebSphere Portlet Factory. We're using version 7.0.1.

I posted this on another forum and got directed here.

https://www.ibm.com/developerworks/forums/thread.jspa?threadID=425901&tstart=0
There's a thrid party wsdl (SOAP-rpc) that we need to use. I've built a model with a "Web Service Call" to the function we need to call in the WSDL.

To test it, I included a Service Test builder. When I click on the 'Specify Default Inputs' checkbox, I get the following error:

class java.lang.NullPointerException: Error running processInputChange method on the following coordinator class: com.bowstreet.builders.webapp.ui.ServiceTestCoordinator
java.lang.NullPointerException
Plug-in Provider: IBM
Plug-in Name: WebSphere Portlet Factory Designer UI
Plug-in ID: com.bowstreet.designer.ui
Version: 7.0.1

java.lang.NullPointerException
at com.bowstreet.builders.webapp.service.ServiceBuilderRuntimeUtil.collectInputs(ServiceBuilderRuntimeUtil.java:54)
at com.bowstreet.builders.webapp.ui.ServiceConsumer2Coordinator.getOperationInputChoices(ServiceConsumer2Coordinator.java:843)
at com.bowstreet.builders.webapp.ui.ServiceConsumer2Coordinator.populateOverridenInputs(ServiceConsumer2Coordinator.java:606)
at com.bowstreet.builders.webapp.ui.ServiceConsumer2Coordinator.reloadData(ServiceConsumer2Coordinator.java:207)
at com.bowstreet.builders.webapp.ui.ServiceConsumer2Coordinator.processInputChange(ServiceConsumer2Coordinator.java:168)
at com.bowstreet.editor.uitools.coordinator.BuilderEditorCoordinatorController.processInputChange(BuilderEditorCoordinatorController.java:453)
at com.bowstreet.designer.builders.CoordinatorRunner$CoordinatorContextInternal.processInputChange(CoordinatorRunner.java:666)
at com.bowstreet.designer.builders.CoordinatorRunner.builderWidgetChanged(CoordinatorRunner.java:269)
at com.bowstreet.designer.builders.widgets.AbstractBuilderWidget.notifyAllListeners(AbstractBuilderWidget.java:220)
at com.bowstreet.designer.builders.widgets.AbstractButtonWidget.widgetSelected(AbstractButtonWidget.java:101)
at com.bowstreet.designer.builders.widgets.CheckBoxWidget.widgetSelected(CheckBoxWidget.java:100)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Someone responded and said that the error is coming from GUI Portlet Factory Designer because "one or more service operations in your provider model do not have a schema associated with the operation inputs."

The WSDL in question is:
https://www.surfguard.slsa.asn.au/surfguard_playpen/SLSA_WebServices/wsdl/awardFunctions.wsdl

The operation in question is 'getMemberAwards'.

This WSDL is consumed by other applications - mainly PHP applications.

All the inputs and outputs to the operation are defined in the WSDL.

I don't understand why the test builder is failing. Is there a "special" WSDL standard for these builders that I'm unaware of?

Any help would be greatly appreciated.

Thanks in advance.
Updated on 2012-05-06T15:05:07Z at 2012-05-06T15:05:07Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Service Test Builder gets NullPointerException

    ‏2012-05-04T18:59:16Z  
    The NPE on the Service Test builder sounds like a bug.

    But I wanted to also wanted to recommend a best practice for testing your web services in WEF: Create a "provider modeL" that contains your integration builders, such as the Web Service Call, Web Service Multi-Op, REST Service Call, SQL, etc. Add a Service Definition builder. Then, abstract your Web Service Call service by adding a Service Operation that points to this Web Service Call. The provider model becomes an interface that your "consumer models" use to interact with these services. When a "Service Consumer" builder is added to a consumer model and pointed to the provider model, the consumer model only sees the Service Operations in the provider; they do not know about the actual back end integration builders being used.

    Getting back to testing the service: Once you've created a provider model with Service Definition, integration builders such as Web Service Call, and a Service Operation to wrap it, you can easily enable "Testing Support" input in the Service Definition builder. This will automatically create a test harness for testing your services. Specifically, a main method will be created that loads a page that lists all your services. You can then select a service to test. If the service has inputs, you'll get an input form to fill out input values. After clicking submit, you'll get a result page with data.

    One thing I've seen in the field that you might want to watch out for: By default, the testing support will present a form that prompts you for the inputs to your service. For inputs that you don't enter a value for, page automation and the WSC builder will send an empty element for that field in the SOAP request. So if your endpoint's validation doesn't allow for receiving empty elements in the SOAP request, you'll get a SOAPFaultException. You can work around this by using Data Column MOdifier builder to hide fields you don't want to enter values for. When the field is hidden, page automation won't set an empty element to the service and you'll be all set.

    Sam
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Service Test Builder gets NullPointerException

    ‏2012-05-04T19:58:00Z  
    The NPE on the Service Test builder sounds like a bug.

    But I wanted to also wanted to recommend a best practice for testing your web services in WEF: Create a "provider modeL" that contains your integration builders, such as the Web Service Call, Web Service Multi-Op, REST Service Call, SQL, etc. Add a Service Definition builder. Then, abstract your Web Service Call service by adding a Service Operation that points to this Web Service Call. The provider model becomes an interface that your "consumer models" use to interact with these services. When a "Service Consumer" builder is added to a consumer model and pointed to the provider model, the consumer model only sees the Service Operations in the provider; they do not know about the actual back end integration builders being used.

    Getting back to testing the service: Once you've created a provider model with Service Definition, integration builders such as Web Service Call, and a Service Operation to wrap it, you can easily enable "Testing Support" input in the Service Definition builder. This will automatically create a test harness for testing your services. Specifically, a main method will be created that loads a page that lists all your services. You can then select a service to test. If the service has inputs, you'll get an input form to fill out input values. After clicking submit, you'll get a result page with data.

    One thing I've seen in the field that you might want to watch out for: By default, the testing support will present a form that prompts you for the inputs to your service. For inputs that you don't enter a value for, page automation and the WSC builder will send an empty element for that field in the SOAP request. So if your endpoint's validation doesn't allow for receiving empty elements in the SOAP request, you'll get a SOAPFaultException. You can work around this by using Data Column MOdifier builder to hide fields you don't want to enter values for. When the field is hidden, page automation won't set an empty element to the service and you'll be all set.

    Sam
    Thank you for the reply.

    I've tried all sorts of service model wrappers. These are my "service" models. The consumers are in a different model.

    I've tried at least 4 different models wrappers with:
    1 - 'Web Serice Call' builder with a local WSDL definition in WEB-INF.
    2 - 'Web Service Call' builder to the 3rd party WSDL definition (i.e. not in WEB-INF).
    3 - 'Web Service Multiple Operations' builder to a local WSDL definition
    4 - 'Web Service Multiple Operations' builder to the 3rd party WSDL definition.

    They all had issues with the WSDL. The Muliple Operations builder compalined about the input variables - something about them having to be simple (I can't remember the exact message).

    I fiddled around with the local WSDL definition and it would accept the input if all the operations only had one input variable. It would not accept a definition where there are multiple input variables.

    But, it still complained about the outputs - no matter what I did with them (Please note that all the outputs are defined as string - nothing special about it).
    Something is not right about this interface.

    We tested the WSDL using plain java calls and they worked just fine. But, when we call from these builders, it has a heart attack.

    What gives?

    I think we're ready to give up on Portlet Factory.
  • DGawron
    DGawron
    580 Posts

    Re: Service Test Builder gets NullPointerException

    ‏2012-05-04T22:45:17Z  
    Thank you for the reply.

    I've tried all sorts of service model wrappers. These are my "service" models. The consumers are in a different model.

    I've tried at least 4 different models wrappers with:
    1 - 'Web Serice Call' builder with a local WSDL definition in WEB-INF.
    2 - 'Web Service Call' builder to the 3rd party WSDL definition (i.e. not in WEB-INF).
    3 - 'Web Service Multiple Operations' builder to a local WSDL definition
    4 - 'Web Service Multiple Operations' builder to the 3rd party WSDL definition.

    They all had issues with the WSDL. The Muliple Operations builder compalined about the input variables - something about them having to be simple (I can't remember the exact message).

    I fiddled around with the local WSDL definition and it would accept the input if all the operations only had one input variable. It would not accept a definition where there are multiple input variables.

    But, it still complained about the outputs - no matter what I did with them (Please note that all the outputs are defined as string - nothing special about it).
    Something is not right about this interface.

    We tested the WSDL using plain java calls and they worked just fine. But, when we call from these builders, it has a heart attack.

    What gives?

    I think we're ready to give up on Portlet Factory.
    This may be a long shot, but see if the service provider has a doc literal implementation of the service. Doc literal is more interoperable and easier for WEF to consume. That being said, this looks like a bug or limitation in the service builder implementation rather than the web service call builders. I used Web Service Call builders with the 3 "get" operations and the model regenerated w/o issue (WEF 7.0.1.2 plus a fixpack). That tells me the problem you are having is likely due to the use of RPC style and the service builder's requirement that inputs and outputs be expressed as XML. I'd suggest contacting support and opening a ticket. We can provide more help through that channel.
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Service Test Builder gets NullPointerException

    ‏2012-05-06T15:05:07Z  
    • DGawron
    • ‏2012-05-04T22:45:17Z
    This may be a long shot, but see if the service provider has a doc literal implementation of the service. Doc literal is more interoperable and easier for WEF to consume. That being said, this looks like a bug or limitation in the service builder implementation rather than the web service call builders. I used Web Service Call builders with the 3 "get" operations and the model regenerated w/o issue (WEF 7.0.1.2 plus a fixpack). That tells me the problem you are having is likely due to the use of RPC style and the service builder's requirement that inputs and outputs be expressed as XML. I'd suggest contacting support and opening a ticket. We can provide more help through that channel.
    Thank you for that reply. We will open a ticket.