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 Massimiliano Masi <ma...@math.unifi.it> on 2007/11/05 13:09:24 UTC
Error in extracting properties: maybe a FAQ
Hi All,
I am trying to add a custom wsse:Security element in the SOAP envelope
before to apply the policy (since I've some problems with it).
I use this code:
//Service invocation
ServiceClient client = new ServiceClient(ctx, null);
OperationClient operationClient =
client.createClient(ServiceClient.ANON_OUT_IN_OP);
MessageContext outMsgCtx = new MessageContext();
client.engageModule("rampart");
client.engageModule("addressing");
Policy servicePolicy = loadPolicy(pathToPolicy,username);
String service = serviceName;
client.getServiceContext().setProperty(RampartMessageData.KEY_RAMPART_POLICY,
servicePolicy);
Options options = client.getOptions();
options.setAction("RegistryStoredQuery");
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setTo(new EndpointReference(service));
options.setProperty(RampartMessageData.KEY_CUSTOM_ISSUED_TOKEN,
responseToken.getId());
options.setUserName("max");
OMElement payload = XMLUtils.toOM(body);
outMsgCtx.setEnvelope(createSOAPEnvelope(XMLUtils.toOM(header),
XMLUtils.toOM(body), responseToken));
operationClient.addMessageContext(outMsgCtx);
operationClient.execute(true);
MessageContext inMsgtCtx = operationClient.getMessageContext("In");
SOAPEnvelope response = inMsgtCtx.getEnvelope();
//OMElement respElem = client.sendReceive(payload); //waiting
for the jira
//System.out.println("RESPONSE FROM SERVICE: \n" + respElem);
System.out.println("Response from service: "+response);
I get this exception:
If I use the client.sendReceive, everything works.
Thank you,
Massiimiliano.
12:59:32,669 ERROR [STDERR] org.apache.axis2.AxisFault: Error in
extracting message properties
12:59:32,670 ERROR [STDERR] at
org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:70)
12:59:32,671 ERROR [STDERR] at
org.apache.axis2.engine.Phase.invoke(Phase.java:292)
12:59:32,672 ERROR [STDERR] at
org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
12:59:32,673 ERROR [STDERR] at
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:377)
12:59:32,673 ERROR [STDERR] at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
12:59:32,674 ERROR [STDERR] at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
12:59:32,674 ERROR [STDERR] at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
12:59:32,674 ERROR [STDERR] at
com.spirit.XUA.utils.XUAAssertions.sendToService(XUAAssertions.java:757)
12:59:32,675 ERROR [STDERR] at
com.spirit.XUA.actors.AD.TEMPORARY_TEST.temptemp(TEMPORARY_TEST.java:52)
12:59:32,675 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:59:32,676 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
12:59:32,676 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
12:59:32,677 ERROR [STDERR] at
java.lang.reflect.Method.invoke(Method.java:585)
12:59:32,677 ERROR [STDERR] at
org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(RawXMLINOutMessageReceiver.java:97)
12:59:32,678 ERROR [STDERR] at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
12:59:32,678 ERROR [STDERR] at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
12:59:32,679 ERROR [STDERR] at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
12:59:32,679 ERROR [STDERR] at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
12:59:32,680 ERROR [STDERR] at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
12:59:32,680 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
12:59:32,681 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
12:59:32,681 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
12:59:32,681 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
12:59:32,682 ERROR [STDERR] at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
12:59:32,682 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
12:59:32,683 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
12:59:32,683 ERROR [STDERR] at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
12:59:32,684 ERROR [STDERR] at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
12:59:32,684 ERROR [STDERR] at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
12:59:32,685 ERROR [STDERR] at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
12:59:32,685 ERROR [STDERR] at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
12:59:32,686 ERROR [STDERR] at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
12:59:32,686 ERROR [STDERR] at
org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
12:59:32,687 ERROR [STDERR] at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
12:59:32,687 ERROR [STDERR] at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
12:59:32,688 ERROR [STDERR] at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
12:59:32,689 ERROR [STDERR] at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
12:59:32,689 ERROR [STDERR] at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
12:59:32,690 ERROR [STDERR] at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
12:59:32,690 ERROR [STDERR] at java.lang.Thread.run(Thread.java:613)
12:59:32,691 ERROR [STDERR] Caused by:
org.apache.rampart.RampartException: Error in extracting message
properties
12:59:32,692 ERROR [STDERR] at
org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:290)
12:59:32,693 ERROR [STDERR] at
org.apache.rampart.MessageBuilder.build(MessageBuilder.java:58)
12:59:32,693 ERROR [STDERR] at
org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)
12:59:32,694 ERROR [STDERR] ... 39 more
12:59:32,695 ERROR [STDERR] Caused by:
org.apache.ws.security.WSSecurityException: Error in converting SOAP
Envelope to Document; nested exception is:
java.lang.ClassCastException: org.apache.axiom.om.impl.llom.OMElementImpl
12:59:32,695 ERROR [STDERR] at
org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:157)
12:59:32,696 ERROR [STDERR] at
org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:150)
12:59:32,696 ERROR [STDERR] ... 41 more
12:59:32,697 ERROR [STDERR] Caused by: java.lang.ClassCastException:
org.apache.axiom.om.impl.llom.OMElementImpl
12:59:32,698 ERROR [STDERR] at
org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:107)
12:59:32,699 ERROR [STDERR] ... 42 more
12:59:32,700 ERROR [STDERR]
com.spirit.XUA.utils.XUAAssertionException: Error in extracting
message properties
12:59:32,702 ERROR [STDERR] at
com.spirit.XUA.utils.XUAAssertions.sendToService(XUAAssertions.java:773)
12:59:32,751 ERROR [STDERR] at
com.spirit.XUA.actors.AD.TEMPORARY_TEST.temptemp(TEMPORARY_TEST.java:52)
12:59:32,752 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:59:32,753 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
12:59:32,753 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
12:59:32,754 ERROR [STDERR] at
java.lang.reflect.Method.invoke(Method.java:585)
12:59:32,755 ERROR [STDERR] at
org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(RawXMLINOutMessageReceiver.java:97)
12:59:32,755 ERROR [STDERR] at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
12:59:32,756 ERROR [STDERR] at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
12:59:32,756 ERROR [STDERR] at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
12:59:32,757 ERROR [STDERR] at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
12:59:32,757 ERROR [STDERR] at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
12:59:32,758 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
12:59:32,759 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
12:59:32,759 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
12:59:32,760 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
12:59:32,761 ERROR [STDERR] at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
12:59:32,761 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
12:59:32,762 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
12:59:32,762 ERROR [STDERR] at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
12:59:32,763 ERROR [STDERR] at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
12:59:32,764 ERROR [STDERR] at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
12:59:32,764 ERROR [STDERR] at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
12:59:32,765 ERROR [STDERR] at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
12:59:32,765 ERROR [STDERR] at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
12:59:32,766 ERROR [STDERR] at
org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
12:59:32,766 ERROR [STDERR] at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
12:59:32,767 ERROR [STDERR] at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
12:59:32,767 ERROR [STDERR] at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
12:59:32,768 ERROR [STDERR] at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
12:59:32,768 ERROR [STDERR] at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
12:59:32,769 ERROR [STDERR] at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
12:59:32,769 ERROR [STDERR] at java.lang.Thread.run(Thread.java:613)
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org