RE: Unexpected subelement while parsing nilled response
Ah, thank you for that observation. I am a little confused as to how it happened that way, because this wsdl and the service itself were both created using axis2's java2wsdl utility. I will play around with switches to see if I can get the responses to match the namespaces. -Phil According the wsdl the namespace of the erroMessage element is http://webservices.basic.wrapper.authentisec.fod.com/xsd. but at the response it is http://webservices.basic.wrapper.authentisec.fod.com http://webservices.basic.wrapper.authentisec.fod.com/ thanks, Amila.
Unexpected subelement while parsing nilled response
I have used axis2 to build client stubs using: wsdl2java -s -u -uw -or -uri wsdl-jimbo.wsdl and when I hit the server I got a response which looked fine, but my client rejects it with the error: org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement errorMessage I have no idea why - it looks like it should be completely happy with this kind of element here. Any help would be greatly appreciated. Thanks, Phil -SOAP response, then WSDL file-- soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; soapenv:Body ns:loginResponse xmlns:ns=http://webservices.basic.wrapper.authentisec.fod.com; ns:return type=com.fod.authentisec.wrapper.basic.webservices.WsResponse ns:errorMessage xsi:nil=true xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance/ ns:sessionId186311778900720554061472776531421868378/ns:sessionId ns:statusSUCCESS/ns:status ns:tins xsi:nil=true xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance/ ns:tokenDetail xsi:nil=true xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance/ ns:wsTokenDataResponse xsi:nil=true xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance/ /ns:return /ns:loginResponse /soapenv:Body /soapenv:Envelope - wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:thisNs=http://webservices.basic.wrapper.authentisec.fod.com; xmlns:wsaw=http://www.w3.org/2006/05/addressing/wsdl; xmlns:http=http://schemas.xmlsoap.org/wsdl/http/; xmlns:xsdNs=http://webservices.basic.wrapper.authentisec.fod.com/xsd; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/; xmlns:soap12=http://schemas.xmlsoap.org/wsdl/soap12/; targetNamespace=http://webservices.basic.wrapper.authentisec.fod.com; wsdl:documentation Please Type your service description here /wsdl:documentation wsdl:types xs:schema xmlns:ax21=http://webservices.basic.wrapper.authentisec.fod.com/xsd; attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http://webservices.basic.wrapper.authentisec.fod.com/xs d xs:complexType name=WsResponse xs:sequence xs:element minOccurs=0 maxOccurs=1 name=errorMessage type=xs:string/ xs:element minOccurs=0 name=sessionId nillable=true type=xs:string/ xs:element minOccurs=1 name=status type=xs:string/ xs:element maxOccurs=unbounded minOccurs=0 name=tins nillable=true type=xs:string/ xs:element minOccurs=0 name=tokenDetail nillable=true type=ax21:WsTokenDetails/ xs:element maxOccurs=unbounded minOccurs=0 name=wsTokenDataResponse nillable=true type=ax21:WsTokenData/ /xs:sequence /xs:complexType xs:complexType name=WsTokenDetails xs:sequence xs:element minOccurs=0 name=additionalPayload nillable=true type=xs:string/ xs:element minOccurs=0 name=embeddedPayload nillable=true type=xs:string/ xs:element minOccurs=0 name=endDate nillable=true type=xs:dateTime/ xs:element minOccurs=0 name=exported nillable=true type=xs:boolean/ xs:element minOccurs=0 name=pin nillable=true type=xs:string/ xs:element minOccurs=0 name=pinSecured nillable=true type=xs:boolean/ xs:element minOccurs=0 name=redemptionCount nillable=true type=xs:long/ xs:element minOccurs=0 name=redemptionLimit nillable=true type=xs:long/ xs:element minOccurs=0 name=startDate nillable=true type=xs:dateTime/ xs:element minOccurs=0 name=suspended nillable=true type=xs:boolean/ xs:element minOccurs=0 name=tin nillable=true type=xs:string/ xs:element minOccurs=0 name=tokenStatusName nillable=true type=xs:string/ xs:element minOccurs=0 name=tokenTypeName nillable=true type=xs:string/ /xs:sequence /xs:complexType xs:complexType name=WsTokenData xs:sequence xs:element minOccurs=0 name=errorMessage nillable=true type=xs:string/ xs:element minOccurs=0 name=status nillable=true type=xs:string/ xs:element minOccurs=0 name=tin nillable=true type=xs:string/ xs:element minOccurs=0 name=tokenData nillable=true type=xs:string/ /xs:sequence /xs:complexType xs:complexType name=WsKeyStringPair xs:sequence
passing name-value pairs
Hello people, I want to make a service which makes partial updates to a record. If I simply expose the record it's great, but I can't see which fields the user chose to update and which they want left alone. So I looked at using name-value pairs. On the server side it's great - I know the types of the data I'm getting because I can get that from the given field name, but it seems that when I declare the value as a (Java) Object, axis makes it an OMElement, which I guess means it's up to the client end to build the element manually. Fair enough I guess, but not very useful. I could pass in a bitmap of which fields I have updated, corresponding to the fields in the class, but that's quite clumsy. So I could happily use a simple class _if_ I could determine at the server which fields have been set by the client. Or I could happily use an array of name-value pairs _if_ there was a more elegant way of passing an object (which happens to take 1 of only 3 different types). Anyone solved a similar problem? Thanks, Phil
RE: Rampart engaged, OutflowSecurity set in axis2.xml, still no security in headers
Hi Prabath, thanks again. I have configured the axis used by this wizard to be axis2, and to revision 1.3. Your comment about axis server axis2.xml files - yes, I have been using the server config file, although changing to use the client config file hasn't helped. What has helped though, is not only including the configuration context line you suggested, but also *using* it in the stub constructor :) Doh! Thanks again for your excellent help. Phil --- Phil Davies wrote: The client architecture was mainly decided by Eclipse's Web Services Client wizard. I guess this generates stubs with Axis - not Axis2, please verify the versions of the referenced libraries. ... program? Think in this way - there is one Axis2.xml used by the service, that is what you find by default inside - [AXIS2_HOME]/conf. Also - when you are using a client, you can specify an Axis2.xml for the client as well - in the way I mentioned previously. If you can go through sample available with [1] - it explains all what you need to know from both the service and the client side. Thanks regards. - Prabath [1]:http://blog.facilelogin.com/2008/07/web-services-security-encryption -with.html Thanks, Phil Hi Phil; From your previous comments I guess, you have not engaged rampart module at the client side - only at the service end. Make sure at the client side you load the axis2.xml with Rampart being engaged. ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(re po,repo/conf/axis2.xml Also, please make sure that you have the rampart module inside repo/modules. Thanks regards. - Prabath - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Rampart engaged, OutflowSecurity set in axis2.xml, still no security in headers
Hi, I've scoured the web for this particular problem, but no answer yet. I'm trying to build a WS client. I am using axis2-1.3, and I can successfully query the web services without security. When I add security, I still don't get any SOAP header, only the same outgoing request. I am adding security by (a) making sure the Rampart module (1.3) is globally engaged, and (b) adding the module and OutflowSecurity elements to the axis2.xml file (see below). I'm fairly sure the axis2.xml file is getting used, because if I break the xml in (say) the OutflowSecurity element and restart Tomcat, I get a complaint from the servlet. Apart from that there's no sign that the OutflowSecurity element is being processed at all. Are there other factors which need to be present before rampart will add security to the message headers? Any help appreciated. Thanks Phil Davies Added to axis2.xml: module ref=rampart/ parameter name=OutflowSecurity action itemsUsernameToken Timestamp/items userwsuser/user passwordCallbackClasscom.PasswordGetter/passwordCallbackClass /action /parameter
RE: Rampart engaged, OutflowSecurity set in axis2.xml, still no security in headers
Thanks for the info - I have already found and read this page, and again it looks initially like what I'm doing should work. Can you tell me - do I *need* a policy somewhere? Thanks, Phil --- Hi Phil; Hope this[1] may be helpful. Thanks regards. - Prabath [1]:http://blog.facilelogin.com/2008/07/web-services-security-encryption -with.html Phil Davies wrote: Hi, I've scoured the web for this particular problem, but no answer yet. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Rampart engaged, OutflowSecurity set in axis2.xml, still no security in headers
Thanks Prabath, for such a quick reply. Yes, this is all client work. Ok, I wasn't expecting to have to write any Java to get security added, but anyway I added your line and when I finally gave it the right file paths it behaved as before - i.e. no headers. I ran the ant script which sets up the modules for axis, and can see that rampart is globally engaged by using the axis2 admin page. The client architecture was mainly decided by Eclipse's Web Services Client wizard. It put the stub into an existing web project, and axis2 is on the classpath. The project's WEB-INF/conf dir has an axis2.xml file, and so does AXIS2_HOME/conf. I have added the module and parameter elements to both of these now. I then wrote a little test program which invokes one of the operations and when I do this I get an axis fault returned, after the round trip to the server. Wireshark also shows me an outgoing request with no security header. I have also used the Web Services Explorer in Eclipse with the same result. Here's something I find a little confusing - after running the wizard to generate the client, the Eclipse local Tomcat on that machine has the WebServicesTestClient (described above) deployed. If I then point a browser at this, I can log in to the axis admin pages, and I can see that rampart is globally engaged - but how can I know that *this* axis is the same axis the client stub sees when it's called from my test program? Thanks, Phil Hi Phil; From your previous comments I guess, you have not engaged rampart module at the client side - only at the service end. Make sure at the client side you load the axis2.xml with Rampart being engaged. ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(re po,repo/conf/axis2.xml Also, please make sure that you have the rampart module inside repo/modules. Thanks regards. - Prabath - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]