diff --git a/src/main/java/burp/BurpExtender.java b/src/main/java/burp/BurpExtender.java index a97d64f..e6ebe7d 100644 --- a/src/main/java/burp/BurpExtender.java +++ b/src/main/java/burp/BurpExtender.java @@ -3,7 +3,6 @@ public class BurpExtender implements IBurpExtender { - @Override public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks) { diff --git a/src/main/java/burp/Menu.java b/src/main/java/burp/Menu.java index 9b4d91e..7cccfa8 100644 --- a/src/main/java/burp/Menu.java +++ b/src/main/java/burp/Menu.java @@ -26,6 +26,10 @@ public List createMenuItems( final IContextMenuInvocation invocation) { List list; list = new ArrayList(); + + if (invocation.getInvocationContext() != IContextMenuInvocation.CONTEXT_MESSAGE_EDITOR_REQUEST && invocation.getInvocationContext() != IContextMenuInvocation.CONTEXT_MESSAGE_VIEWER_REQUEST){ + return list; + } JMenuItem item = new JMenuItem("Parse WSDL"); item.addMouseListener(new MouseListener() { @@ -36,16 +40,17 @@ public void mouseClicked(MouseEvent e) { public void mousePressed(MouseEvent e) { + + } + + + public void mouseReleased(MouseEvent e) { WSDLParser parser = new WSDLParser(helpers, tab); try { new Worker(parser,invocation, tab, callbacks).execute(); } catch (Exception e1) { e1.printStackTrace(); } - } - - - public void mouseReleased(MouseEvent e) { } @@ -69,7 +74,6 @@ public void mouseExited(MouseEvent e) { class Worker extends SwingWorker { private JDialog dialog = new JDialog(); - private JProgressBar progressBar = new JProgressBar(); private WSDLParser parser; private IContextMenuInvocation invocation; private WSDLParserTab tab; @@ -77,6 +81,7 @@ class Worker extends SwingWorker { private int status; public Worker(WSDLParser parser, IContextMenuInvocation invocation, WSDLParserTab tab, IBurpExtenderCallbacks callbacks) { + JProgressBar progressBar = new JProgressBar(); progressBar.setString("Parsing WSDL"); progressBar.setStringPainted(true); progressBar.setIndeterminate(true); @@ -101,9 +106,7 @@ protected Void doInBackground() throws Exception { protected void done() { dialog.dispose(); if (status == -1) { - JOptionPane.showMessageDialog(tab.getUiComponent().getParent(), "Error: Can't Read Response"); - } else if(status == -2){ JOptionPane.showMessageDialog(tab.getUiComponent().getParent(), "Error: Not a WSDL"); } else if(status == -3){ diff --git a/src/main/java/burp/WSDLParser.java b/src/main/java/burp/WSDLParser.java index e1cf6c3..6292eac 100644 --- a/src/main/java/burp/WSDLParser.java +++ b/src/main/java/burp/WSDLParser.java @@ -100,7 +100,6 @@ public int parseWSDL(IHttpRequestResponse requestResponse, IBurpExtenderCallback xmlRequest = createRequest(requestResponse, builder, operation); } catch (Exception e) { success = false; - } if (success) { endpoints = builder.getServiceUrls(); @@ -132,7 +131,7 @@ private File createTempFile(String body) { private byte[] createRequest(IHttpRequestResponse requestResponse, SoapBuilder builder, SoapOperation operation) { SoapContext context = SoapContext.builder() - .alwaysBuildHeaders(true).exampleContent(false).typeComments(true).buildOptional(true).build(); + .alwaysBuildHeaders(true).exampleContent(true).typeComments(true).buildOptional(true).build(); String message = builder.buildInputMessage(operation, context); String host = getHost(builder.getServiceUrls().get(0)); String endpointURL = getEndPoint(builder.getServiceUrls().get(0), host); diff --git a/src/main/java/burp/WSDLParserTab.java b/src/main/java/burp/WSDLParserTab.java index eea9bbf..d793afa 100644 --- a/src/main/java/burp/WSDLParserTab.java +++ b/src/main/java/burp/WSDLParserTab.java @@ -31,12 +31,10 @@ public WSDLTab createTab(String request) { return wsdltab; } - @Override public String getTabCaption() { return "Wsdler"; } - @Override public Component getUiComponent() { return tabs; } diff --git a/src/main/java/burp/WSDLTab.java b/src/main/java/burp/WSDLTab.java index 522fa15..029c96c 100644 --- a/src/main/java/burp/WSDLTab.java +++ b/src/main/java/burp/WSDLTab.java @@ -49,17 +49,14 @@ public void addEntry(WSDLEntry entry) { } } - @Override public int getRowCount() { return entries.size(); } - @Override public int getColumnCount() { return 3; } - @Override public String getColumnName(int columnIndex) { switch (columnIndex) { case 0: @@ -73,12 +70,10 @@ public String getColumnName(int columnIndex) { } } - @Override public Class getColumnClass(int columnIndex) { return getValueAt(0, columnIndex).getClass(); } - @Override public Object getValueAt(int rowIndex, int columnIndex) { WSDLEntry wsdlEntry = entries.get(rowIndex); @@ -99,17 +94,14 @@ public boolean isCellEditable(int row, int col) { return col >= 2; } - @Override public byte[] getRequest() { return currentlyDisplayedItem.getRequest(); } - @Override public byte[] getResponse() { return currentlyDisplayedItem.getResponse(); } - @Override public IHttpService getHttpService() { return currentlyDisplayedItem.getHttpService(); } @@ -120,7 +112,6 @@ public WSDLTable(TableModel tableModel) { super(tableModel); } - @Override public void changeSelection(int row, int col, boolean toggle, boolean extend) { WSDLEntry wsdlEntry = entries.get(super.convertRowIndexToModel(row)); @@ -131,7 +122,6 @@ public void changeSelection(int row, int col, boolean toggle, boolean extend) { private boolean painted; - @Override public void paint(Graphics g) { super.paint(g); diff --git a/src/main/java/org/reficio/ws/legacy/SampleXmlUtil.java b/src/main/java/org/reficio/ws/legacy/SampleXmlUtil.java index f4c85ee..892ae56 100644 --- a/src/main/java/org/reficio/ws/legacy/SampleXmlUtil.java +++ b/src/main/java/org/reficio/ws/legacy/SampleXmlUtil.java @@ -205,10 +205,6 @@ private String sampleDataForSimpleType(SchemaType sType) { } SchemaType primitiveType = sType.getPrimitiveType(); - if (primitiveType != null - && (primitiveType.getBuiltinTypeCode() == SchemaType.BTC_BASE_64_BINARY || primitiveType - .getBuiltinTypeCode() == SchemaType.BTC_HEX_BINARY)) - return "cid:" + (long) (System.currentTimeMillis() * Math.random()); // if( sType != null ) if (!exampleContent)