[JBossWS] - How to add handler chain to dynamic web service proxy client
by rk_jboss
Hi,
I'm trying to add a handler chain (which has couple of handlers) to web service client (written using dynamic proxy) but when I try to run the client handlers are not added. If I use the the static stubs,I'm able to add the handlers.
I tried with different classes in jboss ws package but did not work.
Pls can anyone advice me if I miss something.
my client code is
|
| import org.jboss.ws.core.jaxws.binding.BindingImpl;
| import org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS;
|
| some other imports
|
| class client
| {
| public static void main(String[] args) {
| try {
| String namespace = "some namespace";
| String serviceName = "some serviceName";
| String portName = "some portName";
| String endpointAddress = "some endpointAddress";
|
| QName serviceQName = new QName(namespace, serviceName);
| Service service = Service.create(serviceQName);
| QName portQName = new QName(namespace, portName);
| service.addPort(portQName, SOAPBinding.SOAP11HTTP_BINDING, endpointAddress);
|
| Dispatch<SOAPMessage> dispatch =
| service.createDispatch(portQName, SOAPMessage.class, Service.Mode.MESSAGE);
|
| List<Handler> handlerChain = new ArrayList<Handler>();
| handlerChain.add(new ClientWSSecurityHandler());
| handlerChain.add(new LoggingHandler());
|
| // I tried the following options
| //1) did not work
| BindingImpl bindingProvider = (BindingImpl) dispatch.getBinding();
| bindingProvider.setHandlerChain(handlerChain);
|
| //2) did not work
| SOAP11BindingJAXWS bindingProvider = (SOAP11BindingJAXWS) dispatch.getBinding();
| bindingProvider.setHandlerChain(handlerChain);
|
|
| //creating soap message goes and invoking the service here
|
| } catch(WebServiceException webServiceException) {
| sop("WebServiceException is::"+webServiceException.getMessage());
| webServiceException.printStackTrace();
| } catch (SOAPException soapEx) {
| sop("SOAPException is::"+soapEx.getMessage());
| soapEx.printStackTrace();
| }
|
| }
| }
Thanks in advance.
Thanks,
Ram
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246562#4246562
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246562
17 years, 1 month
[JBoss jBPM] - Problems with variables in Start-node formular
by legux
Hi all.
I have got the following problem.
I created a process definition with jbpm 4.
To the start-node i assigned a form where the user can select the value of two variables.
The first transition leads from start to a decision-node, where i want to evaluate the input. I assigned a DecisionHandler to do this.
Using a JUnit-Test everything wents fine.
When i deploy this to the jboss and want to start the process with the jbpm-console, the form is shown and i can select the values, but in the DecisionHandler i can't see the variables.
When i put a human task between the start node and the decision, and assign view.ftl to this node where i show the variables i can see the values and after completing this task the decisionHandler also can evaluate the variables.
Can anybody help me with this problem?
thanks,
steffen
for a better understanding of my problem i will give you a short example:
the test.jpdl.xml
| <process name="test" xmlns="http://jbpm.org/4.0/jpdl">
|
| <start form="start.ftl" name="start1">
| <transition name="to java1" to="exclusive1"/>
| </start>
|
| <decision name="exclusive1">
| <handler class="org.jbpm.test.TestDecision"/>
| <transition name="to task1" to="task1"/>
| <transition name="to task2" to="task2"/>
| </decision>
| <task assignee="alex" name="task1">
| <transition name="to end1" to="end1"/>
| </task>
| <task assignee="alex" name="task2">
| <transition name="to end1" to="end1"/>
| </task>
|
| <end name="end1"/>
|
| </process>
|
start.ftl
| <form action="${form.action}" method="POST" enctype="multipart/form-data">
|
| <h5>Variable A</h5>
|
| <select name="varA">
| <option value="1">A1</option>
| <option value="2">A2</option>
| <option value="3">A3</option>
| </select>
|
| <br/>
|
| <h5>Variable B</h5>
| <select name="varB">
| <option value="1">B1</option>
| <option value="0">B0</option>
| </select>
| <br/>
| <input type="submit" name="Done"/>
|
| </form>
|
TestCase
| public void testProcess() throws Exception {
| Map<String, Object> variables = new HashMap<String, Object>();
| variables.put("varA", "1");
| variables.put("varB", "2");
| ProcessInstance instance = executionService
| .startProcessInstanceByKey("test", variables);
| String pid = instance.getId();
|
| assertEquals(true, instance.isActive("task1"));
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246553#4246553
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246553
17 years, 1 month
[JBoss Portal] - Re: Search Portlet?
by albertodominguezs
Hi Tom,
I didn't get any help or info. However, while I was debugging a custom LoginModule I found some really useful lines inside the org.jboss.portal.core.cms.ui.admin.CMSAdminPortlet.java.
Hope these lines work for you.
| package org.jboss.portal.core.cms.ui.admin;
|
| // ...
|
| public class CMSAdminPortlet extends JBossPortlet
| {
|
| // ...
|
| private void internalDoView(JBossRenderRequest rReq, JBossRenderResponse rRes)
| throws CMSException, PortletException, IOException
| {
|
| // ...
|
| else if (CMSAdminConstants.OP_VIEWSEARCHRESULTS.equals(op))
| {
| rRes.setContentType("text/html");
|
| String textQuery = rReq.getParameter("search");
| FederatedQuery query = new FederatedQuery(textQuery);
|
| JCRQueryConverter converter = new JCRQueryConverter();
|
| List files;
| try
| {
| Command searchCommand = CMSService.getCommandFactory().createSearchCommand((JCRQuery)converter.convert(query));
| files = (List)CMSService.execute(searchCommand);
| }
| catch (CMSException e)
| {
| e.printStackTrace();
| files = new ArrayList();
| }
| catch (QueryConversionException e)
| {
| files = new ArrayList();
| rReq.setAttribute("conversionError", Boolean.TRUE);
| }
| rReq.setAttribute("files", files);
| rReq.setAttribute("textQuery", textQuery);
|
| javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/searchResults.jsp");
| prd.include(rReq, rRes);
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246551#4246551
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246551
17 years, 1 month