special character escaping in adb requests
I have an app that uses adb to construct messages to send to a web service. Everything works fine, unless my data contains characters like '', in which case axis fails to escape the characters and generates invalid xml (I'm using xml messages). I'm doing things like: axis2_stub_t *my_service = axis2_stub_create_MyService(env, client_home, url); adb_foo_t *myreq = adb_foo_create(env); adb_foo_set_myfield(myreq, env, abcxyz); adb_fooresp_t *response = axis2_stub_op_MyService_myOp(an_service, env, myreq); The adb code was generated from a wsdl (and xsd) that has elements defined like: xs:element name=foo type=xs:string/ and the command used was: axis2.sh org.apache.axis2.wsdl.WSDL2C -uri myservice.wsdl -d adb -u -o generated Is there some extra step I need to take to make this work right? Or, is there some bug that might be fixed in a more recent version? eric
Re: special character escaping in adb requests
Hi Eric, Unfortunately You have to set the texts after escaping these characters at least for now. It is apparently a bug. (we should do it inside). Can you please raise a JIRA issue on that. Thanks Dimuthu On Thu, Jan 29, 2009 at 12:48 AM, Haszlakiewicz, Eric ehas...@transunion.com wrote: I have an app that uses adb to construct messages to send to a web service. Everything works fine, unless my data contains characters like '', in which case axis fails to escape the characters and generates invalid xml (I'm using xml messages). I'm doing things like: axis2_stub_t *my_service = axis2_stub_create_MyService(env, client_home, url); adb_foo_t *myreq = adb_foo_create(env); adb_foo_set_myfield(myreq, env, abcxyz); adb_fooresp_t *response = axis2_stub_op_MyService_myOp(an_service, env, myreq); The adb code was generated from a wsdl (and xsd) that has elements defined like: xs:element name=foo type=xs:string/ and the command used was: axis2.sh org.apache.axis2.wsdl.WSDL2C -uri myservice.wsdl -d adb -u -o generated Is there some extra step I need to take to make this work right? Or, is there some bug that might be fixed in a more recent version? eric -- Thanks, Dimuthu Gamage http://www.dimuthu.org http://www.wso2.org
Re: AW: setting username/password in soap header programmatically
Hi, thanks agagin for your reply. I am using Axis2 (with Rampart 1.4) and not Axis 1. I am generating a stub for my client using wsdl2java. I just noticed from your reply you say to use axis2.xml for the client, where would I insert this. I have searched the web extensively, there does not seem to be any way of the client inserting a handler programmatically, thanks, Brian Mario-Leander Reimer wrote: Hi Brain, I just realized that you are using Axis1. Sorry for the misunderstanding. The code you had sent will was for Axis2, I have this working under Axis2 1.4.1 with Rampart 1.4. Unfortunately I have no experience with Axis1 so I can't help you any further. Regards, Leander -Ursprüngliche Nachricht- Von: brianfm [mailto:bfmur...@gmail.com] Gesendet: Dienstag, 27. Januar 2009 18:18 An: axis-user@ws.apache.org Betreff: Re: setting username/password in soap header programmatically Hi, thanks to everyone again who has replied. I would prefer not to add custom headers to the soap message, i want to use the ws-security usernametoken. Thanks Leander for your response, but that approach did not work. In the wss4j documentation, is the following code snippit. Unfortunately, it is not clear on which object the _setPropery in on - its is not on any generation code from wsdl2java or in the apit: PingServiceLocator service = new PingServiceLocator(); ... PingPort port = (PingPort) service.getPing1(); port._setProperty(UsernameToken.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT); port._setProperty(WSHandlerConstants.USER, werner); This is from the package description of org.apache.ws.axis.security. I had success with the following approach , but all these classes are deprecated, and no alternative is suggested in the api. OutflowConfiguration outflowConfig = new OutflowConfiguration(); outflowConfig.setActionItems(UsernameToken); outflowConfig.setUser(bob); outflowConfig.setPasswordCallbackClass(test1.security.PWCBClientHandle r); axisstub._getServiceClient().getOptions().setProperty(WSSHandlerConstan ts.OUTFLOW_SECURITY, outflowConfig.getProperty()); I am trying to attempt something basic here, unfortunately the api doc is quite poor. Any ideas? Brian brianfm wrote: Hi, My application requires that I programmatically set a username and password into the ws-security standard locations in the soap header. Note that I do not want to configure Rampart athentication because authentication logic will be fully proprietery in the server. I intend to just retrieve the usename/password from soap header programmtically from server and then authenticate. thanks, Brian -- View this message in context: http://www.nabble.com/setting-username- password-in-soap-header-programmatically-tp21641020p21689872.html Sent from the Axis - User mailing list archive at Nabble.com. VVA Networks GmbH Mario-Leander Reimer Dipl.-Inf. (FH) Teamleitung Publishing Solutions --- VVA Networks GmbH : medien mit zukunft Geisenhausenerstraße 15-17 81379 München Deutschland --- Fon:+49 89 2000375-610 Fax:+49 89 2000375-699 Mobil: +49 173 5883541 --- leander.rei...@vva-networks.de www.vva-networks.de --- HRB 33884 Düsseldorf Geschäftsführer Rolf Christian Kassel --- Ein Unternehmen der VVA Kommunikation http://www.vva.de --- omnisuite® - integrate. automate. communicate. http://www.omnisuite.de --- Diese Nachricht (inklusive aller Anhänge) ist vertraulich. Sie darf ausschließlich durch den vorgesehenen Empfänger und Adressaten gelesen, kopiert oder genutzt werden. Sollten Sie diese Nachricht versehentlich erhalten haben, bitten wir, den Absender (durch Antwort-E-Mail) hiervon unverzüglich zu informieren und die Nachricht zu löschen. Jede unerlaubte Nutzung oder Weitergabe des Inhalts dieser Nachricht, sei es vollständig oder teilweise, ist unzulässig. This message (including any attachments) is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error please contact the sender (by return E-Mail) immediately and delete this message. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. -- View this message in context: http://www.nabble.com/setting-username-password-in-soap-header-programmatically-tp21641020p21702411.html Sent from the Axis - User mailing list
Using Axis2 services from Javascript (by removing the XML namespaces)
Hi there, just wrote a nice little blog entry about how to use an Axis2 service via XML from Javascript: http://www.marcusschiesser.de/?p=142 Have fun, Marcus
Reload keystore file
Hi, I have a problem with Axis2. At my project, we have an Microsoft Exchange 2007, and some other project has created an API to interact with this Exchange server with the help of Axis2. This other project uses a Websphere server to manage a keystore to do basic authentication over SSL. My application on the otherhand runs as a standalone application, and I have to manage the keystore myself. Now, I managed to use this keystore to calling the Exchange 2007 Web services over SSL, and it works great. But, as you probably know, certificates expire ... and they have to get renewed. So, I managed to create something a 'KeyStoreManager' that will fetch the new certificates from the Exchange server and put it in the keystore file. And this works great as well .. *IF* I restart my application. When my application modifies the keystore file, it looks like Axis2 is using some caching mechanism. Because when I make the web service call again (after inserting the new certificate in my keystore), it can't authenticate because it cached the keystore file in memory. To specify the keystore to Axis2, I use this code: System.setProperty(javax.net.ssl.trustStore, /path/to/keystore.jks); System.setProperty(javax.net.ssl.trustStorePassword, thisisnottherealpassword); To extract the new certificate and add it to my keystore, I use code based on the one you can find at http://helpdesk.objects.com.au/java/how-do-i-programatically-extract-a-certificate-from-a-site-and-add-it-to-my-keystore The problem is: when the keystore file is updated with the new certificate, axis2 doesn't seem to know about it because it uses a cached version of the keystore file. So my question is: how can I clear this axis2 keystore cache in some way so axis2 will be forced to read the keystore file again? Thank you for your help, Kind regards, Sebastian
axis2-1.4: utf-8 chars in response not encoded correctly
i've created a service with axis2 and eclipse. in both soap the request and response i have turkish (ISO-8859-9) characeters. i view the soap request and response with SOAPMonitor. i see that turkish characters on the request message are seen correct, but turkish chars on the response are not encoded correctly on the response soap message. the service is inside an .aar file and is deployed to axis2.war on tomcat 6.0 server i've used two clients for test (one generated in eclipse the other one in jdeveloper). both the clients and the server are on the same machine (windows XP). -- View this message in context: http://www.nabble.com/axis2-1.4%3A-utf-8-chars-in-response-not-encoded-correctly-tp21703073p21703073.html Sent from the Axis - User mailing list archive at Nabble.com.
AW: AW: setting username/password in soap header programmatically
Hi, then your example with the PingServiceLocator and the PingPort classes confused me. I also use wsdl2java (well the Maven plugin with wsdl2code goal), and I end up with a couple of classes and interfaces. For the client code I use the generated class that ends in Stub, so I would expect something like PingServiceStub that extends from org.apache.axis2.client.Stub and implements PingService Maybe the names are a little different. Then construct a org.apache.axis2.context.ConfigurationContext instance using ConfigurationContext context = ConfigurationContextFactory .createConfigurationContextFromFileSystem(this.axis2repo, this.axis2xml); The parameters are the location of the axis2repo (where your modules are) and the axis2xml parameter sets the location of the client axis2.xml (well, I just use a customized axis2.xml for my client). The most important changes for my service and client are module ref=rampart/ parameter name=OutflowSecurity action itemsUsernameToken/items passwordTypePasswordText/passwordType !-- for encrypted passwords passwordTypePasswordDigest/passwordType -- addUTElementsNonce Created/addUTElements !-- if you want to set it in the config statically userusername/user passwordCallbackClassOutflowSecurityCallbackHandler/passwordCallbackClass -- /action /parameter Then construct the service stub with the context this.serviceStub = new PingServiceStub(context, enter service URL here); Then get the service options org.apache.axis2.client.Options options = this.serviceStub ._getServiceClient().getOptions(); And set the security options programmatically as previously posted, e.g. options.setProperty(WSHandlerConstants.USER, this.user); OutflowSecurityCallbackHandler cbh = new OutflowSecurityCallbackHandler(); options.setProperty(WSHandlerConstants.PW_CALLBACK_REF, cbh); That should do it. Obviously your service also needs to have the proper Rampart and InflowSecurity parameter configuration in its service.xml or the server side axis2.xml. BR, Leander -Ursprüngliche Nachricht- Von: brianfm [mailto:bfmur...@gmail.com] Gesendet: Mittwoch, 28. Januar 2009 10:26 An: axis-user@ws.apache.org Betreff: Re: AW: setting username/password in soap header programmatically Hi, thanks agagin for your reply. I am using Axis2 (with Rampart 1.4) and not Axis 1. I am generating a stub for my client using wsdl2java. I just noticed from your reply you say to use axis2.xml for the client, where would I insert this. I have searched the web extensively, there does not seem to be any way of the client inserting a handler programmatically, thanks, Brian Mario-Leander Reimer wrote: Hi Brain, I just realized that you are using Axis1. Sorry for the misunderstanding. The code you had sent will was for Axis2, I have this working under Axis2 1.4.1 with Rampart 1.4. Unfortunately I have no experience with Axis1 so I can't help you any further. Regards, Leander -Ursprüngliche Nachricht- Von: brianfm [mailto:bfmur...@gmail.com] Gesendet: Dienstag, 27. Januar 2009 18:18 An: axis-user@ws.apache.org Betreff: Re: setting username/password in soap header programmatically Hi, thanks to everyone again who has replied. I would prefer not to add custom headers to the soap message, i want to use the ws-security usernametoken. Thanks Leander for your response, but that approach did not work. In the wss4j documentation, is the following code snippit. Unfortunately, it is not clear on which object the _setPropery in on - its is not on any generation code from wsdl2java or in the apit: PingServiceLocator service = new PingServiceLocator(); ... PingPort port = (PingPort) service.getPing1(); port._setProperty(UsernameToken.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT); port._setProperty(WSHandlerConstants.USER, werner); This is from the package description of org.apache.ws.axis.security. I had success with the following approach , but all these classes are deprecated, and no alternative is suggested in the api. OutflowConfiguration outflowConfig = new OutflowConfiguration(); outflowConfig.setActionItems(UsernameToken); outflowConfig.setUser(bob); outflowConfig.setPasswordCallbackClass(test1.security.PWCBClientHandle r); axisstub._getServiceClient().getOptions().setProperty(WSSHandlerConstan ts.OUTFLOW_SECURITY, outflowConfig.getProperty()); I am trying to attempt something basic here, unfortunately the api doc is quite poor. Any ideas? Brian brianfm wrote: Hi, My application requires that I programmatically set a username and password into the ws-security standard locations in
Misunderstanding in rampart processIssueResponse
Hello, I'm posting here since the rampart's mailing list seems to be dead. Is it dead? Is rampart still alive? in STSClient you have the method: private Token processIssueResponse(int version, OMElement result, String issuerAddress) throws TrustException { OMElement rstr = result; if (version == RahasConstants.VERSION_05_12) { //The WS-SX result will be an RSTRC rstr = result.getFirstElement(); } The rstr is always the first element, but for WST1.3 is not mandatory at all. This makes the stsclient unable to get the securitytoken from a message like: wst:RequestSecurityTokenResponse xmlns:wst=http://docs.oasis-open.org/ws-sx/ws-trust/200512; wst:TokenTypeurn:oasis:names:tc:SAML:2.0:assertion/wst:TokenType wst:RequestedAttachedReference wsse:SecurityTokenReference xmlns:wsse=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd; wsse:Reference URI=#_5d26046afa8e38339caa4e1c53735d4d ValueType=urn:oasis:names:tc:SAML:2.0:assertion / /wsse:SecurityTokenReference ... wst:RequestedSecurityToken saml:Assertion xmlns:saml=urn:oasis:names:tc:SAML:2.0:assertion ID=_5d26046afa8e38339caa4e1c53735d4d IssueInstant=2009-01-13T17:06:00.597Z Version=2.0 saml:Issuer Form That is valid. Am I wrong? Thanks Massimiliano This message was sent using IMP, the Internet Messaging Program.
Re: Misunderstanding in rampart processIssueResponse
Hi Massimiliano, On Wed, Jan 28, 2009 at 7:58 PM, Massimiliano Masi m...@math.unifi.itwrote: Hello, I'm posting here since the rampart's mailing list seems to be dead. Is it dead? Is rampart still alive? No, But during certain times developers are busy with other projects and you might not get an answer to some of your mails. Still we try to answer most of the questions during our free time. in STSClient you have the method: private Token processIssueResponse(int version, OMElement result, String issuerAddress) throws TrustException { OMElement rstr = result; if (version == RahasConstants.VERSION_05_12) { //The WS-SX result will be an RSTRCi rstr = result.getFirstElement(); } The rstr is always the first element, but for WST1.3 is not mandatory at all. This makes the stsclient unable to get the securitytoken from a message like: wst:RequestSecurityTokenResponse xmlns:wst= http://docs.oasis-open.org/ws-sx/ws-trust/200512; wst:TokenTypeurn:oasis:names:tc:SAML:2.0:assertion/wst:TokenType wst:RequestedAttachedReference wsse:SecurityTokenReference xmlns:wsse= http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd wsse:Reference URI=#_5d26046afa8e38339caa4e1c53735d4d ValueType=urn:oasis:names:tc:SAML:2.0:assertion / /wsse:SecurityTokenReference ... wst:RequestedSecurityToken saml:Assertion xmlns:saml=urn:oasis:names:tc:SAML:2.0:assertion ID=_5d26046afa8e38339caa4e1c53735d4d IssueInstant=2009-01-13T17:06:00.597Z Version=2.0 saml:Issuer Form Yes, this seems a bug. Can you raise a JIRA and even better if you can attach a patch too. thanks, nandana -- Nandana Mihindukulasooriya WSO2 inc. http://nandana83.blogspot.com/ http://www.wso2.org
RE: Session cookie in ADB client HTTP request
Hi Jason, Try this ... stub._getServiceClient().getOptions().setManageSession(true); Thanks Raghu -Original Message- From: Jason Wells [mailto:ja...@wells.me] Sent: Tuesday, January 27, 2009 5:14 PM To: axis-user@ws.apache.org Subject: Session cookie in ADB client HTTP request Hi, I used wsdl2java to generate an ADB client that goes against a stateful service in Axis2. When I call service operations with the client, the JSESSIONID that the server sends in the HTTP responses aren't maintained in its requests, so the server opens a new session with each request. How can I configure the client to maintain the session? In other words, I want to do what it looks like you can do in Axis1 with these settings: Stub.setMaintainSession(true); Stub._setProperty(Call.SESSION_MAINTAIN_PROPERTY, new Boolean(true)); Thanks, Jason
Axis 1.x File Upload
Hi, AnyOne has an exmple for a file upload using axis 1.x? Best REgards -- Paulo
RE: AXIS2-4050 Client Proxy Authentication Failed, Screwed up http headers
Hi Andreas We got that patch applied to our proxy server and it didn't resolve our issue. Conal -Original Message- From: Conal Markey [mailto:c.mar...@kainos.com] Sent: 23 January 2009 15:10 To: axis-user@ws.apache.org Subject: RE: AXIS2-4050 Client Proxy Authentication Failed, Screwed up http headers Hi Andreas Thanks for the link below. I have forwarded this onto the ISA administrator and they are looking into it at the moment. It may take a few days to resolve but I'll post back with the outcome. Conal -Original Message- From: Andreas Veithen [mailto:andreas.veit...@gmail.com] Sent: 22 January 2009 22:12 To: axis-user@ws.apache.org Subject: Re: AXIS2-4050 Client Proxy Authentication Failed, Screwed up http headers I don't see anything wrong in that request. My guess is that we are actually looking in the wrong place. Probably there is nothing wrong with the request, but there is an issue with the ISA server that causes it to return a misleading error message. Something similar to [1]. Andreas [1] http://support.microsoft.com/kb/915045 On Thu, Jan 22, 2009 at 18:18, Conal Markey c.mar...@kainos.com wrote: Hi Andreas Below are the headers captured using wireshark. Conal POST http://xx..com/xdatawebservice/query.asmx HTTP/1.1\r\n Request Method: POST Request URI: http://xxx.x.com/xxdatawebservice/xxquery.asmx Request Version: HTTP/1.1 Content-Type: application/soap+xml; charset=UTF-8; action=http://..com/xDataWebService/xQuery/Queryxxx xxx\r\n User-Agent: Axis2\r\n Proxy-Authorization: Basic bWF==\r\n Credentials: xxx:x Host: idstaging.moneymate.com\r\n Proxy-Connection: Keep-Alive\r\n Transfer-Encoding: chunked\r\n \r\n -Original Message- From: Conal Markey [mailto:c.mar...@kainos.com] Sent: 21 January 2009 11:09 To: axis-user@ws.apache.org Subject: RE: AXIS2-4050 Client Proxy Authentication Failed, Screwed up http headers Hi Andreas I'll set one of the tools up when I get back to this. For the moment the headers below are what I had from debugging through my test client. I got these from the requestHeaders attribute on the org.apache.commons.httpclient.methods.PostMethod object. [Content-Type: application/soap+xml; charset=UTF-8; action=http://.xxx.com/xDataWebService/Query/Query; , Host: xx..com , User-Agent: Axis2 , Proxy-Authorization: Basic bWxx== ] Thanks Conal -Original Message- From: Andreas Veithen [mailto:andreas.veit...@gmail.com] Sent: 21 January 2009 10:24 To: axis-user@ws.apache.org Subject: Re: AXIS2-4050 Client Proxy Authentication Failed, Screwed up http headers Conal, Can you try to intercept the request (headers) using a tool like Wireshark or Apache TCPMon and post it here? Andreas On Wed, Jan 21, 2009 at 10:25, Conal Markey c.mar...@kainos.com wrote: Andreas, I ran my test client with the code supplied below and I'm still having the issue with headers. See message below. HTTP/1.1 400 Bad Request ( The HTTP request includes a non-supported header. Contact your ISA Server administrator. ) I need to get a POC working and have spent some time on this already so for the moment I'm going to plan B!! If I get a resolution to this I'll post back to the forum. It seems to me though that the issue in Jira should not be marked as resolved. Thanks Conal -Original Message- From: Conal Markey [mailto:c.mar...@kainos.com] Sent: 20 January 2009 22:16 To: axis-user@ws.apache.org Subject: RE: AXIS2-4050 Client Proxy Authentication Failed, Screwed up http headers Thanks for the reply Andreas. Yes, I'm still seeing issues with this. I'll patch the code tomorrow with the source from the link you provided and see if it resolves the issue I'm having. Thanks again Conal -Original Message- From: Andreas Veithen [mailto:andreas.veit...@gmail.com] Sent: 20 January 2009 21:46 To: axis-user@ws.apache.org Subject: Re: AXIS2-4050 Client Proxy Authentication Failed, Screwed up http headers The code modifications can be found at [1]. Not sure how this change would solve problems with screwed up headers. Are you still seeing this issue? Andreas [1] http://svn.apache.org/viewvc?view=revrevision=701047 On Tue, Jan 20, 2009 at 17:29, Conal Markey c.mar...@kainos.com wrote: According to JIRA this item is resolved by Dimuthu Leelaranthe. Could you supply details of the fix applied to resolve this and patched source if possible? Thanks This e-mail is intended solely for the addressee and is strictly confidential; if you are not the addressee please destroy the message and all copies. Any opinion or information contained in this email or its attachments that does not relate to the business of Kainos is personal to the sender and is not given by or endorsed
Re: AXIS2-4050 Client Proxy Authentication Failed, Screwed up http headers
Hi Conal Check the Alerts tab under the monitoring section in ISA Server Management console. You should see the exact reason for the header being rejected. [1] - does this help? Also, what exactly is the full response you get as seen through wireshark? Could you post a new example? Also, you could check if the correct credentials went through by checking the decoded basic auth string. Try something that works too (any request through the proxy) and post it, so that its easier to figure out which header is the problem .. I suspect transfer encoding.. cheers asankha [1] http://www.experts-exchange.com/Other/Miscellaneous/Q_21903188.html?sfQueryTermInfo=1+connecto Below are the headers captured using wireshark. POST http://xx..com/xdatawebservice/query.asmx HTTP/1.1\r\n Request Method: POST Request URI: http://xxx.x.com/xxdatawebservice/xxquery.asmx Request Version: HTTP/1.1 Content-Type: application/soap+xml; charset=UTF-8; action=http://..com/xDataWebService/xQuery/Queryxxx xxx\r\n User-Agent: Axis2\r\n Proxy-Authorization: Basic bWF==\r\n Credentials: xxx:x Host: idstaging.moneymate.com\r\n Proxy-Connection: Keep-Alive\r\n Transfer-Encoding: chunked\r\n \r\n -- Asankha C. Perera http://adroitlogic.org http://esbmagic.blogspot.com
export to aar from eclipse - missing option
Hi there, I'm using eclipse (2.4.1) and I'm trying to export my project to aar. I learned that I should do: File-- Export -- Web Services and choose aar BUT...I don't have this option! can anyone advise what should I do in order to have it. Thank you!! -- View this message in context: http://www.nabble.com/export-to-aar-from-eclipse---missing-option-tp21711747p21711747.html Sent from the Axis - User mailing list archive at Nabble.com.
RE: AXIS2-4050 Client Proxy Authentication Failed, Screwed up http headers
Hi Asankha Your right, it's the transfer encoding header that is causing the problem. I implemented a quick hack to force a set of the Content-Length header and it was successful. I need to do some more digging with our proxy administrator to try and resolve the issue. Thanks for the info Conal From: Asankha Perera [mailto:asankha.apa...@gmail.com] On Behalf Of Asankha C. Perera Sent: 28 January 2009 17:35 To: axis-user@ws.apache.org Subject: Re: AXIS2-4050 Client Proxy Authentication Failed, Screwed up http headers Hi Conal Check the Alerts tab under the monitoring section in ISA Server Management console. You should see the exact reason for the header being rejected. [1] - does this help? Also, what exactly is the full response you get as seen through wireshark? Could you post a new example? Also, you could check if the correct credentials went through by checking the decoded basic auth string. Try something that works too (any request through the proxy) and post it, so that its easier to figure out which header is the problem .. I suspect transfer encoding.. cheers asankha [1] http://www.experts-exchange.com/Other/Miscellaneous/Q_21903188.html?sfQu eryTermInfo=1+connecto Below are the headers captured using wireshark. POST http://xx..com/xdatawebservice/query.asmx HTTP/1.1\r\n Request Method: POST Request URI: http://xxx.x.com/xxdatawebservice/xxquery.asmx Request Version: HTTP/1.1 Content-Type: application/soap+xml; charset=UTF-8; action=http://..com/xDataWebService/xQuery/Queryxxx xxx\r\n User-Agent: Axis2\r\n Proxy-Authorization: Basic bWF==\r\n Credentials: xxx:x Host: idstaging.moneymate.com\r\n Proxy-Connection: Keep-Alive\r\n Transfer-Encoding: chunked\r\n \r\n -- Asankha C. Perera http://adroitlogic.org http://esbmagic.blogspot.com This e-mail is intended solely for the addressee and is strictly confidential; if you are not the addressee please destroy the message and all copies. Any opinion or information contained in this email or its attachments that does not relate to the business of Kainos is personal to the sender and is not given by or endorsed by Kainos. Kainos is the trading name of Kainos Software Limited, registered in Northern Ireland under company number: NI19370, having its registered offices at: Kainos House, 4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland. Registered in the UK for VAT under number: 454598802 and registered in Ireland for VAT under number: 9950340E. This email has been scanned for all known viruses by MessageLabs but is not guaranteed to be virus free; further terms and conditions may be found on our website - www.kainos.com
Re: Session cookie in ADB client HTTP request
Hi Amila, With this set, the server is still instancing one service object per request, and when I examine the interaction in tcpmon, I still don't see JSESSIONID in the stub's requests. Anything else I need to do? Jason On Jan 27, 2009, at 9:45 PM, Amila Suriarachchi wrote: On Wed, Jan 28, 2009 at 4:43 AM, Jason Wells ja...@wells.me wrote: Hi, I used wsdl2java to generate an ADB client that goes against a stateful service in Axis2. When I call service operations with the client, the JSESSIONID that the server sends in the HTTP responses aren't maintained in its requests, so the server opens a new session with each request. How can I configure the client to maintain the session? In other words, I want to do what it looks like you can do in Axis1 with these settings: Stub.setMaintainSession(true); Stub._setProperty(Call.SESSION_MAINTAIN_PROPERTY, new Boolean(true)); in axis2 stub._getServiceClient().getOptions().setManageSession(true); thanks, Amila. Thanks, Jason
Re: WS_Security with Axis2 using ServiceClient and OperationClient
On Tue, Jan 27, 2009 at 1:55 AM, Wishing Carebear wishing.careb...@gmail.com wrote: Sameera: Looked into 240 link. It had the following information for client configurations: This configuration parameter should be included in the client's axis2.xml file and in sample-02 the file is rampart-ut-samples/sample02/client.axis2.xml. My requirement is to do the WS-Security programmatically. Is it possible using rampart and axis2. Yes, this should be possible. If you are using WS-SecurityPolicy to indicate the security actions, anyway you need to specify that policy.xml file. Please have a look at the Apache Rampart site for more details.. Following shows, how you should secure SOAP message using Rampart with WS-SecurityPolicy. Rampart policy sample02 public static void main(String[] args) throws Exception { if(args.length != 3) { System.out.println(Usage: $java Client endpoint_address client_repo_path policy_xml_path); } ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], null); ServiceClient client = new ServiceClient(ctx, null); Options options = new Options(); options.setAction(urn:echo); options.setTo(new EndpointReference(args[0])); options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, loadPolicy(args[2])); client.setOptions(options); client.engageModule(addressing); client.engageModule(rampart); OMElement response = client.sendReceive(getPayload(Hello world)); System.out.println(response); } Thanks for your time and help, cbear On Sun, Jan 25, 2009 at 6:32 AM, Sameera Jayasoma sameera.madus...@gmail.com wrote: Hi, You can achieve WS-Security with Apache Axis2 by using Rampart. Rampart is an Axis2 module. For more information please refer following articles. http://wso2.org/library/3190 http://wso2.org/library/240 On Sat, Jan 24, 2009 at 8:15 AM, Wishing Carebear wishing.careb...@gmail.com wrote: Hello: I'm using the Cleint API's (ServiceClient and OperationClient) to consume webservices. I have been successful so far writing dynamic clients ( without using wsdl2java). Now want to integrate WSSecurity feature with the dynamic clients. Would like to know if there are any examples how to do WS_Security with Axis2. Thanks for your time and help cabear -- Sameera Jayasoma Software Engineer WSO2 Inc. Oxygenating the Web Service Platform. http://wso2.org/ blog: http://tech.jayasoma.org -- Sameera Jayasoma Software Engineer WSO2 Inc. Oxygenating the Web Service Platform. http://wso2.org/ blog: http://tech.jayasoma.org
Re: Lifecycle, ServiceLifeCycle methods never called?
Amila, Thank you, that did the trick. For the destroy() problem, I'm getting inconsistent behavior: sometimes it gets fired, sometimes not. It seems that Tomcat has to be running for a minimum of 5-6 minutes in order for it to be called most often, although that isn't reliably true. Jason On Jan 27, 2009, at 9:54 PM, Amila Suriarachchi wrote: On Wed, Jan 28, 2009 at 1:27 AM, Jason Wells ja...@wells.me wrote: Hi, I have an Axis2 1.4.1 service in Tomcat 6 deployed at transport session scope. It implements Lifecycle and ServiceLifeCycle. When I hit the service for the first time, I can see init() gets called. However, neither startUp(), shutDown() nor destroy() ever get called, not even when I let the session time out or shut down Tomcat. What am I missing? you need to set ServiceLifeCycle as follows service name=POJOService class=test.kp.service.TestServiceLifeCycle in the services.xml ServiceLifeCycle actually refers to AxisService Object life cycle. thanks, Amila. Thanks, Jason -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
Re: WS_Security with Axis2 using ServiceClient and OperationClient
Thanks Sameera.I have downloaded the rampart and understanding the samples. Interestingly in the basic one, there is a mention of DynamicConfiguration as item 11 but do not see any relevant examples. Anyway will try out to have a better understand and get back to you if I have more questions. Best regards, cabear On Wed, Jan 28, 2009 at 11:31 AM, Sameera Jayasoma sameera.madus...@gmail.com wrote: On Tue, Jan 27, 2009 at 1:55 AM, Wishing Carebear wishing.careb...@gmail.com wrote: Sameera: Looked into 240 link. It had the following information for client configurations: This configuration parameter should be included in the client's axis2.xml file and in sample-02 the file is rampart-ut-samples/sample02/client.axis2.xml. My requirement is to do the WS-Security programmatically. Is it possible using rampart and axis2. Yes, this should be possible. If you are using WS-SecurityPolicy to indicate the security actions, anyway you need to specify that policy.xml file. Please have a look at the Apache Rampart site for more details.. Following shows, how you should secure SOAP message using Rampart with WS-SecurityPolicy. Rampart policy sample02 public static void main(String[] args) throws Exception { if(args.length != 3) { System.out.println(Usage: $java Client endpoint_address client_repo_path policy_xml_path); } ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], null); ServiceClient client = new ServiceClient(ctx, null); Options options = new Options(); options.setAction(urn:echo); options.setTo(new EndpointReference(args[0])); options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, loadPolicy(args[2])); client.setOptions(options); client.engageModule(addressing); client.engageModule(rampart); OMElement response = client.sendReceive(getPayload(Hello world)); System.out.println(response); } Thanks for your time and help, cbear On Sun, Jan 25, 2009 at 6:32 AM, Sameera Jayasoma sameera.madus...@gmail.com wrote: Hi, You can achieve WS-Security with Apache Axis2 by using Rampart. Rampart is an Axis2 module. For more information please refer following articles. http://wso2.org/library/3190 http://wso2.org/library/240 On Sat, Jan 24, 2009 at 8:15 AM, Wishing Carebear wishing.careb...@gmail.com wrote: Hello: I'm using the Cleint API's (ServiceClient and OperationClient) to consume webservices. I have been successful so far writing dynamic clients ( without using wsdl2java). Now want to integrate WSSecurity feature with the dynamic clients. Would like to know if there are any examples how to do WS_Security with Axis2. Thanks for your time and help cabear -- Sameera Jayasoma Software Engineer WSO2 Inc. Oxygenating the Web Service Platform. http://wso2.org/ blog: http://tech.jayasoma.org -- Sameera Jayasoma Software Engineer WSO2 Inc. Oxygenating the Web Service Platform. http://wso2.org/ blog: http://tech.jayasoma.org
How am i suppose to change the ns1 to something else?
Hi All, While running the samples.stock example I tried to capture the SOAP message is being passed from one end to another end i found that in soapenv: Body ns1:getQuote soapenv:encodingStyle=\ http://schemas.xmlsoap.org/soap/encoding/\; xmlns:ns1=\urn:xmltoday-delayed-quotes\ /soapenv: Body now for getQuote it shows prefix as *ns1* if i want to change this value would that be possible, if yes then how am i suppose to change this? Please help me out for this :) -- Regards, Sachin Parnami
Re: Reload keystore file
Does anyone have a clue how I can refresh the keystore in axis2? Thank you. On Wed, Jan 28, 2009 at 10:56 AM, Sebastian Van Sande sebast...@vansande.org wrote: Hi, I have a problem with Axis2. At my project, we have an Microsoft Exchange 2007, and some other project has created an API to interact with this Exchange server with the help of Axis2. This other project uses a Websphere server to manage a keystore to do basic authentication over SSL. My application on the otherhand runs as a standalone application, and I have to manage the keystore myself. Now, I managed to use this keystore to calling the Exchange 2007 Web services over SSL, and it works great. But, as you probably know, certificates expire ... and they have to get renewed. So, I managed to create something a 'KeyStoreManager' that will fetch the new certificates from the Exchange server and put it in the keystore file. And this works great as well .. *IF* I restart my application. When my application modifies the keystore file, it looks like Axis2 is using some caching mechanism. Because when I make the web service call again (after inserting the new certificate in my keystore), it can't authenticate because it cached the keystore file in memory. To specify the keystore to Axis2, I use this code: System.setProperty(javax.net.ssl.trustStore, /path/to/keystore.jks); System.setProperty(javax.net.ssl.trustStorePassword, thisisnottherealpassword); To extract the new certificate and add it to my keystore, I use code based on the one you can find at http://helpdesk.objects.com.au/java/how-do-i-programatically-extract-a-certificate-from-a-site-and-add-it-to-my-keystore The problem is: when the keystore file is updated with the new certificate, axis2 doesn't seem to know about it because it uses a cached version of the keystore file. So my question is: how can I clear this axis2 keystore cache in some way so axis2 will be forced to read the keystore file again? Thank you for your help, Kind regards, Sebastian
Re: How to configure wsdd when Service class in a jar...?
Hi Kamal, Thanks for your suggestion. Actually, the client needs some jar files which are missing in the axis lib directory. Once, I placed the required jars in the axis lib directory, my axis client started working. Axis error messages were misleading!!! Thank You Shravan Kumar. M - Kamal Wrote: Hi, Can you check the TOMCAT DIR/webapps/axis/WEB-INF/server-config.wsdd and see whether your service details are available inside that file? Kamal Mettananda http://lkamal.blogspot.com On Thu, Jan 22, 2009 at 6:16 PM, Shravan Mahankali shravan.mahank...@catalytic.com wrote: Hi, 1) I have a Media.jar which has a service class com.bos.Enlarge.java 2) I have placed this Media.jar in TOMCAT DIR/webapps/axis/WEB-INF/lib/ directory, as suggested in the axis docs. 3) I have below deploy.wsdd, it got deployed successfully, using Axis AdminClient: -- deployment name=MediaTool xmlns=http://xml.apache.org/axis/wsdd/; xmlns:java=http://xml.apache.org/axis/wsdd/providers/java; service name=Media provider=java:RPC parameter name=className value= com.bos.Enlarge/ parameter name=allowedMethods value=scanMedia/ /service /deployment -- 4) But when I access http://127.0.0.1:8080/axis/servlet/AxisServlet to see the list of deployed services, I get this text And now... Some Services and no list. 5) I have a client consuming this webservice as attached here, executing this client is returning - HTTP Status 404 - The requested resource (/axis/Media) is not available. Could anyone please advise, how to handle this scenario. Thank You, Shravan Kumar. M -