简体   繁体   中英

Axis1.4 created wsdl how to generate soap response or classes

I have a wsdl written in Apache Axis version: 1.4 , I have generated java classes using soapui smart bear version 5.4, On generation of classes I'm able to get,

  • srv_PortType(I)
  • srvService(I)
  • srvServiceLocator (C)
  • srvSopaBindingStub (C)

I was expecting to get request and response object too, so that whatever response I'm getting can enclose in soap response and sent it back.

My main objective is,Need to write code for enclosing response in soap format in spring boot.

As of now I'm able to get above classes and interfaces from wsdl and code for request which return the response as a String and not the soap response with header and body , I'm stuck with it,

Code for getting response as a string is as below,

 try {
          SrvServiceLocator locator = new SrvServiceLocator();
          Srv_PortType service = locator.getSrv();
          // invoke business method
          String response = service.method("data");
          System.out.println(response);
      } catch (javax.xml.rpc.ServiceException ex) {
          ex.printStackTrace();
      } catch (java.rmi.RemoteException ex) {
          ex.printStackTrace();
      }

Take a look at this post, i wouldn't say i'ts a duplicate but your question gets answered nonetheless.

Try this online tool: https://www.wsdl-analyzer.com It appears to be free and does a lot more than generate the XML for requests and response. There is also this: https://www.oxygenxml.com/xml_editor/wsdl_soap_analyzer.html , which can be downloaded, but not free.

answered Mar 20 '16 at 12:12 Siderite Zackwehdex

Generating Request/Response XML from a WSDL

I understand the rule about just posting links, but it feels unjust to the original answerer to simply copy his answer's text, and to be honest, the Spring framework official documentation provides ample help with this ass well. https://spring.io/guides/gs/consuming-web-service/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM