Allow accessing Web Services when WebGoat is on a non-standard port

git-svn-id: http://webgoat.googlecode.com/svn/trunk@226 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
rogan.dawes 2008-01-10 10:09:27 +00:00
parent 64ce7068c4
commit 647c0c4a34

View File

@ -149,7 +149,7 @@ public class WSDLScanning extends LessonAdapter
}
public Object accessWGService(String serv, String proc,
public Object accessWGService(String serv, int port, String proc,
String parameterName, Object parameterValue)
{
String targetNamespace = "WebGoat";
@ -164,7 +164,7 @@ public class WSDLScanning extends LessonAdapter
call.setReturnType(XMLType.XSD_STRING);
call.setUsername("guest");
call.setPassword("guest");
call.setTargetEndpointAddress("http://localhost/WebGoat/services/"
call.setTargetEndpointAddress("http://localhost:" + port + "/WebGoat/services/"
+ serv);
Object result = call.invoke(new Object[] { parameterValue });
return result;
@ -233,11 +233,12 @@ public class WSDLScanning extends LessonAdapter
}
TR header = new TR();
TR results = new TR();
int port = s.getRequest().getServerPort();
for (int i = 0; i < fields.length; i++)
{
header.addElement(new TD().addElement(fields[i]));
results.addElement(new TD()
.addElement((String) accessWGService("WSDLScanning",
.addElement((String) accessWGService("WSDLScanning", port,
fields[i], "acct_num", new Integer(id))));
}
if (fields.length == 0)
@ -365,4 +366,4 @@ public class WSDLScanning extends LessonAdapter
return super.getCustomCredits("By Alex Smolen", CREDITS_LOGO);
}
}
}