Axis security, when web-app can't use Basic Web Authentication
Hi , I'd greatly appreciate advice on the following. In short: what do you do when a web-service requires clients to login (supplying user + password), *but* the server/web-app can't be configured to use basic web authentication ? We have an Axis web service, which requires login (namely, clients connecting to the web service must supply user + password ) . Now, normally this should be handled by the servlet-container (configure "web.xml" to use "Basic Web Authentication", and put Security Constraints on the web-service URL ). *Unfortunately*, we can't take this approach, since our web-application is already using *Form-Based* login (namely: the same web-application that contains our Axis servlet, also contains other modules - such as JSP pages - that rely on form-based login). Any recommendations for this situation ? We are considering solutions, such as:1) A filter to intercept requests to the web-service, and check for user credentials.2) Passing user + password on applicative level, as additional method parameters (we use HTTPS, so passwords can be transmitted safely).Those this make sense ? Or is there some feature build into Axis that could help ? Thanks very much. Do you Yahoo!? Meet the all-new My Yahoo! Try it today!
Re: array of recursive beans (doc/literal style)
Hi Dino, It was nice meeting you yesterday. Thanks for helping with Interop problems :) -- dims On Wed, 16 Feb 2005 19:16:24 -0800, Dino Chiesa [EMAIL PROTECTED] wrote: Hm I don't really know what the problem is, then. I started with the WSDL you sent me, and removed the weird, redundant ArrayOf_tns1_ContainerBean type, and introduced a new named complexType in its place. Like so: element name=getRootContainersResponse type=tns1:ArrayOfContainerBean / complexType name=ArrayOfContainerBean sequence element maxOccurs=unbounded name=item type=tns1:ContainerBean/ /sequence /complexType and then of course the ContainerBean itself specified the type of the childContainers element to be the ArrayOfContainerBean complexType. ya follow me? Then I did the wsdl2Java --server-side dance, not using --noWrapped, and provided an implementation of the service that generates random data, which is important because you are sending xsd:date and .NET doesn't like nil Dates. Whoops ! no ArrayOfContainerBean.java is generated. Using --noWrapped, it is? So in the end I ran wsdl2Java twice, first with noWrapped, then without, and got the required classes to be generated. After taking that brief detour, I deployed the service to Jetty, using the generated deploy.wsdd. I also built a simple .NET client that calls the getRootContainers() method. I get back an array of ContainerBeans and each ContainerBean has a child array of ContainerBeans. It works for me. I am using your wsdl and schema, modified as above. I can send you any of these files or a zip of all of them. I tried it with AXIS v1.1 first, which I have had good success with. It worked. Then I tried it with AXIS 1.2RC2. I expected this to not work because you all are saying that arrays are broken in v1.2RC2. It necessitated lots of changes to my makefile due to changes in the names of generated classes.?? also the weirdness with failing to generate the ArrayOfContainerBean. But in the end it worked. In both cases the client was .NET v1.1. I double-checked the axis jars in the jetty webapp, they are from Nov 16 2004, whiich I guess is the release date of v1.2RC2. so it really is working. I did not apply Eric's patch. I don't even know what Eric's patch is. Just for grins I generated a .NET server-side implementation, too. The same client works with both the AXIS server and the .NET server. Just change the URL.There's no difference. Except the .NET version is faster and better looking. ;) WSDL first, a good idea. (tm) From: Praveen Peddi [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 5:43 PM To: [EMAIL PROTECTED] Subject: Re: array of recursive beans (doc/literal style) I don't really like the option 1. And I don't know how to go for option 2 :). I am trying to apply Eric's patch and see if it fixes my problem (assuming that this patch will be applied to Axis's cvs :) ). Praveen - Original Message - From: Dino Chiesa To: [EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 5:06 PM Subject: RE: array of recursive beans (doc/literal style) yes, our most recent messages crossed in the ether. From: Praveen Peddi [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 2:34 PM To: [EMAIL PROTECTED] Subject: Re: array of recursive beans (doc/literal style) The main problem seems to be in the axis response anyway. So I am not sure if changing the WSDL would fix the problem on .NET side.Axis response has a blank namespace for the second level elements (see the green text and red text. I think they both should have similar attributes and namespaces). thats what I have to fix I think. But how do I fix is the question. 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 getRootContainersResponse xmlns=http://soap.session.ip.contextmedia.com; item xsi:type=ns1:ContainerBean xmlns:ns1=http://soap.session.ip.contextmedia.com; ID9C5B3C608B5D151B6F87E368CC8AF182/ID accessPermissions7/accessPermissions accountID7F1CB4C5C87072FA8D6C21133A642EAB/accountID childContainers item xmlns= ID163C42F9BC87CB1CEBC14C0A45820DED/ID accessPermissions7/accessPermissions accountID7F1CB4C5C87072FA8D6C21133A642EAB/accountID childContainers xsi:nil=true/ creationDate2005-02-09T17:21:44.000Z/creationDate deliveryPermissions0/deliveryPermissions description/ lastModifiedDate2005-02-09T17:21:44.000Z/lastModifiedDate nametest/name parentID9C5B3C608B5D151B6F87E368CC8AF182/parentID type4/type
Axis sends weird SOAP requests
Hi all, I'm investigating how good/bad Axis and Systinet work together. And I think I found a fault at Axis' side. When I send a request with no parameters, Axis generates the following SOAP message: POST /WholeSalerService HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: Axis/1.2RC2 Host: localhost:5050 Cache-Control: no-cache Pragma: no-cache SOAPAction: http://www.apogado.com/ws/WholeSalerService/getAllProducts; Content-Length: 249 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:BodygetAllProducts xmlns=//soapenv:Body/soapenv:Envelope When I send this request to a Systinet Service, I get the following error message from Systinet: HTTP/1.0 500 Internal Server Error Date: Thu, 17 Feb 2005 20:16:22 GMT Server: Systinet Server for Java/5.5 (Java/1.5.0_01; Windows XP/5.1; build SSJ-5.5-20041128-1204) SOAPAction: Content-type: text/xml;charset=UTF-8 Connection: close ?xml version=1.0 encoding=UTF-8? e:Envelope xmlns:e=http://schemas.xmlsoap.org/soap/envelope/;e:Bodye:Faultfaultcodee:Server/faultcodefaultstringUnknown element getAllProducts/faultstringdetailijm:idoox-java-mapping.org.idoox.xmlrpc.MessageProcessingException xmlns:e=http://schemas.xmlsoap.org/soap/envelope/; xmlns:ijm=urn:idoox-java-mappingijm:stack-traceorg.idoox.xmlrpc.MessageProcessingException: Unknown element getAllProducts at org.idoox.wasp.wsdl.SOAPMethodInfo$RequiredElements$Invocation.notNillElement(SOAPMethodInfo.java:1052) at com.systinet.wasp.server.adaptor.JavaInvoker.fillCallParamsXml(JavaInvoker.java:1144) at com.systinet.wasp.server.adaptor.JavaInvoker.beginInvoke(JavaInvoker.java:478) at com.idoox.wasp.server.adaptor.JavaAdaptorImpl.beginInvoke(JavaAdaptorImpl.java:63) at com.idoox.wasp.server.AdaptorTemplate.javaInvocation(AdaptorTemplate.java:510) at com.idoox.wasp.server.AdaptorTemplate.doDispatch(AdaptorTemplate.java:395) at com.idoox.wasp.server.AdaptorTemplate.dispatch(AdaptorTemplate.java:328) at com.idoox.wasp.server.ServiceConnector.dispatch(ServiceConnector.java:378) at com.systinet.wasp.ServiceManagerImpl.dispatchRequest(ServiceManagerImpl.java:625) at com.systinet.wasp.ServiceManagerImpl.dispatch(ServiceManagerImpl.java:461) at com.systinet.wasp.ServiceManagerImpl$DispatcherConnHandler.handlePost(ServiceManagerImpl.java:2525) at com.idoox.transport.http.server.Jetty$WaspHttpHandler.handle(Jetty.java:97) at com.mortbay.HTTP.HandlerContext.handle(HandlerContext.java:1087) at com.mortbay.HTTP.HttpServer.service(HttpServer.java:675) at com.mortbay.HTTP.HttpConnection.service(HttpConnection.java:457) at com.mortbay.HTTP.HttpConnection.handle(HttpConnection.java:317) at com.mortbay.HTTP.SocketListener.handleConnection(SocketListener.java:99) at com.mortbay.Util.ThreadedServer.handle(ThreadedServer.java:254) at com.mortbay.Util.ThreadPool$PoolThreadRunnable.run(ThreadPool.java:607) at java.lang.Thread.run(Thread.java:595) /ijm:stack-trace/ijm:idoox-java-mapping.org.idoox.xmlrpc.MessageProcessingException/detail/e:Fault/e:Body/e:Envelope This is the SOAP message that SHOULD be sended by Axis: POST /WholeSalerService HTTP/1.1 Content-Length: 144 Content-Type: text/xml; charset=utf-8 SOAPAction: http://www.apogado.com/ws/WholeSalerService/getAllProducts User-Agent: Jakarta Commons-HttpClient/2.0.1 Host: localhost:5050 Expect: 100-continue SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; SOAP-ENV:Header/ SOAP-ENV:Body/ /SOAP-ENV:Envelope When I send the SOAP message manually (with some SOAP debug tool), then I get the right response, and not the error I get when I send the generated SOAP message with Axis. Here is my WSDL file, I think it's correct .. if not so, please let me know: ?xml version=1.0 encoding=UTF-8? wsdl:definitions name=WholeSalerService targetNamespace=http://www.apogado.com/ws/WholeSalerService.wsdl; xmlns:tns=http://www.apogado.com/ws/WholeSalerService.wsdl; xmlns:xsd1=http://www.apogado.com/ws/WholeSalerService.xsd; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; wsdl:types xsd:schema targetNamespace=http://www.apogado.com/ws/WholeSalerService.xsd; elementFormDefault=qualified xsd:element name=Address xsd:complexType xsd:sequence xsd:element maxOccurs=1 minOccurs=1 name=type type=xsd:string/ xsd:element maxOccurs=1 minOccurs=1 name=street type=xsd:string/ xsd:element maxOccurs=1 minOccurs=1 name=number
re: one webservice won't deploy
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I use ant to deploy my webservices, and 4 of the 5 deploy. The one that doesn't, doesn't give any kind of error, it just doesn't get written into the wsdd file. Any idea why this may be happening? I don't even know where I should start looking. The webservice was deploying, it started yesterday to not deploy. Thanx for any suggestions. - -- Love is mutual self-giving that ends in self-recovery. Fulton Sheen James Black[EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCFJ7EikQgpVn8xrARAsO1AJwPO7Kt/Gs//zhpvX8vGAPwwKegWwCgi6r3 zLWWA/q7rvCStlXGVEDo+5s= =rWUn -END PGP SIGNATURE-
Re: one webservice won't deploy
Hi James, If you are running Axis under Tomcat then look at Tomcat console or log files. Sunil DISCLAIMER: Any Information contained or transmitted in this e-mail and / or attachments may contain confidential data, proprietary to Majoris Systems Pvt Ltd., and / or the authors of the information and is intended for use only by the individual or entity to which it is addressed. If you are not the intended recipient or email appears to have been sent to you by error, you are not authorised to access, read, disclose, copy, use or otherwise deal with it. If you have received this e-mail in error, please notify us immediately at mail to: [EMAIL PROTECTED] and delete this mail from your records. This is to notify that Majoris Systems Pvt Limited shall have no liability or obligation, legal or otherwise, for any errors, omissions, viruses or computer problems experienced as a result of this transmission since data over the public Internet cannot be guaranteed to be secure or error-free. - Original Message - From: James Black [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 17, 2005 7:10 PM Subject: re: one webservice won't deploy -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I use ant to deploy my webservices, and 4 of the 5 deploy. The one that doesn't, doesn't give any kind of error, it just doesn't get written into the wsdd file. Any idea why this may be happening? I don't even know where I should start looking. The webservice was deploying, it started yesterday to not deploy. Thanx for any suggestions. - -- Love is mutual self-giving that ends in self-recovery. Fulton Sheen James Black[EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCFJ7EikQgpVn8xrARAsO1AJwPO7Kt/Gs//zhpvX8vGAPwwKegWwCgi6r3 zLWWA/q7rvCStlXGVEDo+5s= =rWUn -END PGP SIGNATURE-
Re: one webservice won't deploy
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sunil Kothari wrote: | Hi James, | If you are running Axis under Tomcat then look at Tomcat console or log | files. ~ I found no errors in catalina.out or server.log, which is why I am confused. - -- Love is mutual self-giving that ends in self-recovery. Fulton Sheen James Black[EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCFKPNikQgpVn8xrARAqLLAJoCelxzTbYlxc8zqGaxFKMQH6MSIwCfQUiC r+Yjg9g3/Oa6As3aMIqnWPw= =nMqz -END PGP SIGNATURE-
Wrapper/lit, Messaging Interop with .NET
Title: Message Hi, I read few threads which recommend to use wrapped/lit for interop between Axis (server in my case) and .NET (client app in my case). I was wondering if Messaging style is also well supported with .NET? In the case of my application, we want to receive an XML structure + a string + boolean, and return an XML structure as response. So, we could encode all that in a outer XML structure, as request too, which would be Messaging style-friendly too. But we are wondering how .NET would work with this style? Thanks for you answer! Christian Faucher "Ce message est confidentiel, a l'usage exclusif du destinataire ci-dessus et son contenu ne represente en aucun cas un engagement de la part de AXA, sauf en cas de stipulation expresse et par ecrit de la part de AXA. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement. Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur.""This e-mail message is confidential, for the exclusive use of the addressee and its contents shall not constitute a commitment by AXA, except as otherwise specifically provided in writing by AXA. Any unauthorized disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately."
Re: Wrapper/lit, Messaging Interop with .NET
You can certainly use message style... .NET can work with your XML Schema-defined message parts. A good way to test interop (from the message part standpoint) is to use the xsd.exe commandline utility in .NET to chomp your XSD file you have created for your Axis message style service. This will give you an idea of what your objects will look like when creating a web reference to your Axis service... -pc On Thu, 17 Feb 2005 09:39:27 -0500, Faucher, Christian [EMAIL PROTECTED] wrote: Hi, I read few threads which recommend to use wrapped/lit for interop between Axis (server in my case) and .NET (client app in my case). I was wondering if Messaging style is also well supported with .NET? In the case of my application, we want to receive an XML structure + a string + boolean, and return an XML structure as response. So, we could encode all that in a outer XML structure, as request too, which would be Messaging style-friendly too. But we are wondering how .NET would work with this style? Thanks for you answer! Christian Faucher Ce message est confidentiel, a l'usage exclusif du destinataire ci-dessus et son contenu ne represente en aucun cas un engagement de la part de AXA, sauf en cas de stipulation expresse et par ecrit de la part de AXA. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement. Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur. This e-mail message is confidential, for the exclusive use of the addressee and its contents shall not constitute a commitment by AXA, except as otherwise specifically provided in writing by AXA. Any unauthorized disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately.
Re: Error generating WSDL with xsd:string attribute in AXIS 1.2RC2
Hello. I've found a workaround to the problem stated below. Tracing through the Axis code i found out that the WSDL Emitter gets confused with namespaces. I've removed all simpleType's like xsd:simpleType name=uuid xsd:restriction base=xsd:string xsd:pattern value=[_][a-zA-Z0-9\-_]{22}/ /xsd:restriction /xsd:simpleType I've left all enumerations like the one below in the wsdl schema. xsd:simpleType name=clientType xsd:restriction base=xsd:string xsd:enumeration value=BROKERAGE/ xsd:enumeration value=TRADING/ /xsd:restriction /xsd:simpleType Thomas - Original Message - From: thomas willomitzer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 20:35 Subject: Error generating WSDL with xsd:string attribute in AXIS 1.2RC2 Hi There! I have seen a couple of people with the same problem but there seems to be no answer so far: The problem relates to WSDL generation of deployed services in Axis 1.2RC2 . The error is: BEGIN AXIS error Sorry, something seems to have gone wrong... here are the details: Fault - Bean attribute ISIN is of type java.lang.String, which is not a simple type AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException faultSubcode: faultString: Bean attribute ISIN is of type java.lang.String, which is not a simple type faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}hostname:willo END -- The steps involved to reproduce the problem (I've done it around 132 times): 1.) run wsdl2java -s -t file.wsdl (wsdl file below) 2.) Compile and deploy service with adminclient deploy.wsdd 3.) List services (deployed service appears) 4.) Try to get wsdl of deployed service I changed the type ISIN above to xsd:int int he schema and no complains about ISIN anymore. It complained about CountryCode though, which is the next xsd:string attribute in the complexType. PLEASE HELP! Cheers Thomas Here is my WSDL file BEGIN ?xml version=1.0 encoding=UTF-8? wsdl:definitions name=Untitled targetNamespace=http://soap.xml.company.com/; xmlns:bhub=http://data.xml.company.com; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:tns=http://soap.xml.company.com/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; wsdl:types xsd:schema attributeFormDefault=unqualified elementFormDefault=qualified targetNamespace=http://data.xml.company.com; xmlns=http://data.xml.company.com; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xsd:simpleType name=time xsd:restriction base=xsd:string xsd:pattern value=[a-zA-Z]{3}[ ][a-zA-Z]{3}[ ][0-9]{2}[ ][0-9]{2}[:][0-9]{2}[:][0-9]{2} [ ][a-zA-Z]{3}[ ][0-9]{4}/ /xsd:restriction /xsd:simpleType xsd:simpleType name=hour xsd:restriction base=xsd:string xsd:pattern value=[0-9]?[0-9][:][0-9]{2}[:][0-9]{2}/ /xsd:restriction /xsd:simpleType xsd:simpleType name=date xsd:restriction base=xsd:string xsd:pattern value=[0-3]?[0-9][\-][a-zA-Z]{3}[\-][0-9]{2}/ /xsd:restriction /xsd:simpleType xsd:simpleType name=boolean xsd:restriction base=xsd:string xsd:enumeration value=TRUE/ xsd:enumeration value=FALSE/ /xsd:restriction /xsd:simpleType xsd:simpleType name=clientType xsd:restriction base=xsd:string xsd:enumeration value=BROKERAGE/ xsd:enumeration value=TRADING/ /xsd:restriction /xsd:simpleType xsd:simpleType name=userType xsd:restriction base=xsd:string xsd:enumeration value=BROKER/ xsd:enumeration value=TRADER/ /xsd:restriction /xsd:simpleType xsd:simpleType name=productType xsd:restriction base=xsd:string xsd:enumeration value=FUTURE/ xsd:enumeration value=INDEX/ xsd:enumeration value=EQUITY/ /xsd:restriction /xsd:simpleType xsd:simpleType name=productTypeInt xsd:restriction base=xsd:int
RE: Axis security, when web-app can't use Basic Web Authenticatio n
There are couple of approaches you can take, but here's what I would do. - Implement an Authentication handler and Authorization handler extending BasicHandler These handlers would directly invoke your authentication/authorization methods andvalidate credentials. - Set authenticated user context in servlet request/context if your business components need it. - Defile these handlers in wsdd request flow inside your service section. e.g. requestFlow name="UserAuth" handler type="java:my.own.AuthenticationHandler"/ handler type="java:my.own.AuthorizationHandler"/ /requestFlow - Client should supply credentials in message header. In the case of Axis clients, it would be something like: call.setUsername(uid); call.setPassword(pswd); Hope it helps. Jai -Original Message-From: sol myr [mailto:[EMAIL PROTECTED]Sent: Thursday, February 17, 2005 5:28 AMTo: [EMAIL PROTECTED]Subject: Axis security, when web-app can't use Basic Web Authentication Hi , I'd greatly appreciate advice on the following. In short: what do you do when a web-service requires clients to login (supplying user + password), *but* the server/web-app can't be configured to use basic web authentication ? We have an Axis web service, which requires login (namely, clients connecting to the web service must supply user + password ) . Now, normally this should be handled by the servlet-container (configure "web.xml" to use "Basic Web Authentication", and put Security Constraints on the web-service URL ). *Unfortunately*, we can't take this approach, since our web-application is already using *Form-Based* login (namely: the same web-application that contains our Axis servlet, also contains other modules - such as JSP pages - that rely on form-based login). Any recommendations for this situation ? We are considering solutions, such as:1) A filter to intercept requests to the web-service, and check for user credentials.2) Passing user + password on applicative level, as additional method parameters (we use HTTPS, so passwords can be transmitted safely).Those this make sense ? Or is there some feature build into Axis that could help ? Thanks very much. Do you Yahoo!?Meet the all-new My Yahoo! - Try it today!
RE: JWS question
If you invoke it through SOAP, you will get a nice SOAP:Fault with more details of the error. HTH -Original Message- From: Dave Hoffer [mailto:[EMAIL PROTECTED] Sent: 08 February 2005 20:46 To: [EMAIL PROTECTED] Subject: JWS question I have a single java class that has two public methods that I am trying to deploy using JWS. However these two methods use JNI to call code in a library (dll). Can I use JWS to deploy this (at least for test)? I have put the library code (dll) in the same folder as the class file that JWS creates. Is this the right location? Should I use the lib folder instead? When I click to see the wsdl that JWS creates it says... AXIS error Sorry, something seems to have gone wrong... here are the details: Exception - java.lang.reflect.InvocationTargetException How can I deploy this?
RE: Axis security, when web-app can't use Basic Web Authentication
I like that solution, especially because of the ease of a client supplying credentials (call.setUsername()). But is there an interoperable solution that would work with .NET in a similar manner? -Sharam From: THOMAS, JAI [AG-Contractor/1000] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 17, 2005 11:22 AMTo: '[EMAIL PROTECTED]'Subject: RE: Axis security, when web-app can't use Basic Web Authentication There are couple of approaches you can take, but here's what I would do. - Implement an Authentication handler and Authorization handler extending BasicHandler These handlers would directly invoke your authentication/authorization methods andvalidate credentials. - Set authenticated user context in servlet request/context if your business components need it. - Defile these handlers in wsdd request flow inside your service section. e.g. requestFlow name="UserAuth" handler type="java:my.own.AuthenticationHandler"/ handler type="java:my.own.AuthorizationHandler"/ /requestFlow - Client should supply credentials in message header. In the case of Axis clients, it would be something like: call.setUsername(uid); call.setPassword(pswd); Hope it helps. Jai -Original Message-From: sol myr [mailto:[EMAIL PROTECTED]Sent: Thursday, February 17, 2005 5:28 AMTo: [EMAIL PROTECTED]Subject: Axis security, when web-app can't use Basic Web Authentication Hi , I'd greatly appreciate advice on the following. In short: what do you do when a web-service requires clients to login (supplying user + password), *but* the server/web-app can't be configured to use basic web authentication ? We have an Axis web service, which requires login (namely, clients connecting to the web service must supply user + password ) . Now, normally this should be handled by the servlet-container (configure "web.xml" to use "Basic Web Authentication", and put Security Constraints on the web-service URL ). *Unfortunately*, we can't take this approach, since our web-application is already using *Form-Based* login (namely: the same web-application that contains our Axis servlet, also contains other modules - such as JSP pages - that rely on form-based login). Any recommendations for this situation ? We are considering solutions, such as:1) A filter to intercept requests to the web-service, and check for user credentials.2) Passing user + password on applicative level, as additional method parameters (we use HTTPS, so passwords can be transmitted safely).Those this make sense ? Or is there some feature build into Axis that could help ? Thanks very much. Do you Yahoo!?Meet the all-new My Yahoo! - Try it today!
RE: Axis security, when web-app can't use Basic Web Authenticatio n
Sharam, This approach is interoperable since you are effectively settingthese data in message header. For e.g. .NET client usemethods provided by .NET to do the same. Jai -Original Message-From: Sharam Fouladgar-Mercer [mailto:[EMAIL PROTECTED]Sent: Thursday, February 17, 2005 10:48 AMTo: [EMAIL PROTECTED]Subject: RE: Axis security, when web-app can't use Basic Web Authentication I like that solution, especially because of the ease of a client supplying credentials (call.setUsername()). But is there an interoperable solution that would work with .NET in a similar manner? -Sharam From: THOMAS, JAI [AG-Contractor/1000] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 17, 2005 11:22 AMTo: '[EMAIL PROTECTED]'Subject: RE: Axis security, when web-app can't use Basic Web Authentication There are couple of approaches you can take, but here's what I would do. - Implement an Authentication handler and Authorization handler extending BasicHandler These handlers would directly invoke your authentication/authorization methods andvalidate credentials. - Set authenticated user context in servlet request/context if your business components need it. - Defile these handlers in wsdd request flow inside your service section. e.g. requestFlow name="UserAuth" handler type="java:my.own.AuthenticationHandler"/ handler type="java:my.own.AuthorizationHandler"/ /requestFlow - Client should supply credentials in message header. In the case of Axis clients, it would be something like: call.setUsername(uid); call.setPassword(pswd); Hope it helps. Jai -Original Message-From: sol myr [mailto:[EMAIL PROTECTED]Sent: Thursday, February 17, 2005 5:28 AMTo: [EMAIL PROTECTED]Subject: Axis security, when web-app can't use Basic Web Authentication Hi , I'd greatly appreciate advice on the following. In short: what do you do when a web-service requires clients to login (supplying user + password), *but* the server/web-app can't be configured to use basic web authentication ? We have an Axis web service, which requires login (namely, clients connecting to the web service must supply user + password ) . Now, normally this should be handled by the servlet-container (configure "web.xml" to use "Basic Web Authentication", and put Security Constraints on the web-service URL ). *Unfortunately*, we can't take this approach, since our web-application is already using *Form-Based* login (namely: the same web-application that contains our Axis servlet, also contains other modules - such as JSP pages - that rely on form-based login). Any recommendations for this situation ? We are considering solutions, such as:1) A filter to intercept requests to the web-service, and check for user credentials.2) Passing user + password on applicative level, as additional method parameters (we use HTTPS, so passwords can be transmitted safely).Those this make sense ? Or is there some feature build into Axis that could help ? Thanks very much. Do you Yahoo!?Meet the all-new My Yahoo! - Try it today!
Custom Deserializer/typeMapping problem
I am having a problem getting my Deserializer to be used after registering its Factory with the typeMapping element in the dd. I have tried many different combinations but regardless of what I do the SimpleDeserializer is selected. I believe this is happening because axis is interpreting the entire message as a String instead of my desired type. I am somewhat new to axis so any help from those of you who really understand the framework would be much appreciated. There have been several similar threads on this with this one being the closest to my problem, however the solution needs to be on the server not the client: List: axis-user Subject: (resolved) RE: deserializing nested complex types From: Mitch Gitman mgitman () usa ! net Date: 2002-12-06 21:36:19 From my dd: typeMapping qname=baldue:BalanceDueMsg xmlns:baldue=http://balancedue.websvc.csp.leapwireless.com languageSpecificType=java:com.leapwireless.csp.websvc.balancedue.BalanceDueMsgType serializer=com.leapwireless.csp.websvc.balancedue.axis.BalanceDueSerializerFactory deserializer=com.leapwireless.csp.websvc.balancedue.axis.BalanceDueDeserializerFactory encodingStyle=http://schemas.xmlsoap.org/soap/encoding// My web service class relevant method signature (this is a java rpc service): public BalanceDueMsgType getBalanceDue(BalanceDueMsgType msgT) I am using JDK 1.4.2, JBoss 3.2.5/JBoss.Net/Axis 1.1 Basically my DeserializerFactory/Deserializer never gets a chance to deal with the incoming request message (java rpc web service). The SimpleDeserializer always gets these and returns a this error when dealing with the nested type in the message: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. I set a breakpoint in the Eclipse debugger in the SimpleDeserializer onChildElement method (which throws the exception) and this is what the variables look like in that method: this= SimpleDeserializer (id=212) activeDeserializers= HashSet (id=229) attributeMap= null cacheStringDSer= null cacheXMLType= null componentsReadyFlag= false constructor= Constructor (id=236) defaultType= null id= null isEnded= false isHref= false isNil= false javaType= Class (java.lang.String) (id=200)//Based on other problems like this one I believe the problem is here, i.e. axis thinks this is a string type. myElement= null myElements= null myIndex= 0 propertyMap= null targets= Vector (id=241) typeDesc= null val= CharArrayWriter (id=246) value= null xmlType= QName (id=249) localPart= string namespaceURI= http://www.w3.org/2001/XMLSchema namespace= http://balancedue.websvc.csp.leapwireless.com localName= BalanceDueMsg prefix= attributes= NullAttributes (id=205) context= DeserializationContextImpl (id=213) Most interesting here are the values of the namespace and localName local variables (which are the ones I want) and the value of the SimpleDeserializer.javaType field which is set to a String when it should be BalanceDueMsgType. Based on the debugger variables above, the value of the curElement field inside of the context variable has this data (which is what was intended): BalanceDueMsg xmlns=http://balancedue.websvc.csp.leapwireless.com accountNumACCOUNTNUMBER/accountNum sessionIdSTRING/sessionId balanceData/ /BalanceDueMsg The client I am using is a little gizmo in Oxygen XML that prepares the raw xml so you can edit it manually and then sends it so I am not using any wsdl2java stubs or anything like that. This tool bases everything off the wsdl/schema and is more rigorous than most in terms of validation. Also the information is getting to the correct place in the correct way with the exception of the Deserializer that is chosen. Here is the SOAP input and response: SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ SOAP-ENV:Header/ SOAP-ENV:Body oxy:getBalanceDue xmlns:oxy=http://balancedue.websvc.csp.leapwireless.com SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ msgT BalanceDueMsg xmlns=http://balancedue.websvc.csp.leapwireless.com accountNumACCOUNTNUMBER/accountNum sessionIdSTRING/sessionId balanceData/ /BalanceDueMsg /msgT /oxy:getBalanceDue /SOAP-ENV:Body /SOAP-ENV:Envelope 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:Fault faultcodesoapenv:Server.userException/faultcode faultstringorg.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize./faultstring detail/ /soapenv:Fault /soapenv:Body /soapenv:Envelope Mike Cassisa Software Engineer Cricket Communications 10307 Pacific Center Court San Diego, CA 92121 858-882-6096 Office
re: webservice won't deploy at all
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have tried to get my webservice to deploy, and have had no luck. The other 4 deploy fine. I am including my deployment wsdd file to see if there is something that ~ is causing it to not deploy. Tomcat is showing no errors in the logs, and the modification date on the server-config.wsdd file is changed, but nothing is actually written. Any ideas would be great. Thanx. - -- Love is mutual self-giving that ends in self-recovery. Fulton Sheen James Black[EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCFNSiikQgpVn8xrARAplFAJ9u0AXgxwJ1hWWz/infYsmI0n/ZdQCgkele 6yoW7paNoknOVNSArc0LPns= =c0aB -END PGP SIGNATURE-
RE: Axis security, when web-app can't use Basic Web Authenticatio n
Not sure if this fits your requirements, but if you want to use HTTP Basic Authentication **without** having the servlet container manage it for you, try using: org.apache.axis.handlers.http.HttpAuthHandler This class strips out the user name and password from the HTTP Headers and sets the username and password on the context. Then, you would need to setup another handler to actually authenticate and authorize the user as Thomas stated. So your requestFlow would look like this: requestFlow name=UserAuth handler type=java:org.apache.axis.handlers.http.HttpAuthHandler/ handler type=java:my.own.AuthenticationHandler/ handler type=java:my.own.AuthorizationHandler/ /requestFlow Al Quoting THOMAS, JAI [AG-Contractor/1000] [EMAIL PROTECTED]: There are couple of approaches you can take, but here's what I would do. - Implement an Authentication handler and Authorization handler extending BasicHandler These handlers would directly invoke your authentication/authorization methods and validate credentials. - Set authenticated user context in servlet request/context if your business components need it. - Defile these handlers in wsdd request flow inside your service section. e.g. requestFlow name=UserAuth handler type=java:my.own.AuthenticationHandler/ handler type=java:my.own.AuthorizationHandler/ /requestFlow - Client should supply credentials in message header. In the case of Axis clients, it would be something like: b Hope it helps. Jai -Original Message- From: sol myr [mailto:[EMAIL PROTECTED] Sent: Thursday, February 17, 2005 5:28 AM To: [EMAIL PROTECTED] Subject: Axis security, when web-app can't use Basic Web Authentication Hi , I'd greatly appreciate advice on the following. In short: what do you do when a web-service requires clients to login (supplying user + password), *but* the server/web-app can't be configured to use basic web authentication ? We have an Axis web service, which requires login (namely, clients connecting to the web service must supply user + password ) . Now, normally this should be handled by the servlet-container (configure web.xml to use Basic Web Authentication, and put Security Constraints on the web-service URL ). *Unfortunately*, we can't take this approach, since our web-application is already using *Form-Based* login (namely: the same web-application that contains our Axis servlet, also contains other modules - such as JSP pages - that rely on form-based login). Any recommendations for this situation ? We are considering solutions, such as: 1) A filter to intercept requests to the web-service, and check for user credentials. 2) Passing user + password on applicative level, as additional method parameters (we use HTTPS, so passwords can be transmitted safely). Those this make sense ? Or is there some feature build into Axis that could help ? Thanks very much. _ Do you Yahoo!? Meet the all-new My Yahoo! http://my.yahoo.com - Try it today!
re: Problem with java2wsdl ant task for document/literal (was Re: webservice won't deploy at all)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I removed style=wrapped use=literal from my ant task, java2wsdl, and now I can deploy my webservice. If I want to use the ant task to generate my files, how do I tell it to use document/literal wrapped. Thanx. - -- Love is mutual self-giving that ends in self-recovery. Fulton Sheen James Black[EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCFNiZikQgpVn8xrARAkweAJ9o2ZQrx297ZbsoJknJpnKyvuMUKQCdFKH5 bxVd8aBWcOcMBIyqQHyxjeg= =IrJ7 -END PGP SIGNATURE-
To any .NET friends out here...
Title: Message Hi, I would appreciate if any .NET friends out here could validate the attached WSDL file against .NET and, in case something is wrong, let me know what is it. Unfortunatly, I dont have .NET installed on my PC and I am not familiar with it, the reason why I am asking the community for this. The server-side is Java (1.4.2) with Axis 1.2RC2, deployed over SunOne 7.1. The style is "wrapped" (see attached .wsdd). Here is the signature of the method being invoked on the server: String makeNewBusiness(String pBrokerUserId, String pRequestXml, boolean pSnapshots); Thank you for your help! Christian Faucher "Ce message est confidentiel, a l'usage exclusif du destinataire ci-dessus et son contenu ne represente en aucun cas un engagement de la part de AXA, sauf en cas de stipulation expresse et par ecrit de la part de AXA. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement. Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur.""This e-mail message is confidential, for the exclusive use of the addressee and its contents shall not constitute a commitment by AXA, except as otherwise specifically provided in writing by AXA. Any unauthorized disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately." CQDemoServer.wsdd Description: CQDemoServer.wsdd CQDemo-wrapped.wsdl Description: CQDemo-wrapped.wsdl
RE: To any .NET friends out here...
Title: Message Remove the namespace prefix from the global element names (NCName). See the attachments. From: Faucher, Christian [mailto:[EMAIL PROTECTED] Sent: February 17, 2005 12:53 PM To: [EMAIL PROTECTED] Subject: To any .NET friends out here... Hi, I would appreciate if any .NET friends out here could validate the attached WSDL file against .NET and, in case something is wrong, let me know what is it. Unfortunatly, I dont have .NET installed on my PC and I am not familiar with it, the reason why I am asking the community for this. The server-side is Java (1.4.2) with Axis 1.2RC2, deployed over SunOne 7.1. The style is wrapped (see attached .wsdd). Here is the signature of the method being invoked on the server: String makeNewBusiness(String pBrokerUserId, String pRequestXml, boolean pSnapshots); Thank you for your help! Christian Faucher Ce message est confidentiel, a l'usage exclusif du destinataire ci-dessus et son contenu ne represente en aucun cas un engagement de la part de AXA, sauf en cas de stipulation expresse et par ecrit de la part de AXA. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement. Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur. This e-mail message is confidential, for the exclusive use of the addressee and its contents shall not constitute a commitment by AXA, except as otherwise specifically provided in writing by AXA. Any unauthorized disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately. CQDemo-wrapped.wsdl Description: CQDemo-wrapped.wsdl CQDemoImplService.cs Description: CQDemoImplService.cs
Re: axis on-the-fly wsdl generation problem
Final followup, FYI. In the end, the problem turned out to be java2wsdl of wsdl2java of the following type of xsd fragment: xsd:element name="nest" xsd:complexType xsd:sequence xsd:element ref="nest" minOccurs="0" maxOccurs="unbounded"/ xsd:element ref="atom" minOccurs="0" maxOccurs="unbounded"/ /xsd:sequence /xsd:complexType /xsd:element It appears that it cannot handle the anonymous complexType when referenced by a subelement. For instance, the approximate equivalent below is handled properly: xsd:complexType name="NestType" xsd:sequence xsd:element ref="nest" minOccurs="0" maxOccurs="unbounded"/ xsd:element ref="atom" minOccurs="0" maxOccurs="unbounded"/ /xsd:sequence /xsd:complexType xsd:element name="nest" type="NestType"/ I've no idea why this change should make a difference, but ?wsdl is working again for me. Cheers, Michael Michael Thome wrote: As an in-progress followup, the lack of a stack dump is due to java bug 4872096 (see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4872096 ) which can be worked around by adding -Xint to the vm arguments. I'm currently getting (with the middle cut out): java.lang.StackOverflowError ...
RE : To any .NET friends out here...
Title: Message Cool! Thanks for your help, Ioan. Question to all: what is the trick so that my parameters dont get prefixed with namespace, ?wsdl generated WSDL? Some entry in WSDD file? Christian Faucher -Message d'origine-De: Ioan Berbece [mailto:[EMAIL PROTECTED] Envoyé: jeudi, février 17, 2005 13:33À: [EMAIL PROTECTED]Objet: RE: To any .NET friends out here... Remove the namespace prefix from the global element names (NCName). See the attachments. From: Faucher, Christian [mailto:[EMAIL PROTECTED] Sent: February 17, 2005 12:53 PMTo: [EMAIL PROTECTED]Subject: To any .NET friends out here... Hi, I would appreciate if any .NET friends out here could validate the attached WSDL file against .NET and, in case something is wrong, let me know what is it. Unfortunatly, I dont have .NET installed on my PC and I am not familiar with it, the reason why I am asking the community for this. The server-side is Java (1.4.2) with Axis 1.2RC2, deployed over SunOne 7.1. The style is "wrapped" (see attached .wsdd). Here is the signature of the method being invoked on the server: String makeNewBusiness(String pBrokerUserId, String pRequestXml, boolean pSnapshots); Thank you for your help! Christian Faucher "Ce message est confidentiel, a l'usage exclusif du destinataire ci-dessus et son contenu ne represente en aucun cas un engagement de la part de AXA, sauf en cas de stipulation expresse et par ecrit de la part de AXA. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement. Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur.""This e-mail message is confidential, for the exclusive use of the addressee and its contents shall not constitute a commitment by AXA, except as otherwise specifically provided in writing by AXA. Any unauthorized disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately."
Re: Deploy problems - any thoughts please
Do you are trying to deploy some beans which contains another beans which contains another beans etc. I don't know exactly what Axis perform for discovering relationships in the beans. But i think it uses reflection or instrospection. Maybe there is no end in your relationship ! Maybe you have to indicate explicitly when Axis has to stop its reflection -- Sebastien On Wed, 16 Feb 2005 17:30:34 -0800 (PST), Samisa Abeysinghe [EMAIL PROTECTED] wrote: I get a SOAP fault when trying to deploy wsdd with AdminClient. No clue why this is happening. I have the classes on my CLASSPATH. Appriciate any help. Details below. Thanks, Samisa... Processing file ca/deploy.wsdd Exception: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.reflect.InvocationTargetException faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.reflect.InvocationTargetException faultActor: faultNode: faultDetail: java.lang.reflect.InvocationTargetException at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:223) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:130) at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1053) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:218) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:568) at org.apache.axis.Message.getSOAPEnvelope(Message.java:427) at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:701) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:93) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:144) at org.apache.axis.client.Call.invokeEngine(Call.java:2688) at org.apache.axis.client.Call.invoke(Call.java:2671) __ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250
Re: Custom Deserializer/typeMapping problem
Since you are in wrapped/literal mode shouldn't the encoding style be ""? Or you could try using beanMapping rather than typeMapping. Also, the msgT tag looks strange. It seems unnecessary but if you do add then I think you need a deserializer for that structure too. Mike Cassisa wrote: I am having a problem getting my Deserializer to be used after registering its Factory with the typeMapping element in the dd. I have tried many different combinations but regardless of what I do the SimpleDeserializer is selected. I believe this is happening because axis is interpreting the entire message as a String instead of my desired type. I am somewhat new to axis so any help from those of you who really understand the framework would be much appreciated. There have been several similar threads on this with this one being the closest to my problem, however the solution needs to be on the server not the client: List: axis-user Subject: (resolved) RE: deserializing nested complex types From: Mitch Gitman mgitman () usa ! net Date: 2002-12-06 21:36:19 From my dd: typeMapping qname="baldue:BalanceDueMsg" xmlns:baldue="http://balancedue.websvc.csp.leapwireless.com" languageSpecificType="java:com.leapwireless.csp.websvc.balancedue.BalanceDueMsgType" serializer="com.leapwireless.csp.websvc.balancedue.axis.BalanceDueSerializerFactory" deserializer="com.leapwireless.csp.websvc.balancedue.axis.BalanceDueDeserializerFactory" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/ My web service class relevant method signature (this is a java rpc service): public BalanceDueMsgType getBalanceDue(BalanceDueMsgType msgT) I am using JDK 1.4.2, JBoss 3.2.5/JBoss.Net/Axis 1.1 Basically my DeserializerFactory/Deserializer never gets a chance to deal with the incoming request message (java rpc web service). The SimpleDeserializer always gets these and returns a this error when dealing with the nested type in the message: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. I set a breakpoint in the Eclipse debugger in the SimpleDeserializer onChildElement method (which throws the exception) and this is what the variables look like in that method: this= SimpleDeserializer (id=212) activeDeserializers= HashSet (id=229) attributeMap= null cacheStringDSer= null cacheXMLType= null componentsReadyFlag= false constructor= Constructor (id=236) defaultType= null id= null isEnded= false isHref= false isNil= false javaType= Class (java.lang.String) (id=200)//Based on other problems like this one I believe the problem is here, i.e. axis thinks this is a string type. myElement= null myElements= null myIndex= 0 propertyMap= null targets= Vector (id=241) typeDesc= null val= CharArrayWriter (id=246) value= null xmlType= QName (id=249) localPart= "string" namespaceURI= "http://www.w3.org/2001/XMLSchema" namespace= "http://balancedue.websvc.csp.leapwireless.com" localName= "BalanceDueMsg" prefix= "" attributes= NullAttributes (id=205) context= DeserializationContextImpl (id=213) Most interesting here are the values of the namespace and localName local variables (which are the ones I want) and the value of the SimpleDeserializer.javaType field which is set to a String when it should be BalanceDueMsgType. Based on the debugger variables above, the value of the curElement field inside of the context variable has this data (which is what was intended): BalanceDueMsg xmlns="http://balancedue.websvc.csp.leapwireless.com" accountNumACCOUNTNUMBER/accountNum sessionIdSTRING/sessionId balanceData/ /BalanceDueMsg The client I am using is a little gizmo in Oxygen XML that prepares the raw xml so you can edit it manually and then sends it so I am not using any wsdl2java stubs or anything like that. This tool bases everything off the wsdl/schema and is more rigorous than most in terms of validation. Also the information is getting to the correct place in the correct way with the exception of the Deserializer that is chosen. Here is the SOAP input and response: SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:Header/ SOAP-ENV:Body oxy:getBalanceDue xmlns:oxy="http://balancedue.websvc.csp.leapwireless.com" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" msgT BalanceDueMsg xmlns="http://balancedue.websvc.csp.leapwireless.com" accountNumACCOUNTNUMBER/accountNum sessionIdSTRING/sessionId balanceData/ /BalanceDueMsg /msgT /oxy:getBalanceDue /SOAP-ENV:Body /SOAP-ENV:Envelope 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
Re: basic question about axis
I'm not sure what you are asking exactly. Tomcat routes incoming requests based on the path and extension type, as specified in web.xml. For example, any requests for jws files are routed to Axis: servlet-mapping servlet-nameAxisServlet/servlet-name url-pattern*.jws/url-pattern /servlet-mapping You can look at the web.xml in the sample app released with axis. Vikas Phonsa wrote: Hi Everybody, I have a very basic question about how axis intercepts calls to the deployed services. An axis based web services application is not much different than a regular web application deployed with the war structure except that we load a bunch of axis servlets on startup and we have a server-config.wsdd file. When a request comes over http it first reaches the application server and the server passes the request to the required application. So when and how does axis come into picture here (assuming that we don't have any custom handlers and stuff )? What happens when the request is passed from the server to the web application? Thanks Vikas
Re: basic question about axis
servlet-mapping servlet-nameAxisServlet/servlet-name url-pattern/services/*/url-pattern /servlet-mapping So every request with /services/* would be passed to the AxisServlet, right? Right Now how would the AxisServlet find the service / class that needs to be invoked? JWS files are found automatically; you don't have to do anything. For services that are written in Java you need the server-config.wsdd file in your WEB-INF directly. (Or alternately you can deploy the service using as specified in the manual, but I just copied over my wsdd file).
RE: Is there a way to get the auto-generated WSDL document at compile time?
Just checking to see if anyone had an answer for this question ... JDG From: Jay Glanville [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 11:15 AM To: [EMAIL PROTECTED] Subject: Is there a way to get the auto-generated WSDL document at compile time? Hello all. We have a web application that is configured through the server-config.wsdd file. The resulting WSDL file is auto-generated for us by Axis (i.e.: http://localhost/app_ctx/services/webservice?wsdl). So far, everything is working out rather well for us. What we would like to do next is have the WSDL document generated at compile time, not run time. In other words, we currently have to start our service in order to get a WSDL file, but we'd like to simply get it generated for us without having to run it. I've investigated using Java2WSDL, but I'm under the understanding that it doesn't take the WSDD into consideration. It's in the WSDD that we have all of our bean mapping entries, and thus our WSDL depends on our WSDD's contents. Is there a way to get Axis to perform the auto-generate WSDL at compile time? Thanks JDG --- Jay Glanville
Re: Custom Deserializer/typeMapping problem
Mike, if you want to use your own serializer/deserializer try to adapt this tutorial : http://www-106.ibm.com/developerworks/webservices/library/ws-castor/ They do a data binding with castor. So they need to integrate in their WSDD and the generate stubs Castor serializer/deserializer. Look at what they do. Sebastien On Fri, 18 Feb 2005 09:30:30 +0900, Bill Keese [EMAIL PROTECTED] wrote: Since you are in wrapped/literal mode shouldn't the encoding style be ? Or you could try using beanMapping rather than typeMapping. Also, the msgT tag looks strange. It seems unnecessary but if you do add then I think you need a deserializer for that structure too. Mike Cassisa wrote: I am having a problem getting my Deserializer to be used after registering it's Factory with the typeMapping element in the dd. I have tried many different combinations but regardless of what I do the SimpleDeserializer is selected. I believe this is happening because axis is interpreting the entire message as a String instead of my desired type. I am somewhat new to axis so any help from those of you who really understand the framework would be much appreciated. There have been several similar threads on this with this one being the closest to my problem, however the solution needs to be on the server not the client: List: axis-user Subject:(resolved) RE: deserializing nested complex types From: Mitch Gitman mgitman () usa ! net Date: 2002-12-06 21:36:19 From my dd: typeMapping qname=baldue:BalanceDueMsg xmlns:baldue=http://balancedue.websvc.csp.leapwireless.com; languageSpecificType=java:com.leapwireless.csp.websvc.balancedue.BalanceDueMsgType serializer=com.leapwireless.csp.websvc.balancedue.axis.BalanceDueSerializerFactory deserializer=com.leapwireless.csp.websvc.balancedue.axis.BalanceDueDeserializerFactory encodingStyle=http://schemas.xmlsoap.org/soap/encoding// My web service class' relevant method signature (this is a java rpc service): public BalanceDueMsgType getBalanceDue(BalanceDueMsgType msgT) I am using JDK 1.4.2, JBoss 3.2.5/JBoss.Net/Axis 1.1 Basically my DeserializerFactory/Deserializer never gets a chance to deal with the incoming request message (java rpc web service). The SimpleDeserializer always gets these and returns a this error when dealing with the nested type in the message: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. I set a breakpoint in the Eclipse debugger in the SimpleDeserializer onChildElement method (which throws the exception) and this is what the variables look like in that method: this= SimpleDeserializer (id=212) activeDeserializers= HashSet (id=229) attributeMap= null cacheStringDSer= null cacheXMLType= null componentsReadyFlag= false constructor= Constructor (id=236) defaultType= null id= null isEnded= false isHref= false isNil= false javaType= Class (java.lang.String) (id=200)//Based on other problems like this one I believe the problem is here, i.e. axis thinks this is a string type. myElement= null myElements= null myIndex= 0 propertyMap= null targets= Vector (id=241) typeDesc= null val= CharArrayWriter (id=246) value= null xmlType= QName (id=249) localPart= string namespaceURI= http://www.w3.org/2001/XMLSchema; namespace= http://balancedue.websvc.csp.leapwireless.com; localName= BalanceDueMsg prefix= attributes= NullAttributes (id=205) context= DeserializationContextImpl (id=213) Most interesting here are the values of the namespace and localName local variables (which are the ones I want) and the value of the SimpleDeserializer.javaType field which is set to a String when it should be BalanceDueMsgType. Based on the debugger variables above, the value of the curElement field inside of the context variable has this data (which is what was intended): BalanceDueMsg xmlns=http://balancedue.websvc.csp.leapwireless.com; accountNumACCOUNTNUMBER/accountNum sessionIdSTRING/sessionId balanceData/ /BalanceDueMsg The client I am using is a little gizmo in Oxygen XML that prepares the raw xml so you can edit it manually and then sends it so I am not using any wsdl2java
Re: Is there a way to get the auto-generated WSDL document at compile time?
@Jay Do you try to perform all the needed process. I am talking about using first Java2WSDL and after WSDL2Java. Maybe if you use the right options in the first step (Java2WSDL) the generated WSDD shall be the same that you already created ? I strongly think the more difficult in the Axis Ant Task it's to put the right options. -- Sebastien On Thu, 17 Feb 2005 20:20:19 -0500, Jay Glanville [EMAIL PROTECTED] wrote: Just checking to see if anyone had an answer for this question ... JDG From: Jay Glanville [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 11:15 AM To: [EMAIL PROTECTED] Subject: Is there a way to get the auto-generated WSDL document at compile time? Hello all. We have a web application that is configured through the server-config.wsdd file. The resulting WSDL file is auto-generated for us by Axis (i.e.: http://localhost/app_ctx/services/webservice?wsdl). So far, everything is working out rather well for us. What we would like to do next is have the WSDL document generated at compile time, not run time. In other words, we currently have to start our service in order to get a WSDL file, but we'd like to simply get it generated for us without having to run it. I've investigated using Java2WSDL, but I'm under the understanding that it doesn't take the WSDD into consideration. It's in the WSDD that we have all of our bean mapping entries, and thus our WSDL depends on our WSDD's contents. Is there a way to get Axis to perform the auto-generate WSDL at compile time? Thanks JDG --- Jay Glanville
Re: forcing registration of serializer/deserializer for beans that do not appear directly as args
@Tim If you follow what i said in a first email on how to properly map an array bean (Bean[]) in the Bean. The explicit type mapping in the WSDD doesn't appear the next time. I am using Axis web service with that options : provider=java:RPC style=wrapped use=literal Sebastien On Thu, 17 Feb 2005 13:45:31 -0800, Tim K. (Gmane) [EMAIL PROTECTED] wrote: OK, it worked without doing anything special for the array. The extra classes are included in the wsdd and it works, but if a Bean[] appears explicitly as an argument of a method there's also an explictit type mapping in the wsdd for the Bean[], but not when using --extraClasses. It works, but I am curios why the difference. Thanks for your tip. Tim Sebastien Mayemba Mbokoso wrote: I think u don't need to include anything special for your arrays. Generate all your stubs with the task WSDL2Java and look at in the deploy.wsdd if the extra classes are mapped. - Sebastien On Wed, 16 Feb 2005 12:12:53 -0800, Tim K. (Gmane) [EMAIL PROTECTED] wrote: Yes, I do. Ah, I missed the --extraClasses option ... Do I need to also include anything special for the arrays to work (e.g.a B[] in addition to B)? Thanks. Tim Sebastien Mayemba Mbokoso wrote: Do you know all the object types of 'Object o' at run-time ? If you do maybe you can use Java2WSDL with that more option : --extraClasses ? --- Sebastien On Wed, 16 Feb 2005 11:20:24 -0800, Tim K. (Gmane) [EMAIL PROTECTED] wrote: Hello, Using java2wsdl to generate the WSDL from java server side classes, how can I force the registration of a serializer/deserializer for a bean that does not appear directly in the method arguments, e.g.: public A foo(A a) where A is a bean which can contain another bean B and also a bean array B[] but it's not typed (e.g. it's defined as an Object): A { ... Object o; // At run-time this can be B, B[] or other things. ... } The problem is that at run-time the server complains that there is no deserializer for B which makes sense because java2wsdl has never seen B anywhere in the method signatures. The work-around so far has been to add a dummy method that has both B and B[] as arguments, but there's gotta be a nicer way to do it. Thank you for your help. -- Tim