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 Sanjay Vivek <Sa...@newcastle.ac.uk> on 2008/06/26 10:24:21 UTC

Exceptions when using a Rampart client generated from stub classes.

Hi everyone,

I've installed and configured Rampart 1.4 to work with the tutorial at
http://wso2.org/library/3190 However, I'm having trouble getting the
SOAP response from the service when generating a client using the stub
classes. The SOAP request headers send by the client doesn't contain the
WSSE security headers and I get a "Exception in thread "main"
org.apache.axis2.AxisFault: Missing wsse:Security header in request".

However, everything works fine when I generate a client using AXIOM. Is
there a reason why the WSSE headers are being stripped out when using a
client generated from the stub classes? Any help would be appreciated.
Cheers.

Regards
--------------
Sanjay Vivek
Web Analyst
Middleware Team
ISS
Newcastle University

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


RE: Exceptions when using a Rampart client generated from stub classes.

Posted by Sanjay Vivek <Sa...@newcastle.ac.uk>.
Hi Nandana,
 
I updated the TransportToken.class and I can now diable HTTPS without
any problems. Thanks again!
 
Regards
Sanjay


________________________________

	From: Nandana Mihindukulasooriya [mailto:nandana.cse@gmail.com] 
	Sent: 04 July 2008 10:35
	To: axis-user@ws.apache.org
	Subject: Re: Exceptions when using a Rampart client generated
from stub classes.
	
	
	Hi Sanjay,
	
	

		Yes, I need to disable HTTPS for a short period of time
so that I can do
		some debugging with TCPMON. However, I get the following
exceptions when
		I do comment out that line as shown below. The
exceptions goes away when
		I un-comment the line. The line that sticks out it
"[ERROR]
		Servlet.service() for servlet jsp threw exception
		java.lang.IllegalStateException: getOutputStream() has
already been
		called for this response". Any idea why I'm getting
these exceptions?
		Thanks again.


	This is due to the issue
http://issues.apache.org/jira/browse/RAMPART-176 . Just fixed it in the
trunk. 
	 

		Caused by: java.lang.NullPointerException
		       at
	
org.apache.ws.secpolicy.model.TransportToken.serialize(TransportToken.ja
		va:90)
		       at
	
org.apache.ws.secpolicy.model.TransportBinding.serialize(TransportBindin
		g.java:157)
		       at
	
org.apache.axis2.util.ExternalPolicySerializer.serialize(ExternalPolicyS
		erializer.java:159)
		  


	thanks,
	nandana
	
	
	-- 
	Nandana Mihindukulasooriya 
	WSO2 inc.
	
	http://nandana83.blogspot.com/
	


Re: Exceptions when using a Rampart client generated from stub classes.

Posted by Nandana Mihindukulasooriya <na...@gmail.com>.
Hi Sanjay,

Yes, I need to disable HTTPS for a short period of time so that I can do
> some debugging with TCPMON. However, I get the following exceptions when
> I do comment out that line as shown below. The exceptions goes away when
> I un-comment the line. The line that sticks out it "[ERROR]
> Servlet.service() for servlet jsp threw exception
> java.lang.IllegalStateException: getOutputStream() has already been
> called for this response". Any idea why I'm getting these exceptions?
> Thanks again.


This is due to the issue http://issues.apache.org/jira/browse/RAMPART-176 .
Just fixed it in the trunk.


> Caused by: java.lang.NullPointerException
>        at
> org.apache.ws.secpolicy.model.TransportToken.serialize(TransportToken.ja
> va:90)
>        at
> org.apache.ws.secpolicy.model.TransportBinding.serialize(TransportBindin
> g.java:157)
>        at
> org.apache.axis2.util.ExternalPolicySerializer.serialize(ExternalPolicyS
> erializer.java:159)
>


thanks,
nandana


-- 
Nandana Mihindukulasooriya
WSO2 inc.

http://nandana83.blogspot.com/

RE: Exceptions when using a Rampart client generated from stub classes.

Posted by Sanjay Vivek <Sa...@newcastle.ac.uk>.
Hi Nandana,
 
Yes, I need to disable HTTPS for a short period of time so that I can do
some debugging with TCPMON. However, I get the following exceptions when
I do comment out that line as shown below. The exceptions goes away when
I un-comment the line. The line that sticks out it "[ERROR]
Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been
called for this response". Any idea why I'm getting these exceptions?
Thanks again.

Regards
Sanjay

[ERROR] Servlet.service() for servlet AxisServlet threw exception
org.apache.axis2.dataretrieval.DataRetrievalException:
java.lang.NullPointerException
	at
org.apache.axis2.dataretrieval.AxisDataLocatorImpl.getData(AxisDataLocat
orImpl.java:85)
	at
org.apache.axis2.description.AxisService.getData(AxisService.java:2722)
	at
org.apache.axis2.description.AxisService.getWSDL(AxisService.java:1462)
	at
org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1334
)
	at
org.apache.axis2.transport.http.ListingAgent.processListService(ListingA
gent.java:287)
	at
org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:240)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:269)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:188)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:210)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:174)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:117)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:108)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
51)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:87
0)
	at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc
essConnection(Http11BaseProtocol.java:665)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:528)
	at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow
erWorkerThread.java:81)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:685)
	at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.axis2.dataretrieval.DataRetrievalException:
java.lang.NullPointerException
	at
org.apache.axis2.dataretrieval.WSDLDataLocator.outputInlineForm(WSDLData
Locator.java:134)
	at
org.apache.axis2.dataretrieval.WSDLDataLocator.getData(WSDLDataLocator.j
ava:73)
	at
org.apache.axis2.dataretrieval.AxisDataLocatorImpl.getData(AxisDataLocat
orImpl.java:81)
	... 21 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
	at
org.apache.axis2.util.ExternalPolicySerializer.serialize(ExternalPolicyS
erializer.java:175)
	at
org.apache.axis2.util.PolicyUtil.getPolicyComponentAsOMElement(PolicyUti
l.java:110)
	at
org.apache.axis2.description.AxisService2WSDL11.addPoliciesToDefinitionE
lement(AxisService2WSDL11.java:612)
	at
org.apache.axis2.description.AxisService2WSDL11.generateOM(AxisService2W
SDL11.java:238)
	at
org.apache.axis2.dataretrieval.WSDLDataLocator.outputInlineForm(WSDLData
Locator.java:130)
	... 23 more
Caused by: java.lang.NullPointerException
	at
org.apache.ws.secpolicy.model.TransportToken.serialize(TransportToken.ja
va:90)
	at
org.apache.ws.secpolicy.model.TransportBinding.serialize(TransportBindin
g.java:157)
	at
org.apache.axis2.util.ExternalPolicySerializer.serialize(ExternalPolicyS
erializer.java:159)
	... 27 more
[ERROR] Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been
called for this response
	at
org.apache.catalina.connector.Response.getWriter(Response.java:601)
	at
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.ja
va:196)
	at
org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125)
	at
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:1
18)
	at
org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:1
85)
	at
org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspF
actoryImpl.java:116)
	at
org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryIm
pl.java:76)
	at
org.apache.jsp.axis2_002dweb.Error.error500_jsp._jspService(error500_jsp
.java:99)
	at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:328)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
	at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:269)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:188)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
her.java:691)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicatio
nDispatcher.java:471)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp
atcher.java:403)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat
cher.java:301)
	at
org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java
:364)
	at
org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java
:285)
	at
org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.j
ava:229)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:135)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:117)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:108)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
51)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:87
0)
	at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc
essConnection(Http11BaseProtocol.java:665)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:528)
	at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow
erWorkerThread.java:81)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:685)
	at java.lang.Thread.run(Thread.java:619)
Jun 23, 2008 10:04:35 AM org.apache.catalina.core.StandardHostValve
custom
SEVERE: Exception Processing ErrorPage[errorCode=500,
location=/axis2-web/Error/error500.jsp]
org.apache.jasper.JasperException: getOutputStream() has already been
called for this response
	at
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServle
tWrapper.java:476)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:383)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
	at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:269)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:188)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
her.java:691)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicatio
nDispatcher.java:471)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp
atcher.java:403)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat
cher.java:301)
	at
org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java
:364)
	at
org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java
:285)
	at
org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.j
ava:229)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:135)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:117)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:108)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
51)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:87
0)
	at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc
essConnection(Http11BaseProtocol.java:665)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:528)
	at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow
erWorkerThread.java:81)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:685)
	at java.lang.Thread.run(Thread.java:619) 
 
 


________________________________

	From: Nandana Mihindukulasooriya [mailto:nandana.cse@gmail.com] 
	Sent: 04 July 2008 06:08
	To: axis-user@ws.apache.org
	Subject: Re: Exceptions when using a Rampart client generated
from stub classes.
	
	
	Hi Sanjay,
	
	

		That worked perfectly! Thanks for your advice. On a
separate note, I've
		a question regarding disabling HTTPS. The primary reason
I want to do
		this is because TCPMON can't intercept encrypted
messages. I disabled
		HTTPS by commenting out the following line in the
services.xml file :
		
		                               <sp:TransportToken>
		                                 <wsp:Policy>
		                                       <!--
<sp:HttpsToken
		RequireClientCertificate="false"/>-->
		                                 </wsp:Policy>
		                               </sp:TransportToken>
		


	I'm not clear about your requirements. By commenting out the
above line, what do is remove the requirement which says the message
MUST come through the HTTPS transport. So if you comment this line and
call the web service through HTTP , you will be able to intercept the
messages through TCPMON. Is this what you want ?
	
	Else if we really want is to disable https for a certain
service, "Exposing a Service on a Selected Transport" section of this
tutorial [1]. 
	
	thanks,
	nandana
	

	[1] - http://wso2.org/library/2060
	
	-- 
	Nandana Mihindukulasooriya 
	WSO2 inc.
	
	http://nandana83.blogspot.com/
	


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


Re: Exceptions when using a Rampart client generated from stub classes.

Posted by Nandana Mihindukulasooriya <na...@gmail.com>.
Hi Sanjay,

That worked perfectly! Thanks for your advice. On a separate note, I've
> a question regarding disabling HTTPS. The primary reason I want to do
> this is because TCPMON can't intercept encrypted messages. I disabled
> HTTPS by commenting out the following line in the services.xml file :
>
>                                <sp:TransportToken>
>                                  <wsp:Policy>
>                                        <!-- <sp:HttpsToken
> RequireClientCertificate="false"/>-->
>                                  </wsp:Policy>
>                                </sp:TransportToken>
>

I'm not clear about your requirements. By commenting out the above line,
what do is remove the requirement which says the message MUST come through
the HTTPS transport. So if you comment this line and call the web service
through HTTP , you will be able to intercept the messages through TCPMON. Is
this what you want ?

Else if we really want is to disable https for a certain service, "Exposing
a Service on a Selected Transport" section of this tutorial [1].

thanks,
nandana

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

-- 
Nandana Mihindukulasooriya
WSO2 inc.

http://nandana83.blogspot.com/

RE: Exceptions when using a Rampart client generated from stub classes.

Posted by Sanjay Vivek <Sa...@newcastle.ac.uk>.
Hi Nandana,
 
That worked perfectly! Thanks for your advice. On a separate note, I've
a question regarding disabling HTTPS. The primary reason I want to do
this is because TCPMON can't intercept encrypted messages. I disabled
HTTPS by commenting out the following line in the services.xml file : 

				<sp:TransportToken>
				  <wsp:Policy>
					<!-- <sp:HttpsToken
RequireClientCertificate="false"/>-->
				  </wsp:Policy>
				</sp:TransportToken>

However, I get various exceptions when I attempt to disable HTTPS in
this manner. Any pointers on what I'm doing wrong? Thanks again.

Regards
Sanjay 

 

________________________________

	From: Nandana Mihindukulasooriya [mailto:nandana.cse@gmail.com] 
	Sent: 01 July 2008 07:21
	To: axis-user@ws.apache.org
	Subject: Re: Exceptions when using a Rampart client generated
from stub classes.
	
	
	Hi Sanjay,
	


		  What is the workaround in this case? Does this mean we
can't use Stub classes for Axis2.1.4? Cheers.
		

	One work around would be to load the policy externally ( as
shown in Rampart policy samples ) and inject it to the Stub.
	
	eg.
	
	SecureServiceStub stub = new SecureServiceStub(ctx);
	ServiceClient sc = stub._getServiceClient();
	Options options = sc.getOptions();
	options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
loadPolicy("/path/to/policy"));
	
	
	and 
	
	private Policy loadPolicy(String xmlPath) throws Exception {
	   StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
	   return PolicyEngine.getPolicy(builder.getDocumentElement());
	}
	
	thanks,
	nandana
	
	[1] -
https://svn.apache.org/repos/asf/webservices/rampart/trunk/java/modules/
rampart-samples/policy/sample01/src/org/apache/rampart/samples/policy/sa
mple01/Client.java
	
	 

________________________________

			From: Nandana Mihindukulasooriya
[mailto:nandana.cse@gmail.com] 
			Sent: 28 June 2008 05:31
			To: axis-user@ws.apache.org
			Subject: Re: Exceptions when using a Rampart
client generated from stub classes.
			
			
			I think the issue is with the code generation.
In Axis2 1.4, policies applied  like  this [1], will be attached to port
type not to the binding. So if you compare the WSDL generated by Axis2
1.3 [2]  with the WSDL generated by Axis2 1.4 , there are different. It
seems that code generator is not taking policies attached to the port
type in to account. If you go through the source code of the Stub,
popolateAxisService() method, you will be able to see whether policies
actually are attached to the stub or not. 
			
			thanks,
			nandana
			
			
			[1] -
http://wso2.org/library/3190#Step_4._Engaging_Rampart_and_applying_the_s
ecurity_policy 
			[2] - http://wso2.org/files/UToverHTTPS.xml
			
			
			On Thu, Jun 26, 2008 at 2:24 PM, Sanjay Vivek
<Sa...@newcastle.ac.uk> wrote:
			

				Hi everyone,
				
				I've installed and configured Rampart
1.4 to work with the tutorial at
				http://wso2.org/library/3190 However,
I'm having trouble getting the
				SOAP response from the service when
generating a client using the stub
				classes. The SOAP request headers send
by the client doesn't contain the
				WSSE security headers and I get a
"Exception in thread "main"
				org.apache.axis2.AxisFault: Missing
wsse:Security header in request".
				
				However, everything works fine when I
generate a client using AXIOM. Is
				there a reason why the WSSE headers are
being stripped out when using a
				client generated from the stub classes?
Any help would be appreciated.
				Cheers.
				
				Regards
				--------------
				Sanjay Vivek
				Web Analyst
				Middleware Team
				ISS
				Newcastle University
				
	
---------------------------------------------------------------------
				To unsubscribe, e-mail:
axis-user-unsubscribe@ws.apache.org
				For additional commands, e-mail:
axis-user-help@ws.apache.org
				
				





	-- 
	Nandana Mihindukulasooriya 
	WSO2 inc.
	
	http://nandana83.blogspot.com/
	


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


Re: Exceptions when using a Rampart client generated from stub classes.

Posted by Nandana Mihindukulasooriya <na...@gmail.com>.
Hi Sanjay,

   What is the workaround in this case? Does this mean we can't use Stub
> classes for Axis2.1.4? Cheers.
>

One work around would be to load the policy externally ( as shown in Rampart
policy samples ) and inject it to the Stub.

eg.

SecureServiceStub stub = new SecureServiceStub(ctx);
ServiceClient sc = stub._getServiceClient();
Options options = sc.getOptions();
options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
loadPolicy("/path/to/policy"));

and

private Policy loadPolicy(String xmlPath) throws Exception {
   StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
   return PolicyEngine.getPolicy(builder.getDocumentElement());
}

thanks,
nandana

[1] -
https://svn.apache.org/repos/asf/webservices/rampart/trunk/java/modules/rampart-samples/policy/sample01/src/org/apache/rampart/samples/policy/sample01/Client.java



>  ------------------------------
> *From:* Nandana Mihindukulasooriya [mailto:nandana.cse@gmail.com]
> *Sent:* 28 June 2008 05:31
> *To:* axis-user@ws.apache.org
> *Subject:* Re: Exceptions when using a Rampart client generated from stub
> classes.
>
> I think the issue is with the code generation. In Axis2 1.4, policies
> applied  like  this [1], will be attached to port type not to the binding.
> So if you compare the WSDL generated by Axis2 1.3 [2]  with the WSDL
> generated by Axis2 1.4 , there are different. It seems that code generator
> is not taking policies attached to the port type in to account. If you go
> through the source code of the Stub, popolateAxisService() method, you will
> be able to see whether policies actually are attached to the stub or not.
>
> thanks,
> nandana
>
>
> [1] -
> http://wso2.org/library/3190#Step_4._Engaging_Rampart_and_applying_the_security_policy
> [2] - http://wso2.org/files/UToverHTTPS.xml
>
> On Thu, Jun 26, 2008 at 2:24 PM, Sanjay Vivek <
> Sanjay.Vivek@newcastle.ac.uk> wrote:
>
>> Hi everyone,
>>
>> I've installed and configured Rampart 1.4 to work with the tutorial at
>> http://wso2.org/library/3190 However, I'm having trouble getting the
>> SOAP response from the service when generating a client using the stub
>> classes. The SOAP request headers send by the client doesn't contain the
>> WSSE security headers and I get a "Exception in thread "main"
>> org.apache.axis2.AxisFault: Missing wsse:Security header in request".
>>
>> However, everything works fine when I generate a client using AXIOM. Is
>> there a reason why the WSSE headers are being stripped out when using a
>> client generated from the stub classes? Any help would be appreciated.
>> Cheers.
>>
>> Regards
>> --------------
>> Sanjay Vivek
>> Web Analyst
>> Middleware Team
>> ISS
>> Newcastle University
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>


-- 
Nandana Mihindukulasooriya
WSO2 inc.

http://nandana83.blogspot.com/

RE: Exceptions when using a Rampart client generated from stub classes.

Posted by Sanjay Vivek <Sa...@newcastle.ac.uk>.
Hi Nandana,
 
I looked through the populateAxisService() method for both Axis2.1.3 and
Axis2.1.4 and it appears that the policy is not attached to the Stub for
the populateAxisService() method for Axis2.1.4. What is the workaround
in this case? Does this mean we can't use Stub classes for Axis2.1.4?
Cheers.
 
Regards
Sanjay


________________________________

	From: Nandana Mihindukulasooriya [mailto:nandana.cse@gmail.com] 
	Sent: 28 June 2008 05:31
	To: axis-user@ws.apache.org
	Subject: Re: Exceptions when using a Rampart client generated
from stub classes.
	
	
	I think the issue is with the code generation. In Axis2 1.4,
policies applied  like  this [1], will be attached to port type not to
the binding. So if you compare the WSDL generated by Axis2 1.3 [2]  with
the WSDL generated by Axis2 1.4 , there are different. It seems that
code generator is not taking policies attached to the port type in to
account. If you go through the source code of the Stub,
popolateAxisService() method, you will be able to see whether policies
actually are attached to the stub or not. 
	
	thanks,
	nandana
	
	
	[1] -
http://wso2.org/library/3190#Step_4._Engaging_Rampart_and_applying_the_s
ecurity_policy 
	[2] - http://wso2.org/files/UToverHTTPS.xml
	
	
	On Thu, Jun 26, 2008 at 2:24 PM, Sanjay Vivek
<Sa...@newcastle.ac.uk> wrote:
	

		Hi everyone,
		
		I've installed and configured Rampart 1.4 to work with
the tutorial at
		http://wso2.org/library/3190 However, I'm having trouble
getting the
		SOAP response from the service when generating a client
using the stub
		classes. The SOAP request headers send by the client
doesn't contain the
		WSSE security headers and I get a "Exception in thread
"main"
		org.apache.axis2.AxisFault: Missing wsse:Security header
in request".
		
		However, everything works fine when I generate a client
using AXIOM. Is
		there a reason why the WSSE headers are being stripped
out when using a
		client generated from the stub classes? Any help would
be appreciated.
		Cheers.
		
		Regards
		--------------
		Sanjay Vivek
		Web Analyst
		Middleware Team
		ISS
		Newcastle University
		
	
---------------------------------------------------------------------
		To unsubscribe, e-mail:
axis-user-unsubscribe@ws.apache.org
		For additional commands, e-mail:
axis-user-help@ws.apache.org
		
		



Re: Exceptions when using a Rampart client generated from stub classes.

Posted by Nandana Mihindukulasooriya <na...@gmail.com>.
I think the issue is with the code generation. In Axis2 1.4, policies
applied  like  this [1], will be attached to port type not to the binding.
So if you compare the WSDL generated by Axis2 1.3 [2]  with the WSDL
generated by Axis2 1.4 , there are different. It seems that code generator
is not taking policies attached to the port type in to account. If you go
through the source code of the Stub, popolateAxisService() method, you will
be able to see whether policies actually are attached to the stub or not.

thanks,
nandana


[1] -
http://wso2.org/library/3190#Step_4._Engaging_Rampart_and_applying_the_security_policy
[2] - http://wso2.org/files/UToverHTTPS.xml

On Thu, Jun 26, 2008 at 2:24 PM, Sanjay Vivek <Sa...@newcastle.ac.uk>
wrote:

> Hi everyone,
>
> I've installed and configured Rampart 1.4 to work with the tutorial at
> http://wso2.org/library/3190 However, I'm having trouble getting the
> SOAP response from the service when generating a client using the stub
> classes. The SOAP request headers send by the client doesn't contain the
> WSSE security headers and I get a "Exception in thread "main"
> org.apache.axis2.AxisFault: Missing wsse:Security header in request".
>
> However, everything works fine when I generate a client using AXIOM. Is
> there a reason why the WSSE headers are being stripped out when using a
> client generated from the stub classes? Any help would be appreciated.
> Cheers.
>
> Regards
> --------------
> Sanjay Vivek
> Web Analyst
> Middleware Team
> ISS
> Newcastle University
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>