Firstly, not sure if this is the right place to past this, forum admin please move if not right.
Before I ask the question I will give some background to what I am trying to achieve.
I have been tasked with testing the performance of a client server application that appears to use the spring framework. To do this I am planing to use the Grinder (Jython).
I have used The Grinder's TCP Proxy to record the traffic between the client and server, the first of many http post's looks like this:
So it appears that I have a Java serialised object, created using org.springframework.security.context.rmi.ContextPr opagatingRemoteInvocation.Code:response = myRequest.POST('remoting/SchedulerService', u'\xAC\xED\x00\x05sr' u'\x00Korg.springframework.security.context.rmi.ContextPropagatingRemoteInvocation\x1F\x1F\xB4\xC7\x0A\xDE\xDF>\x02\x00\x01L\x00\x0FsecurityContextt' u'\x006Lorg/springframework/security/context/SecurityContext;xr' u'\x005org.springframework.remoting.support.RemoteInvocation_l\x8B\x9F\xF6\x0A\x11\x0A\x02\x00\x04[\x00\x09argumentst' u'\x00\x13[Ljava/lang/Object;L\x00\x0Aattributest' u'\x00\x0FLjava/util/Map;L\x00\x0AmethodNamet' u'\x00\x12Ljava/lang/String;[\x00\x0EparameterTypest' u'\x00\x12[Ljava/lang/Class;xpur' u'\x00\x13[Ljava.lang.Object;\x90\xCEX\x9F\x10s)l\x02\x00\x00xp\x00\x00\x00\x00pt' u'\x00\x0FgetWorkTypeListur' u'\x00\x12[Ljava.lang.Class;\xAB\x16\xD7\xAE\xCB\xCDZ\x99\x02\x00\x00xp\x00\x00\x00\x00sr' u'\x008org.springframework.security.context.SecurityContextImpl\xBC\x09q\xA7\x90/\x92t\x02\x00\x01L\x00\x0Eauthenticationt' u'\x00-Lorg/springframework/security/Authentication;xpp', ( NVPair('Content-Type', 'application/x-java-serialized-object'), ))
I have succeeded in de serialising the response, and am happy with that, but now I'm trying to understand how to create the request that simulates this. I have googled evrey think I can find around ContextPropagatingRemoteInvocation and RemoteInvocation, but can't seem to create an object that I can serialise to send to the the server.
Here is my best attempt (I'm not sure if I am progressing in the right direction):
But this produces an error:Code:from org.springframework.security.context.rmi import ContextPropagatingRemoteInvocationFactory from org.springframework.security.context.rmi import ContextPropagatingRemoteInvocation factory = ContextPropagatingRemoteInvocationFactory() factory.addAttribute('methodName', 'getWorkTypeList') Attributes = factory.getAttributes() print 'repr(Attributes)' print repr(Attributes)
If someone can guide me on the right track to reproduce the above serialised object I should be right for the rest of the application. Am I even on the right track trying to use spring to try and create this http post?Code:Aborted run due to Jython exception: <type 'exceptions.AttributeError'>: 'org.springframework.security.context.rmi.ContextPr' object has no attribute 'addAttribute' [calling TestRunner] <type 'exceptions.AttributeError'>: 'org.springframework.security.context.rmi.ContextPr' object has no attribute 'addAttribute' factory.addAttribute('methodName', 'getWorkTypeList')
Thanks,
Dave.


Reply With Quote
