Hi everybody,
i’ve a problem:i’ve to launch a BatchJob using DataServices WebService (with java). Eclipse has created a bunch of classes from WSDL. Whitout security, it’s all right. With security enabled, i do correctly login, i retrieve the sessionID, but then i don’t know where to put that string in subsequent calls (es ask for Job status, or launch a batch job).
Can anybody give me any examples?
you will have to pass the sessionID as part of the header, some of the tools when converting the WSDL to Java will not generate the code for that, try the latest version of the tool to see if the issue is fixed or you can try by adding the following code
Modify Connection_OperationsStub.java to add header object.
Hi manoj_d,
thanks very much for your answer. I think i’ve to add the header on Batch_Job_AdminStub (am i right?). On the stub class there is a addHeader() method, i’ve modified my code in this way:
LogonRequest logreq = new LogonRequest();
logreq.setCms_authentication("secEnterprise");
logreq.setPassword(j.getRepository().getPasswordDS());
logreq.setUsername(j.getRepository().getLoginDS());
logreq.setCms_system(j.getRepository().getServerCms());
Connection_OperationsProxy connOp = new Connection_OperationsProxy();
connOp.setEndpoint(j.getRepository().getUrl());
Session sess = connOp.logon(logreq);//this works
SOAPHeaderElement header = new SOAPHeaderElement("http://www.businessobjects.com/DataServices/ServerX.xsd", "session");
MessageElement sessionIDElm = new MessageElement("", "SessionID");
sessionIDElm.addTextNode(sess.getSessionID());
header.addChildElement(sessionIDElm);
Batch_Job_AdminStub bja = new Batch_Job_AdminStub(new URL(j.getRepository().getUrl()),null);
bja.setHeader(header);
but server response is always: Web Services security enabled and session validation failed. Error: No sessionID supplied in soap request
can you check the return of Logon ? are you getting a session ID ?
can you try to capture the input that is going to DS Webserver using TCPMon or WireShark
or you can also enable WS Trace for DS and check the input XML for this do the following
Stop tomcat
go to %LINK_DIR%\conf open Admin.xml in notepad and set the value of to TRUE
Start tomcat
run your client app, check the %LINK_DIR%\log\webservices.log.0 file for the input that is coming to DS WebServer and post that here
What is your DS version ?
the input looks fine, can you try following from SoapUI
Import the DS WSDL in SoapUI Project
call logon operation to get a session ID
use the XML that you see in the log replace the session id and call run_batch_job see if that works
ser and ns1 are aliases and both resolve to same namespace, the problem is not with that
if you look at the element name sessionID in your input and SoapUI input the “S” in sessionID is capital S in case of SoapUI, I think this is causing the issue
Change your code the send this name as SessionID instead of sessionID and see if that works