| soapUI part2: How to use soapUI with Oracle/BEA WLNG's Session Manager and WSS |
| Blog - Telecom, IMS, SOA | |
| Written by Jonas W | |
| Tuesday, 27 May 2008 14:49 | |
|
I will in this blog post illustrate how a test client can handle session management from Oracle/BEA's WebLogic Network Gatekeeper. In this middleware Telco product; applications and service providers normally need to establish a valid session to be permitted to send traffic over telecom networks. Without a valid session the Gatekeeper will reject telecom requests (unless you using a custom made traffic path with some other authentication mechanism). We will use the eminent soapUI for this exercise, and build a test case with a property transfer step, where we take a valid WLNG sessionID and store it on global level. This application session id will later on be used when we send traffic and we will inject the sessionID in the soap header for ParlayX requests. Preconditions:
Please notice that we now expect that you know how to setup accounts in WLNG, since we not discuss this any further here. Setup basic WS-Security1) Start your local soapUI workspace from preconditions (where we had the Terminal Location ParlayX 3.0 project). 2) Now we need to create Global Property SessionID and WSS. Double click on the project node in the soapUI tool. Select to create a global property, name it to SessionID. Add via the plus sign in the bottom of the editor. See mark in screenshot.
3) Now in the same editor, select tab named “WS-Security Configurations”. Add a config, name it “app-login”. Also, select the new app-login-key, and add a new “WSS entry”. Select “username” as type, add your WLNG application account credentials as username and password. Password Type should be PasswordText. See screenshot for details.
Build the Application4) For the telecom product Oracle/BEA WebLogic Network Gatekeeper it exists a session manager which is new from WLNG version 3.0. There was a similar authentication mechanism earlier, but from version 3.0, this is the one we will use. To locate the session manager WSDL file browse to http://<ip>:<port>/session_manager/SessionManager?WSDL (or select an Access Tier node in the deployment tree). For this example I’m running my WLNG locally on my laptop, therefore I can find the session WSDL on http://localhost:8001/session_manager/SessionManager?WSDL. Copy the URL. 5) Right click on the project, and select -> “Add WSDL from URL”. Use the same URL to session manager WSDL from step above. E.g. http://localhost:8001/session_manager/SessionManager?WSDL. Accept to create default operations.
6) Right click on project “Redstone ParlayX 3.0 Location” (or whatever you have decided to call yours). Select -> “New Test Suite”. Select a proper name (or leave default TestSuite 1). 7) Right click on the new TestSuite 1 -> select “New Test Case”. Accept the new default name for the test case, TestCase1. 8) Rick click on TestCase1 -> select ”Add step” -> “Test Request”. Name the new test request to “Get Session Id”. Select proper operation in next dialog. We are looking for SessionManagerSoapBinding -> getSession. Click ok. In next step, enable all checkboxes to create assertions and optional values. See screenshot below.
9) Open the editor for the new request, click on the tab “auth”. Add username, password and our newly created key for Outgoing WSS (app-login). See screenshot for details.
10) Now try to send a request for a session id. Push the play-button. If everything is OK, you should get a result like this:
<soapenv:Envelope xmlns:soapenv=
11) Now, let’s move the result from the session operation to the global property. This is handle via a property transfer step, and some xpath. 12) Right click on the Test Steps node, select -> “Add Step” -> “Property Transfer”. Name the new transfer to “MoveSessionid”. Click OK. 13) Open the editor for Property Transfer “MoveSessionId”. Create a new local parameter (via the plus-sign), name it “temp-session-id”. This parameter should now exists in the list to the left. Make sure this new property is selected, and select “Get Session Id” as source, and “Response” as Property. The following XPath code shall be included in source field: declare namespace service-manager= See screenshot for details how to setup the property transfer in step 13.
14) Try to invoke the property transfer step via the play button in transfer editor. If you get the session id in a list, this property transfer actually works! What to do now? Well lets use this login-info in a real WLNG invocation…
Use the sessionID in web service requests15) Lets reuse the ParlayX Terminal Location resources which we already have created in earlier steps (notice: it’s possible to use this session id in any other WLNG Northbound interface exposed, just keep in mind that the service must be enabled in the SLA associated with the application account we try to use. WLNG 3.0 does not come with ParlayX 3.0 for Terminal Location OOTB. This can be expected in custom deployments or in newer versions of WLNG. So this code approach will work for SMS, MMS, Call, Charging and all the other ParlayX Web Service supported interfaces exposed by the Gatekeeper). 16) Create a new Test case in our TestSuite 1. Name it “getLocation”. 17) Add a new test step, name it “getLocationReqest”, select TerminalLocationBindning -> getLocation as target. To use the global sessionId, we now need to add some extra code to our SOAP header. The following must be added: <soapenv:Header> 18) By using this code snippet above, you are now ready to invoke WLNG nodes, and get a ParlayX terminal Location 3.0 result back! Just use the play button! Rock on!
Comments? Contact This e-mail address is being protected from spambots, you need JavaScript enabled to view it |
|
MinaProjekt.se is the Redstone project site that gives users free access to information tools to collaborate, communicate and manage documents. The service is completely open to companies, organizations, associations and individuals.
We deliver business performance for clients based on our skill-sets:
| Services & Capabilities: | Agile Development | Pre-Study | Integration | Testing | Data | Architecture | Support | Troubleshooting | Portals | CMS |
| Tools & Technology: | Java EE | EJB | C/C++/C# | Telco | SS7 | ParlayX | Web Services | SOAP | WSDL | Web 2.0 | Ruby on Rails | HTML | XML | CSS | JSP |
| Products: | XML-RPC for Java | Prevalent Storage for Java | minaprojekt.se |
| Blogs: | Telecom, IMS & SOA | Ruby on Rails | Redstone |