Skip to content

Commit

Permalink
fixed not a schema error
Browse files Browse the repository at this point in the history
  • Loading branch information
egru committed Apr 24, 2016
1 parent c4f4cac commit e4801a2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/burp/WSDLParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private byte[] createRequest(IHttpRequestResponse requestResponse, SoapBuilder b
iter.remove();
}
}
headers.add("SOAPAction: " + operation.getOperationName());
headers.add("SOAPAction: " + operation.getSoapAction());
headers.add("Content-Type: text/xml;charset=UTF-8");
headers.add("Host: " + host);

Expand Down
27 changes: 23 additions & 4 deletions src/main/java/com/ibm/wsdl/xml/WSDLReaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import javax.xml.parsers.*;

import burp.IHttpRequestResponse;
import burp.IRequestInfo;
import burp.IResponseInfo;
import burp.WSDLParser;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
Expand Down Expand Up @@ -414,7 +415,13 @@ protected Import parseImport(Element importEl,

if (importedDef == null)
{
byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{});
List<String> headers = WSDLParser.headers;
byte[] getRequest = WSDLParser.helpers.buildHttpRequest(url);
IRequestInfo getRequestInfo = WSDLParser.helpers.analyzeRequest(getRequest);
List<String> getRequestInfoHeaders = getRequestInfo.getHeaders();
headers.set(0,getRequestInfoHeaders.get(0));

byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{});
IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
byte[] response = httpRequestResponse.getResponse();
IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);
Expand Down Expand Up @@ -814,8 +821,13 @@ protected ExtensibilityElement parseSchema( Class parentType,

if (referencedSchema == null)
{
// We haven't read this schema in before so do it now
byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{});
List<String> headers = WSDLParser.headers;
byte[] getRequest = WSDLParser.helpers.buildHttpRequest(url);
IRequestInfo getRequestInfo = WSDLParser.helpers.analyzeRequest(getRequest);
List<String> getRequestInfoHeaders = getRequestInfo.getHeaders();
headers.set(0,getRequestInfoHeaders.get(0));

byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{});
IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
byte[] response = httpRequestResponse.getResponse();
IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);
Expand Down Expand Up @@ -2287,7 +2299,14 @@ public Definition readWSDL(String contextURI, String wsdlURI)
: null;
URL url = StringUtils.getURL(contextURL, wsdlURI);

byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{});
List<String> headers = WSDLParser.headers;
byte[] getRequest = WSDLParser.helpers.buildHttpRequest(url);
IRequestInfo getRequestInfo = WSDLParser.helpers.analyzeRequest(getRequest);
List<String> getRequestInfoHeaders = getRequestInfo.getHeaders();
headers.set(0,getRequestInfoHeaders.get(0));

byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{});

IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
byte[] response = httpRequestResponse.getResponse();
IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.apache.xmlbeans.impl.schema;

import burp.IHttpRequestResponse;
import burp.IRequestInfo;
import burp.IResponseInfo;
import burp.WSDLParser;
import org.apache.xmlbeans.impl.common.QNameHelper;
Expand Down Expand Up @@ -280,8 +281,13 @@ else if (! options.hasOption(XmlOptions.DOCUMENT_SOURCE_NAME))
int count = 0;

if (url.toString().contains("http")){
List<String> headers = WSDLParser.headers;
byte[] getRequest = WSDLParser.helpers.buildHttpRequest(url);
IRequestInfo getRequestInfo = WSDLParser.helpers.analyzeRequest(getRequest);
List<String> getRequestInfoHeaders = getRequestInfo.getHeaders();
headers.set(0,getRequestInfoHeaders.get(0));

byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{});
byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{});
IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
byte[] response = httpRequestResponse.getResponse();
IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);
Expand Down

0 comments on commit e4801a2

Please sign in to comment.