Vault API login using Java
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
We are dealing with the same issue as http://forums.autodesk.com/t5/vault-customization/can-t-connect-to-vault-using-api/m-p/5789804/highl... except that we have always used Java (and unfortunately, this can't change).
Our old code signed in to Vault using the SecurityService and setting the SoapEndpoint address, then creating a security header with the results of our signin call using the specific vault/user information.
SecurityServiceLocator loc = new SecurityServiceLocator();
loc.setSecurityServiceSoapEndpointAddress("http://" + vaultServer + "/autodeskDM/Services/SecurityService.asmx");
SecurityServiceSoapStub port = (SecurityServiceSoapStub)loc.getSecurityServiceSoap();
port.signIn(userName, password, vaultName)
SOAPHeaderElement soapHead = port.getResponseHeader("http://AutodeskDM/Services/Security/1/22/2015/", "SecurityHeader");
NodeList secNodes = soapHead.getChildNodes();
String ticket = null;
long userId = -1;
for (int i=0; i<secNodes.getLength(); i++)
{
Node n = secNodes.item(i);
String nodeName = n.getNodeName();
if (nodeName != null && nodeName.equals("Ticket"))
{
ticket = n.getFirstChild().getNodeValue();
}else if (nodeName != null && nodeName.equals("UserId"))
{
String userIdString = n.getFirstChild().getNodeValue();
userId = Long.parseLong(userIdString);
}
}
securityHeader = new SecurityHeader(ticket, userId);
We now need to update to the Vault 2016 API and have to update or rewrite the code. All help references I can find are for .NET, c#, VB etc. and seem to reference WebServicesTools classes that I cannot find. Note: we use a wsdl to java class generator to get all the classes for WebServices.
My hope is that once I have WebServicesTools I can get the WebServiceManager or UserPasswordCredentials classes. Is this the right approach? Where do I find those? Any other ideas?
Thanks in advance!
