Inside Sonic MQ 7.6. About libraries

Introduction

Once upon a time I have an idea. Why not to study well known and relatively small Java enterprise application? We live in the world of high-level Java applications: different kind frameworks, application servers, enterprise service buses, business process management systems, etc. From one side, it’s interesting how this industry organize. From another side, yes, we have some limitations in licenses for commercial products and usually ban on de-compilation, but I will not go out of research work. I don’t want to steal anything (real thief will not write articles), and at least at this article I will work with open information – primary with library names. I will try to understand thin organization of work of one enterprise product – enterprise service bus Sonic MQ 7.6. I am interested to study code, which seems to me etalon (I think, I will be disappointed!). And I am interested in such specifics as organization of physical containers in Sonic MQ, which is main mystery in this product. I have interest also in the common technological questions – especially, using of open source libraries. For this research work I need tools – JDCore Java Decompiler (http://java.decompiler.free.fr) – it’s good that Sonic did not apply any kind obfuscation. And, certainly, I will use google for Internet search. First I will try to investigate libraries and reproduce on their functionality common mechanism – it is, in any case, good interesting task of the introspection analysis.

List of native libraries in the Sonic MQ 7.6

1. antconfig.jar

2. broker.jar

3. loggerAPI.jar

4. pluginLogger70.jar

5. pluginLogger75.jar

6. pluginLogger76.jar

7. mfcontext.jar

8. MFlaunch.jar

9. MFtriggers.jar

10. mgmt_client.jar

11. pluginMF21.jar

12. pluginMF30.jar

13. pluginMF75.jar

14. pluginMF76.jar

15. MFdirectory.jar

16. mgmt_config.jar

17. MQtriggers.jar

18. pluginMQ61.jar

19. pluginMQ70.jar

20. pluginMQ75.jar

21. pluginMQ76.jar

22. pluginMQbroker.jar

23. pluginSecurity76.jar

24. pse.jar

25. rsa_ssl.jar

26. sdf.jar

27. smc.jar

28. smq-install.jar

29. smq_tools.jar

30. smq_upgrade.jar

31. sonic_ASPI.jar

32. sonic_Channel.jar

33. sonic_Client.jar

34. sonic_Client_ext.jar

35. sonic_Crypto.jar

36. sonic_mgmt_client.jar

37. sonic_Selector.jar

38. sonic_SF.jar

39. sonic_SSL.jar

40. sonic_XA.jar

41. sonic_XMessage.jar

Grouped list of native libraries (the first approximation)

  1. Work with standard java tools

antconfig.jar – customization of ant

  1. Work of broker

broker.jar

  1. Logging

loggerAPI.jar – obviously, common logging library

pluginLogger70.jar – logging for Sonic 7.0

pluginLogger75.jar – logging for Sonic 7.5

pluginLogger76.jar – logging for Sonic 7.6

4. Work with physical containers (mf)

mfcontext.jar – work with container context

MFlaunch.jar – container’s launch

MFtriggers.jar

pluginMF21.jar – anything very old

pluginMF75.jar – stuff from version 7.5

pluginMF76.jar – stuff from version 7.6

MFdirectory.jar – support of the Sonic file system

pluginMF30.jar

5. Work with client (.NET-client and similar)

mgmt_client.jar

sonic_Client.jar

sonic_Client_ext.jar – work with Stream API, etc.

sonic_mgmt_client.jar – Management API

6. Work with configurations

mgmt_config.jar – don’t understand yet…

7. Work of mq-transport

MQtriggers.jar

pluginMQ61.jar – stuff for version 6.1

pluginMQ70.jar – stuff for version 7.0

pluginMQ75.jar – stuff for version 7.5

pluginMQ76.jar – stuff for version 7.6

pluginMQbroker.jar – work with broker from mq-side

smq-install.jar – installation mq?

smq_tools.jar – mq tools (Test Client, etc.)

smq_upgrade.jar – upgrade mq

sonic_ASPI.jar – JMS-implementation?

sonic_Channel.jar – work with channels

sonic_Selector.jar – work with selector API

sonic_SF.jar

8. Security

pluginSecurity76.jar

rsa_ssl.jar – link to third-party library rsa

sonic_Crypto.jar – encryption

sonic_SSL.jar – work with SSL

9. Work with Sonic file system

pse.jar – is working also with databases (PSE Pro provides an application programming interface (API) that allows you to store Java objects persistently)

  1. Diagnostics

sdf.jar – as I understood, for testing

  1. Sonic Management Console

smc.jar

  1. Transactions

sonic_XA.jar

  1. Work with xml messages

sonic_XMessage.jar

Small summary

Note existence of old versions libraries. It’s carelessness of distributive or Sonic really uses functionality of old libraries. Separate functionalities are physically placed into separate libraries as different kind APIs. Big corpus of libraries is about mq and containers, it’s not unusual, and it’s the most delicious part. Great attention have various plugins, and it’s really strange for un-plugined Sonic. Libraries have almost no reference to third-party jars, and, I think, it’s because of conscious license policy. Though few jars (pse.jar) consist of main body and sonic cover – probably, it’s simply result of several commands work. And we can find CERN-functionality in the library MFDirectory.jar, so any Sonic using organization far from atom physics can apply this functionality!

List of third-party libraries grouped on the license type

I.                   Free licenses (open source)

  1. addressing-1.0.jar
  2. activation.jar
  3. mail.jar
  4. jaxrpc.jar
  5. jndi.jar
  6. saaj.jar
  7. ant.jar
  8. ant-launcher.jar
  9. axis.jar
  10. bcprov-jdk14-127.jar
  11. bcprov-jdk15-135.jar
  12. commons-discovery.jar
  13. commons-logging.jar
  14. jmxri.jar
  15. js.jar
  16. opensaml.jar
  17. sjsxp.jar
  18. soap.jar
  19. wsdl4j.jar
  20. wspbeans.jar
  21. wss4j.jar
  22. xbean.jar
  23. xercesImpl.jar
  24. xmlParserAPIs.jar
  25. xmlsec.jarII.                Commercial licenses
    1. asn1.jar
    2. certj.jar
    3. jsafe.jar
    4. jsafeJCE.jar
    5. sslj.jar
    6. mcharts.jar

Thematic list of third-party libraries

 

I.                   Security

 

  1. asn1.jar
  2. certj.jar
  3. jsafe.jar
  4. jsafeJCE.jar
  5. sslj.jar
  6. bcprov-jdk14-127.jar
  7. bcprov-jdk15-135.jar
  8. opensaml.jar

 

II.                Data vizualisation

mcharts.jar

III. Web services

 

  1. addressing-1.0.jar
  2. saaj.jar
  3. axis.jar
  4. soap.jar
  5. wsdl4j.jar
  6. wspbeans.jar
  7. wss4j.jar

IV. Java beans

1. activation.jar

  1. V.                 Mail

1. mail.jar

VI.              XML

  1. jaxrpc.jar
  2. sjsxp.jar
  3. xbean.jar
  4. xmlParserAPIs.jar
  5. xmlsec.jar

VII. JNDI

1. jndi.jar

VIII.        Ant

  1. ant.jar
  2. ant-launcher.jar

IX. Common

1. commons-discovery.jar

X.                 Logging

1. commons-logging.jar

XI.              JMX

1. jmxri.jar

XII.           JavaScript

1. js.jar

XIII.        XSLT

  1. xercesImpl.jar

List of third-party libraries with comments

  1. addressing-1.0.jar – Apache implementation of WS-Addressing

Apache Addressing is an implementation of the Web Services Addressing (WS-Addressing), published by the IBM, Microsoft and BEA as a joint specification, on top of Apache Axis (The Next Generation SOAP) – http://svn.apache.org/repos/asf/webservices/archive/addressing/site/index.html

  1. activation.jar – JavaBeans Activation Framework (Sun/Oracle) – http://www.oracle.com/technetwork/java/jaf11-139815.html

With the JavaBeans Activation Framework standard extension, developers who use Java technology can take advantage of standard services to determine the type of an arbitrary piece of data, encapsulate access to it, discover the operations available on it, and to instantiate the appropriate bean to perform said operation(s). For example, if a browser obtained a JPEG image, this framework would enable the browser to identify that stream of data as an JPEG image, and from that type, the browser could locate and instantiate an object that could manipulate, or view that image.

  1. mail.jar – JavaMail (Sun/Oracle, optional in J2SE, included in JEE) – http://www.oracle.com/technetwork/java/javamail/index.html
  2. jaxrpc.jar – JSR-000101 Java(TM) API for XML-Based RPC Specification Interface Classes 1.1 Final Release (Sun/Oracle)

The Java API for XML based RPC (JAX-RPC) enables Java technology developers to build Web applications and Web services incorporating XML based RPC functionality according to the SOAP (Simple Object Access Protocol) 1.1 specification.

By using JAX-RPC, developers can rapidly achieve Web services interoperability based on widely adopted standards and protocols.

http://java.sun.com/xml/downloads/jaxrpc.html

5.      jndi.jar – Java Naming and Directory Interface (JNDI) (Sun/Oracle)

http://www.oracle.com/technetwork/java/jndi/index.html

  1. saaj.jar – Java Technology & XML Downloads – SOAP with Attachments API for Java (SAAJ) (Sun/Oracle)

http://java.sun.com/xml/downloads/saaj.html

  1. ant.jar, ant-launcher.jar – Apache Ant

http://ant.apache.org/bindownload.cgi

  1. asn1.jar –  RSA BSAFE® Crypto-J 3.4.3

http://www.rsa.com/products/bsafe/documentation/cryptoj_343_releasenotes.pdf

certj.jar – Certificate Management Components for Java

http://www.rsa.com/products/bsafe/documentation/certj212html/certj/dev_guide/classCertJ.html        

jsafe.jar, jsafeJCE.jar – RSA BSAFE® Crypto-J 2.2

http://www.rsa.com/products/bsafe/documentation/cryptoj_22_releasenotes.pdf

sslj.jar – SSL-J is a software development toolkit for building SSL security into enterprise-to-enterprise and commercial Internet applications.

Click to access sslj_416_install_guide.pdf

RSA is department of EMC (hardware, memory cards, data warehousing), and its business is informational security. Founders – Rivest, Shamir, Adleman – authors of RSA algorithm.

  1. axis.jar – Apache Web Services – Axis

http://axis.apache.org/axis/java/install.html

  1. bcprov-jdk14-127.jar, bcprov-jdk15-135.jar – Legion of the Bouncy Castle Java cryptography APIs

http://bouncycastle.org/java.html

BouncyCastlewas created inAustraliaand has no American limitations for export of crypto-algorithms. Open source

  1. commons-discovery.jar – Apache Commons

The Discovery component is about discovering, or finding, implementations for pluggable interfaces. It provides facilities for instantiating classes in general, and for lifecycle management of singleton (factory) classes.

http://commons.apache.org/discovery/

  1. commons-logging.jar – Apache Commons

The Logging package is an ultra-thin bridge between different logging implementations. A library that uses the commons-logging API can be used with any logging implementation at runtime. Commons-logging comes with support for a number of popular logging implementations, and writing adapters for others is a reasonably simple task.

http://commons.apache.org/logging/

13.  jmxri.jar – Java Management Extension (JMX) 1.2.1 (Sun/Oracle)

http://www.oracle.com/technetwork/java/javase/tech/download-jsp-141676.html

14. js.jar – scripting Java by means Rhino Shell (Mozilla)

http://www.mozilla.org/rhino/scriptjava.html

15. mcharts.jar – Charting platform for Java (singleton-labs)

For desktop and web

2D and 3D

http://www.singleton-labs.com/

Singleton Labs is company whose business is data visualization (graphs, charts, diagrams). Located inKaunas(Lithuania)

16. opensaml.jar

OpenSAML is a set of open source C++ & Java libraries meant to support developers working with the Security Assertion Markup Language (SAML) – authentication & authorization.(shibboleth)

Shibboleth is part of MACE-project

About MACE

In order to help create a national interoperable middleware infrastructure for research and education, Internet2 has brought together a group of leading campus IT architects to provide technical advice and direction. This group, called MACE (Middleware Architecture Committee for Education), draws its members from universities that are doing advanced work in this area. MACE aims to foster interoperability in areas such as security and directories.

https://wiki.shibboleth.net/confluence/display/OpenSAML/Home

17. sjsxp.jar – here are two JAR files in the Sun Java System XML Streaming Parser (SJSXP) implementation of JSR 173, Streaming API for XML (StAX). (Sun/Oracle)

http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.6/tutorial/doc/SJSXP-jars.html

18. soap.jar – Apache SOAP

http://www.apache.org/dyn/closer.cgi/ws/soap/

19. wsdl4j.jar – the Web Services Description Language for Java Toolkit (WSDL4J) allows the creation, representation, and manipulation of WSDL documents (sourceforge)

http://wsdl4j.sourceforge.net/

20. wspbeans.jar – GridSAM provides a job submission open standards based web service for submitting computational jobs to many commonly used distributed resource management systems. (sourceforge)

http://sourceforge.net/projects/gridsam/

21. wss4j.jar – Apache WSS4J is an implementation of the Web Services Security (WS-Security) being developed at OASIS Web Services Security TC. WSS4J is a primarily a Java library that can be used to sign and verify SOAP Messages with WS-Security information. WSS4J will use Apache Axis and Apache XML-Security projects and will be interoperable with JAX-RPC based server/clients and .NET server/clients.

http://ws.apache.org/wss4j/

22. xbean.jar – XMLBeans is a technology for accessing XML by binding it to Java types. (Apache)

http://xmlbeans.apache.org/index.html

23. xercesImpl.jar – As our charter will tell you, the Apache Xalan Project is a collaborative software development project dedicated to providing robust, full-featured, commercial-quality, and freely available XSLT support on a wide variety of platforms. (Apache)

http://xalan.apache.org/index.html

24. xmlParserAPIs.jar is part of Apache xml-commons

http://xml.apache.org/commons/

25. xmlsec.jar is part of Apache Santuario

http://santuario.apache.org/download.html

The Apache SantuarioTM project is aimed at providing implementation of the primary security standards for XML

Summary on third party libraries

 

For me it was discourage to find plenty of open source libraries in the commercial product. In fact, Progress paid for licenses only in the most important and complicated cases – for enterprise level security and data visualization. Why they have need in the package for drawing graphics and diagrams in the transport product – it’s question, on which I hope to find answer later. We have note once more that other libraries, and these are imposing packages on xml and web services, have free licenses (though here may be nuances), but mechanism is of special interest for me, and it’s important, that it’s building on the common accessible libraries.  

It’s interesting, that we found activation.jar, which usually used for activation of bins in the enterprise level application servers. Plenty of web services libraries calls perplexity in my feelings – what do they do on the MQ-level? Probably, they make parsing messages after calling web services in a bus? Reference to the mail.jar is enigmatic too – because Sonic is not working with e-mail directly, there is special component for this work. Existence of the xslt-library calls similar questions – probably, library works for purposes of inner routing.

Common summary

We have yet more questions then answers. Sonic built in many respects on the open-source libraries. Commercial licenses are using for strictly definite purposes (data visualization, enterprise level security). Basic mechanism (brokers, containers, clients, mq, security questions) is written by Progress Sonic. And we will dig into that side – to the mechanism of containers launching, first, and this will be theme of the next article.

Posted in Uncategorized | Leave a comment

Calling web service with basic authentication from Sonic

This will be a post full of technical details – interesting mainly for
Sonic developers.
Once upon a time I had great need to call web service from Sonic (version 7.6).
Sonic has opportunity to call usual web services, but this service had basic
authentication. So I designed simple ESB-process with web service invocation.

Then I tried to customize this invocation component, pointed for him needed
login and password, but web service all the time replied me with error:

com.sonicsw.xq.XQServiceException: (null (WSDLException: faultCode=OTHER_ERROR: Unable to locate document at ‘http://1c-dev.main.rosevrobank.ru/stock/ws/Staff?wsdl’.)) (null (WSDLException: faultCode=OTHER_ERROR: Unable to locate document at ‘http://1c-dev.main.rosevrobank.ru/stock/ws/Staff?wsdl’.) (WSDLException: faultCode=OTHER_ERROR: Unable to locate document at ‘http://1c-dev.main.rosevrobank.ru/stock/ws/Staff?wsdl’.))
at com.sonicsw.xqimpl.service.wsinvk.WSInvocationComponent.service(WSInvocationComponent.java:70)
at com.sonicsw.xqimpl.service.ServiceMessageHandler.callService(ServiceMessageHandler.java:429)
at com.sonicsw.xqimpl.service.ServiceMessageHandler.handleMessage(ServiceMessageHandler.java:190)
at com.sonicsw.xqimpl.service.ProcessMessageHandler.doHandleMessage(ProcessMessageHandler.java:317)
at com.sonicsw.xqimpl.service.ProcessMessageHandler.handleMessage(ProcessMessageHandler.java:94)
at com.sonicsw.xqimpl.service.XQDispatcher.onMessage(XQDispatcher.java:422)
at com.sonicsw.xqimpl.service.MessageSendingHelper.sendToService(MessageSendingHelper.java:330)
at com.sonicsw.xqimpl.service.MessageSendingHelper.sendToAddress(MessageSendingHelper.java:78)
at com.sonicsw.xqimpl.service.MessageSendingHelper.sendEnvelopes(MessageSendingHelper.java:926)
at com.sonicsw.xqimpl.service.XQDispatcher.onMessage(XQDispatcher.java:499)
at com.sonicsw.xqimpl.endpoint.container.EndpointContextContainer.onMessage(EndpointContextContainer.java:90)
at com.sonicsw.xq.connector.jms.JMSEndpoint$JMSEndpointListener.onMessage(JMSEndpoint.java:575)
at progress.message.jimpl.Session.deliver(Session.java:3006)
at progress.message.jimpl.Session.run(Session.java:2397)
at progress.message.jimpl.Session$SessionThread.run(Session.java:2782)
Caused by: com.sonicsw.xqimpl.invk.ESBException: null (WSDLException: faultCode=OTHER_ERROR: Unable to locate document at ‘http://1c-dev.main.rosevrobank.ru/stock/ws/Staff?wsdl’.) (WSDLException: faultCode=OTHER_ERROR: Unable to locate document at ‘http://1c-dev.main.rosevrobank.ru/stock/ws/Staff?wsdl’.)
at com.sonicsw.xqimpl.invkimpl.ESBServiceImpl.getEndpoint(ESBServiceImpl.java:366)
at com.sonicsw.xqimpl.service.wsinvk.WSInvocationScriptObject$WSInvocationScriptCommand.execute(WSInvocationScriptObject.java:377)
at com.sonicsw.xqimpl.script.Command.executeScriptCommand(Command.java:319)
at com.sonicsw.xqimpl.script.Command.execute(Command.java:275)
at com.sonicsw.xqimpl.script.ScriptEngine.executeCommand(ScriptEngine.java:66)
at com.sonicsw.xqimpl.service.wsinvk.WSInvocationComponent.service(WSInvocationComponent.java:37)

Only after I’ve placed wsdl-file to Sonic file system, this error disappeared
(and another one appeared 8-).
I don’t think it’s good solution, but it’s working!

Next error message looked this way:
[10/10/25 16:39:40] ID=ESB6 (warning) Trace follows…
javax.jms.JMSSecurityException: Inauthentic Client
at
progress.message.jimpl.JMSExceptionUtil.createJMSSecurityException(JMSExceptionUtil.java:134)
at
progress.message.jimpl.JMSExceptionUtil.createJMSSecurityException(JMSExceptionUtil.java:117)
at
progress.message.jimpl.JMSExceptionUtil.createJMSSecurityException(JMSExceptionUtil.java:103)
at progress.message.jimpl.Connection.(Connection.java:844)
at
progress.message.jclient.ConnectionFactory.createConnection(ConnectionFactory.java:2110)
at
com.sonicsw.xq.connector.jms.messagingbean.MessagingBean.connect(MessagingBean.java:857)
at
com.sonicsw.xq.connector.jms.messagingbean.MessagingBean.reconnect(MessagingBean.java:706)
at
com.sonicsw.xq.connector.jms.JMSEndpoint$EndpointConnection$CloseHandler.handleConnectionLoss(JMSEndpoint.java:823)
at
com.sonicsw.xq.connector.jms.JMSEndpoint$EndpointConnection$CloseHandler.run(JMSEndpoint.java:722)
Caused by: [2101] progress.message.client.EInauthenticClient: Inauthentic
Client
at
progress.message.zclient.Connection.connectWithRecoveryOpt(Connection.java:1007)
at
progress.message.zclient.ReconnectHelper.connectAndChaseSingleFailoverRedirect(ReconnectHelper.java:534)
at
progress.message.zclient.Connection.connect(Connection.java:1574)
at progress.message.jimpl.Connection.(Connection.java:650)

Here solution was – customizing of Sonic connection and using correct for Sonic login
and password.

So I started to connect from Sonic to needed web service, no problem!

But… Next I needed to transfer complex xml parameters to this web service:

<<xs:element name=”Insert”>>
<<xs:complexType>>
<<xs:sequence>>
<<xs:element name=”ID_1C”
type=”xs:string”/>>
<<xs:element name=”Staff_Name”
type=”xs:string”/>>
<<xs:element name=”Staff_ShortName”
type=”xs:string”/>>
<<xs:element name=”Staff_id”
type=”xs:string”/>>
<</xs:sequence>>
<</xs:complexType>>
<</xs:element>>

What to do? I did not find answer in the Sonic documentation.
Web service replied only “Fault String: Wrong format.” on all my attempts to communicate with him.

And here is solution to this problem.
I have to send him xml messages of this kind:

<<m:Insert xmlns:m=”Stock_Staff”>>
<<m:ID_1C>0</m:ID_1C>>
<<m:Staff_Name>Pedro Pedros Pedros</m:Staff_Name>>
<<m:Staff_ShortName>Pedro P.P.</m:Staff_ShortName>>
<<m:Staff_id>123456</m:Staff_id>>
<</m:Insert>>

So after transforming my parameters to the xml of this kind
I finally called web service with basic authentication and complex parameters
and received correct answers.

Sorry again for a lot of technical details.

Yuriy L.Gik

Posted in Uncategorized | Leave a comment

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Posted in Uncategorized | 1 Comment