Inserted line into webservice consumer methods to add SOAP Headers

/ Published in: Java
Save to your folder(s)

When Domino is used to create a webservice consumer, it does not provide an easy way to add SOAP headers to method calls. To do so, extend the STUB class it provides, copy any methods that need SOAP headers, and insert a line after the 'createCall' to provide that functionality. See snippet 69125 for the details of the 'createSessionHeader' code.

Copy this code and paste it in your HTML
  1. public QueryService_pkg.QueryResult queryFirst(QueryService_pkg.QueryRequest request) throws java.rmi.RemoteException {
  2. lotus.domino.websvc.client.Call _call = createCall("queryFirst");
  3. _call = createSessionHeader(_call);
  4. java.lang.Object _resp = _call.invoke(new java.lang.Object[] {request});
  5. this.queryHeader = _call.getResponseMessage().getSOAPEnvelope().getHeaderByName(new QueryServiceLocator().getServiceName().getNamespaceURI(), "QueryHeaderValue");
  6. return (QueryService_pkg.QueryResult) _call.convert(_resp, QueryService_pkg.QueryResult.class);
  7. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.