Error installing Axis2.war in Jboss
Hi All, I am having trouble installing Axis2 1.4.1 or 1.5 they both are giving same error as below. All I did was to put axis2.war in jboss-5.1.0.GA \server\default. This is in both Jboss 5.1and 5.01 Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration at org.apache.xerces.parsers.SAXParser.init(Unknown Source) at org.apache.xerces.parsers.SAXParser.init(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.init(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.init(Unknown Source) at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source) at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.init(SaxJBossXBParser.java:92) ... 75 more 2009-06-16 15:17:28,039 ERROR [org.jboss.web.tomcat.service.deployers.JBossContextConfig] (main) XML error parsing: jboss.web/localhost/context.xml.default org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100) at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processContextConfig(JBossContextConfig.java:549) at org.jboss.web.tomcat.service.deployers.JBossContextConfig.init(JBossContextConfig.java:537) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java: Please let me know if you have it working in Jboss. Thanks a lot -rishi
Re: Rampart with JAX-WS
Hi All, I tried engaging Rampart module globally and since I am writing JAX-WS - thought it might be the way to enable security. But now I am wondering where should I put policy.xml fil. I am getting following exception: 2009-06-04 11:56:04,420 [HttpConnection--2] ERROR org.apache.axis2.engine.AxisEngine - Must Understand check failed for headers: { http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security org.apache.axis2.AxisFault: Must Understand check failed for headers: { http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security at org.apache.axis2.jaxws.handler.HandlerUtils.checkMustUnderstand(HandlerUtils.java:157) at org.apache.axis2.jaxws.server.EndpointController.handleRequest(EndpointController.java:261) at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:98) at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:159) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275) at org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:278) at org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:281) at org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:187) at org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:82) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575) at java.lang.Thread.run(Thread.java:619) 2009-06-04 11:56:04,436 [HttpConnection--2] WARN org.apache.axis2.transport.http.server.HttpServiceProcessor - Error in extracting message properties org.apache.axis2.AxisFault: Error in extracting message properties at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:70) at org.apache.axis2.engine.Phase.invoke(Phase.java:317) I am using SOAP UI to create WS-Security request (Username / Password basic) and monitoring via tcpmon - it does create WS_Security request - But I think its failing on server side because server does not know how to process this security header. I have to tell how to parse. Traditionally we can do via service.xml file but not in this. Hence I thought if I put pocily.xml in /conf (where axis2.xml) directory - it would load/ But it does not. Any thoughts - thanks a lot, rishi On Wed, Jun 3, 2009 at 7:16 PM, Kapur, Rajneesh rka...@activehealth.netwrote: Hi, I got Axis2 1.5 build but did not find any samples or docs as how to engage Rampart in JAX-WS style. Since we don't have service.xml in JAX-WS, what options do we have? Paul, if you or someone please have samples or explain the procedure - that would be very nice. Another option posted by Sagar (as link) was to implement org.apache.axis2.service. Lifecycle interface and in the init method I will get ServiceContext - from where I can get AxisService and engage it like that. But for me this init method is never invoked by Axis framework. Here is what I have: @WebService(serviceName = PIXQueryResponseService) public class SampleJAXWSService implements Lifecycle { @WebMethod public String myMethod(String msg){ } @Override public void destroy(ServiceContext arg0) { log.debug( destroy called.***); } @Override public void init(ServiceContext arg0) throws AxisFault { log.debug( init called.***); AxisService service = arg0.getAxisService(); log.debug( inside init: + service.getName()); } } Please let me know where I am making mistake, and guide. Thanks a lot, rishi -- IMPORTANT WARNING: Information contained in this email is intended for the use of the individual to whom it is addressed, and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If you are not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is STRICTLY FORBIDDEN. If you have received this communication in error, please notify us immediately by return email and delete this document. Thank you.
Re: Rampart with JAX-WS
Hi All, I was finally able to get Rampart 1.4 working with JAX-WS style service. I am using Axis2 1.4.1 version and here is what I did. I had to engage Rampart globally and added the following in axis2.xml file. *parameter name=InflowSecurity action itemsUsernameToken/items passwordCallbackClasscom.sample.PWCBHandler/passwordCallbackClass /action /parameter* Loads of thanks to Axis2 community, and my colleagues. -rishi On Thu, Jun 4, 2009 at 12:11 PM, rishi kapur@gmail.com wrote: Hi All, I tried engaging Rampart module globally and since I am writing JAX-WS - thought it might be the way to enable security. But now I am wondering where should I put policy.xml fil. I am getting following exception: 2009-06-04 11:56:04,420 [HttpConnection--2] ERROR org.apache.axis2.engine.AxisEngine - Must Understand check failed for headers: { http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Securityhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd%7DSecurity org.apache.axis2.AxisFault: Must Understand check failed for headers: { http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Securityhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd%7DSecurity at org.apache.axis2.jaxws.handler.HandlerUtils.checkMustUnderstand(HandlerUtils.java:157) at org.apache.axis2.jaxws.server.EndpointController.handleRequest(EndpointController.java:261) at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:98) at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:159) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275) at org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:278) at org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:281) at org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:187) at org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:82) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575) at java.lang.Thread.run(Thread.java:619) 2009-06-04 11:56:04,436 [HttpConnection--2] WARN org.apache.axis2.transport.http.server.HttpServiceProcessor - Error in extracting message properties org.apache.axis2.AxisFault: Error in extracting message properties at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:70) at org.apache.axis2.engine.Phase.invoke(Phase.java:317) I am using SOAP UI to create WS-Security request (Username / Password basic) and monitoring via tcpmon - it does create WS_Security request - But I think its failing on server side because server does not know how to process this security header. I have to tell how to parse. Traditionally we can do via service.xml file but not in this. Hence I thought if I put pocily.xml in /conf (where axis2.xml) directory - it would load/ But it does not. Any thoughts - thanks a lot, rishi On Wed, Jun 3, 2009 at 7:16 PM, Kapur, Rajneesh rka...@activehealth.netwrote: Hi, I got Axis2 1.5 build but did not find any samples or docs as how to engage Rampart in JAX-WS style. Since we don't have service.xml in JAX-WS, what options do we have? Paul, if you or someone please have samples or explain the procedure - that would be very nice. Another option posted by Sagar (as link) was to implement org.apache.axis2.service. Lifecycle interface and in the init method I will get ServiceContext - from where I can get AxisService and engage it like that. But for me this init method is never invoked by Axis framework. Here is what I have: @WebService(serviceName = PIXQueryResponseService) public class SampleJAXWSService implements Lifecycle { @WebMethod public String myMethod(String msg){ } @Override public void destroy(ServiceContext arg0) { log.debug( destroy called.***); } @Override public void init(ServiceContext arg0) throws AxisFault { log.debug( init called.***); AxisService service = arg0.getAxisService(); log.debug( inside init: + service.getName()); } } Please let me know where I am making mistake, and guide. Thanks a lot, rishi -- IMPORTANT WARNING: Information contained in this email is intended for the use of the individual to whom it is addressed, and may contain information
Re: Getting the Content Lenth of The SOAP Response
Sriram, I am by no means an expert but thought it might help you - so please take it into consideration while implementing it or spending time on it. - From what I understand you need content's length in SoapEnvelope. -- to do so: There might be another easier way to do so: but one way I could think is -- inside your messageReceiver - you have handle to MessageContenxt - from that you can get SOAPEnvelope and then you can extract SoapHeader and SoapBody - Assuming you have Text message - do string.length on it and add new OMElement as child of SoapHeaderBlock (please see AXIOM API) -regards, rishi
service specific folder configuration
Hi all, you know how we deploy all services in /WEB-INF/services/ folder -- But my requirement is to have service specific folder mapping. Therefore I thought if I create folder in services directory as myservice1 and myservice2 and deploy them as follows: 1) /WEB-INF/services/myservice1/myService1 2) /WEB-INF/services/myservice2/myService2 The goal is that if the user says http://localhost:/axis2/services/myservice1/myService1?wsdl -- then he/she should be able to get the wsdl same if she does http://localhost:/axis2/services/myservice2/myService2?wsdl -- then he/she should be able to get the wsdl I am testing this in Tomcat 6.0.18 and have axis2.1.4.1 Please let me know how can I achieve this - thanks a lot. regards, rishi
adding schema reference to Soap Envelope
Hi, I am new to Axis2 and was wondering how can get a handle to response SoapEnvelope? I want to update the response SoapEnvelop element (generated by Axis2 ) as: original: soapenv:Envelope xmlns:soapenv= http://www.w3.org/2003/05/soap-envelope; update it to: soapenv:Envelope xmlns:soapenv= http://www.w3.org/2003/05/soap-envelope; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://www.w3.org/2003/05/soap-envelope http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd; The reason I want to do is because my response payload within the body has following 3 things: 1) return code (string) 2) memberId (Long) 3) xml document ( of type String) Since this is a xml document -- its root element also defines xmlns:xsi= http://www.w3.org/2001/XMLSchema-instanceand xsi:schemaLocation... Now if I don't wrap this element in CDATA section - then XMLSpy says -- The element declaration was not found for root element soapenv:Envelope But if I don't wrap it with CDATA section and update soapenv:Envelope to have xmlns:xsi and xsi:schemaLocation (as stated above) --- then everything is fine. So I was wondering where and how should I update the outgoing soapEnvelope to have above mentioned references. Please let me know - really appreciate your help. -Rishi
Re: wsdl2java issue in upgrading from axis 1.2 to 1.4
Is there any workaround for this problem? What i was thinking was to use wsdl2java of axis1.2 and use axis 1.4 for actual SOAP requests. But when i tried it by replacing the jars, it seems not working :( On Mon, Mar 30, 2009 at 8:56 PM, Jean-christophe cazeaux jccazeau...@gmail.com wrote: Hello, I got exactly the same issue. This occurs with axis 1.3 and axis 1.4. If you add a foo attribute in your wsdl like this : complexType name=ItemList sequence element name=foo type=anyType/ element name=ItemEntry type=abcd:ItemEntry minOccurs=0 maxOccurs=49 nillable=true/ /sequence /complexType The java Class ItemList will be correctly generated. So it appears to be a regression in axis from 1.3... Maybe someone has an other explanation and/or solution? JC 2009/3/30 Rishi Renjith rishirenj...@gmail.com: Hello, In my project, we are planning to upgrade from axis 1.2 to axis 1.4. But when we tested, we noticed that wsdl2java is not generating some java classes which it used to generate in axis 1.2 For eg, with the wsdl structure as below, complexType name=ItemEntry sequence element name=one type=abcd:DOW minOccurs=1 maxOccurs=1/ element name=two type=xsd:time minOccurs=0 maxOccurs=1 nillable=true/ /sequence /complexType complexType name=ItemList sequence element name=ItemEntry type=abcd:ItemEntry minOccurs=0 maxOccurs=49 nillable=true/ /sequence /complexType complexType name=Item-loc sequence element name=ItemList type=abcd:ItemList minOccurs=0 maxOccurs=1 nillable=true/ /sequence /complexType wsdl2java is not generating a class for ItemList in axis 1.4, but it used to generate a class for ItemList in axis1.2. Is wsdl2java in 1.4 backward compatible with 1.2 ? Thanks, Rishi
wsdl2java issue in upgrading from axis 1.2 to 1.4
Hello, In my project, we are planning to upgrade from axis 1.2 to axis 1.4. But when we tested, we noticed that wsdl2java is not generating some java classes which it used to generate in axis 1.2 For eg, with the wsdl structure as below, complexType name=ItemEntry sequence element name=one type=abcd:DOW minOccurs=1 maxOccurs=1/ element name=two type=xsd:time minOccurs=0 maxOccurs=1 nillable=true/ /sequence /complexType complexType name=ItemList sequence element name=ItemEntry type=abcd:ItemEntry minOccurs=0 maxOccurs=49 nillable=true/ /sequence /complexType complexType name=Item-loc sequence element name=ItemList type=abcd:ItemList minOccurs=0 maxOccurs=1 nillable=true/ /sequence /complexType wsdl2java is not generating a class for ItemList in axis 1.4, but it used to generate a class for ItemList in axis1.2. Is wsdl2java in 1.4 backward compatible with 1.2 ? Thanks, Rishi
xsd:double
Hi We have an xml element of schema type double and since we are coding in java I have used the following api - String.valueOf(double) to convert a double to a string while creating the xml] and Double.parseDouble(String) to create a double out of that. Now there are some systems that seems to have problem with the scientific notation and they want the double value with only the decimal dot separator without haveing to deal with the E. Is there a way in java that I can acheive that without breaking the schema? Fro example when I convert double . to string I get 9.999E7 in the xml. Can I get . in xml instead through some java api? -- thanks Rishi
getting ServletConfig instance from MessageContext in Axis2 1.1
Hi I was wondering if there is a way to get the ServletConfig [not ServletContext] handle of the AxisServlet from the MessageContext instance in my web service class. I tried the following code and it didnt work Servlet servlet = (Servlet)MessageContext.*getCurrentMessageContext*(). getProperty(org.apache.axis2.transport.http.HTTPConstants.*MC_HTTP_SERVLET* ); *return* servlet.getServletConfig();--got NullpointerException here Is there a way to do this inside the service. -- thanks Rishi
encrypting the usernametoken header and the body using policy
Hi All I am new to policy and struggling to create a server policy file where in I can specify the requirement that the usernametoken header should be encrypted as well as the body. Does anyone has any sample policy which will do that. I had this policy file but the server fails me saying that the EncryptedData was not expected error. ?xml version=1.0 encoding=UTF-8? wsp:Policy xmlns:wsp=http://schemas.xmlsoap.org/ws/2004/09/policy; xmlns:sp=http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512; xmlns:spe= http://www.ibm.com/xmlns/prod/websphere/200605/ws-securitypolicy-ext; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xmi= http://schema.omg.org/spec/XMI/1.0; xmlns:wsu= http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd sp:SupportingTokens wsp:Policy wsu:Id=request:uname_token sp:UsernameToken sp:IncludeToken= http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512/IncludeToken/AlwaysToRecipient wsp:Policy sp:WssUsernameToken10 /sp:WssUsernameToken10 /wsp:Policy /sp:UsernameToken /wsp:Policy /sp:SupportingTokens sp:AsymmetricBinding wsp:Policy sp:InitiatorToken wsp:Policy sp:X509Token sp:IncludeToken= http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512/IncludeToken/AlwaysToInitiator wsp:Policy sp:WssX509V3Token10 / /wsp:Policy /sp:X509Token /wsp:Policy /sp:InitiatorToken sp:AlgorithmSuite wsp:Policy sp:Basic128Rsa15 / /wsp:Policy /sp:AlgorithmSuite sp:RecipientToken wsp:Policy sp:X509Token sp:IncludeToken= http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512/IncludeToken/AlwaysToRecipient wsp:Policy sp:WssX509V3Token10 / /wsp:Policy /sp:X509Token /wsp:Policy /sp:RecipientToken sp:Layout wsp:Policy sp:Strict / /wsp:Policy /sp:Layout /wsp:Policy /sp:AsymmetricBinding wsp:Policy wsu:Id=request:encrypt sp:EncryptedParts sp:Body/ sp:Header Name=UsernameToken Namespace= http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd/ /sp:EncryptedParts sp:EncryptedElements sp:XPath/*[namespace-uri()=' http://schemas.xmlsoap.org/soap/envelope/' and local-name()='Envelope']/*[namespace-uri()=' http://schemas.xmlsoap.org/soap/envelope/' and local-name()='Header']/*[namespace-uri()=' http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' and local-name()='Security']/*[namespace-uri()=' http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' and local-name()='UsernameToken']/sp:XPath /sp:EncryptedElements /wsp:Policy wsp:Policy wsu:Id=response:encrypt sp:EncryptedParts sp:Body/ /sp:EncryptedParts sp:EncryptedElements sp:XPath/*[namespace-uri()=' http://schemas.xmlsoap.org/soap/envelope/' and local-name()='Envelope']/*[namespace-uri()=' http://schemas.xmlsoap.org/soap/envelope/' and local-name()='Header']/*[namespace-uri()=' http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' and local-name()='Security']/*[namespace-uri()=' http://www.w3.org/2000/09/xmldsig#' and local-name()='Signature']/sp:XPath /sp:EncryptedElements /wsp:Policy /wsp:Policy -- thanks Rishi
Re: service deployment using axis2 api
thanks Deepal that worked for me. On 5/17/07, Deepal Jayasinghe [EMAIL PROTECTED] wrote: Hi Rishi , As I can see always you are creating a new configurationContext and not use the server's configurationContext that is why you do not see your service when you browse to it. Try to get the server's configurationContext and add the service to it, Thanks Deepal Hi I was wondering if anyone tried programmatic deployment of Axis2 services without say creating an aar file. I have Axis2 deployed as a web module inside my application ear file. Its supposed to run on any app server. I am trying to use the code below [which will be called at startup of the server] to deploy a service in Axis2. I am using the axis2 admin console to see if the service appears - but I dont see it in the available services and if I try to send a message to it - it returns with service not found error. I have the AxisServlet deployed in my web.xml but I didnt set any axis2.xml.path or axis2.repository.path. Not sure what else I need to do to get this working. If try the aar way - the same service works great. Its only when I try to go without aar I have this issue. public void deployWebService(String serviceName, String operation) throws AxisFault { AxisServiceGroup serviceGroup; AxisConfiguration axis2Config; String axisConfigFile = axis2.xml; ConfigurationContext configContext; System.out.println(In deployy); try { if (configContext == null) { configContext = ConfigurationContextFactory .createConfigurationContextFromFileSystem(C:\\deployment\\axis2, C:\\deployment\\axis2\\axis2.xml); axis2Config = configContext.getAxisConfiguration(); } } catch (AxisFault e) { e.printStackTrace(); } if (serviceGroup == null) { serviceGroup = new AxisServiceGroup(); } AxisService axisService = new AxisService(serviceName); axisService.setClientSide(false); axisService.setParent (serviceGroup); AxisOperation axisOp = AxisOperationFactory.getAxisOperation(WSDLConstants.MEP_CONSTANT_IN_OUT ); axisOp.setName(new QName(operation)); MessageReceiver messageReceiver = new RawXMLINOutMessageReceiver(); axisOp.setMessageReceiver(messageReceiver); axisOp.setSoapAction(urn:+operation); PhasesInfo pinfo = axis2Config.getPhasesInfo(); pinfo.setOperationPhases(axisOp); axisService.addOperation (axisOp); Parameter param1 = new Parameter(WSConstants.PARAM_SERVICE_CLASS, WSConstants.STANDARD_SERVICE); axisService.addParameter(param1); Parameter param2 = new Parameter(WSConstants.MAX_SERVICE, serviceName); axisService.addParameter(param2); Parameter param3 = new Parameter(WSConstants.PARAM_QUEUED, false); axisService.addParameter(param3); Parameter param4 = new Parameter(WSConstants.PARAM_SECURITY, None); axisService.addParameter(param4); serviceGroup.addService(axisService); axis2Config.addServiceGroup(serviceGroup); } -- thanks Rishi -- Thanks, Deepal The highest tower is built one brick at a time - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- thanks Rishi
Re: Stax and Axis2
AXIOM implementation is based on StAX - but u can plugin any stax implemenation with it. We have tried both IBM and BEA implementation of stax and it works great with all of them. On 5/16/07, Vibhor_Sharma [EMAIL PROTECTED] wrote: Hi Few conceptual question why did we use the STAX in Axis2 and why is it so important to use it ? why was'nt SAX used? Why only woodstox STAX used why not some other implementation? Is it possible to plugin any other event based parser in Axis2? or it relies on woodstox and for that matter STAX only? Thanks Vibhor -- thanks Rishi
service deployment using axis2 api
Hi I was wondering if anyone tried programmatic deployment of Axis2 services without say creating an aar file. I have Axis2 deployed as a web module inside my application ear file. Its supposed to run on any app server. I am trying to use the code below [which will be called at startup of the server] to deploy a service in Axis2. I am using the axis2 admin console to see if the service appears - but I dont see it in the available services and if I try to send a message to it - it returns with service not found error. I have the AxisServlet deployed in my web.xml but I didnt set any axis2.xml.path or axis2.repository.path. Not sure what else I need to do to get this working. If try the aar way - the same service works great. Its only when I try to go without aar I have this issue. public void deployWebService(String serviceName, String operation) throws AxisFault { AxisServiceGroup serviceGroup; AxisConfiguration axis2Config; String axisConfigFile = axis2.xml; ConfigurationContext configContext; System.out.println(In deployy); try { if (configContext == null) { configContext = ConfigurationContextFactory .createConfigurationContextFromFileSystem(C:\\deployment\\axis2, C:\\deployment\\axis2\\axis2.xml); axis2Config = configContext.getAxisConfiguration(); } } catch (AxisFault e) { e.printStackTrace(); } if (serviceGroup == null) { serviceGroup = new AxisServiceGroup(); } AxisService axisService = new AxisService(serviceName); axisService.setClientSide(false); axisService.setParent(serviceGroup); AxisOperation axisOp = AxisOperationFactory.getAxisOperation( WSDLConstants.MEP_CONSTANT_IN_OUT); axisOp.setName(new QName(operation)); MessageReceiver messageReceiver = new RawXMLINOutMessageReceiver(); axisOp.setMessageReceiver(messageReceiver); axisOp.setSoapAction(urn:+operation); PhasesInfo pinfo = axis2Config.getPhasesInfo(); pinfo.setOperationPhases(axisOp); axisService.addOperation(axisOp); Parameter param1 = new Parameter(WSConstants.PARAM_SERVICE_CLASS, WSConstants.STANDARD_SERVICE); axisService.addParameter(param1); Parameter param2 = new Parameter(WSConstants.MAX_SERVICE, serviceName); axisService.addParameter(param2); Parameter param3 = new Parameter(WSConstants.PARAM_QUEUED, false); axisService.addParameter(param3); Parameter param4 = new Parameter(WSConstants.PARAM_SECURITY, None); axisService.addParameter(param4); serviceGroup.addService(axisService); axis2Config.addServiceGroup(serviceGroup); } -- thanks Rishi
Re: wsdl message with no parts
Hi Anne thanks for the clarification. I am wondering if what you said for RPC type is also valid for the wrapped doc-lit type too [which kind of similar to rpc literal type and which is followed by .Net]. I mean if a pojo service method signature reads -- public void test(String s) The response wsdl message will have a part element like --- message name=wsns:testResponseMessage part name=output element=myns:testResponse/ /message -right? as opposed to having no part defined like message name=wsns:testTesponseMessage /message I am generating the service wsdl on my own and am integrating to .Net paltform [.Net is the client]. Since .Net seems to be following the wrapped doc-lit style do you think I should generate the wsdl response message with a non-empty part as shown above [even though the pojo method has void return type] This will imply that for a request response kind of web service we allways need to have a response message with one part element to be compliant with .Net? That seems little to harsh for me as I didnt find any such requirement in BP 1.1 OR this is something that is introduced just because of .Net? thanks Rishi On 3/31/07, Anne Thomas Manes [EMAIL PROTECTED] wrote: It depends on the style. If you are using document style, an empty message declaration with no parts (either input or output) will generate an empty SOAP body. If you are using rpc style, an empty input message declaration will generate a SOAP body containing an element that has a local name equal to the operation name in the namespace specified in the soap:body declaration in the binding. An empty output message declaration will generate a SOAP body containing an element representing the response value (in this case, void). The name of the response element is not significant, but by convention it has a local name constructed from the operation name appended with Response and it is in the namespace specified in the soap:body declaration. Anne On 3/30/07, Rishi krish [EMAIL PROTECTED] wrote: Also just wanted to show what the TCP monitor is howing for the response ?xml version=1.0 encoding=UTF-8? soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd= http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; soapenv:Body/ /soapenv:Envelope So the body elemet is empty and the wsdl snippet is below: message name=AddrMessage part name=input element=inx:Address / /message message name=AddrMessageResponse / portType name=AddrPortType operation name=processAddr input message=inws:AddrMessage / output message=inws:AddrMessageResponse / /operation /portType Note the AddrMessageResponse definition - thats empty too. So can I conclude that an empty wsdlmessage definition would imply a empty soap body element in wire? thanks Rishi On 3/30/07, Amila Suriarachchi [EMAIL PROTECTED] wrote: On 3/29/07, Rishi krish [EMAIL PROTECTED] wrote: Hi All This is probably a generic wsdl question - I will be using a the Axis2 serviceclient api to call a web service which has a wsdl operation [with http binding] the outpout of which refers to a wsdl:message which has no parts defined. I am wondering what that means for the service response? http binding has not clearly defined in wsdl 1.1. so if you deal with http bindings better to use WSDL 2.0 Athe response would be an empty soap body if you use http binding you would not get any soap messages. So we can throw this option. Actually this is the case if you have above serario with a document/literal binding. BThe response would be just an http response with no trace of soap. [no soap envelope] I think this should be the case. the problem here is that wsdl 1.1spec does not clearly specify whether we have to use the rpc type message construction or document type message construction with http binding. Can anyone pls confirm what should be the response if the service/soap engine is behaving correctly? -- thanks Rishi -- Amila Suriarachchi, WSO2 Inc. -- thanks Rishi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- thanks Rishi
Re: wsdl message with no parts
Hi Amila I am sorry for confusing the qustion. I am WSDL is using soap binding with http as the transport protocol. In my secnario the WSDL operation has both intput and output message and the output message has no part associated with it. My question was should the service response contain an empty soap body element or should it contain no soap reference at all [I mean empty http message body]. I read somewhere it should be an empty soap body element but wanted to verify what people in this forum think it should be. thanks Rishi On 3/30/07, Amila Suriarachchi [EMAIL PROTECTED] wrote: On 3/29/07, Rishi krish [EMAIL PROTECTED] wrote: Hi All This is probably a generic wsdl question - I will be using a the Axis2 serviceclient api to call a web service which has a wsdl operation [with http binding] the outpout of which refers to a wsdl:message which has no parts defined. I am wondering what that means for the service response? http binding has not clearly defined in wsdl 1.1. so if you deal with http bindings better to use WSDL 2.0 Athe response would be an empty soap body if you use http binding you would not get any soap messages. So we can throw this option. Actually this is the case if you have above serario with a document/literal binding. BThe response would be just an http response with no trace of soap. [no soap envelope] I think this should be the case. the problem here is that wsdl 1.1 spec does not clearly specify whether we have to use the rpc type message construction or document type message construction with http binding. Can anyone pls confirm what should be the response if the service/soap engine is behaving correctly? -- thanks Rishi -- Amila Suriarachchi, WSO2 Inc. -- thanks Rishi
Re: wsdl message with no parts
Also just wanted to show what the TCP monitor is howing for the response ?xml version=1.0 encoding=UTF-8? soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; soapenv:Body/ /soapenv:Envelope So the body elemet is empty and the wsdl snippet is below: message name=AddrMessage part name=input element=inx:Address / /message message name=AddrMessageResponse / portType name=AddrPortType operation name=processAddr input message=inws:AddrMessage / output message=inws:AddrMessageResponse / /operation /portType Note the AddrMessageResponse definition - thats empty too. So can I conclude that an empty wsdlmessage definition would imply a empty soap body element in wire? thanks Rishi On 3/30/07, Amila Suriarachchi [EMAIL PROTECTED] wrote: On 3/29/07, Rishi krish [EMAIL PROTECTED] wrote: Hi All This is probably a generic wsdl question - I will be using a the Axis2 serviceclient api to call a web service which has a wsdl operation [with http binding] the outpout of which refers to a wsdl:message which has no parts defined. I am wondering what that means for the service response? http binding has not clearly defined in wsdl 1.1. so if you deal with http bindings better to use WSDL 2.0 Athe response would be an empty soap body if you use http binding you would not get any soap messages. So we can throw this option. Actually this is the case if you have above serario with a document/literal binding. BThe response would be just an http response with no trace of soap. [no soap envelope] I think this should be the case. the problem here is that wsdl 1.1 spec does not clearly specify whether we have to use the rpc type message construction or document type message construction with http binding. Can anyone pls confirm what should be the response if the service/soap engine is behaving correctly? -- thanks Rishi -- Amila Suriarachchi, WSO2 Inc. -- thanks Rishi
wsdl message with no parts
Hi All This is probably a generic wsdl question - I will be using a the Axis2 serviceclient api to call a web service which has a wsdl operation [with http binding] the outpout of which refers to a wsdl:message which has no parts defined. I am wondering what that means for the service response? Athe response would be an empty soap body BThe response would be just an http response with no trace of soap. [no soap envelope] Can anyone pls confirm what should be the response if the service/soap engine is behaving correctly? -- thanks Rishi
truststore in rampart 1.1
Hi I was wondering if there is a way to specify the truststore in the crypto properties file while configuring signature/encryption using rampart 1.1. JSSE recommends the usage of truststore [storing the ca certs] and keystore[storing the private key] and I see only one entry in the rampart crypto properties file samples org.apache.ws.security.crypto.merlin.file which I assume is the keystore. We can put all the cacerts in that one keystore - but I would rather not if there is a way to specify both stores. Any suggestions? -- thanks Rishi
Re: sendReceive and sendRobust
Hi Keith/Depal I had read that article and I beleive still I have few questions on this: Whats an in-only operation - is it mapping to an operation like void test(OMElement om) on the Service? I tried that operation type with sendReceive and it worked [the service was also deployed in axis2 with RawXMLInOut] - so when you say sendReceive has designed to invoke in-out it is not recommended to use that to invoke in-only operation and if you do so you will get exception as well, I didnt get an exception - so do you say that I should not use sendReceive as not getting exception is a bug?? Ideally I would like to ask this question - I have a service which has on operation public OMElement test(OMElement) This method might return null for some cases of invocation. But I just didnt want to have 2 separate methods one return void and another return OMElement. So there is just one method [as above]. Now I have deployed this service in Axis2 and associated the operation with RawXMLInOutReceive... Now starts the client part: I am using only sendReceive and tested both the cases of null return and non null return on that service and everything works fine. Is this right? or you think this is a bug and I am just lucky to get it working? thanks Anamitra On 2/27/07, keith chapman [EMAIL PROTECTED] wrote: This might help too http://wso2.org/library/290 Thanks, Keith On 2/28/07, Rishi krish [EMAIL PROTECTED] wrote: Hi All I am confused abt the usage of these 2 methods in the ServiceClient class. As per the axis2 doc - we should use sendRobust if we are not needing the response but care abt the fault and we should use sendReceive if we care abt the reponse and fault. Does it mean that calling sendReceive should work in both cases? Case 1 The web service operation I am calling has no response [service method has java void as return type] Case 2The web service operation has declared [service method has OMElement as return type] response but Case2 afor an invocation of that method it returns null Case2 bfor another invocation it return data. I am testing my application with these above cases [and subcases] and its working with sendReceive in client. In that case I am not clear whats the use of having sendRobust ?? It seems using sendReceive will be enough for handling all the cases - right? I am writing my own DII Web Service Client using the ServiceClient api. Unless really needed I want to use sendReceive and fireAndForget [for oneway]. Can anyone point me if I am not getting this right. -- thanks Rishi -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/ -- thanks Rishi
axis2 adding extra namespace declaration in response
Hi I am using axis2 1.1.1 [released version] and I am using RawXMLINOutMessageReceiver for my service operation. In the response Axis2 is adding an extra namespace which I beleive is derived from the package name of my service class. So if my service class is in package abc.bcd then its adding a namespace declaration like xmlns:tns=http://bcd.abc; in the root element of my response message. This looks like a bug - its not bothering me too much - but I dont like my response getting modified. Is there a fix for this that I can try. -- thanks Rishi
Re: axis2 adding extra namespace declaration in response
Hi Ryan thanks for the response. Can you pls tell me the class name I should be looking for? thanks Rishi On 2/27/07, Ryan Nelsestuen [EMAIL PROTECTED] wrote: They have just recently removed that declareNamespace call in the current code – look at that class in SVN. -- *From:* Rishi krish [mailto:[EMAIL PROTECTED] *Sent:* Tuesday, February 27, 2007 10:31 AM *To:* axis-user@ws.apache.org *Subject:* axis2 adding extra namespace declaration in response Hi I am using axis2 1.1.1 [released version] and I am using RawXMLINOutMessageReceiver for my service operation. In the response Axis2 is adding an extra namespace which I beleive is derived from the package name of my service class. So if my service class is in package abc.bcdthen its adding a namespace declaration like xmlns:tns= http://bcd.abc; in the root element of my response message. This looks like a bug - its not bothering me too much - but I dont like my response getting modified. Is there a fix for this that I can try. -- thanks Rishi -- thanks Rishi
sendReceive and sendRobust
Hi All I am confused abt the usage of these 2 methods in the ServiceClient class. As per the axis2 doc - we should use sendRobust if we are not needing the response but care abt the fault and we should use sendReceive if we care abt the reponse and fault. Does it mean that calling sendReceive should work in both cases? Case 1 The web service operation I am calling has no response [service method has java void as return type] Case 2The web service operation has declared [service method has OMElement as return type] response but Case2 afor an invocation of that method it returns null Case2 bfor another invocation it return data. I am testing my application with these above cases [and subcases] and its working with sendReceive in client. In that case I am not clear whats the use of having sendRobust ?? It seems using sendReceive will be enough for handling all the cases - right? I am writing my own DII Web Service Client using the ServiceClient api. Unless really needed I want to use sendReceive and fireAndForget [for oneway]. Can anyone point me if I am not getting this right. -- thanks Rishi
Re: Classloading problems again
Hi Angel I have a similar need and I put the axis2 jars in the application classloader path which is parent to the war classloader. In my case my EJBs need to access the axis2 class files [like ServiceClient]. So I have them refed in the manifest file for my EJB and I dont keep them in web-inf/lib. I am using EAR deployment in both Weblogic and Websphere. On 2/16/07, Angel Todorov [EMAIL PROTECTED] wrote: Hi Dims, I had a different thing in mind: I want to move the whole axis2-kernel-ver.jar into a shared lib (either shared/lib in the case of tomcat, or an EAR archive in the case of any other application server). Would that work for any call (i.e. would some classloading problem arise) ? Regards, Angel On 2/16/07, Davanum Srinivas [EMAIL PROTECTED] wrote: It doesn't work is not really a bug report is it? :) Yes, you can do this, then don't package your service classes into AAR's. just drop the classes in WEB-INF/classes for the respective WAR's and in the repo for each one just have a directory with services.xml for each service in that WAR. thanks, dims On 2/16/07, Angel Todorov [EMAIL PROTECTED] wrote: Hi all, I am also encountering problems with the Axis2 classloading. I would like to move axis2-kernel jar to shared/lib. All other axis2 jars stay in its own lib dir. I would like to use classes from the axis2-kernel jar in two web apps, not only in axis2.war. It doesn't work - my opinion is because Axis2 has probably some custom classloading, instead of using the classloading infrastructure of the Application Server. does this mean that if i want to deploy axis2 on some app. server which supports the EAR specification, i won't be able to share axis2 jars between two webapps in the same EAR ? Thanks. Best, Angel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- thanks Rishi
Re: sendRobust and MessageReceivers
Hi Deepal I am using a pretty old version of axis2 - a nightly build which I took around the August 2006 time frame [axis2 1.0]. Its really simple to recreate - have a method public void handleMsg(OMElement om) and register it in services.xml with RawXMLINOnlyMessageReceiver. I use the ServiceClient.sendRobust(omelem) from my client side and the debug shows the server invocation goes through fine. It fails with that exception in the client side of response. Can you pls clarify first if my setup is as per axis2 design? [All my service methods are synchronous ones]. I describing my code [both server and client side] for any method of type OMElement (OMElement) I am using RawXMLINOutMessageReceiver in service.xml and ServiceClient.sendReceive(om) on client side. For any method of type void (OMElement) I am using RawXMLINOnlyMessageReceiver in services.xml and ServiceClient.sendRobust(om) in the client side. Is this the right way of working? Or I am missing something? Its also possible that this issue is fixed in future version - as I see in the newsgrp ur mail saying the sendRobust is buggy. So not sure what to do OR if you can give me a fix that I can try here locally it will be great. thanks Anamitra On 2/15/07, Deepal Jayasinghe [EMAIL PROTECTED] wrote: Hi Rishi ; What is the Axis2 version you are using. In the meantime can you pls help me to re-create the issue. Thanks Deepal Hi I have a method in my service class like public void handleReq(OMElement om)... I want the clients to call this method synchronously so that they get back a fault in case of an exception from the service. I added the messageReceiver class as org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver . And from the client [I am using ServiceClient] I call sendRobust method. I am getting the following error from the client after my service method has been invoked successfully: org.apache.axis2.AxisFault: Incoming message input stream is null at org.apache.axis2.transport.TransportUtils.createSOAPMessage(Transport Utils.java:64) at org.apache.axis2.description.OutInAxisOperationClient.send (OutInAxisO peration.java:349) at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAx isOperation.java:279) at org.apache.axis2.client.ServiceClient.sendRobust(ServiceClient.java :3 59) at org.apache.axis2.client.ServiceClient.sendRobust(ServiceClient.java:3 39) I am bit desparate in getting this thing working and can anyone let me know if this is a bug in axis2 or I am using a wrong setup. -- thanks Rishi -- Thanks, Deepal The highest tower is built one brick at a time - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- thanks Rishi
soapAction question
Hi I am redaing through the WS-I BP 1.1 spec and I saw them specify that the soapAction HTTP header MUST be a quoted string. I am using axis2 1.0 and if I see the soapAction header in the tcpmon I see it not quoted. I am sending my message using ServiceClient and seeting the soapAction using options.setAction(soapAction); So what I did was to add quotes myself to the soapAction and then call the above api. I dont feel I should be doing this and it should really be done by ServiceClient. Is this a known bug or this is fixed in a future release [ 1.1?]. -- thanks Rishi
sendRobust and MessageReceivers
Hi I have a method in my service class like public void handleReq(OMElement om)... I want the clients to call this method synchronously so that they get back a fault in case of an exception from the service. I added the messageReceiver class as org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver. And from the client [I am using ServiceClient] I call sendRobust method. I am getting the following error from the client after my service method has been invoked successfully: org.apache.axis2.AxisFault: Incoming message input stream is null at org.apache.axis2.transport.TransportUtils.createSOAPMessage (Transport Utils.java:64) at org.apache.axis2.description.OutInAxisOperationClient.send (OutInAxisO peration.java:349) at org.apache.axis2.description.OutInAxisOperationClient.execute (OutInAx isOperation.java:279) at org.apache.axis2.client.ServiceClient.sendRobust( ServiceClient.java:3 59) at org.apache.axis2.client.ServiceClient.sendRobust( ServiceClient.java:3 39) I am bit desparate in getting this thing working and can anyone let me know if this is a bug in axis2 or I am using a wrong setup. -- thanks Rishi
Re: axis2 repository
created AXIS2-1960. thanks Rishi On 1/9/07, Deepal Jayasinghe [EMAIL PROTECTED] wrote: Hi Rishi ; At the moment we do not have a way to provide parameters programatically , I also think its a good feature to have . So please create a JIRA then I will make sure to fix that before next release. Thanks Deepal Hi Below is the snippet from the web.xml file that the axis2 servlet reads to find the repository details. init-param param-nameaxis2.xml.path/param-name param-valueC:\axis2\myrepository\axis2.xml/param-value /init-param init-param param-nameaxis2.repository.path/param-name param-valueC:\axis2\myrepository/param-value /init-param Is there a way that I can provide this programmatically at the server startup - like setting some system property. What we are trying to avoid is specifying that in the web.xml which is just a setup headache for end users when we finally ship our product with axis bundled with it. We plan to derive the axis2 repository path from some othe application specific params and create the repository folder structure and copy all the modules [rampart,addressing] mar files as well as the axis2.xml at some point in the appserver startup. We will *NOT* mark the axis servlet as load-on-startup to be true. What I am looking is for an api/way to set those 2 values other than from the web.xml. -- thanks Rishi -- Thanks, Deepal The highest tower is built one brick at a time - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- thanks Rishi
Re: axis 2 1.1.1 RC1
Hi thanks for all the response. Can you pls tell me how to set the soap12 while using the serviceclient api? I remember seeing this piece of code somewhere and not sure this is the way to set soap12 for servicelcient: options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI); serviceClient.setOptions(options); Also u said the soap fault is broken for soap11 - but I can still use soap11 as long as I am not bothered about faults - right? Is there any chance of a fix by the time axis 2 1.1.1 is released finally?[probably a question for Thilana] thanks Rishi On 1/2/07, Mary Thompson [EMAIL PROTECTED] wrote: Yes you do need Rampart 1.1. I have been using rampart 1.1 with the nightly builds for about a month now. You can ignore all the policy stuff. In fact I have not always even loaded rahas.mar. I did not need to make any wsdl changes for rampart 1.1. However, using rampart 1.1 did break the soap 1.1 fault message handling. There is a jira about this, AXIS2-1643. The cause is evidently caused by a bug in WSCOMMONS-104. Using SOAP 1.2 gets around this. Mary Thompson Rishi krish wrote: Hi I have downloaded the axis2 1.1.1 rc1 and I have some setup questions: 1What version of rampart should I download? I assume the answer is rampart 1.1. 2I have been using rampart 1.0 along with axis2 and if I have to use rampart 1.1 will all my services.xml securiy deployment xml format change? I see the samples from rampart 1.1 [basic samples] and they seem exactly same as before. But the site for downloading rampart1.1 says The WS-Security and WS-SecureConversation implementation for axis2. Now with a new configuration model based on WS-SecurityPolicy I am confused at the new configuration model statement. If I am not using ws-policy or security policy can I still go on using the old [rampart 1.0] way of specifying security attributes. 3Getting compilation error in using the piece of code below - used to work for axis2 1.0 release. *if*(httpUserName != *null* httpPassword != * null*) { HttpTransportProperties.BasicAuthentication basicAuthentication = *new* HttpTransportProperties().*new* BasicAuthentication(); basicAuthentication.setUsername( axis2); basicAuthentication.setPassword( axis2); options.setProperty( org.apache.axis2.transport.http.HTTPConstants.BASIC_AUTHENTICATION, basicAuthentication); } 4I was using OperationContext to get some custom parameters from services.xml. Should I start using MessageContext.getCurrentMessageContext().getParameter(..) instead? thanks Rishi - Mary R. Thompson[EMAIL PROTECTED] Secure Grid Technologies Group (510) 486-7408 Lawrence Berkeley National Lab http://dsd.lbl.gov/~mrt -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- thanks Rishi
axis 2 1.1.1 RC1
Hi I have downloaded the axis2 1.1.1 rc1 and I have some setup questions: 1What version of rampart should I download? I assume the answer is rampart 1.1. 2I have been using rampart 1.0 along with axis2 and if I have to use rampart 1.1 will all my services.xml securiy deployment xml format change? I see the samples from rampart 1.1 [basic samples] and they seem exactly same as before. But the site for downloading rampart1.1 says The WS-Security and WS-SecureConversation implementation for axis2. Now with a new configuration model based on WS-SecurityPolicy I am confused at the new configuration model statement. If I am not using ws-policy or security policy can I still go on using the old [rampart 1.0] way of specifying security attributes. 3Getting compilation error in using the piece of code below - used to work for axis2 1.0 release. *if*(httpUserName != *null* httpPassword != *null*) { HttpTransportProperties.BasicAuthentication basicAuthentication = *new* HttpTransportProperties().*new* BasicAuthentication(); basicAuthentication.setUsername(axis2); basicAuthentication.setPassword(axis2); options.setProperty( org.apache.axis2.transport.http.HTTPConstants.BASIC_AUTHENTICATION, basicAuthentication); } 4I was using OperationContext to get some custom parameters from services.xml. Should I start using MessageContext.getCurrentMessageContext().getParameter(..) instead? thanks Rishi
[axis2]ws policy question
Hi Dims/Deepal I was in the morning axis2 tutorial presentation and it was definitely very helpful. I had asked a question related to the WS-policy implementation [neethi I guess] and I had some question on the facts Dims mentioned in that session abt the policy implementation. I have a sort of legacy application which I am web service enabling using axis. I need the dynamic deployment feature of axis2 [ie dropping the aar file with the WSDL in a folder ]. I create my own wsdl and the services.xmland the schema dynamically at runtime when the user chooses to deploy the legacy service as a Web service. I deal with the Raw xml in my java service class and it has one method say - public OMElement dothis(OMElement om). I let the axis modify the wsdl and hence will not use the useOriginalWSDL param. My WSDL can have n number of methods and I figure that at runtime from the legacy artifact/service the user is trying to deploy. But my java class is fixed as after I get the XML I know what to do with that to invoke the actual legacy service. When it comes to security we suggest the user to go and modify the services.xml and add the inflow and outflow xml blocks at the service level [as I have only one physical operation but n wsdl operation]. I have a major problem here - I want to specify those inflow/outflow security stuff based on the WSDL operation but thats not possible with the current design of services.xml. [remember as I said I have 1 physical operation and N wsdl operation]. I know for a fact that WS specification no way forces the WSDL operation name to be the same as the physical operation name. So In that case even if I come down to the level of deploying each operation in my legacy service as a individual Web services [so I am now at 1 to 1 mapping] still I want to have a separate WSDL operation name as from the java operation name [which is say allways dothis for me]. I want my inflow/outflow stuff to appear as a policy in the WSDL for that operation/service [now say 1 service will have one operation only] - I am not sure how axis will be able to match my java operation to the WSDL operation [If specify the security in the operation level]. My flow of service invocation is like as below: [my java class is like a proxy to the legacy services] axis engine my java class -legacy service1 axis engine my java class -legacy service2 . ... My java class is pregenerated fixed code which has only one method dothis which takes in the XML and knows which legacy artifact to call and how to get response back. So my question is Q1Do you suggest me [for WS-policy and operation level security] sake to change my design to 1 legacy service method as one Axis Web service? If I stick with legacy service as one web service then potentially a legacy service may have N wsdl operation and my java class has only one [as its generically handling all requests for any legacy service]. So my services xml has only one operation and I have to declare security policy only at the service level. Q2Also I am generating my own WSDL but letting Axis modify it - so I am hoping that the policy stuff should appear as pasrt of the Axis modified WSDL - right? [given I just specify the inflow/outflow sec parameters.] -- thanks Rishi
BouncyCastle and axis2
Hi Again this a newbe question: The BouncyCastle jar does not come with normal axis distribution and I guess we have to put a reference to that in the java.security file for Encryption/Signature to work with axis2 and have that jar file in the lib/ext folder of the jre.. Q1Is the use of BouncyCastle hardcoded in the axis2 software? [this would be not a nice thing] Q2What value does BouncyCastle provide if I am using jdk1.5 [which somes with a RSA imlpementation by default although not strong enough I guess]? Q3Can I not have BouncyCastle and have say another provider which provides the same functionality - this is related to Q1. My point is any standard J2EE server today will provide WS-Security support - so they must have some provider which does that encryption [strong enough] and signature for them. I am not sure why wss4j/axis2 cannot use that provider whcih comes with a J2EE server. If it can then I dont have the extra download and also dont have to setup BC in the java.security file. I was looking into the archives and saw some issues with BC and IBM jdk and am not sure if those have been resolved yet. My target platform is Websphere 6.1 [jdk 1.5] and feeling a little bit shaky on BouncyCastle. -- thanks Rishi
single sign on with axis2
Hi I am new to axis2 and am trying to figure out whats the best approach for this scenario: The user logs in to a j2ee application running in a j2ee server [say Weblogic/Websphere]. The user is validated using a LDAP server [the j2ee server handles that part] and after the authentication we have a user Principal. Now the user need to invoke a Web service hosted by another server [j2ee or .net] which uses the same LDAP repository for authentication. I am developing the web service client using the ServiceClient class in axis2 and the code is sitting in the first server. I am at loss as to what kind of security token should I use to communicate with the Web service. I have to pass the Principal information to the other side and not sure whether to use the UserNameToken. The problem here is I dont beleive the Principal has any info abt the password and that makes me beleive that I cannot use UserNameToken. OR should I use SAML token and if thats the case I have no idea where to get info to set up a SAML token using the ServiceClient api. OR Axis2 ServiceClient api does not support this scenario. Also along side I had another question - All the samples for UserNameToken shows the userid preconfigured in the clients axis2.xml. Can the userid be fed to the ServiceClient api programmatically. What I am trying to acheive is dynamic userid [which might change per invocation] and not a static preconfigured one. Though this will not help me in the above singlesign on scenario OR may be it will - pls suggest. -- thanks Rishi
Re: single sign on with axis2
Hi George thanks for ur reply. Lets for simplicity sake take the simple password based LDAP authentication [I know most of our customers use this - but some use x509 certificates]. I have googled and kind of come to this conclusion that for Web service SSO - SAML is the best solution. But my problem is my knowldege on SAML is almost 0 and axis2 does not have good examples illustrating how to use SAML with axis2. I am pasting a comment by Anne Thomas Manes sometime back in this grp abt SAML Annes comments in this news grp- SAML provides a standard XML format to express and exchange security assertions. Assertions come in three flavors: authentication, authorization, and attributes. You get these assertions from some type of trust authority, such as a single sign-on service or an entitlement service.* *SAML defines the protocols (SOAP messages) that you use to get these assertions*. * One of the primary reasons why you might want to use SAML is to support single sign-on. But if you don't have a SAML authentication authority, then you probably don't want to use SAML. In WS-Security speak, a SAML assertion is an XML security token. Once you have a SAML token, you can relay that security information in your SOAP messages (in a SOAP header) using WS-Security. WS-Security also supports a number of other security tokens, such as X.509 certificates, Kerberos tickets, XrML tokens, XCBF tokens, or a simple userID/password token. I think WSS is the best approach today to implement single sign-on within a single trust domain. If that trust domain is implemented using Active Directory, then I suggest using Kerberos tickets for your authentication token. For any other type of trust domain, use SAML and a SAML-compliant single sign-on service. Add Liberty to the mix to support single sign-on across trust domains. SAML-compliant single sign-on products are available from Sun, Entrust, Securant, Entegrity, and Netegrity. I'm sure there are others. -end Anne's comments- So what I get from these comments are * 1u need a SAML compliant single sign on service - * Q1 is this the LDAP server or this is some other service? Q2Is this entity the same as the SAML authentication authority? * 2SAML defines protocols to talk to a SAML compliant single sign on service to get back assertions * Qcan I assume that the Axis client [ServiceClient] communicates with the SAML compliant single sign on service to get back the asertions and then add them to the WS Security header of the out going SOAP message? 3Can I assume that to talk to the *SAML compliant single sign on service -* the axis ServiceClient has to be configured via the saml.properties and the SAMLTokenSigned/Unsigned action? How does the ServiceClient know abt logged in the user identity [probably here is where the dynamic runtime user id setting is going to come as compared to the static axis2.xml security user configuration]? 4Where can I get a documentation of how I can configure a Axis Web Service client for putting a SAML SSO token in the WS Security header? Is the client configuration [samp.properties] pretty standard for all *SAML compliant single sign on service*? Is there any article [ws02??] for axis2 client/service setup for SAML where I can refer and get a hold on how to use/configure SAML+Axis2 or if anyone in this grp has successfully used SAML with Axis2 and can share some sample configurations [client and server] - it would be of great help to me. thanks Rishi On 11/16/06, George Stanchev [EMAIL PROTECTED] wrote: Hi Rishi, How is your user authenticating against the LDAP? Simple password based authentication or some kind of certificate based authentication? You will need to establish trust between your Server A and Server B somehow. You can use an X509 certificate or simple public/private key pair which you need to exchange. Once Server B knows and trusts Server A, then you can issue your ServerA-ServerB request with either UsernameToken or SAMLTokenSigned action. In the first case you can sign the message or portion of your message including the token with ServerA's certificate that was used to establish the trust. In second case, you can just sign the SAML token with that certificate (or public key). The ServerB then would have to check if the certificate is trusted and trust the Principle relayed via the token. As far as what token type to use - depends what Principle claims you have to supply. UsernameToken is good about relying usernames but thats about it. With SAML you can add additional claims in the token. Both those scenarios are supported by Axis2/rampart, however you still have to do the handling on your ServerB to determine if the incoming message was issued by trusted authority. Axis2/rampart allows dynamic configurations - look at the user's manual to see