I have a example DynaClient which does not appear to work sending a DataSource.
 Unfortunately it does not appear to be working correctly with the latest XFire.

Here is the source (very small)

==== Begin Source ====

public class DynaTest {

        /**
         * @param args
         */
        public static void main(String[] args) throws Exception{
                // 
http://localhost:8080/DocumentService/services/DocumentService
                
                Client client = new Client(new
URL("http://localhost:8080/DocumentService/services/DocumentService?WSDL";));
                
                // Enable HTTP chunking and MTOM
//              client.setProperty(HttpTransport.CHUNKING_ENABLED, "true");
//              client.setProperty("mtom-enabled", "true");
                
                File myFile = new File("C:/tmp/JavaWSTutorial.pdf");
                System.out.println(myFile.canRead());
                FileDataSource myFileDataSource = new FileDataSource(myFile);
                System.out.println(myFileDataSource.getName());

                Object[] results = client.invoke("receiveFileDataSource", 
new Object[]
{myFileDataSource, "JavaWSTutorial.pdf"});              
                
                System.out.println("Success creating DynaClient");

=== End Source ===

Yet I recieve the following error when trying to execute

==== Stack Begin ===

Exception in thread "main" org.codehaus.xfire.fault.XFireFault:
javax.activation.FileDataSource
        at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
        at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
        at org.codehaus.xfire.client.Client.invoke(Client.java:335)
        at org.codehaus.xfire.client.Client.invoke(Client.java:349)
        at gov.opm.test.DynaTest.main(DynaTest.java:30)
Caused by: java.lang.ClassCastException: javax.activation.FileDataSource

        at
org.codehaus.xfire.aegis.type.mtom.DataHandlerType.createAttachment(
DataHandlerType.java:18)
        at
org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.writeObject
(AbstractXOPType.java:89)
        at
org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter
(AegisBindingProvider.java:200)
        at
org.codehaus.xfire.service.binding.AbstractBinding.writeParameter
(AbstractBinding.java:273)
        at
org.codehaus.xfire.service.binding.WrappedBinding.writeMessage
(WrappedBinding.java:89)
        at 
org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:80)
        at
org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments
(HttpChannel.java:56)
        at
org.codehaus.xfire.transport.http.CommonsHttpMessageSender.
getByteArrayRequestEntity(CommonsHttpMessageSender.java:313)
        at
org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(
CommonsHttpMessageSender.java:251)
        at
org.codehaus.xfire.transport.http.HttpChannel.sendViaClient
(HttpChannel.java:123)
        at org.codehaus.xfire.transport.http.HttpChannel.send
(HttpChannel.java:48)
        at org.codehaus.xfire.handler.OutMessageSender.invoke
(OutMessageSender.java:26)
        at org.codehaus.xfire.handler.HandlerPipeline.invoke
(HandlerPipeline.java:131)
        at org.codehaus.xfire.client.Invocation.invoke
(Invocation.java:75)
        ... 3 more
=== End Stack ===

Any clue why this doesn't work?

Thanks




---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to