premjeetsinghho
12 years agoNew Contributor
Get request parameter data types
Hello,
I am trying to get all the methods, their parameters and the parameters data types like Boolean, String etc. from a Wsdl.
Here's my code
public class SoapUIClass {
public static void main(String[] args) throws Exception {
soapTest();
}
public static void soapTest() throws Exception
{
WsdlProject project = new WsdlProject();
WsdlInterface iface = WsdlInterfaceFactory.importWsdl(project,
"http://www.dneonline.com/calculator.asmx?WSDL", true)[0];
Operation[] operations = iface.getAllOperations();
for (Operation o : operations) {
System.out.println("\n");
System.out.println(o.getName());
List<Request> childrens = o.getRequestList();
for (Request c : childrens) {
System.out.println(c.getRequestContent());
}
}
System.exit(0);
}
}
It gives me the output like
Add
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Add>
<tem:intA>?</tem:intA>
<tem:intB>?</tem:intB>
</tem:Add>
</soapenv:Body>
</soapenv:Envelope>
My requirement is to get the data type of intA and intB. How can i get that?
Also getRequestContent() returns a xml. Is there any way i can get the list of parameters with their data types?
I am trying to get all the methods, their parameters and the parameters data types like Boolean, String etc. from a Wsdl.
Here's my code
public class SoapUIClass {
public static void main(String[] args) throws Exception {
soapTest();
}
public static void soapTest() throws Exception
{
WsdlProject project = new WsdlProject();
WsdlInterface iface = WsdlInterfaceFactory.importWsdl(project,
"http://www.dneonline.com/calculator.asmx?WSDL", true)[0];
Operation[] operations = iface.getAllOperations();
for (Operation o : operations) {
System.out.println("\n");
System.out.println(o.getName());
List<Request> childrens = o.getRequestList();
for (Request c : childrens) {
System.out.println(c.getRequestContent());
}
}
System.exit(0);
}
}
It gives me the output like
Add
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Add>
<tem:intA>?</tem:intA>
<tem:intB>?</tem:intB>
</tem:Add>
</soapenv:Body>
</soapenv:Envelope>
My requirement is to get the data type of intA and intB. How can i get that?
Also getRequestContent() returns a xml. Is there any way i can get the list of parameters with their data types?