Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 78440 invoked from network); 21 Aug 2008 09:19:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2008 09:19:43 -0000 Received: (qmail 63161 invoked by uid 500); 21 Aug 2008 09:19:35 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 63107 invoked by uid 500); 21 Aug 2008 09:19:35 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 63096 invoked by uid 99); 21 Aug 2008 09:19:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Aug 2008 02:19:35 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Aug 2008 09:18:46 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AA64C234C1C2 for ; Thu, 21 Aug 2008 02:18:45 -0700 (PDT) Message-ID: <773839473.1219310325696.JavaMail.jira@brutus> Date: Thu, 21 Aug 2008 02:18:45 -0700 (PDT) From: "Ulf Dittmer (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Commented: (AXIS2-1014) org.apache.asix2.saaj.SOAPConnectionImpl does not handle MimeHeaders (SOAPAction) In-Reply-To: <9642393.1155355573828.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXIS2-1014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624298#action_12624298 ] Ulf Dittmer commented on AXIS2-1014: ------------------------------------ As a stopgap measure to get SOAPAction to work, add the following lines before "opClient.setOptions(options);": MimeHeaders mh = request.getMimeHeaders(); String[] action = mh.getHeader(HTTPConstants.HEADER_SOAP_ACTION); if (action != null) options.setAction(action[0]); You'll also need: import org.apache.axis2.transport.http.HTTPConstants; With that change, it's possible to use WS-Security with SAAJ clients. I still think this is a major bug; I really don't understand why it's been lingering for years. > org.apache.asix2.saaj.SOAPConnectionImpl does not handle MimeHeaders (SOAPAction) > --------------------------------------------------------------------------------- > > Key: AXIS2-1014 > URL: https://issues.apache.org/jira/browse/AXIS2-1014 > Project: Axis 2.0 (Axis2) > Issue Type: Bug > Components: client-api > Reporter: Jian Wu > Assignee: sumedha rubasinghe > > I looked into org.apache.axis2.saaj.SOAPConnectionImpl.java in the > Axis2 Source Repositoy, as the following code snippet shown, it > never pass down MimeHeaders from SOAPMessage to the ServiceClient, > so all the SOAPMessages with empty SOAPAction as "" > ========================================== > public SOAPMessage call(SOAPMessage request, Object endpoint) throws SOAPException { > if (closed) { > throw new SOAPException("SOAPConnection closed"); > } > // initialize URL > URL url; > try { > url = (endpoint instanceof URL) ? (URL) endpoint : new URL(endpoint.toString()); > } catch (MalformedURLException e) { > throw new SOAPException(e); > } > // initialize and set Options > Options options = new Options(); > options.setTo(new EndpointReference(url.toString())); > // initialize the Sender > OperationClient opClient; > try { > serviceClient = new ServiceClient(); > opClient = serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP); > } catch (AxisFault e) { > throw new SOAPException(e); > } > opClient.setOptions(options); > if (request.countAttachments() != 0) { // SOAPMessage with attachments > opClient.getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, > Constants.VALUE_TRUE); > return handleSOAPMessage(request, opClient); > } else { // simple SOAPMessage > return handleSOAPMessage(request, opClient); > } > } > private SOAPMessage handleSOAPMessage(SOAPMessage request, > OperationClient opClient) throws SOAPException { > MessageContext requestMsgCtx = new MessageContext(); > try { > requestMsgCtx.setEnvelope(toOMSOAPEnvelope(request)); > opClient.addMessageContext(requestMsgCtx); > opClient.execute(true); > MessageContext msgCtx = opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); > //TODO: get attachments > return getSOAPMessage(msgCtx.getEnvelope()); > } catch (AxisFault e) { > throw new SOAPException(e); > } > } > protected org.apache.axiom.soap.SOAPEnvelope toOMSOAPEnvelope(SOAPMessage saajSOAPMsg) > throws SOAPException { > final org.apache.axiom.soap.SOAPEnvelope omSOAPEnv = > SAAJUtil.toOMSOAPEnvelope(saajSOAPMsg.getSOAPPart().getDocumentElement()); > System.err.println("#### req OM Soap Env=" + omSOAPEnv); > Map attachmentMap = new HashMap(); > final Iterator attachments = saajSOAPMsg.getAttachments(); > while (attachments.hasNext()) { > final AttachmentPart attachment = (AttachmentPart) attachments.next(); > if (attachment.getContentId() == null || > attachment.getContentId().trim().length() == 0) { > attachment.setContentId(IDGenerator.generateID()); > } > if (attachment.getDataHandler() == null) { > throw new SOAPException("Attachment with NULL DataHandler"); > } > attachmentMap.put(attachment.getContentId(), attachment); > } > insertAttachmentNodes(attachmentMap, omSOAPEnv); > // printOMSOAPEnvelope(omSOAPEnv); > return omSOAPEnv; > } > ====================================== > As suggested by Davanum Srinivas, I file this bug to track this problem -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org