Re: sign/encrypt a portion of soap message !
Your package should work according to the processing model defined in the OASIS WS-Security 2004 standard. wss4j (http://ws.apache.org/ws-fx/wss4j/) implements WS-Security (and supports wsu:Id). Anne On 4/15/05, Pham Hoai Van [EMAIL PROTECTED] wrote: Hi all, I wanna write a package that help developer sign/encrypt soap message. Developer can specify which portion of soap msg will be signed/encrypted then my package will sign/encrypt that portion. I think of using Xpath and wsu:Id but xpath is a bit complicated and it seems axis doesn't support wsu:Id. Any suggestion of storing which information will be signed/encrypted ? Thanks Hoai Van
Re: supporting both rpc/encoded and wrapped doc/lit
Hello Tim, In Axis 1.2 each Service is bound to a ServiceDesc with Use and Style fields. So they can't support both rpc/enc and wrapped/lit. I think you could use some tricks by patching the source and dynamically attribute providers to process the request message but you will have a problem when you want to show both wsdl at the same time.
problem deploying (maybe)
I enter the following command ...java org.apache.axis.client.AdminClient deploy.wsddI get AdminDone processing/Admin but when I check the axis classes directory , my class is not there (but there isan entry in server-config.wsdd )... am Ito manually transfer the classes over ?
RE: Bug in Deserializer code?! onStartChild(..)
Once I switched from wrapped style to rpc/encoded my service started working. I guess I was registering my typeMappings on the client side with the wrong encoding style http://schemas.xmlsoap.org/soap/encoding/ Do I need to use a different URL when registering type mappings with the wrapped style? From: Oleg Lebedev [mailto:[EMAIL PROTECTED] Sent: Sat 4/16/2005 1:01 PM To: axis-user@ws.apache.org Subject: Bug in Deserializer code?! onStartChild(..) I've been getting a lot of deserializer errors on the client side from Axis 1.2 RC3. The client make a findSchoolByName(String) call and the server finds the school and sends it back to the client. The error occurs on the client side when trying to deserialize the message. The message from the server and the error stack trace are shown at the end of this message. I started debugging the code and found out that in RPCHandler.onStartChild(..) method the following piece of code: // If that didn't work, try position // FIXME : Do we need to be in EITHER named OR positional // mode? I.e. will it screw us up to find something // by position if we've already looked something up // by name? I think so... if (paramDesc == null) { if (isResponse) { paramDesc = operation.getReturnParamDesc(); } else { paramDesc = operation.getParameter(rpcElem.getParams().size() - 1); } } finds paramDesc, with the following field values: javaType = null name.localPart = findSchoolByNameResponsefindSchoolByNameReturn This doesn't look right to me because of the first sign. Since javaType is null the following sets destClass to null. destClass = paramDesc.getJavaType(); Later in the code, dser is set to null by the following: dser = context.getDeserializer(destClass, type); This causes the error message below to be thrown. Is this a bug? Has it been fixed? Is there a work around? Any help would be greatly appreciated! Here is how I registered the School type in WSDD which is returned by findSchoolByNameResponse: beanMapping qname=ns:School xmlns:ns=urn:dss.sww.com languageSpecificType=java:com.sww.dss.domain.model.hibernate.School/ Here is the XML response from the server: ?xml version=1.0 encoding=UTF-8? soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; soapenv:Body findSchoolByNameResponse xmlns=urn:dss.sww.com findSchoolByNameReturn nameShkola/name /findSchoolByNameReturn /findSchoolByNameResponse /soapenv:Body /soapenv:Envelope Here is the error stack trace: org.xml.sax.SAXException: Deserializing parameter 'findSchoolByNameReturn': could not find deserializer for type {urn:dss.sww.com}School AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXException: Deserializing parameter 'findSchoolByNameReturn': could not find deserializer for type {urn:dss.sww.com}School faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Deserializing parameter 'findSchoolByNameReturn': could not find deserializer for type {urn:dss.sww.com}School at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:270) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1140) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:238) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:386) at org.apache.axis.client.Call.invoke(Call.java:2437) at org.apache.axis.client.Call.invoke(Call.java:2336) at org.apache.axis.client.Call.invoke(Call.java:1793) -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. If you have questions about this email, please contact the IT Help Desk. Mail
service scope
I have a Service called Property ... what I am trying to do is to populate this service object's instance variables and then retreive those instance variables with get methods . I gave the service session scope ... The following code is not giving me correct output . I always retreive null instance variables ... Is what I am trying to achieve possible and can the following code do it ? If so , then the problem is elsewhere ... the populate method is using database code to access mysql ... String endpointURL = "http://localhost:8080/axis/services/Property"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpointURL) ); call.setOperationName("setPropertyID"); Integer integer = new Integer(1); call.invoke(new Object[] {integer}); call.setOperationName("populate"); call.invoke(new Object[] {}); call.setOperationName("getPropertyID"); call.setReturnType( org.apache.axis.encoding.XMLType.XSD_INT ); Integer outPut1 = (Integer) call.invoke(new Object[] {}); out.println("Property ID: " + outPut1.toString()); call.setOperationName("getAddress"); call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING ); out.println("Address: " + (String) call.invoke(new Object[] {}));
Re: supporting both rpc/encoded and wrapped doc/lit
OK, but if I want to deploy the same service twice once rpc/enc, once wrapped/lit, all I have to do is use different service names in the deploy.wsdd/server-config.wsdd, right? Something like MyService_rpc and MyService_wrapped, but the implementation java class can be the same as long as the proper use and style options are set for each service ... Thanks. Tim Yves Erb wrote: Hello Tim, In Axis 1.2 each Service is bound to a ServiceDesc with Use and Style fields. So they can't support both rpc/enc and wrapped/lit. I think you could use some tricks by patching the source and dynamically attribute providers to process the request message but you will have a problem when you want to show both wsdl at the same time.
Re: supporting both rpc/encoded and wrapped doc/lit
Yes, it should work.
Re: service scope
Let me rephrase my question is it possible to have the following service class MyService so that I can first set the private instance variable ( with setVar)and then immediately after on the next call ( with getVar) retrieve it ? So far , I haven't been able to get it to work ... public class MyService { private String var; public void setVar(String var) { this.var = var; } public String getVar() { return var; } } - Original Message - From: aleks To: axis-user@ws.apache.org Sent: Saturday, April 16, 2005 2:24 PM Subject: service scope I have a Service called Property ... what I am trying to do is to populate this service object's instance variables and then retreive those instance variables with get methods . I gave the service session scope ... The following code is not giving me correct output . I always retreive null instance variables ... Is what I am trying to achieve possible and can the following code do it ? If so , then the problem is elsewhere ... the populate method is using database code to access mysql ... String endpointURL = "http://localhost:8080/axis/services/Property"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpointURL) ); call.setOperationName("setPropertyID"); Integer integer = new Integer(1); call.invoke(new Object[] {integer}); call.setOperationName("populate"); call.invoke(new Object[] {}); call.setOperationName("getPropertyID"); call.setReturnType( org.apache.axis.encoding.XMLType.XSD_INT ); Integer outPut1 = (Integer) call.invoke(new Object[] {}); out.println("Property ID: " + outPut1.toString()); call.setOperationName("getAddress"); call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING ); out.println("Address: " + (String) call.invoke(new Object[] {}));
Re: sign/encrypt a portion of soap message !
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Anne Thomas Manes wrote: Your package should work according to the processing model defined in the OASIS WS-Security 2004 standard. wss4j (http://ws.apache.org/ws-fx/wss4j/) implements WS-Security (and supports wsu:Id). Looking at the website, it appears that wss4j may not be ready for production use, which can be a problem for webservices that need encryption, but are in production. - -- Corruptisima republica plurimae leges. [The more corrupt a republic, the more laws.] Tacitus from Annals III, 116AD Blogs: http://jamesruminations.blogspot.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.0 (MingW32) iD8DBQFCYci4J/zyYkX46joRAvl2AJ9XXr/CVYGOcAp6baXbZMrYExuklgCfcYJJ 3vOc8dUvIyw0JhjPG6XxzSg= =wiOB -END PGP SIGNATURE-