Skip to content

Commit e4801a2

Browse files
committed
fixed not a schema error
1 parent c4f4cac commit e4801a2

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

src/main/java/burp/WSDLParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private byte[] createRequest(IHttpRequestResponse requestResponse, SoapBuilder b
167167
iter.remove();
168168
}
169169
}
170-
headers.add("SOAPAction: " + operation.getOperationName());
170+
headers.add("SOAPAction: " + operation.getSoapAction());
171171
headers.add("Content-Type: text/xml;charset=UTF-8");
172172
headers.add("Host: " + host);
173173

src/main/java/com/ibm/wsdl/xml/WSDLReaderImpl.java

+23-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import javax.xml.parsers.*;
1212

1313
import burp.IHttpRequestResponse;
14+
import burp.IRequestInfo;
1415
import burp.IResponseInfo;
1516
import burp.WSDLParser;
1617
import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
@@ -414,7 +415,13 @@ protected Import parseImport(Element importEl,
414415

415416
if (importedDef == null)
416417
{
417-
byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{});
418+
List<String> headers = WSDLParser.headers;
419+
byte[] getRequest = WSDLParser.helpers.buildHttpRequest(url);
420+
IRequestInfo getRequestInfo = WSDLParser.helpers.analyzeRequest(getRequest);
421+
List<String> getRequestInfoHeaders = getRequestInfo.getHeaders();
422+
headers.set(0,getRequestInfoHeaders.get(0));
423+
424+
byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{});
418425
IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
419426
byte[] response = httpRequestResponse.getResponse();
420427
IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);
@@ -814,8 +821,13 @@ protected ExtensibilityElement parseSchema( Class parentType,
814821

815822
if (referencedSchema == null)
816823
{
817-
// We haven't read this schema in before so do it now
818-
byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{});
824+
List<String> headers = WSDLParser.headers;
825+
byte[] getRequest = WSDLParser.helpers.buildHttpRequest(url);
826+
IRequestInfo getRequestInfo = WSDLParser.helpers.analyzeRequest(getRequest);
827+
List<String> getRequestInfoHeaders = getRequestInfo.getHeaders();
828+
headers.set(0,getRequestInfoHeaders.get(0));
829+
830+
byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{});
819831
IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
820832
byte[] response = httpRequestResponse.getResponse();
821833
IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);
@@ -2287,7 +2299,14 @@ public Definition readWSDL(String contextURI, String wsdlURI)
22872299
: null;
22882300
URL url = StringUtils.getURL(contextURL, wsdlURI);
22892301

2290-
byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{});
2302+
List<String> headers = WSDLParser.headers;
2303+
byte[] getRequest = WSDLParser.helpers.buildHttpRequest(url);
2304+
IRequestInfo getRequestInfo = WSDLParser.helpers.analyzeRequest(getRequest);
2305+
List<String> getRequestInfoHeaders = getRequestInfo.getHeaders();
2306+
headers.set(0,getRequestInfoHeaders.get(0));
2307+
2308+
byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{});
2309+
22912310
IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
22922311
byte[] response = httpRequestResponse.getResponse();
22932312
IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);

src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeLoaderBase.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.apache.xmlbeans.impl.schema;
1717

1818
import burp.IHttpRequestResponse;
19+
import burp.IRequestInfo;
1920
import burp.IResponseInfo;
2021
import burp.WSDLParser;
2122
import org.apache.xmlbeans.impl.common.QNameHelper;
@@ -280,8 +281,13 @@ else if (! options.hasOption(XmlOptions.DOCUMENT_SOURCE_NAME))
280281
int count = 0;
281282

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

284-
byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{});
290+
byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{});
285291
IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
286292
byte[] response = httpRequestResponse.getResponse();
287293
IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);

0 commit comments

Comments
 (0)