You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by Sanjay Vivek <Sa...@newcastle.ac.uk> on 2008/03/12 13:10:44 UTC

"Missing wsse:Security header in request" exception when invoking a service.

Hi all,

I'm attempting to invoke a policy enabled client but I'm getting the
following exceptions:

Exception in thread "main" java.lang.RuntimeException:
org.apache.axis2.AxisFault: Missing wsse:Security header in request
	at
edu.internet2.middleware.grouper.webservicesClient.StubGetGroups.getGrou
ps(StubGetGroups.java:100)
	at
edu.internet2.middleware.grouper.webservicesClient.StubGetGroups.main(St
ubGetGroups.java:40)
Caused by: org.apache.axis2.AxisFault: Missing wsse:Security header in
request
	at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java
:486)
	at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(Out
InAxisOperation.java:343)
	at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
ation.java:389)
	at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA
xisOperation.java:211)
	at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163
)
	at
edu.internet2.middleware.grouper.webservicesClient.GrouperServiceStub.ge
tGroups(GrouperServiceStub.java:6128)
	at
edu.internet2.middleware.grouper.webservicesClient.StubGetGroups.getGrou
ps(StubGetGroups.java:85)
	... 1 more


So basically no WSSE headers are going through to the service. The code
snippet for the client is given below. What exactly am I doing wrong?
Any pointers would be very helpful. Cheers.

		ConfigurationContext ctx = 
            	ConfigurationContextFactory.
            	   createConfigurationContextFromFileSystem(confPath,
null);
        	
            GrouperServiceStub stub = new GrouperServiceStub(ctx,
 
"http://localhost:8083/rampartgrouper-ws/services/RampartGrouperService"
);

            
            ServiceClient client = new ServiceClient(ctx, null);
            
            Options options = stub._getServiceClient().getOptions();
            options.setAction("urn:getGroupsSimple");
            options.setTo(targetEPR);
            options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
loadPolicy( confPath + "/conf/policy.xml"));           
            options.setUserName("carlos.tevez@hotmail.com");
            
            client.setOptions(options);            
            client.engageModule("addressing");
            client.engageModule("rampart");

Regards
--------------
Sanjay Vivek
Web Analyst
Middleware Team
ISS
University of Newcastle Upon Tyne

RE: "Missing wsse:Security header in request" exception when invoking a service.

Posted by Sanjay Vivek <Sa...@newcastle.ac.uk>.
Hi Nandana,

The SOAP request is:

<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
      <soapenv:Header>
 
<wsa:To>http://localhost:8083/rampartgrouper-ws/services/RampartGrouperS
ervice</wsa:To>
 
<wsa:MessageID>urn:uuid:BCF8AEBCAE7C34553D1205321590501</wsa:MessageID>
         <wsa:Action>urn:getGroups</wsa:Action>
      </soapenv:Header>
      <soapenv:Body>
         <ns1:getGroups
xmlns:ns1="http://webservices.grouper.middleware.internet2.edu/xsd">
            <ns1:subjectLookup>
               <ns1:subjectId>obi.martins@hotmail.com</ns1:subjectId>
            </ns1:subjectLookup>
            <ns1:memberFilter>All</ns1:memberFilter>
            <ns1:actAsSubjectLookup>
               <ns1:subjectId>carlos.tevez@hotmail.com</ns1:subjectId>
            </ns1:actAsSubjectLookup>
         </ns1:getGroups>
      </soapenv:Body>
   </soapenv:Envelope>


And the SOAP response is:

 <soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
      <soapenv:Header>
 
<wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
 
<wsa:RelatesTo>urn:uuid:BCF8AEBCAE7C34553D1205321590501</wsa:RelatesTo>
      </soapenv:Header>
      <soapenv:Body>
         <soapenv:Fault>
            <soapenv:Code>
               <soapenv:Value>soapenv:Receiver</soapenv:Value>
            </soapenv:Code>
            <soapenv:Reason>
               <soapenv:Text xml:lang="en-US">Missing wsse:Security
header in request</soapenv:Text>
            </soapenv:Reason>
            <soapenv:Detail />
         </soapenv:Fault>
      </soapenv:Body>
   </soapenv:Envelope>


Unfortunately the logs from TCPMON doesn't really say much. I'm guessing
I've got the configuration wrong for the client but not sure what I've
done wrong. I've also attached the client code with this email for your
reference.  Thanks again.

Regards
Sanjay

>-----Original Message-----
>From: Nandana Mihindukulasooriya [mailto:nandana.cse@gmail.com] 
>Sent: 12 March 2008 12:16
>To: rampart-dev@ws.apache.org
>Subject: Re: "Missing wsse:Security header in request" 
>exception when invoking a service.
>
>Hi Sanjay,
>
> can post the SOAP request and response captured from a TCPMon 
>, it would be easy to see what is going wrong.
>
>thanks,
>/nandana
>

Re: "Missing wsse:Security header in request" exception when invoking a service.

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

 can post the SOAP request and response captured from a TCPMon , it
would be easy to see what is going wrong.

thanks,
/nandana

On Wed, Mar 12, 2008 at 5:40 PM, Sanjay Vivek
<Sa...@newcastle.ac.uk> wrote:
> Hi all,
>
>  I'm attempting to invoke a policy enabled client but I'm getting the
>  following exceptions:
>
>  Exception in thread "main" java.lang.RuntimeException:
>  org.apache.axis2.AxisFault: Missing wsse:Security header in request
>         at
>  edu.internet2.middleware.grouper.webservicesClient.StubGetGroups.getGrou
>  ps(StubGetGroups.java:100)
>         at
>  edu.internet2.middleware.grouper.webservicesClient.StubGetGroups.main(St
>  ubGetGroups.java:40)
>  Caused by: org.apache.axis2.AxisFault: Missing wsse:Security header in
>  request
>         at
>  org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java
>  :486)
>         at
>  org.apache.axis2.description.OutInAxisOperationClient.handleResponse(Out
>  InAxisOperation.java:343)
>         at
>  org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
>  ation.java:389)
>         at
>  org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA
>  xisOperation.java:211)
>         at
>  org.apache.axis2.client.OperationClient.execute(OperationClient.java:163
>  )
>         at
>  edu.internet2.middleware.grouper.webservicesClient.GrouperServiceStub.ge
>  tGroups(GrouperServiceStub.java:6128)
>         at
>  edu.internet2.middleware.grouper.webservicesClient.StubGetGroups.getGrou
>  ps(StubGetGroups.java:85)
>         ... 1 more
>
>
>  So basically no WSSE headers are going through to the service. The code
>  snippet for the client is given below. What exactly am I doing wrong?
>  Any pointers would be very helpful. Cheers.
>
>                 ConfigurationContext ctx =
>                 ConfigurationContextFactory.
>                    createConfigurationContextFromFileSystem(confPath,
>  null);
>
>             GrouperServiceStub stub = new GrouperServiceStub(ctx,
>
>  "http://localhost:8083/rampartgrouper-ws/services/RampartGrouperService"
>  );
>
>
>             ServiceClient client = new ServiceClient(ctx, null);
>
>             Options options = stub._getServiceClient().getOptions();
>             options.setAction("urn:getGroupsSimple");
>             options.setTo(targetEPR);
>             options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
>  loadPolicy( confPath + "/conf/policy.xml"));
>             options.setUserName("carlos.tevez@hotmail.com");
>
>             client.setOptions(options);
>             client.engageModule("addressing");
>             client.engageModule("rampart");
>
>  Regards
>  --------------
>  Sanjay Vivek
>  Web Analyst
>  Middleware Team
>  ISS
>  University of Newcastle Upon Tyne


http://nandana83.blogspot.com/
http://nandanasm.wordpress.com/