Hi Azeez,

Afkham Azeez-2 wrote
> http://axis.apache.org/axis2/java/core/docs/mtom-guide.html may help

Thanks, I used that class. However, when using the following code, the
attachment doesn't seem to be getting delivered to the ESB. I am using this
to test a cloud connector, and the connector itself returned the error it
gives when it can't find this specific attachment. Is there something I'm
missing?

        OMElement getFileMandatoryParamRequest =
AXIOMUtil.stringToOM(omString);
        
        ServiceClient serviceClient = new ServiceClient();

        Options serviceOptions = new Options();
        
        serviceOptions.setTo(new
EndpointReference(getProxyServiceURL(CONNECTOR_NAME + "_"
                            + methodName)));
        serviceClient.setOptions(serviceOptions);
        MessageContext messageContext = new MessageContext();

        SOAPEnvelope soapEnvelope =
TransportUtils.createSOAPEnvelope(getFileMandatoryParamRequest);
        messageContext.setDoingSwA(true);
        messageContext.setEnvelope(soapEnvelope);
        messageContext.addAttachment("certificate", new DataHandler(new
URL("file:" + File.separator + File.separator
                + ProductConstant.SYSTEM_TEST_RESOURCE_LOCATION +
ConnectorIntegrationUtil.ESB_CONFIG_LOCATION
                + File.separator + "googledrive_certificate.p12")));
        OperationClient opClient =
serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP);
        opClient.addMessageContext(messageContext);
        
        opClient.execute(true);
        MessageContext responseMsgCtx =
opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

Thanks. 



--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/Sending-SOAP-attachments-using-AxisServiceClient-object-in-Integration-Tests-tp92033p92260.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to