Skip to content

Commit a386448

Browse files
committed
Menu cleanup and sample data fix
-Fix some sample data returing incorrectly -Change right click menu option to appear on requests only
1 parent 589cf39 commit a386448

File tree

6 files changed

+11
-26
lines changed

6 files changed

+11
-26
lines changed

src/main/java/burp/BurpExtender.java

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
public class BurpExtender implements IBurpExtender
44
{
55

6-
@Override
76
public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks)
87
{
98

src/main/java/burp/Menu.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public List<JMenuItem> createMenuItems(
2626
final IContextMenuInvocation invocation) {
2727
List<JMenuItem> list;
2828
list = new ArrayList<JMenuItem>();
29+
30+
if (invocation.getInvocationContext() != IContextMenuInvocation.CONTEXT_MESSAGE_EDITOR_REQUEST && invocation.getInvocationContext() != IContextMenuInvocation.CONTEXT_MESSAGE_VIEWER_REQUEST){
31+
return list;
32+
}
2933
JMenuItem item = new JMenuItem("Parse WSDL");
3034

3135
item.addMouseListener(new MouseListener() {
@@ -36,16 +40,17 @@ public void mouseClicked(MouseEvent e) {
3640

3741

3842
public void mousePressed(MouseEvent e) {
43+
44+
}
45+
46+
47+
public void mouseReleased(MouseEvent e) {
3948
WSDLParser parser = new WSDLParser(helpers, tab);
4049
try {
4150
new Worker(parser,invocation, tab, callbacks).execute();
4251
} catch (Exception e1) {
4352
e1.printStackTrace();
4453
}
45-
}
46-
47-
48-
public void mouseReleased(MouseEvent e) {
4954

5055
}
5156

@@ -69,14 +74,14 @@ public void mouseExited(MouseEvent e) {
6974
class Worker extends SwingWorker<Void,Void> {
7075

7176
private JDialog dialog = new JDialog();
72-
private JProgressBar progressBar = new JProgressBar();
7377
private WSDLParser parser;
7478
private IContextMenuInvocation invocation;
7579
private WSDLParserTab tab;
7680
private IBurpExtenderCallbacks callbacks;
7781
private int status;
7882

7983
public Worker(WSDLParser parser, IContextMenuInvocation invocation, WSDLParserTab tab, IBurpExtenderCallbacks callbacks) {
84+
JProgressBar progressBar = new JProgressBar();
8085
progressBar.setString("Parsing WSDL");
8186
progressBar.setStringPainted(true);
8287
progressBar.setIndeterminate(true);
@@ -101,9 +106,7 @@ protected Void doInBackground() throws Exception {
101106
protected void done() {
102107
dialog.dispose();
103108
if (status == -1) {
104-
105109
JOptionPane.showMessageDialog(tab.getUiComponent().getParent(), "Error: Can't Read Response");
106-
107110
} else if(status == -2){
108111
JOptionPane.showMessageDialog(tab.getUiComponent().getParent(), "Error: Not a WSDL");
109112
} else if(status == -3){

src/main/java/burp/WSDLParser.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ public int parseWSDL(IHttpRequestResponse requestResponse, IBurpExtenderCallback
100100
xmlRequest = createRequest(requestResponse, builder, operation);
101101
} catch (Exception e) {
102102
success = false;
103-
104103
}
105104
if (success) {
106105
endpoints = builder.getServiceUrls();
@@ -132,7 +131,7 @@ private File createTempFile(String body) {
132131

133132
private byte[] createRequest(IHttpRequestResponse requestResponse, SoapBuilder builder, SoapOperation operation) {
134133
SoapContext context = SoapContext.builder()
135-
.alwaysBuildHeaders(true).exampleContent(false).typeComments(true).buildOptional(true).build();
134+
.alwaysBuildHeaders(true).exampleContent(true).typeComments(true).buildOptional(true).build();
136135
String message = builder.buildInputMessage(operation, context);
137136
String host = getHost(builder.getServiceUrls().get(0));
138137
String endpointURL = getEndPoint(builder.getServiceUrls().get(0), host);

src/main/java/burp/WSDLParserTab.java

-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ public WSDLTab createTab(String request) {
3131
return wsdltab;
3232
}
3333

34-
@Override
3534
public String getTabCaption() {
3635
return "Wsdler";
3736
}
3837

39-
@Override
4038
public Component getUiComponent() {
4139
return tabs;
4240
}

src/main/java/burp/WSDLTab.java

-10
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,14 @@ public void addEntry(WSDLEntry entry) {
4949
}
5050
}
5151

52-
@Override
5352
public int getRowCount() {
5453
return entries.size();
5554
}
5655

57-
@Override
5856
public int getColumnCount() {
5957
return 3;
6058
}
6159

62-
@Override
6360
public String getColumnName(int columnIndex) {
6461
switch (columnIndex) {
6562
case 0:
@@ -73,12 +70,10 @@ public String getColumnName(int columnIndex) {
7370
}
7471
}
7572

76-
@Override
7773
public Class getColumnClass(int columnIndex) {
7874
return getValueAt(0, columnIndex).getClass();
7975
}
8076

81-
@Override
8277
public Object getValueAt(int rowIndex, int columnIndex) {
8378

8479
WSDLEntry wsdlEntry = entries.get(rowIndex);
@@ -99,17 +94,14 @@ public boolean isCellEditable(int row, int col) {
9994
return col >= 2;
10095
}
10196

102-
@Override
10397
public byte[] getRequest() {
10498
return currentlyDisplayedItem.getRequest();
10599
}
106100

107-
@Override
108101
public byte[] getResponse() {
109102
return currentlyDisplayedItem.getResponse();
110103
}
111104

112-
@Override
113105
public IHttpService getHttpService() {
114106
return currentlyDisplayedItem.getHttpService();
115107
}
@@ -120,7 +112,6 @@ public WSDLTable(TableModel tableModel) {
120112
super(tableModel);
121113
}
122114

123-
@Override
124115
public void changeSelection(int row, int col, boolean toggle, boolean extend) {
125116

126117
WSDLEntry wsdlEntry = entries.get(super.convertRowIndexToModel(row));
@@ -131,7 +122,6 @@ public void changeSelection(int row, int col, boolean toggle, boolean extend) {
131122

132123
private boolean painted;
133124

134-
@Override
135125
public void paint(Graphics g) {
136126
super.paint(g);
137127

src/main/java/org/reficio/ws/legacy/SampleXmlUtil.java

-4
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,6 @@ private String sampleDataForSimpleType(SchemaType sType) {
205205
}
206206

207207
SchemaType primitiveType = sType.getPrimitiveType();
208-
if (primitiveType != null
209-
&& (primitiveType.getBuiltinTypeCode() == SchemaType.BTC_BASE_64_BINARY || primitiveType
210-
.getBuiltinTypeCode() == SchemaType.BTC_HEX_BINARY))
211-
return "cid:" + (long) (System.currentTimeMillis() * Math.random());
212208

213209
// if( sType != null )
214210
if (!exampleContent)

0 commit comments

Comments
 (0)