[Axis2] Exception in loading logging module

"Manuela Vergerio" <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <!&!AAAAAAAAAAAYAAAAAAAAAOk5kzvS+vFCqV/O/uqVB7fCgAAAEAAAAAvvK9GENHdPqOm3OR+JtysBAAAAAA==@teaminformatica.ch>
Good morning,

 

I'm a software developer and I'm dealing with an open source Java Trasmitter
which sends and receives signed and encrypted xml files using SOAP envelope
(README.html in attachment is the documentation I've got and pom.xml is the
main maven xml compiler instructions).

 

I was able to run Java Trasmitter through Eclipse, I create a simple main
class (Lancia_Trasmitter.java) which just Ping the test server, here is the
log from Eclipse:

 

[INFO] Configuring client

[INFO] No services directory was found under
C:\Eclipse_Project\TRASMITTER\transmitter\target\test-classes\axis.

[INFO] Deploying module: addressing-1.6.2 -
file:/C:/Eclipse_Project/TRASMITTER/Jars/axis2-1.6.2.jar

[INFO] Deploying module: rahas-1.1 -
file:/C:/Eclipse_Project/TRASMITTER/Jars/axis2-rahas-1.1.jar

[INFO] Deploying module: metadataExchange-1.6.2-classpath-module -
file:/C:/Eclipse_Project/TRASMITTER/Jars/mex-1.6.2-classpath-module.jar

[INFO] Deploying module: logging-3.0.0 -
file:/C:/Eclipse_Project/TRASMITTER/Jars/logging-3.0.0.mar

[INFO] Deploying module: rampart-1.6.2 -
file:/C:/Eclipse_Project/TRASMITTER/Jars/rampart-1.6.2.mar

[INFO] Deploying module: rampart-3.0.0 -
file:/C:/Eclipse_Project/TRASMITTER/Jars/rampart-3.0.0.mar

[INFO] Configuring endpoint to
https://tst.itserve.ch/itserve/lohnstandard/testing/refapps2/receiver-webser
vice/20130514-0.0/SalaryDeclarationService

[INFO] Antwort Ping: <?xml version="1.0" encoding="UTF-8"
standalone="yes"?><PingResponse
xmlns:ns2="http://www.swissdec.ch/schema/sd/20130514/SalaryDeclarationContai
ner"
xmlns="http://www.swissdec.ch/schema/sd/20130514/SalaryDeclarationServiceTyp
es"
xmlns:ns3="http://www.swissdec.ch/schema/sd/20130514/SalaryDeclaration"><Sys
temDateTime>2014-05-14T10:40:16.177+02:00</SystemDateTime></PingResponse>

 

 

Now I need to run the same Lancia_Trasmitter.java class outside Eclipse. In
order to reach my goal I create a jar file with all java classes,
TI_Trasmitter.jar, and this are instructions I use from command line:
 
cd C:\WDProjet 14\Paghe_DEC\Trasmitter

 

"C:/Program Files/Java/jdk1.7.0_55/bin/TEST_SWISSDEC" -cp
.;./activation-1.1.jar;./antlr-2.7.7.jar;./axiom-api-1.2.13.jar;./axiom-dom-
1.2.13.jar;./axiom-impl-1.2.13.jar;./axis2-adb-codegen-1.6.2.jar;./axis2-ant
-plugin-1.6.2.jar;./axis2-clustering-1.6.2.jar;./axis2-codegen-1.6.2.jar;./a
xis2-corba-1.6.2.jar;./axis2-fastinfoset-1.6.2.jar;./axis2-jaxbri-1.6.2.jar;
./axis2-jibx-1.6.2.jar;./axis2-json-1.6.2.jar;./axis2-metadata-1.6.2.jar;./a
xis2-mtompolicy-1.6.2.jar;./axis2-saaj-1.6.2.jar;./axis2-soapmonitor-servlet
-1.6.2.jar;./axis2-spring-1.6.2.jar;./bcel-5.1.jar;./commons-cli-1.2.jar;./c
ommons-codec-1.3.jar;./commons-fileupload-1.2.jar;./commons-httpclient-3.1.j
ar;./commons-io-1.4.jar;./commons-logging-1.1.1.jar;./esapi-2.0GA.jar;./log4
j-1.2.15.jar;./bcprov-jdk15-140.jar;./commons-collections-3.1.jar;./commons-
lang-2.3.jar;./esapi-2.0GA.jar;./joda-time-1.6.2.jar;./opensaml-2.5.1-1.jar;
./openws-1.4.2-1.jar;./rampart-core-1.6.2.jar;./rampart-policy-1.6.2.jar;./r
ampart-trust-1.6.2.jar;./slf4j-api-1.5.5.jar;./slf4j-jcl-1.5.5.jar;./velocit
y-1.5.jar;./wss4j-1.6.4.jar;./xmlsec-1.4.6.jar;./xmltooling-1.3.2-1.jar;./ax
is2-rahas-1.1.jar;./axis2-jaxws-1.6.2.jar;./axis2-java2wsdl-1.6.2.jar;./axis
2-xmlbeans-1.6.2.jar;./httpcore-4.0.jar;./woden-api-1.0M9.jar;./commons-http
client-3.1-rc1.jar;./axis2-transport-http-1.6.2.jar;./axis2-transport-local-
1.6.2.jar;./axis2-adb-1.6.2.jar;./neethi-3.0.1.jar;./XmlSchema-1.4.7.jar;./w
sdl4j-1.6.2.jar;./transmitter-3.0.0.jar;./axis2-1.6.2;./axis2-kernel-1.6.2.j
ar;./axiom-api-1.2.14.jar;./axiom-dom-1.2.14.jar;./axiom-impl-1.2.14.jar;./c
ommons-lang-2.3.jar;./commons-logging-1.1.3.jar;./log4j.jar;./mail.jar;./jun
it-4.11.jar;./TI_Trasmitter.jar
ch/swissdec/samples/transmitter/Lancia_Trasmitter

 

Here exceptions I got:

[INFO] Configuring client

[INFO] Deploying module: rahas-1.1 - file:/C:/WDProjet
14/Paghe_DEC/Trasmitter/axis2-rahas-1.1.jar

[INFO] Deploying module: logging-3.0.0 - file:/C:/WDProjet
14/Paghe_DEC/Trasmitter/logging-3.0.0.mar

[INFO] Deploying module: rampart-3.0.0 - file:/C:/WDProjet
14/Paghe_DEC/Trasmitter/rampart-3.0.0.mar

[ERROR] Error loading logging module

ch.swissdec.samples.transmitter.TransmitterException: Error loading logging
module

        at
ch.swissdec.samples.transmitter.AbstractTransmitter.configure(AbstractTransm
itter.java:92)

        at
ch.swissdec.samples.transmitter.AbstractTransmitter.createServiceStub(Abstra
ctTransmitter.java:115)

        at
ch.swissdec.samples.transmitter.PingTransmitter.ping(PingTransmitter.java:30
)

        at
ch.swissdec.samples.transmitter.PingTest.testPing(PingTest.java:15)

        at
ch.swissdec.samples.transmitter.Lancia_Trasmitter.main(Lancia_Trasmitter.jav
a:29)

Caused by: org.apache.axis2.phaseresolver.PhaseException: Did not find the
desired phase 'Logging' while deploying handler 'InFlowLogHandler'.

        at
org.apache.axis2.phaseresolver.PhaseHolder.addHandler(PhaseHolder.java:75)

        at
org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToFlow(PhaseResolve
r.java:68)

        at
org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseRe
solver.java:104)

        at
org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseRe
solver.java:110)

        at
org.apache.axis2.description.AxisOperation.onEngage(AxisOperation.java:152)

        at
org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.ja
va:478)

        at
org.apache.axis2.description.AxisService.onEngage(AxisService.java:779)

        at
org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.ja
va:478)

        at
org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.ja
va:439)

        at
org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:361)

        at
ch.swissdec.samples.transmitter.AbstractTransmitter.configure(AbstractTransm
itter.java:90)

        ... 4 more

Exception in thread "main" junit.framework.AssertionFailedError: Error
loading logging module

        at junit.framework.Assert.fail(Assert.java:57)

        at junit.framework.TestCase.fail(TestCase.java:227)

        at
ch.swissdec.samples.transmitter.PingTest.testPing(PingTest.java:31)

        at
ch.swissdec.samples.transmitter.Lancia_Trasmitter.main(Lancia_Trasmitter.jav
a:29)

 

I attach:

-          AbstractTransmitter.java (the error is at line 92
AbstractTransmitter.java:92)

-          LoggingModule.java

-          LogHandler.java

-          logging-3.0.0.mar  (the result I obtain after compiling logging
part with maven)

 

 

I really don't understand why I always got error:  "Error loading logging
module", what's wrong in my command line??

 

Thanks very much in advance for your help!

Best Regards,

Manuela Vergerio

Senior Software Analyst & Developer

 



Via Roncaglia 3 | CH-6883 Novazzano, Switzerland

Tel +41 91 922 92 81 | fax +41 91 923 27 56 | Skype: manuela_team

 <http://www.teaminformatica.ch/> http://www.teaminformatica.ch

 

This message, including attachments, is strictly confidential and subjected
to applicable laws. If you receive this message by mistake, please notify
the sender then delete and destroy the original message, any attachment and
all copies. You should not copy, forward, and/or disclose the message, in
whole or in part, without permission of sender.

P Please consider the environment before printing this email, make sure that
it's necessary.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
image001.png (image/png, 3.2 KB) - not displayed
LoggingModule.java (application/octet-stream, 1.5 KB) - not displayed
LogHandler.java (application/octet-stream, 3.3 KB) - not displayed
logging-3.0.0.mar (application/octet-stream, 7 KB) - not displayed
README.html (text/html, 27.4 KB)
<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Java Axis 2 Transmitter Sample 3.0.0</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.73.2"><meta name="description" content="Sample for Lohnstandard-CH (ELM V4.0) Transmitter using the Apache Axis2 Java Axis 2 webservices stack and a JAXB2 JAXB2 binding. It uses Apache Rampart Rampart to implement the WS-Security requirements."></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="d0e2"></a>Java Axis 2 Transmitter Sample 3.0.0</h1></div><div><h3 class="subtitle"><i>Swissdec Lohnstandard</i></h3></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="orgname">Swissdec</span></h3></div></div></div><div><p class="pubdate">2013-10-29</p></div><div><div class="abstract"><p class="title"><b>Abstract</b></p><p>Sample for Lohnstandard-CH (ELM V4.0) Transmitter using the Apache Axis2 Java <sup>[<a name="d0e17" href="#ftn.d0e17" class="footnote">1</a>]</sup> webservices stack and a JAXB2 <sup>[<a name="d0e24" href="#ftn.d0e24" class="footnote">2</a>]</sup> binding. It uses Apache Rampart <sup>[<a name="d0e31" href="#ftn.d0e31" class="footnote">3</a>]</sup> to implement the WS-Security requirements.</p><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.d0e17" href="#d0e17" class="para">1</a>] </sup>
                        <a class="link" href="http://ws.apache.org/axis2/">Axis 2</a>
                    </p></div><div class="footnote"><p><sup>[<a name="ftn.d0e24" href="#d0e24" class="para">2</a>] </sup>
                        <a class="link" href="https://jaxb.dev.java.net/">JAXB2</a>
                    </p></div><div class="footnote"><p><sup>[<a name="ftn.d0e31" href="#d0e31" class="para">3</a>] </sup>
                        <a class="link" href="http://ws.apache.org/rampart/">Rampart</a>
                    </p></div></div></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#d0e38">Installation Prerequisites</a></span></dt><dt><span class="section"><a href="#d0e95">Dependent Module Versions</a></span></dt><dt><span class="section"><a href="#d0e100">Transmitter Module</a></span></dt><dd><dl><dt><span class="section"><a href="#d0e116">Binding</a></span></dt><dt><span class="section"><a href="#d0e129">Ping Operation</a></span></dt><dt><span class="section"><a href="#d0e143">CheckInteroperability Operation</a></span></dt><dt><span class="section"><a href="#d0e168">DeclareSalary Operation</a></span></dt></dl></dd><dt><span class="section"><a href="#d0e196">Logging Module</a></span></dt><dt><span class="section"><a href="#d0e212">Build</a></span></dt><dt><span class="section"><a href="#d0e242">Configuration</a></span></dt><dt><span class="section"><a href="#d0e441">Running</a></span></dt><dt><span class="section"><a href="#d0e501">Security</a></span></dt><dt><span class="section"><a href="#d0e540">Documentation</a></span></dt><dt><span class="section"><a href="#d0e551">Redistribution</a></span></dt><dt><span class="section"><a href="#d0e556">Support</a></span></dt><dt><span class="section"><a href="#d0e564">Issues</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e38"></a>Installation Prerequisites</h2></div></div></div><p> The following table lists the software requirements for the Axis2 sample application </p><div class="itemizedlist"><ul type="disc"><li><p>
                        <span class="emphasis"><em>Java 1.7</em></span> or later. </p></li><li><p>
                        <span class="emphasis"><em>Maven 3.0.5</em></span>
                        <sup>[<a name="d0e56" href="#ftn.d0e56" class="footnote">4</a>]</sup> The build is tested with Maven 3.0.5. Further build and runtime
                        dependencies are defined in the <span class="emphasis"><em>pom.xml</em></span> and are
                        resolved during the build. Refer to a in-depth Maven 2 or Maven 3 Howto
                        Guide <sup>[<a name="d0e66" href="#ftn.d0e66" class="footnote">5</a>]</sup>
                        <sup>[<a name="d0e73" href="#ftn.d0e73" class="footnote">6</a>]</sup>. To show all direct and transitive dependencies, use <code class="code">mvn
                            dependency:tree</code>.</p></li><li><p>
                        <span class="emphasis"><em>Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction
                            Policy Files 7 </em></span>
                        <sup>[<a name="d0e87" href="#ftn.d0e87" class="footnote">7</a>]</sup> . </p></li></ul></div><p>
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e95"></a>Dependent Module Versions</h2></div></div></div><p>Please see the pom.xml files for the versions of the dependent modules used in this
            transmitter sample. Be aware of changes if you use different/newer versions.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e100"></a>Transmitter Module</h2></div></div></div><p> Shows how to configure Axis2 with a JAXB2 schema binding and engaging the
                <span class="emphasis"><em>Rampart</em></span> (WSS) and custom <span class="emphasis"><em>Logging</em></span> module.
            Rampart is the security module used in Axis2. It secures SOAP messages according to
            specifications in the WS-Security stack. Common functionality for all three operations
            can be found in the <code class="code">ch.swissdec.samples.transmitter.AbstractTransmitter</code>
            class. </p><p> We use the asynchronous invocations of the client stub class with a callback handler
            in this example. This is useful to invoke operations in the background and not block the
            user interface of the application while the potentially lengthy network I/O is in
            progress. </p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e116"></a>Binding</h3></div></div></div><p>JAXB2 binding classes are generated from the XML Schema and written to
                    <span class="emphasis"><em>src/main/java/ch/swissdec/schema</em></span> of the transmitter module.
                If missing, they are regenerated on demand during the
                    <span class="emphasis"><em>generate-sources</em></span> phase of the Maven build. </p><p> The binding classes allow you to work in the object world without worrying about
                the exact XML structure which is marshalled into the SOAP message. For the purpose
                of this example, we unmarshall a static ELM XML instance document instead of
                manually setting the properties on the XML binding classes. Typically in your
                application you will gather the data from a database instead. </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e129"></a>Ping Operation</h3></div></div></div><p>The <code class="code">ch.swissdec.samples.transmitter.PingTransmitter</code> class does
                    <span class="emphasis"><em>not</em></span> inherit from the
                    <code class="code">ch.swissdec.samples.transmitter.SecureTransmitter</code> and therefore
                requests are neither signed nor encrypted. </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e143"></a>CheckInteroperability Operation</h3></div></div></div><p>The <code class="code">ch.swissdec.samples.transmitter.CheckInteroperabilityTransmitter</code>
                class descends from the
                    <code class="code">ch.swissdec.samples.transmitter.SecureTransmitter</code> and therefore
                requests are signed and encrypted depending on the policy configuration
                    in<span class="emphasis"><em>policy.xml</em></span>. </p><p>Refer to the <code class="code">ch.swissdec.samples.transmitter.TransmitterTest</code> class in
                    <span class="emphasis"><em>test/java</em></span> directory of the transmitter module to see how to
                check the the <code class="code">CheckInteroperabilityResponseType</code> in the response.
            </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e168"></a>DeclareSalary Operation</h3></div></div></div><p>The <code class="code">ch.swissdec.samples.transmitter.DeclareSalaryTransmitter</code> class
                descends from the <code class="code">ch.swissdec.samples.transmitter.SecureTransmitter</code> and
                therefore requests are signed and encrypted depending on the policy configuration
                    in<span class="emphasis"><em>policy.xml</em></span>. </p><p>Refer to the <code class="code">ch.swissdec.samples.transmitter.TransmitterTest</code> class in
                    <span class="emphasis"><em>test/java</em></span> directory of the transmitter module to see how to
                read the completion credentials from the <code class="code">AccessInformationType</code> in the
                response. Make sure to handle a <code class="code">SalaryDeclarationFault</code> and read its
                notification messages to be displayed to the user appropriately as shown in the test
                class and not just like any other remote exception. </p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e196"></a>Logging Module</h2></div></div></div><p>The logging module is used to demonstrate an archiving feature of requests and
            responses. The logging module is a simple Axis2 handler that is engaged in the in and
            out flow phase orders. Refer to the<code class="code">
    &lt;phase name="Logging"/&gt;
    
            </code>references in the <span class="emphasis"><em>axis2.xml</em></span> configuration file of the
            transmitter module. In this configuration, messages are logged before the security phase
            in the incoming flow and after the security phase in the outgoing message flow. </p><p> The archive directory is created if missing and can be configured using the
                <code class="code">logging.archive</code> property. </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e212"></a>Build</h2></div></div></div><p> This example uses a multimodule project structure including two modules. Use
            </p><pre class="programlisting">
                mvn install -Dmaven.test.skip
            </pre><p>
            from the project root directory to build and install both modules in your local
            repository. You find the build result in the <span class="emphasis"><em>target</em></span> directory of
            the two modules. The <code class="code">-Dmaven.test.skip</code> flag will make the build without
            running any testcase. </p><p> For consecutive builds, add the <code class="code">-o</code> flag to work offline for better build
            performance. </p><pre class="programlisting">
                mvn install -Dmaven.test.skip -o
            </pre><p>
            
            
            
            
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e242"></a>Configuration</h2></div></div></div><p>This refers to the configuration options of the transmitter module. Options are loaded
            at runtime from the file <span class="emphasis"><em>properties.xml</em></span> in the classpath. </p><div class="itemizedlist"><ul type="disc"><li><p> Ensure that you configured a correct webservice endpoint. By default the
                    configured endpoint points to the Reference Applications Receiver <sup>[<a name="d0e254" href="#ftn.d0e254" class="footnote">8</a>]</sup> . It can also be configured in code using
                        <code class="code">ch.swissdec.samples.transmitter.AbstractTransmitter#setEndpoint(String)</code>
                </p><p> Property name: <code class="code">endpoint.url</code>
                </p><p> Default value: <code class="code">
                        <a class="link" href="https://tst.itserve.ch/itserve/lohnstandard/testing/refapps2/receiver-webservice/20130514-0.0/SalaryDeclarationService">
                            https://tst.itserve.ch/itserve/lohnstandard/testing/refapps2/receiver-webservice/20130514-0.0/SalaryDeclarationService
                        </a>
                    </code>
                </p></li><li><p> Change the default Monitoring ID if you want to configure the response
                    behaviour of the receiver in the Salary Declaration Reference Application <sup>[<a name="d0e280" href="#ftn.d0e280" class="footnote">9</a>]</sup> . </p><p> Property name: <code class="code">monitoring.id</code>
                </p><p> Default value: <code class="code">default</code>
                </p></li><li><p>Boolean value indicating if the <code class="code">TestCase</code> element should be added
                    to the request context.</p><p> Property name: <code class="code">testcase</code>
                </p><p> Default value: <code class="code">true</code>
                </p></li><li><p> By default, all messages are logged to a directory named
                        <span class="emphasis"><em>archive</em></span> of the transmitter module. See the logging
                    archive configuration option in <span class="emphasis"><em>properties.xml</em></span>
                </p><p> Property name: <code class="code">logging.archive</code>
                </p><p> Default value: <code class="code">archive</code> which is the directory name relative to
                    the current working directory where the <code class="code">java</code> executable is launched
                    from. </p></li><li><p>Default parameter for the <code class="code">CheckInteroperability</code> operation if not
                    passed exlicity in the method call. See
                        <code class="code">ch.swissdec.samples.transmitter.CheckInteroperabilityTransmitter</code>
                </p><p> Property name: <code class="code">interop.firstoperand</code>
                </p><p> Default value: <code class="code">999000000000.00</code>
                </p></li><li><p>Default parameter for the <code class="code">CheckInteroperability</code> operation if not
                    passed exlicity in the method call. See
                        <code class="code">ch.swissdec.samples.transmitter.CheckInteroperabilityTransmitter</code>
                </p><p> Property name: <code class="code">interop.secondoperand</code>
                </p><p> Default value: <code class="code">10.50</code>
                </p></li><li><p>Default parameter for the <code class="code">CheckInteroperability</code> operation if not
                    passed exlicity in the method call. See
                        <code class="code">ch.swissdec.samples.transmitter.CheckInteroperabilityTransmitter</code>
                </p><p> Property name: <code class="code">interop.umlautstring</code>
                </p><p> Default value: <code class="code">&Auml;&Euml;&Ouml;&Uuml;&Aacute;&Eacute;&Oacute;&Uacute;&Agrave;&Egrave;&Ograve;&Ugrave;&Acirc;&Ecirc;&Ocirc;&Ucirc;</code>
                </p></li><li><p>Default parameter for the <code class="code">Ping</code> operation if not passed exlicity
                    in the method call. See
                        <code class="code">ch.swissdec.samples.transmitter.PingTransmitter</code>
                </p><p> Property name: <code class="code">ping.echo</code>
                </p><p> Default value: <code class="code">Echo</code>
                </p></li><li><p>User Agent Configuration matching your application identifiers</p><p>
                    <code class="code">
                        
                        &lt;entry key="ua.name"&gt;Swissdec Axis2 Sample&lt;/entry&gt;
        
                    </code>
                </p><p>
                    <code class="code">
                        
                        &lt;entry key="ua.producer"&gt;itServe AG&lt;/entry&gt;
        
                    </code>
                </p><p>
                    <code class="code">
                        
                        &lt;entry key="ua.version"&gt;3.0.0&lt;/entry&gt;
        
                    </code>
                </p><p>
                    <code class="code">
                        
                        &lt;entry key="ua.elmStdVersion"&gt;4.0&lt;/entry&gt;
        
                    </code>
                </p><p> Swissdec Ceritficate key for your application: </p><p>
                    <code class="code">
                        
                        &lt;entry key="ua.certificate"&gt;Invalid&lt;/entry&gt;
        
                    </code>
                </p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e441"></a>Running</h2></div></div></div><p> To run all test methods of the
                <code class="code">ch.swissdec.samples.transmitter.TransmitterTest</code> class, use
            </p><pre class="programlisting">
                mvn test
            </pre><p>
        </p><p> You can find the loggged messages in the <span class="emphasis"><em>archive</em></span> directory of
            the transmitter module by default. The following operations as defined in the WSDL are
            invoked: </p><div class="itemizedlist"><ul type="disc"><li><p>
                        <code class="code">Ping</code>
                    </p><p> Refer to the <code class="code">testTestPing</code> method implementation of the
                            <code class="code">ch.swissdec.samples.transmitter.TransmitterTest</code> class.
                    </p></li><li><p>
                        <code class="code">CheckInteroperability</code>
                    </p><p> Refer to the <code class="code">testCheckInteroperability</code> method implementation
                        of the <code class="code">ch.swissdec.samples.transmitter.TransmitterTest</code> class.
                    </p></li><li><p>
                        <code class="code">DeclareSalary</code>
                    </p><p> Refer to the <code class="code">testDeclareSalary</code> method implementation of the
                            <code class="code">ch.swissdec.samples.transmitter.TransmitterTest</code> class.
                    </p></li></ul></div><p>
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e501"></a>Security</h2></div></div></div><p> You can disable encryption by modifying the <span class="emphasis"><em>policy.xml</em></span> file in
            in the <span class="emphasis"><em>src/main/resources/security</em></span> directory of the transmitter
            module. Delete <code class="code">&lt;sp:Body/&gt;</code> from the EncryptedParts section. </p><p> Replace the Java keystore at <span class="emphasis"><em>resources/security/transmitter.jks</em></span>
            to use your own certificates you get from Swissdec. Make sure to adjust the alias and
            password setting in the <code class="code">RampartConfig</code> section of the
                <span class="emphasis"><em>policy.xml</em></span> file. Use <span class="emphasis"><em>keytool</em></span> from your
            Java distribution to manipulate the Keystore. Do change the
            <span class="emphasis"><em>user</em></span>-entries as well. Mostly these and the alias correspond.</p><p>You <span class="emphasis"><em>MUST</em></span> change the password to read the certificate from the
            keystore in the class
            <code class="code">ch.swissdec.samples.transmitter.wss.PasswordCallback</code>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e540"></a>Documentation</h2></div></div></div><p> To generate a documentation report, use
            </p><pre class="programlisting">
                mvn site:stage
            </pre><p> You find
            the HTML documentation in <span class="emphasis"><em>target/site</em></span> including Javadoc HTML.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e551"></a>Redistribution</h2></div></div></div><p>You are free to redistribute any parts of this sample with your application.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e556"></a>Support</h2></div></div></div><p>If you need assistance in using this application you can contact the technical support
            by email: <code class="email">&lt;<a class="email" href="mailto:[email protected]">[email protected]</a>&gt;</code>
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e564"></a>Issues</h2></div></div></div><p>
            </p><div class="itemizedlist"><ul type="disc"><li><p> Version 1.6.2 of Axis 2 (which currently is the latest stable version):
                        No issue is known so far. Homepage:<sup>[<a name="d0e573" href="#ftn.d0e573" class="footnote">10</a>]</sup>
                    </p></li><li><p> The JAXB binding does not correctly marshall (serialize) instances of
                            <code class="code">SalaryAmountType</code> that have a <code class="code">xs:decimal</code>
                        pattern restriction. We include a <span class="emphasis"><em>jaxb-binding.xjb</em></span> file
                        that is included when generating the JAXB binding sources referencing custom
                        classes in the <code class="code">ch.swissdec.samples.transmitter.binding</code> package
                        to marshall these types. </p></li><li><p> The JAXB unmarshalling is incomplete if the response is unencrypted using
                        the Apache Rampart handler and the response is read from the Axiom StAX
                        reader implementation. A workaround is implemented in
                            <code class="code">SalaryDeclarationServiceStub#fromOM</code>.</p></li><li><p> Further generation bugs exist that make the class
                            <code class="code">SalaryDeclarationServiceStub</code> not usable from the start.
                        Please use the delivered class <code class="code">MySalaryDeclarationServiceStub</code>.
                    </p></li><li><p>
                        <code class="code">java.security.InvalidKeyException: Illegal key size or default
                            parameters</code> exception. You have to download the JCE Unlimited
                        Strength Jurisdiction Policy files from sun and replace the existing ones.
                        Download the Java Cryptography Extension (JCE) Unlimited Strength
                        Jurisdiction Policy Files corresponding to your JDK version and extract the
                        jar files <span class="emphasis"><em>local_policy.jar</em></span> and
                            <span class="emphasis"><em>US_export_policy.jar</em></span> to
                            <span class="emphasis"><em>$JAVA_HOME/jre/lib/security</em></span>. </p></li><li><p>Tests throw an error <code class="code">org.apache.axis2.AxisFault: The timestamp could
                            not be validated</code></p><p>One of the reasons of this error can be a time gap between client and
                        server. If so, you can ajust the following points:</p><div class="orderedlist"><ol type="1"><li><p> Insure your system time is correct. Be aware that already
                                    minimal differences from official time might cause a
                                    failure.</p></li><li><p>You can ajust the <code class="code">&lt;ramp:timestampMaxSkew&gt;</code>
                                    option in <code class="code">police.xml</code> file. This parameter allows to
                                    specify the tolerence limit for timestamps created slightly
                                    ahead of the receiver's time.</p></li></ol></div><p>Be very careful with the second option! You should rather ajust system time than having a large timestampMaxSkew value.</p></li></ul></div><p>
        </p></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.d0e17" href="#d0e17" class="para">1</a>] </sup>
                        <a class="link" href="http://ws.apache.org/axis2/">Axis 2</a>
                    </p></div><div class="footnote"><p><sup>[<a name="ftn.d0e24" href="#d0e24" class="para">2</a>] </sup>
                        <a class="link" href="https://jaxb.dev.java.net/">JAXB2</a>
                    </p></div><div class="footnote"><p><sup>[<a name="ftn.d0e31" href="#d0e31" class="para">3</a>] </sup>
                        <a class="link" href="http://ws.apache.org/rampart/">Rampart</a>
                    </p></div><div class="footnote"><p><sup>[<a name="ftn.d0e56" href="#d0e56" class="para">4</a>] </sup>
                                <a class="link" href="http://maven.apache.org/">Maven 3</a>
                            </p></div><div class="footnote"><p><sup>[<a name="ftn.d0e66" href="#d0e66" class="para">5</a>] </sup>
                                <a class="link" href="http://repo.exist.com/dist/maestro/1.7.0/BetterBuildsWithMaven.pdf"> Better Builds With Maven </a>
                            </p></div><div class="footnote"><p><sup>[<a name="ftn.d0e73" href="#d0e73" class="para">6</a>] </sup><a class="link" href="http://maven.apache.org/guides/index.html">Maven
                                    Documentation</a></p></div><div class="footnote"><p><sup>[<a name="ftn.d0e87" href="#d0e87" class="para">7</a>] </sup>
                                <a class="link" href="http://java.sun.com/javase/downloads/index.jsp"> Java
                                    Cryptography Extension (JCE) Unlimited Strength Jurisdiction
                                    Policy Files 7 </a>
                            </p></div><div class="footnote"><p><sup>[<a name="ftn.d0e254" href="#d0e254" class="para">8</a>] </sup>
                            <a class="link" href="https://tst.itserve.ch/itserve/lohnstandard/testing/refapps2/receiver-webservice/20130514-0.0/SalaryDeclarationService">
                                https://tst.itserve.ch/itserve/lohnstandard/testing/refapps2/receiver-webservice/20130514-0.0/SalaryDeclarationService
                            </a>
                        </p></div><div class="footnote"><p><sup>[<a name="ftn.d0e280" href="#d0e280" class="para">9</a>] </sup>
                            <a class="link" href="https://tst.itserve.ch/itserve/lohnstandard/testing/refapps2/receiver/20130514-0.0/">
                                https://tst.itserve.ch/itserve/lohnstandard/testing/refapps2/receiver/20130514-0.0/
                            </a>
                        </p></div><div class="footnote"><p><sup>[<a name="ftn.d0e573" href="#d0e573" class="para">10</a>] </sup>
                                <a class="link" href="http://axis.apache.org/axis2/java/core/index.html">AXIS 2</a>
                            </p></div></div></div></body></html>
pom.xml (text/xml, 16.4 KB)
<?xml version="1.0" encoding="UTF-8"?>
<!--
    ~ Copyright 1996-2013 itServe AG. All rights reserved.
    ~
    ~ This software is the proprietary information of itServe AG
    ~ Bern Switzerland. Use is subject to license terms.
    ~
    -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>ch.swissdec.samples.axis2</groupId>
    <artifactId>SwissdecTransmitterSample</artifactId>
    <version>${projectVersion}</version>
    <packaging>pom</packaging>
    <name>Swissdec Lohnstandard Java Axis 2 Transmitter Sample</name>
    <url>http://swissdec.ch</url>
    <inceptionYear>2010</inceptionYear>
    <modules>
        <module>logging</module>
        <module>security</module>
        <module>transmitter</module>
    </modules>

    <properties>
        <targetJdk>1.7</targetJdk>
        <projectVersion>3.0.0</projectVersion>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <axis2.version>1.6.2</axis2.version>
        <axiom.version>1.2.13</axiom.version>
        <jaxb.version>2.1.13</jaxb.version>
        <rampart.version>1.6.2</rampart.version>
    </properties>

    <!-- Manage versions of transitive dependencies -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-impl</artifactId>
                <version>${jaxb.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-xjc</artifactId>
                <version>${jaxb.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>2.2.7</version>
            </dependency>

            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.4</version>
            </dependency>

            <dependency>
                <groupId>org.apache.neethi</groupId>
                <artifactId>neethi</artifactId>
                <version>3.0.2</version>
            </dependency>

            <dependency>
                <groupId>org.apache.axis2</groupId>
                <artifactId>addressing</artifactId>
                <version>${axis2.version}</version>
                <type>mar</type>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.ws.commons.axiom</groupId>
                <artifactId>axiom-api</artifactId>
                <version>${axiom.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.ws.commons.axiom</groupId>
                <artifactId>axiom-dom</artifactId>
                <version>${axiom.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.ws.commons.axiom</groupId>
                <artifactId>axiom-impl</artifactId>
                <version>${axiom.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2</artifactId>
                <version>${axis2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2-jaxbri</artifactId>
                <version>${axis2.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.axis2</groupId>
                <artifactId>mex</artifactId>
                <version>${axis2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2-transport-http</artifactId>
                <version>${axis2.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.rampart</groupId>
                <artifactId>rampart-core</artifactId>
                <version>${rampart.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-kernel</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-codegen</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-xmlbeans</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-adb-codegen</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-mtompolicy</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>commons-fileupload</groupId>
                        <artifactId>commons-fileupload</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.mail</groupId>
                        <artifactId>mail</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.ws.commons.axiom</groupId>
                        <artifactId>axiom-impl</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.ws.commons.axiom</groupId>
                        <artifactId>axiom-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.ws.commons.axiom</groupId>
                        <artifactId>axiom-dom</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.xalan</groupId>
                        <artifactId>xalan</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.rampart</groupId>
                <artifactId>rampart-trust</artifactId>
                <version>${rampart.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.xalan</groupId>
                        <artifactId>xalan</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.apache.santuario</groupId>
                <artifactId>xmlsec</artifactId>
                <version>1.5.3</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>2.7.1</version>
            <scope>compile</scope>
        </dependency>
        <!-- Logging -->
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <organization>
        <name>Swissdec</name>
        <url>http://swissdec.ch</url>
    </organization>
    <developers>
        <developer>
            <id>koch</id>
            <timezone>UTC+1</timezone>
            <name>Thomas Koch</name>
            <email>[email protected]</email>
            <organization>itServe AG</organization>
            <organizationUrl>http://www.itserve.ch</organizationUrl>
        </developer>
    </developers>
    <build>
        <defaultGoal>package</defaultGoal>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/properties.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>**</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <inherited>true</inherited>
                <configuration>
                    <source>${targetJdk}</source>
                    <target>${targetJdk}</target>
                    <meminitial>256m</meminitial>
                    <maxmem>1024m</maxmem>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.3</version>
                <inherited>true</inherited>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>2.0-beta-7</version>
                <inherited>true</inherited>
                <configuration>
                    <outputEncoding>UTF-8</outputEncoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2-beta-3</version>
                <inherited>false</inherited>
                <configuration>
                    <finalName>sample-transmitter-axis2-${project.version}</finalName>
                    <descriptors>
                        <descriptor>${basedir}/assembly.xml</descriptor>
                    </descriptors>
                    <appendAssemblyId>false</appendAssemblyId>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.4.3</version>
                <inherited>true</inherited>
                <configuration>
                    <!--<argLine>-Xmx512M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</argLine>-->
                    <systemProperties>
                        <property>
                            <name>file.encoding</name>
                            <value>UTF-8</value>
                        </property>
                    </systemProperties>
                    <enableAssertions>false</enableAssertions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>
                <inherited>true</inherited>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Implementation-Version>${project.version}</Implementation-Version>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.agilejava.docbkx</groupId>
                <artifactId>docbkx-maven-plugin</artifactId>
                <version>2.0.9</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate-html</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.docbook</groupId>
                        <artifactId>docbook-xml</artifactId>
                        <version>4.4</version>
                        <scope>runtime</scope>
                    </dependency>
                </dependencies>
                <configuration>
                    <includes>*.xml</includes>
                    <sourceDirectory>${basedir}/doc</sourceDirectory>
                    <targetDirectory>${basedir}</targetDirectory>
                    <imgSrcPath>file:///${basedir}/doc</imgSrcPath>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.4.3</version>
                <inherited>true</inherited>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report-only</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.5</version>
                <inherited>true</inherited>
                <configuration>
                    <source>${targetJdk}</source>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.1.1</version>
                <inherited>true</inherited>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>summary</report>
                            <report>dependencies</report>
                            <report>dependency-convergence</report>
                            <report>plugin-management</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <repositories>
        <repository>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </releases>
            <id>shibboleth</id>
            <name>new shibboleth repo location</name>
            <url>https://build.shibboleth.net/nexus/content/groups/public</url>
        </repository>
        <repository>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>never</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </snapshots>
            <id>apache-snapshots</id>
            <name>Apache Maven2 SNAPSHOTS</name>
            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
        </repository>
        <repository>
            <releases>
                <enabled>false</enabled>
                <updatePolicy>never</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </releases>
            <id>apache-ws-snapshots2</id>
            <name>Apache ws.zones - 2</name>
            <url>http://ws.zones.apache.org/repository2</url>
        </repository>
    </repositories>
</project>
AbstractTransmitter.java (application/octet-stream, 7 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.