You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Megadeth <ca...@gmail.com> on 2012/06/26 09:45:34 UTC

JAX-WS client and service with Rampart module for signing messages

Hi, 

I created java project. It is client of my jax-ws web service and I use it
for signing messages. 
I renamed rampart.mar to rampart.jar and put it into classpath of java
project (also addressing and rahas mars). I am not sure if this is correct,
but it works for me. 

In client I put this: 

String axis2xml = "C:/.../conf/client.axis2.xml"; 
System.setProperty(Constants.AXIS2_CONF, axis2xml); 
FileSystemConfigurator configurator = new FileSystemConfigurator(null,
axis2xml); 
ClientConfigurationFactory factory = new
ClientConfigurationFactory(configurator); 
MetadataFactoryRegistry.setFactory(ClientConfigurationFactory.class,
factory); 

JaxwsLibrary service = new JaxwsLibrary(); 
ESomePortType stub = service.getLibrary(); 

BindingProvider provider = (BindingProvider)stub; 

Policy policy = loadPolicy("sign-policy-client.xml"); 
provider.getRequestContext().put(RampartMessageData.KEY_RAMPART_POLICY,
policy); 

provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, 
"http://localhost:8080........../MyWebService"); 

I realized that I MUST set factory BEFORE creating service object. If you do
not, then Axis will not be configured properly. 
As you can see, my entire policy is in separate xml. I also put this policy
into wsdl, but I am not sure if this one (from wsdl) is used anywhere. 

Then I generate service jar: 
<jar jarfile="${service-archive-name}.jar">  
<fileset dir="${compiled-code}"/>  
</jar>  

"compiled-code" is directory where resides classes generated by wsimport. 
Then I put this into axis2.xml on the service side (I am not sure this is
correct): 

<parameter name="OutflowSecurity">  
<action>  
<items>Signature</items>  
<user>serveralias</user>  
<passwordCallbackClass>hr.bla.bla.PWServiceHandler</passwordCallbackClass>  
<signaturePropFile>crypto.properties</signaturePropFile>  
</action>  
</parameter>  

<parameter name="InflowSecurity">  
<action>  
<items>Signature</items>  
<passwordCallbackClass>hr.bla.bla.PWServiceHandler</passwordCallbackClass>  
<signaturePropFile>crypto.properties</signaturePropFile>  
</action>  
</parameter>  

Also, I put crypto.properties, My.jks and handler class into MyUtil.jar. 
Then MyUtil.jar is added to /WEB-INF/lib. 

When I start all this (WebSphere 6.1, Rational Software Developer with
TCP/IP monitoring, Axis 1.6.0 and Rampart 1.6.0; axis and rampart versions
MUST be the same) client sends signed message to web service. From the web
service side this message is validated, but when server sends
acknowledgement message something goes wrong. 
I can see from debugger that password handler (on service side) do his job,
but after that I see this (without security everything works ok): 

[2012.06.18 10:08:52:000 CEST] 0000001f ServletWrappe E SRVE0068E: Uncaught
exception thrown in one of the service methods of the servlet: AxisServlet.
Exception thrown : java.lang.NullPointerException 
at
org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:281) 
at
org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:255) 
at
org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:717) 
at
org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:414) 
at
org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:90) 
at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147) 
at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65) 
at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340) 
at org.apache.axis2.engine.Phase.invoke(Phase.java:313) 
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262) 
at org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:516) 
at
org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:433) 
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:216) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:501) 
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464) 
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90) 
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744) 
at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455) 
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:279) 
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) 
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) 
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) 
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) 
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) 
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136) 
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195) 
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743) 
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873) 
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469) 

I realize that above exception is because I forgot to load policy for
service. 
But where I need to put it ? 
I know that somehow I can put policy inside axis2.xml, but I don't know how.   

Using this: 

https://issues.apache.org/jira/browse/AXIS2-4611?p...em.issuetabpanels:all-tabpanel  
I tried to create aar and put policy in service.xml. 
But for that I need axis2 1.7 and rampart 1.7. (The same thing is with 1.6.0
versions). 
I can see my service from axis console, and also I can open wsdl by click on
web service link. 

After I start client TCP/IP monitor gave me: 
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header
xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
soapenv:mustUnderstand="1"><wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Timestamp-1"><wsu:Created>2012-06-18T14:45:29.000Z</wsu:Created><wsu:Expires>2012-06-18T14:50:29.000Z</wsu:Expires></wsu:Timestamp><wsse:BinarySecurityToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
wsu:Id="CertId-CFAD48F0CEE02316E613400307290001">MIICKzCCAZSgAwIBAgIET9nnZDANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJIUjENMAsGA1UEChMERmluYTETMBEGA1UECxMKUHJvZ3JhbWVyaTEnMCUGA1UEAxMeZHRvbWxqZW5vdmljMS5pbnRyYW5ldC5maW5hLmhyMB4XDTEyMDYxNDEzMzAxMloXDTEzMDYxNDEzMzAxMlowWjELMAkGA1UEBhMCSFIxDTALBgNVBAoTBEZpbmExEzARBgNVBAsTClByb2dyYW1lcmkxJzAlBgNVBAMTHmR0b21samVub3ZpYzEuaW50cmFuZXQuZmluYS5ocjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAu/FWX1RIOSHaVSMHMU/debHywi5PMkKXQISeWljpZ/by4T/HEQGFB9muJDnOTdHJ8ELF0s+r1RUAF/+mG5sD3UpUZeAmyP+haSQh5weD7Aj/OUf3g8S6/Ftk5OkS4XOaVWqJwhpkTrLa9Lgk2fQLpOW2Zsk0z62Cb87/VsYy42ECAwEAATANBgkqhkiG9w0BAQQFAAOBgQAJ0+fNH8o3BPV9JgQrjdJbeObRccNT7fIR3YtMgtm/Xp6/hqMAbS/qBkNsPx4VJImc8xjXnWdDr6I0+nsxTtCmw5FIPKKkYaYWxo3r/LZy6eZwcSfAzxWGVv4S4b8lIkZqLn2iBBKNEwDPr5dDtCMj5+SfvDmRo1Kp096K7iEqHw==</wsse:BinarySecurityToken><ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-2">  
<ds:SignedInfo>  
<ds:CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />  
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"
/>  
<ds:Reference URI="#Id-806760470">  
<ds:Transforms>  
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />  
</ds:Transforms>  
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />  
<dsigestValue>PZ7Tv3Iei2t9trchNcReIWIPqdg=</dsigestValue>  
</ds:Reference>  
<ds:Reference URI="#Timestamp-1">  
<ds:Transforms>  
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />  
</ds:Transforms>  
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />  
<dsigestValue>dW1lWCZA1zJ+aKHv7k6oIE7VcDE=</dsigestValue>  
</ds:Reference>  
</ds:SignedInfo>  
<ds:SignatureValue>  
Vw2alx+bvcoUqhtYKeYfNm4LEi6P1PBqJs2vDu9mzN4VghsLiYXQsADaK2S+izxNLIy+FwVuXn/z 
DI7tyPqZtZW6GXUGfl8fSJvDbxtcX7SWu8mQwzQGuK9gBQRLMkqEvB3Gh/YuNpD8htiU1jFM4jBw 
yhgIQco07s1R5B+yK5U= 
</ds:SignatureValue>  
<ds:KeyInfo Id="KeyId-CFAD48F0CEE02316E613400307290002">  
<wsse:SecurityTokenReference
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="STRId-CFAD48F0CEE02316E613400307290003"><wsse:Reference
URI="#CertId-CFAD48F0CEE02316E613400307290001"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
/></wsse:SecurityTokenReference>  
</ds:KeyInfo>  
</ds:Signature></wsse:Security><wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action><wsa:RelatesTo>urn:uuid:4a9625ed-87b6-4238-8fc8-2589f578edd9</wsa:RelatesTo></soapenv:Header><soapenv:Body
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Id-806760470"><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>java.lang.RuntimeException:
The service class cannot be found for this 
AxisService.</faultstring><detail
/></soapenv:Fault></soapenv:Body></soapenv:Envelope>  

I suppose that rampart now runs but without Axis doing web service method
call. 
Probably Axis can't find service class. Also debugger won't debug this class
in Eclipse. 

This is error from axis log:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
java.lang.RuntimeException: The service class cannot be found for this
AxisService.
	at
org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:1326)
	at
org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.demarshalFaultResponse(MethodMarshallerUtils.java:1052)
	at
org.apache.axis2.jaxws.marshaller.impl.alt.DocLitBareMethodMarshaller.demarshalFaultResponse(DocLitBareMethodMarshaller.java:415)
	at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.getFaultResponse(JAXWSProxyHandler.java:577)
	at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(JAXWSProxyHandler.java:520)
	at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:386)
	at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:171)
	at $Proxy28.sendOutgoingInvoice(Unknown Source)
	at
hr.fina.jaxws.invoicesStatusesService.client.WebServiceClient.main(WebServiceClient.java:92)

Do I need to comment some of this features in axis2.xml ? 
    
    <deployer extension=".class" directory="pojo"
class="org.apache.axis2.deployment.POJODeployer"/>
    <deployer extension=".jar" directory="servicejars" 
              class="org.apache.axis2.jaxws.framework.JAXWSDeployer"/>
    <deployer extension=".jar" directory="transports" 
              class="org.apache.axis2.deployment.TransportDeployer"/>

I read on web that this is some problem between axis2 engine, jdk 1.6 and
Websphere 6.1.
What to do next ?

Please, help me. 

Thanks.
-- 
View this message in context: http://old.nabble.com/JAX-WS-client-and-service-with-Rampart-module-for-signing-messages-tp34070987p34070987.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: JAX-WS client and service with Rampart module for signing messages

Posted by Martin Gainty <mg...@hotmail.com>.
policy errors:make sure your policy.xml contains userCertAlias element e.g.<ramp:userCertAlias>client2</ramp:userCertAlias>
missing ServiceClass in services.xml for example:<service>
 <parameter name="ServiceClass" locked="false">fu.Bar</parameter>is fu.Bar java class on your classpath http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Fcrun_classload.html hth
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 > Date: Tue, 26 Jun 2012 23:56:37 +0530
> Subject: Re: JAX-WS client and service with Rampart module for signing messages
> From: thejaka.amila@gmail.com
> To: java-user@axis.apache.org
> CC: axis-user@ws.apache.org
> 
> Hi Megadeth,
> 
> Please find some answers inline.
> 
> On Tue, Jun 26, 2012 at 1:15 PM, Megadeth <ca...@gmail.com> wrote:
> >
> > Hi,
> >
> > I created java project. It is client of my jax-ws web service and I use it
> > for signing messages.
> > I renamed rampart.mar to rampart.jar and put it into classpath of java
> > project (also addressing and rahas mars). I am not sure if this is correct,
> > but it works for me.
> 
> This is not the correct way to do. When creating the
> FileSystemConfigurator, you can give a repository path. There you can
> specify path to the axis2 repository (E.g :-
> /home/amila/development/apache/axis2/java/rampart/packs/axis2-1.6.2/repository).
> Rampart.mar should be there within repository in a folder called
> "modules".
> 
> >
> > In client I put this:
> >
> > String axis2xml = "C:/.../conf/client.axis2.xml";
> > System.setProperty(Constants.AXIS2_CONF, axis2xml);
> > FileSystemConfigurator configurator = new FileSystemConfigurator(null,
> > axis2xml);
> > ClientConfigurationFactory factory = new
> > ClientConfigurationFactory(configurator);
> > MetadataFactoryRegistry.setFactory(ClientConfigurationFactory.class,
> > factory);
> >
> > JaxwsLibrary service = new JaxwsLibrary();
> > ESomePortType stub = service.getLibrary();
> >
> > BindingProvider provider = (BindingProvider)stub;
> >
> > Policy policy = loadPolicy("sign-policy-client.xml");
> > provider.getRequestContext().put(RampartMessageData.KEY_RAMPART_POLICY,
> > policy);
> >
> > provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
> > "http://localhost:8080........../MyWebService");
> >
> > I realized that I MUST set factory BEFORE creating service object. If you do
> > not, then Axis will not be configured properly.
> > As you can see, my entire policy is in separate xml. I also put this policy
> > into wsdl, but I am not sure if this one (from wsdl) is used anywhere.
> >
> > Then I generate service jar:
> > <jar jarfile="${service-archive-name}.jar">
> > <fileset dir="${compiled-code}"/>
> > </jar>
> >
> > "compiled-code" is directory where resides classes generated by wsimport.
> > Then I put this into axis2.xml on the service side (I am not sure this is
> > correct):
> >
> > <parameter name="OutflowSecurity">
> > <action>
> > <items>Signature</items>
> > <user>serveralias</user>
> > <passwordCallbackClass>hr.bla.bla.PWServiceHandler</passwordCallbackClass>
> > <signaturePropFile>crypto.properties</signaturePropFile>
> > </action>
> > </parameter>
> >
> > <parameter name="InflowSecurity">
> > <action>
> > <items>Signature</items>
> > <passwordCallbackClass>hr.bla.bla.PWServiceHandler</passwordCallbackClass>
> > <signaturePropFile>crypto.properties</signaturePropFile>
> > </action>
> > </parameter>
> 
> Rampart supports 2 modes of operations.
> 1. Parameter based configurations
> 2. Policy based configurations
> 
> What you have defined above is parameter based configuration.
> Parameter based configuration is sort of obsolete. Therefore we
> recommend you to use policy based configurations. In addition you dont
> need to specify both to sign messages.
> 
> >
> > Also, I put crypto.properties, My.jks and handler class into MyUtil.jar.
> > Then MyUtil.jar is added to /WEB-INF/lib.
> >
> > When I start all this (WebSphere 6.1, Rational Software Developer with
> > TCP/IP monitoring, Axis 1.6.0 and Rampart 1.6.0; axis and rampart versions
> > MUST be the same) client sends signed message to web service. From the web
> > service side this message is validated, but when server sends
> > acknowledgement message something goes wrong.
> > I can see from debugger that password handler (on service side) do his job,
> > but after that I see this (without security everything works ok):
> >
> > [2012.06.18 10:08:52:000 CEST] 0000001f ServletWrappe E SRVE0068E: Uncaught
> > exception thrown in one of the service methods of the servlet: AxisServlet.
> > Exception thrown : java.lang.NullPointerException
> > at
> > org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:281)
> > at
> > org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:255)
> > at
> > org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:717)
> > at
> > org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:414)
> > at
> > org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:90)
> > at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)
> > at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
> > at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
> > at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
> > at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
> > at org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:516)
> > at
> > org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:433)
> > at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:216)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > at
> > com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
> > at
> > com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:501)
> > at
> > com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
> > at
> > com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
> > at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
> > at
> > com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
> > at
> > com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
> > at
> > com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
> > at
> > com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
> > at
> > com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:279)
> > at
> > com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
> > at
> > com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
> > at
> > com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
> > at
> > com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
> > at
> > com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
> > at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> > at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
> > at
> > com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
> > at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
> > at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
> >
> > I realize that above exception is because I forgot to load policy for
> > service.
> > But where I need to put it ?
> > I know that somehow I can put policy inside axis2.xml, but I don't know how.
> 
> You need to specify policy within the services.xml file.
> >
> > Using this:
> >
> > https://issues.apache.org/jira/browse/AXIS2-4611?p...em.issuetabpanels:all-tabpanel
> > I tried to create aar and put policy in service.xml.
> > But for that I need axis2 1.7 and rampart 1.7. (The same thing is with 1.6.0
> > versions).
> > I can see my service from axis console, and also I can open wsdl by click on
> > web service link.
> >
> > After I start client TCP/IP monitor gave me:
> > <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> > <soapenv:Header
> > xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsse:Security
> > xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
> > soapenv:mustUnderstand="1"><wsu:Timestamp
> > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> > wsu:Id="Timestamp-1"><wsu:Created>2012-06-18T14:45:29.000Z</wsu:Created><wsu:Expires>2012-06-18T14:50:29.000Z</wsu:Expires></wsu:Timestamp><wsse:BinarySecurityToken
> > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> > EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
> > ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
> > wsu:Id="CertId-CFAD48F0CEE02316E613400307290001">MIICKzCCAZSgAwIBAgIET9nnZDANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJIUjENMAsGA1UEChMERmluYTETMBEGA1UECxMKUHJvZ3JhbWVyaTEnMCUGA1UEAxMeZHRvbWxqZW5vdmljMS5pbnRyYW5ldC5maW5hLmhyMB4XDTEyMDYxNDEzMzAxMloXDTEzMDYxNDEzMzAxMlowWjELMAkGA1UEBhMCSFIxDTALBgNVBAoTBEZpbmExEzARBgNVBAsTClByb2dyYW1lcmkxJzAlBgNVBAMTHmR0b21samVub3ZpYzEuaW50cmFuZXQuZmluYS5ocjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAu/FWX1RIOSHaVSMHMU/debHywi5PMkKXQISeWljpZ/by4T/HEQGFB9muJDnOTdHJ8ELF0s+r1RUAF/+mG5sD3UpUZeAmyP+haSQh5weD7Aj/OUf3g8S6/Ftk5OkS4XOaVWqJwhpkTrLa9Lgk2fQLpOW2Zsk0z62Cb87/VsYy42ECAwEAATANBgkqhkiG9w0BAQQFAAOBgQAJ0+fNH8o3BPV9JgQrjdJbeObRccNT7fIR3YtMgtm/Xp6/hqMAbS/qBkNsPx4VJImc8xjXnWdDr6I0+nsxTtCmw5FIPKKkYaYWxo3r/LZy6eZwcSfAzxWGVv4S4b8lIkZqLn2iBBKNEwDPr5dDtCMj5+SfvDmRo1Kp096K7iEqHw==</wsse:BinarySecurityToken><ds:Signature
> > xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-2">
> > <ds:SignedInfo>
> > <ds:CanonicalizationMethod
> > Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
> > <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"
> > />
> > <ds:Reference URI="#Id-806760470">
> > <ds:Transforms>
> > <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
> > </ds:Transforms>
> > <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
> > <dsigestValue>PZ7Tv3Iei2t9trchNcReIWIPqdg=</dsigestValue>
> > </ds:Reference>
> > <ds:Reference URI="#Timestamp-1">
> > <ds:Transforms>
> > <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
> > </ds:Transforms>
> > <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
> > <dsigestValue>dW1lWCZA1zJ+aKHv7k6oIE7VcDE=</dsigestValue>
> > </ds:Reference>
> > </ds:SignedInfo>
> > <ds:SignatureValue>
> > Vw2alx+bvcoUqhtYKeYfNm4LEi6P1PBqJs2vDu9mzN4VghsLiYXQsADaK2S+izxNLIy+FwVuXn/z
> > DI7tyPqZtZW6GXUGfl8fSJvDbxtcX7SWu8mQwzQGuK9gBQRLMkqEvB3Gh/YuNpD8htiU1jFM4jBw
> > yhgIQco07s1R5B+yK5U=
> > </ds:SignatureValue>
> > <ds:KeyInfo Id="KeyId-CFAD48F0CEE02316E613400307290002">
> > <wsse:SecurityTokenReference
> > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> > wsu:Id="STRId-CFAD48F0CEE02316E613400307290003"><wsse:Reference
> > URI="#CertId-CFAD48F0CEE02316E613400307290001"
> > ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
> > /></wsse:SecurityTokenReference>
> > </ds:KeyInfo>
> > </ds:Signature></wsse:Security><wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action><wsa:RelatesTo>urn:uuid:4a9625ed-87b6-4238-8fc8-2589f578edd9</wsa:RelatesTo></soapenv:Header><soapenv:Body
> > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> > wsu:Id="Id-806760470"><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>java.lang.RuntimeException:
> > The service class cannot be found for this
> > AxisService.</faultstring><detail
> > /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
> >
> > I suppose that rampart now runs but without Axis doing web service method
> > call.
> > Probably Axis can't find service class. Also debugger won't debug this class
> > in Eclipse.
> >
> > This is error from axis log:
> > Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
> > java.lang.RuntimeException: The service class cannot be found for this
> > AxisService.
> 
> I am not quite sure why you are getting above error message. (Service
> class not deployed properly ?)
> 
> Thanks
> AmilaJ
> 
> >        at
> > org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:1326)
> >        at
> > org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.demarshalFaultResponse(MethodMarshallerUtils.java:1052)
> >        at
> > org.apache.axis2.jaxws.marshaller.impl.alt.DocLitBareMethodMarshaller.demarshalFaultResponse(DocLitBareMethodMarshaller.java:415)
> >        at
> > org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.getFaultResponse(JAXWSProxyHandler.java:577)
> >        at
> > org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(JAXWSProxyHandler.java:520)
> >        at
> > org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:386)
> >        at
> > org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:171)
> >        at $Proxy28.sendOutgoingInvoice(Unknown Source)
> >        at
> > hr.fina.jaxws.invoicesStatusesService.client.WebServiceClient.main(WebServiceClient.java:92)
> >
> > Do I need to comment some of this features in axis2.xml ?
> >
> >    <deployer extension=".class" directory="pojo"
> > class="org.apache.axis2.deployment.POJODeployer"/>
> >    <deployer extension=".jar" directory="servicejars"
> >              class="org.apache.axis2.jaxws.framework.JAXWSDeployer"/>
> >    <deployer extension=".jar" directory="transports"
> >              class="org.apache.axis2.deployment.TransportDeployer"/>
> >
> > I read on web that this is some problem between axis2 engine, jdk 1.6 and
> > Websphere 6.1.
> > What to do next ?
> >
> > Please, help me.
> >
> > Thanks.
> > --
> > View this message in context: http://old.nabble.com/JAX-WS-client-and-service-with-Rampart-module-for-signing-messages-tp34070987p34070987.html
> > Sent from the Axis - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> > For additional commands, e-mail: java-user-help@axis.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
 		 	   		  

Re: JAX-WS client and service with Rampart module for signing messages

Posted by Megadeth <ca...@gmail.com>.
Hi Amila,
Thanks for response. I reordered things about mars as you suggested and it
works ok. 
Yesterday I decided to try new path of investigation.
I installed Rational Software Architect 8.0.4 and WebSphere 7.0. Then I
fixed WebSphere and my actual version is now 7.0.0.23 (the last one).
Then project described in previous mail was imported, and some minor
configuration was done (classpath, module dependencies... due to diferrences
beetwen RSA versions).
I deployed project as aar and decided to try it with and without security. 
Policy was configured the same as before. It means, on client side it was
put in policy.xml and loaded when client was started. On the server side it
was put inside service.xml.

In the text below: 
	-	by "SECURITY ENABLED" I mean uncommented rampart and rahas tags inside
axis2 xmls on client and server side.
	-	by "SECURITY DISABLED" I mean commented rampart and rahas tags inside
axis2 xmls on client and server side.

So this are my experiment results:
------------------------------------------------------------------------------------------------------

1.	Experiment: From axis2 console services list I clicked on my service link
(the only one). 
With two methods from my web service there was also bunch of other methods
which I don't understand where they are coming from. Anyway, WSDL was not
shown and the SystemOut.log has the same exceptions with SECURITY ENABLED
and SECURITY DISABLED. 

[29.06.12. 18:09:09:766 CEST] 00000017 AsyncTranspor E WSWS7216E: The
following error occured during a JNDI lookup operation for the
jms/DefaultAsyncReplyQueue connection factory :
javax.naming.NameNotFoundException: Context:
MONSTER2Node04Cell/nodes/MONSTER2Node04/servers/server1, name:
jms/DefaultAsyncReplyCF: First component in name jms/DefaultAsyncReplyCF not
found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound:
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0] 
at
com.ibm.ws.naming.jndicos.CNContextImpl.mapNotFoundException(CNContextImpl.java:4378) 
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1807) 
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1762) 
at
com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1513) 
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:645) 
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:166) 
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:180) 
at javax.naming.InitialContext.lookup(InitialContext.java:436) 
at
com.ibm.ws.websvcs.transport.jms.JMSConnectionFactory.connect(JMSConnectionFactory.java:151) 
at
com.ibm.ws.websvcs.transport.jms.AsyncTransportListener.getEPRForService(AsyncTransportListener.java:245) 
at
com.ibm.ws.websvcs.transport.jms.AsyncTransportListener.getEPRsForService(AsyncTransportListener.java:180) 
at
org.apache.axis2.description.AxisService.calculateEPRs(AxisService.java:1011) 
at org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1358) 
at
org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:286) 
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:246) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181) 
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91) 
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864) 
at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592) 
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276) 
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) 
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) 
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) 
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) 
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) 
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) 
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) 
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) 
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) 
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1613) 
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound:
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0 
at
com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.handleNameNotFound(WsnOptimizedNamingImpl.java:2519) 
at
com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.getNextWsnOptimizedNamingContext(WsnOptimizedNamingImpl.java:1270) 
at
com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$3.run(WsnOptimizedNamingImplBase.java:4738) 
at
com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$3.run(WsnOptimizedNamingImplBase.java:4733) 
at com.ibm.ws.naming.util.CommonHelpers.retry(CommonHelpers.java:771) 
at
com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.getTargetContext(WsnOptimizedNamingImplBase.java:4732) 
at
com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$LeafOperationData.<init>(WsnOptimizedNamingImplBase.java:5311) 
at
com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2155) 
at
com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:538) 
at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2810) 
at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2806) 
at com.ibm.ws.naming.util.CommonHelpers.retry(CommonHelpers.java:771) 
at
com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:2804) 
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1803) 
... 37 more 

[29.06.12. 18:09:09:766 CEST] 00000017 AxisService W
org.apache.axis2.description.AxisService calculateEPRs Context:
MONSTER2Node04Cell/nodes/MONSTER2Node04/servers/server1, name:
jms/DefaultAsyncReplyCF: First component in name jms/DefaultAsyncReplyCF not
found. 
[29.06.12. 18:09:09:766 CEST] 00000017 servlet E
com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught
exception created in one of the service methods of the servlet AxisServlet
in application JaxWs-EAR_Novi. Exception created :
java.lang.NullPointerException 
at
com.ibm.ws.websvcs.transport.http.client.WAShttpsAsyncResponseListener.getEPRForService(WAShttpsAsyncResponseListener.java:804) 
at
com.ibm.ws.websvcs.transport.http.client.WAShttpsAsyncResponseListener.getEPRsForService(WAShttpsAsyncResponseListener.java:937) 
at
org.apache.axis2.description.AxisService.calculateEPRs(AxisService.java:1011) 
at org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1358) 
at
org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:286) 
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:246) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181) 
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91) 
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864) 
at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592) 
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276) 
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) 
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) 
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) 
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) 
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) 
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) 
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) 
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) 
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) 
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1613) 

[29.06.12. 18:09:09:766 CEST] 00000017 LocalTranCoor E WLTC0017E: Resources
rolled back due to setRollbackOnly() being called. 
[29.06.12. 18:09:09:766 CEST] 00000017 webapp E
com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet
Error]-[AxisServlet]: java.lang.NullPointerException 
at
com.ibm.ws.websvcs.transport.http.client.WAShttpsAsyncResponseListener.getEPRForService(WAShttpsAsyncResponseListener.java:804) 
at
com.ibm.ws.websvcs.transport.http.client.WAShttpsAsyncResponseListener.getEPRsForService(WAShttpsAsyncResponseListener.java:937) 
at
org.apache.axis2.description.AxisService.calculateEPRs(AxisService.java:1011) 
at org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1358) 
at
org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:286) 
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:246) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502) 
at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181) 
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91) 
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864) 
at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592) 
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305) 
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276) 
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) 
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) 
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) 
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) 
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) 
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) 
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) 
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) 
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) 
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1613) 


2.	Experiment: Request/Response cycle with SECURITY ENABLED.

	2.1.	Message sent from client:

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
soapenv:mustUnderstand="1"><wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Timestamp-1"><wsu:Created>2012-06-29T16:05:16.684Z</wsu:Created><wsu:Expires>2012-06-29T16:10:16.684Z</wsu:Expires></wsu:Timestamp><wsse:BinarySecurityToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
wsu:Id="CertId-FFC59DA2220A26958613409859196331">MIICkTCCAfqgAwIBAgIETww4XjANBgkqhkiG9w0BAQQFADCBjDELMAkGA1UEBhMCSFIxDDAKBgNVBBETAzM4NTERMA8GA1UECBMISHJ2YXRza2ExDzANBgNVBAcTBlphZ3JlYjENMAsGA1UEChMERmluYTETMBEGA1UECxMKUHJvZ3JhbWVyaTEnMCUGA1UEAxMeZHRvbWxqZW5vdmljMS5pbnRyYW5ldC5maW5hLmhyMB4XDTEyMDExMDEzMDg0NloXDTEzMDEwOTEzMDg0NlowgYwxCzAJBgNVBAYTAkhSMQwwCgYDVQQREwMzODUxETAPBgNVBAgTCEhydmF0c2thMQ8wDQYDVQQHEwZaYWdyZWIxDTALBgNVBAoTBEZpbmExEzARBgNVBAsTClByb2dyYW1lcmkxJzAlBgNVBAMTHmR0b21samVub3ZpYzEuaW50cmFuZXQuZmluYS5ocjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAlAjMTPsQGJ0VoDAo2BQZ9YRAUgB79Uz4XIwHrQs4UfMw8coYy6cIuELQEXA8Dd9CY9BGYHSmMnRZmK8AW3nNUWoZFRqdMJbnlPq8rxaKETdkCE2ovVhUizF2Cg8Pkmpvqqv6Vlvm+xQPdeqzQ6Idjkh+L2nzxE1Eemycgr30Hm8CAwEAATANBgkqhkiG9w0BAQQFAAOBgQAZU/DMFnjnNW8HUYBnT4piKWRNyIBspulyMqxFXIPG8yd9fJRSQ7UzF11j7jNfRc6YOzxpGZsXe3w29lkW4FoxFZ1M+vX6706YFsw49Cmm0YdfDkBVi9i3y93xR5Z0G7DUyGmiUO3wfVfhjnoYz1XsKdzqpgLoIBKMsiP/hZh+/w==</wsse:BinarySecurityToken><ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-2"> 
<ds:SignedInfo> 
<ds:CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> 
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"
/> 
<ds:Reference URI="#Id-499129792"> 
<ds:Transforms> 
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> 
</ds:Transforms> 
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 
<ds:DigestValue>zTGO/5TCnNh9ex6znyWxy8EyEFU=</ds:DigestValue> 
</ds:Reference> 
<ds:Reference URI="#Timestamp-1"> 
<ds:Transforms> 
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> 
</ds:Transforms> 
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 
<ds:DigestValue>XzkSJOTJ5d+yHVlNDpW1dvXvYkE=</ds:DigestValue> 
</ds:Reference> 
</ds:SignedInfo> 
<ds:SignatureValue> 
Xt5/lEuHVAfOs/BSsCUHbrANFr3NHFCuw3/qdB+zXWBSxCjYva+YeXtCVWUGVZQ3+1JoitQzSgB5 
fYefDdOqFONpCppmoxPE46AytJAWn97SGOr0nqeqGCBcp6GFKglQEkl0zowzICNCTOk7ndVX0Co8 
MeSe1QJHIgObV4Be2SI= 
</ds:SignatureValue> 
<ds:KeyInfo Id="KeyId-FFC59DA2220A26958613409859196482"> 
<wsse:SecurityTokenReference
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="STRId-FFC59DA2220A26958613409859196483"><wsse:Reference
URI="#CertId-FFC59DA2220A26958613409859196331"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
/></wsse:SecurityTokenReference> 
</ds:KeyInfo> 
</ds:Signature></wsse:Security></soapenv:Header><soapenv:Body
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Id-499129792"><ns3:SendOutgoingInvoiceMsg
xmlns:ns3="http://fina.hr/eracun/SendOutgoingInvoice/v0.1"
xmlns="http://fina.hr/eracun/invoicewebservicecomponents/v0.1"
xmlns:ns2="http://fina.hr/eracun/SendIncomingInvoiceStatus/v0.1"><HeaderSupplier><MessageID>987654321</MessageID><SupplierID>123456789</SupplierID><MessageType>3</MessageType><MessageAttributes>nekaj</MessageAttributes></HeaderSupplier><ns3:Data>emFrYWo=</ns3:Data></ns3:SendOutgoingInvoiceMsg></soapenv:Body></soapenv:Envelope> 

	2.2.	Message sent from service (debugger didn't step into password handler
on the service side) 

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault
xmlns:axis2ns1="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>axis2ns1:MustUnderstand</faultcode><faultstring>Must
Understand check failed for headers:
{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security</faultstring><detail></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope> 


	2.3.	Java client log after request/response cycle  was this:
Exception in thread "main" javax.xml.ws.ProtocolException: Must Understand
check failed for headers:
{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security 
at
org.apache.axis2.jaxws.ExceptionFactory.createProtocolException(ExceptionFactory.java:199) 
at
org.apache.axis2.jaxws.ExceptionFactory.makeProtocolException(ExceptionFactory.java:97) 
at
org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:1333) 
at
org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.demarshalFaultResponse(MethodMarshallerUtils.java:1052) 
at
org.apache.axis2.jaxws.marshaller.impl.alt.DocLitBareMethodMarshaller.demarshalFaultResponse(DocLitBareMethodMarshaller.java:415) 
at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.getFaultResponse(JAXWSProxyHandler.java:577) 
at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(JAXWSProxyHandler.java:520) 
at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:386) 
at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:171) 
at $Proxy28.sendOutgoingInvoice(Unknown Source) 
at
hr.fina.jaxws.invoicesStatusesService.client.WebServiceClient.main(WebServiceClient.java:98) 

	2.4.	SystemOut.log didn't show anything.


3.	Experiment: Request/Response cycle with SECURITY DISABLED
	
	3.1.	Message sent from client:
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns3:SendOutgoingInvoiceMsg
xmlns="http://fina.hr/eracun/invoicewebservicecomponents/v0.1"
xmlns:ns2="http://fina.hr/eracun/SendIncomingInvoiceStatus/v0.1"
xmlns:ns3="http://fina.hr/eracun/SendOutgoingInvoice/v0.1"><HeaderSupplier><MessageID>987654321</MessageID><SupplierID>123456789</SupplierID><MessageType>3</MessageType><MessageAttributes>nekaj</MessageAttributes></HeaderSupplier><ns3:Data>emFrYWo=</ns3:Data></ns3:SendOutgoingInvoiceMsg></soapenv:Body></soapenv:Envelope> 

	3.2.	Message sent from servce was not shown in TCP/IP monitor. Debugger did
step into service method.

	3.3.	Java client log after request/response cycle  was this:

Exception in thread "main" javax.xml.ws.WebServiceException:
com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog 
at javax.xml.stream.SerializableLocation@167e167e 
at
org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175) 
at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70) 
at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128) 
at
org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:572) 
at
org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:123) 
at
org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:93) 
at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:373) 
at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:171) 
at $Proxy28.sendOutgoingInvoice(Unknown Source) 
at
hr.fina.jaxws.invoicesStatusesService.client.WebServiceClient.main(WebServiceClient.java:98) 
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog 
at javax.xml.stream.SerializableLocation@167e167e 
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:686) 
at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134) 
at
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040) 
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069) 
at
org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225) 
at
org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34) 
at
org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225) 
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681) 
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214) 
at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204) 
at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154) 
at
org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBuilder(AbstractOMMetaFactory.java:73) 
at
org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder(AbstractOMMetaFactory.java:79) 
at
org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLBuilderFactory.java:196) 
at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:55) 
at
org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:179) 
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145) 
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108) 
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67) 
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354) 
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421) 
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229) 
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) 
at
org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:567) 
... 6 more 

	3.4.	SystemOut.log didn't show anything.
------------------------------------------------------------------------------------------------------

All this results reminds me on exception which was thrown when I was using
RSA 7 and WebSphere 6.1: 

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
java.lang.RuntimeException: The service class cannot be found for this
AxisService.
at
org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:1326)
at
org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.demarshalFaultResponse(MethodMarshallerUtils.java:1052)
at
org.apache.axis2.jaxws.marshaller.impl.alt.DocLitBareMethodMarshaller.demarshalFaultResponse(DocLitBareMethodMarshaller.java:415)
at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.getFaultResponse(JAXWSProxyHandler.java:577)
at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(JAXWSProxyHandler.java:520)
at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:386)
at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:171)
at $Proxy28.sendOutgoingInvoice(Unknown Source)
at
hr.fina.jaxws.invoicesStatusesService.client.WebServiceClient.main(WebServiceClient.java:92)


Do you have idea what is going wrong ?

Thanks.

-- 
View this message in context: http://old.nabble.com/JAX-WS-client-and-service-with-Rampart-module-for-signing-messages-tp34070987p34093419.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: JAX-WS client and service with Rampart module for signing messages

Posted by Amila Jayasekara <th...@gmail.com>.
Hi Megadeth,

Please find some answers inline.

On Tue, Jun 26, 2012 at 1:15 PM, Megadeth <ca...@gmail.com> wrote:
>
> Hi,
>
> I created java project. It is client of my jax-ws web service and I use it
> for signing messages.
> I renamed rampart.mar to rampart.jar and put it into classpath of java
> project (also addressing and rahas mars). I am not sure if this is correct,
> but it works for me.

This is not the correct way to do. When creating the
FileSystemConfigurator, you can give a repository path. There you can
specify path to the axis2 repository (E.g :-
/home/amila/development/apache/axis2/java/rampart/packs/axis2-1.6.2/repository).
Rampart.mar should be there within repository in a folder called
"modules".

>
> In client I put this:
>
> String axis2xml = "C:/.../conf/client.axis2.xml";
> System.setProperty(Constants.AXIS2_CONF, axis2xml);
> FileSystemConfigurator configurator = new FileSystemConfigurator(null,
> axis2xml);
> ClientConfigurationFactory factory = new
> ClientConfigurationFactory(configurator);
> MetadataFactoryRegistry.setFactory(ClientConfigurationFactory.class,
> factory);
>
> JaxwsLibrary service = new JaxwsLibrary();
> ESomePortType stub = service.getLibrary();
>
> BindingProvider provider = (BindingProvider)stub;
>
> Policy policy = loadPolicy("sign-policy-client.xml");
> provider.getRequestContext().put(RampartMessageData.KEY_RAMPART_POLICY,
> policy);
>
> provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
> "http://localhost:8080........../MyWebService");
>
> I realized that I MUST set factory BEFORE creating service object. If you do
> not, then Axis will not be configured properly.
> As you can see, my entire policy is in separate xml. I also put this policy
> into wsdl, but I am not sure if this one (from wsdl) is used anywhere.
>
> Then I generate service jar:
> <jar jarfile="${service-archive-name}.jar">
> <fileset dir="${compiled-code}"/>
> </jar>
>
> "compiled-code" is directory where resides classes generated by wsimport.
> Then I put this into axis2.xml on the service side (I am not sure this is
> correct):
>
> <parameter name="OutflowSecurity">
> <action>
> <items>Signature</items>
> <user>serveralias</user>
> <passwordCallbackClass>hr.bla.bla.PWServiceHandler</passwordCallbackClass>
> <signaturePropFile>crypto.properties</signaturePropFile>
> </action>
> </parameter>
>
> <parameter name="InflowSecurity">
> <action>
> <items>Signature</items>
> <passwordCallbackClass>hr.bla.bla.PWServiceHandler</passwordCallbackClass>
> <signaturePropFile>crypto.properties</signaturePropFile>
> </action>
> </parameter>

Rampart supports 2 modes of operations.
1. Parameter based configurations
2. Policy based configurations

What you have defined above is parameter based configuration.
Parameter based configuration is sort of obsolete. Therefore we
recommend you to use policy based configurations. In addition you dont
need to specify both to sign messages.

>
> Also, I put crypto.properties, My.jks and handler class into MyUtil.jar.
> Then MyUtil.jar is added to /WEB-INF/lib.
>
> When I start all this (WebSphere 6.1, Rational Software Developer with
> TCP/IP monitoring, Axis 1.6.0 and Rampart 1.6.0; axis and rampart versions
> MUST be the same) client sends signed message to web service. From the web
> service side this message is validated, but when server sends
> acknowledgement message something goes wrong.
> I can see from debugger that password handler (on service side) do his job,
> but after that I see this (without security everything works ok):
>
> [2012.06.18 10:08:52:000 CEST] 0000001f ServletWrappe E SRVE0068E: Uncaught
> exception thrown in one of the service methods of the servlet: AxisServlet.
> Exception thrown : java.lang.NullPointerException
> at
> org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:281)
> at
> org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:255)
> at
> org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:717)
> at
> org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:414)
> at
> org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:90)
> at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)
> at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
> at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
> at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
> at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
> at org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:516)
> at
> org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:433)
> at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:216)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:501)
> at
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
> at
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
> at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
> at
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
> at
> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:279)
> at
> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
> at
> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
> at
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
> at
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
> at
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
> at
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>
> I realize that above exception is because I forgot to load policy for
> service.
> But where I need to put it ?
> I know that somehow I can put policy inside axis2.xml, but I don't know how.

You need to specify policy within the services.xml file.
>
> Using this:
>
> https://issues.apache.org/jira/browse/AXIS2-4611?p...em.issuetabpanels:all-tabpanel
> I tried to create aar and put policy in service.xml.
> But for that I need axis2 1.7 and rampart 1.7. (The same thing is with 1.6.0
> versions).
> I can see my service from axis console, and also I can open wsdl by click on
> web service link.
>
> After I start client TCP/IP monitor gave me:
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> <soapenv:Header
> xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsse:Security
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
> soapenv:mustUnderstand="1"><wsu:Timestamp
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="Timestamp-1"><wsu:Created>2012-06-18T14:45:29.000Z</wsu:Created><wsu:Expires>2012-06-18T14:50:29.000Z</wsu:Expires></wsu:Timestamp><wsse:BinarySecurityToken
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
> ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
> wsu:Id="CertId-CFAD48F0CEE02316E613400307290001">MIICKzCCAZSgAwIBAgIET9nnZDANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJIUjENMAsGA1UEChMERmluYTETMBEGA1UECxMKUHJvZ3JhbWVyaTEnMCUGA1UEAxMeZHRvbWxqZW5vdmljMS5pbnRyYW5ldC5maW5hLmhyMB4XDTEyMDYxNDEzMzAxMloXDTEzMDYxNDEzMzAxMlowWjELMAkGA1UEBhMCSFIxDTALBgNVBAoTBEZpbmExEzARBgNVBAsTClByb2dyYW1lcmkxJzAlBgNVBAMTHmR0b21samVub3ZpYzEuaW50cmFuZXQuZmluYS5ocjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAu/FWX1RIOSHaVSMHMU/debHywi5PMkKXQISeWljpZ/by4T/HEQGFB9muJDnOTdHJ8ELF0s+r1RUAF/+mG5sD3UpUZeAmyP+haSQh5weD7Aj/OUf3g8S6/Ftk5OkS4XOaVWqJwhpkTrLa9Lgk2fQLpOW2Zsk0z62Cb87/VsYy42ECAwEAATANBgkqhkiG9w0BAQQFAAOBgQAJ0+fNH8o3BPV9JgQrjdJbeObRccNT7fIR3YtMgtm/Xp6/hqMAbS/qBkNsPx4VJImc8xjXnWdDr6I0+nsxTtCmw5FIPKKkYaYWxo3r/LZy6eZwcSfAzxWGVv4S4b8lIkZqLn2iBBKNEwDPr5dDtCMj5+SfvDmRo1Kp096K7iEqHw==</wsse:BinarySecurityToken><ds:Signature
> xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-2">
> <ds:SignedInfo>
> <ds:CanonicalizationMethod
> Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"
> />
> <ds:Reference URI="#Id-806760470">
> <ds:Transforms>
> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
> </ds:Transforms>
> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
> <dsigestValue>PZ7Tv3Iei2t9trchNcReIWIPqdg=</dsigestValue>
> </ds:Reference>
> <ds:Reference URI="#Timestamp-1">
> <ds:Transforms>
> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
> </ds:Transforms>
> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
> <dsigestValue>dW1lWCZA1zJ+aKHv7k6oIE7VcDE=</dsigestValue>
> </ds:Reference>
> </ds:SignedInfo>
> <ds:SignatureValue>
> Vw2alx+bvcoUqhtYKeYfNm4LEi6P1PBqJs2vDu9mzN4VghsLiYXQsADaK2S+izxNLIy+FwVuXn/z
> DI7tyPqZtZW6GXUGfl8fSJvDbxtcX7SWu8mQwzQGuK9gBQRLMkqEvB3Gh/YuNpD8htiU1jFM4jBw
> yhgIQco07s1R5B+yK5U=
> </ds:SignatureValue>
> <ds:KeyInfo Id="KeyId-CFAD48F0CEE02316E613400307290002">
> <wsse:SecurityTokenReference
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="STRId-CFAD48F0CEE02316E613400307290003"><wsse:Reference
> URI="#CertId-CFAD48F0CEE02316E613400307290001"
> ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
> /></wsse:SecurityTokenReference>
> </ds:KeyInfo>
> </ds:Signature></wsse:Security><wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action><wsa:RelatesTo>urn:uuid:4a9625ed-87b6-4238-8fc8-2589f578edd9</wsa:RelatesTo></soapenv:Header><soapenv:Body
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="Id-806760470"><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>java.lang.RuntimeException:
> The service class cannot be found for this
> AxisService.</faultstring><detail
> /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
>
> I suppose that rampart now runs but without Axis doing web service method
> call.
> Probably Axis can't find service class. Also debugger won't debug this class
> in Eclipse.
>
> This is error from axis log:
> Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
> java.lang.RuntimeException: The service class cannot be found for this
> AxisService.

I am not quite sure why you are getting above error message. (Service
class not deployed properly ?)

Thanks
AmilaJ

>        at
> org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:1326)
>        at
> org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.demarshalFaultResponse(MethodMarshallerUtils.java:1052)
>        at
> org.apache.axis2.jaxws.marshaller.impl.alt.DocLitBareMethodMarshaller.demarshalFaultResponse(DocLitBareMethodMarshaller.java:415)
>        at
> org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.getFaultResponse(JAXWSProxyHandler.java:577)
>        at
> org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(JAXWSProxyHandler.java:520)
>        at
> org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:386)
>        at
> org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:171)
>        at $Proxy28.sendOutgoingInvoice(Unknown Source)
>        at
> hr.fina.jaxws.invoicesStatusesService.client.WebServiceClient.main(WebServiceClient.java:92)
>
> Do I need to comment some of this features in axis2.xml ?
>
>    <deployer extension=".class" directory="pojo"
> class="org.apache.axis2.deployment.POJODeployer"/>
>    <deployer extension=".jar" directory="servicejars"
>              class="org.apache.axis2.jaxws.framework.JAXWSDeployer"/>
>    <deployer extension=".jar" directory="transports"
>              class="org.apache.axis2.deployment.TransportDeployer"/>
>
> I read on web that this is some problem between axis2 engine, jdk 1.6 and
> Websphere 6.1.
> What to do next ?
>
> Please, help me.
>
> Thanks.
> --
> View this message in context: http://old.nabble.com/JAX-WS-client-and-service-with-Rampart-module-for-signing-messages-tp34070987p34070987.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: JAX-WS client and service with Rampart module for signing messages

Posted by Andreas Veithen <an...@gmail.com>.
You should also read the following document:

http://axis.apache.org/axis2/java/core/docs/app_server.html

Andreas

On Sat, Jun 30, 2012 at 8:05 PM, Megadeth <ca...@gmail.com> wrote:
>
> Hi Amila,
>
> At first I think I need to study this:
>
> http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Finfo%2Fae%2Fae%2Ftwbs_thirdparty.html
>
> I'll be back :)
>
>
> --
> View this message in context: http://old.nabble.com/JAX-WS-client-and-service-with-Rampart-module-for-signing-messages-tp34070987p34096102.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: JAX-WS client and service with Rampart module for signing messages

Posted by Megadeth <ca...@gmail.com>.
Hi Amila,

At first I think I need to study this:

http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Finfo%2Fae%2Fae%2Ftwbs_thirdparty.html

I'll be back :)


-- 
View this message in context: http://old.nabble.com/JAX-WS-client-and-service-with-Rampart-module-for-signing-messages-tp34070987p34096102.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org