Archive

Author Archive

Functional Quality Testing for SOA / WebServices

March 19, 2009 1 comment

As the number of services is growing in our environment, the need for automatic regression/functional testing is increasing.  I have recenly encountered articles on IBM Rational Tester for SOA Quality. It is nice tool, but having budget contraints we will have to build something on our own.

First thing that comes to mind to use Ant ant Junit tests that would be able to send SOAP and test results against expected XMLs. And quick search reveals IBM’s recent article on that topic:

 Testing SOA applications with WebSphere Integration Developer and Ant scripts

Also so far we have been using SOAPUI for our initial and integration unit testing, it would be nice to re-use existing SOAPUI projects in Continous Integration scripts and also expand them not only to send and receive results, but verify results against predefined set of results. Researching few articles on this theme: 

 Testing Web Services with SoapUI

Series of articles on continuous integration (CI), SoapUI and Groovy:
Functional Web Services Testing Made Easy with SoapUI – Part 1
Functional Web Services Testing Made Easy with SoapUI – Part 2
Functional Web Services Testing Made Easy with SoapUI – Part 3

Categories: SOA Tags: , , , ,

Websphere wsadmin.bat utility running out of memory

January 16, 2009 Leave a comment

Recently we have encountered Memory problems running Websphere wsadmin based scripts.

We were trying to retrieve large amount of CBE events from WESB using eventquery.bat script and default 256K memory settings were easily exhausted.

Our first option was to find in wsadmin.bat the line shown below and increase it

set PERFJAVAOPTION=-Xms256m -Xmx256m -Xj9 -Xquickstart

 

 But of course we wanted somewhat more elegant solution and came by the following IBM Tech Note, with the ‘javaoption’ parameter described:

http://www-01.ibm.com/support/docview.wss?rs=180&context=SSEQTP&uid=swg1PQ73288

 

 Instead of modyfing wsadmin.bat file passing ‘javaoption’ parameters worked perfectly

wsadmin.bat   -javaoption –Xms256m -javaoption –Xmx768m .. rest of parameters…

or in event query case:

eventquery.bat   -javaoption –Xms256m -javaoption –Xmx768m .. rest of parameters…

Websphere Password Decoding

December 16, 2008 Leave a comment

Passwords stored in Websphere Server configuration files actually could be decoded
http://robertmaldon.blogspot.com/2006/07/recovering-passwords-from-websphere.html

for the Websphere ESB 6.1 that runs on top of WAS 6.1.17 the actual comand is:
\IBM\WebSphere\ESB\deploytool\itp\plugins\com.ibm.websphere.v61_6.1.200>\IBM\WebSphere\ESB\java\bin\java -cp ws_runtime.jar com.ibm.ws.security.util.PasswordDecoder {xor}booqL2sSOm0=encoded password == “{xor}bWcqL2sSOm0=”, decoded password == “hello”

And a very nice online password decoder
http://www.sysman.nl/wasdecoder/

Plugins integration with WID 6.1.2

November 18, 2008 8 comments

The new WID 6.1.2 hides plugin installation by default. I was looking for usual Eclipse menu Help->Software Updates->Find and Install to point to Site for installing the plugin, but it disappead. The trick was to switch from the default “Business Integration” perspective to “Resources” and then “Software Updates” are back and working.

Of course other ways of copying jars to features/plugins and links are still working, but the managed updates via Eclipse seems to be more elegant way. (http://www.venukb.com/2006/08/20/install-eclipse-plugins-the-easy-way/)

Collection of useful SOA and general plugins:

  1. Subclipse plugin installation instructions : Subversion integartion
    http://subclipse.tigris.org/install.htmlhttp://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/
  2. SoapUI Plugin – Web Service Testing
    http://www.soapui.org/eclipse/index.html
  3. BIRT Plugin – useful for Tivoli Common Reporting on SOA infrastructure
    http://www.eclipse.org/birt/phoenix/
  4. WSRR Plugin – Webservice registry and repository plugin
    http://publib.boulder.ibm.com/infocenter/sr/v6r2/index.jsp?topic=/com.ibm.sr.doc/twsr_plugininstall.html

Web Services Contract First

October 1, 2008 Leave a comment

There are lots and lots of reasons to design the contract for the webservice (interface,messages etc) and only then proceed to the actual coding. Anyway it’s a common practice to any software project, but it is not that straightforward process in Visual Studio ASMX webservices.

With all the Vistual studio pre-generated project artifacts and templates it’s so much easier to get your[WebMethod] and voila! WSDL is genareted and contract is ready.

Here is nice article to address the doubts “Contract-First Web Services: 6 Reasons to Start with WSDL and Schema” on SOA Magazine

Nice post on the WebServiceContractFirst in VS2008 and WCF
ww.dotneteer.com/Weblog/post/2008/04/WSDL-first-(Contract-first)-Web-Service-development-with-Visual-Studio-2008.aspx

After doing some research and blogs scanning WSCF tool from thinktecture looks promising for ASMX
WSCF.blue is the new edition that supports WCF  http://wscfblue.codeplex.com/

(For the default .AddIn file locations for Visual Studio 2008 add-ins http://www.mztools.com/articles/2008/MZ2008001.aspx )

WAS 6.1 setup Windows NT Service

September 10, 2008 1 comment

There is a handy WASService command available in WAS_ROOT\bin allowing Websphere Application Server 6.1 integration with Windows Services.

Samples and documentation on IBM InforCenter – WASService Command

For WAS with security enabled first thing we encountered was a failure to stop WAS service from service console.

   RoleBasedAuth E   SECJ0306E: No received or invocation credential exist on the thread. … The stack trace  is java.lang.Exception: Invocation and received credentials are both null

To mitigate the problem add “stopArgs” parameters specifying username and password. In addition to make storing of passord more secure specify “-encodeParams” and password will be stored in registry in non readable format.

WASService.exe -add “DEV01N01” -serverName server1 -profilePath C:\IBM\pf\ESB\DEV01N01 -stopArgs “-username userA -password passwordXXX” -encodeParams

Disable Soap1.2 generation in ASMX.NET WSDL generator

July 31, 2008 Leave a comment

Websphere ESB 6.1 does not support Soap 1.2 yet. Presense of Soap1.2 bindings in .NET auto generated  WSDL files created lots of  problems with the new WID 6.1.2 release. So there are two options either modify WSDL manualy  when importing to ESB or modify the .NET web service to supress Soap1.2.

To disable Soap1.2 binding generation add in web.config  under <system.web>

    <webServices>

      <protocols>

        <clear/>

        <add name=HttpSoap />

        <add name=Documentation/>

      </protocols>

    </webServices>

WID 6.1.2 – problems migrating the mediation module

July 2, 2008 2 comments

After battling WID 6.1.2 start up,  few more problems come up during migration of mediation projects to the new WID 6.1.2

1. WebService export binding does not regenerate the binding servlet in descriptors even after the full clean and rebuild. The error received when sending SOAP

               Error 404: SRVE0190E: File not found: /sca/WebService

Basically the web.xml was missing servlet mapping

<servlet id=”WebService_WebServicePortTypeHttpPort“>

     <display-name>Web Services Router Servlet for SCA</display-name>

     <servlet-name>WebService_WebServicePortTypeHttpPort</servlet-name>

      <servlet-class>com.ibm.ws.webservices.engine.transport.http.WebServicesServlet</servlet-class>

 </servlet>

  <servlet-mapping>

      <servlet-name>WebService_WebServicePortTypeHttpPort</servlet-name>

      <url-pattern>sca/WebService</url-pattern>

  </servlet-mapping>

 The easiest way for WID to regenerate the web.xml properly was  to “Replace the Binding” on the Export.

2. Web Service Import binding does not regenerate the EJB references in descriptors after full clean and rebuild. Getting the following exeption while testing the mediation module:

com.ibm.websphere.sca.ServiceRuntimeException: Resource
java:comp/env/sca/import/SOAServicesInterfacePartner cannot be resovled.:
caused by: javax.naming.NameNotFoundException: Name comp/env/sca not found in  context “java:”.

 This problem looks pretty much the same as in IBM support note:

http://www-1.ibm.com/support/docview.wss?rs=203&context=SW000&dc=DA410&dc=DA450&dc=DA430&dc=DA440&dc=D600&dc=D700&dc=DB510&dc=DB520&dc=D800&dc=D900&dc=DA900&dc=DA800&dc=DB540&dc=DB400&dc=DB560&dc=DB530&dc=DA600&dc=DB550&dc=D100&dc=DA420&dc=DA460&dc=DB300&dc=DA470&dc=DA480&dc=DB100&dc=DA4A10&dc=DA4A20&dc=DA700&dc=DA4A30&dc=DA400&dc=DA100&dc=DA500&dc=D200&dc=DB700&dc=DB600&q1=JR24087&uid=swg1JR24087&loc=en_US&cs=UTF-8&lang=all

The following ejb reference is misssing in ejb-jar.xml:

<service-ref>

        <description>SOAServicesInterfacePartner</description>

        <service-ref-name>sca/import/SOAServicesInterfacePartner</service-ref-name>

        <service-interface>javax.xml.rpc.Service</service-interface>

         <wsdl-file>META-INF/wsdl/validateUser.wsdl</wsdl-file>

          <jaxrpc-mapping-file>META-INF/validateUser_mapping.xml</jaxrpc-mapping-file>

          <service-qname xmlns:pfx=”urn:com:deloitte:pim:soa“>pfx:SOAServices</service-qname>

         <handler>

               <display-name>SCA Service Import Handler</display-name>

               <handler-name>ServiceImportHandler</handler-name>

               <handler-class>com.ibm.wsspi.sca.webservice.jaxrpc.ServiceImportHandler</handler-class>

          </handler>

    </service-ref>

 the same trick with refactoring the name of the import did not work – looking for workaround ….

The root cause for both problems were presense of Soap 1.2 bindings in .NET Web Service WSDL. Disabling Soap 1.2 did the trick…

Related Posts

WID 6.1.2 launch problem

June 30, 2008 1 comment

Having to migrate to Vista, I took this opportunity to upgrade my Websphere Integration Developer to the latest and greatest WID 6.1.2 just released by IBM. And the first immediate problem I’ve encoutered – it just would not startup! Every try to start WID gets the error with printout of all the startup parameters:

JVM termintaed. Exit code =1
…\javaw.exe
-quickstart
-Xms512m

I have scanned all the newsgroups – apparently this problem existed before this release in other IBM and Eclipse based products. IBM support site suggests it may be due to the java cache and -Xshareclasses flag:

Rational Software Development Platform desktop product fails to launch

And numerous newsgroups publishing workarounds:
Java Ranch

The solution for the new WID 6.1.2 was to clear out eclipse.ini from all the arguments leaving only 2 lines specifying the jdk to call:

-vm
C:\IBM\WID61\jdk\jre\bin\javaw.exe

And Wow – it’s starting up.

I have played with all the parameters by adding/removing them from eclipse.ini and the offending one was – Xmx1024m, specifying the maximum java heap. (decreasing it to 512m – helped in my case) Looks like launcher tries to start up few java processes and exhausted the RAM available on the laptop.

Anyways just clear out eclipse.ini and leave 2 line – it will work with defaults.

wsdl.exe generator for WSDL with modeled soap faults

June 25, 2008 Leave a comment

Here is common problem with faults modeled using WSCF (WebServiceContractFirst) tool – while trying to generate C# Proxy for a webservice WSDL, I have kept getting the following error:

Error: Unable to cast object of type ‘System.Xml.XmlElement’ to type ‘System.Web
.Services.Description.ServiceDescriptionFormatExtension’
.

After a careful investigation of WSDL on W3C, I have discovered that the the bogus definition ( that wsdl.exe can’t understand)  was in fault section of the binding:

<binding name=”SOAServices type=”tns:SOAServicesInterface“>

 <soap:binding transport=”http://schemas.xmlsoap.org/soap/http“/>

  <operation name=”ValidateUser“>

      <soap:operation soapAction=”soa:validateUserIn style=”document“/>

      <input>

             <soap:body use=”literal“/>

      </input>

      <output>

             <soap:body use=”literal“/>

      </output>

       <fault name=”ValidateUserFault“>

          <soap:body use=”literal“/>

      </fault>

   </operation>

</binding>

Replacing the definition to include soap:fault instead of soap:body resolves the problem.

<wsdl:fault name=” ValidateUserFault “>

        <soap:fault name=” ValidateUserFault use=”literal“/>

 </wsdl:fault>

It would have been nice if wsdl.exe will generate more information for the errors, but ….