Reputation: 741
I want to create an application with PHP
that get WSDL
and method name from user and generate a SOAP
request just like SOAPUI
.
in fact I want to create application just like SOAPUI
that create XML
request and let user edit it and fill the requested parameters.
how could I do that?
Upvotes: 2
Views: 1611
Reputation: 741
I found a solution :)
as far as I know there is no PHP
equivalent for SOAPUI
.
so I found that there is a API
in SOAPUI
with help of @satheesh-cheveri in following link, and create JAVA
program to use it and then call the JAVA
application inside my PHP
application:
https://stackoverflow.com/a/20487079/1665693
I take a long time to find out what library needed to be imported so I list it here for everyone who needed:
and here is my function I asked for:
public String generateSampleRequest(String wsdl, String method) {
String result = "";
try {
WsdlProject project = new WsdlProject();
WsdlInterface[] wsdls = WsdlImporter.importWsdl(project, wsdl);
WsdlInterface ws = wsdls[0];
WsdlOperation wsdlOperation = ws.getOperationByName(method);
result = wsdlOperation.createRequest(true);
ws.release();
project.release();
} catch (Exception e) {
result = e.getMessage();
}
return result;
}
Upvotes: 2
Reputation: 8082
You are looking for SoapServer
. More info here.
EDIT I forgot to add SoapClient. Thanks Magnus Eriksson
Upvotes: 1