Sooooo.... here is how it's done using Axis directly, without the ColdFusion wrapper:

                String endpoint = "http://127.0.0.1:8081/ccx/Test4Mihai";
               
                Service service = new Service();
                service.getEngine().setOption("sendMultiRefs", Boolean.FALSE);
               
                Call call = (Call) service.createCall();
                call.setTargetEndpointAddress(new URL(endpoint));
               
                String aString = new String("Str1");
                Long aLong = new Long(123);
                Boolean aBoolean = new Boolean(false);
                Integer anInt = new Integer(123);
               
                AttachmentPart ap= new AttachmentPart(new DataHandler(new FileDataSource("D:/opt/data32/cv.xml")));
               
                call.setOperationName(new QName("withAttachment"));
                call.addAttachmentPart(ap);
                call.addParameter("aString", XMLType.XSD_STRING, ParameterMode.IN);
                call.addParameter("aLong", XMLType.XSD_LONG, ParameterMode.IN);
                call.addParameter("aBoolean", XMLType.XSD_BOOLEAN, ParameterMode.IN);
                call.addParameter("anInt", XMLType.XSD_INTEGER, ParameterMode.IN);
                call.setReturnType(XMLType.XSD_STRING);
               
                String ret = (String) call.invoke(new Object[] {aString, aLong, aBoolean, anInt});
               
                System.out.println("Sent  '" + aString + "," + aLong + "," + aBoolean + "," + anInt + "', got back '" + ret + "'");
               
                System.out.println("");System.out.println("");System.out.println("");
                SOAPMessage msg = call.getMessageContext().getMessage();
                System.out.println("SOAPBody:" + msg.getSOAPBody().toString());


The parameter mapping is not really necessary as Axis figures out by himself the mapping types, it's just for clarity.

I still cannot find any way to do it using the CFMX7 wrapper around Axis. Even using Axis classes from ColdFusion seems impossible as the data types get mixed up and I get a:
18:19:31.031 - org.apache.axis.AxisFault Exception - in /opt/app/tomcat4.1/bin/../webapps/cfusion/appproc/views/test_mihai.cfm : line 72

    ; nested exception is:
java.lang.ClassCastException

Best regards,
Mihai Manuta

Mihai Manuta wrote:
Nope... this is the standard format as defined by WS-I: http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html
It actually means that the attachment should arrive as an extra mime part in the SOAP message.
I'm working on an implementation using Apache Axis in Java. Once I do it, I will try to do the same thing in MX7 (since it uses Axis for web services)

Best regards,
Mihai


Thomas Chiverton wrote:
On Wednesday 19 April 2006 14:26, Mihai Manuta wrote:
        <xsd:simpleType name="swaRef">
                <xsd:restriction base="xsd:anyURI"/>
        </xsd:simpleType>

Looks like you give at a URI rather than the contents of that URI. OTOH, the 
message looks like it is just expecting a HTTP POST-type encoding.
Do you have any documentation or examples in another language to guide you ?

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to