• Post Reply Bookmark Topic Watch Topic
  • New Topic

Invoking ODM Rules service from an AXIS 2 Web service

 
Ram Appu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

I am Invoking a webservice(Axis-2) which is hosted in Axis server form the client system. This was a n existing functionality from many years. Now we have a requirement to call Jrules Webservice. When it was invoked from parent class , Axis is throwing the Missing Security Header exception.

When created a test client locally, which is hosted in Tomcat server , then there was no issue.

Have added explicitly the wsse header in stub itself to check if it can by pass the issue. However the issue still remains same.

Note: Jrules does not not required Authentication. But since the client code is generated using axis and hosted in axis server , it was asking to pass the security headers to Jrules Webservice.

Stub class



,com.ibm.www.rules.decisionservice.ruleapp.XXX.XXX{
org.apache.axis2.context.MessageContext _messageContext = null;
try{
org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName());
_operationClient.getOptions().setAction("XXX");
_operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);



addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&");


// create a message context
_messageContext = new org.apache.axis2.context.MessageContext();



// create SOAP envelope with that payload
org.apache.axiom.soap.SOAPEnvelope env = null;


OMFactory omFactory = OMAbstractFactory.getOMFactory();
OMElement omSecurityElement = omFactory.createOMElement(new QName( "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security", "wsse"), null);


OMElement omusertoken = omFactory.createOMElement(new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "UsernameToken", "wsu"), null);

OMElement omuserName = omFactory.createOMElement(new QName("", "Username", "wsse"), null);
omuserName.setText("XXX");

OMElement omPassword = omFactory.createOMElement(new QName("", "Password", "wsse"), null);

omPassword.setText("XXX");

omusertoken.addChild(omuserName);
omusertoken.addChild(omPassword);
omSecurityElement.addChild(omusertoken);



env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
nmicIdentifyBidTypeRulesRequest0,
optimizeContent(new javax.xml.namespace.QName("")));

OMNamespace xsi = getFactory(_operationClient.getOptions().getSoapVersionURI()).
createOMNamespace("", "");

env.declareNamespace(xsi);


//adding SOAP soap_headers
_serviceClient.addHeader(omSecurityElement);
_serviceClient.addHeadersToEnvelope(env);
// set the message context with that soap envelope
_messageContext.setEnvelope(env);




// add the message contxt to the operation client
_operationClient.addMessageContext(_messageContext);




//execute the operation client
_operationClient.execute(true);



00000022 AxisEngine E org.apache.axis2.engine.AxisEngine receive WSDoAllReceiver: Incoming message does not contain required Security header
org.apache.axis2.AxisFault: WSDoAllReceiver: Incoming message does not contain required Security header
at org.apache.rampart.handler.WSDoAllReceiver.processBasic(WSDoAllReceiver.java:221)
at org.apache.rampart.handler.WSDoAllReceiver.processMessage(WSDoAllReceiver.java:86)
at org.apache.rampart.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:72)
at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:254)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:160)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:364)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at com.ibm.www.rules.decisionservice.nmicidentifybidtyperuleapp.nmicidentifybidtyperules.NmicIdentifyBidTypeRulesDecisionServiceStub.nmicIdentifyBidTypeRules(NmicIdentifyBidTypeRulesDecisionServiceStub.java:220)
at org.att.services.repassportservice.util.REPassportServiceDAO.getDataFromJruleForBidType(REPassportServiceDAO.java:1023)
at org.att.services.repassportservice.util.REPassportServiceDAO.determineBidInfo(REPassportServiceDAO.java:1081)
at org.att.services.repassportservice.impl.REPassportServiceImpl.receiveSelfNom(REPassportServiceImpl.java:97)
at com.att.nmic.nmic.repassportservice.REPassportServiceSkeleton.send(REPassportServiceSkeleton.java:31)
at com.att.nmic.nmic.repassportservice.REPassportServiceMessageReceiverInOut.invokeBusinessLogic(REPassportServiceMessageReceiverInOut.jav a:48)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:944)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:507)
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:878)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:191)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
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:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1660)

Axis2.xml

<parameter name="OutflowSecurity">
<action>
<items>UsernameToken</items>
<user></user>
<passwordCallbackClass>org.att.security.XXX</passwordCallbackClass>
<passwordType>PasswordText</passwordType>
</action>
</parameter>

<parameter name="InflowSecurity">
<action>
<items>UsernameToken</items>
<passwordCallbackClass>org.att.security.XXX</passwordCallbackClass>
</action>
</parameter>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!