|
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---------------------------------------------------------- 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] |
- [CFCDev] Web services with attached files Mihai Manuta
- Re: [CFCDev] Web services with attached files Thomas Chiverton
- Re: [CFCDev] Web services with attached files Mihai Manuta
- Re: [CFCDev] Web services with attached file... Thomas Chiverton
- Re: [CFCDev] Web services with attached ... Mihai Manuta
- Re: [CFCDev] Web services with atta... Thomas Chiverton
- Re: [CFCDev] Web services with ... Mihai Manuta
- Re: [CFCDev] Web services w... Mihai Manuta
- RE: [CFCDev] Web services w... Rob Munn
