/** * Set the port name. */ public void setPortName(String portName) { setPortName(new QName(portName)); } // setPortName
/** * Sets the endpoint address of the given SOAP client. * * @param soapClient the SOAP client to set the endpoint address for * @param endpointAddress the target endpoint address */ @Override public void setEndpointAddress(Stub soapClient, String endpointAddress) { soapClient._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, endpointAddress); }
protected void setRequestHeaders(org.apache.axis.client.Call call) throws AxisFault { // Set the call headers. SOAPHeaderElement[] headers = getHeaders(); for(int i=0;i<headers.length;i++){ call.addHeader(headers[i]); } }
/** * Clears all of the SOAP headers from the given SOAP client. * * @param soapClient the client to remove the headers from */ @Override public void clearHeaders(Stub soapClient) { soapClient._setProperty(HTTPConstants.REQUEST_HEADERS, new Hashtable<String, String>()); soapClient.clearHeaders(); }
/** * @see SoapClientHandler#putAllHttpHeaders(Object, Map) */ @Override public void putAllHttpHeaders(Stub soapClient, Map<String, String> headersMap) { @SuppressWarnings("unchecked") Hashtable<String, String> headers = (Hashtable<String, String>) soapClient._getProperty(HTTPConstants.REQUEST_HEADERS); if (headers == null) { headers = new Hashtable<String, String>(); } headers.putAll(headersMap); soapClient._setProperty(HTTPConstants.REQUEST_HEADERS, headers); }
/** * copy the attachments from the stub to the call object. After doing so, * the local set of attachments are cleared. * @param call call object to configure * @throws AxisFault */ protected void setAttachments(org.apache.axis.client.Call call) throws AxisFault { // Set the attachments. Object[] attachments = getAttachments(); for(int i=0;i<attachments.length;i++){ call.addAttachmentPart(attachments[i]); } clearAttachments(); }
protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { try { org.apache.axis.client.Call _call = super._createCall(); if (super.maintainSessionSet) { _call.setMaintainSession(super.maintainSession);
Constructor ctor = stubClass.getConstructor(formalArgs); Stub stub = (Stub) ctor.newInstance(actualArgs); stub._setProperty( Stub.ENDPOINT_ADDRESS_PROPERTY, WSDLUtils.getAddressFromPort(port)); stub.setPortName(portName); return (Remote) stub; } else {
/** * This method is used for adding files as attachments for SOAP calls * * @param stub THe Axis SOAP stub generated by Axis * @param fileLocations list of files to be attached from the local client file system * @return attachment file names */ public synchronized String[] addFiles(Stub stub, String[] fileLocations) { String[] fileNames = new String[fileLocations.length]; for (int i = 0; i < fileLocations.length; i++) { File file = new File(fileLocations[i]); String fileName = file.getName(); fileNames[i] = fileName; // Use classes from the Java Activation Framework // (import activation.jar) to wrap the attachment. DataHandler attachmentFile = new DataHandler(new FileDataSource(file)); // Tell the stub that the message being formed also // contains an attachment, and it is of type MIME // encoding. stub._setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT, Call.ATTACHMENT_ENCAPSULATION_FORMAT_MIME); //Add the attachment to the message stub.addAttachment(attachmentFile); } return fileNames; }
protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { try { org.apache.axis.client.Call _call = super._createCall(); if (super.maintainSessionSet) { _call.setMaintainSession(super.maintainSession);
Constructor ctor = stubClass.getConstructor(formalArgs); Stub stub = (Stub) ctor.newInstance(actualArgs); stub._setProperty( Stub.ENDPOINT_ADDRESS_PROPERTY, WSDLUtils.getAddressFromPort(port)); stub.setPortName(portName); return (Remote) stub; } else {
/** * copy the attachments from the stub to the call object. After doing so, * the local set of attachments are cleared. * @param call call object to configure * @throws AxisFault */ protected void setAttachments(org.apache.axis.client.Call call) throws AxisFault { // Set the attachments. Object[] attachments = getAttachments(); for(int i=0;i<attachments.length;i++){ call.addAttachmentPart(attachments[i]); } clearAttachments(); }
/** * Clears all of the SOAP headers from the given SOAP client. * * @param soapClient the client to remove the headers from */ @Override public void clearHeaders(Stub soapClient) { soapClient._setProperty(HTTPConstants.REQUEST_HEADERS, new Hashtable<String, String>()); soapClient.clearHeaders(); }
/** * @see SoapClientHandler#putAllHttpHeaders(Object, Map) */ @Override public void putAllHttpHeaders(Stub soapClient, Map<String, String> headersMap) { @SuppressWarnings("unchecked") Hashtable<String, String> headers = (Hashtable<String, String>) soapClient._getProperty(HTTPConstants.REQUEST_HEADERS); if (headers == null) { headers = new Hashtable<String, String>(); } headers.putAll(headersMap); soapClient._setProperty(HTTPConstants.REQUEST_HEADERS, headers); }
public synchronized void relayAttachments(Stub stub) throws java.rmi.RemoteException { try { // Sets the data type stub._setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT, Call.ATTACHMENT_ENCAPSULATION_FORMAT_MIME); // Get all the attachments AttachmentPart[] attachments = getMessageAttachments(); // Extract each attachment. for (int i = 0; i < attachments.length; i++) { DataHandler dh = attachments[i].getDataHandler(); //Add the attachment to the message stub.addAttachment(dh); } } catch (Exception e) { log.error(e); } }
/** * Set the port name. */ public void setPortName(String portName) { setPortName(new QName(portName)); } // setPortName
protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { try { org.apache.axis.client.Call _call = super._createCall(); if (super.maintainSessionSet) { _call.setMaintainSession(super.maintainSession);
Constructor ctor = stubClass.getConstructor(formalArgs); Stub stub = (Stub) ctor.newInstance(actualArgs); stub._setProperty( Stub.ENDPOINT_ADDRESS_PROPERTY, WSDLUtils.getAddressFromPort(port)); stub.setPortName(portName); return (Remote) stub; } else {
/** * Set whether SOAP requests should use compression. * * @param soapClient the client to set compression settings for * @param compress whether or not to use compression */ @Override public void setCompression(Stub soapClient, boolean compress) { soapClient._setProperty(HTTPConstants.MC_ACCEPT_GZIP, compress); soapClient._setProperty(HTTPConstants.MC_GZIP_REQUEST, compress); }
/** * copy the attachments from the stub to the call object. After doing so, * the local set of attachments are cleared. * @param call call object to configure * @throws AxisFault */ protected void setAttachments(org.apache.axis.client.Call call) throws AxisFault { // Set the attachments. Object[] attachments = getAttachments(); for(int i=0;i<attachments.length;i++){ call.addAttachmentPart(attachments[i]); } clearAttachments(); }