Coder Social home page Coder Social logo

leonardopuleggi / gwt-har-parser Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 110 KB

Small Java app that read HAR files with GWT RPC request and attemps to serialize/deserialize the requests/responses

Java 100.00%
gwt java java-8 serialization deserialization http http-archive-format

gwt-har-parser's Introduction

Small Java app that reads HAR files with GWT RPC requests and attemps to serialize/deserialize the requests/responses.

I had developed this small tool long back to help a couple of devs to check what was happening in our GWT RPC services. GWT is not the latest framework available but I thought I'd share this for other that still need to support GWT applications. It's pretty easy nowadays to obtain an HAR from the client's browser but it might be hard to understand the result, especially for some complex objects contained in the respose.

This tool tries to help you make sense of the request/responses by serializing/deserializing. With the toString() (if you have implemented it) or with Java Reflection in case you haven't implemented your own toString()

Building

mvn clean install

Test with sample file included in the JAR files

java -jar target\GWT-HAR-Parser-1.0-SNAPSHOT-jar-with-dependencies.jar

Result with sample file

-------------------REQUEST 1---Success--------------------

7|0|7|http://127.0.0.1:8083/helloGWT/hellogwt/|5AD3EA1825E71AD70B90AA5DE4AD4A12|com.example.client.GreetingService|greetResult|com.example.shared.HelloResult/3278810364|java.lang.Integer/3438268394|GWT User|1|2|3|4|1|5|5|6|1|7|


toString() =>
com.example.client.GreetingService.greetResult(com.example.shared.HelloResult@32709393)

via reflection =>
com.google.gwt.user.server.rpc.RPCRequest@1f554b06[flags=0,method=public abstract com.example.shared.HelloResult com.example.client.GreetingService.greetResult(com.example.shared.HelloResult),parameters={com.example.shared.HelloResult@32709393},rpcToken=<null>,serializationPolicy=null]


-------------------RESPONSE 1---Success--------------------

//OK[3,1,2,1,["com.example.shared.HelloResult/3278810364","java.lang.Integer/3438268394","GWT User"],0,7]


toString() =>
com.example.shared.HelloResult@6acdbdf5

via reflection =>
com.example.shared.HelloResult@6acdbdf5[a=1,b=GWT User]

Run with your JARs and your HTTP Archive format

java -jar target\GWT-HAR-Parser-1.0-SNAPSHOT-jar-with-dependencies.jar C:\temp\libs C:\temp\localhost.har

Important: you need to pass the JARs that will be used during the serialization/deserialization of your GWT RPC service

This normally means what you have to pass a directory with the JAR files with the client and shared folder of your GWT project.

If you are using library to use directly the GWT POJOs from Hibernate POJOs (for example Gilead - https://github.com/emsouza/gilead), please pass also these library JARs.

Ideally you can pass all the UI JARs (client and shared and server that you use)

In case of any problem please contact us

gwt-har-parser's People

Stargazers

 avatar

Watchers

 avatar

gwt-har-parser's Issues

How do I serialize the request that was deserialized by this tool

It's a cool tool to parse the gwt requests and responses. But I have a question, could I serialize the request that was deserialized by this tool?

For example:

Parsed/ deserialized result from the above request using this tool:
toString() =>
com.polarion.alm.ui.client.tracker.WorkItemDataService.loadInstances([subterra:data-service:objects:/default/perf1${WorkItem}PERF1-1511, subterra:data-service:objects:/default/perf1${WorkItem}PERF1-1510, subterra:data-service:objects:/default/perf1${WorkItem}PERF1-1509], [id, title, priority, severity, status, resolution, author, assignee, timePoint, remainingEstimate, created, updated, type, project, _document, _space], true, ProjectScope perf1)

via reflection =>
com.google.gwt.user.server.rpc.RPCRequest@365c30cc[flags=0,method=public abstract java.util.ArrayList com.polarion.alm.ui.client.tracker.WorkItemDataService.loadInstances(java.util.ArrayList,java.util.ArrayList,boolean,com.polarion.portal.shared.navigation.IScope),parameters={[subterra:data-service:objects:/default/perf1${WorkItem}PERF1-1511, subterra:data-service:objects:/default/perf1${WorkItem}PERF1-1510, subterra:data-service:objects:/default/perf1${WorkItem}PERF1-1509],[id, title, priority, severity, status, resolution, author, assignee, timePoint, remainingEstimate, created, updated, type, project, _document, _space],true,ProjectScope perf1},rpcToken=,serializationPolicy=null]

Then, how can I get the request before serialization from the above parsed/deserialized result? Since I need modify some parameters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.