Convert WSDL to corresponding HTTP bindings

I am just trying to convert WSDl to several different HTTP requests from the data provided by WSDL. I read a ton of similar questions, but no one gave an answer.

Some say using SOAPUI . I am familiar with this application and really use it. But I need to create these HTTP requests from WSDL myself.

Some say try JAXWS . I went through a series of guides on this, as well as on Axis , and they translated WSDL into Java class bindings, and you use those web service testing methods. I really would like to just generate the HTTP request myself, so that at some point I can manipulate the request and send my own tests.

I started using wsdl4j to start parsing WSDL myself, but would prefer not to go that route until I’m absolutely sure that I am not inventing the wheel. Seems to be the need for it? But with WSDL4J and every other library, I don’t see the transfer of WSDL to soap.

Any suggestions would be very helpful. The goal I want to be able to use WSDL, examine it and create HTTP-SOAP requests for each method in WSDL and have the opportunity than to test them for security problems. The first step is to create these queries!

+5
source share
1 answer

When calling a SOAP web service, you can use a static call or a dynamic call.

A static call means creating a stub from the WSDL and using it to make the call. This creates all the “plumbing” code for you, but is closely tied to this web service, and you cannot use it for other web services with different contracts. For each WSDL you need to create another stub.

WSDL , - , WSDL. WSDL .

- , SoapUI .

WSDL, , XML- XML. Wsdl4j XmlBeans .

Wsdl4j , WSDL. XmlBeans; tools, , schema to .

(, , , ), API SoapUI:

import com.eviware.soapui.impl.wsdl.WsdlInterface;
import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.impl.wsdl.support.wsdl.WsdlImporter;

public class Test {
    public static void main(String[] args) throws Exception {
        WsdlProject project = new WsdlProject();
        WsdlInterface[] wsdls = WsdlImporter.importWsdl(project, "http://www.html2xml.nl/Services/Calculator/Version1/Calculator.asmx?wsdl");
        WsdlInterface wsdl = wsdls[0];
        System.out.println(wsdl.getOperationByName("Add").createRequest(true));
        System.exit(0); // just to clear up some threads created by the project 
    }
}

, ( WS), :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:Add>
         <tem:a>?</tem:a>
         <tem:b>?</tem:b>
      </tem:Add>
   </soapenv:Body>
</soapenv:Envelope>

, .

+2

All Articles