I have an IS service that takes 2 input parameters. The IS service then passes the input parameters to a database query. The output of the query feeds my Mash Zone app.
The 2 input parameters are input boxes entered by the business users on my Mash Apps. How can I pass the 2 input parameters to my IS service? I use XML file to create the data feed for the output of my IS service.
I tried to use the Create URL, parameters to pass the user input value but not sure if that is the right way. The problem also is that without any default value I cannot click on "Configure Columns".
Please advise on how to pass user inputs to backend IS services.
Many thanks in advance.
Hi Min Chai,
I have evaluated a practical way to use an IS service as an MashZone data feed. There are two main issues:
1. How to send input values to IS service?
2. What is the format of the IS response?
First, you have developed a IS service like dev.mg:getDatafeed doing some processing:
As you only use simple string input, you are able to invoke the service via HTTP GET and pass the input parameter via tagged values (?KEY=VALUE&). Example:
http://localhost:5555/invoke/dev.mg/getDatafeed?myInValue1=abc&myInValue2=123
Second, your service needs to return pure XML output. I recommend using output templates in the shown way:
Hit the Button “New…” in the properties tab. Depending on your output you choose a simple xml format. Make sure that your xml is well formed and contains your output values (inserted using template commands %loop ...% and %value …%).
Example:
Now, testing your IS service in a browser your request
http://localhost:5555/invoke/dev.mg/getDatafeed?myInValue1=abc&myInValue2=123
will return a xml output (that’s what you need to process in DataFeed)
Back to MashZone you simply add a data feed looks like
As access to IS Service is protected by HTTP Basic Authentication you need to add some securities in the data feed.
Hope this will help you starting.
Regards,
Marko
Marko,
Thanks for the reply. I did exactly what you have prescribed except my 2 parameters to the IS services look like this:
StartDate with default value of 01/01/2010
EndDate with default value of 12/31/2010
My IS srevice is not the problem here. It ran fine in Developer given those values. the output of my IS service looks like this:
<?xml version="1.0"?>
<List>
<Deal>
<DealId>7121</DealId>
</Deal>
<Deal>
<DealId>7140</DealId>
</Deal></List>
With the XML File, Create URL, User Input Test all setup as you have said, when I click on configure column, I always get this error:
**************************************************************************************************
Unable to parse resulting file to a document.
Unable to parse resulting file to a document.
org.xml.sax.SAXParseException: The reference to entity "EndDate" must end with the ';' delimiter.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.idsscheer.ppmmashup.feed.feeddefinition.operators.tableoperators.sourceconnectoroperators.ZXMLDocumentSource.getDocument(ZXMLDocumentSource.java:80)
at com.idsscheer.ppmmashup.feed.impl.ZMUFeedService.getResourceTableDataInfo(ZMUFeedService.java:822)
at com.idsscheer.ppmmashup.business.impl.ZBusinessDelegate.getRessourceTableDataInfo(ZBusinessDelegate.java:355)
at com.idsscheer.ppmmashup.web.webservice.impl.ZMashUpWebService.getRessourceTableDataInfo(ZMashUpWebService.java:178)
at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at com.idsscheer.ppmmashup.web.aspect.ZTimeTrackingAspect.trackDuration(ZTimeTrackingAspect.java:66)
at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at com.idsscheer.ppmmashup.web.aspect.ZExceptionWrapperAspect.wrapExceptionToArray(ZExceptionWrapperAspect.java:71)
at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy103.getRessourceTableDataInfo(Unknown Source)
at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:60)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:423)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:178)
at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
at com.idsscheer.ppmmashup.web.filter.ZSessionInvocationFilter.doFilter(ZSessionInvocationFilter.java:144)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at com.idsscheer.ppmmashup.web.security.ZGuestProcessingFilter.doFilter(ZGuestProcessingFilter.java:136)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at com.idsscheer.ppmmashup.web.security.ZUrlAuthenticationFilter.doFilter(ZUrlAuthenticationFilter.java:74)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.idsscheer.ppmmashup.web.filter.ZRequestEncodingFilter.doFilter(ZRequestEncodingFilter.java:43)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
************************************************************************************************
Question:
1. is there a soap monitor too I can use to see what IS passed back to the Data Feed?
2. Why would a parser complaining about an input parameter which does not even exist in my output?
I have done several implementation like above with IS services successfully. The only difference is that I have not use input parameters.
Any suggestion would be greatly appreciated.
Thanks,
Min
And when I run the following URL in my browser:
I get the expected XML doc.
MashZone does not like the second parameter. Not sure why.
Ok, it looks like wM stuff is running.
But back to your questions:
1. There is a TCP-Monitor coming with Designer (Preferences->Run/Debug->TCP/IP Monitor).
2. I'm not sure if a slash in your URL causes any problems (because it's not allowed, you have to encode your values). Can you please try it first without a date as input parameter (only to eliminate a possible problem)?
Marko
Marko,
I have changed the StartDate and EndDate values to 20100101 and 20101231 (without the slash) or 01-01-2010 and 12-31-2010 respectively but the error is still the same. Frankly I am not sure if my IS service is even being invoked.
When you mentioned Designer, is this an ARIS product or the webMethods Designer?
Thanks again for your help.
Min
It's webMethods Designer (Eclipse).
In your Statistics on http://entqaportz.ame.ad.sag:5555/ you can see a service invocation counter. This also helps you to detect if your IS service has invoked.
Regards,
Marko