Can we re-generate java.frag from .class file in webMethods 7.1.2 or 8.2 - CLOSED

Dear Experts,

I have been trying this from a long time but could not get to the end of it. Can someone throw some light on it :idea:

Can we re-generate java.frag from .class file in webMethods v7.1.2 and up?

In brief:

Step 1: I create a java service on webMethods developer/designer and then go to the file system (IS directory) and delete the corresponding java.frag file under …\ns\ (name space directory) and I delete the .java file under …\code\source\

Step 2: Using the .class file under …\code\classes\ directory can I regenerate the java.frag file again which was deleted in step 1.

Kindly note that I am not interested in de-compiling the .class file in order to generate the .java file by using Java Decompiler.

Leaving the above option is there any other option to get the java.frag file back in the file system.

When I look at the java.frag file - Basically it is an xml file which looks like

<?xml version="1.0" encoding="UTF-8"?> java service name true Encrypted stuff for eg.: [b]CUlEYXRhQ3Vyc29yIGNyID0gcGlwZWxpbmUuZ2V0Q3Vyc29yKCk7CglTdHJpbmcJdXNlck5hbWUg PSBJRGF0YVV0aWwuZ2V0U3RyaW5nKCBjciwgInVzZXJOYW1lIiApOyAKICAgICAgICBJRGF0YSBh bGxMb2NrcyA9IE5TTG9ja01hbmFnZXIuZ2V0QWxsTG9ja0RldGFpbHMoKTsKICAgICAgICBJRGF0 YUN1cnNvciBsb2NrQ3IgPSBhbGxMb2Nrcy5nZXRDdXJzb3IoKTsKICAgICAgICBJbnZva2VTdGF0 ZSBzdGF0ZSA9IEludm9rZVN0YXRlLmdldEN1cnJlbnRTdGF0ZSgpOwogICAgICAgIEludm9rZVN0 YXRlIF90bXAgPSBzdGF0ZTsKICAgICAgICBWZWN[/b]0

I see webMethods is doing something internally to generate the java.frag file.

And I know that java.frag file lets you see the source code on developer/designer.

Feel free if you need more information about the subject.

com.wm.util.Base64.decode(Encrypted_Stuff )

Hi Xiaowei,


Can you provide me more information please.

The full java signature is public static String decode(String), this method will return the java source if you pass the encrypted stuff as input.

I guess you have misunderstood the question? Can we re-generate java.frag from .class file in webMethods 7.1.2 or 8.2?

Please suggest or advice.

Please look at the step 1 and step 2 in my initial post :slight_smile:

Sorry, I totally misunderstand what you mean.
It’s impossible get the same java.frag back as the original one from .class.
webMethods encodes the java service source code in Base64, then save it in java.frag, so it can decodes it back and put into developer editor. Once you lost the *.java or java.frag you can’t get the same source code as begin.
But if you have the source code, you can use Base64.encode to generate the encrypted stuff in java.frag.

Hmm… so its not at all possible to get the java.frag file from .class file having said (that .java file is not available). :frowning:

The only option is to de-compile the .class file and then generate .java file which will in turn generate java.frag file for the corresponding .java file.

I’m afraid so