I freely admit that I am out of my depth here regarding SOAP connectivity. I used SOAP UI to generate Java classes from a wsdl location given to me by a third party.
This generated an interface:
@WebService(name = "Ext_Webservice_SoapPort", targetNamespace = "https://ws.185red.com")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@XmlSeeAlso({ ObjectFactory.class })
public interface ExtWebserviceSoapPort
{
@WebMethod(action = "https://ws.185red.com#acceptArrayOfInt")
@WebResult(partName = "return")
boolean acceptArrayOfInt(@WebParam(name = "param", partName = "param") final ArrayOfInt p0);
@WebMethod(action = "https://ws.185red.com#acceptArrayOfStrings")
@WebResult(partName = "return")
boolean acceptArrayOfStrings(@WebParam(name = "param", partName = "param") final ArrayOfString p0);
@WebMethod(action = "https://ws.185red.com#acceptArrayOfComplexType")
@WebResult(partName = "return")
boolean acceptArrayOfComplexType(@WebParam(name = "param", partName = "param") final ArrayOfExtWebserviceComplextypePerson p0);
@WebMethod(action = "https://ws.185red.com#acceptComplexType")
@WebResult(partName = "return")
boolean acceptComplexType(@WebParam(name = "param", partName = "param") final ExtWebserviceComplexTypePerson p0);
@WebMethod(action = "https://ws.185red.com#returnArrayOfInt")
@WebResult(partName = "return")
ArrayOfInt returnArrayOfInt();
@WebMethod(action = "https://ws.185red.com#returnArrayOfStrings")
@WebResult(partName = "return")
ArrayOfString returnArrayOfStrings();
@WebMethod(action = "https://ws.185red.com#returnArrayOfComplexType")
@WebResult(partName = "return")
ArrayOfExtWebserviceComplextypePerson returnArrayOfComplexType();
@WebMethod(action = "https://ws.185red.com#returnComplexType")
@WebResult(partName = "return")
ExtWebserviceComplexTypePerson returnComplexType();
@WebMethod(action = "https://ws.185red.com#login")
@WebResult(partName = "return")
String login(@WebParam(name = "username", partName = "username") final String p0, @WebParam(name = "password", partName = "password") final String p1);
@WebMethod(action = "https://ws.185red.com#logout")
@WebResult(partName = "return")
boolean logout();
@WebMethod(operationName = "FetchData", action = "https://ws.185red.com#FetchData")
@WebResult(partName = "return")
ArrayOfExtWebserviceComplextypeRecordwithoutkey fetchData(@WebParam(name = "formId", partName = "formId") final int p0, @WebParam(name = "criteria", partName = "criteria") final ArrayOfExtWebserviceComplextypeSearchcriteria p1, @WebParam(name = "keysToFetch", partName = "keysToFetch") final ArrayOfString p2);
@WebMethod(operationName = "FetchDataCount", action = "https://ws.185red.com#FetchDataCount")
@WebResult(partName = "return")
int fetchDataCount(@WebParam(name = "formId", partName = "formId") final int p0, @WebParam(name = "criteria", partName = "criteria") final ArrayOfExtWebserviceComplextypeSearchcriteria p1);
@WebMethod(operationName = "FetchRecordByUniqueKey", action = "https://ws.185red.com#FetchRecordByUniqueKey")
@WebResult(partName = "return")
ExtWebserviceComplexTypeRecordWithKey fetchRecordByUniqueKey(@WebParam(name = "formId", partName = "formId") final int p0, @WebParam(name = "uniqueKey", partName = "uniqueKey") final String p1, @WebParam(name = "tokensToFetch", partName = "tokensToFetch") final ArrayOfString p2);
@WebMethod(operationName = "UpdateDateFulfillment", action = "https://ws.185red.com#UpdateDateFulfillment")
@WebResult(partName = "return")
ArrayOfExtWebserviceComplextypeUpdatedataresult updateDateFulfillment(@WebParam(name = "formId", partName = "formId") final int p0, @WebParam(name = "values", partName = "values") final ArrayOfExtWebserviceComplextypeRecordwithkey p1);
@WebMethod(operationName = "UpdateData", action = "https://ws.185red.com#UpdateData")
@WebResult(partName = "return")
ArrayOfExtWebserviceComplextypeUpdatedataresult updateData(@WebParam(name = "formId", partName = "formId") final int p0, @WebParam(name = "values", partName = "values") final ArrayOfExtWebserviceComplextypeRecordwithkey p1, @WebParam(name = "markAsComplete", partName = "markAsComplete") final boolean p2, @WebParam(name = "prepopulate", partName = "prepopulate") final boolean p3);
@WebMethod(operationName = "DeleteData", action = "https://ws.185red.com#DeleteData")
@WebResult(partName = "return")
int deleteData(@WebParam(name = "formId", partName = "formId") final int p0, @WebParam(name = "criteria", partName = "criteria") final ArrayOfExtWebserviceComplextypeSearchcriteria p1);
}
I feel as if these methods are all set up, I simply need to pass in the data fields in order to call them. However I'm not sure exactly how to do that.
For example, the first method I would want to call is the login method. My understanding would be that I simply set the username and password and call the method. Then check for a return string. Like so:
@WebMethod(action = "https://ws.185red.com#login")
@WebResult(partName = "return")
@RequestMapping("/getAllTest")
public String login(@WebParam(name = "username", partName = "username") String username, @WebParam(name = "password", partName = "password") String password) {
username = "";
password = "";
//webresult return?
return "";
}
Is there something else I would need to do in order to A) actually send the request out and B)see the response? I believe I should just have to set the variables and it should be all set. I understand that I would need to actually call the request but am I not doing that by setting the WebMethod/WebResult annotations and pointing it to the endpoint location on my local webpage?
Again completely out of my depth here, if someone could point me to some documentation I'd be extremely grateful.
Thanks in advance.