Customer has below error while connecting to the service via Web Service Consumer
Stack Trace is below
Exception detail:
java.lang.NullPointerException: replacement
at java.util.regex.Matcher.replaceFirst(Unknown Source)
at java.lang.String.replaceFirst(Unknown Source)
at com.extol.processcontrol.engine2.tasks.URIBuilderInitializer.mutateStringWithReplacementProps(URIBuilderInitializer.java:74)
at com.extol.processcontrol.engine2.tasks.URIBuilderInitializer.init(URIBuilderInitializer.java:26)
at com.extol.webservices.consumer.http.WSConsumerHttpRequestBuilder.build(WSConsumerHttpRequestBuilder.java:41)
at com.extol.processcontrol.engine2.tasks.WebServiceConnectorTask.executeRESTClient(WebServiceConnectorTask.java:352)
at com.extol.processcontrol.engine2.tasks.WebServiceConnectorTask.handleREST(WebServiceConnectorTask.java:268)
at com.extol.processcontrol.engine2.tasks.WebServiceConnectorTask.doWork(WebServiceConnectorTask.java:201)
at com.extol.processcontrol.engine2.Core.runTask(Core.java:228)
at com.extol.processcontrol.engine2.Core.doWork(Core.java:163)
at com.extol.processcontrol.engine2.Core.run(Core.java:103)
Resolution:
Customer has a REST web Service consumer object in which he is using Substitution Variable as part of URL
Where the value for ${connectionId} will be substituted in the runtime in the BPs where this particular Web Service Consumer Object is called.
Below are the changes required in the BPs.
- In this case the Connection ID value will be supplied in the run time using the input parameter in the BPs pConnectionId
2. Create a variable an name it as key of type string. Assign the initial value same as the substitution variable in the Web Consumer object
3. Create a SetProperty Task and supply the parameters as below
a. Properties File : a variable of type Properties. It is named as vProperties
b. Property Name : select the variable key which you created in Step 2
c. Value : supply the value which carries the value in runtime for the substitution variable. In this case is taken from Business Process input parameter pConnectionId as mentioned in step1
4. In the Web Consumer object task in the Request Parameters map the property variable which was used in Step 3.a
You can find the replaced URL in auditor log as below
Sample Project SVN link:
https://cleo.plan.io/svn/divya/WebServiceSubstitutionVariable/trunk/com.sample.harmonyAPI
I have considered Harmony REST API as REST provider in the above project.
Comments
0 comments
Please sign in to leave a comment.