JBossESB 4.4 have a new zero-code webservice invoker
August 7, 2008 – 11:20 pm by Stefano MAESTRIWe are proud to announce that recently released JBossESB 4.4 contain a wise based implementation of webservice client invoker.
In a nutshell it is a zero-code webservice caller supporting smooks based mapping, and pluggable JAX-WS handler. Here is an abstract of the message with which I presented it to ESB community (here you find original message and related discussion):
It uses wsconsume API to dynamically generate client object and invoke web service, delagating to JBossWS JAX-WS implementation the dirty job.
It use smooks under the hood to transform user defined object into JAX-WS generated ones.It support also standard JAX-WS handler and a generic smooks transformation handler to apply transformation to generated soap messages.
You can find it in my workspace under product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/
I also wrote javadoc for the action class explaining how to use it and e example demonstrating 3 common use case:* Direct call of a simple service without any mapping is needed
* Call of a service using a smooks mapper java-to-java
* Call a simple webservices without mapping, but with an handler
modifying header with smooks and an handler logging on System.out
request and response
In this 3 examples don’t forget to have a look to wise-core.properties for some important configs. Of course they could be integrated in action’s config in jboss-esb.xml in next future, but this first implementation leave them there.On wise roadmap I have the implementation of webservices’ call receiving different resources (CSV, XML and so on) using smooks to map it on JAX-WS generated client objects, giving another interesting opportunity in ESB environment.
It is an initial implementation, and I need to integrate wise objects generation with new smooks configgenerator ( http://milyn.codehaus.org/Smooks+User+Guide#SmooksUserGuide-GeneratingtheSmooksBindingConfiguration ) to make user experience easier.
Moreover we are working on wise-core to improve it and make it more configurable an pluggable and support much more stuffs. I’ll post a roadmap soon.
Stay tuned!













12 Responses to “JBossESB 4.4 have a new zero-code webservice invoker”
Hi Stefano,
I have had a problem with NTLM authentication when accessing web services protected with this mechanism. I keep getting “WiseConnectionException: Wsdl download failed”
(wrapped inside “ActionProcessingException: Error durinfg wise client creation” – which has a typo).
Using soapUI I’m connecting without a problem to the same web service endpoint. Could it be that WISE SOAP client is not using Domain information when authenticating?
I’ve used network protocol analyzer Wireshark to narrow down the problem. The only difference a human can notice (everything else is encrypted) when looking at the captured packets and HTTP traffic is in NTLMSSP_AUTH authentication phase, where WISE SOAP client sends (decyphered by Wireshark) User: W\N (literally, which does not resemble my username nor password) whereas soapUI sends User: \ (without anything before the backslash).
Do you have any clues?
In the meantime, I’ll ask the web services provider to turn off the authentication for their web services for selected IPs in order to import some data using JBoss ESB.
Thank you in advance!
Cheers!
Shonzilla
By Shonzilla on Jan 15, 2009
Hi again Stefano,
I must correct myself – there was something more I could do and I just did. I figured out that NTLM authentication messages that are embedded HTTP packets are Base64-encoded. It turns out that in every NTLM authentication phase (NTLMSSP_AUTH and NTLMSSP_CHALLENGE) my Windows credentials are used (i.e. local Windows users username and domain can be seen) instead of the supplied:
Could it be that JAX-WS client (used under-the-hood by WISE SOAP client) is disobeying configured username/password under Windows or am I doing something wrong?
Cheers!
Shonzilla
By Shonzilla on Jan 15, 2009
I’m sorry it’s a known (stupid) bug. See there for explaination and solution. (please join that discussion if you have any further question)
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201174#4201174
https://jira.jboss.org/jira/browse/JBESB-2265
Thanks for the interest.
By Stefano MAESTRI on Jan 15, 2009
Stefano, I’ve checked immediately the updated SOAP ESB service and it didn’t work. I delayed my response until I’ve checked what exactly is the problem.
I’ve found out that NTLM authentication is missing from wise-core library and that only HTTP Basic authentication scheme is supported. HTTP Digest authentication is currently not supported either.
The web services I’m trying to connect are implemented in .NET and NTLM authentication seemed like a nice fit (NTLM v2 being much stronger protection than HTTP Basic Auth is the main reason it’s being used). With the whole point of web services allowing interoperability of distributed and disparate systems, it would be great if WISE SOAP client (i.e. wise-core) would support Digest and NTLM authentication as well.
Thinking about how to support this, I’ve found out that Apache HttpClient has out-of-the-box support for all authentication schemes:
http://hc.apache.org/httpclient-http://hc.apache.org/httpclient-3.x/authentication.html#Authentication_Schemes
I’ve analyzed how much work it would require to use HttpClient to handle communication with the remote web services and found out that at least:
* it.javalinux.wise.core.client.impl.reflection.builder.ReflectionBasedWSDynamicClientBuilder should be modified to transfer WSDL using HttpClient (that first step was failing in my case) and
* at least in one more place where web service requests are being issued
I plan to post my conclusion in the JBoss forum and to submit a JIRA bug if you agree. In the meantime, drop me a short comment if you think using inserting HttpClient would be feasible.
Cheers!
Shonzilla
p.s. I have seen that commons-httpclient-3.0.1.jar is included in soap.esb.tgz you’ve attached to https://jira.jboss.org/jira/browse/JBESB-2265 but I haven’t had time to look for the exact reference to it.
By Shonzilla on Jan 26, 2009
https://jira.jboss.org/jira/browse/WISE-106
By Stefano MAESTRI on Jan 26, 2009
Hi Stefano,
I’m trying to run “webservice_consumer_wise” sample examples from jbossESB_4.5.GA under JBoss_AS_4.3.2, but I get the following errors:
17:27:31,873 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
17:27:31,874 INFO [STDOUT] Request map is: {toWhom=Jimbo}
17:27:31,879 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
17:27:33,008 INFO [STDOUT] parsing WSDL…
17:27:35,708 INFO [STDOUT] Failed to invoke WsImport
17:27:35,708 INFO [STDOUT] java.lang.NoClassDefFoundError: com/sun/xml/xsom/impl/ElementDecl
17:27:35,709 INFO [STDOUT] at com.sun.xml.xsom.impl.parser.state.elementDeclBody.makeResult(elementDeclBody.java
17:27:36,502 INFO [STDOUT] at com.sun.xml.xsom.impl.parser.state.elementDeclBody.text(elementDeclBody.java:808)
..
..
********************************************
Could you please tell me the reason for this fault?
Is there any classpath variable i need to set specifically for the jbossESB wise? or any other configuration?
Pls help.
By Suleman on Apr 22, 2009
I ran the clean version again and got this error:
..
..
9 INFO [WSDLFilePublisher] WSDL published to: file:/C:/ESB_Project/jboss-4.2.3.GA/server/default/data/wsdl/Quickstart_webservice_consumer_wise.esb/Quickstart_webservice_consumer_wise.war/H
Service442486963637018408.wsdl
8 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
0 INFO [STDOUT] Request map is: {toWhom=Jimbo}
0 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
3 INFO [STDOUT] parsing WSDL…
9 INFO [STDOUT] generating code…
7 INFO [STDOUT] it\javalinux\wise\HelloWorld.java
0 INFO [STDOUT] it\javalinux\wise\HelloWorldWSService.java
4 INFO [STDOUT] it\javalinux\wise\ObjectFactory.java
8 INFO [STDOUT] it\javalinux\wise\SayHello.java
1 INFO [STDOUT] it\javalinux\wise\SayHelloResponse.java
4 INFO [STDOUT] it\javalinux\wise\package-info.java
5 INFO [STDOUT] error invoking:public abstract java.lang.String it.javalinux.wise.HelloWorld.sayHello(java.lang.String)
5 INFO [STDOUT] error invoking:[Ljava.lang.Object;@b24759
6 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < , , , , , , , , , , > ] MessageID: 4675c737-701f-4d62-8753-80
RelatesTo: jms:correlationID#4675c737-701f-4d62-8753-809371de3256 ]
oa.esb.actions.ActionProcessingException: Could not call methodsayHello
org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:282)
org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:619)
it.javalinux.wise.core.exceptions.WiseException: Unknown exception received: null
it.javalinux.wise.core.exceptions.WiseException.rethrow(WiseException.java:44)
it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:87)
it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:108)
org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.java:280)
5 more
java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:75)
7 more
javax.xml.ws.WebServiceException: java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:404)
org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:314)
..
..
Any help?
By Suleman on Apr 22, 2009
And i ran the other example as well, webservice_consumer_wise2 and it produced this error:
..
..
20:33:04,971 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
20:33:05,009 INFO [STDOUT] Request map is: {external=org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise2.ExternalObject@14b6827[internal=org.jboss.soa.esb.samples.quickstart.webservice_con
sumer_wise2.InternalObject@fc269b[text=Jimbo,number=1],date=Wed Mar 07 04:27:00 CET 2007]}
20:33:05,010 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
20:33:05,046 INFO [STDOUT] parsing WSDL…
20:33:05,080 INFO [STDOUT] generating code…
20:33:05,083 INFO [STDOUT] it\javalinux\wise\ComplexObject.java
20:33:05,090 INFO [STDOUT] it\javalinux\wise\ObjectFactory.java
20:33:05,094 INFO [STDOUT] it\javalinux\wise\PingComplexObject.java
20:33:05,097 INFO [STDOUT] it\javalinux\wise\PingComplexObjectResponse.java
20:33:05,100 INFO [STDOUT] it\javalinux\wise\PingWS.java
20:33:05,103 INFO [STDOUT] it\javalinux\wise\PingWSService.java
20:33:05,106 INFO [STDOUT] it\javalinux\wise\package-info.java
20:33:05,443 INFO [ClassUtil] Loaded 4 classes from 2 URLs through class list file META-INF/content-handlers.inf. Process took 11ms. Turn on debug logging for more info.
20:33:05,621 INFO [ClassUtil] Not adding class ‘org.milyn.javabean.decoders.LocaleAwareDateDecoder’ to list. Class does not implement/extend ‘org.milyn.javabean.DataDecoder’.
20:33:05,627 INFO [ClassUtil] Loaded 22 classes from 1 URLs through class list file META-INF/data-decoders.inf. Process took 18ms. Turn on debug logging for more info.
20:33:12,810 ERROR [STDERR] java.lang.OutOfMemoryError: PermGen space
20:33:13,640 ERROR [STDERR] at java.lang.Class.getDeclaredConstructors0(Native Method)
20:33:13,641 ERROR [STDERR] at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
20:33:13,641 ERROR [STDERR] at java.lang.Class.getConstructor0(Class.java:2699)
20:33:14,391 ERROR [STDERR] at java.lang.Class.newInstance0(Class.java:326)
20:33:14,391 ERROR [STDERR] at java.lang.Class.newInstance(Class.java:308)
20:33:15,224 ERROR [STDERR] at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381)
20:33:15,224 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
20:33:15,224 ERROR [STDERR] at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377)
20:33:15,227 ERROR [STDERR] at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:95)
20:33:15,223 WARN [MessageAwareListener] TransactionalRunner caught throwable:
20:33:15,230 ERROR [STDERR] at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:313)
20:33:15,958 ERROR [STDERR] at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1327)
20:33:15,959 ERROR [STDERR] at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:52)
20:33:15,962 ERROR [STDERR] at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:437)
20:33:15,964 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
20:33:15,967 ERROR [STDERR] at java.io.ObjectStreamClass.(ObjectStreamClass.java:413)
20:33:15,970 ERROR [STDERR] at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310)
20:33:15,973 ERROR [STDERR] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1106)
20:33:15,975 ERROR [STDERR] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
20:33:15,978 ERROR [STDERR] at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:274)
20:33:15,981 ERROR [STDERR] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
20:33:15,984 ERROR [STDERR] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
20:33:15,987 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
20:33:15,989 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
20:33:15,992 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:392)
20:33:15,995 ERROR [STDERR] at org.jbpm.persistence.jta.JtaDbPersistenceService.getUserTransaction(JtaDbPersistenceService.java:88)
20:33:15,998 ERROR [STDERR] at org.jbpm.persistence.jta.JtaDbPersistenceService.beginJtaTransaction(JtaDbPersistenceService.java:49)
20:33:16,000 ERROR [STDERR] at org.jbpm.persistence.jta.JtaDbPersistenceService.(JtaDbPersistenceService.java:28)
20:33:16,003 ERROR [STDERR] at org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory.openService(JtaDbPersistenceServiceFactory.java:17)
20:33:16,006 ERROR [STDERR] at org.jbpm.svc.Services.getService(Services.java:144)
20:33:16,009 ERROR [STDERR] at org.jbpm.svc.Services.getPersistenceService(Services.java:183)
20:33:16,011 ERROR [STDERR] at org.jbpm.JbpmContext.getPersistenceService(JbpmContext.java:628)
20:33:16,014 ERROR [STDERR] at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:561)
20:33:17,570 ERROR [STDERR] Exception in thread “pool-25-thread-1″
20:33:17,575 ERROR [STDERR] Exception in thread “JbpmJobExector:192.168.77.108:1″
20:33:17,576 ERROR [STDERR] java.lang.OutOfMemoryError: PermGen space
20:33:17,576 ERROR [STDERR] java.lang.OutOfMemoryError: PermGen space
..
in the wise-core class, the temp directory path is absolute:
wise.tmpDir=C://JBoss/wise1
could this be a problem?
By Suleman on Apr 22, 2009
problem got fixed..it was due to this: java.lang.OutOfMemoryError: PermGen space
and solution:
On Windows, you can set this in the jboss: \bin\run.bat file:
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m -XX:MaxPermSize=128m
By Suleman on Apr 23, 2009
Great you have solved your problem. Sorry for the delay answering you, I’m very busy these days.
Join our community to http://www.jboss.org/wise
By Stefano MAESTRI on Apr 23, 2009
Hi Stefano,
All those “webservice_consume_wise*” examples work fine, i even changed the scenarios in them and that worked as well.
Now i want to build a small esb soapclient service by invoking and remotely deployed webserivce, e.g. http://www.w3schools.com/webservices/tempconvert.asmx?WSDL
I tried to change the scenario, but couldn’t got through with it. The problem comes with in web.xml under “webservice_consumer_wise4\war\resources\WEB-INF”
Apart from changing other configuration files, i’m not sure if i have changed the “build.xml” correctly. As in this scenario i’m not actually deploying a webservice as it is not part of my application “webservice_consumer_wise4\war\src\org\jboss\soa\esb\samples\quickstart\webservice_consumer1\HelloWorldWS”, so what should i do within the “build.xml” so that it should not try to access the locally available service.
In nutshell, i don’t have ws as part of my application but using a remote one. In the examples, you first deploy a WS locally and then consume it through soapclient. But in my scenario I dont want to deploy a WS but want to consume it only through SOAPclient.
This mind sound a very naive question to you, but i’m not only new in esb world but haven’t done much work in pure j2ee area as well:(, so not very confident with build.xml structure.
Thanks.
By Suleman on Apr 28, 2009