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 Jon Hanshew <jh...@visa.com> on 2007/08/29 23:06:21 UTC

Rampart 1.3 and Axis2 1.3

Grettings,

I have gotten all the Rampart 1.3 Policy samples (except for tomcat) to run
with Axis2 1.3.  All the Basic samples run but do nothing interesting that I
can see.  

I am trying to get an Service and Client to run based on Policy sample01.  I
think I have everything configured correctly, but I cannot get my own stuff
to run with the rampart and addressing modules engaged.

I suspect that the problem may stem from the difference between Axis2 style
clients and Axis clients.  Here is a code sample.

ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:/SecurityRepos",
null);
               
                EmsServiceStub  stub =      new EmsServiceStub (ctx,
"http://localhost:8080/axis2/services/EmsService");
                ServiceClient   client =    stub._getServiceClient();
                Options         options =   client.getOptions();
               
                options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, 
loadPolicy("C:/SecurityPolicy/policy.xml"));
                client.engageModule("addressing");
                client.engageModule("rampart");
                
                response = stub.GetEmsData(request);

Note that this code does not use the service calling pattern shown in the
Rampart samples.  The client and server work fine when the "engage" staments
are commented out.  However it crashes with the following trace when I leave
the "engage" statements in.

org.apache.axis2.AxisFault: The server did not recognise the action which it
received: 
        at
org.apache.axis2.handlers.addressing.AddressingInFaultHandler.invoke(AddressingInFaultHandler.java:114)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
        at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:336)
        at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
        at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
        at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
        at
emsservice.client.EmsServiceStub.GetEmsData(EmsServiceStub.java:141)
        at emsservice.client.TestClient.main(TestClient.java:103)

Additionally, the Soapmonitor shows no activity at all.

Does anybody have a clue about what is going on?

Thanks,

Jon

-- 
View this message in context: http://www.nabble.com/Rampart-1.3-and-Axis2-1.3-tf4350415.html#a12395803
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: Rampart 1.3 and Axis2 1.3

Posted by Jon Hanshew <jh...@visa.com>.
Thanks for the response.

Here is the service.xml that I am now using.

<?xml version="1.0" encoding="UTF-8"?>
<!-- This file was auto-generated from WSDL -->
<!-- by the Apache Axis2 version: #axisVersion# #today# -->
<serviceGroup>
    <service name="EmsService">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
class="emsservice.service.EmsServiceMessageReceiverInOut"/>
        </messageReceivers>
        <parameter locked="false"
name="ServiceClass">emsservice.service.EmsServiceSkeleton</parameter>
        <parameter locked="false" name="useOriginalwsdl">true</parameter>
        <parameter locked="false"
name="modifyUserWSDLPortAddress">true</parameter>
        <operation name="GetEmsEnhancements"
mep="http://www.w3.org/ns/wsdl/in-out">
            <actionMapping>\"\"</actionMapping>
           
<outputActionMapping>http://emsservice.ems.visa.com/v1/EmsPortType/EmsResponseMessage</outputActionMapping>
        </operation>
	<module ref="rampart" />
	<module ref="addressing" />
	<module ref="rahas" />

	<wsp:Policy wsu:Id="UTOverTransport"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
		<wsp:ExactlyOne>
		  <wsp:All>
			<sp:TransportBinding
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
			  <wsp:Policy>
				<sp:TransportToken>
				  <wsp:Policy>
					<sp:HttpsToken RequireClientCertificate="false"/>
				  </wsp:Policy>
				</sp:TransportToken>
				<sp:AlgorithmSuite>
				  <wsp:Policy>
					<sp:Basic256/>
				  </wsp:Policy>
				</sp:AlgorithmSuite>
				<sp:Layout>
				  <wsp:Policy>
					<sp:Lax/>
				  </wsp:Policy>
				</sp:Layout>
				<sp:IncludeTimestamp/>
			  </wsp:Policy>
			</sp:TransportBinding>
			<sp:SignedSupportingTokens
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
				<wsp:Policy>
					<sp:UsernameToken
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient"
/>
			  </wsp:Policy>
			</sp:SignedSupportingTokens>
			
			<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> 
			
<ramp:passwordCallbackClass>emsservice.service.PWCBHandler</ramp:passwordCallbackClass>
			</ramp:RampartConfig>
			
		  </wsp:All>
		</wsp:ExactlyOne>
	</wsp:Policy>

    </service>
</serviceGroup>


and here is the exception that the server is now throwing.


java.lang.NullPointerException
        at org.apache.rampart.RampartEngine.process(RampartEngine.java:90)
        at
org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:85)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
        at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:
        at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
        at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:595)

I have turned on debugging and starting to compare successful runs to this
failed one.

Any suggestions would be greatly appreciated.

Jon




Dimuthu wrote:
> 
> Hi,
> 
> On Wed, 2007-08-29 at 14:06 -0700, Jon Hanshew wrote:
>> Grettings,
>> 
>> I have gotten all the Rampart 1.3 Policy samples (except for tomcat) to
>> run
>> with Axis2 1.3.  All the Basic samples run but do nothing interesting
>> that I
>> can see.  
>> 
>> I am trying to get an Service and Client to run based on Policy sample01. 
>> I
>> think I have everything configured correctly, but I cannot get my own
>> stuff
>> to run with the rampart and addressing modules engaged.
>> 
>> I suspect that the problem may stem from the difference between Axis2
>> style
>> clients and Axis clients.  Here is a code sample.
> I was mislead by the last sentence above, sorry about it.
> 
> Looking at the Exception below I can see that you have used an Axis2
> client. Have you specified the <actionMapping> element in your
> service.xml? When addressing module is present you have to specify
> that. 
> 
> This article can help you on action mapping[1]. Axis2 user guide can
> also help.
> 
> Cheers,
> Dimuthu.
> 
> [1]http://wso2.org/library/2060
> 
> 
>> ConfigurationContext ctx =
>> ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:/SecurityRepos",
>> null);
>>                
>>                 EmsServiceStub  stub =      new EmsServiceStub (ctx,
>> "http://localhost:8080/axis2/services/EmsService");
>>                 ServiceClient   client =    stub._getServiceClient();
>>                 Options         options =   client.getOptions();
>>                
>>                
>> options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, 
>> loadPolicy("C:/SecurityPolicy/policy.xml"));
>>                 client.engageModule("addressing");
>>                 client.engageModule("rampart");
>>                 
>>                 response = stub.GetEmsData(request);
>> 
>> Note that this code does not use the service calling pattern shown in the
>> Rampart samples.  The client and server work fine when the "engage"
>> staments
>> are commented out.  However it crashes with the following trace when I
>> leave
>> the "engage" statements in.
>> 
>> org.apache.axis2.AxisFault: The server did not recognise the action which
>> it
>> received: 
>>         at
>> org.apache.axis2.handlers.addressing.AddressingInFaultHandler.invoke(AddressingInFaultHandler.java:114)
>>         at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
>>         at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
>>         at
>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:336)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
>>         at
>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>>         at
>> emsservice.client.EmsServiceStub.GetEmsData(EmsServiceStub.java:141)
>>         at emsservice.client.TestClient.main(TestClient.java:103)
>> 
>> Additionally, the Soapmonitor shows no activity at all.
>> 
>> Does anybody have a clue about what is going on?
>> 
>> Thanks,
>> 
>> Jon
>> 
> -- 
> http://wso2.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Rampart-1.3-and-Axis2-1.3-tf4350415.html#a12409486
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: Rampart 1.3 and Axis2 1.3

Posted by Jon Hanshew <jh...@visa.com>.
Your suggestion of looking into action mapping was very good.  Thanks.

I have turned on debugging and have been able to verify that the "good"
client and my own client behave identically up to message delivery to the
service.  The good client gets a positive response from the service while
(unfortunately) my client does not.

I have made the actionMapping parameter ("target") in the service's
service.xml match the option.setAction(target) value in my client's Java
code, but still no happiness.  I still am getting an error complaint from
the service that it couldn't figure out what to do from my request's SOAP
header.

Nevertheless, I should be close to getting things to work.

Any additional suggestions would be very much appreciated.

Thanks,

Jon

Nevertheless, I think I am close.

Dimuthu wrote:
> 
> Hi,
> 
> On Wed, 2007-08-29 at 14:06 -0700, Jon Hanshew wrote:
>> Grettings,
>> 
>> I have gotten all the Rampart 1.3 Policy samples (except for tomcat) to
>> run
>> with Axis2 1.3.  All the Basic samples run but do nothing interesting
>> that I
>> can see.  
>> 
>> I am trying to get an Service and Client to run based on Policy sample01. 
>> I
>> think I have everything configured correctly, but I cannot get my own
>> stuff
>> to run with the rampart and addressing modules engaged.
>> 
>> I suspect that the problem may stem from the difference between Axis2
>> style
>> clients and Axis clients.  Here is a code sample.
> I was mislead by the last sentence above, sorry about it.
> 
> Looking at the Exception below I can see that you have used an Axis2
> client. Have you specified the <actionMapping> element in your
> service.xml? When addressing module is present you have to specify
> that. 
> 
> This article can help you on action mapping[1]. Axis2 user guide can
> also help.
> 
> Cheers,
> Dimuthu.
> 
> [1]http://wso2.org/library/2060
> 
> 
>> ConfigurationContext ctx =
>> ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:/SecurityRepos",
>> null);
>>                
>>                 EmsServiceStub  stub =      new EmsServiceStub (ctx,
>> "http://localhost:8080/axis2/services/EmsService");
>>                 ServiceClient   client =    stub._getServiceClient();
>>                 Options         options =   client.getOptions();
>>                
>>                
>> options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, 
>> loadPolicy("C:/SecurityPolicy/policy.xml"));
>>                 client.engageModule("addressing");
>>                 client.engageModule("rampart");
>>                 
>>                 response = stub.GetEmsData(request);
>> 
>> Note that this code does not use the service calling pattern shown in the
>> Rampart samples.  The client and server work fine when the "engage"
>> staments
>> are commented out.  However it crashes with the following trace when I
>> leave
>> the "engage" statements in.
>> 
>> org.apache.axis2.AxisFault: The server did not recognise the action which
>> it
>> received: 
>>         at
>> org.apache.axis2.handlers.addressing.AddressingInFaultHandler.invoke(AddressingInFaultHandler.java:114)
>>         at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
>>         at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
>>         at
>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:336)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
>>         at
>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>>         at
>> emsservice.client.EmsServiceStub.GetEmsData(EmsServiceStub.java:141)
>>         at emsservice.client.TestClient.main(TestClient.java:103)
>> 
>> Additionally, the Soapmonitor shows no activity at all.
>> 
>> Does anybody have a clue about what is going on?
>> 
>> Thanks,
>> 
>> Jon
>> 
> -- 
> http://wso2.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Rampart-1.3-and-Axis2-1.3-tf4350415.html#a12420712
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: Rampart 1.3 and Axis2 1.3

Posted by Dimuthu <mu...@apache.org>.
Hi,

On Wed, 2007-08-29 at 14:06 -0700, Jon Hanshew wrote:
> Grettings,
> 
> I have gotten all the Rampart 1.3 Policy samples (except for tomcat) to run
> with Axis2 1.3.  All the Basic samples run but do nothing interesting that I
> can see.  
> 
> I am trying to get an Service and Client to run based on Policy sample01.  I
> think I have everything configured correctly, but I cannot get my own stuff
> to run with the rampart and addressing modules engaged.
> 
> I suspect that the problem may stem from the difference between Axis2 style
> clients and Axis clients.  Here is a code sample.
I was mislead by the last sentence above, sorry about it.

Looking at the Exception below I can see that you have used an Axis2
client. Have you specified the <actionMapping> element in your
service.xml? When addressing module is present you have to specify
that. 

This article can help you on action mapping[1]. Axis2 user guide can
also help.

Cheers,
Dimuthu.

[1]http://wso2.org/library/2060


> ConfigurationContext ctx =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:/SecurityRepos",
> null);
>                
>                 EmsServiceStub  stub =      new EmsServiceStub (ctx,
> "http://localhost:8080/axis2/services/EmsService");
>                 ServiceClient   client =    stub._getServiceClient();
>                 Options         options =   client.getOptions();
>                
>                 options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, 
> loadPolicy("C:/SecurityPolicy/policy.xml"));
>                 client.engageModule("addressing");
>                 client.engageModule("rampart");
>                 
>                 response = stub.GetEmsData(request);
> 
> Note that this code does not use the service calling pattern shown in the
> Rampart samples.  The client and server work fine when the "engage" staments
> are commented out.  However it crashes with the following trace when I leave
> the "engage" statements in.
> 
> org.apache.axis2.AxisFault: The server did not recognise the action which it
> received: 
>         at
> org.apache.axis2.handlers.addressing.AddressingInFaultHandler.invoke(AddressingInFaultHandler.java:114)
>         at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
>         at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
>         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:336)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
>         at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>         at
> emsservice.client.EmsServiceStub.GetEmsData(EmsServiceStub.java:141)
>         at emsservice.client.TestClient.main(TestClient.java:103)
> 
> Additionally, the Soapmonitor shows no activity at all.
> 
> Does anybody have a clue about what is going on?
> 
> Thanks,
> 
> Jon
> 
-- 
http://wso2.org


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


Re: Rampart 1.3 and Axis2 1.3

Posted by Dimuthu <mu...@apache.org>.
Hi,

Please see my comments inline.


On Wed, 2007-08-29 at 14:06 -0700, Jon Hanshew wrote:
> Grettings,
> 
> I have gotten all the Rampart 1.3 Policy samples (except for tomcat) to run
> with Axis2 1.3.  All the Basic samples run but do nothing interesting that I
> can see.  
> 
> I am trying to get an Service and Client to run based on Policy sample01.  I
> think I have everything configured correctly, but I cannot get my own stuff
> to run with the rampart and addressing modules engaged.
> 
> I suspect that the problem may stem from the difference between Axis2 style
> clients and Axis clients.  Here is a code sample.

Rampart is the security module for Axis2. If you want to provide
security for a client generated using Axis, then you have to use wss4j.

If you want to provide security for a client generated using Axis2, then
you have to use Rampart.


Regards,
Dimuthu

> ConfigurationContext ctx =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:/SecurityRepos",
> null);
>                
>                 EmsServiceStub  stub =      new EmsServiceStub (ctx,
> "http://localhost:8080/axis2/services/EmsService");
>                 ServiceClient   client =    stub._getServiceClient();
>                 Options         options =   client.getOptions();
>                
>                 options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, 
> loadPolicy("C:/SecurityPolicy/policy.xml"));
>                 client.engageModule("addressing");
>                 client.engageModule("rampart");
>                 
>                 response = stub.GetEmsData(request);
> 
> Note that this code does not use the service calling pattern shown in the
> Rampart samples.  The client and server work fine when the "engage" staments
> are commented out.  However it crashes with the following trace when I leave
> the "engage" statements in.
> 
> org.apache.axis2.AxisFault: The server did not recognise the action which it
> received: 
>         at
> org.apache.axis2.handlers.addressing.AddressingInFaultHandler.invoke(AddressingInFaultHandler.java:114)
>         at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
>         at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
>         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:336)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
>         at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>         at
> emsservice.client.EmsServiceStub.GetEmsData(EmsServiceStub.java:141)
>         at emsservice.client.TestClient.main(TestClient.java:103)
> 
> Additionally, the Soapmonitor shows no activity at all.
> 
> Does anybody have a clue about what is going on?
> 
> Thanks,
> 
> Jon
> 
-- 
http://wso2.org


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