[JBoss Tools] - Testing Web Services...
by Brian Fitzpatrick
Brian Fitzpatrick [http://community.jboss.org/people/bfitzpat] modified the blog post:
"Testing Web Services..."
To view the blog post, visit: http://community.jboss.org/community/jbosstools/blog/2010/05/26/testing-w...
--------------------------------------------------------------
Hey there...
In the Eclipse world as I've learned more about web services, I've found it interesting to see the areas that have needed some work. For example, though you have a TCP/IP monitor in Eclipse WTP and a Web Services Explorer that allow you to test deployed web services in a UDDI v2 registry and keep track of the HTML headers as well as your request and response SOAP calls.
But it doesn't handle UDDI v3 registries and didn't seem to handle RESTful web services, so I started tinkering...
The first result of that tinkering is a new Web Service Tester (WST) that works with JAX-WS and JAX-RS web services and integrates with the TCP/IP monitor for more detailed call information. It's not the prettiest thing in the world, but it works. :)
Here's an example of how it works...
Let's say there's a public web service out "there" in the vast expanses of the web that you want to call. In this case, it's to do a search for relevant lines from Shakespeare's plays. And it's a JAX-WS service.
To invoke the service using the WST, you need to know three things at this point (and hopefully this will improve over time).
1. The Endpoint URI. In this case it's: http://www.xmlme.com/WSShakespeare.asmx http://www.xmlme.com/WSShakespeare.asmx
2. The Action URI. In this case it's: http://xmlme.com/WebServices/GetSpeech http://xmlme.com/WebServices/GetSpeech
3. And the form the SOAP should take...
Sample SOAP in this case looks like:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetSpeech xmlns="http://xmlme.com/WebServices">
<Request>slings and arrows</Request>
</GetSpeech>
</soap:Body>
</soap:Envelope>
So we copy these bits into the WST...
http://community.jboss.org/servlet/JiveServlet/showImage/38-1787-3052/wst... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1787-3052...
Hit the Invoke button and in the "Response Body" tab you can see the response that comes back from Shakespeare's +Hamlet+....
http://community.jboss.org/servlet/JiveServlet/showImage/38-1787-3053/wst... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1787-3053...
You can open the entire response in the XML Editor from the popup menu. And if the response is a traditional SOAP envelope, you can open just the text from the operation "Result" in the XML Editor, which simplifies things and gets rid of the extraneous SOAP bits.
http://community.jboss.org/servlet/JiveServlet/showImage/38-1787-3055/wst... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1787-3055...
And in the "Response Header" tab you can see the HTTP header information that came back from the WS invocation...
http://community.jboss.org/servlet/JiveServlet/showImage/38-1787-3054/wst... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1787-3054...
Same rules apply for RESTful (JAX-RS) service invocation... In this case, we're invoking a public JAX-RS service to retrieve a list of postal data...
http://community.jboss.org/servlet/JiveServlet/showImage/38-1787-3056/wst... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1787-3056...
In addition, if you want more fine-grained TCP/IP monitoring, you can hook into the WTP TCP/IP Monitor view as well.
In this example, I've configured a monitor for the RESTful service we just invoked. That basically creates a proxy that the TCP/IP monitor listens to and captures the data from. Though you get the header info and can see the results in the tester itself, it's nice to see the time the invocation takes and hook into a more traditional monitoring tool.
http://community.jboss.org/servlet/JiveServlet/showImage/38-1787-3057/wst... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1787-3057...
The next thing to do is hook up the tester so it can infer details from a WSDL file and possibly even browse a UDDI repository for details.
Let me know what you think! I'd be curious what features you'd like to see in this thing. The idea isn't that the tester competes with more fully featured tools like soapUI, but provides a quick tester inside JBoss Tools or JBDS to help out web service developers.
--Fitz
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/community/jbosstools/blog/2010/05/26/testing-w...]
15 years, 10 months
[JBoss Tools] - Testing Web Services From WSDLs
by Brian Fitzpatrick
Brian Fitzpatrick [http://community.jboss.org/people/bfitzpat] modified the blog post:
"Testing Web Services From WSDLs"
To view the blog post, visit: http://community.jboss.org/community/jbosstools/blog/2010/06/04/testing-w...
--------------------------------------------------------------
Hi again...
I've been working on the JBoss Tools Web Service Tester and have just recently added the ability to select a WSDL file to populate the endpoint/action URLs and generate a Sample SOAP message when testing JAX-WS services. I'm still working on figuring out how to connect to a UDDI v3 registry to browse and select an operation from a published service in that context, but in the meantime you have a way to test your WSDL-based web services a bit easier...
Before I provide an example, I want to bring up a great resource for publicly-accessible web services from around the world - http://www.xmethods.net/ve2/index.po XMethods.net. If you haven't checked it out, it provides some great services that you can use to test tools like the WS Tester. A few that I found that are very useful for testing are:
* http://www.xmethods.net/ve2/ViewListing.po?key=uuid:7EB41E38-599C-30A8-9A... Temperature Conversions
* http://www.xmethods.net/ve2/ViewListing.po?key=425811 CDYNE Weather
* http://www.xmethods.net/ve2/ViewListing.po?key=427560 Driving Directions
* http://www.xmethods.net/ve2/ViewListing.po?key=427594 Google Search Results as RSS
So let's start with the Google Search Results one, which has a WSDL at http://www.ecubicle.net/gsearch_rss.asmx?WSDL http://www.ecubicle.net/gsearch_rss.asmx?WSDL.
If we look at the WS Tester, it has a new button - "Get from WSDL..."...
http://community.jboss.org/servlet/JiveServlet/showImage/38-1808-3111/ws_... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1808-3111...
So I click on the "Get from WSDL..." button and see the "Select WSDL" dialog:
http://community.jboss.org/servlet/JiveServlet/showImage/38-1808-3112/ws_... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1808-3112...
In the "WSDL URI:" field, I paste my WSDL URL in and it populates the three fields - Service, Port, and Operation. If there is more than one SOAP port available (such as SOAP and SOAP12), you can select it in the list and the operation list will change accordingly. In this case, there's just one operation available, but you have a vertical scroll bar on the right of the list to pick and choose.
http://community.jboss.org/servlet/JiveServlet/showImage/38-1808-3113/ws_... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1808-3113...
When I hit OK, it does a number of things with the WSDL. It searches through the WSDL for the endpoint and action URLs, but more importantly it will try and generate a valid sample of the SOAP Request message. Even if the WSDL has multiple imports and/or imports schemas, it should (knock on wood) generate even complex messages fairly well. (If it doesn't, please let me know by putting in a JIRA.)
So in this case, it comes back populating the WS Tester with these values:
http://community.jboss.org/servlet/JiveServlet/showImage/38-1808-3114/ws_... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1808-3114...
If I change the values a bit...
* searchPage becomes an empty value (delete the "?")
* gQuery becomes "JBoss Web Services"
* numOfResults becomes an empty value (delete the "?")
And hit Invoke...
http://community.jboss.org/servlet/JiveServlet/showImage/38-1808-3115/ws_... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1808-3115...
If I copy the response into an XML file and clean it up a bit, it looks pretty good:
http://community.jboss.org/servlet/JiveServlet/showImage/38-1808-3116/ws_... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1808-3116...
So if you look at a web service with multiple operations like the CDYNE Weather service (WSDL at http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl), you have more options in the operation list:
http://community.jboss.org/servlet/JiveServlet/showImage/38-1808-3117/ws_... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1808-3117...
And I was able to get the forecast for my city:
http://community.jboss.org/servlet/JiveServlet/showImage/38-1808-3118/ws_... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-1808-3118...
So if you have a WSDL file or a URL to a WSDL file, you should be able to use the WS Tester to test it now.
Next step is to get some sort of facility into the mix so you can browse a UDDI repository for the service.
This is checked into the JBoss Tools trunk now, so you should be able to play with it. Let me know what you think!
--Fitz
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/community/jbosstools/blog/2010/06/04/testing-w...]
15 years, 10 months
Re: [jboss-user] [jBPM] - IdentityService implementation
by Maciej Swiderski
Maciej Swiderski [http://community.jboss.org/people/swiderski.maciej] replied to the discussion
"IdentityService implementation"
To view the discussion, visit: http://community.jboss.org/message/546474#546474
--------------------------------------------------------------
> Sebastian Herbst wrote:
>
> Hi,
> I've tried to see when this error happens exactly. It allways appears, when the processdefinition node contains candidate-user/group. As long this tag is missing findPersonalTasks(..), takeTask or completeTask work fine. When it comes to a node containing ths tags it crashes with the following error. I don't see why this is happening. (I don't want to use the juel libary because it conflicts with some other of my libaries)
It happens because assignment (assignee, candidate-groups, candidate-users) can be given as expression that must be evaluated on runtime.
Since you don't/can't use juel in your system I would recommend you create your own implementation of ScriptEngine that will do the evaluation for you instead of the default one based on juel. You need to specify what language shall be used for evaluation and you can do that with another attribute for task activity:
- assignee-lang
- candidate-users-lang
- candidate-groups-lang
Another way could be to used other that are already defined:
- bsh
- groovy
HTH
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546474#546474]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months