-1

I need to create a client for some legacy soap services. I use java and preferably I would create a project with with proper rest endpoints that proxy request/response to this archaic sopa service. I have a wsdl url but it has use="encoded" which means I guess it uses rpc style and it has not been supported by any framework for a long time. I believe I need to use apache axis 1 to call this service. Most posts Ive seen are from ~2012 and even back then those old posts said rpc soap services are extremely deprecated. I dont have any option to update the remote wsdl and I need to call these services. I think anyone at my company who ever knew what it does or how it works is long gone. I was able to generate some code off the wsdl after a lot of trial and error and I have these classes now:

enter image description here

I have no idea how to invoke these classes and documentation online is all dead ends. Please save me. I assume I would need to use one of these classes and enter a url, then I need to invoke one of the rpc functions and pass some payload. Was expecting to have some stongly typed DTO classes generated but I can pass a string of XML I guess if I have to.

Any help or links to working code samples would be hugely appreciated!

2
  • did you try using the same version of Axis -which should be part of the question- from the server to generate the client and invoke it following Axis documentation? Commented Aug 31, 2024 at 3:24
  • thanks for the reply. We are talking about some soap server I have no idea how to access it. It has not been updated by my company in 10+ years and no one has a clue where it works, where the source code is, or what it does. Im upgrading some code that depends on it and leaving the remote service call as technical debt because I dont have time to figure it out. Commented Sep 1, 2024 at 23:53

1 Answer 1

0

You should try something like this :

import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RestController public class SoapProxyController { @GetMapping("/soap-endpoint") public String proxyRequest(@RequestParam String param1, @RequestParam String param2) { try { EntitiesWebServiceBrokerLocator locator = new EntitiesWebServiceBrokerLocator(); EntitiesWebServiceBrokerPortSoapBindingStub stub = (EntitiesWebServiceBrokerPortSoapBindingStub) locator.getYourServicePort(); // Set the endpoint URL if necessary stub._setProperty(EntitiesWebServiceBrokerPortSoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, "url-to-be-fille"); // Call the SOAP method String response = stub.yourSoapMethod(param1, param2); return response; } catch (Exception e) { e.printStackTrace(); return "Error: " + e.getMessage(); } 
Sign up to request clarification or add additional context in comments.

1 Comment

thanks that is more or less what I ended up going with

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.