You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Praveen Peddi <pp...@contextmedia.com> on 2003/01/03 15:41:37 UTC

Soap With attachments example

Hi all,
I read the example at http://www-106.ibm.com/developerworks/webservices/library/ws-soapatt/?open&l=930,t=grws and it was very helpful. I have a small problem. I am using Apache SOAP 2.2 both on the client side and the server side and I am not using WSDL, but simple RPC based invocation.

The server side code DocumentManagementImpl is fine and my code is similar to that. But the client side code uses WSTK and Apache SOAP I guess. It also uses WSDL based invocation. I need to add attachments using Apache SOAP only (may be using SOAPContext) and with out using WSDL. Does anyone has a sample code to add attachments using apache soap only. My server url looks like http://<hostname>:<port>/soap/servlet/rpcrouter
My client code before using attachments looks something like below. Now I need to code related to attachments to this code.
// Build the call.

Call call = new Call();

trace("after calling Call");

call.setTargetObjectURI("urn:SOAPServiceName");

call.setMethodName("methodName");

call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

Vector params = new Vector();

params.addElement(new Parameter("arg1", userField.getText().getClass(), new String(userField.getText()),null));

params.addElement(new Parameter("arg2", passField.getText().getClass(), new String(passField.getText()), null));

call.setParams(params);

Response resp;

resp = call.invoke(url, "");


Any help would be appreciated.

Thanks

Praveen

Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
> Can you post your full client code?

On second thought, don't: I see from your stack trace you have a GUI,
etc.  I'll just build on what you've posted.

Scott Nichol


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Scott,
If you look at the following snippet, the exception occurs only for the "else" case (i.e thumb is passed as null).

call.setTargetObjectURI("urn:CMISOAPContentService");
        call.setMethodName("uploadContentObject");
        call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

        Vector params = new Vector();
        params.addElement(new Parameter("sessionID", long.class,
                new Long(sessionID), null));
        params.addElement(new Parameter("containerID", containerID.getClass(),
                new String(containerID), null));
        params.addElement(new Parameter("xmlString", xmlString.getClass(),
                new String(xmlString), null));

        DataSource ds = new ByteArrayDataSource(sourceBytes, "application/octet-stream");
        DataHandler dh = new DataHandler(ds);
        params.addElement(new Parameter("source",
                javax.activation.DataHandler.class, dh, null));

        //            params.addElement(new Parameter("encodedSource", encodedSource.getClass(), new String(encodedSource), null));
        params.addElement(new Parameter("sourceFileName",
                sourceFileName.getClass(), new String(sourceFileName), null));

        if (thumbBytes != null && thumbFileName!=null) {
            ds = new ByteArrayDataSource(thumbBytes, "application/octet-stream");
            dh = new DataHandler(ds);
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, dh, null));
            params.addElement(new Parameter("thumbFileName",
                    thumbFileName.getClass(), new String(thumbFileName), null));
        } else {

            //exception occurs only for this case
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, null, null));
            params.addElement(new Parameter("thumbFileName",
                    new String().getClass(), null, null));
        }




----- Original Message ----- 
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 4:41 PM
Subject: Re: Urgent: Soap With attachments example


> What does uploadContentObject return, specifically, what is the Java
> type?  If you have provided a mapping for it in the server's deployment
> descriptor, what is the mapping?
> 
> Scott Nichol
> 
> P.S.: I appreciate that you are probably working on something with a
> deadline and require help to move forward, but putting "urgent" in the
> subject and asking me to "look at the error ASAP" is not the greatest
> etiquette for this list.  I am committed to helping Apache SOAP users
> and improving the Apache SOAP code, but I do so as an unpaid volunteer!
> I am also committed to making my mortgage payments ;-), so I cannot
> always get to things in a timely manner.  Please try to be patient.
> And, if I (or someone else on the list) cannot respond quickly enough,
> there's always the source code available for you to trace through, as
> well.
> 
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Cc: <sn...@scottnichol.com>
> Sent: Tuesday, January 07, 2003 4:22 PM
> Subject: Urgent: Soap With attachments example
> 
> 
> > Hi Scott,
> > Could you please look at the error ASAP and let me know whats wrong in
> my
> > code. I need to fix it ASAP.
> >
> > Thanks in Advance.
> >
> > Praveen
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 11:50 AM
> > Subject: Re: Soap With attachments example
> >
> >
> > > I updated my jar file with the current jar file that I got from the
> > nightly
> > > build. Now this is the error I get when I pass null for DataHandler.
> > >
> > > Uploading ....
> > > uploadContentObjectUsingAttachments...
> > > Generated fault:
> > >   Fault Code   = SOAP-ENV:Client
> > >   Fault String = Can't yet deserialize non-null Objects
> > > java.lang.Exception: Can't yet deserialize non-null Objects
> > >         at
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > >         at
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > er.actionPerformed(NewContentObjectDialog.java:275)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > istener.java:211)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at java.awt.Dialog.show(Dialog.java:375)
> > >         at java.awt.Component.show(Component.java:941)
> > >         at java.awt.Component.setVisible(Component.java:898)
> > >         at
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > rmed(SimplexFrame.java:391)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > >         at
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > d(BasicMenuItemUI.java:882)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > >         at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > >
> > > Praveen
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > The newest nightly is right here:
> > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > Hey Scott,
> > > > > I could not find a nightly build dated yesterday or today. Could
> you
> > > > please
> > > > > check it out. If not, where can find the insturctions on how to
> > > > compile the
> > > > > src, so that I can compile it and use it. Can I just replace the
> old
> > > > > MimePartSerializer class file with the new one or do I have to
> replece
> > > > the
> > > > > whole jar.
> > > > >
> > > > > Thanks
> > > > >
> > > > > Praveen
> > > > >
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > This is a "quirk" of the MimePartSerializer.  It is used to
> > > > serialize
> > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.  When a
> null
> > > > > > value is passed in for serialization, the serializer (for some
> > > > reason)
> > > > > > chooses to serialize it as an Object.  That's why you get the
> > > > mismatch.
> > > > > >
> > > > > > I'm going to change the code to use the type specified to the
> > > > serializer
> > > > > > when serializing a null.  You can either grab the source
> > > > > >
> > > >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > >
> > > >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > ext/plain), compile it and use it, or wait until tomorrow and
> get a
> > > > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > Hi Scott,
> > > > > >
> > > > > > Eveyrthing seems to work fine now, except one minor problem.
> When
> > > > there
> > > > > > is nothing to send as argument I am passing in null and thats
> > > > throwing
> > > > > > exception. Please look at the bold lines of my code below. I
> am
> > > > passing
> > > > > > in the type of the argument as
> javax.activation.DataHandler.class,
> > > > but
> > > > > > it still takes it as Object. See the exception after the code.
> Look
> > > > at
> > > > > > the 6th argument of the method. It is assuming the object type
> as
> > > > > > "Object" not "javax.activation.DataHandler"
> > > > > >
> > > > > > Vector params = new Vector();
> > > > > >         params.addElement(new Parameter("sessionID",
> long.class,
> > > > > >                 new Long(sessionID), null));
> > > > > >         params.addElement(new Parameter("containerID",
> > > > > > containerID.getClass(),
> > > > > >                 new String(containerID), null));
> > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > xmlString.getClass(),
> > > > > >                 new String(xmlString), null));
> > > > > >
> > > > > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > "application/octet-stream");
> > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > >         params.addElement(new Parameter("source",
> > > > > >                 javax.activation.DataHandler.class, dh,
> null));
> > > > > >
> > > > > >         //            params.addElement(new
> > > > Parameter("encodedSource",
> > > > > > encodedSource.getClass(), new String(encodedSource), null));
> > > > > >         params.addElement(new Parameter("sourceFileName",
> > > > > >                 sourceFileName.getClass(), new
> > > > String(sourceFileName),
> > > > > > null));
> > > > > >
> > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > "application/octet-stream");
> > > > > >             dh = new DataHandler(ds);
> > > > > >             params.addElement(new Parameter("thumb",
> > > > > >                     javax.activation.DataHandler.class, dh,
> null));
> > > > > >             params.addElement(new Parameter("thumbFileName",
> > > > > >                     thumbFileName.getClass(), new
> > > > String(thumbFileName),
> > > > > > null));
> > > > > >         } else {
> > > > > >             params.addElement(new Parameter("thumb",
> > > > > >                     javax.activation.DataHandler.class, null,
> > > > null));
> > > > > >             params.addElement(new Parameter("thumbFileName",
> > > > > >                     new String().getClass(), null, null));
> > > > > >         }
> > > > > >
> > > > > > Exception trace is as follows:
> > > > > >
> > > > > > Generated fault:
> > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > >   Fault String = Exception while handling service request:
> > > > > > com.contextmedia.ip.s
> > > > > >
> > > >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > ing,java
> > > > > >
> > > >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > ect,java
> > > > > > .lang.String) -- no signature match
> > > > > > java.lang.Exception: Exception while handling service request:
> > > > > > com.contextmedia.
> > > > > >
> > > >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > .String,
> > > > > >
> > > >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > .Object,
> > > > > > java.lang.String) -- no signature match
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > istener.java:211)
> > > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > rmed(SimplexFrame.java:391)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > d(BasicMenuItemUI.java:882)
> > > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at
> > > > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > >         at
> > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > >
> > > > > >
> > > > > >
> > > > > > Praveen
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > As a general recommendation, I encourage you to capture a
> stack
> > > > trace
> > > > > > > for your exceptions.  Just having the exception message
> makes it
> > > > > > harder
> > > > > > > to understand the cause of most exceptions.
> > > > > > >
> > > > > > > This particular exception means that a ByteArrayDataSource
> was
> > > > created
> > > > > > > with no data array, such as passing a null for the byte
> array.
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > >
> > > > > > > > BUt I have another problem. When I execute that method, I
> get
> > > > the
> > > > > > > following
> > > > > > > > exception.
> > > > > > > >
> > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > >
> > > > > > > > What does this mean? I double checked that my soap method
> exists
> > > > in
> > > > > > > the
> > > > > > > > descriptor and the implementation also exists on the
> server
> > > > side.
> > > > > > But
> > > > > > > the
> > > > > > > > call doesn't reach the server at all.
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > This sample that I created from you code works for me,
> i.e. it
> > > > > > does
> > > > > > > not
> > > > > > > > > throw an NPE.
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > import java.io.*;
> > > > > > > > > import java.util.*;
> > > > > > > > > import java.net.*;
> > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > import org.xml.sax.*;
> > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > import org.apache.soap.*;
> > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > import javax.activation.*;
> > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > >
> > > > > > > > > public class TestAttachments {
> > > > > > > > >  public static void main(String[] args) {
> > > > > > > > >   try {
> > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > >
> > > > > > > > >    // Build the call.
> > > > > > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > > > > > >    Call call = new Call();
> > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > >
> > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > >
> > > > > > > > >    Vector params = new Vector();
> > > > > > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > > > >
> > > > > > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > >     dh2, null));
> > > > > > > > >
> > > > > > > > >    call.setParams(params);
> > > > > > > > >
> > > > > > > > >    // Invoke the call.
> > > > > > > > >    Response resp;
> > > > > > > > >
> > > > > > > > >    try {
> > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > >     e.printStackTrace();
> > > > > > > > >    }
> > > > > > > > >   } catch (Exception e) {
> > > > > > > > >    e.printStackTrace();
> > > > > > > > >   }
> > > > > > > > >  }
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
> 

Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Scott,
If you look at the following snippet, the exception occurs only for the "else" case (i.e thumb is passed as null).

call.setTargetObjectURI("urn:CMISOAPContentService");
        call.setMethodName("uploadContentObject");
        call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

        Vector params = new Vector();
        params.addElement(new Parameter("sessionID", long.class,
                new Long(sessionID), null));
        params.addElement(new Parameter("containerID", containerID.getClass(),
                new String(containerID), null));
        params.addElement(new Parameter("xmlString", xmlString.getClass(),
                new String(xmlString), null));

        DataSource ds = new ByteArrayDataSource(sourceBytes, "application/octet-stream");
        DataHandler dh = new DataHandler(ds);
        params.addElement(new Parameter("source",
                javax.activation.DataHandler.class, dh, null));

        //            params.addElement(new Parameter("encodedSource", encodedSource.getClass(), new String(encodedSource), null));
        params.addElement(new Parameter("sourceFileName",
                sourceFileName.getClass(), new String(sourceFileName), null));

        if (thumbBytes != null && thumbFileName!=null) {
            ds = new ByteArrayDataSource(thumbBytes, "application/octet-stream");
            dh = new DataHandler(ds);
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, dh, null));
            params.addElement(new Parameter("thumbFileName",
                    thumbFileName.getClass(), new String(thumbFileName), null));
        } else {

            //exception occurs only for this case
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, null, null));
            params.addElement(new Parameter("thumbFileName",
                    new String().getClass(), null, null));
        }




----- Original Message ----- 
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 4:41 PM
Subject: Re: Urgent: Soap With attachments example


> What does uploadContentObject return, specifically, what is the Java
> type?  If you have provided a mapping for it in the server's deployment
> descriptor, what is the mapping?
> 
> Scott Nichol
> 
> P.S.: I appreciate that you are probably working on something with a
> deadline and require help to move forward, but putting "urgent" in the
> subject and asking me to "look at the error ASAP" is not the greatest
> etiquette for this list.  I am committed to helping Apache SOAP users
> and improving the Apache SOAP code, but I do so as an unpaid volunteer!
> I am also committed to making my mortgage payments ;-), so I cannot
> always get to things in a timely manner.  Please try to be patient.
> And, if I (or someone else on the list) cannot respond quickly enough,
> there's always the source code available for you to trace through, as
> well.
> 
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Cc: <sn...@scottnichol.com>
> Sent: Tuesday, January 07, 2003 4:22 PM
> Subject: Urgent: Soap With attachments example
> 
> 
> > Hi Scott,
> > Could you please look at the error ASAP and let me know whats wrong in
> my
> > code. I need to fix it ASAP.
> >
> > Thanks in Advance.
> >
> > Praveen
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 11:50 AM
> > Subject: Re: Soap With attachments example
> >
> >
> > > I updated my jar file with the current jar file that I got from the
> > nightly
> > > build. Now this is the error I get when I pass null for DataHandler.
> > >
> > > Uploading ....
> > > uploadContentObjectUsingAttachments...
> > > Generated fault:
> > >   Fault Code   = SOAP-ENV:Client
> > >   Fault String = Can't yet deserialize non-null Objects
> > > java.lang.Exception: Can't yet deserialize non-null Objects
> > >         at
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > >         at
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > er.actionPerformed(NewContentObjectDialog.java:275)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > istener.java:211)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at java.awt.Dialog.show(Dialog.java:375)
> > >         at java.awt.Component.show(Component.java:941)
> > >         at java.awt.Component.setVisible(Component.java:898)
> > >         at
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > rmed(SimplexFrame.java:391)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > >         at
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > d(BasicMenuItemUI.java:882)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > >         at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > >
> > > Praveen
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > The newest nightly is right here:
> > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > Hey Scott,
> > > > > I could not find a nightly build dated yesterday or today. Could
> you
> > > > please
> > > > > check it out. If not, where can find the insturctions on how to
> > > > compile the
> > > > > src, so that I can compile it and use it. Can I just replace the
> old
> > > > > MimePartSerializer class file with the new one or do I have to
> replece
> > > > the
> > > > > whole jar.
> > > > >
> > > > > Thanks
> > > > >
> > > > > Praveen
> > > > >
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > This is a "quirk" of the MimePartSerializer.  It is used to
> > > > serialize
> > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.  When a
> null
> > > > > > value is passed in for serialization, the serializer (for some
> > > > reason)
> > > > > > chooses to serialize it as an Object.  That's why you get the
> > > > mismatch.
> > > > > >
> > > > > > I'm going to change the code to use the type specified to the
> > > > serializer
> > > > > > when serializing a null.  You can either grab the source
> > > > > >
> > > >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > >
> > > >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > ext/plain), compile it and use it, or wait until tomorrow and
> get a
> > > > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > Hi Scott,
> > > > > >
> > > > > > Eveyrthing seems to work fine now, except one minor problem.
> When
> > > > there
> > > > > > is nothing to send as argument I am passing in null and thats
> > > > throwing
> > > > > > exception. Please look at the bold lines of my code below. I
> am
> > > > passing
> > > > > > in the type of the argument as
> javax.activation.DataHandler.class,
> > > > but
> > > > > > it still takes it as Object. See the exception after the code.
> Look
> > > > at
> > > > > > the 6th argument of the method. It is assuming the object type
> as
> > > > > > "Object" not "javax.activation.DataHandler"
> > > > > >
> > > > > > Vector params = new Vector();
> > > > > >         params.addElement(new Parameter("sessionID",
> long.class,
> > > > > >                 new Long(sessionID), null));
> > > > > >         params.addElement(new Parameter("containerID",
> > > > > > containerID.getClass(),
> > > > > >                 new String(containerID), null));
> > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > xmlString.getClass(),
> > > > > >                 new String(xmlString), null));
> > > > > >
> > > > > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > "application/octet-stream");
> > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > >         params.addElement(new Parameter("source",
> > > > > >                 javax.activation.DataHandler.class, dh,
> null));
> > > > > >
> > > > > >         //            params.addElement(new
> > > > Parameter("encodedSource",
> > > > > > encodedSource.getClass(), new String(encodedSource), null));
> > > > > >         params.addElement(new Parameter("sourceFileName",
> > > > > >                 sourceFileName.getClass(), new
> > > > String(sourceFileName),
> > > > > > null));
> > > > > >
> > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > "application/octet-stream");
> > > > > >             dh = new DataHandler(ds);
> > > > > >             params.addElement(new Parameter("thumb",
> > > > > >                     javax.activation.DataHandler.class, dh,
> null));
> > > > > >             params.addElement(new Parameter("thumbFileName",
> > > > > >                     thumbFileName.getClass(), new
> > > > String(thumbFileName),
> > > > > > null));
> > > > > >         } else {
> > > > > >             params.addElement(new Parameter("thumb",
> > > > > >                     javax.activation.DataHandler.class, null,
> > > > null));
> > > > > >             params.addElement(new Parameter("thumbFileName",
> > > > > >                     new String().getClass(), null, null));
> > > > > >         }
> > > > > >
> > > > > > Exception trace is as follows:
> > > > > >
> > > > > > Generated fault:
> > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > >   Fault String = Exception while handling service request:
> > > > > > com.contextmedia.ip.s
> > > > > >
> > > >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > ing,java
> > > > > >
> > > >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > ect,java
> > > > > > .lang.String) -- no signature match
> > > > > > java.lang.Exception: Exception while handling service request:
> > > > > > com.contextmedia.
> > > > > >
> > > >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > .String,
> > > > > >
> > > >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > .Object,
> > > > > > java.lang.String) -- no signature match
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > istener.java:211)
> > > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > rmed(SimplexFrame.java:391)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > d(BasicMenuItemUI.java:882)
> > > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at
> > > > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > >         at
> > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > >
> > > > > >
> > > > > >
> > > > > > Praveen
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > As a general recommendation, I encourage you to capture a
> stack
> > > > trace
> > > > > > > for your exceptions.  Just having the exception message
> makes it
> > > > > > harder
> > > > > > > to understand the cause of most exceptions.
> > > > > > >
> > > > > > > This particular exception means that a ByteArrayDataSource
> was
> > > > created
> > > > > > > with no data array, such as passing a null for the byte
> array.
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > >
> > > > > > > > BUt I have another problem. When I execute that method, I
> get
> > > > the
> > > > > > > following
> > > > > > > > exception.
> > > > > > > >
> > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > >
> > > > > > > > What does this mean? I double checked that my soap method
> exists
> > > > in
> > > > > > > the
> > > > > > > > descriptor and the implementation also exists on the
> server
> > > > side.
> > > > > > But
> > > > > > > the
> > > > > > > > call doesn't reach the server at all.
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > This sample that I created from you code works for me,
> i.e. it
> > > > > > does
> > > > > > > not
> > > > > > > > > throw an NPE.
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > import java.io.*;
> > > > > > > > > import java.util.*;
> > > > > > > > > import java.net.*;
> > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > import org.xml.sax.*;
> > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > import org.apache.soap.*;
> > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > import javax.activation.*;
> > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > >
> > > > > > > > > public class TestAttachments {
> > > > > > > > >  public static void main(String[] args) {
> > > > > > > > >   try {
> > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > >
> > > > > > > > >    // Build the call.
> > > > > > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > > > > > >    Call call = new Call();
> > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > >
> > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > >
> > > > > > > > >    Vector params = new Vector();
> > > > > > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > > > >
> > > > > > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > >     dh2, null));
> > > > > > > > >
> > > > > > > > >    call.setParams(params);
> > > > > > > > >
> > > > > > > > >    // Invoke the call.
> > > > > > > > >    Response resp;
> > > > > > > > >
> > > > > > > > >    try {
> > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > >     e.printStackTrace();
> > > > > > > > >    }
> > > > > > > > >   } catch (Exception e) {
> > > > > > > > >    e.printStackTrace();
> > > > > > > > >   }
> > > > > > > > >  }
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
> 

Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Even though we may not be using large files for attachments, this service
will be called many times by the same or many clients to import content into
the system. For example, one of clients uploads 5000 contents which means it
calls the methods 5000 times. Ofcourse client uses session pooling, so it
creates at about 5 to 10 sessions and those 10 sessions call this method
simultaneously.

Initially I was base64 encoding the bytes and sending them to the server but
that took lot of memoery and the server crashed. After using the
attachments, its sligtly better. Even now, I think I am not implementing it
in a best way. My team is still not satisfied with the performance, so I was
thinking if axis would help me.

Thanks.
Praveen

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 4:09 PM
Subject: Re: Urgent: Soap With attachments example


> If your attachments will be several megabytes, you might benefit from
> using Axis.  Apache SOAP still creates an image of the whole payload in
> memory, which gets to be a problem with large attachments.  While
> improving this is on the to-do list for SOAP, I do not know when it will
> be done.
>
> I personally think the most compelling feature of Axis is support for
> WSDL.  If you want to write clients to consume WSDL-based services, it's
> great to have the tool create proxies for you.  The WSDL generation for
> services is great, too, but you can use the Axis tool to generate WSDL
> for Apache SOAP services, so that alone is not a reason to switch.
>
> Down the road, of course, you will certainly want to be using Axis,
> since it will evolve with the SOAP and WSDL specs, while Apache SOAP
> will remain a SOAP 1.1 implementation.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Wednesday, January 08, 2003 3:56 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > Thanks a lot Scott.
> > If nothing works out, I will pass in some dummy bytes and work around.
> >
> > Once again I really appreciate your help.
> >
> > Do you think its better to migrate to Axis, since we are using
> attachments
> > extensively. Whats your suggestion?
> >
> > Thanks
> >
> > Praveen
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Wednesday, January 08, 2003 3:12 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > Ugh.  I never noticed that the admin GUI does not allow one to
> specify a
> > > fault listener.
> > >
> > > To get to the bottom of this, I wrote my own sample client and
> service.
> > > I got the "no signature match" error when I passed a null
> DataHandler,
> > > because the Apache SOAP code serializes a DataHandler as
> xsd:anyType,
> > > which is always deserialized as an Object.  I am not sure why you do
> not
> > > still see this message, too.
> > >
> > > Anyway, I made a small change to SOAPMappingRegistry so that a null
> > > DataHandler can be properly serialized and de-serialized.  If you
> pick
> > > up the next nightly build, you will get that change.  Both your
> client
> > > and server will need the new code.
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Wednesday, January 08, 2003 11:44 AM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > > Even though I have a deployment descriptor and the line
> > > >
> > >
> <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
> > > tene
> > > > r> is in a separate line, I deployed the services using the soap
> admin
> > > > client that apache provided. I got NoClassDefFound errors when I
> tried
> > > to
> > > > deploy using deployment descriptor.
> > >
> > > <<snip>>
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Even though we may not be using large files for attachments, this service
will be called many times by the same or many clients to import content into
the system. For example, one of clients uploads 5000 contents which means it
calls the methods 5000 times. Ofcourse client uses session pooling, so it
creates at about 5 to 10 sessions and those 10 sessions call this method
simultaneously.

Initially I was base64 encoding the bytes and sending them to the server but
that took lot of memoery and the server crashed. After using the
attachments, its sligtly better. Even now, I think I am not implementing it
in a best way. My team is still not satisfied with the performance, so I was
thinking if axis would help me.

Thanks.
Praveen

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 4:09 PM
Subject: Re: Urgent: Soap With attachments example


> If your attachments will be several megabytes, you might benefit from
> using Axis.  Apache SOAP still creates an image of the whole payload in
> memory, which gets to be a problem with large attachments.  While
> improving this is on the to-do list for SOAP, I do not know when it will
> be done.
>
> I personally think the most compelling feature of Axis is support for
> WSDL.  If you want to write clients to consume WSDL-based services, it's
> great to have the tool create proxies for you.  The WSDL generation for
> services is great, too, but you can use the Axis tool to generate WSDL
> for Apache SOAP services, so that alone is not a reason to switch.
>
> Down the road, of course, you will certainly want to be using Axis,
> since it will evolve with the SOAP and WSDL specs, while Apache SOAP
> will remain a SOAP 1.1 implementation.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Wednesday, January 08, 2003 3:56 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > Thanks a lot Scott.
> > If nothing works out, I will pass in some dummy bytes and work around.
> >
> > Once again I really appreciate your help.
> >
> > Do you think its better to migrate to Axis, since we are using
> attachments
> > extensively. Whats your suggestion?
> >
> > Thanks
> >
> > Praveen
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Wednesday, January 08, 2003 3:12 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > Ugh.  I never noticed that the admin GUI does not allow one to
> specify a
> > > fault listener.
> > >
> > > To get to the bottom of this, I wrote my own sample client and
> service.
> > > I got the "no signature match" error when I passed a null
> DataHandler,
> > > because the Apache SOAP code serializes a DataHandler as
> xsd:anyType,
> > > which is always deserialized as an Object.  I am not sure why you do
> not
> > > still see this message, too.
> > >
> > > Anyway, I made a small change to SOAPMappingRegistry so that a null
> > > DataHandler can be properly serialized and de-serialized.  If you
> pick
> > > up the next nightly build, you will get that change.  Both your
> client
> > > and server will need the new code.
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Wednesday, January 08, 2003 11:44 AM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > > Even though I have a deployment descriptor and the line
> > > >
> > >
> <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
> > > tene
> > > > r> is in a separate line, I deployed the services using the soap
> admin
> > > > client that apache provided. I got NoClassDefFound errors when I
> tried
> > > to
> > > > deploy using deployment descriptor.
> > >
> > > <<snip>>
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
If your attachments will be several megabytes, you might benefit from
using Axis.  Apache SOAP still creates an image of the whole payload in
memory, which gets to be a problem with large attachments.  While
improving this is on the to-do list for SOAP, I do not know when it will
be done.

I personally think the most compelling feature of Axis is support for
WSDL.  If you want to write clients to consume WSDL-based services, it's
great to have the tool create proxies for you.  The WSDL generation for
services is great, too, but you can use the Axis tool to generate WSDL
for Apache SOAP services, so that alone is not a reason to switch.

Down the road, of course, you will certainly want to be using Axis,
since it will evolve with the SOAP and WSDL specs, while Apache SOAP
will remain a SOAP 1.1 implementation.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 3:56 PM
Subject: Re: Urgent: Soap With attachments example


> Thanks a lot Scott.
> If nothing works out, I will pass in some dummy bytes and work around.
>
> Once again I really appreciate your help.
>
> Do you think its better to migrate to Axis, since we are using
attachments
> extensively. Whats your suggestion?
>
> Thanks
>
> Praveen
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Wednesday, January 08, 2003 3:12 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > Ugh.  I never noticed that the admin GUI does not allow one to
specify a
> > fault listener.
> >
> > To get to the bottom of this, I wrote my own sample client and
service.
> > I got the "no signature match" error when I passed a null
DataHandler,
> > because the Apache SOAP code serializes a DataHandler as
xsd:anyType,
> > which is always deserialized as an Object.  I am not sure why you do
not
> > still see this message, too.
> >
> > Anyway, I made a small change to SOAPMappingRegistry so that a null
> > DataHandler can be properly serialized and de-serialized.  If you
pick
> > up the next nightly build, you will get that change.  Both your
client
> > and server will need the new code.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Wednesday, January 08, 2003 11:44 AM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > Even though I have a deployment descriptor and the line
> > >
> >
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
> > tene
> > > r> is in a separate line, I deployed the services using the soap
admin
> > > client that apache provided. I got NoClassDefFound errors when I
tried
> > to
> > > deploy using deployment descriptor.
> >
> > <<snip>>
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
If your attachments will be several megabytes, you might benefit from
using Axis.  Apache SOAP still creates an image of the whole payload in
memory, which gets to be a problem with large attachments.  While
improving this is on the to-do list for SOAP, I do not know when it will
be done.

I personally think the most compelling feature of Axis is support for
WSDL.  If you want to write clients to consume WSDL-based services, it's
great to have the tool create proxies for you.  The WSDL generation for
services is great, too, but you can use the Axis tool to generate WSDL
for Apache SOAP services, so that alone is not a reason to switch.

Down the road, of course, you will certainly want to be using Axis,
since it will evolve with the SOAP and WSDL specs, while Apache SOAP
will remain a SOAP 1.1 implementation.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 3:56 PM
Subject: Re: Urgent: Soap With attachments example


> Thanks a lot Scott.
> If nothing works out, I will pass in some dummy bytes and work around.
>
> Once again I really appreciate your help.
>
> Do you think its better to migrate to Axis, since we are using
attachments
> extensively. Whats your suggestion?
>
> Thanks
>
> Praveen
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Wednesday, January 08, 2003 3:12 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > Ugh.  I never noticed that the admin GUI does not allow one to
specify a
> > fault listener.
> >
> > To get to the bottom of this, I wrote my own sample client and
service.
> > I got the "no signature match" error when I passed a null
DataHandler,
> > because the Apache SOAP code serializes a DataHandler as
xsd:anyType,
> > which is always deserialized as an Object.  I am not sure why you do
not
> > still see this message, too.
> >
> > Anyway, I made a small change to SOAPMappingRegistry so that a null
> > DataHandler can be properly serialized and de-serialized.  If you
pick
> > up the next nightly build, you will get that change.  Both your
client
> > and server will need the new code.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Wednesday, January 08, 2003 11:44 AM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > Even though I have a deployment descriptor and the line
> > >
> >
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
> > tene
> > > r> is in a separate line, I deployed the services using the soap
admin
> > > client that apache provided. I got NoClassDefFound errors when I
tried
> > to
> > > deploy using deployment descriptor.
> >
> > <<snip>>
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Thanks a lot Scott.
If nothing works out, I will pass in some dummy bytes and work around.

Once again I really appreciate your help.

Do you think its better to migrate to Axis, since we are using attachments
extensively. Whats your suggestion?

Thanks

Praveen
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 3:12 PM
Subject: Re: Urgent: Soap With attachments example


> Ugh.  I never noticed that the admin GUI does not allow one to specify a
> fault listener.
>
> To get to the bottom of this, I wrote my own sample client and service.
> I got the "no signature match" error when I passed a null DataHandler,
> because the Apache SOAP code serializes a DataHandler as xsd:anyType,
> which is always deserialized as an Object.  I am not sure why you do not
> still see this message, too.
>
> Anyway, I made a small change to SOAPMappingRegistry so that a null
> DataHandler can be properly serialized and de-serialized.  If you pick
> up the next nightly build, you will get that change.  Both your client
> and server will need the new code.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Wednesday, January 08, 2003 11:44 AM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > Even though I have a deployment descriptor and the line
> >
> <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
> tene
> > r> is in a separate line, I deployed the services using the soap admin
> > client that apache provided. I got NoClassDefFound errors when I tried
> to
> > deploy using deployment descriptor.
>
> <<snip>>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Thanks a lot Scott.
If nothing works out, I will pass in some dummy bytes and work around.

Once again I really appreciate your help.

Do you think its better to migrate to Axis, since we are using attachments
extensively. Whats your suggestion?

Thanks

Praveen
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 3:12 PM
Subject: Re: Urgent: Soap With attachments example


> Ugh.  I never noticed that the admin GUI does not allow one to specify a
> fault listener.
>
> To get to the bottom of this, I wrote my own sample client and service.
> I got the "no signature match" error when I passed a null DataHandler,
> because the Apache SOAP code serializes a DataHandler as xsd:anyType,
> which is always deserialized as an Object.  I am not sure why you do not
> still see this message, too.
>
> Anyway, I made a small change to SOAPMappingRegistry so that a null
> DataHandler can be properly serialized and de-serialized.  If you pick
> up the next nightly build, you will get that change.  Both your client
> and server will need the new code.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Wednesday, January 08, 2003 11:44 AM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > Even though I have a deployment descriptor and the line
> >
> <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
> tene
> > r> is in a separate line, I deployed the services using the soap admin
> > client that apache provided. I got NoClassDefFound errors when I tried
> to
> > deploy using deployment descriptor.
>
> <<snip>>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
Ugh.  I never noticed that the admin GUI does not allow one to specify a
fault listener.

To get to the bottom of this, I wrote my own sample client and service.
I got the "no signature match" error when I passed a null DataHandler,
because the Apache SOAP code serializes a DataHandler as xsd:anyType,
which is always deserialized as an Object.  I am not sure why you do not
still see this message, too.

Anyway, I made a small change to SOAPMappingRegistry so that a null
DataHandler can be properly serialized and de-serialized.  If you pick
up the next nightly build, you will get that change.  Both your client
and server will need the new code.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 11:44 AM
Subject: Re: Urgent: Soap With attachments example


> Even though I have a deployment descriptor and the line
>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
tene
> r> is in a separate line, I deployed the services using the soap admin
> client that apache provided. I got NoClassDefFound errors when I tried
to
> deploy using deployment descriptor.

<<snip>>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Forgot to mention one thing in my last email.
The admin client for deploying soap services does not have any provision for
specifying the faultListener. Probably thats the reason I don't see any
extra info even with fault.toString().
Should I deploy the services using deployment services. I used the following
command but I got errors:
java -classpath
".;xerces-2.0.0.jar;soap-2-2.jar;mail-1.2.jar;activation-1.0.1.jar;jdom1_8.j
ar;saxpath-1.0b8.jar;jaxen-full-1.0b8.jar"
org.apache.soap.server.ServiceManagerClient
http://localhost:7001/soap/servlet/rpcrouter deploy CMISOAPContainerDD.xml

The error I got is:
Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/Node
        at
org.apache.soap.server.ServiceManagerClient.<init>(ServiceManagerClie
nt.java:81)
        at
org.apache.soap.server.ServiceManagerClient.main(ServiceManagerClient
.java:216)

Am I missing any libraries in the classpath.

Praveen
----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 11:44 AM
Subject: Re: Urgent: Soap With attachments example


> Even though I have a deployment descriptor and the line
>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
> r> is in a separate line, I deployed the services using the soap admin
> client that apache provided. I got NoClassDefFound errors when I tried to
> deploy using deployment descriptor.
>
> Here is the trace after the statement you told.
> /***************************************************/
> Uploading ....
> uploadContentObjectUsingAttachments...
> Generated fault:
>   Fault Code   = SOAP-ENV:Client
>   Fault String = Can't yet deserialize non-null Objects
>   Message printed by fault.toString = [Attributes={}]
> [faultCode=SOAP-ENV:Client
> ] [faultString=Can't yet deserialize non-null Objects]
> [faultActorURI=/soap/serv
> let/rpcrouter] [DetailEntries=] [FaultEntries=]
> java.lang.Exception: Can't yet deserialize non-null Objects
>         at
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> entObjectWithAttachments(ContentObjectUtils.java:751)
>         at
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> er.actionPerformed(NewContentObjectDialog.java:275)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> istener.java:211)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at java.awt.Dialog.show(Dialog.java:375)
>         at java.awt.Component.show(Component.java:941)
>         at java.awt.Component.setVisible(Component.java:898)
>         at
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> rmed(SimplexFrame.java:391)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> d(BasicMenuItemUI.java:882)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
>
> /***************************************************/
>
> Praveen
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Wednesday, January 08, 2003 11:15 AM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > To provide more information, could you please add a line of code:
> >
> >     Fault fault = resp.getFault();
> >
> >     System.err.println("Generated fault: ");
> >     System.out.println("  Fault Code   = " + fault.getFaultCode());
> >     System.out.println("  Fault String = " + fault.getFaultString());
> > +++ System.out.println(fault.toString());
> >
> > Also, please be certain the deployment descriptor for the services
> > specifies
> >
> >
> > <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
> > tener>
> >
> > (This should be on a single line, with no whitespace between the element
> > tags.)
> >
> > With this listener, printing fault.toString() on the client should show
> > the stack trace.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Cc: <sn...@scottnichol.com>
> > Sent: Wednesday, January 08, 2003 10:16 AM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > Dear Scott,
> > > I don't do anything special as far as I know. I think the fault is
> > generated
> > > by the apache tool kit.
> > > Let me send you the complete method again. May be its easy to
> > understand
> > > when u look at the full method. If you look at the arguments of my
> > client
> > > method, sourceBytes are never null but thumbBytes are sometimes null.
> > This
> > > is basically the case I am problems in.
> > >
> > > public static String uploadContentObjectWithAttachments(long
> > sessionID,
> > >         String containerID, String title, byte[] sourceBytes,
> > >         String sourceFileName, byte[] thumbBytes, String
> > thumbFileName)
> > >         throws Exception {
> > >          System.out.println("uploadContentObjectUsingAttachments...");
> > >         // Process the arguments.
> > >         URL url = null;
> > >
> > >         String xmlString = "<?xml version=\"1.0\"
> > encoding=\"UTF-8\"?>" +
> > >             "<content>" + "<title>" + title + "</title>" +
> > >             "<source><url><unencoded>" + sourceFileName +
> > >             "</unencoded>  </url></source>";
> > >
> > >         if (thumbFileName != null) {
> > >             xmlString += ("<thumbnail><url><unencoded>" +
> > thumbFileName +
> > >             "</unencoded></url></thumbnail>");
> > >         }
> > >   xmlString += "<categorization>"+
> > >            "<category>My Content/cat1</category>"+
> > >            "<category>My Content/cat2</category>"+
> > >            "<category>My Content/cat3</category>"+
> > >            "</categorization>";
> > >         xmlString += "</content>";
> > >
> > >         try {
> > >             url = new URL(Simplex.getServerURL());
> > >         } catch (MalformedURLException me) {
> > >             System.err.println("MalformedURLException:" +
> > me.getMessage());
> > >         }
> > >
> > >         // Build the call.
> > >         SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > >         Call call = new Call();
> > >
> > >   call.setSOAPMappingRegistry(smr);
> > >         call.setTargetObjectURI("urn:CMISOAPContentService");
> > >         call.setMethodName("uploadContentObject");
> > >         call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > >
> > >         Vector params = new Vector();
> > >         params.addElement(new Parameter("sessionID", long.class,
> > >                 new Long(sessionID), null));
> > >         params.addElement(new Parameter("containerID",
> > > containerID.getClass(),
> > >                 new String(containerID), null));
> > >         params.addElement(new Parameter("xmlString",
> > xmlString.getClass(),
> > >                 new String(xmlString), null));
> > >
> > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >         DataHandler dh = new DataHandler(ds);
> > >         params.addElement(new Parameter("source",
> > >                 javax.activation.DataHandler.class, dh, null));
> > >
> > >         //            params.addElement(new Parameter("encodedSource",
> > > encodedSource.getClass(), new String(encodedSource), null));
> > >         params.addElement(new Parameter("sourceFileName",
> > >                 sourceFileName.getClass(), new String(sourceFileName),
> > > null));
> > >
> > >         if (thumbBytes != null && thumbFileName!=null) {
> > >             ds = new ByteArrayDataSource(thumbBytes,
> > > "application/octet-stream");
> > >             dh = new DataHandler(ds);
> > >             params.addElement(new Parameter("thumb",
> > >                     javax.activation.DataHandler.class, dh, null));
> > >             params.addElement(new Parameter("thumbFileName",
> > >                     thumbFileName.getClass(), new
> > String(thumbFileName),
> > > null));
> > >         } else {
> > >             params.addElement(new Parameter("thumb",
> > >                     javax.activation.DataHandler.class, null, null));
> > >             params.addElement(new Parameter("thumbFileName",
> > >                     new String().getClass(), null, null));
> > >         }
> > >
> > >         call.setParams(params);
> > >
> > >         // Invoke the call.
> > >         Response resp;
> > >
> > >         try {
> > >             resp = call.invoke(url, "");
> > >
> > >             //System.out.println("Response is: " + resp);
> > >         } catch (SOAPException e) {
> > >          e.printStackTrace();
> > >             System.err.println("Caught SOAPException (" +
> > e.getFaultCode() +
> > >                 "): " + e.getMessage());
> > >
> > >             return null;
> > >         }
> > >
> > >         // Check the response.
> > >         if (!resp.generatedFault()) {
> > >             Parameter ret = resp.getReturnValue();
> > >             String encodedString = (String) ret.getValue();
> > >             String decodedString = new
> > String(Base64.decode(encodedString));
> > >
> > >             //  System.out.println("XML String: " + decodedString);
> > >             return decodedString;
> > >         } else {
> > >             Fault fault = resp.getFault();
> > >
> > >             System.err.println("Generated fault: ");
> > >             System.out.println("  Fault Code   = " +
> > fault.getFaultCode());
> > >             System.out.println("  Fault String = " +
> > > fault.getFaultString());
> > >             throw new Exception(fault.getFaultString());
> > >         }
> > >     }
> > >
> > > Praveen
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 6:00 PM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > > Interesting.  Do you do anything special to generate the fault, such
> > as
> > > > registering a fault listener?
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 5:50 PM
> > > > Subject: Re: Urgent: Soap With attachments example
> > > >
> > > >
> > > > I think the exception is not thrown by the invoke() method but a
> > fault
> > > > is generated in the response.
> > > >
> > > > try {
> > > >             resp = call.invoke(url, "");
> > > >
> > > >             //System.out.println("Response is: " + resp);
> > > >         } catch (SOAPException e) {
> > > >          e.printStackTrace();
> > > >             System.err.println("Caught SOAPException (" +
> > > > e.getFaultCode() +
> > > >                 "): " + e.getMessage());
> > > >
> > > >             return null;
> > > >         }
> > > >
> > > >         // Check the response.
> > > >         if (!resp.generatedFault()) {
> > > >             Parameter ret = resp.getReturnValue();
> > > >             String encodedString = (String) ret.getValue();
> > > >             String decodedString = new
> > > > String(Base64.decode(encodedString));
> > > >
> > > >             //  System.out.println("XML String: " + decodedString);
> > > >             return decodedString;
> > > >         } else {
> > > >
> > > >             //this is where the error is traced
> > > >             Fault fault = resp.getFault();
> > > >
> > > >             System.err.println("Generated fault: ");
> > > >             System.out.println("  Fault Code   = " +
> > > > fault.getFaultCode());
> > > >             System.out.println("  Fault String = " +
> > > > fault.getFaultString());
> > > >             throw new Exception(fault.getFaultString());
> > > >         }
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 5:18 PM
> > > > Subject: Re: Urgent: Soap With attachments example
> > > >
> > > >
> > > > > That's odd.  The error message is when deserializing, but the
> > client
> > > > > only deserializes responses.  Is the line at which the exception
> > is
> > > > > thrown doing the Call#invoke?
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 4:56 PM
> > > > > Subject: Re: Urgent: Soap With attachments example
> > > > >
> > > > >
> > > > > > I am sorry about it. I didn't mean to demand the response or
> > > > anything
> > > > > like
> > > > > > that. I am just kind of under pressure and it looked like the
> > > > problem
> > > > > might
> > > > > > be in the soap tool kit (since u said it didn't handler null
> > > > arguments
> > > > > > before).
> > > > > >
> > > > > > But I appreciate your help. You have been a great help to me.
> > > > > >
> > > > > > uploadContentObject returns a base64 encoded string. But it
> > looks
> > > > like
> > > > > the
> > > > > > request doesn't goto the server at all. I can't see the trace on
> > the
> > > > > server
> > > > > > I should have been seen if the request comes in.
> > > > > >
> > > > > > Praveen
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Tuesday, January 07, 2003 4:41 PM
> > > > > > Subject: Re: Urgent: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > What does uploadContentObject return, specifically, what is
> > the
> > > > Java
> > > > > > > type?  If you have provided a mapping for it in the server's
> > > > > deployment
> > > > > > > descriptor, what is the mapping?
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > P.S.: I appreciate that you are probably working on something
> > with
> > > > a
> > > > > > > deadline and require help to move forward, but putting
> > "urgent" in
> > > > > the
> > > > > > > subject and asking me to "look at the error ASAP" is not the
> > > > > greatest
> > > > > > > etiquette for this list.  I am committed to helping Apache
> > SOAP
> > > > > users
> > > > > > > and improving the Apache SOAP code, but I do so as an unpaid
> > > > > volunteer!
> > > > > > > I am also committed to making my mortgage payments ;-), so I
> > > > cannot
> > > > > > > always get to things in a timely manner.  Please try to be
> > > > patient.
> > > > > > > And, if I (or someone else on the list) cannot respond quickly
> > > > > enough,
> > > > > > > there's always the source code available for you to trace
> > through,
> > > > > as
> > > > > > > well.
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Cc: <sn...@scottnichol.com>
> > > > > > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > > > > > Subject: Urgent: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > Hi Scott,
> > > > > > > > Could you please look at the error ASAP and let me know
> > whats
> > > > > wrong in
> > > > > > > my
> > > > > > > > code. I need to fix it ASAP.
> > > > > > > >
> > > > > > > > Thanks in Advance.
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > I updated my jar file with the current jar file that I got
> > > > from
> > > > > the
> > > > > > > > nightly
> > > > > > > > > build. Now this is the error I get when I pass null for
> > > > > DataHandler.
> > > > > > > > >
> > > > > > > > > Uploading ....
> > > > > > > > > uploadContentObjectUsingAttachments...
> > > > > > > > > Generated fault:
> > > > > > > > >   Fault Code   = SOAP-ENV:Client
> > > > > > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > > > > > java.lang.Exception: Can't yet deserialize non-null
> > Objects
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > 45)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > ctButton.java:1499)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > .java:373)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > > istener.java:211)
> > > > > > > > >         at
> > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > >         at
> > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > >         at
> > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > >         at
> > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > >
> > > > > > > > >         at
> > > > > > > >
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > >         at
> > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > read.java:126)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > ad.java:93)
> > > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > > > >         at
> > java.awt.Component.setVisible(Component.java:898)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > 45)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > ctButton.java:1499)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > .java:373)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > > >         at
> > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > >         at
> > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > >         at
> > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > >         at
> > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > >
> > > > > > > > >         at
> > > > > > > >
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > >         at
> > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > read.java:126)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > ad.java:93)
> > > > > > > > >         at
> > > > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > > >         at
> > > > > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > > >
> > > > > > > > > Praveen
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > The newest nightly is right here:
> > > > > > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > > > > > >
> > > > > > > > > > Scott Nichol
> > > > > > > > > >
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > Hey Scott,
> > > > > > > > > > > I could not find a nightly build dated yesterday or
> > today.
> > > > > Could
> > > > > > > you
> > > > > > > > > > please
> > > > > > > > > > > check it out. If not, where can find the insturctions
> > on
> > > > how
> > > > > to
> > > > > > > > > > compile the
> > > > > > > > > > > src, so that I can compile it and use it. Can I just
> > > > replace
> > > > > the
> > > > > > > old
> > > > > > > > > > > MimePartSerializer class file with the new one or do I
> > > > have
> > > > > to
> > > > > > > replece
> > > > > > > > > > the
> > > > > > > > > > > whole jar.
> > > > > > > > > > >
> > > > > > > > > > > Thanks
> > > > > > > > > > >
> > > > > > > > > > > Praveen
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > > This is a "quirk" of the MimePartSerializer.  It is
> > used
> > > > > to
> > > > > > > > > > serialize
> > > > > > > > > > > > InputStream, DataSource, MimeBodyPart and
> > DataHandler.
> > > > > When a
> > > > > > > null
> > > > > > > > > > > > value is passed in for serialization, the serializer
> > > > (for
> > > > > some
> > > > > > > > > > reason)
> > > > > > > > > > > > chooses to serialize it as an Object.  That's why
> > you
> > > > get
> > > > > the
> > > > > > > > > > mismatch.
> > > > > > > > > > > >
> > > > > > > > > > > > I'm going to change the code to use the type
> > specified
> > > > to
> > > > > the
> > > > > > > > > > serializer
> > > > > > > > > > > > when serializing a null.  You can either grab the
> > source
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > > > > > ext/plain), compile it and use it, or wait until
> > > > tomorrow
> > > > > and
> > > > > > > get a
> > > > > > > > > > > > nightly build
> > > > (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > > > > > >
> > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > >
> > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Hi Scott,
> > > > > > > > > > > >
> > > > > > > > > > > > Eveyrthing seems to work fine now, except one minor
> > > > > problem.
> > > > > > > When
> > > > > > > > > > there
> > > > > > > > > > > > is nothing to send as argument I am passing in null
> > and
> > > > > thats
> > > > > > > > > > throwing
> > > > > > > > > > > > exception. Please look at the bold lines of my code
> > > > below.
> > > > > I
> > > > > > > am
> > > > > > > > > > passing
> > > > > > > > > > > > in the type of the argument as
> > > > > > > javax.activation.DataHandler.class,
> > > > > > > > > > but
> > > > > > > > > > > > it still takes it as Object. See the exception after
> > the
> > > > > code.
> > > > > > > Look
> > > > > > > > > > at
> > > > > > > > > > > > the 6th argument of the method. It is assuming the
> > > > object
> > > > > type
> > > > > > > as
> > > > > > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > > > > > >
> > > > > > > > > > > > Vector params = new Vector();
> > > > > > > > > > > >         params.addElement(new Parameter("sessionID",
> > > > > > > long.class,
> > > > > > > > > > > >                 new Long(sessionID), null));
> > > > > > > > > > > >         params.addElement(new
> > Parameter("containerID",
> > > > > > > > > > > > containerID.getClass(),
> > > > > > > > > > > >                 new String(containerID), null));
> > > > > > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > > > > > xmlString.getClass(),
> > > > > > > > > > > >                 new String(xmlString), null));
> > > > > > > > > > > >
> > > > > > > > > > > >         DataSource ds = new
> > > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > > > > > >                 javax.activation.DataHandler.class,
> > dh,
> > > > > > > null));
> > > > > > > > > > > >
> > > > > > > > > > > >         //            params.addElement(new
> > > > > > > > > > Parameter("encodedSource",
> > > > > > > > > > > > encodedSource.getClass(), new String(encodedSource),
> > > > > null));
> > > > > > > > > > > >         params.addElement(new
> > > > Parameter("sourceFileName",
> > > > > > > > > > > >                 sourceFileName.getClass(), new
> > > > > > > > > > String(sourceFileName),
> > > > > > > > > > > > null));
> > > > > > > > > > > >
> > > > > > > > > > > >         if (thumbBytes != null &&
> > thumbFileName!=null) {
> > > > > > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > >             dh = new DataHandler(ds);
> > > > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > > > >
> > javax.activation.DataHandler.class,
> > > > > dh,
> > > > > > > null));
> > > > > > > > > > > >             params.addElement(new
> > > > > Parameter("thumbFileName",
> > > > > > > > > > > >                     thumbFileName.getClass(), new
> > > > > > > > > > String(thumbFileName),
> > > > > > > > > > > > null));
> > > > > > > > > > > >         } else {
> > > > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > > > >
> > javax.activation.DataHandler.class,
> > > > > null,
> > > > > > > > > > null));
> > > > > > > > > > > >             params.addElement(new
> > > > > Parameter("thumbFileName",
> > > > > > > > > > > >                     new String().getClass(), null,
> > > > null));
> > > > > > > > > > > >         }
> > > > > > > > > > > >
> > > > > > > > > > > > Exception trace is as follows:
> > > > > > > > > > > >
> > > > > > > > > > > > Generated fault:
> > > > > > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > > > > > >   Fault String = Exception while handling service
> > > > request:
> > > > > > > > > > > > com.contextmedia.ip.s
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > > > > > ing,java
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > > > > > ect,java
> > > > > > > > > > > > .lang.String) -- no signature match
> > > > > > > > > > > > java.lang.Exception: Exception while handling
> > service
> > > > > request:
> > > > > > > > > > > > com.contextmedia.
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > > > > > .String,
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > > > > > .Object,
> > > > > > > > > > > > java.lang.String) -- no signature match
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > > > > >
> > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > > > 45)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > > > ctButton.java:1499)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > > > .java:373)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > > > )
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > > > > > istener.java:211)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > > > )
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > > > >
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > > > >         at
> > > > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > > >         at
> > > > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > > > read.java:126)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > > > ad.java:93)
> > > > > > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > > > > > >         at
> > java.awt.Component.show(Component.java:941)
> > > > > > > > > > > >         at
> > > > > java.awt.Component.setVisible(Component.java:898)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > > > 45)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > > > ctButton.java:1499)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > > > .java:373)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > > > )
> > > > > > > > > > > >         at
> > > > > > > > > >
> > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > > > )
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > > > >
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > > > >         at
> > > > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > > >         at
> > > > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > > > read.java:126)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > > > ad.java:93)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > >
> > > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > > > > > >         at
> > > > > > > > > >
> > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Praveen
> > > > > > > > > > > >
> > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > > As a general recommendation, I encourage you to
> > > > capture
> > > > > a
> > > > > > > stack
> > > > > > > > > > trace
> > > > > > > > > > > > > for your exceptions.  Just having the exception
> > > > message
> > > > > > > makes it
> > > > > > > > > > > > harder
> > > > > > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > > > > > >
> > > > > > > > > > > > > This particular exception means that a
> > > > > ByteArrayDataSource
> > > > > > > was
> > > > > > > > > > created
> > > > > > > > > > > > > with no data array, such as passing a null for the
> > > > byte
> > > > > > > array.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > > >
> > > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > > Yeah. It works now. Its my bad. Sorry about
> > that.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > BUt I have another problem. When I execute that
> > > > > method, I
> > > > > > > get
> > > > > > > > > > the
> > > > > > > > > > > > > following
> > > > > > > > > > > > > > exception.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > What does this mean? I double checked that my
> > soap
> > > > > method
> > > > > > > exists
> > > > > > > > > > in
> > > > > > > > > > > > > the
> > > > > > > > > > > > > > descriptor and the implementation also exists on
> > the
> > > > > > > server
> > > > > > > > > > side.
> > > > > > > > > > > > But
> > > > > > > > > > > > > the
> > > > > > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Praveen
> > > > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > > > From: "Scott Nichol"
> > <sn...@scottnichol.com>
> > > > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > This sample that I created from you code works
> > for
> > > > > me,
> > > > > > > i.e. it
> > > > > > > > > > > > does
> > > > > > > > > > > > > not
> > > > > > > > > > > > > > > throw an NPE.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > import java.io.*;
> > > > > > > > > > > > > > > import java.util.*;
> > > > > > > > > > > > > > > import java.net.*;
> > > > > > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > > > > > >   try {
> > > > > > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    // Build the call.
> > > > > > > > > > > > > > >    SOAPMappingRegistry smr = new
> > > > > SOAPMappingRegistry();
> > > > > > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > > > > > >
> > call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > > > > > >
> > > > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > > > > > >    DataSource ds = new
> > > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > > > > > >     javax.activation.DataHandler.class, dh,
> > > > null));
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    DataSource ds2 = new
> > > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > > > > > >     dh2, null));
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > > > > > >    Response resp;
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    try {
> > > > > > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > > > > > >     //System.out.println("Response is: " +
> > resp);
> > > > > > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > > > > > >     System.err.println("Caught
> > SOAPException");
> > > > > > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > > > > > >    }
> > > > > > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > > > > > >   }
> > > > > > > > > > > > > > >  }
> > > > > > > > > > > > > > > }
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
Ugh.  I never noticed that the admin GUI does not allow one to specify a
fault listener.

To get to the bottom of this, I wrote my own sample client and service.
I got the "no signature match" error when I passed a null DataHandler,
because the Apache SOAP code serializes a DataHandler as xsd:anyType,
which is always deserialized as an Object.  I am not sure why you do not
still see this message, too.

Anyway, I made a small change to SOAPMappingRegistry so that a null
DataHandler can be properly serialized and de-serialized.  If you pick
up the next nightly build, you will get that change.  Both your client
and server will need the new code.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 11:44 AM
Subject: Re: Urgent: Soap With attachments example


> Even though I have a deployment descriptor and the line
>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
tene
> r> is in a separate line, I deployed the services using the soap admin
> client that apache provided. I got NoClassDefFound errors when I tried
to
> deploy using deployment descriptor.

<<snip>>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Forgot to mention one thing in my last email.
The admin client for deploying soap services does not have any provision for
specifying the faultListener. Probably thats the reason I don't see any
extra info even with fault.toString().
Should I deploy the services using deployment services. I used the following
command but I got errors:
java -classpath
".;xerces-2.0.0.jar;soap-2-2.jar;mail-1.2.jar;activation-1.0.1.jar;jdom1_8.j
ar;saxpath-1.0b8.jar;jaxen-full-1.0b8.jar"
org.apache.soap.server.ServiceManagerClient
http://localhost:7001/soap/servlet/rpcrouter deploy CMISOAPContainerDD.xml

The error I got is:
Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/Node
        at
org.apache.soap.server.ServiceManagerClient.<init>(ServiceManagerClie
nt.java:81)
        at
org.apache.soap.server.ServiceManagerClient.main(ServiceManagerClient
.java:216)

Am I missing any libraries in the classpath.

Praveen
----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 11:44 AM
Subject: Re: Urgent: Soap With attachments example


> Even though I have a deployment descriptor and the line
>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
> r> is in a separate line, I deployed the services using the soap admin
> client that apache provided. I got NoClassDefFound errors when I tried to
> deploy using deployment descriptor.
>
> Here is the trace after the statement you told.
> /***************************************************/
> Uploading ....
> uploadContentObjectUsingAttachments...
> Generated fault:
>   Fault Code   = SOAP-ENV:Client
>   Fault String = Can't yet deserialize non-null Objects
>   Message printed by fault.toString = [Attributes={}]
> [faultCode=SOAP-ENV:Client
> ] [faultString=Can't yet deserialize non-null Objects]
> [faultActorURI=/soap/serv
> let/rpcrouter] [DetailEntries=] [FaultEntries=]
> java.lang.Exception: Can't yet deserialize non-null Objects
>         at
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> entObjectWithAttachments(ContentObjectUtils.java:751)
>         at
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> er.actionPerformed(NewContentObjectDialog.java:275)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> istener.java:211)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at java.awt.Dialog.show(Dialog.java:375)
>         at java.awt.Component.show(Component.java:941)
>         at java.awt.Component.setVisible(Component.java:898)
>         at
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> rmed(SimplexFrame.java:391)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> d(BasicMenuItemUI.java:882)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
>
> /***************************************************/
>
> Praveen
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Wednesday, January 08, 2003 11:15 AM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > To provide more information, could you please add a line of code:
> >
> >     Fault fault = resp.getFault();
> >
> >     System.err.println("Generated fault: ");
> >     System.out.println("  Fault Code   = " + fault.getFaultCode());
> >     System.out.println("  Fault String = " + fault.getFaultString());
> > +++ System.out.println(fault.toString());
> >
> > Also, please be certain the deployment descriptor for the services
> > specifies
> >
> >
> > <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
> > tener>
> >
> > (This should be on a single line, with no whitespace between the element
> > tags.)
> >
> > With this listener, printing fault.toString() on the client should show
> > the stack trace.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Cc: <sn...@scottnichol.com>
> > Sent: Wednesday, January 08, 2003 10:16 AM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > Dear Scott,
> > > I don't do anything special as far as I know. I think the fault is
> > generated
> > > by the apache tool kit.
> > > Let me send you the complete method again. May be its easy to
> > understand
> > > when u look at the full method. If you look at the arguments of my
> > client
> > > method, sourceBytes are never null but thumbBytes are sometimes null.
> > This
> > > is basically the case I am problems in.
> > >
> > > public static String uploadContentObjectWithAttachments(long
> > sessionID,
> > >         String containerID, String title, byte[] sourceBytes,
> > >         String sourceFileName, byte[] thumbBytes, String
> > thumbFileName)
> > >         throws Exception {
> > >          System.out.println("uploadContentObjectUsingAttachments...");
> > >         // Process the arguments.
> > >         URL url = null;
> > >
> > >         String xmlString = "<?xml version=\"1.0\"
> > encoding=\"UTF-8\"?>" +
> > >             "<content>" + "<title>" + title + "</title>" +
> > >             "<source><url><unencoded>" + sourceFileName +
> > >             "</unencoded>  </url></source>";
> > >
> > >         if (thumbFileName != null) {
> > >             xmlString += ("<thumbnail><url><unencoded>" +
> > thumbFileName +
> > >             "</unencoded></url></thumbnail>");
> > >         }
> > >   xmlString += "<categorization>"+
> > >            "<category>My Content/cat1</category>"+
> > >            "<category>My Content/cat2</category>"+
> > >            "<category>My Content/cat3</category>"+
> > >            "</categorization>";
> > >         xmlString += "</content>";
> > >
> > >         try {
> > >             url = new URL(Simplex.getServerURL());
> > >         } catch (MalformedURLException me) {
> > >             System.err.println("MalformedURLException:" +
> > me.getMessage());
> > >         }
> > >
> > >         // Build the call.
> > >         SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > >         Call call = new Call();
> > >
> > >   call.setSOAPMappingRegistry(smr);
> > >         call.setTargetObjectURI("urn:CMISOAPContentService");
> > >         call.setMethodName("uploadContentObject");
> > >         call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > >
> > >         Vector params = new Vector();
> > >         params.addElement(new Parameter("sessionID", long.class,
> > >                 new Long(sessionID), null));
> > >         params.addElement(new Parameter("containerID",
> > > containerID.getClass(),
> > >                 new String(containerID), null));
> > >         params.addElement(new Parameter("xmlString",
> > xmlString.getClass(),
> > >                 new String(xmlString), null));
> > >
> > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >         DataHandler dh = new DataHandler(ds);
> > >         params.addElement(new Parameter("source",
> > >                 javax.activation.DataHandler.class, dh, null));
> > >
> > >         //            params.addElement(new Parameter("encodedSource",
> > > encodedSource.getClass(), new String(encodedSource), null));
> > >         params.addElement(new Parameter("sourceFileName",
> > >                 sourceFileName.getClass(), new String(sourceFileName),
> > > null));
> > >
> > >         if (thumbBytes != null && thumbFileName!=null) {
> > >             ds = new ByteArrayDataSource(thumbBytes,
> > > "application/octet-stream");
> > >             dh = new DataHandler(ds);
> > >             params.addElement(new Parameter("thumb",
> > >                     javax.activation.DataHandler.class, dh, null));
> > >             params.addElement(new Parameter("thumbFileName",
> > >                     thumbFileName.getClass(), new
> > String(thumbFileName),
> > > null));
> > >         } else {
> > >             params.addElement(new Parameter("thumb",
> > >                     javax.activation.DataHandler.class, null, null));
> > >             params.addElement(new Parameter("thumbFileName",
> > >                     new String().getClass(), null, null));
> > >         }
> > >
> > >         call.setParams(params);
> > >
> > >         // Invoke the call.
> > >         Response resp;
> > >
> > >         try {
> > >             resp = call.invoke(url, "");
> > >
> > >             //System.out.println("Response is: " + resp);
> > >         } catch (SOAPException e) {
> > >          e.printStackTrace();
> > >             System.err.println("Caught SOAPException (" +
> > e.getFaultCode() +
> > >                 "): " + e.getMessage());
> > >
> > >             return null;
> > >         }
> > >
> > >         // Check the response.
> > >         if (!resp.generatedFault()) {
> > >             Parameter ret = resp.getReturnValue();
> > >             String encodedString = (String) ret.getValue();
> > >             String decodedString = new
> > String(Base64.decode(encodedString));
> > >
> > >             //  System.out.println("XML String: " + decodedString);
> > >             return decodedString;
> > >         } else {
> > >             Fault fault = resp.getFault();
> > >
> > >             System.err.println("Generated fault: ");
> > >             System.out.println("  Fault Code   = " +
> > fault.getFaultCode());
> > >             System.out.println("  Fault String = " +
> > > fault.getFaultString());
> > >             throw new Exception(fault.getFaultString());
> > >         }
> > >     }
> > >
> > > Praveen
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 6:00 PM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > > Interesting.  Do you do anything special to generate the fault, such
> > as
> > > > registering a fault listener?
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 5:50 PM
> > > > Subject: Re: Urgent: Soap With attachments example
> > > >
> > > >
> > > > I think the exception is not thrown by the invoke() method but a
> > fault
> > > > is generated in the response.
> > > >
> > > > try {
> > > >             resp = call.invoke(url, "");
> > > >
> > > >             //System.out.println("Response is: " + resp);
> > > >         } catch (SOAPException e) {
> > > >          e.printStackTrace();
> > > >             System.err.println("Caught SOAPException (" +
> > > > e.getFaultCode() +
> > > >                 "): " + e.getMessage());
> > > >
> > > >             return null;
> > > >         }
> > > >
> > > >         // Check the response.
> > > >         if (!resp.generatedFault()) {
> > > >             Parameter ret = resp.getReturnValue();
> > > >             String encodedString = (String) ret.getValue();
> > > >             String decodedString = new
> > > > String(Base64.decode(encodedString));
> > > >
> > > >             //  System.out.println("XML String: " + decodedString);
> > > >             return decodedString;
> > > >         } else {
> > > >
> > > >             //this is where the error is traced
> > > >             Fault fault = resp.getFault();
> > > >
> > > >             System.err.println("Generated fault: ");
> > > >             System.out.println("  Fault Code   = " +
> > > > fault.getFaultCode());
> > > >             System.out.println("  Fault String = " +
> > > > fault.getFaultString());
> > > >             throw new Exception(fault.getFaultString());
> > > >         }
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 5:18 PM
> > > > Subject: Re: Urgent: Soap With attachments example
> > > >
> > > >
> > > > > That's odd.  The error message is when deserializing, but the
> > client
> > > > > only deserializes responses.  Is the line at which the exception
> > is
> > > > > thrown doing the Call#invoke?
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 4:56 PM
> > > > > Subject: Re: Urgent: Soap With attachments example
> > > > >
> > > > >
> > > > > > I am sorry about it. I didn't mean to demand the response or
> > > > anything
> > > > > like
> > > > > > that. I am just kind of under pressure and it looked like the
> > > > problem
> > > > > might
> > > > > > be in the soap tool kit (since u said it didn't handler null
> > > > arguments
> > > > > > before).
> > > > > >
> > > > > > But I appreciate your help. You have been a great help to me.
> > > > > >
> > > > > > uploadContentObject returns a base64 encoded string. But it
> > looks
> > > > like
> > > > > the
> > > > > > request doesn't goto the server at all. I can't see the trace on
> > the
> > > > > server
> > > > > > I should have been seen if the request comes in.
> > > > > >
> > > > > > Praveen
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Tuesday, January 07, 2003 4:41 PM
> > > > > > Subject: Re: Urgent: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > What does uploadContentObject return, specifically, what is
> > the
> > > > Java
> > > > > > > type?  If you have provided a mapping for it in the server's
> > > > > deployment
> > > > > > > descriptor, what is the mapping?
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > P.S.: I appreciate that you are probably working on something
> > with
> > > > a
> > > > > > > deadline and require help to move forward, but putting
> > "urgent" in
> > > > > the
> > > > > > > subject and asking me to "look at the error ASAP" is not the
> > > > > greatest
> > > > > > > etiquette for this list.  I am committed to helping Apache
> > SOAP
> > > > > users
> > > > > > > and improving the Apache SOAP code, but I do so as an unpaid
> > > > > volunteer!
> > > > > > > I am also committed to making my mortgage payments ;-), so I
> > > > cannot
> > > > > > > always get to things in a timely manner.  Please try to be
> > > > patient.
> > > > > > > And, if I (or someone else on the list) cannot respond quickly
> > > > > enough,
> > > > > > > there's always the source code available for you to trace
> > through,
> > > > > as
> > > > > > > well.
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Cc: <sn...@scottnichol.com>
> > > > > > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > > > > > Subject: Urgent: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > Hi Scott,
> > > > > > > > Could you please look at the error ASAP and let me know
> > whats
> > > > > wrong in
> > > > > > > my
> > > > > > > > code. I need to fix it ASAP.
> > > > > > > >
> > > > > > > > Thanks in Advance.
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > I updated my jar file with the current jar file that I got
> > > > from
> > > > > the
> > > > > > > > nightly
> > > > > > > > > build. Now this is the error I get when I pass null for
> > > > > DataHandler.
> > > > > > > > >
> > > > > > > > > Uploading ....
> > > > > > > > > uploadContentObjectUsingAttachments...
> > > > > > > > > Generated fault:
> > > > > > > > >   Fault Code   = SOAP-ENV:Client
> > > > > > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > > > > > java.lang.Exception: Can't yet deserialize non-null
> > Objects
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > 45)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > ctButton.java:1499)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > .java:373)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > > istener.java:211)
> > > > > > > > >         at
> > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > >         at
> > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > >         at
> > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > >         at
> > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > >
> > > > > > > > >         at
> > > > > > > >
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > >         at
> > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > read.java:126)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > ad.java:93)
> > > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > > > >         at
> > java.awt.Component.setVisible(Component.java:898)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > 45)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > ctButton.java:1499)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > .java:373)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > > >         at
> > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > >         at
> > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > >         at
> > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > >         at
> > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > >
> > > > > > > > >         at
> > > > > > > >
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > >         at
> > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > read.java:126)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > ad.java:93)
> > > > > > > > >         at
> > > > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > > >         at
> > > > > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > > >
> > > > > > > > > Praveen
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > The newest nightly is right here:
> > > > > > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > > > > > >
> > > > > > > > > > Scott Nichol
> > > > > > > > > >
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > Hey Scott,
> > > > > > > > > > > I could not find a nightly build dated yesterday or
> > today.
> > > > > Could
> > > > > > > you
> > > > > > > > > > please
> > > > > > > > > > > check it out. If not, where can find the insturctions
> > on
> > > > how
> > > > > to
> > > > > > > > > > compile the
> > > > > > > > > > > src, so that I can compile it and use it. Can I just
> > > > replace
> > > > > the
> > > > > > > old
> > > > > > > > > > > MimePartSerializer class file with the new one or do I
> > > > have
> > > > > to
> > > > > > > replece
> > > > > > > > > > the
> > > > > > > > > > > whole jar.
> > > > > > > > > > >
> > > > > > > > > > > Thanks
> > > > > > > > > > >
> > > > > > > > > > > Praveen
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > > This is a "quirk" of the MimePartSerializer.  It is
> > used
> > > > > to
> > > > > > > > > > serialize
> > > > > > > > > > > > InputStream, DataSource, MimeBodyPart and
> > DataHandler.
> > > > > When a
> > > > > > > null
> > > > > > > > > > > > value is passed in for serialization, the serializer
> > > > (for
> > > > > some
> > > > > > > > > > reason)
> > > > > > > > > > > > chooses to serialize it as an Object.  That's why
> > you
> > > > get
> > > > > the
> > > > > > > > > > mismatch.
> > > > > > > > > > > >
> > > > > > > > > > > > I'm going to change the code to use the type
> > specified
> > > > to
> > > > > the
> > > > > > > > > > serializer
> > > > > > > > > > > > when serializing a null.  You can either grab the
> > source
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > > > > > ext/plain), compile it and use it, or wait until
> > > > tomorrow
> > > > > and
> > > > > > > get a
> > > > > > > > > > > > nightly build
> > > > (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > > > > > >
> > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > >
> > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Hi Scott,
> > > > > > > > > > > >
> > > > > > > > > > > > Eveyrthing seems to work fine now, except one minor
> > > > > problem.
> > > > > > > When
> > > > > > > > > > there
> > > > > > > > > > > > is nothing to send as argument I am passing in null
> > and
> > > > > thats
> > > > > > > > > > throwing
> > > > > > > > > > > > exception. Please look at the bold lines of my code
> > > > below.
> > > > > I
> > > > > > > am
> > > > > > > > > > passing
> > > > > > > > > > > > in the type of the argument as
> > > > > > > javax.activation.DataHandler.class,
> > > > > > > > > > but
> > > > > > > > > > > > it still takes it as Object. See the exception after
> > the
> > > > > code.
> > > > > > > Look
> > > > > > > > > > at
> > > > > > > > > > > > the 6th argument of the method. It is assuming the
> > > > object
> > > > > type
> > > > > > > as
> > > > > > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > > > > > >
> > > > > > > > > > > > Vector params = new Vector();
> > > > > > > > > > > >         params.addElement(new Parameter("sessionID",
> > > > > > > long.class,
> > > > > > > > > > > >                 new Long(sessionID), null));
> > > > > > > > > > > >         params.addElement(new
> > Parameter("containerID",
> > > > > > > > > > > > containerID.getClass(),
> > > > > > > > > > > >                 new String(containerID), null));
> > > > > > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > > > > > xmlString.getClass(),
> > > > > > > > > > > >                 new String(xmlString), null));
> > > > > > > > > > > >
> > > > > > > > > > > >         DataSource ds = new
> > > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > > > > > >                 javax.activation.DataHandler.class,
> > dh,
> > > > > > > null));
> > > > > > > > > > > >
> > > > > > > > > > > >         //            params.addElement(new
> > > > > > > > > > Parameter("encodedSource",
> > > > > > > > > > > > encodedSource.getClass(), new String(encodedSource),
> > > > > null));
> > > > > > > > > > > >         params.addElement(new
> > > > Parameter("sourceFileName",
> > > > > > > > > > > >                 sourceFileName.getClass(), new
> > > > > > > > > > String(sourceFileName),
> > > > > > > > > > > > null));
> > > > > > > > > > > >
> > > > > > > > > > > >         if (thumbBytes != null &&
> > thumbFileName!=null) {
> > > > > > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > >             dh = new DataHandler(ds);
> > > > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > > > >
> > javax.activation.DataHandler.class,
> > > > > dh,
> > > > > > > null));
> > > > > > > > > > > >             params.addElement(new
> > > > > Parameter("thumbFileName",
> > > > > > > > > > > >                     thumbFileName.getClass(), new
> > > > > > > > > > String(thumbFileName),
> > > > > > > > > > > > null));
> > > > > > > > > > > >         } else {
> > > > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > > > >
> > javax.activation.DataHandler.class,
> > > > > null,
> > > > > > > > > > null));
> > > > > > > > > > > >             params.addElement(new
> > > > > Parameter("thumbFileName",
> > > > > > > > > > > >                     new String().getClass(), null,
> > > > null));
> > > > > > > > > > > >         }
> > > > > > > > > > > >
> > > > > > > > > > > > Exception trace is as follows:
> > > > > > > > > > > >
> > > > > > > > > > > > Generated fault:
> > > > > > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > > > > > >   Fault String = Exception while handling service
> > > > request:
> > > > > > > > > > > > com.contextmedia.ip.s
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > > > > > ing,java
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > > > > > ect,java
> > > > > > > > > > > > .lang.String) -- no signature match
> > > > > > > > > > > > java.lang.Exception: Exception while handling
> > service
> > > > > request:
> > > > > > > > > > > > com.contextmedia.
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > > > > > .String,
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > > >
> > java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > > > > > .Object,
> > > > > > > > > > > > java.lang.String) -- no signature match
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > > > > >
> > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > > > 45)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > > > ctButton.java:1499)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > > > .java:373)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > > > )
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > > > > > istener.java:211)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > > > )
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > > > >
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > > > >         at
> > > > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > > >         at
> > > > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > > > read.java:126)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > > > ad.java:93)
> > > > > > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > > > > > >         at
> > java.awt.Component.show(Component.java:941)
> > > > > > > > > > > >         at
> > > > > java.awt.Component.setVisible(Component.java:898)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > > > 45)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > > > ctButton.java:1499)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > > > .java:373)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > > > )
> > > > > > > > > > > >         at
> > > > > > > > > >
> > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > > > )
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > > > >
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > > > >         at
> > > > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > > > >         at
> > > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > > >         at
> > > > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > > > read.java:126)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > > > ad.java:93)
> > > > > > > > > > > >         at
> > > > > > > > > > > >
> > > > > > >
> > > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > > > > > >         at
> > > > > > > > > >
> > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Praveen
> > > > > > > > > > > >
> > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > > As a general recommendation, I encourage you to
> > > > capture
> > > > > a
> > > > > > > stack
> > > > > > > > > > trace
> > > > > > > > > > > > > for your exceptions.  Just having the exception
> > > > message
> > > > > > > makes it
> > > > > > > > > > > > harder
> > > > > > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > > > > > >
> > > > > > > > > > > > > This particular exception means that a
> > > > > ByteArrayDataSource
> > > > > > > was
> > > > > > > > > > created
> > > > > > > > > > > > > with no data array, such as passing a null for the
> > > > byte
> > > > > > > array.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > > >
> > > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > > Yeah. It works now. Its my bad. Sorry about
> > that.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > BUt I have another problem. When I execute that
> > > > > method, I
> > > > > > > get
> > > > > > > > > > the
> > > > > > > > > > > > > following
> > > > > > > > > > > > > > exception.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > What does this mean? I double checked that my
> > soap
> > > > > method
> > > > > > > exists
> > > > > > > > > > in
> > > > > > > > > > > > > the
> > > > > > > > > > > > > > descriptor and the implementation also exists on
> > the
> > > > > > > server
> > > > > > > > > > side.
> > > > > > > > > > > > But
> > > > > > > > > > > > > the
> > > > > > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Praveen
> > > > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > > > From: "Scott Nichol"
> > <sn...@scottnichol.com>
> > > > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > This sample that I created from you code works
> > for
> > > > > me,
> > > > > > > i.e. it
> > > > > > > > > > > > does
> > > > > > > > > > > > > not
> > > > > > > > > > > > > > > throw an NPE.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > import java.io.*;
> > > > > > > > > > > > > > > import java.util.*;
> > > > > > > > > > > > > > > import java.net.*;
> > > > > > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > > > > > >   try {
> > > > > > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    // Build the call.
> > > > > > > > > > > > > > >    SOAPMappingRegistry smr = new
> > > > > SOAPMappingRegistry();
> > > > > > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > > > > > >
> > call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > > > > > >
> > > > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > > > > > >    DataSource ds = new
> > > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > > > > > >     javax.activation.DataHandler.class, dh,
> > > > null));
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    DataSource ds2 = new
> > > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > > > > > >     dh2, null));
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > > > > > >    Response resp;
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >    try {
> > > > > > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > > > > > >     //System.out.println("Response is: " +
> > resp);
> > > > > > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > > > > > >     System.err.println("Caught
> > SOAPException");
> > > > > > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > > > > > >    }
> > > > > > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > > > > > >   }
> > > > > > > > > > > > > > >  }
> > > > > > > > > > > > > > > }
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Even though I have a deployment descriptor and the line
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
r> is in a separate line, I deployed the services using the soap admin
client that apache provided. I got NoClassDefFound errors when I tried to
deploy using deployment descriptor.

Here is the trace after the statement you told.
/***************************************************/
Uploading ....
uploadContentObjectUsingAttachments...
Generated fault:
  Fault Code   = SOAP-ENV:Client
  Fault String = Can't yet deserialize non-null Objects
  Message printed by fault.toString = [Attributes={}]
[faultCode=SOAP-ENV:Client
] [faultString=Can't yet deserialize non-null Objects]
[faultActorURI=/soap/serv
let/rpcrouter] [DetailEntries=] [FaultEntries=]
java.lang.Exception: Can't yet deserialize non-null Objects
        at
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
entObjectWithAttachments(ContentObjectUtils.java:751)
        at
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
er.actionPerformed(NewContentObjectDialog.java:275)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:211)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.Dialog.show(Dialog.java:375)
        at java.awt.Component.show(Component.java:941)
        at java.awt.Component.setVisible(Component.java:898)
        at
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
rmed(SimplexFrame.java:391)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
        at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
d(BasicMenuItemUI.java:882)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)

/***************************************************/

Praveen

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 11:15 AM
Subject: Re: Urgent: Soap With attachments example


> To provide more information, could you please add a line of code:
>
>     Fault fault = resp.getFault();
>
>     System.err.println("Generated fault: ");
>     System.out.println("  Fault Code   = " + fault.getFaultCode());
>     System.out.println("  Fault String = " + fault.getFaultString());
> +++ System.out.println(fault.toString());
>
> Also, please be certain the deployment descriptor for the services
> specifies
>
>
> <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
> tener>
>
> (This should be on a single line, with no whitespace between the element
> tags.)
>
> With this listener, printing fault.toString() on the client should show
> the stack trace.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Cc: <sn...@scottnichol.com>
> Sent: Wednesday, January 08, 2003 10:16 AM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > Dear Scott,
> > I don't do anything special as far as I know. I think the fault is
> generated
> > by the apache tool kit.
> > Let me send you the complete method again. May be its easy to
> understand
> > when u look at the full method. If you look at the arguments of my
> client
> > method, sourceBytes are never null but thumbBytes are sometimes null.
> This
> > is basically the case I am problems in.
> >
> > public static String uploadContentObjectWithAttachments(long
> sessionID,
> >         String containerID, String title, byte[] sourceBytes,
> >         String sourceFileName, byte[] thumbBytes, String
> thumbFileName)
> >         throws Exception {
> >          System.out.println("uploadContentObjectUsingAttachments...");
> >         // Process the arguments.
> >         URL url = null;
> >
> >         String xmlString = "<?xml version=\"1.0\"
> encoding=\"UTF-8\"?>" +
> >             "<content>" + "<title>" + title + "</title>" +
> >             "<source><url><unencoded>" + sourceFileName +
> >             "</unencoded>  </url></source>";
> >
> >         if (thumbFileName != null) {
> >             xmlString += ("<thumbnail><url><unencoded>" +
> thumbFileName +
> >             "</unencoded></url></thumbnail>");
> >         }
> >   xmlString += "<categorization>"+
> >            "<category>My Content/cat1</category>"+
> >            "<category>My Content/cat2</category>"+
> >            "<category>My Content/cat3</category>"+
> >            "</categorization>";
> >         xmlString += "</content>";
> >
> >         try {
> >             url = new URL(Simplex.getServerURL());
> >         } catch (MalformedURLException me) {
> >             System.err.println("MalformedURLException:" +
> me.getMessage());
> >         }
> >
> >         // Build the call.
> >         SOAPMappingRegistry smr = new SOAPMappingRegistry();
> >         Call call = new Call();
> >
> >   call.setSOAPMappingRegistry(smr);
> >         call.setTargetObjectURI("urn:CMISOAPContentService");
> >         call.setMethodName("uploadContentObject");
> >         call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> >
> >         Vector params = new Vector();
> >         params.addElement(new Parameter("sessionID", long.class,
> >                 new Long(sessionID), null));
> >         params.addElement(new Parameter("containerID",
> > containerID.getClass(),
> >                 new String(containerID), null));
> >         params.addElement(new Parameter("xmlString",
> xmlString.getClass(),
> >                 new String(xmlString), null));
> >
> >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > "application/octet-stream");
> >         DataHandler dh = new DataHandler(ds);
> >         params.addElement(new Parameter("source",
> >                 javax.activation.DataHandler.class, dh, null));
> >
> >         //            params.addElement(new Parameter("encodedSource",
> > encodedSource.getClass(), new String(encodedSource), null));
> >         params.addElement(new Parameter("sourceFileName",
> >                 sourceFileName.getClass(), new String(sourceFileName),
> > null));
> >
> >         if (thumbBytes != null && thumbFileName!=null) {
> >             ds = new ByteArrayDataSource(thumbBytes,
> > "application/octet-stream");
> >             dh = new DataHandler(ds);
> >             params.addElement(new Parameter("thumb",
> >                     javax.activation.DataHandler.class, dh, null));
> >             params.addElement(new Parameter("thumbFileName",
> >                     thumbFileName.getClass(), new
> String(thumbFileName),
> > null));
> >         } else {
> >             params.addElement(new Parameter("thumb",
> >                     javax.activation.DataHandler.class, null, null));
> >             params.addElement(new Parameter("thumbFileName",
> >                     new String().getClass(), null, null));
> >         }
> >
> >         call.setParams(params);
> >
> >         // Invoke the call.
> >         Response resp;
> >
> >         try {
> >             resp = call.invoke(url, "");
> >
> >             //System.out.println("Response is: " + resp);
> >         } catch (SOAPException e) {
> >          e.printStackTrace();
> >             System.err.println("Caught SOAPException (" +
> e.getFaultCode() +
> >                 "): " + e.getMessage());
> >
> >             return null;
> >         }
> >
> >         // Check the response.
> >         if (!resp.generatedFault()) {
> >             Parameter ret = resp.getReturnValue();
> >             String encodedString = (String) ret.getValue();
> >             String decodedString = new
> String(Base64.decode(encodedString));
> >
> >             //  System.out.println("XML String: " + decodedString);
> >             return decodedString;
> >         } else {
> >             Fault fault = resp.getFault();
> >
> >             System.err.println("Generated fault: ");
> >             System.out.println("  Fault Code   = " +
> fault.getFaultCode());
> >             System.out.println("  Fault String = " +
> > fault.getFaultString());
> >             throw new Exception(fault.getFaultString());
> >         }
> >     }
> >
> > Praveen
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 6:00 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > Interesting.  Do you do anything special to generate the fault, such
> as
> > > registering a fault listener?
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 5:50 PM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > I think the exception is not thrown by the invoke() method but a
> fault
> > > is generated in the response.
> > >
> > > try {
> > >             resp = call.invoke(url, "");
> > >
> > >             //System.out.println("Response is: " + resp);
> > >         } catch (SOAPException e) {
> > >          e.printStackTrace();
> > >             System.err.println("Caught SOAPException (" +
> > > e.getFaultCode() +
> > >                 "): " + e.getMessage());
> > >
> > >             return null;
> > >         }
> > >
> > >         // Check the response.
> > >         if (!resp.generatedFault()) {
> > >             Parameter ret = resp.getReturnValue();
> > >             String encodedString = (String) ret.getValue();
> > >             String decodedString = new
> > > String(Base64.decode(encodedString));
> > >
> > >             //  System.out.println("XML String: " + decodedString);
> > >             return decodedString;
> > >         } else {
> > >
> > >             //this is where the error is traced
> > >             Fault fault = resp.getFault();
> > >
> > >             System.err.println("Generated fault: ");
> > >             System.out.println("  Fault Code   = " +
> > > fault.getFaultCode());
> > >             System.out.println("  Fault String = " +
> > > fault.getFaultString());
> > >             throw new Exception(fault.getFaultString());
> > >         }
> > >
> > >
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 5:18 PM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > > That's odd.  The error message is when deserializing, but the
> client
> > > > only deserializes responses.  Is the line at which the exception
> is
> > > > thrown doing the Call#invoke?
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 4:56 PM
> > > > Subject: Re: Urgent: Soap With attachments example
> > > >
> > > >
> > > > > I am sorry about it. I didn't mean to demand the response or
> > > anything
> > > > like
> > > > > that. I am just kind of under pressure and it looked like the
> > > problem
> > > > might
> > > > > be in the soap tool kit (since u said it didn't handler null
> > > arguments
> > > > > before).
> > > > >
> > > > > But I appreciate your help. You have been a great help to me.
> > > > >
> > > > > uploadContentObject returns a base64 encoded string. But it
> looks
> > > like
> > > > the
> > > > > request doesn't goto the server at all. I can't see the trace on
> the
> > > > server
> > > > > I should have been seen if the request comes in.
> > > > >
> > > > > Praveen
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 4:41 PM
> > > > > Subject: Re: Urgent: Soap With attachments example
> > > > >
> > > > >
> > > > > > What does uploadContentObject return, specifically, what is
> the
> > > Java
> > > > > > type?  If you have provided a mapping for it in the server's
> > > > deployment
> > > > > > descriptor, what is the mapping?
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > P.S.: I appreciate that you are probably working on something
> with
> > > a
> > > > > > deadline and require help to move forward, but putting
> "urgent" in
> > > > the
> > > > > > subject and asking me to "look at the error ASAP" is not the
> > > > greatest
> > > > > > etiquette for this list.  I am committed to helping Apache
> SOAP
> > > > users
> > > > > > and improving the Apache SOAP code, but I do so as an unpaid
> > > > volunteer!
> > > > > > I am also committed to making my mortgage payments ;-), so I
> > > cannot
> > > > > > always get to things in a timely manner.  Please try to be
> > > patient.
> > > > > > And, if I (or someone else on the list) cannot respond quickly
> > > > enough,
> > > > > > there's always the source code available for you to trace
> through,
> > > > as
> > > > > > well.
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Cc: <sn...@scottnichol.com>
> > > > > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > > > > Subject: Urgent: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > Hi Scott,
> > > > > > > Could you please look at the error ASAP and let me know
> whats
> > > > wrong in
> > > > > > my
> > > > > > > code. I need to fix it ASAP.
> > > > > > >
> > > > > > > Thanks in Advance.
> > > > > > >
> > > > > > > Praveen
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > I updated my jar file with the current jar file that I got
> > > from
> > > > the
> > > > > > > nightly
> > > > > > > > build. Now this is the error I get when I pass null for
> > > > DataHandler.
> > > > > > > >
> > > > > > > > Uploading ....
> > > > > > > > uploadContentObjectUsingAttachments...
> > > > > > > > Generated fault:
> > > > > > > >   Fault Code   = SOAP-ENV:Client
> > > > > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > > > > java.lang.Exception: Can't yet deserialize non-null
> Objects
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > istener.java:211)
> > > > > > > >         at
> > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > > >         at
> java.awt.Component.setVisible(Component.java:898)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > >         at
> > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at
> > > > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > >         at
> > > > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > The newest nightly is right here:
> > > > > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > Hey Scott,
> > > > > > > > > > I could not find a nightly build dated yesterday or
> today.
> > > > Could
> > > > > > you
> > > > > > > > > please
> > > > > > > > > > check it out. If not, where can find the insturctions
> on
> > > how
> > > > to
> > > > > > > > > compile the
> > > > > > > > > > src, so that I can compile it and use it. Can I just
> > > replace
> > > > the
> > > > > > old
> > > > > > > > > > MimePartSerializer class file with the new one or do I
> > > have
> > > > to
> > > > > > replece
> > > > > > > > > the
> > > > > > > > > > whole jar.
> > > > > > > > > >
> > > > > > > > > > Thanks
> > > > > > > > > >
> > > > > > > > > > Praveen
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > This is a "quirk" of the MimePartSerializer.  It is
> used
> > > > to
> > > > > > > > > serialize
> > > > > > > > > > > InputStream, DataSource, MimeBodyPart and
> DataHandler.
> > > > When a
> > > > > > null
> > > > > > > > > > > value is passed in for serialization, the serializer
> > > (for
> > > > some
> > > > > > > > > reason)
> > > > > > > > > > > chooses to serialize it as an Object.  That's why
> you
> > > get
> > > > the
> > > > > > > > > mismatch.
> > > > > > > > > > >
> > > > > > > > > > > I'm going to change the code to use the type
> specified
> > > to
> > > > the
> > > > > > > > > serializer
> > > > > > > > > > > when serializing a null.  You can either grab the
> source
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > > > > ext/plain), compile it and use it, or wait until
> > > tomorrow
> > > > and
> > > > > > get a
> > > > > > > > > > > nightly build
> > > (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > > > > >
> > > > > > > > > > > Scott Nichol
> > > > > > > > > > >
> > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Hi Scott,
> > > > > > > > > > >
> > > > > > > > > > > Eveyrthing seems to work fine now, except one minor
> > > > problem.
> > > > > > When
> > > > > > > > > there
> > > > > > > > > > > is nothing to send as argument I am passing in null
> and
> > > > thats
> > > > > > > > > throwing
> > > > > > > > > > > exception. Please look at the bold lines of my code
> > > below.
> > > > I
> > > > > > am
> > > > > > > > > passing
> > > > > > > > > > > in the type of the argument as
> > > > > > javax.activation.DataHandler.class,
> > > > > > > > > but
> > > > > > > > > > > it still takes it as Object. See the exception after
> the
> > > > code.
> > > > > > Look
> > > > > > > > > at
> > > > > > > > > > > the 6th argument of the method. It is assuming the
> > > object
> > > > type
> > > > > > as
> > > > > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > > > > >
> > > > > > > > > > > Vector params = new Vector();
> > > > > > > > > > >         params.addElement(new Parameter("sessionID",
> > > > > > long.class,
> > > > > > > > > > >                 new Long(sessionID), null));
> > > > > > > > > > >         params.addElement(new
> Parameter("containerID",
> > > > > > > > > > > containerID.getClass(),
> > > > > > > > > > >                 new String(containerID), null));
> > > > > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > > > > xmlString.getClass(),
> > > > > > > > > > >                 new String(xmlString), null));
> > > > > > > > > > >
> > > > > > > > > > >         DataSource ds = new
> > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > > > > >                 javax.activation.DataHandler.class,
> dh,
> > > > > > null));
> > > > > > > > > > >
> > > > > > > > > > >         //            params.addElement(new
> > > > > > > > > Parameter("encodedSource",
> > > > > > > > > > > encodedSource.getClass(), new String(encodedSource),
> > > > null));
> > > > > > > > > > >         params.addElement(new
> > > Parameter("sourceFileName",
> > > > > > > > > > >                 sourceFileName.getClass(), new
> > > > > > > > > String(sourceFileName),
> > > > > > > > > > > null));
> > > > > > > > > > >
> > > > > > > > > > >         if (thumbBytes != null &&
> thumbFileName!=null) {
> > > > > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >             dh = new DataHandler(ds);
> > > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > > >
> javax.activation.DataHandler.class,
> > > > dh,
> > > > > > null));
> > > > > > > > > > >             params.addElement(new
> > > > Parameter("thumbFileName",
> > > > > > > > > > >                     thumbFileName.getClass(), new
> > > > > > > > > String(thumbFileName),
> > > > > > > > > > > null));
> > > > > > > > > > >         } else {
> > > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > > >
> javax.activation.DataHandler.class,
> > > > null,
> > > > > > > > > null));
> > > > > > > > > > >             params.addElement(new
> > > > Parameter("thumbFileName",
> > > > > > > > > > >                     new String().getClass(), null,
> > > null));
> > > > > > > > > > >         }
> > > > > > > > > > >
> > > > > > > > > > > Exception trace is as follows:
> > > > > > > > > > >
> > > > > > > > > > > Generated fault:
> > > > > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > > > > >   Fault String = Exception while handling service
> > > request:
> > > > > > > > > > > com.contextmedia.ip.s
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > > > > ing,java
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > > > > ect,java
> > > > > > > > > > > .lang.String) -- no signature match
> > > > > > > > > > > java.lang.Exception: Exception while handling
> service
> > > > request:
> > > > > > > > > > > com.contextmedia.
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > > > > .String,
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > > > > .Object,
> > > > > > > > > > > java.lang.String) -- no signature match
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > > > >
> entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > > 45)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > > ctButton.java:1499)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > > .java:373)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > > )
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > > > > istener.java:211)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > > )
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > > >
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > > >         at
> > > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > >         at
> > > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > > read.java:126)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > > ad.java:93)
> > > > > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > > > > >         at
> java.awt.Component.show(Component.java:941)
> > > > > > > > > > >         at
> > > > java.awt.Component.setVisible(Component.java:898)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > > 45)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > > ctButton.java:1499)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > > .java:373)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > > )
> > > > > > > > > > >         at
> > > > > > > > >
> javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > > )
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > > >
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > > >         at
> > > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > >         at
> > > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > > read.java:126)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > > ad.java:93)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > >
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > > > > >         at
> > > > > > > > >
> > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Praveen
> > > > > > > > > > >
> > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > > As a general recommendation, I encourage you to
> > > capture
> > > > a
> > > > > > stack
> > > > > > > > > trace
> > > > > > > > > > > > for your exceptions.  Just having the exception
> > > message
> > > > > > makes it
> > > > > > > > > > > harder
> > > > > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > > > > >
> > > > > > > > > > > > This particular exception means that a
> > > > ByteArrayDataSource
> > > > > > was
> > > > > > > > > created
> > > > > > > > > > > > with no data array, such as passing a null for the
> > > byte
> > > > > > array.
> > > > > > > > > > > >
> > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > >
> > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > > Yeah. It works now. Its my bad. Sorry about
> that.
> > > > > > > > > > > > >
> > > > > > > > > > > > > BUt I have another problem. When I execute that
> > > > method, I
> > > > > > get
> > > > > > > > > the
> > > > > > > > > > > > following
> > > > > > > > > > > > > exception.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > > > > >
> > > > > > > > > > > > > What does this mean? I double checked that my
> soap
> > > > method
> > > > > > exists
> > > > > > > > > in
> > > > > > > > > > > > the
> > > > > > > > > > > > > descriptor and the implementation also exists on
> the
> > > > > > server
> > > > > > > > > side.
> > > > > > > > > > > But
> > > > > > > > > > > > the
> > > > > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Praveen
> > > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > > From: "Scott Nichol"
> <sn...@scottnichol.com>
> > > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > > This sample that I created from you code works
> for
> > > > me,
> > > > > > i.e. it
> > > > > > > > > > > does
> > > > > > > > > > > > not
> > > > > > > > > > > > > > throw an NPE.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > import java.io.*;
> > > > > > > > > > > > > > import java.util.*;
> > > > > > > > > > > > > > import java.net.*;
> > > > > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > > > > >   try {
> > > > > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    // Build the call.
> > > > > > > > > > > > > >    SOAPMappingRegistry smr = new
> > > > SOAPMappingRegistry();
> > > > > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > > > > >
> call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > > > > >
> > > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > > > > >    DataSource ds = new
> > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > > > > >     javax.activation.DataHandler.class, dh,
> > > null));
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    DataSource ds2 = new
> > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > > > > >     dh2, null));
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > > > > >    Response resp;
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    try {
> > > > > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > > > > >     //System.out.println("Response is: " +
> resp);
> > > > > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > > > > >     System.err.println("Caught
> SOAPException");
> > > > > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > > > > >    }
> > > > > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > > > > >   }
> > > > > > > > > > > > > >  }
> > > > > > > > > > > > > > }
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Even though I have a deployment descriptor and the line
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
r> is in a separate line, I deployed the services using the soap admin
client that apache provided. I got NoClassDefFound errors when I tried to
deploy using deployment descriptor.

Here is the trace after the statement you told.
/***************************************************/
Uploading ....
uploadContentObjectUsingAttachments...
Generated fault:
  Fault Code   = SOAP-ENV:Client
  Fault String = Can't yet deserialize non-null Objects
  Message printed by fault.toString = [Attributes={}]
[faultCode=SOAP-ENV:Client
] [faultString=Can't yet deserialize non-null Objects]
[faultActorURI=/soap/serv
let/rpcrouter] [DetailEntries=] [FaultEntries=]
java.lang.Exception: Can't yet deserialize non-null Objects
        at
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
entObjectWithAttachments(ContentObjectUtils.java:751)
        at
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
er.actionPerformed(NewContentObjectDialog.java:275)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:211)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.Dialog.show(Dialog.java:375)
        at java.awt.Component.show(Component.java:941)
        at java.awt.Component.setVisible(Component.java:898)
        at
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
rmed(SimplexFrame.java:391)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
        at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
d(BasicMenuItemUI.java:882)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)

/***************************************************/

Praveen

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Wednesday, January 08, 2003 11:15 AM
Subject: Re: Urgent: Soap With attachments example


> To provide more information, could you please add a line of code:
>
>     Fault fault = resp.getFault();
>
>     System.err.println("Generated fault: ");
>     System.out.println("  Fault Code   = " + fault.getFaultCode());
>     System.out.println("  Fault String = " + fault.getFaultString());
> +++ System.out.println(fault.toString());
>
> Also, please be certain the deployment descriptor for the services
> specifies
>
>
> <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
> tener>
>
> (This should be on a single line, with no whitespace between the element
> tags.)
>
> With this listener, printing fault.toString() on the client should show
> the stack trace.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Cc: <sn...@scottnichol.com>
> Sent: Wednesday, January 08, 2003 10:16 AM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > Dear Scott,
> > I don't do anything special as far as I know. I think the fault is
> generated
> > by the apache tool kit.
> > Let me send you the complete method again. May be its easy to
> understand
> > when u look at the full method. If you look at the arguments of my
> client
> > method, sourceBytes are never null but thumbBytes are sometimes null.
> This
> > is basically the case I am problems in.
> >
> > public static String uploadContentObjectWithAttachments(long
> sessionID,
> >         String containerID, String title, byte[] sourceBytes,
> >         String sourceFileName, byte[] thumbBytes, String
> thumbFileName)
> >         throws Exception {
> >          System.out.println("uploadContentObjectUsingAttachments...");
> >         // Process the arguments.
> >         URL url = null;
> >
> >         String xmlString = "<?xml version=\"1.0\"
> encoding=\"UTF-8\"?>" +
> >             "<content>" + "<title>" + title + "</title>" +
> >             "<source><url><unencoded>" + sourceFileName +
> >             "</unencoded>  </url></source>";
> >
> >         if (thumbFileName != null) {
> >             xmlString += ("<thumbnail><url><unencoded>" +
> thumbFileName +
> >             "</unencoded></url></thumbnail>");
> >         }
> >   xmlString += "<categorization>"+
> >            "<category>My Content/cat1</category>"+
> >            "<category>My Content/cat2</category>"+
> >            "<category>My Content/cat3</category>"+
> >            "</categorization>";
> >         xmlString += "</content>";
> >
> >         try {
> >             url = new URL(Simplex.getServerURL());
> >         } catch (MalformedURLException me) {
> >             System.err.println("MalformedURLException:" +
> me.getMessage());
> >         }
> >
> >         // Build the call.
> >         SOAPMappingRegistry smr = new SOAPMappingRegistry();
> >         Call call = new Call();
> >
> >   call.setSOAPMappingRegistry(smr);
> >         call.setTargetObjectURI("urn:CMISOAPContentService");
> >         call.setMethodName("uploadContentObject");
> >         call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> >
> >         Vector params = new Vector();
> >         params.addElement(new Parameter("sessionID", long.class,
> >                 new Long(sessionID), null));
> >         params.addElement(new Parameter("containerID",
> > containerID.getClass(),
> >                 new String(containerID), null));
> >         params.addElement(new Parameter("xmlString",
> xmlString.getClass(),
> >                 new String(xmlString), null));
> >
> >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > "application/octet-stream");
> >         DataHandler dh = new DataHandler(ds);
> >         params.addElement(new Parameter("source",
> >                 javax.activation.DataHandler.class, dh, null));
> >
> >         //            params.addElement(new Parameter("encodedSource",
> > encodedSource.getClass(), new String(encodedSource), null));
> >         params.addElement(new Parameter("sourceFileName",
> >                 sourceFileName.getClass(), new String(sourceFileName),
> > null));
> >
> >         if (thumbBytes != null && thumbFileName!=null) {
> >             ds = new ByteArrayDataSource(thumbBytes,
> > "application/octet-stream");
> >             dh = new DataHandler(ds);
> >             params.addElement(new Parameter("thumb",
> >                     javax.activation.DataHandler.class, dh, null));
> >             params.addElement(new Parameter("thumbFileName",
> >                     thumbFileName.getClass(), new
> String(thumbFileName),
> > null));
> >         } else {
> >             params.addElement(new Parameter("thumb",
> >                     javax.activation.DataHandler.class, null, null));
> >             params.addElement(new Parameter("thumbFileName",
> >                     new String().getClass(), null, null));
> >         }
> >
> >         call.setParams(params);
> >
> >         // Invoke the call.
> >         Response resp;
> >
> >         try {
> >             resp = call.invoke(url, "");
> >
> >             //System.out.println("Response is: " + resp);
> >         } catch (SOAPException e) {
> >          e.printStackTrace();
> >             System.err.println("Caught SOAPException (" +
> e.getFaultCode() +
> >                 "): " + e.getMessage());
> >
> >             return null;
> >         }
> >
> >         // Check the response.
> >         if (!resp.generatedFault()) {
> >             Parameter ret = resp.getReturnValue();
> >             String encodedString = (String) ret.getValue();
> >             String decodedString = new
> String(Base64.decode(encodedString));
> >
> >             //  System.out.println("XML String: " + decodedString);
> >             return decodedString;
> >         } else {
> >             Fault fault = resp.getFault();
> >
> >             System.err.println("Generated fault: ");
> >             System.out.println("  Fault Code   = " +
> fault.getFaultCode());
> >             System.out.println("  Fault String = " +
> > fault.getFaultString());
> >             throw new Exception(fault.getFaultString());
> >         }
> >     }
> >
> > Praveen
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 6:00 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > Interesting.  Do you do anything special to generate the fault, such
> as
> > > registering a fault listener?
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 5:50 PM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > I think the exception is not thrown by the invoke() method but a
> fault
> > > is generated in the response.
> > >
> > > try {
> > >             resp = call.invoke(url, "");
> > >
> > >             //System.out.println("Response is: " + resp);
> > >         } catch (SOAPException e) {
> > >          e.printStackTrace();
> > >             System.err.println("Caught SOAPException (" +
> > > e.getFaultCode() +
> > >                 "): " + e.getMessage());
> > >
> > >             return null;
> > >         }
> > >
> > >         // Check the response.
> > >         if (!resp.generatedFault()) {
> > >             Parameter ret = resp.getReturnValue();
> > >             String encodedString = (String) ret.getValue();
> > >             String decodedString = new
> > > String(Base64.decode(encodedString));
> > >
> > >             //  System.out.println("XML String: " + decodedString);
> > >             return decodedString;
> > >         } else {
> > >
> > >             //this is where the error is traced
> > >             Fault fault = resp.getFault();
> > >
> > >             System.err.println("Generated fault: ");
> > >             System.out.println("  Fault Code   = " +
> > > fault.getFaultCode());
> > >             System.out.println("  Fault String = " +
> > > fault.getFaultString());
> > >             throw new Exception(fault.getFaultString());
> > >         }
> > >
> > >
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 5:18 PM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > > That's odd.  The error message is when deserializing, but the
> client
> > > > only deserializes responses.  Is the line at which the exception
> is
> > > > thrown doing the Call#invoke?
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 4:56 PM
> > > > Subject: Re: Urgent: Soap With attachments example
> > > >
> > > >
> > > > > I am sorry about it. I didn't mean to demand the response or
> > > anything
> > > > like
> > > > > that. I am just kind of under pressure and it looked like the
> > > problem
> > > > might
> > > > > be in the soap tool kit (since u said it didn't handler null
> > > arguments
> > > > > before).
> > > > >
> > > > > But I appreciate your help. You have been a great help to me.
> > > > >
> > > > > uploadContentObject returns a base64 encoded string. But it
> looks
> > > like
> > > > the
> > > > > request doesn't goto the server at all. I can't see the trace on
> the
> > > > server
> > > > > I should have been seen if the request comes in.
> > > > >
> > > > > Praveen
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 4:41 PM
> > > > > Subject: Re: Urgent: Soap With attachments example
> > > > >
> > > > >
> > > > > > What does uploadContentObject return, specifically, what is
> the
> > > Java
> > > > > > type?  If you have provided a mapping for it in the server's
> > > > deployment
> > > > > > descriptor, what is the mapping?
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > P.S.: I appreciate that you are probably working on something
> with
> > > a
> > > > > > deadline and require help to move forward, but putting
> "urgent" in
> > > > the
> > > > > > subject and asking me to "look at the error ASAP" is not the
> > > > greatest
> > > > > > etiquette for this list.  I am committed to helping Apache
> SOAP
> > > > users
> > > > > > and improving the Apache SOAP code, but I do so as an unpaid
> > > > volunteer!
> > > > > > I am also committed to making my mortgage payments ;-), so I
> > > cannot
> > > > > > always get to things in a timely manner.  Please try to be
> > > patient.
> > > > > > And, if I (or someone else on the list) cannot respond quickly
> > > > enough,
> > > > > > there's always the source code available for you to trace
> through,
> > > > as
> > > > > > well.
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Cc: <sn...@scottnichol.com>
> > > > > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > > > > Subject: Urgent: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > Hi Scott,
> > > > > > > Could you please look at the error ASAP and let me know
> whats
> > > > wrong in
> > > > > > my
> > > > > > > code. I need to fix it ASAP.
> > > > > > >
> > > > > > > Thanks in Advance.
> > > > > > >
> > > > > > > Praveen
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > I updated my jar file with the current jar file that I got
> > > from
> > > > the
> > > > > > > nightly
> > > > > > > > build. Now this is the error I get when I pass null for
> > > > DataHandler.
> > > > > > > >
> > > > > > > > Uploading ....
> > > > > > > > uploadContentObjectUsingAttachments...
> > > > > > > > Generated fault:
> > > > > > > >   Fault Code   = SOAP-ENV:Client
> > > > > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > > > > java.lang.Exception: Can't yet deserialize non-null
> Objects
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > istener.java:211)
> > > > > > > >         at
> > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > > >         at
> java.awt.Component.setVisible(Component.java:898)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > >         at
> > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at
> > > > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > >         at
> > > > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > The newest nightly is right here:
> > > > > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > Hey Scott,
> > > > > > > > > > I could not find a nightly build dated yesterday or
> today.
> > > > Could
> > > > > > you
> > > > > > > > > please
> > > > > > > > > > check it out. If not, where can find the insturctions
> on
> > > how
> > > > to
> > > > > > > > > compile the
> > > > > > > > > > src, so that I can compile it and use it. Can I just
> > > replace
> > > > the
> > > > > > old
> > > > > > > > > > MimePartSerializer class file with the new one or do I
> > > have
> > > > to
> > > > > > replece
> > > > > > > > > the
> > > > > > > > > > whole jar.
> > > > > > > > > >
> > > > > > > > > > Thanks
> > > > > > > > > >
> > > > > > > > > > Praveen
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > This is a "quirk" of the MimePartSerializer.  It is
> used
> > > > to
> > > > > > > > > serialize
> > > > > > > > > > > InputStream, DataSource, MimeBodyPart and
> DataHandler.
> > > > When a
> > > > > > null
> > > > > > > > > > > value is passed in for serialization, the serializer
> > > (for
> > > > some
> > > > > > > > > reason)
> > > > > > > > > > > chooses to serialize it as an Object.  That's why
> you
> > > get
> > > > the
> > > > > > > > > mismatch.
> > > > > > > > > > >
> > > > > > > > > > > I'm going to change the code to use the type
> specified
> > > to
> > > > the
> > > > > > > > > serializer
> > > > > > > > > > > when serializing a null.  You can either grab the
> source
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > > > > ext/plain), compile it and use it, or wait until
> > > tomorrow
> > > > and
> > > > > > get a
> > > > > > > > > > > nightly build
> > > (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > > > > >
> > > > > > > > > > > Scott Nichol
> > > > > > > > > > >
> > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Hi Scott,
> > > > > > > > > > >
> > > > > > > > > > > Eveyrthing seems to work fine now, except one minor
> > > > problem.
> > > > > > When
> > > > > > > > > there
> > > > > > > > > > > is nothing to send as argument I am passing in null
> and
> > > > thats
> > > > > > > > > throwing
> > > > > > > > > > > exception. Please look at the bold lines of my code
> > > below.
> > > > I
> > > > > > am
> > > > > > > > > passing
> > > > > > > > > > > in the type of the argument as
> > > > > > javax.activation.DataHandler.class,
> > > > > > > > > but
> > > > > > > > > > > it still takes it as Object. See the exception after
> the
> > > > code.
> > > > > > Look
> > > > > > > > > at
> > > > > > > > > > > the 6th argument of the method. It is assuming the
> > > object
> > > > type
> > > > > > as
> > > > > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > > > > >
> > > > > > > > > > > Vector params = new Vector();
> > > > > > > > > > >         params.addElement(new Parameter("sessionID",
> > > > > > long.class,
> > > > > > > > > > >                 new Long(sessionID), null));
> > > > > > > > > > >         params.addElement(new
> Parameter("containerID",
> > > > > > > > > > > containerID.getClass(),
> > > > > > > > > > >                 new String(containerID), null));
> > > > > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > > > > xmlString.getClass(),
> > > > > > > > > > >                 new String(xmlString), null));
> > > > > > > > > > >
> > > > > > > > > > >         DataSource ds = new
> > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > > > > >                 javax.activation.DataHandler.class,
> dh,
> > > > > > null));
> > > > > > > > > > >
> > > > > > > > > > >         //            params.addElement(new
> > > > > > > > > Parameter("encodedSource",
> > > > > > > > > > > encodedSource.getClass(), new String(encodedSource),
> > > > null));
> > > > > > > > > > >         params.addElement(new
> > > Parameter("sourceFileName",
> > > > > > > > > > >                 sourceFileName.getClass(), new
> > > > > > > > > String(sourceFileName),
> > > > > > > > > > > null));
> > > > > > > > > > >
> > > > > > > > > > >         if (thumbBytes != null &&
> thumbFileName!=null) {
> > > > > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >             dh = new DataHandler(ds);
> > > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > > >
> javax.activation.DataHandler.class,
> > > > dh,
> > > > > > null));
> > > > > > > > > > >             params.addElement(new
> > > > Parameter("thumbFileName",
> > > > > > > > > > >                     thumbFileName.getClass(), new
> > > > > > > > > String(thumbFileName),
> > > > > > > > > > > null));
> > > > > > > > > > >         } else {
> > > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > > >
> javax.activation.DataHandler.class,
> > > > null,
> > > > > > > > > null));
> > > > > > > > > > >             params.addElement(new
> > > > Parameter("thumbFileName",
> > > > > > > > > > >                     new String().getClass(), null,
> > > null));
> > > > > > > > > > >         }
> > > > > > > > > > >
> > > > > > > > > > > Exception trace is as follows:
> > > > > > > > > > >
> > > > > > > > > > > Generated fault:
> > > > > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > > > > >   Fault String = Exception while handling service
> > > request:
> > > > > > > > > > > com.contextmedia.ip.s
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > > > > ing,java
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > > > > ect,java
> > > > > > > > > > > .lang.String) -- no signature match
> > > > > > > > > > > java.lang.Exception: Exception while handling
> service
> > > > request:
> > > > > > > > > > > com.contextmedia.
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > > > > .String,
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> > >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > > > > .Object,
> > > > > > > > > > > java.lang.String) -- no signature match
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > > > >
> entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > > 45)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > > ctButton.java:1499)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > > .java:373)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > > )
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > > > > istener.java:211)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > > )
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > > >
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > > >         at
> > > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > >         at
> > > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > > read.java:126)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > > ad.java:93)
> > > > > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > > > > >         at
> java.awt.Component.show(Component.java:941)
> > > > > > > > > > >         at
> > > > java.awt.Component.setVisible(Component.java:898)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > > 45)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > > ctButton.java:1499)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > > .java:373)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > > )
> > > > > > > > > > >         at
> > > > > > > > >
> javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > > )
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > > >
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > > >         at
> > > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > > >         at
> > > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > > >         at
> > > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > > >         at
> > > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > > read.java:126)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > > ad.java:93)
> > > > > > > > > > >         at
> > > > > > > > > > >
> > > > > >
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > > > > >         at
> > > > > > > > >
> > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Praveen
> > > > > > > > > > >
> > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > > As a general recommendation, I encourage you to
> > > capture
> > > > a
> > > > > > stack
> > > > > > > > > trace
> > > > > > > > > > > > for your exceptions.  Just having the exception
> > > message
> > > > > > makes it
> > > > > > > > > > > harder
> > > > > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > > > > >
> > > > > > > > > > > > This particular exception means that a
> > > > ByteArrayDataSource
> > > > > > was
> > > > > > > > > created
> > > > > > > > > > > > with no data array, such as passing a null for the
> > > byte
> > > > > > array.
> > > > > > > > > > > >
> > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > >
> > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > > Yeah. It works now. Its my bad. Sorry about
> that.
> > > > > > > > > > > > >
> > > > > > > > > > > > > BUt I have another problem. When I execute that
> > > > method, I
> > > > > > get
> > > > > > > > > the
> > > > > > > > > > > > following
> > > > > > > > > > > > > exception.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > > > > >
> > > > > > > > > > > > > What does this mean? I double checked that my
> soap
> > > > method
> > > > > > exists
> > > > > > > > > in
> > > > > > > > > > > > the
> > > > > > > > > > > > > descriptor and the implementation also exists on
> the
> > > > > > server
> > > > > > > > > side.
> > > > > > > > > > > But
> > > > > > > > > > > > the
> > > > > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Praveen
> > > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > > From: "Scott Nichol"
> <sn...@scottnichol.com>
> > > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > > This sample that I created from you code works
> for
> > > > me,
> > > > > > i.e. it
> > > > > > > > > > > does
> > > > > > > > > > > > not
> > > > > > > > > > > > > > throw an NPE.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > import java.io.*;
> > > > > > > > > > > > > > import java.util.*;
> > > > > > > > > > > > > > import java.net.*;
> > > > > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > > > > >   try {
> > > > > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    // Build the call.
> > > > > > > > > > > > > >    SOAPMappingRegistry smr = new
> > > > SOAPMappingRegistry();
> > > > > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > > > > >
> call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > > > > >
> > > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > > > > >    DataSource ds = new
> > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > > > > >     javax.activation.DataHandler.class, dh,
> > > null));
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    DataSource ds2 = new
> > > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > > > > >     dh2, null));
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > > > > >    Response resp;
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >    try {
> > > > > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > > > > >     //System.out.println("Response is: " +
> resp);
> > > > > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > > > > >     System.err.println("Caught
> SOAPException");
> > > > > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > > > > >    }
> > > > > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > > > > >   }
> > > > > > > > > > > > > >  }
> > > > > > > > > > > > > > }
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
To provide more information, could you please add a line of code:

    Fault fault = resp.getFault();

    System.err.println("Generated fault: ");
    System.out.println("  Fault Code   = " + fault.getFaultCode());
    System.out.println("  Fault String = " + fault.getFaultString());
+++ System.out.println(fault.toString());

Also, please be certain the deployment descriptor for the services
specifies


<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
tener>

(This should be on a single line, with no whitespace between the element
tags.)

With this listener, printing fault.toString() on the client should show
the stack trace.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Cc: <sn...@scottnichol.com>
Sent: Wednesday, January 08, 2003 10:16 AM
Subject: Re: Urgent: Soap With attachments example


> Dear Scott,
> I don't do anything special as far as I know. I think the fault is
generated
> by the apache tool kit.
> Let me send you the complete method again. May be its easy to
understand
> when u look at the full method. If you look at the arguments of my
client
> method, sourceBytes are never null but thumbBytes are sometimes null.
This
> is basically the case I am problems in.
>
> public static String uploadContentObjectWithAttachments(long
sessionID,
>         String containerID, String title, byte[] sourceBytes,
>         String sourceFileName, byte[] thumbBytes, String
thumbFileName)
>         throws Exception {
>          System.out.println("uploadContentObjectUsingAttachments...");
>         // Process the arguments.
>         URL url = null;
>
>         String xmlString = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>" +
>             "<content>" + "<title>" + title + "</title>" +
>             "<source><url><unencoded>" + sourceFileName +
>             "</unencoded>  </url></source>";
>
>         if (thumbFileName != null) {
>             xmlString += ("<thumbnail><url><unencoded>" +
thumbFileName +
>             "</unencoded></url></thumbnail>");
>         }
>   xmlString += "<categorization>"+
>            "<category>My Content/cat1</category>"+
>            "<category>My Content/cat2</category>"+
>            "<category>My Content/cat3</category>"+
>            "</categorization>";
>         xmlString += "</content>";
>
>         try {
>             url = new URL(Simplex.getServerURL());
>         } catch (MalformedURLException me) {
>             System.err.println("MalformedURLException:" +
me.getMessage());
>         }
>
>         // Build the call.
>         SOAPMappingRegistry smr = new SOAPMappingRegistry();
>         Call call = new Call();
>
>   call.setSOAPMappingRegistry(smr);
>         call.setTargetObjectURI("urn:CMISOAPContentService");
>         call.setMethodName("uploadContentObject");
>         call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
>
>         Vector params = new Vector();
>         params.addElement(new Parameter("sessionID", long.class,
>                 new Long(sessionID), null));
>         params.addElement(new Parameter("containerID",
> containerID.getClass(),
>                 new String(containerID), null));
>         params.addElement(new Parameter("xmlString",
xmlString.getClass(),
>                 new String(xmlString), null));
>
>         DataSource ds = new ByteArrayDataSource(sourceBytes,
> "application/octet-stream");
>         DataHandler dh = new DataHandler(ds);
>         params.addElement(new Parameter("source",
>                 javax.activation.DataHandler.class, dh, null));
>
>         //            params.addElement(new Parameter("encodedSource",
> encodedSource.getClass(), new String(encodedSource), null));
>         params.addElement(new Parameter("sourceFileName",
>                 sourceFileName.getClass(), new String(sourceFileName),
> null));
>
>         if (thumbBytes != null && thumbFileName!=null) {
>             ds = new ByteArrayDataSource(thumbBytes,
> "application/octet-stream");
>             dh = new DataHandler(ds);
>             params.addElement(new Parameter("thumb",
>                     javax.activation.DataHandler.class, dh, null));
>             params.addElement(new Parameter("thumbFileName",
>                     thumbFileName.getClass(), new
String(thumbFileName),
> null));
>         } else {
>             params.addElement(new Parameter("thumb",
>                     javax.activation.DataHandler.class, null, null));
>             params.addElement(new Parameter("thumbFileName",
>                     new String().getClass(), null, null));
>         }
>
>         call.setParams(params);
>
>         // Invoke the call.
>         Response resp;
>
>         try {
>             resp = call.invoke(url, "");
>
>             //System.out.println("Response is: " + resp);
>         } catch (SOAPException e) {
>          e.printStackTrace();
>             System.err.println("Caught SOAPException (" +
e.getFaultCode() +
>                 "): " + e.getMessage());
>
>             return null;
>         }
>
>         // Check the response.
>         if (!resp.generatedFault()) {
>             Parameter ret = resp.getReturnValue();
>             String encodedString = (String) ret.getValue();
>             String decodedString = new
String(Base64.decode(encodedString));
>
>             //  System.out.println("XML String: " + decodedString);
>             return decodedString;
>         } else {
>             Fault fault = resp.getFault();
>
>             System.err.println("Generated fault: ");
>             System.out.println("  Fault Code   = " +
fault.getFaultCode());
>             System.out.println("  Fault String = " +
> fault.getFaultString());
>             throw new Exception(fault.getFaultString());
>         }
>     }
>
> Praveen
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 6:00 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > Interesting.  Do you do anything special to generate the fault, such
as
> > registering a fault listener?
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 5:50 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > I think the exception is not thrown by the invoke() method but a
fault
> > is generated in the response.
> >
> > try {
> >             resp = call.invoke(url, "");
> >
> >             //System.out.println("Response is: " + resp);
> >         } catch (SOAPException e) {
> >          e.printStackTrace();
> >             System.err.println("Caught SOAPException (" +
> > e.getFaultCode() +
> >                 "): " + e.getMessage());
> >
> >             return null;
> >         }
> >
> >         // Check the response.
> >         if (!resp.generatedFault()) {
> >             Parameter ret = resp.getReturnValue();
> >             String encodedString = (String) ret.getValue();
> >             String decodedString = new
> > String(Base64.decode(encodedString));
> >
> >             //  System.out.println("XML String: " + decodedString);
> >             return decodedString;
> >         } else {
> >
> >             //this is where the error is traced
> >             Fault fault = resp.getFault();
> >
> >             System.err.println("Generated fault: ");
> >             System.out.println("  Fault Code   = " +
> > fault.getFaultCode());
> >             System.out.println("  Fault String = " +
> > fault.getFaultString());
> >             throw new Exception(fault.getFaultString());
> >         }
> >
> >
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 5:18 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > That's odd.  The error message is when deserializing, but the
client
> > > only deserializes responses.  Is the line at which the exception
is
> > > thrown doing the Call#invoke?
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 4:56 PM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > > I am sorry about it. I didn't mean to demand the response or
> > anything
> > > like
> > > > that. I am just kind of under pressure and it looked like the
> > problem
> > > might
> > > > be in the soap tool kit (since u said it didn't handler null
> > arguments
> > > > before).
> > > >
> > > > But I appreciate your help. You have been a great help to me.
> > > >
> > > > uploadContentObject returns a base64 encoded string. But it
looks
> > like
> > > the
> > > > request doesn't goto the server at all. I can't see the trace on
the
> > > server
> > > > I should have been seen if the request comes in.
> > > >
> > > > Praveen
> > > >
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 4:41 PM
> > > > Subject: Re: Urgent: Soap With attachments example
> > > >
> > > >
> > > > > What does uploadContentObject return, specifically, what is
the
> > Java
> > > > > type?  If you have provided a mapping for it in the server's
> > > deployment
> > > > > descriptor, what is the mapping?
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > P.S.: I appreciate that you are probably working on something
with
> > a
> > > > > deadline and require help to move forward, but putting
"urgent" in
> > > the
> > > > > subject and asking me to "look at the error ASAP" is not the
> > > greatest
> > > > > etiquette for this list.  I am committed to helping Apache
SOAP
> > > users
> > > > > and improving the Apache SOAP code, but I do so as an unpaid
> > > volunteer!
> > > > > I am also committed to making my mortgage payments ;-), so I
> > cannot
> > > > > always get to things in a timely manner.  Please try to be
> > patient.
> > > > > And, if I (or someone else on the list) cannot respond quickly
> > > enough,
> > > > > there's always the source code available for you to trace
through,
> > > as
> > > > > well.
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Cc: <sn...@scottnichol.com>
> > > > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > > > Subject: Urgent: Soap With attachments example
> > > > >
> > > > >
> > > > > > Hi Scott,
> > > > > > Could you please look at the error ASAP and let me know
whats
> > > wrong in
> > > > > my
> > > > > > code. I need to fix it ASAP.
> > > > > >
> > > > > > Thanks in Advance.
> > > > > >
> > > > > > Praveen
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > I updated my jar file with the current jar file that I got
> > from
> > > the
> > > > > > nightly
> > > > > > > build. Now this is the error I get when I pass null for
> > > DataHandler.
> > > > > > >
> > > > > > > Uploading ....
> > > > > > > uploadContentObjectUsingAttachments...
> > > > > > > Generated fault:
> > > > > > >   Fault Code   = SOAP-ENV:Client
> > > > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > > > java.lang.Exception: Can't yet deserialize non-null
Objects
> > > > > > >         at
> > > > > > >
> > > > >
> > >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > 45)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > ctButton.java:1499)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > .java:373)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > istener.java:211)
> > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > >         at
> > java.awt.Component.processEvent(Component.java:3539)
> > > > > > >         at
> > java.awt.Container.processEvent(Container.java:1159)
> > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > >
> > > > > > >         at
> > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > >         at
java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > read.java:126)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > ad.java:93)
> > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > >         at
java.awt.Component.setVisible(Component.java:898)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > rmed(SimplexFrame.java:391)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > 45)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > ctButton.java:1499)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > .java:373)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > )
> > > > > > >         at
> > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > >         at
> > java.awt.Component.processEvent(Component.java:3539)
> > > > > > >         at
> > java.awt.Container.processEvent(Container.java:1159)
> > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > >
> > > > > > >         at
> > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > >         at
java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > read.java:126)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > ad.java:93)
> > > > > > >         at
> > > > > > >
> > >
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > >         at
> > > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > >
> > > > > > > Praveen
> > > > > > > ----- Original Message -----
> > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > The newest nightly is right here:
> > > > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > > > >
> > > > > > > > Scott Nichol
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > Hey Scott,
> > > > > > > > > I could not find a nightly build dated yesterday or
today.
> > > Could
> > > > > you
> > > > > > > > please
> > > > > > > > > check it out. If not, where can find the insturctions
on
> > how
> > > to
> > > > > > > > compile the
> > > > > > > > > src, so that I can compile it and use it. Can I just
> > replace
> > > the
> > > > > old
> > > > > > > > > MimePartSerializer class file with the new one or do I
> > have
> > > to
> > > > > replece
> > > > > > > > the
> > > > > > > > > whole jar.
> > > > > > > > >
> > > > > > > > > Thanks
> > > > > > > > >
> > > > > > > > > Praveen
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > This is a "quirk" of the MimePartSerializer.  It is
used
> > > to
> > > > > > > > serialize
> > > > > > > > > > InputStream, DataSource, MimeBodyPart and
DataHandler.
> > > When a
> > > > > null
> > > > > > > > > > value is passed in for serialization, the serializer
> > (for
> > > some
> > > > > > > > reason)
> > > > > > > > > > chooses to serialize it as an Object.  That's why
you
> > get
> > > the
> > > > > > > > mismatch.
> > > > > > > > > >
> > > > > > > > > > I'm going to change the code to use the type
specified
> > to
> > > the
> > > > > > > > serializer
> > > > > > > > > > when serializing a null.  You can either grab the
source
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > > > ext/plain), compile it and use it, or wait until
> > tomorrow
> > > and
> > > > > get a
> > > > > > > > > > nightly build
> > (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > > > >
> > > > > > > > > > Scott Nichol
> > > > > > > > > >
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hi Scott,
> > > > > > > > > >
> > > > > > > > > > Eveyrthing seems to work fine now, except one minor
> > > problem.
> > > > > When
> > > > > > > > there
> > > > > > > > > > is nothing to send as argument I am passing in null
and
> > > thats
> > > > > > > > throwing
> > > > > > > > > > exception. Please look at the bold lines of my code
> > below.
> > > I
> > > > > am
> > > > > > > > passing
> > > > > > > > > > in the type of the argument as
> > > > > javax.activation.DataHandler.class,
> > > > > > > > but
> > > > > > > > > > it still takes it as Object. See the exception after
the
> > > code.
> > > > > Look
> > > > > > > > at
> > > > > > > > > > the 6th argument of the method. It is assuming the
> > object
> > > type
> > > > > as
> > > > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > > > >
> > > > > > > > > > Vector params = new Vector();
> > > > > > > > > >         params.addElement(new Parameter("sessionID",
> > > > > long.class,
> > > > > > > > > >                 new Long(sessionID), null));
> > > > > > > > > >         params.addElement(new
Parameter("containerID",
> > > > > > > > > > containerID.getClass(),
> > > > > > > > > >                 new String(containerID), null));
> > > > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > > > xmlString.getClass(),
> > > > > > > > > >                 new String(xmlString), null));
> > > > > > > > > >
> > > > > > > > > >         DataSource ds = new
> > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > "application/octet-stream");
> > > > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > > > >                 javax.activation.DataHandler.class,
dh,
> > > > > null));
> > > > > > > > > >
> > > > > > > > > >         //            params.addElement(new
> > > > > > > > Parameter("encodedSource",
> > > > > > > > > > encodedSource.getClass(), new String(encodedSource),
> > > null));
> > > > > > > > > >         params.addElement(new
> > Parameter("sourceFileName",
> > > > > > > > > >                 sourceFileName.getClass(), new
> > > > > > > > String(sourceFileName),
> > > > > > > > > > null));
> > > > > > > > > >
> > > > > > > > > >         if (thumbBytes != null &&
thumbFileName!=null) {
> > > > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > > > "application/octet-stream");
> > > > > > > > > >             dh = new DataHandler(ds);
> > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > >
javax.activation.DataHandler.class,
> > > dh,
> > > > > null));
> > > > > > > > > >             params.addElement(new
> > > Parameter("thumbFileName",
> > > > > > > > > >                     thumbFileName.getClass(), new
> > > > > > > > String(thumbFileName),
> > > > > > > > > > null));
> > > > > > > > > >         } else {
> > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > >
javax.activation.DataHandler.class,
> > > null,
> > > > > > > > null));
> > > > > > > > > >             params.addElement(new
> > > Parameter("thumbFileName",
> > > > > > > > > >                     new String().getClass(), null,
> > null));
> > > > > > > > > >         }
> > > > > > > > > >
> > > > > > > > > > Exception trace is as follows:
> > > > > > > > > >
> > > > > > > > > > Generated fault:
> > > > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > > > >   Fault String = Exception while handling service
> > request:
> > > > > > > > > > com.contextmedia.ip.s
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > > > ing,java
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > > > ect,java
> > > > > > > > > > .lang.String) -- no signature match
> > > > > > > > > > java.lang.Exception: Exception while handling
service
> > > request:
> > > > > > > > > > com.contextmedia.
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > > > .String,
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > > > .Object,
> > > > > > > > > > java.lang.String) -- no signature match
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > > >
entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > 45)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > ctButton.java:1499)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > .java:373)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > )
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > > > istener.java:211)
> > > > > > > > > >         at
> > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > >         at
> > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > >         at
> > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > )
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > >
> > > > > > > > > >         at
> > > > > > > > > >
> > > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > >         at
> > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > >         at
> > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > read.java:126)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > ad.java:93)
> > > > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > > > >         at
java.awt.Component.show(Component.java:941)
> > > > > > > > > >         at
> > > java.awt.Component.setVisible(Component.java:898)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > 45)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > ctButton.java:1499)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > .java:373)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > )
> > > > > > > > > >         at
> > > > > > > >
javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > > > >         at
> > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > >         at
> > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > >         at
> > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > )
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > >
> > > > > > > > > >         at
> > > > > > > > > >
> > > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > >         at
> > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > >         at
> > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > read.java:126)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > ad.java:93)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > > > >         at
> > > > > > > >
> > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Praveen
> > > > > > > > > >
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > As a general recommendation, I encourage you to
> > capture
> > > a
> > > > > stack
> > > > > > > > trace
> > > > > > > > > > > for your exceptions.  Just having the exception
> > message
> > > > > makes it
> > > > > > > > > > harder
> > > > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > > > >
> > > > > > > > > > > This particular exception means that a
> > > ByteArrayDataSource
> > > > > was
> > > > > > > > created
> > > > > > > > > > > with no data array, such as passing a null for the
> > byte
> > > > > array.
> > > > > > > > > > >
> > > > > > > > > > > Scott Nichol
> > > > > > > > > > >
> > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > > Yeah. It works now. Its my bad. Sorry about
that.
> > > > > > > > > > > >
> > > > > > > > > > > > BUt I have another problem. When I execute that
> > > method, I
> > > > > get
> > > > > > > > the
> > > > > > > > > > > following
> > > > > > > > > > > > exception.
> > > > > > > > > > > >
> > > > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > > > >
> > > > > > > > > > > > What does this mean? I double checked that my
soap
> > > method
> > > > > exists
> > > > > > > > in
> > > > > > > > > > > the
> > > > > > > > > > > > descriptor and the implementation also exists on
the
> > > > > server
> > > > > > > > side.
> > > > > > > > > > But
> > > > > > > > > > > the
> > > > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > > > >
> > > > > > > > > > > > Praveen
> > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > From: "Scott Nichol"
<sn...@scottnichol.com>
> > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > > This sample that I created from you code works
for
> > > me,
> > > > > i.e. it
> > > > > > > > > > does
> > > > > > > > > > > not
> > > > > > > > > > > > > throw an NPE.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > > >
> > > > > > > > > > > > > import java.io.*;
> > > > > > > > > > > > > import java.util.*;
> > > > > > > > > > > > > import java.net.*;
> > > > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > > > >
> > > > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > > > >   try {
> > > > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > > > >
> > > > > > > > > > > > >    // Build the call.
> > > > > > > > > > > > >    SOAPMappingRegistry smr = new
> > > SOAPMappingRegistry();
> > > > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > > > >
call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > > > >
> > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > > > >
> > > > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > > > >
> > > > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > > > >    DataSource ds = new
> > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > > > >     javax.activation.DataHandler.class, dh,
> > null));
> > > > > > > > > > > > >
> > > > > > > > > > > > >    DataSource ds2 = new
> > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > > > >     dh2, null));
> > > > > > > > > > > > >
> > > > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > > > >
> > > > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > > > >    Response resp;
> > > > > > > > > > > > >
> > > > > > > > > > > > >    try {
> > > > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > > > >     //System.out.println("Response is: " +
resp);
> > > > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > > > >     System.err.println("Caught
SOAPException");
> > > > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > > > >    }
> > > > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > > > >   }
> > > > > > > > > > > > >  }
> > > > > > > > > > > > > }
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
To provide more information, could you please add a line of code:

    Fault fault = resp.getFault();

    System.err.println("Generated fault: ");
    System.out.println("  Fault Code   = " + fault.getFaultCode());
    System.out.println("  Fault String = " + fault.getFaultString());
+++ System.out.println(fault.toString());

Also, please be certain the deployment descriptor for the services
specifies


<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis
tener>

(This should be on a single line, with no whitespace between the element
tags.)

With this listener, printing fault.toString() on the client should show
the stack trace.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Cc: <sn...@scottnichol.com>
Sent: Wednesday, January 08, 2003 10:16 AM
Subject: Re: Urgent: Soap With attachments example


> Dear Scott,
> I don't do anything special as far as I know. I think the fault is
generated
> by the apache tool kit.
> Let me send you the complete method again. May be its easy to
understand
> when u look at the full method. If you look at the arguments of my
client
> method, sourceBytes are never null but thumbBytes are sometimes null.
This
> is basically the case I am problems in.
>
> public static String uploadContentObjectWithAttachments(long
sessionID,
>         String containerID, String title, byte[] sourceBytes,
>         String sourceFileName, byte[] thumbBytes, String
thumbFileName)
>         throws Exception {
>          System.out.println("uploadContentObjectUsingAttachments...");
>         // Process the arguments.
>         URL url = null;
>
>         String xmlString = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>" +
>             "<content>" + "<title>" + title + "</title>" +
>             "<source><url><unencoded>" + sourceFileName +
>             "</unencoded>  </url></source>";
>
>         if (thumbFileName != null) {
>             xmlString += ("<thumbnail><url><unencoded>" +
thumbFileName +
>             "</unencoded></url></thumbnail>");
>         }
>   xmlString += "<categorization>"+
>            "<category>My Content/cat1</category>"+
>            "<category>My Content/cat2</category>"+
>            "<category>My Content/cat3</category>"+
>            "</categorization>";
>         xmlString += "</content>";
>
>         try {
>             url = new URL(Simplex.getServerURL());
>         } catch (MalformedURLException me) {
>             System.err.println("MalformedURLException:" +
me.getMessage());
>         }
>
>         // Build the call.
>         SOAPMappingRegistry smr = new SOAPMappingRegistry();
>         Call call = new Call();
>
>   call.setSOAPMappingRegistry(smr);
>         call.setTargetObjectURI("urn:CMISOAPContentService");
>         call.setMethodName("uploadContentObject");
>         call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
>
>         Vector params = new Vector();
>         params.addElement(new Parameter("sessionID", long.class,
>                 new Long(sessionID), null));
>         params.addElement(new Parameter("containerID",
> containerID.getClass(),
>                 new String(containerID), null));
>         params.addElement(new Parameter("xmlString",
xmlString.getClass(),
>                 new String(xmlString), null));
>
>         DataSource ds = new ByteArrayDataSource(sourceBytes,
> "application/octet-stream");
>         DataHandler dh = new DataHandler(ds);
>         params.addElement(new Parameter("source",
>                 javax.activation.DataHandler.class, dh, null));
>
>         //            params.addElement(new Parameter("encodedSource",
> encodedSource.getClass(), new String(encodedSource), null));
>         params.addElement(new Parameter("sourceFileName",
>                 sourceFileName.getClass(), new String(sourceFileName),
> null));
>
>         if (thumbBytes != null && thumbFileName!=null) {
>             ds = new ByteArrayDataSource(thumbBytes,
> "application/octet-stream");
>             dh = new DataHandler(ds);
>             params.addElement(new Parameter("thumb",
>                     javax.activation.DataHandler.class, dh, null));
>             params.addElement(new Parameter("thumbFileName",
>                     thumbFileName.getClass(), new
String(thumbFileName),
> null));
>         } else {
>             params.addElement(new Parameter("thumb",
>                     javax.activation.DataHandler.class, null, null));
>             params.addElement(new Parameter("thumbFileName",
>                     new String().getClass(), null, null));
>         }
>
>         call.setParams(params);
>
>         // Invoke the call.
>         Response resp;
>
>         try {
>             resp = call.invoke(url, "");
>
>             //System.out.println("Response is: " + resp);
>         } catch (SOAPException e) {
>          e.printStackTrace();
>             System.err.println("Caught SOAPException (" +
e.getFaultCode() +
>                 "): " + e.getMessage());
>
>             return null;
>         }
>
>         // Check the response.
>         if (!resp.generatedFault()) {
>             Parameter ret = resp.getReturnValue();
>             String encodedString = (String) ret.getValue();
>             String decodedString = new
String(Base64.decode(encodedString));
>
>             //  System.out.println("XML String: " + decodedString);
>             return decodedString;
>         } else {
>             Fault fault = resp.getFault();
>
>             System.err.println("Generated fault: ");
>             System.out.println("  Fault Code   = " +
fault.getFaultCode());
>             System.out.println("  Fault String = " +
> fault.getFaultString());
>             throw new Exception(fault.getFaultString());
>         }
>     }
>
> Praveen
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 6:00 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > Interesting.  Do you do anything special to generate the fault, such
as
> > registering a fault listener?
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 5:50 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > I think the exception is not thrown by the invoke() method but a
fault
> > is generated in the response.
> >
> > try {
> >             resp = call.invoke(url, "");
> >
> >             //System.out.println("Response is: " + resp);
> >         } catch (SOAPException e) {
> >          e.printStackTrace();
> >             System.err.println("Caught SOAPException (" +
> > e.getFaultCode() +
> >                 "): " + e.getMessage());
> >
> >             return null;
> >         }
> >
> >         // Check the response.
> >         if (!resp.generatedFault()) {
> >             Parameter ret = resp.getReturnValue();
> >             String encodedString = (String) ret.getValue();
> >             String decodedString = new
> > String(Base64.decode(encodedString));
> >
> >             //  System.out.println("XML String: " + decodedString);
> >             return decodedString;
> >         } else {
> >
> >             //this is where the error is traced
> >             Fault fault = resp.getFault();
> >
> >             System.err.println("Generated fault: ");
> >             System.out.println("  Fault Code   = " +
> > fault.getFaultCode());
> >             System.out.println("  Fault String = " +
> > fault.getFaultString());
> >             throw new Exception(fault.getFaultString());
> >         }
> >
> >
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 5:18 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > That's odd.  The error message is when deserializing, but the
client
> > > only deserializes responses.  Is the line at which the exception
is
> > > thrown doing the Call#invoke?
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 4:56 PM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > > I am sorry about it. I didn't mean to demand the response or
> > anything
> > > like
> > > > that. I am just kind of under pressure and it looked like the
> > problem
> > > might
> > > > be in the soap tool kit (since u said it didn't handler null
> > arguments
> > > > before).
> > > >
> > > > But I appreciate your help. You have been a great help to me.
> > > >
> > > > uploadContentObject returns a base64 encoded string. But it
looks
> > like
> > > the
> > > > request doesn't goto the server at all. I can't see the trace on
the
> > > server
> > > > I should have been seen if the request comes in.
> > > >
> > > > Praveen
> > > >
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 4:41 PM
> > > > Subject: Re: Urgent: Soap With attachments example
> > > >
> > > >
> > > > > What does uploadContentObject return, specifically, what is
the
> > Java
> > > > > type?  If you have provided a mapping for it in the server's
> > > deployment
> > > > > descriptor, what is the mapping?
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > P.S.: I appreciate that you are probably working on something
with
> > a
> > > > > deadline and require help to move forward, but putting
"urgent" in
> > > the
> > > > > subject and asking me to "look at the error ASAP" is not the
> > > greatest
> > > > > etiquette for this list.  I am committed to helping Apache
SOAP
> > > users
> > > > > and improving the Apache SOAP code, but I do so as an unpaid
> > > volunteer!
> > > > > I am also committed to making my mortgage payments ;-), so I
> > cannot
> > > > > always get to things in a timely manner.  Please try to be
> > patient.
> > > > > And, if I (or someone else on the list) cannot respond quickly
> > > enough,
> > > > > there's always the source code available for you to trace
through,
> > > as
> > > > > well.
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Cc: <sn...@scottnichol.com>
> > > > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > > > Subject: Urgent: Soap With attachments example
> > > > >
> > > > >
> > > > > > Hi Scott,
> > > > > > Could you please look at the error ASAP and let me know
whats
> > > wrong in
> > > > > my
> > > > > > code. I need to fix it ASAP.
> > > > > >
> > > > > > Thanks in Advance.
> > > > > >
> > > > > > Praveen
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > I updated my jar file with the current jar file that I got
> > from
> > > the
> > > > > > nightly
> > > > > > > build. Now this is the error I get when I pass null for
> > > DataHandler.
> > > > > > >
> > > > > > > Uploading ....
> > > > > > > uploadContentObjectUsingAttachments...
> > > > > > > Generated fault:
> > > > > > >   Fault Code   = SOAP-ENV:Client
> > > > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > > > java.lang.Exception: Can't yet deserialize non-null
Objects
> > > > > > >         at
> > > > > > >
> > > > >
> > >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > 45)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > ctButton.java:1499)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > .java:373)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > istener.java:211)
> > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > >         at
> > java.awt.Component.processEvent(Component.java:3539)
> > > > > > >         at
> > java.awt.Container.processEvent(Container.java:1159)
> > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > >
> > > > > > >         at
> > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > >         at
java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > read.java:126)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > ad.java:93)
> > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > >         at
java.awt.Component.setVisible(Component.java:898)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > rmed(SimplexFrame.java:391)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > 45)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > ctButton.java:1499)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > .java:373)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > )
> > > > > > >         at
> > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > >         at
> > java.awt.Component.processEvent(Component.java:3539)
> > > > > > >         at
> > java.awt.Container.processEvent(Container.java:1159)
> > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > >
> > > > > > >         at
> > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > >         at
java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > read.java:126)
> > > > > > >         at
> > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > ad.java:93)
> > > > > > >         at
> > > > > > >
> > >
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > >         at
> > > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > >
> > > > > > > Praveen
> > > > > > > ----- Original Message -----
> > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > The newest nightly is right here:
> > > > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > > > >
> > > > > > > > Scott Nichol
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > Hey Scott,
> > > > > > > > > I could not find a nightly build dated yesterday or
today.
> > > Could
> > > > > you
> > > > > > > > please
> > > > > > > > > check it out. If not, where can find the insturctions
on
> > how
> > > to
> > > > > > > > compile the
> > > > > > > > > src, so that I can compile it and use it. Can I just
> > replace
> > > the
> > > > > old
> > > > > > > > > MimePartSerializer class file with the new one or do I
> > have
> > > to
> > > > > replece
> > > > > > > > the
> > > > > > > > > whole jar.
> > > > > > > > >
> > > > > > > > > Thanks
> > > > > > > > >
> > > > > > > > > Praveen
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > This is a "quirk" of the MimePartSerializer.  It is
used
> > > to
> > > > > > > > serialize
> > > > > > > > > > InputStream, DataSource, MimeBodyPart and
DataHandler.
> > > When a
> > > > > null
> > > > > > > > > > value is passed in for serialization, the serializer
> > (for
> > > some
> > > > > > > > reason)
> > > > > > > > > > chooses to serialize it as an Object.  That's why
you
> > get
> > > the
> > > > > > > > mismatch.
> > > > > > > > > >
> > > > > > > > > > I'm going to change the code to use the type
specified
> > to
> > > the
> > > > > > > > serializer
> > > > > > > > > > when serializing a null.  You can either grab the
source
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > > > ext/plain), compile it and use it, or wait until
> > tomorrow
> > > and
> > > > > get a
> > > > > > > > > > nightly build
> > (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > > > >
> > > > > > > > > > Scott Nichol
> > > > > > > > > >
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hi Scott,
> > > > > > > > > >
> > > > > > > > > > Eveyrthing seems to work fine now, except one minor
> > > problem.
> > > > > When
> > > > > > > > there
> > > > > > > > > > is nothing to send as argument I am passing in null
and
> > > thats
> > > > > > > > throwing
> > > > > > > > > > exception. Please look at the bold lines of my code
> > below.
> > > I
> > > > > am
> > > > > > > > passing
> > > > > > > > > > in the type of the argument as
> > > > > javax.activation.DataHandler.class,
> > > > > > > > but
> > > > > > > > > > it still takes it as Object. See the exception after
the
> > > code.
> > > > > Look
> > > > > > > > at
> > > > > > > > > > the 6th argument of the method. It is assuming the
> > object
> > > type
> > > > > as
> > > > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > > > >
> > > > > > > > > > Vector params = new Vector();
> > > > > > > > > >         params.addElement(new Parameter("sessionID",
> > > > > long.class,
> > > > > > > > > >                 new Long(sessionID), null));
> > > > > > > > > >         params.addElement(new
Parameter("containerID",
> > > > > > > > > > containerID.getClass(),
> > > > > > > > > >                 new String(containerID), null));
> > > > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > > > xmlString.getClass(),
> > > > > > > > > >                 new String(xmlString), null));
> > > > > > > > > >
> > > > > > > > > >         DataSource ds = new
> > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > "application/octet-stream");
> > > > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > > > >                 javax.activation.DataHandler.class,
dh,
> > > > > null));
> > > > > > > > > >
> > > > > > > > > >         //            params.addElement(new
> > > > > > > > Parameter("encodedSource",
> > > > > > > > > > encodedSource.getClass(), new String(encodedSource),
> > > null));
> > > > > > > > > >         params.addElement(new
> > Parameter("sourceFileName",
> > > > > > > > > >                 sourceFileName.getClass(), new
> > > > > > > > String(sourceFileName),
> > > > > > > > > > null));
> > > > > > > > > >
> > > > > > > > > >         if (thumbBytes != null &&
thumbFileName!=null) {
> > > > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > > > "application/octet-stream");
> > > > > > > > > >             dh = new DataHandler(ds);
> > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > >
javax.activation.DataHandler.class,
> > > dh,
> > > > > null));
> > > > > > > > > >             params.addElement(new
> > > Parameter("thumbFileName",
> > > > > > > > > >                     thumbFileName.getClass(), new
> > > > > > > > String(thumbFileName),
> > > > > > > > > > null));
> > > > > > > > > >         } else {
> > > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > > >
javax.activation.DataHandler.class,
> > > null,
> > > > > > > > null));
> > > > > > > > > >             params.addElement(new
> > > Parameter("thumbFileName",
> > > > > > > > > >                     new String().getClass(), null,
> > null));
> > > > > > > > > >         }
> > > > > > > > > >
> > > > > > > > > > Exception trace is as follows:
> > > > > > > > > >
> > > > > > > > > > Generated fault:
> > > > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > > > >   Fault String = Exception while handling service
> > request:
> > > > > > > > > > com.contextmedia.ip.s
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > > > ing,java
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > > > ect,java
> > > > > > > > > > .lang.String) -- no signature match
> > > > > > > > > > java.lang.Exception: Exception while handling
service
> > > request:
> > > > > > > > > > com.contextmedia.
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > > > .String,
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
> >
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > > > .Object,
> > > > > > > > > > java.lang.String) -- no signature match
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > > >
entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > 45)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > ctButton.java:1499)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > .java:373)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > )
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > > > istener.java:211)
> > > > > > > > > >         at
> > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > >         at
> > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > >         at
> > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > )
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > >
> > > > > > > > > >         at
> > > > > > > > > >
> > > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > >         at
> > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > >         at
> > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > read.java:126)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > ad.java:93)
> > > > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > > > >         at
java.awt.Component.show(Component.java:941)
> > > > > > > > > >         at
> > > java.awt.Component.setVisible(Component.java:898)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > > 45)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > > ctButton.java:1499)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > > .java:373)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > > )
> > > > > > > > > >         at
> > > > > > > >
javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > > > >         at
> > > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > > >         at
> > > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > > >         at
> > > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > > )
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > > >
> > > > > > > > > >         at
> > > > > > > > > >
> > > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > > >         at
> > > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > > >         at
> > > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > > >         at
> > > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > > >         at
> > > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > > read.java:126)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > > > > >
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > > ad.java:93)
> > > > > > > > > >         at
> > > > > > > > > >
> > > > >
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > > > >         at
> > > > > > > >
> > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Praveen
> > > > > > > > > >
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > As a general recommendation, I encourage you to
> > capture
> > > a
> > > > > stack
> > > > > > > > trace
> > > > > > > > > > > for your exceptions.  Just having the exception
> > message
> > > > > makes it
> > > > > > > > > > harder
> > > > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > > > >
> > > > > > > > > > > This particular exception means that a
> > > ByteArrayDataSource
> > > > > was
> > > > > > > > created
> > > > > > > > > > > with no data array, such as passing a null for the
> > byte
> > > > > array.
> > > > > > > > > > >
> > > > > > > > > > > Scott Nichol
> > > > > > > > > > >
> > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > > Yeah. It works now. Its my bad. Sorry about
that.
> > > > > > > > > > > >
> > > > > > > > > > > > BUt I have another problem. When I execute that
> > > method, I
> > > > > get
> > > > > > > > the
> > > > > > > > > > > following
> > > > > > > > > > > > exception.
> > > > > > > > > > > >
> > > > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > > > >
> > > > > > > > > > > > What does this mean? I double checked that my
soap
> > > method
> > > > > exists
> > > > > > > > in
> > > > > > > > > > > the
> > > > > > > > > > > > descriptor and the implementation also exists on
the
> > > > > server
> > > > > > > > side.
> > > > > > > > > > But
> > > > > > > > > > > the
> > > > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > > > >
> > > > > > > > > > > > Praveen
> > > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > > From: "Scott Nichol"
<sn...@scottnichol.com>
> > > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > > This sample that I created from you code works
for
> > > me,
> > > > > i.e. it
> > > > > > > > > > does
> > > > > > > > > > > not
> > > > > > > > > > > > > throw an NPE.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > > >
> > > > > > > > > > > > > import java.io.*;
> > > > > > > > > > > > > import java.util.*;
> > > > > > > > > > > > > import java.net.*;
> > > > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > > > >
> > > > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > > > >   try {
> > > > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > > > >
> > > > > > > > > > > > >    // Build the call.
> > > > > > > > > > > > >    SOAPMappingRegistry smr = new
> > > SOAPMappingRegistry();
> > > > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > > > >
call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > > > >
> > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > > > >
> > > > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > > > >
> > > > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > > > >    DataSource ds = new
> > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > > > >     javax.activation.DataHandler.class, dh,
> > null));
> > > > > > > > > > > > >
> > > > > > > > > > > > >    DataSource ds2 = new
> > > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > > > >     dh2, null));
> > > > > > > > > > > > >
> > > > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > > > >
> > > > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > > > >    Response resp;
> > > > > > > > > > > > >
> > > > > > > > > > > > >    try {
> > > > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > > > >     //System.out.println("Response is: " +
resp);
> > > > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > > > >     System.err.println("Caught
SOAPException");
> > > > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > > > >    }
> > > > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > > > >   }
> > > > > > > > > > > > >  }
> > > > > > > > > > > > > }
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Dear Scott,
I don't do anything special as far as I know. I think the fault is generated
by the apache tool kit.
Let me send you the complete method again. May be its easy to understand
when u look at the full method. If you look at the arguments of my client
method, sourceBytes are never null but thumbBytes are sometimes null. This
is basically the case I am problems in.

public static String uploadContentObjectWithAttachments(long sessionID,
        String containerID, String title, byte[] sourceBytes,
        String sourceFileName, byte[] thumbBytes, String thumbFileName)
        throws Exception {
         System.out.println("uploadContentObjectUsingAttachments...");
        // Process the arguments.
        URL url = null;

        String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
            "<content>" + "<title>" + title + "</title>" +
            "<source><url><unencoded>" + sourceFileName +
            "</unencoded>  </url></source>";

        if (thumbFileName != null) {
            xmlString += ("<thumbnail><url><unencoded>" + thumbFileName +
            "</unencoded></url></thumbnail>");
        }
  xmlString += "<categorization>"+
           "<category>My Content/cat1</category>"+
           "<category>My Content/cat2</category>"+
           "<category>My Content/cat3</category>"+
           "</categorization>";
        xmlString += "</content>";

        try {
            url = new URL(Simplex.getServerURL());
        } catch (MalformedURLException me) {
            System.err.println("MalformedURLException:" + me.getMessage());
        }

        // Build the call.
        SOAPMappingRegistry smr = new SOAPMappingRegistry();
        Call call = new Call();

  call.setSOAPMappingRegistry(smr);
        call.setTargetObjectURI("urn:CMISOAPContentService");
        call.setMethodName("uploadContentObject");
        call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

        Vector params = new Vector();
        params.addElement(new Parameter("sessionID", long.class,
                new Long(sessionID), null));
        params.addElement(new Parameter("containerID",
containerID.getClass(),
                new String(containerID), null));
        params.addElement(new Parameter("xmlString", xmlString.getClass(),
                new String(xmlString), null));

        DataSource ds = new ByteArrayDataSource(sourceBytes,
"application/octet-stream");
        DataHandler dh = new DataHandler(ds);
        params.addElement(new Parameter("source",
                javax.activation.DataHandler.class, dh, null));

        //            params.addElement(new Parameter("encodedSource",
encodedSource.getClass(), new String(encodedSource), null));
        params.addElement(new Parameter("sourceFileName",
                sourceFileName.getClass(), new String(sourceFileName),
null));

        if (thumbBytes != null && thumbFileName!=null) {
            ds = new ByteArrayDataSource(thumbBytes,
"application/octet-stream");
            dh = new DataHandler(ds);
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, dh, null));
            params.addElement(new Parameter("thumbFileName",
                    thumbFileName.getClass(), new String(thumbFileName),
null));
        } else {
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, null, null));
            params.addElement(new Parameter("thumbFileName",
                    new String().getClass(), null, null));
        }

        call.setParams(params);

        // Invoke the call.
        Response resp;

        try {
            resp = call.invoke(url, "");

            //System.out.println("Response is: " + resp);
        } catch (SOAPException e) {
         e.printStackTrace();
            System.err.println("Caught SOAPException (" + e.getFaultCode() +
                "): " + e.getMessage());

            return null;
        }

        // Check the response.
        if (!resp.generatedFault()) {
            Parameter ret = resp.getReturnValue();
            String encodedString = (String) ret.getValue();
            String decodedString = new String(Base64.decode(encodedString));

            //  System.out.println("XML String: " + decodedString);
            return decodedString;
        } else {
            Fault fault = resp.getFault();

            System.err.println("Generated fault: ");
            System.out.println("  Fault Code   = " + fault.getFaultCode());
            System.out.println("  Fault String = " +
fault.getFaultString());
            throw new Exception(fault.getFaultString());
        }
    }

Praveen
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 6:00 PM
Subject: Re: Urgent: Soap With attachments example


> Interesting.  Do you do anything special to generate the fault, such as
> registering a fault listener?
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 5:50 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> I think the exception is not thrown by the invoke() method but a fault
> is generated in the response.
>
> try {
>             resp = call.invoke(url, "");
>
>             //System.out.println("Response is: " + resp);
>         } catch (SOAPException e) {
>          e.printStackTrace();
>             System.err.println("Caught SOAPException (" +
> e.getFaultCode() +
>                 "): " + e.getMessage());
>
>             return null;
>         }
>
>         // Check the response.
>         if (!resp.generatedFault()) {
>             Parameter ret = resp.getReturnValue();
>             String encodedString = (String) ret.getValue();
>             String decodedString = new
> String(Base64.decode(encodedString));
>
>             //  System.out.println("XML String: " + decodedString);
>             return decodedString;
>         } else {
>
>             //this is where the error is traced
>             Fault fault = resp.getFault();
>
>             System.err.println("Generated fault: ");
>             System.out.println("  Fault Code   = " +
> fault.getFaultCode());
>             System.out.println("  Fault String = " +
> fault.getFaultString());
>             throw new Exception(fault.getFaultString());
>         }
>
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 5:18 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > That's odd.  The error message is when deserializing, but the client
> > only deserializes responses.  Is the line at which the exception is
> > thrown doing the Call#invoke?
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 4:56 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > I am sorry about it. I didn't mean to demand the response or
> anything
> > like
> > > that. I am just kind of under pressure and it looked like the
> problem
> > might
> > > be in the soap tool kit (since u said it didn't handler null
> arguments
> > > before).
> > >
> > > But I appreciate your help. You have been a great help to me.
> > >
> > > uploadContentObject returns a base64 encoded string. But it looks
> like
> > the
> > > request doesn't goto the server at all. I can't see the trace on the
> > server
> > > I should have been seen if the request comes in.
> > >
> > > Praveen
> > >
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 4:41 PM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > > What does uploadContentObject return, specifically, what is the
> Java
> > > > type?  If you have provided a mapping for it in the server's
> > deployment
> > > > descriptor, what is the mapping?
> > > >
> > > > Scott Nichol
> > > >
> > > > P.S.: I appreciate that you are probably working on something with
> a
> > > > deadline and require help to move forward, but putting "urgent" in
> > the
> > > > subject and asking me to "look at the error ASAP" is not the
> > greatest
> > > > etiquette for this list.  I am committed to helping Apache SOAP
> > users
> > > > and improving the Apache SOAP code, but I do so as an unpaid
> > volunteer!
> > > > I am also committed to making my mortgage payments ;-), so I
> cannot
> > > > always get to things in a timely manner.  Please try to be
> patient.
> > > > And, if I (or someone else on the list) cannot respond quickly
> > enough,
> > > > there's always the source code available for you to trace through,
> > as
> > > > well.
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Cc: <sn...@scottnichol.com>
> > > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > > Subject: Urgent: Soap With attachments example
> > > >
> > > >
> > > > > Hi Scott,
> > > > > Could you please look at the error ASAP and let me know whats
> > wrong in
> > > > my
> > > > > code. I need to fix it ASAP.
> > > > >
> > > > > Thanks in Advance.
> > > > >
> > > > > Praveen
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > I updated my jar file with the current jar file that I got
> from
> > the
> > > > > nightly
> > > > > > build. Now this is the error I get when I pass null for
> > DataHandler.
> > > > > >
> > > > > > Uploading ....
> > > > > > uploadContentObjectUsingAttachments...
> > > > > > Generated fault:
> > > > > >   Fault Code   = SOAP-ENV:Client
> > > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > > java.lang.Exception: Can't yet deserialize non-null Objects
> > > > > >         at
> > > > > >
> > > >
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > > >         at
> > > > > >
> > > >
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > istener.java:211)
> > > > > >         at
> > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > > >         at
> > > > > >
> > > >
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > rmed(SimplexFrame.java:391)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > d(BasicMenuItemUI.java:882)
> > > > > >         at
> > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at
> > > > > >
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > >         at
> > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > >
> > > > > > Praveen
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > The newest nightly is right here:
> > > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > Hey Scott,
> > > > > > > > I could not find a nightly build dated yesterday or today.
> > Could
> > > > you
> > > > > > > please
> > > > > > > > check it out. If not, where can find the insturctions on
> how
> > to
> > > > > > > compile the
> > > > > > > > src, so that I can compile it and use it. Can I just
> replace
> > the
> > > > old
> > > > > > > > MimePartSerializer class file with the new one or do I
> have
> > to
> > > > replece
> > > > > > > the
> > > > > > > > whole jar.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > >
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > This is a "quirk" of the MimePartSerializer.  It is used
> > to
> > > > > > > serialize
> > > > > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.
> > When a
> > > > null
> > > > > > > > > value is passed in for serialization, the serializer
> (for
> > some
> > > > > > > reason)
> > > > > > > > > chooses to serialize it as an Object.  That's why you
> get
> > the
> > > > > > > mismatch.
> > > > > > > > >
> > > > > > > > > I'm going to change the code to use the type specified
> to
> > the
> > > > > > > serializer
> > > > > > > > > when serializing a null.  You can either grab the source
> > > > > > > > >
> > > > > > >
> > > >
> >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > > >
> > > > > > >
> > > >
> >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > > ext/plain), compile it and use it, or wait until
> tomorrow
> > and
> > > > get a
> > > > > > > > > nightly build
> (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi Scott,
> > > > > > > > >
> > > > > > > > > Eveyrthing seems to work fine now, except one minor
> > problem.
> > > > When
> > > > > > > there
> > > > > > > > > is nothing to send as argument I am passing in null and
> > thats
> > > > > > > throwing
> > > > > > > > > exception. Please look at the bold lines of my code
> below.
> > I
> > > > am
> > > > > > > passing
> > > > > > > > > in the type of the argument as
> > > > javax.activation.DataHandler.class,
> > > > > > > but
> > > > > > > > > it still takes it as Object. See the exception after the
> > code.
> > > > Look
> > > > > > > at
> > > > > > > > > the 6th argument of the method. It is assuming the
> object
> > type
> > > > as
> > > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > > >
> > > > > > > > > Vector params = new Vector();
> > > > > > > > >         params.addElement(new Parameter("sessionID",
> > > > long.class,
> > > > > > > > >                 new Long(sessionID), null));
> > > > > > > > >         params.addElement(new Parameter("containerID",
> > > > > > > > > containerID.getClass(),
> > > > > > > > >                 new String(containerID), null));
> > > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > > xmlString.getClass(),
> > > > > > > > >                 new String(xmlString), null));
> > > > > > > > >
> > > > > > > > >         DataSource ds = new
> > ByteArrayDataSource(sourceBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > > >                 javax.activation.DataHandler.class, dh,
> > > > null));
> > > > > > > > >
> > > > > > > > >         //            params.addElement(new
> > > > > > > Parameter("encodedSource",
> > > > > > > > > encodedSource.getClass(), new String(encodedSource),
> > null));
> > > > > > > > >         params.addElement(new
> Parameter("sourceFileName",
> > > > > > > > >                 sourceFileName.getClass(), new
> > > > > > > String(sourceFileName),
> > > > > > > > > null));
> > > > > > > > >
> > > > > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >             dh = new DataHandler(ds);
> > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > >                     javax.activation.DataHandler.class,
> > dh,
> > > > null));
> > > > > > > > >             params.addElement(new
> > Parameter("thumbFileName",
> > > > > > > > >                     thumbFileName.getClass(), new
> > > > > > > String(thumbFileName),
> > > > > > > > > null));
> > > > > > > > >         } else {
> > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > >                     javax.activation.DataHandler.class,
> > null,
> > > > > > > null));
> > > > > > > > >             params.addElement(new
> > Parameter("thumbFileName",
> > > > > > > > >                     new String().getClass(), null,
> null));
> > > > > > > > >         }
> > > > > > > > >
> > > > > > > > > Exception trace is as follows:
> > > > > > > > >
> > > > > > > > > Generated fault:
> > > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > > >   Fault String = Exception while handling service
> request:
> > > > > > > > > com.contextmedia.ip.s
> > > > > > > > >
> > > > > > >
> > > >
> >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > > ing,java
> > > > > > > > >
> > > > > > >
> > > >
> >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > > ect,java
> > > > > > > > > .lang.String) -- no signature match
> > > > > > > > > java.lang.Exception: Exception while handling service
> > request:
> > > > > > > > > com.contextmedia.
> > > > > > > > >
> > > > > > >
> > > >
> >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > > .String,
> > > > > > > > >
> > > > > > >
> > > >
> >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > > .Object,
> > > > > > > > > java.lang.String) -- no signature match
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > 45)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > ctButton.java:1499)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > .java:373)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > > istener.java:211)
> > > > > > > > >         at
> > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > >         at
> > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > >         at
> > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > >
> > > > > > > > >         at
> > > > > > > > >
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > >         at
> > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > read.java:126)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > ad.java:93)
> > > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > > > >         at
> > java.awt.Component.setVisible(Component.java:898)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > 45)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > ctButton.java:1499)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > .java:373)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > > >         at
> > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > >         at
> > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > >         at
> > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > >
> > > > > > > > >         at
> > > > > > > > >
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > >         at
> > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > read.java:126)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > ad.java:93)
> > > > > > > > >         at
> > > > > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > > >         at
> > > > > > >
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Praveen
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > As a general recommendation, I encourage you to
> capture
> > a
> > > > stack
> > > > > > > trace
> > > > > > > > > > for your exceptions.  Just having the exception
> message
> > > > makes it
> > > > > > > > > harder
> > > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > > >
> > > > > > > > > > This particular exception means that a
> > ByteArrayDataSource
> > > > was
> > > > > > > created
> > > > > > > > > > with no data array, such as passing a null for the
> byte
> > > > array.
> > > > > > > > > >
> > > > > > > > > > Scott Nichol
> > > > > > > > > >
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > > > > >
> > > > > > > > > > > BUt I have another problem. When I execute that
> > method, I
> > > > get
> > > > > > > the
> > > > > > > > > > following
> > > > > > > > > > > exception.
> > > > > > > > > > >
> > > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > > >
> > > > > > > > > > > What does this mean? I double checked that my soap
> > method
> > > > exists
> > > > > > > in
> > > > > > > > > > the
> > > > > > > > > > > descriptor and the implementation also exists on the
> > > > server
> > > > > > > side.
> > > > > > > > > But
> > > > > > > > > > the
> > > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > > >
> > > > > > > > > > > Praveen
> > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > > This sample that I created from you code works for
> > me,
> > > > i.e. it
> > > > > > > > > does
> > > > > > > > > > not
> > > > > > > > > > > > throw an NPE.
> > > > > > > > > > > >
> > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > >
> > > > > > > > > > > > import java.io.*;
> > > > > > > > > > > > import java.util.*;
> > > > > > > > > > > > import java.net.*;
> > > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > > >
> > > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > > >   try {
> > > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > > >
> > > > > > > > > > > >    // Build the call.
> > > > > > > > > > > >    SOAPMappingRegistry smr = new
> > SOAPMappingRegistry();
> > > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > > >
> > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > > >
> > > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > > >
> > > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > > >    DataSource ds = new
> > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > > >     javax.activation.DataHandler.class, dh,
> null));
> > > > > > > > > > > >
> > > > > > > > > > > >    DataSource ds2 = new
> > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > > >     dh2, null));
> > > > > > > > > > > >
> > > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > > >
> > > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > > >    Response resp;
> > > > > > > > > > > >
> > > > > > > > > > > >    try {
> > > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > > >    }
> > > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > > >   }
> > > > > > > > > > > >  }
> > > > > > > > > > > > }
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Dear Scott,
I don't do anything special as far as I know. I think the fault is generated
by the apache tool kit.
Let me send you the complete method again. May be its easy to understand
when u look at the full method. If you look at the arguments of my client
method, sourceBytes are never null but thumbBytes are sometimes null. This
is basically the case I am problems in.

public static String uploadContentObjectWithAttachments(long sessionID,
        String containerID, String title, byte[] sourceBytes,
        String sourceFileName, byte[] thumbBytes, String thumbFileName)
        throws Exception {
         System.out.println("uploadContentObjectUsingAttachments...");
        // Process the arguments.
        URL url = null;

        String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
            "<content>" + "<title>" + title + "</title>" +
            "<source><url><unencoded>" + sourceFileName +
            "</unencoded>  </url></source>";

        if (thumbFileName != null) {
            xmlString += ("<thumbnail><url><unencoded>" + thumbFileName +
            "</unencoded></url></thumbnail>");
        }
  xmlString += "<categorization>"+
           "<category>My Content/cat1</category>"+
           "<category>My Content/cat2</category>"+
           "<category>My Content/cat3</category>"+
           "</categorization>";
        xmlString += "</content>";

        try {
            url = new URL(Simplex.getServerURL());
        } catch (MalformedURLException me) {
            System.err.println("MalformedURLException:" + me.getMessage());
        }

        // Build the call.
        SOAPMappingRegistry smr = new SOAPMappingRegistry();
        Call call = new Call();

  call.setSOAPMappingRegistry(smr);
        call.setTargetObjectURI("urn:CMISOAPContentService");
        call.setMethodName("uploadContentObject");
        call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

        Vector params = new Vector();
        params.addElement(new Parameter("sessionID", long.class,
                new Long(sessionID), null));
        params.addElement(new Parameter("containerID",
containerID.getClass(),
                new String(containerID), null));
        params.addElement(new Parameter("xmlString", xmlString.getClass(),
                new String(xmlString), null));

        DataSource ds = new ByteArrayDataSource(sourceBytes,
"application/octet-stream");
        DataHandler dh = new DataHandler(ds);
        params.addElement(new Parameter("source",
                javax.activation.DataHandler.class, dh, null));

        //            params.addElement(new Parameter("encodedSource",
encodedSource.getClass(), new String(encodedSource), null));
        params.addElement(new Parameter("sourceFileName",
                sourceFileName.getClass(), new String(sourceFileName),
null));

        if (thumbBytes != null && thumbFileName!=null) {
            ds = new ByteArrayDataSource(thumbBytes,
"application/octet-stream");
            dh = new DataHandler(ds);
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, dh, null));
            params.addElement(new Parameter("thumbFileName",
                    thumbFileName.getClass(), new String(thumbFileName),
null));
        } else {
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, null, null));
            params.addElement(new Parameter("thumbFileName",
                    new String().getClass(), null, null));
        }

        call.setParams(params);

        // Invoke the call.
        Response resp;

        try {
            resp = call.invoke(url, "");

            //System.out.println("Response is: " + resp);
        } catch (SOAPException e) {
         e.printStackTrace();
            System.err.println("Caught SOAPException (" + e.getFaultCode() +
                "): " + e.getMessage());

            return null;
        }

        // Check the response.
        if (!resp.generatedFault()) {
            Parameter ret = resp.getReturnValue();
            String encodedString = (String) ret.getValue();
            String decodedString = new String(Base64.decode(encodedString));

            //  System.out.println("XML String: " + decodedString);
            return decodedString;
        } else {
            Fault fault = resp.getFault();

            System.err.println("Generated fault: ");
            System.out.println("  Fault Code   = " + fault.getFaultCode());
            System.out.println("  Fault String = " +
fault.getFaultString());
            throw new Exception(fault.getFaultString());
        }
    }

Praveen
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 6:00 PM
Subject: Re: Urgent: Soap With attachments example


> Interesting.  Do you do anything special to generate the fault, such as
> registering a fault listener?
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 5:50 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> I think the exception is not thrown by the invoke() method but a fault
> is generated in the response.
>
> try {
>             resp = call.invoke(url, "");
>
>             //System.out.println("Response is: " + resp);
>         } catch (SOAPException e) {
>          e.printStackTrace();
>             System.err.println("Caught SOAPException (" +
> e.getFaultCode() +
>                 "): " + e.getMessage());
>
>             return null;
>         }
>
>         // Check the response.
>         if (!resp.generatedFault()) {
>             Parameter ret = resp.getReturnValue();
>             String encodedString = (String) ret.getValue();
>             String decodedString = new
> String(Base64.decode(encodedString));
>
>             //  System.out.println("XML String: " + decodedString);
>             return decodedString;
>         } else {
>
>             //this is where the error is traced
>             Fault fault = resp.getFault();
>
>             System.err.println("Generated fault: ");
>             System.out.println("  Fault Code   = " +
> fault.getFaultCode());
>             System.out.println("  Fault String = " +
> fault.getFaultString());
>             throw new Exception(fault.getFaultString());
>         }
>
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 5:18 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > That's odd.  The error message is when deserializing, but the client
> > only deserializes responses.  Is the line at which the exception is
> > thrown doing the Call#invoke?
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 4:56 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > I am sorry about it. I didn't mean to demand the response or
> anything
> > like
> > > that. I am just kind of under pressure and it looked like the
> problem
> > might
> > > be in the soap tool kit (since u said it didn't handler null
> arguments
> > > before).
> > >
> > > But I appreciate your help. You have been a great help to me.
> > >
> > > uploadContentObject returns a base64 encoded string. But it looks
> like
> > the
> > > request doesn't goto the server at all. I can't see the trace on the
> > server
> > > I should have been seen if the request comes in.
> > >
> > > Praveen
> > >
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 4:41 PM
> > > Subject: Re: Urgent: Soap With attachments example
> > >
> > >
> > > > What does uploadContentObject return, specifically, what is the
> Java
> > > > type?  If you have provided a mapping for it in the server's
> > deployment
> > > > descriptor, what is the mapping?
> > > >
> > > > Scott Nichol
> > > >
> > > > P.S.: I appreciate that you are probably working on something with
> a
> > > > deadline and require help to move forward, but putting "urgent" in
> > the
> > > > subject and asking me to "look at the error ASAP" is not the
> > greatest
> > > > etiquette for this list.  I am committed to helping Apache SOAP
> > users
> > > > and improving the Apache SOAP code, but I do so as an unpaid
> > volunteer!
> > > > I am also committed to making my mortgage payments ;-), so I
> cannot
> > > > always get to things in a timely manner.  Please try to be
> patient.
> > > > And, if I (or someone else on the list) cannot respond quickly
> > enough,
> > > > there's always the source code available for you to trace through,
> > as
> > > > well.
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Cc: <sn...@scottnichol.com>
> > > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > > Subject: Urgent: Soap With attachments example
> > > >
> > > >
> > > > > Hi Scott,
> > > > > Could you please look at the error ASAP and let me know whats
> > wrong in
> > > > my
> > > > > code. I need to fix it ASAP.
> > > > >
> > > > > Thanks in Advance.
> > > > >
> > > > > Praveen
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > I updated my jar file with the current jar file that I got
> from
> > the
> > > > > nightly
> > > > > > build. Now this is the error I get when I pass null for
> > DataHandler.
> > > > > >
> > > > > > Uploading ....
> > > > > > uploadContentObjectUsingAttachments...
> > > > > > Generated fault:
> > > > > >   Fault Code   = SOAP-ENV:Client
> > > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > > java.lang.Exception: Can't yet deserialize non-null Objects
> > > > > >         at
> > > > > >
> > > >
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > > >         at
> > > > > >
> > > >
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > istener.java:211)
> > > > > >         at
> > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > > >         at
> > > > > >
> > > >
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > rmed(SimplexFrame.java:391)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > >         at
> > > > > >
> > > >
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > d(BasicMenuItemUI.java:882)
> > > > > >         at
> > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at
> > > > > >
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > >         at
> > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > >
> > > > > > Praveen
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > The newest nightly is right here:
> > > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > Hey Scott,
> > > > > > > > I could not find a nightly build dated yesterday or today.
> > Could
> > > > you
> > > > > > > please
> > > > > > > > check it out. If not, where can find the insturctions on
> how
> > to
> > > > > > > compile the
> > > > > > > > src, so that I can compile it and use it. Can I just
> replace
> > the
> > > > old
> > > > > > > > MimePartSerializer class file with the new one or do I
> have
> > to
> > > > replece
> > > > > > > the
> > > > > > > > whole jar.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > >
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > This is a "quirk" of the MimePartSerializer.  It is used
> > to
> > > > > > > serialize
> > > > > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.
> > When a
> > > > null
> > > > > > > > > value is passed in for serialization, the serializer
> (for
> > some
> > > > > > > reason)
> > > > > > > > > chooses to serialize it as an Object.  That's why you
> get
> > the
> > > > > > > mismatch.
> > > > > > > > >
> > > > > > > > > I'm going to change the code to use the type specified
> to
> > the
> > > > > > > serializer
> > > > > > > > > when serializing a null.  You can either grab the source
> > > > > > > > >
> > > > > > >
> > > >
> >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > > >
> > > > > > >
> > > >
> >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > > ext/plain), compile it and use it, or wait until
> tomorrow
> > and
> > > > get a
> > > > > > > > > nightly build
> (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi Scott,
> > > > > > > > >
> > > > > > > > > Eveyrthing seems to work fine now, except one minor
> > problem.
> > > > When
> > > > > > > there
> > > > > > > > > is nothing to send as argument I am passing in null and
> > thats
> > > > > > > throwing
> > > > > > > > > exception. Please look at the bold lines of my code
> below.
> > I
> > > > am
> > > > > > > passing
> > > > > > > > > in the type of the argument as
> > > > javax.activation.DataHandler.class,
> > > > > > > but
> > > > > > > > > it still takes it as Object. See the exception after the
> > code.
> > > > Look
> > > > > > > at
> > > > > > > > > the 6th argument of the method. It is assuming the
> object
> > type
> > > > as
> > > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > > >
> > > > > > > > > Vector params = new Vector();
> > > > > > > > >         params.addElement(new Parameter("sessionID",
> > > > long.class,
> > > > > > > > >                 new Long(sessionID), null));
> > > > > > > > >         params.addElement(new Parameter("containerID",
> > > > > > > > > containerID.getClass(),
> > > > > > > > >                 new String(containerID), null));
> > > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > > xmlString.getClass(),
> > > > > > > > >                 new String(xmlString), null));
> > > > > > > > >
> > > > > > > > >         DataSource ds = new
> > ByteArrayDataSource(sourceBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > > >                 javax.activation.DataHandler.class, dh,
> > > > null));
> > > > > > > > >
> > > > > > > > >         //            params.addElement(new
> > > > > > > Parameter("encodedSource",
> > > > > > > > > encodedSource.getClass(), new String(encodedSource),
> > null));
> > > > > > > > >         params.addElement(new
> Parameter("sourceFileName",
> > > > > > > > >                 sourceFileName.getClass(), new
> > > > > > > String(sourceFileName),
> > > > > > > > > null));
> > > > > > > > >
> > > > > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >             dh = new DataHandler(ds);
> > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > >                     javax.activation.DataHandler.class,
> > dh,
> > > > null));
> > > > > > > > >             params.addElement(new
> > Parameter("thumbFileName",
> > > > > > > > >                     thumbFileName.getClass(), new
> > > > > > > String(thumbFileName),
> > > > > > > > > null));
> > > > > > > > >         } else {
> > > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > > >                     javax.activation.DataHandler.class,
> > null,
> > > > > > > null));
> > > > > > > > >             params.addElement(new
> > Parameter("thumbFileName",
> > > > > > > > >                     new String().getClass(), null,
> null));
> > > > > > > > >         }
> > > > > > > > >
> > > > > > > > > Exception trace is as follows:
> > > > > > > > >
> > > > > > > > > Generated fault:
> > > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > > >   Fault String = Exception while handling service
> request:
> > > > > > > > > com.contextmedia.ip.s
> > > > > > > > >
> > > > > > >
> > > >
> >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > > ing,java
> > > > > > > > >
> > > > > > >
> > > >
> >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > > ect,java
> > > > > > > > > .lang.String) -- no signature match
> > > > > > > > > java.lang.Exception: Exception while handling service
> > request:
> > > > > > > > > com.contextmedia.
> > > > > > > > >
> > > > > > >
> > > >
> >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > > .String,
> > > > > > > > >
> > > > > > >
> > > >
> >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > > .Object,
> > > > > > > > > java.lang.String) -- no signature match
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > 45)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > ctButton.java:1499)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > .java:373)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > > istener.java:211)
> > > > > > > > >         at
> > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > >         at
> > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > >         at
> > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > >
> > > > > > > > >         at
> > > > > > > > >
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > >         at
> > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > read.java:126)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > ad.java:93)
> > > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > > > >         at
> > java.awt.Component.setVisible(Component.java:898)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > > 45)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > > ctButton.java:1499)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > > .java:373)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > > >         at
> > > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > > >         at
> > > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > > >         at
> > > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > > )
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > > >
> > > > > > > > >         at
> > > > > > > > >
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > > >         at
> > > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > > >         at
> > java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > > >         at
> > > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > > >         at
> > > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > > read.java:126)
> > > > > > > > >         at
> > > > > > > > >
> > > > > > >
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > > ad.java:93)
> > > > > > > > >         at
> > > > > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > > >         at
> > > > > > >
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Praveen
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > As a general recommendation, I encourage you to
> capture
> > a
> > > > stack
> > > > > > > trace
> > > > > > > > > > for your exceptions.  Just having the exception
> message
> > > > makes it
> > > > > > > > > harder
> > > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > > >
> > > > > > > > > > This particular exception means that a
> > ByteArrayDataSource
> > > > was
> > > > > > > created
> > > > > > > > > > with no data array, such as passing a null for the
> byte
> > > > array.
> > > > > > > > > >
> > > > > > > > > > Scott Nichol
> > > > > > > > > >
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > > > > >
> > > > > > > > > > > BUt I have another problem. When I execute that
> > method, I
> > > > get
> > > > > > > the
> > > > > > > > > > following
> > > > > > > > > > > exception.
> > > > > > > > > > >
> > > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > > >
> > > > > > > > > > > What does this mean? I double checked that my soap
> > method
> > > > exists
> > > > > > > in
> > > > > > > > > > the
> > > > > > > > > > > descriptor and the implementation also exists on the
> > > > server
> > > > > > > side.
> > > > > > > > > But
> > > > > > > > > > the
> > > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > > >
> > > > > > > > > > > Praveen
> > > > > > > > > > > ----- Original Message -----
> > > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > > This sample that I created from you code works for
> > me,
> > > > i.e. it
> > > > > > > > > does
> > > > > > > > > > not
> > > > > > > > > > > > throw an NPE.
> > > > > > > > > > > >
> > > > > > > > > > > > Scott Nichol
> > > > > > > > > > > >
> > > > > > > > > > > > import java.io.*;
> > > > > > > > > > > > import java.util.*;
> > > > > > > > > > > > import java.net.*;
> > > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > > >
> > > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > > >   try {
> > > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > > >
> > > > > > > > > > > >    // Build the call.
> > > > > > > > > > > >    SOAPMappingRegistry smr = new
> > SOAPMappingRegistry();
> > > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > > >
> > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > > >
> > > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > > >
> > > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > > >    DataSource ds = new
> > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > > >     javax.activation.DataHandler.class, dh,
> null));
> > > > > > > > > > > >
> > > > > > > > > > > >    DataSource ds2 = new
> > ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > > >     dh2, null));
> > > > > > > > > > > >
> > > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > > >
> > > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > > >    Response resp;
> > > > > > > > > > > >
> > > > > > > > > > > >    try {
> > > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > > >    }
> > > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > > >   }
> > > > > > > > > > > >  }
> > > > > > > > > > > > }
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
Interesting.  Do you do anything special to generate the fault, such as
registering a fault listener?

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 5:50 PM
Subject: Re: Urgent: Soap With attachments example


I think the exception is not thrown by the invoke() method but a fault
is generated in the response.

try {
            resp = call.invoke(url, "");

            //System.out.println("Response is: " + resp);
        } catch (SOAPException e) {
         e.printStackTrace();
            System.err.println("Caught SOAPException (" +
e.getFaultCode() +
                "): " + e.getMessage());

            return null;
        }

        // Check the response.
        if (!resp.generatedFault()) {
            Parameter ret = resp.getReturnValue();
            String encodedString = (String) ret.getValue();
            String decodedString = new
String(Base64.decode(encodedString));

            //  System.out.println("XML String: " + decodedString);
            return decodedString;
        } else {

            //this is where the error is traced
            Fault fault = resp.getFault();

            System.err.println("Generated fault: ");
            System.out.println("  Fault Code   = " +
fault.getFaultCode());
            System.out.println("  Fault String = " +
fault.getFaultString());
            throw new Exception(fault.getFaultString());
        }


----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 5:18 PM
Subject: Re: Urgent: Soap With attachments example


> That's odd.  The error message is when deserializing, but the client
> only deserializes responses.  Is the line at which the exception is
> thrown doing the Call#invoke?
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 4:56 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > I am sorry about it. I didn't mean to demand the response or
anything
> like
> > that. I am just kind of under pressure and it looked like the
problem
> might
> > be in the soap tool kit (since u said it didn't handler null
arguments
> > before).
> >
> > But I appreciate your help. You have been a great help to me.
> >
> > uploadContentObject returns a base64 encoded string. But it looks
like
> the
> > request doesn't goto the server at all. I can't see the trace on the
> server
> > I should have been seen if the request comes in.
> >
> > Praveen
> >
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 4:41 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > What does uploadContentObject return, specifically, what is the
Java
> > > type?  If you have provided a mapping for it in the server's
> deployment
> > > descriptor, what is the mapping?
> > >
> > > Scott Nichol
> > >
> > > P.S.: I appreciate that you are probably working on something with
a
> > > deadline and require help to move forward, but putting "urgent" in
> the
> > > subject and asking me to "look at the error ASAP" is not the
> greatest
> > > etiquette for this list.  I am committed to helping Apache SOAP
> users
> > > and improving the Apache SOAP code, but I do so as an unpaid
> volunteer!
> > > I am also committed to making my mortgage payments ;-), so I
cannot
> > > always get to things in a timely manner.  Please try to be
patient.
> > > And, if I (or someone else on the list) cannot respond quickly
> enough,
> > > there's always the source code available for you to trace through,
> as
> > > well.
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Cc: <sn...@scottnichol.com>
> > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > Subject: Urgent: Soap With attachments example
> > >
> > >
> > > > Hi Scott,
> > > > Could you please look at the error ASAP and let me know whats
> wrong in
> > > my
> > > > code. I need to fix it ASAP.
> > > >
> > > > Thanks in Advance.
> > > >
> > > > Praveen
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > I updated my jar file with the current jar file that I got
from
> the
> > > > nightly
> > > > > build. Now this is the error I get when I pass null for
> DataHandler.
> > > > >
> > > > > Uploading ....
> > > > > uploadContentObjectUsingAttachments...
> > > > > Generated fault:
> > > > >   Fault Code   = SOAP-ENV:Client
> > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > java.lang.Exception: Can't yet deserialize non-null Objects
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > > >
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > istener.java:211)
> > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at
java.awt.Component.processEvent(Component.java:3539)
> > > > >         at
java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > >         at java.awt.Component.show(Component.java:941)
> > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > rmed(SimplexFrame.java:391)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > >         at
> > > > >
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > d(BasicMenuItemUI.java:882)
> > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at
java.awt.Component.processEvent(Component.java:3539)
> > > > >         at
java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at
> > > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > >         at
> > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > >
> > > > > Praveen
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > The newest nightly is right here:
> > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > Hey Scott,
> > > > > > > I could not find a nightly build dated yesterday or today.
> Could
> > > you
> > > > > > please
> > > > > > > check it out. If not, where can find the insturctions on
how
> to
> > > > > > compile the
> > > > > > > src, so that I can compile it and use it. Can I just
replace
> the
> > > old
> > > > > > > MimePartSerializer class file with the new one or do I
have
> to
> > > replece
> > > > > > the
> > > > > > > whole jar.
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > Praveen
> > > > > > >
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > This is a "quirk" of the MimePartSerializer.  It is used
> to
> > > > > > serialize
> > > > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.
> When a
> > > null
> > > > > > > > value is passed in for serialization, the serializer
(for
> some
> > > > > > reason)
> > > > > > > > chooses to serialize it as an Object.  That's why you
get
> the
> > > > > > mismatch.
> > > > > > > >
> > > > > > > > I'm going to change the code to use the type specified
to
> the
> > > > > > serializer
> > > > > > > > when serializing a null.  You can either grab the source
> > > > > > > >
> > > > > >
> > >
>
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > >
> > > > > >
> > >
>
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > ext/plain), compile it and use it, or wait until
tomorrow
> and
> > > get a
> > > > > > > > nightly build
(http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > >
> > > > > > > > Scott Nichol
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Scott,
> > > > > > > >
> > > > > > > > Eveyrthing seems to work fine now, except one minor
> problem.
> > > When
> > > > > > there
> > > > > > > > is nothing to send as argument I am passing in null and
> thats
> > > > > > throwing
> > > > > > > > exception. Please look at the bold lines of my code
below.
> I
> > > am
> > > > > > passing
> > > > > > > > in the type of the argument as
> > > javax.activation.DataHandler.class,
> > > > > > but
> > > > > > > > it still takes it as Object. See the exception after the
> code.
> > > Look
> > > > > > at
> > > > > > > > the 6th argument of the method. It is assuming the
object
> type
> > > as
> > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > >
> > > > > > > > Vector params = new Vector();
> > > > > > > >         params.addElement(new Parameter("sessionID",
> > > long.class,
> > > > > > > >                 new Long(sessionID), null));
> > > > > > > >         params.addElement(new Parameter("containerID",
> > > > > > > > containerID.getClass(),
> > > > > > > >                 new String(containerID), null));
> > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > xmlString.getClass(),
> > > > > > > >                 new String(xmlString), null));
> > > > > > > >
> > > > > > > >         DataSource ds = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > >                 javax.activation.DataHandler.class, dh,
> > > null));
> > > > > > > >
> > > > > > > >         //            params.addElement(new
> > > > > > Parameter("encodedSource",
> > > > > > > > encodedSource.getClass(), new String(encodedSource),
> null));
> > > > > > > >         params.addElement(new
Parameter("sourceFileName",
> > > > > > > >                 sourceFileName.getClass(), new
> > > > > > String(sourceFileName),
> > > > > > > > null));
> > > > > > > >
> > > > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >             dh = new DataHandler(ds);
> > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > >                     javax.activation.DataHandler.class,
> dh,
> > > null));
> > > > > > > >             params.addElement(new
> Parameter("thumbFileName",
> > > > > > > >                     thumbFileName.getClass(), new
> > > > > > String(thumbFileName),
> > > > > > > > null));
> > > > > > > >         } else {
> > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > >                     javax.activation.DataHandler.class,
> null,
> > > > > > null));
> > > > > > > >             params.addElement(new
> Parameter("thumbFileName",
> > > > > > > >                     new String().getClass(), null,
null));
> > > > > > > >         }
> > > > > > > >
> > > > > > > > Exception trace is as follows:
> > > > > > > >
> > > > > > > > Generated fault:
> > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > >   Fault String = Exception while handling service
request:
> > > > > > > > com.contextmedia.ip.s
> > > > > > > >
> > > > > >
> > >
>
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > ing,java
> > > > > > > >
> > > > > >
> > >
>
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > ect,java
> > > > > > > > .lang.String) -- no signature match
> > > > > > > > java.lang.Exception: Exception while handling service
> request:
> > > > > > > > com.contextmedia.
> > > > > > > >
> > > > > >
> > >
>
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > .String,
> > > > > > > >
> > > > > >
> > >
>
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > .Object,
> > > > > > > > java.lang.String) -- no signature match
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > istener.java:211)
> > > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > > >         at
> java.awt.Component.setVisible(Component.java:898)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at
> > > > > > > >
> > >
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > >         at
> > > > > >
java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > As a general recommendation, I encourage you to
capture
> a
> > > stack
> > > > > > trace
> > > > > > > > > for your exceptions.  Just having the exception
message
> > > makes it
> > > > > > > > harder
> > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > >
> > > > > > > > > This particular exception means that a
> ByteArrayDataSource
> > > was
> > > > > > created
> > > > > > > > > with no data array, such as passing a null for the
byte
> > > array.
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > > > >
> > > > > > > > > > BUt I have another problem. When I execute that
> method, I
> > > get
> > > > > > the
> > > > > > > > > following
> > > > > > > > > > exception.
> > > > > > > > > >
> > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > >
> > > > > > > > > > What does this mean? I double checked that my soap
> method
> > > exists
> > > > > > in
> > > > > > > > > the
> > > > > > > > > > descriptor and the implementation also exists on the
> > > server
> > > > > > side.
> > > > > > > > But
> > > > > > > > > the
> > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > >
> > > > > > > > > > Praveen
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > This sample that I created from you code works for
> me,
> > > i.e. it
> > > > > > > > does
> > > > > > > > > not
> > > > > > > > > > > throw an NPE.
> > > > > > > > > > >
> > > > > > > > > > > Scott Nichol
> > > > > > > > > > >
> > > > > > > > > > > import java.io.*;
> > > > > > > > > > > import java.util.*;
> > > > > > > > > > > import java.net.*;
> > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > >
> > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > >   try {
> > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > >
> > > > > > > > > > >    // Build the call.
> > > > > > > > > > >    SOAPMappingRegistry smr = new
> SOAPMappingRegistry();
> > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > >
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > >
> > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > >
> > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > >    DataSource ds = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > >     javax.activation.DataHandler.class, dh,
null));
> > > > > > > > > > >
> > > > > > > > > > >    DataSource ds2 = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > >     dh2, null));
> > > > > > > > > > >
> > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > >
> > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > >    Response resp;
> > > > > > > > > > >
> > > > > > > > > > >    try {
> > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > >    }
> > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > >   }
> > > > > > > > > > >  }
> > > > > > > > > > > }
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
Interesting.  Do you do anything special to generate the fault, such as
registering a fault listener?

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 5:50 PM
Subject: Re: Urgent: Soap With attachments example


I think the exception is not thrown by the invoke() method but a fault
is generated in the response.

try {
            resp = call.invoke(url, "");

            //System.out.println("Response is: " + resp);
        } catch (SOAPException e) {
         e.printStackTrace();
            System.err.println("Caught SOAPException (" +
e.getFaultCode() +
                "): " + e.getMessage());

            return null;
        }

        // Check the response.
        if (!resp.generatedFault()) {
            Parameter ret = resp.getReturnValue();
            String encodedString = (String) ret.getValue();
            String decodedString = new
String(Base64.decode(encodedString));

            //  System.out.println("XML String: " + decodedString);
            return decodedString;
        } else {

            //this is where the error is traced
            Fault fault = resp.getFault();

            System.err.println("Generated fault: ");
            System.out.println("  Fault Code   = " +
fault.getFaultCode());
            System.out.println("  Fault String = " +
fault.getFaultString());
            throw new Exception(fault.getFaultString());
        }


----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 5:18 PM
Subject: Re: Urgent: Soap With attachments example


> That's odd.  The error message is when deserializing, but the client
> only deserializes responses.  Is the line at which the exception is
> thrown doing the Call#invoke?
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 4:56 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > I am sorry about it. I didn't mean to demand the response or
anything
> like
> > that. I am just kind of under pressure and it looked like the
problem
> might
> > be in the soap tool kit (since u said it didn't handler null
arguments
> > before).
> >
> > But I appreciate your help. You have been a great help to me.
> >
> > uploadContentObject returns a base64 encoded string. But it looks
like
> the
> > request doesn't goto the server at all. I can't see the trace on the
> server
> > I should have been seen if the request comes in.
> >
> > Praveen
> >
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 4:41 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > What does uploadContentObject return, specifically, what is the
Java
> > > type?  If you have provided a mapping for it in the server's
> deployment
> > > descriptor, what is the mapping?
> > >
> > > Scott Nichol
> > >
> > > P.S.: I appreciate that you are probably working on something with
a
> > > deadline and require help to move forward, but putting "urgent" in
> the
> > > subject and asking me to "look at the error ASAP" is not the
> greatest
> > > etiquette for this list.  I am committed to helping Apache SOAP
> users
> > > and improving the Apache SOAP code, but I do so as an unpaid
> volunteer!
> > > I am also committed to making my mortgage payments ;-), so I
cannot
> > > always get to things in a timely manner.  Please try to be
patient.
> > > And, if I (or someone else on the list) cannot respond quickly
> enough,
> > > there's always the source code available for you to trace through,
> as
> > > well.
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Cc: <sn...@scottnichol.com>
> > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > Subject: Urgent: Soap With attachments example
> > >
> > >
> > > > Hi Scott,
> > > > Could you please look at the error ASAP and let me know whats
> wrong in
> > > my
> > > > code. I need to fix it ASAP.
> > > >
> > > > Thanks in Advance.
> > > >
> > > > Praveen
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > I updated my jar file with the current jar file that I got
from
> the
> > > > nightly
> > > > > build. Now this is the error I get when I pass null for
> DataHandler.
> > > > >
> > > > > Uploading ....
> > > > > uploadContentObjectUsingAttachments...
> > > > > Generated fault:
> > > > >   Fault Code   = SOAP-ENV:Client
> > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > java.lang.Exception: Can't yet deserialize non-null Objects
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > > >
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > istener.java:211)
> > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at
java.awt.Component.processEvent(Component.java:3539)
> > > > >         at
java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > >         at java.awt.Component.show(Component.java:941)
> > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > rmed(SimplexFrame.java:391)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > >         at
> > > > >
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > d(BasicMenuItemUI.java:882)
> > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at
java.awt.Component.processEvent(Component.java:3539)
> > > > >         at
java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at
> > > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > >         at
> > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > >
> > > > > Praveen
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > The newest nightly is right here:
> > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > Hey Scott,
> > > > > > > I could not find a nightly build dated yesterday or today.
> Could
> > > you
> > > > > > please
> > > > > > > check it out. If not, where can find the insturctions on
how
> to
> > > > > > compile the
> > > > > > > src, so that I can compile it and use it. Can I just
replace
> the
> > > old
> > > > > > > MimePartSerializer class file with the new one or do I
have
> to
> > > replece
> > > > > > the
> > > > > > > whole jar.
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > Praveen
> > > > > > >
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > This is a "quirk" of the MimePartSerializer.  It is used
> to
> > > > > > serialize
> > > > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.
> When a
> > > null
> > > > > > > > value is passed in for serialization, the serializer
(for
> some
> > > > > > reason)
> > > > > > > > chooses to serialize it as an Object.  That's why you
get
> the
> > > > > > mismatch.
> > > > > > > >
> > > > > > > > I'm going to change the code to use the type specified
to
> the
> > > > > > serializer
> > > > > > > > when serializing a null.  You can either grab the source
> > > > > > > >
> > > > > >
> > >
>
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > >
> > > > > >
> > >
>
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > ext/plain), compile it and use it, or wait until
tomorrow
> and
> > > get a
> > > > > > > > nightly build
(http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > >
> > > > > > > > Scott Nichol
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Scott,
> > > > > > > >
> > > > > > > > Eveyrthing seems to work fine now, except one minor
> problem.
> > > When
> > > > > > there
> > > > > > > > is nothing to send as argument I am passing in null and
> thats
> > > > > > throwing
> > > > > > > > exception. Please look at the bold lines of my code
below.
> I
> > > am
> > > > > > passing
> > > > > > > > in the type of the argument as
> > > javax.activation.DataHandler.class,
> > > > > > but
> > > > > > > > it still takes it as Object. See the exception after the
> code.
> > > Look
> > > > > > at
> > > > > > > > the 6th argument of the method. It is assuming the
object
> type
> > > as
> > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > >
> > > > > > > > Vector params = new Vector();
> > > > > > > >         params.addElement(new Parameter("sessionID",
> > > long.class,
> > > > > > > >                 new Long(sessionID), null));
> > > > > > > >         params.addElement(new Parameter("containerID",
> > > > > > > > containerID.getClass(),
> > > > > > > >                 new String(containerID), null));
> > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > xmlString.getClass(),
> > > > > > > >                 new String(xmlString), null));
> > > > > > > >
> > > > > > > >         DataSource ds = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > >                 javax.activation.DataHandler.class, dh,
> > > null));
> > > > > > > >
> > > > > > > >         //            params.addElement(new
> > > > > > Parameter("encodedSource",
> > > > > > > > encodedSource.getClass(), new String(encodedSource),
> null));
> > > > > > > >         params.addElement(new
Parameter("sourceFileName",
> > > > > > > >                 sourceFileName.getClass(), new
> > > > > > String(sourceFileName),
> > > > > > > > null));
> > > > > > > >
> > > > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >             dh = new DataHandler(ds);
> > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > >                     javax.activation.DataHandler.class,
> dh,
> > > null));
> > > > > > > >             params.addElement(new
> Parameter("thumbFileName",
> > > > > > > >                     thumbFileName.getClass(), new
> > > > > > String(thumbFileName),
> > > > > > > > null));
> > > > > > > >         } else {
> > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > >                     javax.activation.DataHandler.class,
> null,
> > > > > > null));
> > > > > > > >             params.addElement(new
> Parameter("thumbFileName",
> > > > > > > >                     new String().getClass(), null,
null));
> > > > > > > >         }
> > > > > > > >
> > > > > > > > Exception trace is as follows:
> > > > > > > >
> > > > > > > > Generated fault:
> > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > >   Fault String = Exception while handling service
request:
> > > > > > > > com.contextmedia.ip.s
> > > > > > > >
> > > > > >
> > >
>
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > ing,java
> > > > > > > >
> > > > > >
> > >
>
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > ect,java
> > > > > > > > .lang.String) -- no signature match
> > > > > > > > java.lang.Exception: Exception while handling service
> request:
> > > > > > > > com.contextmedia.
> > > > > > > >
> > > > > >
> > >
>
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > .String,
> > > > > > > >
> > > > > >
> > >
>
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > .Object,
> > > > > > > > java.lang.String) -- no signature match
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > istener.java:211)
> > > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > > >         at
> java.awt.Component.setVisible(Component.java:898)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at
> > > > > > > >
> > >
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > >         at
> > > > > >
java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > As a general recommendation, I encourage you to
capture
> a
> > > stack
> > > > > > trace
> > > > > > > > > for your exceptions.  Just having the exception
message
> > > makes it
> > > > > > > > harder
> > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > >
> > > > > > > > > This particular exception means that a
> ByteArrayDataSource
> > > was
> > > > > > created
> > > > > > > > > with no data array, such as passing a null for the
byte
> > > array.
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > > > >
> > > > > > > > > > BUt I have another problem. When I execute that
> method, I
> > > get
> > > > > > the
> > > > > > > > > following
> > > > > > > > > > exception.
> > > > > > > > > >
> > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > >
> > > > > > > > > > What does this mean? I double checked that my soap
> method
> > > exists
> > > > > > in
> > > > > > > > > the
> > > > > > > > > > descriptor and the implementation also exists on the
> > > server
> > > > > > side.
> > > > > > > > But
> > > > > > > > > the
> > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > >
> > > > > > > > > > Praveen
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > This sample that I created from you code works for
> me,
> > > i.e. it
> > > > > > > > does
> > > > > > > > > not
> > > > > > > > > > > throw an NPE.
> > > > > > > > > > >
> > > > > > > > > > > Scott Nichol
> > > > > > > > > > >
> > > > > > > > > > > import java.io.*;
> > > > > > > > > > > import java.util.*;
> > > > > > > > > > > import java.net.*;
> > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > >
> > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > >   try {
> > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > >
> > > > > > > > > > >    // Build the call.
> > > > > > > > > > >    SOAPMappingRegistry smr = new
> SOAPMappingRegistry();
> > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > >
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > >
> > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > >
> > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > >    DataSource ds = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > >     javax.activation.DataHandler.class, dh,
null));
> > > > > > > > > > >
> > > > > > > > > > >    DataSource ds2 = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > >     dh2, null));
> > > > > > > > > > >
> > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > >
> > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > >    Response resp;
> > > > > > > > > > >
> > > > > > > > > > >    try {
> > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > >    }
> > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > >   }
> > > > > > > > > > >  }
> > > > > > > > > > > }
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
I think the exception is not thrown by the invoke() method but a fault is generated in the response.

try {
            resp = call.invoke(url, "");

            //System.out.println("Response is: " + resp);
        } catch (SOAPException e) {
         e.printStackTrace();
            System.err.println("Caught SOAPException (" + e.getFaultCode() +
                "): " + e.getMessage());

            return null;
        }

        // Check the response.
        if (!resp.generatedFault()) {
            Parameter ret = resp.getReturnValue();
            String encodedString = (String) ret.getValue();
            String decodedString = new String(Base64.decode(encodedString));

            //  System.out.println("XML String: " + decodedString);
            return decodedString;
        } else {

            //this is where the error is traced
            Fault fault = resp.getFault();

            System.err.println("Generated fault: ");
            System.out.println("  Fault Code   = " + fault.getFaultCode());
            System.out.println("  Fault String = " + fault.getFaultString());
            throw new Exception(fault.getFaultString());
        }


----- Original Message ----- 
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 5:18 PM
Subject: Re: Urgent: Soap With attachments example


> That's odd.  The error message is when deserializing, but the client
> only deserializes responses.  Is the line at which the exception is
> thrown doing the Call#invoke?
> 
> Scott Nichol
> 
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 4:56 PM
> Subject: Re: Urgent: Soap With attachments example
> 
> 
> > I am sorry about it. I didn't mean to demand the response or anything
> like
> > that. I am just kind of under pressure and it looked like the problem
> might
> > be in the soap tool kit (since u said it didn't handler null arguments
> > before).
> >
> > But I appreciate your help. You have been a great help to me.
> >
> > uploadContentObject returns a base64 encoded string. But it looks like
> the
> > request doesn't goto the server at all. I can't see the trace on the
> server
> > I should have been seen if the request comes in.
> >
> > Praveen
> >
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 4:41 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > What does uploadContentObject return, specifically, what is the Java
> > > type?  If you have provided a mapping for it in the server's
> deployment
> > > descriptor, what is the mapping?
> > >
> > > Scott Nichol
> > >
> > > P.S.: I appreciate that you are probably working on something with a
> > > deadline and require help to move forward, but putting "urgent" in
> the
> > > subject and asking me to "look at the error ASAP" is not the
> greatest
> > > etiquette for this list.  I am committed to helping Apache SOAP
> users
> > > and improving the Apache SOAP code, but I do so as an unpaid
> volunteer!
> > > I am also committed to making my mortgage payments ;-), so I cannot
> > > always get to things in a timely manner.  Please try to be patient.
> > > And, if I (or someone else on the list) cannot respond quickly
> enough,
> > > there's always the source code available for you to trace through,
> as
> > > well.
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Cc: <sn...@scottnichol.com>
> > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > Subject: Urgent: Soap With attachments example
> > >
> > >
> > > > Hi Scott,
> > > > Could you please look at the error ASAP and let me know whats
> wrong in
> > > my
> > > > code. I need to fix it ASAP.
> > > >
> > > > Thanks in Advance.
> > > >
> > > > Praveen
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > I updated my jar file with the current jar file that I got from
> the
> > > > nightly
> > > > > build. Now this is the error I get when I pass null for
> DataHandler.
> > > > >
> > > > > Uploading ....
> > > > > uploadContentObjectUsingAttachments...
> > > > > Generated fault:
> > > > >   Fault Code   = SOAP-ENV:Client
> > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > java.lang.Exception: Can't yet deserialize non-null Objects
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > > >
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > istener.java:211)
> > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > >         at java.awt.Component.show(Component.java:941)
> > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > rmed(SimplexFrame.java:391)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > >         at
> > > > >
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > d(BasicMenuItemUI.java:882)
> > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at
> > > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > >         at
> > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > >
> > > > > Praveen
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > The newest nightly is right here:
> > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > Hey Scott,
> > > > > > > I could not find a nightly build dated yesterday or today.
> Could
> > > you
> > > > > > please
> > > > > > > check it out. If not, where can find the insturctions on how
> to
> > > > > > compile the
> > > > > > > src, so that I can compile it and use it. Can I just replace
> the
> > > old
> > > > > > > MimePartSerializer class file with the new one or do I have
> to
> > > replece
> > > > > > the
> > > > > > > whole jar.
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > Praveen
> > > > > > >
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > This is a "quirk" of the MimePartSerializer.  It is used
> to
> > > > > > serialize
> > > > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.
> When a
> > > null
> > > > > > > > value is passed in for serialization, the serializer (for
> some
> > > > > > reason)
> > > > > > > > chooses to serialize it as an Object.  That's why you get
> the
> > > > > > mismatch.
> > > > > > > >
> > > > > > > > I'm going to change the code to use the type specified to
> the
> > > > > > serializer
> > > > > > > > when serializing a null.  You can either grab the source
> > > > > > > >
> > > > > >
> > >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > >
> > > > > >
> > >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > ext/plain), compile it and use it, or wait until tomorrow
> and
> > > get a
> > > > > > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > >
> > > > > > > > Scott Nichol
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Scott,
> > > > > > > >
> > > > > > > > Eveyrthing seems to work fine now, except one minor
> problem.
> > > When
> > > > > > there
> > > > > > > > is nothing to send as argument I am passing in null and
> thats
> > > > > > throwing
> > > > > > > > exception. Please look at the bold lines of my code below.
> I
> > > am
> > > > > > passing
> > > > > > > > in the type of the argument as
> > > javax.activation.DataHandler.class,
> > > > > > but
> > > > > > > > it still takes it as Object. See the exception after the
> code.
> > > Look
> > > > > > at
> > > > > > > > the 6th argument of the method. It is assuming the object
> type
> > > as
> > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > >
> > > > > > > > Vector params = new Vector();
> > > > > > > >         params.addElement(new Parameter("sessionID",
> > > long.class,
> > > > > > > >                 new Long(sessionID), null));
> > > > > > > >         params.addElement(new Parameter("containerID",
> > > > > > > > containerID.getClass(),
> > > > > > > >                 new String(containerID), null));
> > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > xmlString.getClass(),
> > > > > > > >                 new String(xmlString), null));
> > > > > > > >
> > > > > > > >         DataSource ds = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > >                 javax.activation.DataHandler.class, dh,
> > > null));
> > > > > > > >
> > > > > > > >         //            params.addElement(new
> > > > > > Parameter("encodedSource",
> > > > > > > > encodedSource.getClass(), new String(encodedSource),
> null));
> > > > > > > >         params.addElement(new Parameter("sourceFileName",
> > > > > > > >                 sourceFileName.getClass(), new
> > > > > > String(sourceFileName),
> > > > > > > > null));
> > > > > > > >
> > > > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >             dh = new DataHandler(ds);
> > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > >                     javax.activation.DataHandler.class,
> dh,
> > > null));
> > > > > > > >             params.addElement(new
> Parameter("thumbFileName",
> > > > > > > >                     thumbFileName.getClass(), new
> > > > > > String(thumbFileName),
> > > > > > > > null));
> > > > > > > >         } else {
> > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > >                     javax.activation.DataHandler.class,
> null,
> > > > > > null));
> > > > > > > >             params.addElement(new
> Parameter("thumbFileName",
> > > > > > > >                     new String().getClass(), null, null));
> > > > > > > >         }
> > > > > > > >
> > > > > > > > Exception trace is as follows:
> > > > > > > >
> > > > > > > > Generated fault:
> > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > >   Fault String = Exception while handling service request:
> > > > > > > > com.contextmedia.ip.s
> > > > > > > >
> > > > > >
> > >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > ing,java
> > > > > > > >
> > > > > >
> > >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > ect,java
> > > > > > > > .lang.String) -- no signature match
> > > > > > > > java.lang.Exception: Exception while handling service
> request:
> > > > > > > > com.contextmedia.
> > > > > > > >
> > > > > >
> > >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > .String,
> > > > > > > >
> > > > > >
> > >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > .Object,
> > > > > > > > java.lang.String) -- no signature match
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > istener.java:211)
> > > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > > >         at
> java.awt.Component.setVisible(Component.java:898)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at
> > > > > > > >
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > >         at
> > > > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > As a general recommendation, I encourage you to capture
> a
> > > stack
> > > > > > trace
> > > > > > > > > for your exceptions.  Just having the exception message
> > > makes it
> > > > > > > > harder
> > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > >
> > > > > > > > > This particular exception means that a
> ByteArrayDataSource
> > > was
> > > > > > created
> > > > > > > > > with no data array, such as passing a null for the byte
> > > array.
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > > > >
> > > > > > > > > > BUt I have another problem. When I execute that
> method, I
> > > get
> > > > > > the
> > > > > > > > > following
> > > > > > > > > > exception.
> > > > > > > > > >
> > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > >
> > > > > > > > > > What does this mean? I double checked that my soap
> method
> > > exists
> > > > > > in
> > > > > > > > > the
> > > > > > > > > > descriptor and the implementation also exists on the
> > > server
> > > > > > side.
> > > > > > > > But
> > > > > > > > > the
> > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > >
> > > > > > > > > > Praveen
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > This sample that I created from you code works for
> me,
> > > i.e. it
> > > > > > > > does
> > > > > > > > > not
> > > > > > > > > > > throw an NPE.
> > > > > > > > > > >
> > > > > > > > > > > Scott Nichol
> > > > > > > > > > >
> > > > > > > > > > > import java.io.*;
> > > > > > > > > > > import java.util.*;
> > > > > > > > > > > import java.net.*;
> > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > >
> > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > >   try {
> > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > >
> > > > > > > > > > >    // Build the call.
> > > > > > > > > > >    SOAPMappingRegistry smr = new
> SOAPMappingRegistry();
> > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > >
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > >
> > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > >
> > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > >    DataSource ds = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > > > > > >
> > > > > > > > > > >    DataSource ds2 = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > >     dh2, null));
> > > > > > > > > > >
> > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > >
> > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > >    Response resp;
> > > > > > > > > > >
> > > > > > > > > > >    try {
> > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > >    }
> > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > >   }
> > > > > > > > > > >  }
> > > > > > > > > > > }
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
> 

Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
I think the exception is not thrown by the invoke() method but a fault is generated in the response.

try {
            resp = call.invoke(url, "");

            //System.out.println("Response is: " + resp);
        } catch (SOAPException e) {
         e.printStackTrace();
            System.err.println("Caught SOAPException (" + e.getFaultCode() +
                "): " + e.getMessage());

            return null;
        }

        // Check the response.
        if (!resp.generatedFault()) {
            Parameter ret = resp.getReturnValue();
            String encodedString = (String) ret.getValue();
            String decodedString = new String(Base64.decode(encodedString));

            //  System.out.println("XML String: " + decodedString);
            return decodedString;
        } else {

            //this is where the error is traced
            Fault fault = resp.getFault();

            System.err.println("Generated fault: ");
            System.out.println("  Fault Code   = " + fault.getFaultCode());
            System.out.println("  Fault String = " + fault.getFaultString());
            throw new Exception(fault.getFaultString());
        }


----- Original Message ----- 
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 5:18 PM
Subject: Re: Urgent: Soap With attachments example


> That's odd.  The error message is when deserializing, but the client
> only deserializes responses.  Is the line at which the exception is
> thrown doing the Call#invoke?
> 
> Scott Nichol
> 
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 4:56 PM
> Subject: Re: Urgent: Soap With attachments example
> 
> 
> > I am sorry about it. I didn't mean to demand the response or anything
> like
> > that. I am just kind of under pressure and it looked like the problem
> might
> > be in the soap tool kit (since u said it didn't handler null arguments
> > before).
> >
> > But I appreciate your help. You have been a great help to me.
> >
> > uploadContentObject returns a base64 encoded string. But it looks like
> the
> > request doesn't goto the server at all. I can't see the trace on the
> server
> > I should have been seen if the request comes in.
> >
> > Praveen
> >
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 4:41 PM
> > Subject: Re: Urgent: Soap With attachments example
> >
> >
> > > What does uploadContentObject return, specifically, what is the Java
> > > type?  If you have provided a mapping for it in the server's
> deployment
> > > descriptor, what is the mapping?
> > >
> > > Scott Nichol
> > >
> > > P.S.: I appreciate that you are probably working on something with a
> > > deadline and require help to move forward, but putting "urgent" in
> the
> > > subject and asking me to "look at the error ASAP" is not the
> greatest
> > > etiquette for this list.  I am committed to helping Apache SOAP
> users
> > > and improving the Apache SOAP code, but I do so as an unpaid
> volunteer!
> > > I am also committed to making my mortgage payments ;-), so I cannot
> > > always get to things in a timely manner.  Please try to be patient.
> > > And, if I (or someone else on the list) cannot respond quickly
> enough,
> > > there's always the source code available for you to trace through,
> as
> > > well.
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Cc: <sn...@scottnichol.com>
> > > Sent: Tuesday, January 07, 2003 4:22 PM
> > > Subject: Urgent: Soap With attachments example
> > >
> > >
> > > > Hi Scott,
> > > > Could you please look at the error ASAP and let me know whats
> wrong in
> > > my
> > > > code. I need to fix it ASAP.
> > > >
> > > > Thanks in Advance.
> > > >
> > > > Praveen
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > I updated my jar file with the current jar file that I got from
> the
> > > > nightly
> > > > > build. Now this is the error I get when I pass null for
> DataHandler.
> > > > >
> > > > > Uploading ....
> > > > > uploadContentObjectUsingAttachments...
> > > > > Generated fault:
> > > > >   Fault Code   = SOAP-ENV:Client
> > > > >   Fault String = Can't yet deserialize non-null Objects
> > > > > java.lang.Exception: Can't yet deserialize non-null Objects
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > > >
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > istener.java:211)
> > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > >         at java.awt.Component.show(Component.java:941)
> > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > >         at
> > > > >
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > rmed(SimplexFrame.java:391)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > >         at
> > > > >
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > d(BasicMenuItemUI.java:882)
> > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at
> > > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > >         at
> > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > >
> > > > > Praveen
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > The newest nightly is right here:
> > > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > Hey Scott,
> > > > > > > I could not find a nightly build dated yesterday or today.
> Could
> > > you
> > > > > > please
> > > > > > > check it out. If not, where can find the insturctions on how
> to
> > > > > > compile the
> > > > > > > src, so that I can compile it and use it. Can I just replace
> the
> > > old
> > > > > > > MimePartSerializer class file with the new one or do I have
> to
> > > replece
> > > > > > the
> > > > > > > whole jar.
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > Praveen
> > > > > > >
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > This is a "quirk" of the MimePartSerializer.  It is used
> to
> > > > > > serialize
> > > > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.
> When a
> > > null
> > > > > > > > value is passed in for serialization, the serializer (for
> some
> > > > > > reason)
> > > > > > > > chooses to serialize it as an Object.  That's why you get
> the
> > > > > > mismatch.
> > > > > > > >
> > > > > > > > I'm going to change the code to use the type specified to
> the
> > > > > > serializer
> > > > > > > > when serializing a null.  You can either grab the source
> > > > > > > >
> > > > > >
> > >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > > >
> > > > > >
> > >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > > ext/plain), compile it and use it, or wait until tomorrow
> and
> > > get a
> > > > > > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > > >
> > > > > > > > Scott Nichol
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Scott,
> > > > > > > >
> > > > > > > > Eveyrthing seems to work fine now, except one minor
> problem.
> > > When
> > > > > > there
> > > > > > > > is nothing to send as argument I am passing in null and
> thats
> > > > > > throwing
> > > > > > > > exception. Please look at the bold lines of my code below.
> I
> > > am
> > > > > > passing
> > > > > > > > in the type of the argument as
> > > javax.activation.DataHandler.class,
> > > > > > but
> > > > > > > > it still takes it as Object. See the exception after the
> code.
> > > Look
> > > > > > at
> > > > > > > > the 6th argument of the method. It is assuming the object
> type
> > > as
> > > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > > >
> > > > > > > > Vector params = new Vector();
> > > > > > > >         params.addElement(new Parameter("sessionID",
> > > long.class,
> > > > > > > >                 new Long(sessionID), null));
> > > > > > > >         params.addElement(new Parameter("containerID",
> > > > > > > > containerID.getClass(),
> > > > > > > >                 new String(containerID), null));
> > > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > > xmlString.getClass(),
> > > > > > > >                 new String(xmlString), null));
> > > > > > > >
> > > > > > > >         DataSource ds = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > > >         params.addElement(new Parameter("source",
> > > > > > > >                 javax.activation.DataHandler.class, dh,
> > > null));
> > > > > > > >
> > > > > > > >         //            params.addElement(new
> > > > > > Parameter("encodedSource",
> > > > > > > > encodedSource.getClass(), new String(encodedSource),
> null));
> > > > > > > >         params.addElement(new Parameter("sourceFileName",
> > > > > > > >                 sourceFileName.getClass(), new
> > > > > > String(sourceFileName),
> > > > > > > > null));
> > > > > > > >
> > > > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >             dh = new DataHandler(ds);
> > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > >                     javax.activation.DataHandler.class,
> dh,
> > > null));
> > > > > > > >             params.addElement(new
> Parameter("thumbFileName",
> > > > > > > >                     thumbFileName.getClass(), new
> > > > > > String(thumbFileName),
> > > > > > > > null));
> > > > > > > >         } else {
> > > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > > >                     javax.activation.DataHandler.class,
> null,
> > > > > > null));
> > > > > > > >             params.addElement(new
> Parameter("thumbFileName",
> > > > > > > >                     new String().getClass(), null, null));
> > > > > > > >         }
> > > > > > > >
> > > > > > > > Exception trace is as follows:
> > > > > > > >
> > > > > > > > Generated fault:
> > > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > > >   Fault String = Exception while handling service request:
> > > > > > > > com.contextmedia.ip.s
> > > > > > > >
> > > > > >
> > >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > > ing,java
> > > > > > > >
> > > > > >
> > >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > > ect,java
> > > > > > > > .lang.String) -- no signature match
> > > > > > > > java.lang.Exception: Exception while handling service
> request:
> > > > > > > > com.contextmedia.
> > > > > > > >
> > > > > >
> > >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > > .String,
> > > > > > > >
> > > > > >
> > >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > > .Object,
> > > > > > > > java.lang.String) -- no signature match
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > > istener.java:211)
> > > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > > >         at
> java.awt.Component.setVisible(Component.java:898)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > > rmed(SimplexFrame.java:391)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > > 45)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > > ctButton.java:1499)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > > .java:373)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > > )
> > > > > > > >         at
> > > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > > >         at
> > > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > > >         at
> > > java.awt.Component.processEvent(Component.java:3539)
> > > > > > > >         at
> > > java.awt.Container.processEvent(Container.java:1159)
> > > > > > > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > > )
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > > >
> > > > > > > >         at
> > > > > > > >
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > > >         at
> java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > > >         at
> > > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > > >         at
> > > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > > read.java:126)
> > > > > > > >         at
> > > > > > > >
> > > > > >
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > > ad.java:93)
> > > > > > > >         at
> > > > > > > >
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > > >         at
> > > > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > As a general recommendation, I encourage you to capture
> a
> > > stack
> > > > > > trace
> > > > > > > > > for your exceptions.  Just having the exception message
> > > makes it
> > > > > > > > harder
> > > > > > > > > to understand the cause of most exceptions.
> > > > > > > > >
> > > > > > > > > This particular exception means that a
> ByteArrayDataSource
> > > was
> > > > > > created
> > > > > > > > > with no data array, such as passing a null for the byte
> > > array.
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > > > >
> > > > > > > > > > BUt I have another problem. When I execute that
> method, I
> > > get
> > > > > > the
> > > > > > > > > following
> > > > > > > > > > exception.
> > > > > > > > > >
> > > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > > >
> > > > > > > > > > What does this mean? I double checked that my soap
> method
> > > exists
> > > > > > in
> > > > > > > > > the
> > > > > > > > > > descriptor and the implementation also exists on the
> > > server
> > > > > > side.
> > > > > > > > But
> > > > > > > > > the
> > > > > > > > > > call doesn't reach the server at all.
> > > > > > > > > >
> > > > > > > > > > Praveen
> > > > > > > > > > ----- Original Message -----
> > > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > This sample that I created from you code works for
> me,
> > > i.e. it
> > > > > > > > does
> > > > > > > > > not
> > > > > > > > > > > throw an NPE.
> > > > > > > > > > >
> > > > > > > > > > > Scott Nichol
> > > > > > > > > > >
> > > > > > > > > > > import java.io.*;
> > > > > > > > > > > import java.util.*;
> > > > > > > > > > > import java.net.*;
> > > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > > import javax.activation.*;
> > > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > > >
> > > > > > > > > > > public class TestAttachments {
> > > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > > >   try {
> > > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > > >
> > > > > > > > > > >    // Build the call.
> > > > > > > > > > >    SOAPMappingRegistry smr = new
> SOAPMappingRegistry();
> > > > > > > > > > >    Call call = new Call();
> > > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > > >
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > > >
> > > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > > >
> > > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > > >    DataSource ds = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > > > > > >
> > > > > > > > > > >    DataSource ds2 = new
> ByteArrayDataSource(sourceBytes,
> > > > > > > > > > > "application/octet-stream");
> > > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > > >     dh2, null));
> > > > > > > > > > >
> > > > > > > > > > >    call.setParams(params);
> > > > > > > > > > >
> > > > > > > > > > >    // Invoke the call.
> > > > > > > > > > >    Response resp;
> > > > > > > > > > >
> > > > > > > > > > >    try {
> > > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > > > >     e.printStackTrace();
> > > > > > > > > > >    }
> > > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > > >    e.printStackTrace();
> > > > > > > > > > >   }
> > > > > > > > > > >  }
> > > > > > > > > > > }
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
> 

Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
That's odd.  The error message is when deserializing, but the client
only deserializes responses.  Is the line at which the exception is
thrown doing the Call#invoke?

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 4:56 PM
Subject: Re: Urgent: Soap With attachments example


> I am sorry about it. I didn't mean to demand the response or anything
like
> that. I am just kind of under pressure and it looked like the problem
might
> be in the soap tool kit (since u said it didn't handler null arguments
> before).
>
> But I appreciate your help. You have been a great help to me.
>
> uploadContentObject returns a base64 encoded string. But it looks like
the
> request doesn't goto the server at all. I can't see the trace on the
server
> I should have been seen if the request comes in.
>
> Praveen
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 4:41 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > What does uploadContentObject return, specifically, what is the Java
> > type?  If you have provided a mapping for it in the server's
deployment
> > descriptor, what is the mapping?
> >
> > Scott Nichol
> >
> > P.S.: I appreciate that you are probably working on something with a
> > deadline and require help to move forward, but putting "urgent" in
the
> > subject and asking me to "look at the error ASAP" is not the
greatest
> > etiquette for this list.  I am committed to helping Apache SOAP
users
> > and improving the Apache SOAP code, but I do so as an unpaid
volunteer!
> > I am also committed to making my mortgage payments ;-), so I cannot
> > always get to things in a timely manner.  Please try to be patient.
> > And, if I (or someone else on the list) cannot respond quickly
enough,
> > there's always the source code available for you to trace through,
as
> > well.
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Cc: <sn...@scottnichol.com>
> > Sent: Tuesday, January 07, 2003 4:22 PM
> > Subject: Urgent: Soap With attachments example
> >
> >
> > > Hi Scott,
> > > Could you please look at the error ASAP and let me know whats
wrong in
> > my
> > > code. I need to fix it ASAP.
> > >
> > > Thanks in Advance.
> > >
> > > Praveen
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > I updated my jar file with the current jar file that I got from
the
> > > nightly
> > > > build. Now this is the error I get when I pass null for
DataHandler.
> > > >
> > > > Uploading ....
> > > > uploadContentObjectUsingAttachments...
> > > > Generated fault:
> > > >   Fault Code   = SOAP-ENV:Client
> > > >   Fault String = Can't yet deserialize non-null Objects
> > > > java.lang.Exception: Can't yet deserialize non-null Objects
> > > >         at
> > > >
> >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > >         at
> > > >
> >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > >         at
> > > >
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > 45)
> > > >         at
> > > >
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > ctButton.java:1499)
> > > >         at
> > > >
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > .java:373)
> > > >         at
> > > >
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > )
> > > >         at
> > > >
> >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > istener.java:211)
> > > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
> > > >
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > )
> > > >         at
> > > >
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > >
> > > >         at
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > >         at
> > > >
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > read.java:126)
> > > >         at
> > > >
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > ad.java:93)
> > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > >         at java.awt.Component.show(Component.java:941)
> > > >         at java.awt.Component.setVisible(Component.java:898)
> > > >         at
> > > >
> >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > rmed(SimplexFrame.java:391)
> > > >         at
> > > >
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > 45)
> > > >         at
> > > >
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > ctButton.java:1499)
> > > >         at
> > > >
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > .java:373)
> > > >         at
> > > >
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > )
> > > >         at
> > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > >         at
> > > >
> >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > d(BasicMenuItemUI.java:882)
> > > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
> > > >
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > )
> > > >         at
> > > >
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > >
> > > >         at
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > >         at
> > > >
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > read.java:126)
> > > >         at
> > > >
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > ad.java:93)
> > > >         at
> > > >
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > >         at
> > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > >
> > > > Praveen
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > The newest nightly is right here:
> > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > Hey Scott,
> > > > > > I could not find a nightly build dated yesterday or today.
Could
> > you
> > > > > please
> > > > > > check it out. If not, where can find the insturctions on how
to
> > > > > compile the
> > > > > > src, so that I can compile it and use it. Can I just replace
the
> > old
> > > > > > MimePartSerializer class file with the new one or do I have
to
> > replece
> > > > > the
> > > > > > whole jar.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > Praveen
> > > > > >
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > This is a "quirk" of the MimePartSerializer.  It is used
to
> > > > > serialize
> > > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.
When a
> > null
> > > > > > > value is passed in for serialization, the serializer (for
some
> > > > > reason)
> > > > > > > chooses to serialize it as an Object.  That's why you get
the
> > > > > mismatch.
> > > > > > >
> > > > > > > I'm going to change the code to use the type specified to
the
> > > > > serializer
> > > > > > > when serializing a null.  You can either grab the source
> > > > > > >
> > > > >
> >
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > >
> > > > >
> >
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > ext/plain), compile it and use it, or wait until tomorrow
and
> > get a
> > > > > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > Hi Scott,
> > > > > > >
> > > > > > > Eveyrthing seems to work fine now, except one minor
problem.
> > When
> > > > > there
> > > > > > > is nothing to send as argument I am passing in null and
thats
> > > > > throwing
> > > > > > > exception. Please look at the bold lines of my code below.
I
> > am
> > > > > passing
> > > > > > > in the type of the argument as
> > javax.activation.DataHandler.class,
> > > > > but
> > > > > > > it still takes it as Object. See the exception after the
code.
> > Look
> > > > > at
> > > > > > > the 6th argument of the method. It is assuming the object
type
> > as
> > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > >
> > > > > > > Vector params = new Vector();
> > > > > > >         params.addElement(new Parameter("sessionID",
> > long.class,
> > > > > > >                 new Long(sessionID), null));
> > > > > > >         params.addElement(new Parameter("containerID",
> > > > > > > containerID.getClass(),
> > > > > > >                 new String(containerID), null));
> > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > xmlString.getClass(),
> > > > > > >                 new String(xmlString), null));
> > > > > > >
> > > > > > >         DataSource ds = new
ByteArrayDataSource(sourceBytes,
> > > > > > > "application/octet-stream");
> > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > >         params.addElement(new Parameter("source",
> > > > > > >                 javax.activation.DataHandler.class, dh,
> > null));
> > > > > > >
> > > > > > >         //            params.addElement(new
> > > > > Parameter("encodedSource",
> > > > > > > encodedSource.getClass(), new String(encodedSource),
null));
> > > > > > >         params.addElement(new Parameter("sourceFileName",
> > > > > > >                 sourceFileName.getClass(), new
> > > > > String(sourceFileName),
> > > > > > > null));
> > > > > > >
> > > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > "application/octet-stream");
> > > > > > >             dh = new DataHandler(ds);
> > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > >                     javax.activation.DataHandler.class,
dh,
> > null));
> > > > > > >             params.addElement(new
Parameter("thumbFileName",
> > > > > > >                     thumbFileName.getClass(), new
> > > > > String(thumbFileName),
> > > > > > > null));
> > > > > > >         } else {
> > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > >                     javax.activation.DataHandler.class,
null,
> > > > > null));
> > > > > > >             params.addElement(new
Parameter("thumbFileName",
> > > > > > >                     new String().getClass(), null, null));
> > > > > > >         }
> > > > > > >
> > > > > > > Exception trace is as follows:
> > > > > > >
> > > > > > > Generated fault:
> > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > >   Fault String = Exception while handling service request:
> > > > > > > com.contextmedia.ip.s
> > > > > > >
> > > > >
> >
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > ing,java
> > > > > > >
> > > > >
> >
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > ect,java
> > > > > > > .lang.String) -- no signature match
> > > > > > > java.lang.Exception: Exception while handling service
request:
> > > > > > > com.contextmedia.
> > > > > > >
> > > > >
> >
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > .String,
> > > > > > >
> > > > >
> >
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > .Object,
> > > > > > > java.lang.String) -- no signature match
> > > > > > >         at
> > > > > > >
> > > > >
> >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > >         at
> > > > > > >
> > > > >
> >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > 45)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > ctButton.java:1499)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > .java:373)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > istener.java:211)
> > > > > > >         at
> > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > >         at
> > java.awt.Component.processEvent(Component.java:3539)
> > > > > > >         at
> > java.awt.Container.processEvent(Container.java:1159)
> > > > > > >         at
> > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > >
> > > > > > >         at
> > > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > >         at
java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > read.java:126)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > ad.java:93)
> > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > >         at
java.awt.Component.setVisible(Component.java:898)
> > > > > > >         at
> > > > > > >
> > > > >
> >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > rmed(SimplexFrame.java:391)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > 45)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > ctButton.java:1499)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > .java:373)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > )
> > > > > > >         at
> > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > >         at
> > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > >         at
> > java.awt.Component.processEvent(Component.java:3539)
> > > > > > >         at
> > java.awt.Container.processEvent(Container.java:1159)
> > > > > > >         at
> > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > >
> > > > > > >         at
> > > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > >         at
java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > read.java:126)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > ad.java:93)
> > > > > > >         at
> > > > > > >
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > >         at
> > > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Praveen
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > As a general recommendation, I encourage you to capture
a
> > stack
> > > > > trace
> > > > > > > > for your exceptions.  Just having the exception message
> > makes it
> > > > > > > harder
> > > > > > > > to understand the cause of most exceptions.
> > > > > > > >
> > > > > > > > This particular exception means that a
ByteArrayDataSource
> > was
> > > > > created
> > > > > > > > with no data array, such as passing a null for the byte
> > array.
> > > > > > > >
> > > > > > > > Scott Nichol
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > > >
> > > > > > > > > BUt I have another problem. When I execute that
method, I
> > get
> > > > > the
> > > > > > > > following
> > > > > > > > > exception.
> > > > > > > > >
> > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > >
> > > > > > > > > What does this mean? I double checked that my soap
method
> > exists
> > > > > in
> > > > > > > > the
> > > > > > > > > descriptor and the implementation also exists on the
> > server
> > > > > side.
> > > > > > > But
> > > > > > > > the
> > > > > > > > > call doesn't reach the server at all.
> > > > > > > > >
> > > > > > > > > Praveen
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > This sample that I created from you code works for
me,
> > i.e. it
> > > > > > > does
> > > > > > > > not
> > > > > > > > > > throw an NPE.
> > > > > > > > > >
> > > > > > > > > > Scott Nichol
> > > > > > > > > >
> > > > > > > > > > import java.io.*;
> > > > > > > > > > import java.util.*;
> > > > > > > > > > import java.net.*;
> > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > import javax.activation.*;
> > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > >
> > > > > > > > > > public class TestAttachments {
> > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > >   try {
> > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > >
> > > > > > > > > >    // Build the call.
> > > > > > > > > >    SOAPMappingRegistry smr = new
SOAPMappingRegistry();
> > > > > > > > > >    Call call = new Call();
> > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > >
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > >
> > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > >
> > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > >    DataSource ds = new
ByteArrayDataSource(sourceBytes,
> > > > > > > > > > "application/octet-stream");
> > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > > > > >
> > > > > > > > > >    DataSource ds2 = new
ByteArrayDataSource(sourceBytes,
> > > > > > > > > > "application/octet-stream");
> > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > >     dh2, null));
> > > > > > > > > >
> > > > > > > > > >    call.setParams(params);
> > > > > > > > > >
> > > > > > > > > >    // Invoke the call.
> > > > > > > > > >    Response resp;
> > > > > > > > > >
> > > > > > > > > >    try {
> > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > > >     e.printStackTrace();
> > > > > > > > > >    }
> > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > >    e.printStackTrace();
> > > > > > > > > >   }
> > > > > > > > > >  }
> > > > > > > > > > }
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > >
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
That's odd.  The error message is when deserializing, but the client
only deserializes responses.  Is the line at which the exception is
thrown doing the Call#invoke?

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 4:56 PM
Subject: Re: Urgent: Soap With attachments example


> I am sorry about it. I didn't mean to demand the response or anything
like
> that. I am just kind of under pressure and it looked like the problem
might
> be in the soap tool kit (since u said it didn't handler null arguments
> before).
>
> But I appreciate your help. You have been a great help to me.
>
> uploadContentObject returns a base64 encoded string. But it looks like
the
> request doesn't goto the server at all. I can't see the trace on the
server
> I should have been seen if the request comes in.
>
> Praveen
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 4:41 PM
> Subject: Re: Urgent: Soap With attachments example
>
>
> > What does uploadContentObject return, specifically, what is the Java
> > type?  If you have provided a mapping for it in the server's
deployment
> > descriptor, what is the mapping?
> >
> > Scott Nichol
> >
> > P.S.: I appreciate that you are probably working on something with a
> > deadline and require help to move forward, but putting "urgent" in
the
> > subject and asking me to "look at the error ASAP" is not the
greatest
> > etiquette for this list.  I am committed to helping Apache SOAP
users
> > and improving the Apache SOAP code, but I do so as an unpaid
volunteer!
> > I am also committed to making my mortgage payments ;-), so I cannot
> > always get to things in a timely manner.  Please try to be patient.
> > And, if I (or someone else on the list) cannot respond quickly
enough,
> > there's always the source code available for you to trace through,
as
> > well.
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Cc: <sn...@scottnichol.com>
> > Sent: Tuesday, January 07, 2003 4:22 PM
> > Subject: Urgent: Soap With attachments example
> >
> >
> > > Hi Scott,
> > > Could you please look at the error ASAP and let me know whats
wrong in
> > my
> > > code. I need to fix it ASAP.
> > >
> > > Thanks in Advance.
> > >
> > > Praveen
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 11:50 AM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > I updated my jar file with the current jar file that I got from
the
> > > nightly
> > > > build. Now this is the error I get when I pass null for
DataHandler.
> > > >
> > > > Uploading ....
> > > > uploadContentObjectUsingAttachments...
> > > > Generated fault:
> > > >   Fault Code   = SOAP-ENV:Client
> > > >   Fault String = Can't yet deserialize non-null Objects
> > > > java.lang.Exception: Can't yet deserialize non-null Objects
> > > >         at
> > > >
> >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > > >         at
> > > >
> >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > >         at
> > > >
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > 45)
> > > >         at
> > > >
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > ctButton.java:1499)
> > > >         at
> > > >
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > .java:373)
> > > >         at
> > > >
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > )
> > > >         at
> > > >
> >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > istener.java:211)
> > > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
> > > >
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > )
> > > >         at
> > > >
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > >
> > > >         at
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > >         at
> > > >
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > read.java:126)
> > > >         at
> > > >
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > ad.java:93)
> > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > >         at java.awt.Component.show(Component.java:941)
> > > >         at java.awt.Component.setVisible(Component.java:898)
> > > >         at
> > > >
> >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > rmed(SimplexFrame.java:391)
> > > >         at
> > > >
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > 45)
> > > >         at
> > > >
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > ctButton.java:1499)
> > > >         at
> > > >
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > .java:373)
> > > >         at
> > > >
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > )
> > > >         at
> > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > >         at
> > > >
> >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > d(BasicMenuItemUI.java:882)
> > > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
> > > >
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > )
> > > >         at
> > > >
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > >
> > > >         at
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > >         at
> > > >
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > read.java:126)
> > > >         at
> > > >
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > ad.java:93)
> > > >         at
> > > >
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > >         at
> > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > >
> > > > Praveen
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > The newest nightly is right here:
> > > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > Hey Scott,
> > > > > > I could not find a nightly build dated yesterday or today.
Could
> > you
> > > > > please
> > > > > > check it out. If not, where can find the insturctions on how
to
> > > > > compile the
> > > > > > src, so that I can compile it and use it. Can I just replace
the
> > old
> > > > > > MimePartSerializer class file with the new one or do I have
to
> > replece
> > > > > the
> > > > > > whole jar.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > Praveen
> > > > > >
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > This is a "quirk" of the MimePartSerializer.  It is used
to
> > > > > serialize
> > > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.
When a
> > null
> > > > > > > value is passed in for serialization, the serializer (for
some
> > > > > reason)
> > > > > > > chooses to serialize it as an Object.  That's why you get
the
> > > > > mismatch.
> > > > > > >
> > > > > > > I'm going to change the code to use the type specified to
the
> > > > > serializer
> > > > > > > when serializing a null.  You can either grab the source
> > > > > > >
> > > > >
> >
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > > >
> > > > >
> >
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > > ext/plain), compile it and use it, or wait until tomorrow
and
> > get a
> > > > > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > Hi Scott,
> > > > > > >
> > > > > > > Eveyrthing seems to work fine now, except one minor
problem.
> > When
> > > > > there
> > > > > > > is nothing to send as argument I am passing in null and
thats
> > > > > throwing
> > > > > > > exception. Please look at the bold lines of my code below.
I
> > am
> > > > > passing
> > > > > > > in the type of the argument as
> > javax.activation.DataHandler.class,
> > > > > but
> > > > > > > it still takes it as Object. See the exception after the
code.
> > Look
> > > > > at
> > > > > > > the 6th argument of the method. It is assuming the object
type
> > as
> > > > > > > "Object" not "javax.activation.DataHandler"
> > > > > > >
> > > > > > > Vector params = new Vector();
> > > > > > >         params.addElement(new Parameter("sessionID",
> > long.class,
> > > > > > >                 new Long(sessionID), null));
> > > > > > >         params.addElement(new Parameter("containerID",
> > > > > > > containerID.getClass(),
> > > > > > >                 new String(containerID), null));
> > > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > > xmlString.getClass(),
> > > > > > >                 new String(xmlString), null));
> > > > > > >
> > > > > > >         DataSource ds = new
ByteArrayDataSource(sourceBytes,
> > > > > > > "application/octet-stream");
> > > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > > >         params.addElement(new Parameter("source",
> > > > > > >                 javax.activation.DataHandler.class, dh,
> > null));
> > > > > > >
> > > > > > >         //            params.addElement(new
> > > > > Parameter("encodedSource",
> > > > > > > encodedSource.getClass(), new String(encodedSource),
null));
> > > > > > >         params.addElement(new Parameter("sourceFileName",
> > > > > > >                 sourceFileName.getClass(), new
> > > > > String(sourceFileName),
> > > > > > > null));
> > > > > > >
> > > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > > "application/octet-stream");
> > > > > > >             dh = new DataHandler(ds);
> > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > >                     javax.activation.DataHandler.class,
dh,
> > null));
> > > > > > >             params.addElement(new
Parameter("thumbFileName",
> > > > > > >                     thumbFileName.getClass(), new
> > > > > String(thumbFileName),
> > > > > > > null));
> > > > > > >         } else {
> > > > > > >             params.addElement(new Parameter("thumb",
> > > > > > >                     javax.activation.DataHandler.class,
null,
> > > > > null));
> > > > > > >             params.addElement(new
Parameter("thumbFileName",
> > > > > > >                     new String().getClass(), null, null));
> > > > > > >         }
> > > > > > >
> > > > > > > Exception trace is as follows:
> > > > > > >
> > > > > > > Generated fault:
> > > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > > >   Fault String = Exception while handling service request:
> > > > > > > com.contextmedia.ip.s
> > > > > > >
> > > > >
> >
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > > ing,java
> > > > > > >
> > > > >
> >
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > > ect,java
> > > > > > > .lang.String) -- no signature match
> > > > > > > java.lang.Exception: Exception while handling service
request:
> > > > > > > com.contextmedia.
> > > > > > >
> > > > >
> >
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > > .String,
> > > > > > >
> > > > >
> >
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > > .Object,
> > > > > > > java.lang.String) -- no signature match
> > > > > > >         at
> > > > > > >
> > > > >
> >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > > >         at
> > > > > > >
> > > > >
> >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > 45)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > ctButton.java:1499)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > .java:373)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > > istener.java:211)
> > > > > > >         at
> > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > >         at
> > java.awt.Component.processEvent(Component.java:3539)
> > > > > > >         at
> > java.awt.Container.processEvent(Container.java:1159)
> > > > > > >         at
> > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > >
> > > > > > >         at
> > > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > >         at
java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > read.java:126)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > ad.java:93)
> > > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > > >         at
java.awt.Component.setVisible(Component.java:898)
> > > > > > >         at
> > > > > > >
> > > > >
> >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > > rmed(SimplexFrame.java:391)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > > 45)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > > ctButton.java:1499)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > > .java:373)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > > )
> > > > > > >         at
> > > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > > >         at
> > > > > > >
> > > > >
> >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > > d(BasicMenuItemUI.java:882)
> > > > > > >         at
> > java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > > >         at
> > java.awt.Component.processEvent(Component.java:3539)
> > > > > > >         at
> > java.awt.Container.processEvent(Container.java:1159)
> > > > > > >         at
> > java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > > )
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > > >
> > > > > > >         at
> > > > > > >
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > > >         at
> > java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > > >         at
java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > > >         at
> > java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > > >         at
> > java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > > read.java:126)
> > > > > > >         at
> > > > > > >
> > > > >
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > > ad.java:93)
> > > > > > >         at
> > > > > > >
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > > >         at
> > > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Praveen
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > As a general recommendation, I encourage you to capture
a
> > stack
> > > > > trace
> > > > > > > > for your exceptions.  Just having the exception message
> > makes it
> > > > > > > harder
> > > > > > > > to understand the cause of most exceptions.
> > > > > > > >
> > > > > > > > This particular exception means that a
ByteArrayDataSource
> > was
> > > > > created
> > > > > > > > with no data array, such as passing a null for the byte
> > array.
> > > > > > > >
> > > > > > > > Scott Nichol
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > > >
> > > > > > > > > BUt I have another problem. When I execute that
method, I
> > get
> > > > > the
> > > > > > > > following
> > > > > > > > > exception.
> > > > > > > > >
> > > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > > >
> > > > > > > > > What does this mean? I double checked that my soap
method
> > exists
> > > > > in
> > > > > > > > the
> > > > > > > > > descriptor and the implementation also exists on the
> > server
> > > > > side.
> > > > > > > But
> > > > > > > > the
> > > > > > > > > call doesn't reach the server at all.
> > > > > > > > >
> > > > > > > > > Praveen
> > > > > > > > > ----- Original Message -----
> > > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > This sample that I created from you code works for
me,
> > i.e. it
> > > > > > > does
> > > > > > > > not
> > > > > > > > > > throw an NPE.
> > > > > > > > > >
> > > > > > > > > > Scott Nichol
> > > > > > > > > >
> > > > > > > > > > import java.io.*;
> > > > > > > > > > import java.util.*;
> > > > > > > > > > import java.net.*;
> > > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > > import org.xml.sax.*;
> > > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > > import org.apache.soap.*;
> > > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > > import javax.activation.*;
> > > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > > >
> > > > > > > > > > public class TestAttachments {
> > > > > > > > > >  public static void main(String[] args) {
> > > > > > > > > >   try {
> > > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > > >
> > > > > > > > > >    // Build the call.
> > > > > > > > > >    SOAPMappingRegistry smr = new
SOAPMappingRegistry();
> > > > > > > > > >    Call call = new Call();
> > > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > > >
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > > >
> > > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > > >
> > > > > > > > > >    Vector params = new Vector();
> > > > > > > > > >    DataSource ds = new
ByteArrayDataSource(sourceBytes,
> > > > > > > > > > "application/octet-stream");
> > > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > > > > >
> > > > > > > > > >    DataSource ds2 = new
ByteArrayDataSource(sourceBytes,
> > > > > > > > > > "application/octet-stream");
> > > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > > >     dh2, null));
> > > > > > > > > >
> > > > > > > > > >    call.setParams(params);
> > > > > > > > > >
> > > > > > > > > >    // Invoke the call.
> > > > > > > > > >    Response resp;
> > > > > > > > > >
> > > > > > > > > >    try {
> > > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > > >     e.printStackTrace();
> > > > > > > > > >    }
> > > > > > > > > >   } catch (Exception e) {
> > > > > > > > > >    e.printStackTrace();
> > > > > > > > > >   }
> > > > > > > > > >  }
> > > > > > > > > > }
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > >
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
I am sorry about it. I didn't mean to demand the response or anything like
that. I am just kind of under pressure and it looked like the problem might
be in the soap tool kit (since u said it didn't handler null arguments
before).

But I appreciate your help. You have been a great help to me.

uploadContentObject returns a base64 encoded string. But it looks like the
request doesn't goto the server at all. I can't see the trace on the server
I should have been seen if the request comes in.

Praveen

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 4:41 PM
Subject: Re: Urgent: Soap With attachments example


> What does uploadContentObject return, specifically, what is the Java
> type?  If you have provided a mapping for it in the server's deployment
> descriptor, what is the mapping?
>
> Scott Nichol
>
> P.S.: I appreciate that you are probably working on something with a
> deadline and require help to move forward, but putting "urgent" in the
> subject and asking me to "look at the error ASAP" is not the greatest
> etiquette for this list.  I am committed to helping Apache SOAP users
> and improving the Apache SOAP code, but I do so as an unpaid volunteer!
> I am also committed to making my mortgage payments ;-), so I cannot
> always get to things in a timely manner.  Please try to be patient.
> And, if I (or someone else on the list) cannot respond quickly enough,
> there's always the source code available for you to trace through, as
> well.
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Cc: <sn...@scottnichol.com>
> Sent: Tuesday, January 07, 2003 4:22 PM
> Subject: Urgent: Soap With attachments example
>
>
> > Hi Scott,
> > Could you please look at the error ASAP and let me know whats wrong in
> my
> > code. I need to fix it ASAP.
> >
> > Thanks in Advance.
> >
> > Praveen
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 11:50 AM
> > Subject: Re: Soap With attachments example
> >
> >
> > > I updated my jar file with the current jar file that I got from the
> > nightly
> > > build. Now this is the error I get when I pass null for DataHandler.
> > >
> > > Uploading ....
> > > uploadContentObjectUsingAttachments...
> > > Generated fault:
> > >   Fault Code   = SOAP-ENV:Client
> > >   Fault String = Can't yet deserialize non-null Objects
> > > java.lang.Exception: Can't yet deserialize non-null Objects
> > >         at
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > >         at
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > er.actionPerformed(NewContentObjectDialog.java:275)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > istener.java:211)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at java.awt.Dialog.show(Dialog.java:375)
> > >         at java.awt.Component.show(Component.java:941)
> > >         at java.awt.Component.setVisible(Component.java:898)
> > >         at
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > rmed(SimplexFrame.java:391)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > >         at
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > d(BasicMenuItemUI.java:882)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > >         at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > >
> > > Praveen
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > The newest nightly is right here:
> > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > Hey Scott,
> > > > > I could not find a nightly build dated yesterday or today. Could
> you
> > > > please
> > > > > check it out. If not, where can find the insturctions on how to
> > > > compile the
> > > > > src, so that I can compile it and use it. Can I just replace the
> old
> > > > > MimePartSerializer class file with the new one or do I have to
> replece
> > > > the
> > > > > whole jar.
> > > > >
> > > > > Thanks
> > > > >
> > > > > Praveen
> > > > >
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > This is a "quirk" of the MimePartSerializer.  It is used to
> > > > serialize
> > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.  When a
> null
> > > > > > value is passed in for serialization, the serializer (for some
> > > > reason)
> > > > > > chooses to serialize it as an Object.  That's why you get the
> > > > mismatch.
> > > > > >
> > > > > > I'm going to change the code to use the type specified to the
> > > > serializer
> > > > > > when serializing a null.  You can either grab the source
> > > > > >
> > > >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > >
> > > >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > ext/plain), compile it and use it, or wait until tomorrow and
> get a
> > > > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > Hi Scott,
> > > > > >
> > > > > > Eveyrthing seems to work fine now, except one minor problem.
> When
> > > > there
> > > > > > is nothing to send as argument I am passing in null and thats
> > > > throwing
> > > > > > exception. Please look at the bold lines of my code below. I
> am
> > > > passing
> > > > > > in the type of the argument as
> javax.activation.DataHandler.class,
> > > > but
> > > > > > it still takes it as Object. See the exception after the code.
> Look
> > > > at
> > > > > > the 6th argument of the method. It is assuming the object type
> as
> > > > > > "Object" not "javax.activation.DataHandler"
> > > > > >
> > > > > > Vector params = new Vector();
> > > > > >         params.addElement(new Parameter("sessionID",
> long.class,
> > > > > >                 new Long(sessionID), null));
> > > > > >         params.addElement(new Parameter("containerID",
> > > > > > containerID.getClass(),
> > > > > >                 new String(containerID), null));
> > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > xmlString.getClass(),
> > > > > >                 new String(xmlString), null));
> > > > > >
> > > > > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > "application/octet-stream");
> > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > >         params.addElement(new Parameter("source",
> > > > > >                 javax.activation.DataHandler.class, dh,
> null));
> > > > > >
> > > > > >         //            params.addElement(new
> > > > Parameter("encodedSource",
> > > > > > encodedSource.getClass(), new String(encodedSource), null));
> > > > > >         params.addElement(new Parameter("sourceFileName",
> > > > > >                 sourceFileName.getClass(), new
> > > > String(sourceFileName),
> > > > > > null));
> > > > > >
> > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > "application/octet-stream");
> > > > > >             dh = new DataHandler(ds);
> > > > > >             params.addElement(new Parameter("thumb",
> > > > > >                     javax.activation.DataHandler.class, dh,
> null));
> > > > > >             params.addElement(new Parameter("thumbFileName",
> > > > > >                     thumbFileName.getClass(), new
> > > > String(thumbFileName),
> > > > > > null));
> > > > > >         } else {
> > > > > >             params.addElement(new Parameter("thumb",
> > > > > >                     javax.activation.DataHandler.class, null,
> > > > null));
> > > > > >             params.addElement(new Parameter("thumbFileName",
> > > > > >                     new String().getClass(), null, null));
> > > > > >         }
> > > > > >
> > > > > > Exception trace is as follows:
> > > > > >
> > > > > > Generated fault:
> > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > >   Fault String = Exception while handling service request:
> > > > > > com.contextmedia.ip.s
> > > > > >
> > > >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > ing,java
> > > > > >
> > > >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > ect,java
> > > > > > .lang.String) -- no signature match
> > > > > > java.lang.Exception: Exception while handling service request:
> > > > > > com.contextmedia.
> > > > > >
> > > >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > .String,
> > > > > >
> > > >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > .Object,
> > > > > > java.lang.String) -- no signature match
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > istener.java:211)
> > > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > rmed(SimplexFrame.java:391)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > d(BasicMenuItemUI.java:882)
> > > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at
> > > > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > >         at
> > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > >
> > > > > >
> > > > > >
> > > > > > Praveen
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > As a general recommendation, I encourage you to capture a
> stack
> > > > trace
> > > > > > > for your exceptions.  Just having the exception message
> makes it
> > > > > > harder
> > > > > > > to understand the cause of most exceptions.
> > > > > > >
> > > > > > > This particular exception means that a ByteArrayDataSource
> was
> > > > created
> > > > > > > with no data array, such as passing a null for the byte
> array.
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > >
> > > > > > > > BUt I have another problem. When I execute that method, I
> get
> > > > the
> > > > > > > following
> > > > > > > > exception.
> > > > > > > >
> > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > >
> > > > > > > > What does this mean? I double checked that my soap method
> exists
> > > > in
> > > > > > > the
> > > > > > > > descriptor and the implementation also exists on the
> server
> > > > side.
> > > > > > But
> > > > > > > the
> > > > > > > > call doesn't reach the server at all.
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > This sample that I created from you code works for me,
> i.e. it
> > > > > > does
> > > > > > > not
> > > > > > > > > throw an NPE.
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > import java.io.*;
> > > > > > > > > import java.util.*;
> > > > > > > > > import java.net.*;
> > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > import org.xml.sax.*;
> > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > import org.apache.soap.*;
> > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > import javax.activation.*;
> > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > >
> > > > > > > > > public class TestAttachments {
> > > > > > > > >  public static void main(String[] args) {
> > > > > > > > >   try {
> > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > >
> > > > > > > > >    // Build the call.
> > > > > > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > > > > > >    Call call = new Call();
> > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > >
> > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > >
> > > > > > > > >    Vector params = new Vector();
> > > > > > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > > > >
> > > > > > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > >     dh2, null));
> > > > > > > > >
> > > > > > > > >    call.setParams(params);
> > > > > > > > >
> > > > > > > > >    // Invoke the call.
> > > > > > > > >    Response resp;
> > > > > > > > >
> > > > > > > > >    try {
> > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > >     e.printStackTrace();
> > > > > > > > >    }
> > > > > > > > >   } catch (Exception e) {
> > > > > > > > >    e.printStackTrace();
> > > > > > > > >   }
> > > > > > > > >  }
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
I am sorry about it. I didn't mean to demand the response or anything like
that. I am just kind of under pressure and it looked like the problem might
be in the soap tool kit (since u said it didn't handler null arguments
before).

But I appreciate your help. You have been a great help to me.

uploadContentObject returns a base64 encoded string. But it looks like the
request doesn't goto the server at all. I can't see the trace on the server
I should have been seen if the request comes in.

Praveen

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 4:41 PM
Subject: Re: Urgent: Soap With attachments example


> What does uploadContentObject return, specifically, what is the Java
> type?  If you have provided a mapping for it in the server's deployment
> descriptor, what is the mapping?
>
> Scott Nichol
>
> P.S.: I appreciate that you are probably working on something with a
> deadline and require help to move forward, but putting "urgent" in the
> subject and asking me to "look at the error ASAP" is not the greatest
> etiquette for this list.  I am committed to helping Apache SOAP users
> and improving the Apache SOAP code, but I do so as an unpaid volunteer!
> I am also committed to making my mortgage payments ;-), so I cannot
> always get to things in a timely manner.  Please try to be patient.
> And, if I (or someone else on the list) cannot respond quickly enough,
> there's always the source code available for you to trace through, as
> well.
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Cc: <sn...@scottnichol.com>
> Sent: Tuesday, January 07, 2003 4:22 PM
> Subject: Urgent: Soap With attachments example
>
>
> > Hi Scott,
> > Could you please look at the error ASAP and let me know whats wrong in
> my
> > code. I need to fix it ASAP.
> >
> > Thanks in Advance.
> >
> > Praveen
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 11:50 AM
> > Subject: Re: Soap With attachments example
> >
> >
> > > I updated my jar file with the current jar file that I got from the
> > nightly
> > > build. Now this is the error I get when I pass null for DataHandler.
> > >
> > > Uploading ....
> > > uploadContentObjectUsingAttachments...
> > > Generated fault:
> > >   Fault Code   = SOAP-ENV:Client
> > >   Fault String = Can't yet deserialize non-null Objects
> > > java.lang.Exception: Can't yet deserialize non-null Objects
> > >         at
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > entObjectWithAttachments(ContentObjectUtils.java:750)
> > >         at
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > er.actionPerformed(NewContentObjectDialog.java:275)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > istener.java:211)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at java.awt.Dialog.show(Dialog.java:375)
> > >         at java.awt.Component.show(Component.java:941)
> > >         at java.awt.Component.setVisible(Component.java:898)
> > >         at
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > rmed(SimplexFrame.java:391)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > >         at
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > d(BasicMenuItemUI.java:882)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > >         at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > >
> > > Praveen
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 9:59 AM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > The newest nightly is right here:
> > > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > Hey Scott,
> > > > > I could not find a nightly build dated yesterday or today. Could
> you
> > > > please
> > > > > check it out. If not, where can find the insturctions on how to
> > > > compile the
> > > > > src, so that I can compile it and use it. Can I just replace the
> old
> > > > > MimePartSerializer class file with the new one or do I have to
> replece
> > > > the
> > > > > whole jar.
> > > > >
> > > > > Thanks
> > > > >
> > > > > Praveen
> > > > >
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > This is a "quirk" of the MimePartSerializer.  It is used to
> > > > serialize
> > > > > > InputStream, DataSource, MimeBodyPart and DataHandler.  When a
> null
> > > > > > value is passed in for serialization, the serializer (for some
> > > > reason)
> > > > > > chooses to serialize it as an Object.  That's why you get the
> > > > mismatch.
> > > > > >
> > > > > > I'm going to change the code to use the type specified to the
> > > > serializer
> > > > > > when serializing a null.  You can either grab the source
> > > > > >
> > > >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > > >
> > > >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > > ext/plain), compile it and use it, or wait until tomorrow and
> get a
> > > > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > Hi Scott,
> > > > > >
> > > > > > Eveyrthing seems to work fine now, except one minor problem.
> When
> > > > there
> > > > > > is nothing to send as argument I am passing in null and thats
> > > > throwing
> > > > > > exception. Please look at the bold lines of my code below. I
> am
> > > > passing
> > > > > > in the type of the argument as
> javax.activation.DataHandler.class,
> > > > but
> > > > > > it still takes it as Object. See the exception after the code.
> Look
> > > > at
> > > > > > the 6th argument of the method. It is assuming the object type
> as
> > > > > > "Object" not "javax.activation.DataHandler"
> > > > > >
> > > > > > Vector params = new Vector();
> > > > > >         params.addElement(new Parameter("sessionID",
> long.class,
> > > > > >                 new Long(sessionID), null));
> > > > > >         params.addElement(new Parameter("containerID",
> > > > > > containerID.getClass(),
> > > > > >                 new String(containerID), null));
> > > > > >         params.addElement(new Parameter("xmlString",
> > > > > > xmlString.getClass(),
> > > > > >                 new String(xmlString), null));
> > > > > >
> > > > > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > "application/octet-stream");
> > > > > >         DataHandler dh = new DataHandler(ds);
> > > > > >         params.addElement(new Parameter("source",
> > > > > >                 javax.activation.DataHandler.class, dh,
> null));
> > > > > >
> > > > > >         //            params.addElement(new
> > > > Parameter("encodedSource",
> > > > > > encodedSource.getClass(), new String(encodedSource), null));
> > > > > >         params.addElement(new Parameter("sourceFileName",
> > > > > >                 sourceFileName.getClass(), new
> > > > String(sourceFileName),
> > > > > > null));
> > > > > >
> > > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > > "application/octet-stream");
> > > > > >             dh = new DataHandler(ds);
> > > > > >             params.addElement(new Parameter("thumb",
> > > > > >                     javax.activation.DataHandler.class, dh,
> null));
> > > > > >             params.addElement(new Parameter("thumbFileName",
> > > > > >                     thumbFileName.getClass(), new
> > > > String(thumbFileName),
> > > > > > null));
> > > > > >         } else {
> > > > > >             params.addElement(new Parameter("thumb",
> > > > > >                     javax.activation.DataHandler.class, null,
> > > > null));
> > > > > >             params.addElement(new Parameter("thumbFileName",
> > > > > >                     new String().getClass(), null, null));
> > > > > >         }
> > > > > >
> > > > > > Exception trace is as follows:
> > > > > >
> > > > > > Generated fault:
> > > > > >   Fault Code   = SOAP-ENV:Server
> > > > > >   Fault String = Exception while handling service request:
> > > > > > com.contextmedia.ip.s
> > > > > >
> > > >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > > ing,java
> > > > > >
> > > >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > > ect,java
> > > > > > .lang.String) -- no signature match
> > > > > > java.lang.Exception: Exception while handling service request:
> > > > > > com.contextmedia.
> > > > > >
> > > >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > > .String,
> > > > > >
> > > >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > > .Object,
> > > > > > java.lang.String) -- no signature match
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > > istener.java:211)
> > > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > > >         at java.awt.Component.show(Component.java:941)
> > > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > > >         at
> > > > > >
> > > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > > rmed(SimplexFrame.java:391)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > > 45)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > > ctButton.java:1499)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > > .java:373)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > > )
> > > > > >         at
> > > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > > >         at
> > > > > >
> > > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > > d(BasicMenuItemUI.java:882)
> > > > > >         at
> java.awt.Component.processMouseEvent(Component.java:3710)
> > > > > >         at
> java.awt.Component.processEvent(Component.java:3539)
> > > > > >         at
> java.awt.Container.processEvent(Container.java:1159)
> > > > > >         at
> java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > > )
> > > > > >         at
> > > > > >
> > > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > > >
> > > > > >         at
> > > > > >
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > > >         at
> java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > > >         at
> java.awt.Component.dispatchEvent(Component.java:2492)
> > > > > >         at
> java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > > read.java:126)
> > > > > >         at
> > > > > >
> > > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > > ad.java:93)
> > > > > >         at
> > > > > >
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > > >         at
> > > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > > >
> > > > > >
> > > > > >
> > > > > > Praveen
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > As a general recommendation, I encourage you to capture a
> stack
> > > > trace
> > > > > > > for your exceptions.  Just having the exception message
> makes it
> > > > > > harder
> > > > > > > to understand the cause of most exceptions.
> > > > > > >
> > > > > > > This particular exception means that a ByteArrayDataSource
> was
> > > > created
> > > > > > > with no data array, such as passing a null for the byte
> array.
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > > >
> > > > > > > > BUt I have another problem. When I execute that method, I
> get
> > > > the
> > > > > > > following
> > > > > > > > exception.
> > > > > > > >
> > > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > > >
> > > > > > > > What does this mean? I double checked that my soap method
> exists
> > > > in
> > > > > > > the
> > > > > > > > descriptor and the implementation also exists on the
> server
> > > > side.
> > > > > > But
> > > > > > > the
> > > > > > > > call doesn't reach the server at all.
> > > > > > > >
> > > > > > > > Praveen
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > > To: <so...@xml.apache.org>
> > > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > > Subject: Re: Soap With attachments example
> > > > > > > >
> > > > > > > >
> > > > > > > > > This sample that I created from you code works for me,
> i.e. it
> > > > > > does
> > > > > > > not
> > > > > > > > > throw an NPE.
> > > > > > > > >
> > > > > > > > > Scott Nichol
> > > > > > > > >
> > > > > > > > > import java.io.*;
> > > > > > > > > import java.util.*;
> > > > > > > > > import java.net.*;
> > > > > > > > > import org.w3c.dom.*;
> > > > > > > > > import org.xml.sax.*;
> > > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > > import org.apache.soap.*;
> > > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > > import javax.activation.*;
> > > > > > > > > import javax.mail.internet.*;
> > > > > > > > > import javax.xml.parsers.*;
> > > > > > > > >
> > > > > > > > > public class TestAttachments {
> > > > > > > > >  public static void main(String[] args) {
> > > > > > > > >   try {
> > > > > > > > >       URL url = new URL(args[0]);
> > > > > > > > >
> > > > > > > > >    // Build the call.
> > > > > > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > > > > > >    Call call = new Call();
> > > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > > >
> > > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > > >
> > > > > > > > >    Vector params = new Vector();
> > > > > > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > > > >
> > > > > > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > > > > > "application/octet-stream");
> > > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > > >     dh2, null));
> > > > > > > > >
> > > > > > > > >    call.setParams(params);
> > > > > > > > >
> > > > > > > > >    // Invoke the call.
> > > > > > > > >    Response resp;
> > > > > > > > >
> > > > > > > > >    try {
> > > > > > > > >     resp = call.invoke(url, "");
> > > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > > >    } catch (SOAPException e) {
> > > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > > >     e.printStackTrace();
> > > > > > > > >    }
> > > > > > > > >   } catch (Exception e) {
> > > > > > > > >    e.printStackTrace();
> > > > > > > > >   }
> > > > > > > > >  }
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
What does uploadContentObject return, specifically, what is the Java
type?  If you have provided a mapping for it in the server's deployment
descriptor, what is the mapping?

Scott Nichol

P.S.: I appreciate that you are probably working on something with a
deadline and require help to move forward, but putting "urgent" in the
subject and asking me to "look at the error ASAP" is not the greatest
etiquette for this list.  I am committed to helping Apache SOAP users
and improving the Apache SOAP code, but I do so as an unpaid volunteer!
I am also committed to making my mortgage payments ;-), so I cannot
always get to things in a timely manner.  Please try to be patient.
And, if I (or someone else on the list) cannot respond quickly enough,
there's always the source code available for you to trace through, as
well.

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Cc: <sn...@scottnichol.com>
Sent: Tuesday, January 07, 2003 4:22 PM
Subject: Urgent: Soap With attachments example


> Hi Scott,
> Could you please look at the error ASAP and let me know whats wrong in
my
> code. I need to fix it ASAP.
>
> Thanks in Advance.
>
> Praveen
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 11:50 AM
> Subject: Re: Soap With attachments example
>
>
> > I updated my jar file with the current jar file that I got from the
> nightly
> > build. Now this is the error I get when I pass null for DataHandler.
> >
> > Uploading ....
> > uploadContentObjectUsingAttachments...
> > Generated fault:
> >   Fault Code   = SOAP-ENV:Client
> >   Fault String = Can't yet deserialize non-null Objects
> > java.lang.Exception: Can't yet deserialize non-null Objects
> >         at
> >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > entObjectWithAttachments(ContentObjectUtils.java:750)
> >         at
> >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > er.actionPerformed(NewContentObjectDialog.java:275)
> >         at
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
> >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > istener.java:211)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at java.awt.Dialog.show(Dialog.java:375)
> >         at java.awt.Component.show(Component.java:941)
> >         at java.awt.Component.setVisible(Component.java:898)
> >         at
> >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > rmed(SimplexFrame.java:391)
> >         at
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> >         at
> >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > d(BasicMenuItemUI.java:882)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> >         at
java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> >
> > Praveen
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 9:59 AM
> > Subject: Re: Soap With attachments example
> >
> >
> > > The newest nightly is right here:
> > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > Hey Scott,
> > > > I could not find a nightly build dated yesterday or today. Could
you
> > > please
> > > > check it out. If not, where can find the insturctions on how to
> > > compile the
> > > > src, so that I can compile it and use it. Can I just replace the
old
> > > > MimePartSerializer class file with the new one or do I have to
replece
> > > the
> > > > whole jar.
> > > >
> > > > Thanks
> > > >
> > > > Praveen
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > This is a "quirk" of the MimePartSerializer.  It is used to
> > > serialize
> > > > > InputStream, DataSource, MimeBodyPart and DataHandler.  When a
null
> > > > > value is passed in for serialization, the serializer (for some
> > > reason)
> > > > > chooses to serialize it as an Object.  That's why you get the
> > > mismatch.
> > > > >
> > > > > I'm going to change the code to use the type specified to the
> > > serializer
> > > > > when serializing a null.  You can either grab the source
> > > > >
> > >
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > >
> > >
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > ext/plain), compile it and use it, or wait until tomorrow and
get a
> > > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > Hi Scott,
> > > > >
> > > > > Eveyrthing seems to work fine now, except one minor problem.
When
> > > there
> > > > > is nothing to send as argument I am passing in null and thats
> > > throwing
> > > > > exception. Please look at the bold lines of my code below. I
am
> > > passing
> > > > > in the type of the argument as
javax.activation.DataHandler.class,
> > > but
> > > > > it still takes it as Object. See the exception after the code.
Look
> > > at
> > > > > the 6th argument of the method. It is assuming the object type
as
> > > > > "Object" not "javax.activation.DataHandler"
> > > > >
> > > > > Vector params = new Vector();
> > > > >         params.addElement(new Parameter("sessionID",
long.class,
> > > > >                 new Long(sessionID), null));
> > > > >         params.addElement(new Parameter("containerID",
> > > > > containerID.getClass(),
> > > > >                 new String(containerID), null));
> > > > >         params.addElement(new Parameter("xmlString",
> > > > > xmlString.getClass(),
> > > > >                 new String(xmlString), null));
> > > > >
> > > > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > "application/octet-stream");
> > > > >         DataHandler dh = new DataHandler(ds);
> > > > >         params.addElement(new Parameter("source",
> > > > >                 javax.activation.DataHandler.class, dh,
null));
> > > > >
> > > > >         //            params.addElement(new
> > > Parameter("encodedSource",
> > > > > encodedSource.getClass(), new String(encodedSource), null));
> > > > >         params.addElement(new Parameter("sourceFileName",
> > > > >                 sourceFileName.getClass(), new
> > > String(sourceFileName),
> > > > > null));
> > > > >
> > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > "application/octet-stream");
> > > > >             dh = new DataHandler(ds);
> > > > >             params.addElement(new Parameter("thumb",
> > > > >                     javax.activation.DataHandler.class, dh,
null));
> > > > >             params.addElement(new Parameter("thumbFileName",
> > > > >                     thumbFileName.getClass(), new
> > > String(thumbFileName),
> > > > > null));
> > > > >         } else {
> > > > >             params.addElement(new Parameter("thumb",
> > > > >                     javax.activation.DataHandler.class, null,
> > > null));
> > > > >             params.addElement(new Parameter("thumbFileName",
> > > > >                     new String().getClass(), null, null));
> > > > >         }
> > > > >
> > > > > Exception trace is as follows:
> > > > >
> > > > > Generated fault:
> > > > >   Fault Code   = SOAP-ENV:Server
> > > > >   Fault String = Exception while handling service request:
> > > > > com.contextmedia.ip.s
> > > > >
> > >
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > ing,java
> > > > >
> > >
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > ect,java
> > > > > .lang.String) -- no signature match
> > > > > java.lang.Exception: Exception while handling service request:
> > > > > com.contextmedia.
> > > > >
> > >
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > .String,
> > > > >
> > >
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > .Object,
> > > > > java.lang.String) -- no signature match
> > > > >         at
> > > > >
> > >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > >         at
> > > > >
> > >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > >         at
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > > >
> > >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > istener.java:211)
> > > > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at
java.awt.Component.processEvent(Component.java:3539)
> > > > >         at
java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > >         at java.awt.Component.show(Component.java:941)
> > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > >         at
> > > > >
> > >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > rmed(SimplexFrame.java:391)
> > > > >         at
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > >         at
> > > > >
> > >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > d(BasicMenuItemUI.java:882)
> > > > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at
java.awt.Component.processEvent(Component.java:3539)
> > > > >         at
java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at
> > > > >
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > >         at
> > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > >
> > > > >
> > > > >
> > > > > Praveen
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > As a general recommendation, I encourage you to capture a
stack
> > > trace
> > > > > > for your exceptions.  Just having the exception message
makes it
> > > > > harder
> > > > > > to understand the cause of most exceptions.
> > > > > >
> > > > > > This particular exception means that a ByteArrayDataSource
was
> > > created
> > > > > > with no data array, such as passing a null for the byte
array.
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > >
> > > > > > > BUt I have another problem. When I execute that method, I
get
> > > the
> > > > > > following
> > > > > > > exception.
> > > > > > >
> > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > >
> > > > > > > What does this mean? I double checked that my soap method
exists
> > > in
> > > > > > the
> > > > > > > descriptor and the implementation also exists on the
server
> > > side.
> > > > > But
> > > > > > the
> > > > > > > call doesn't reach the server at all.
> > > > > > >
> > > > > > > Praveen
> > > > > > > ----- Original Message -----
> > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > This sample that I created from you code works for me,
i.e. it
> > > > > does
> > > > > > not
> > > > > > > > throw an NPE.
> > > > > > > >
> > > > > > > > Scott Nichol
> > > > > > > >
> > > > > > > > import java.io.*;
> > > > > > > > import java.util.*;
> > > > > > > > import java.net.*;
> > > > > > > > import org.w3c.dom.*;
> > > > > > > > import org.xml.sax.*;
> > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > import org.apache.soap.*;
> > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > import javax.activation.*;
> > > > > > > > import javax.mail.internet.*;
> > > > > > > > import javax.xml.parsers.*;
> > > > > > > >
> > > > > > > > public class TestAttachments {
> > > > > > > >  public static void main(String[] args) {
> > > > > > > >   try {
> > > > > > > >       URL url = new URL(args[0]);
> > > > > > > >
> > > > > > > >    // Build the call.
> > > > > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > > > > >    Call call = new Call();
> > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > >
> > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > >
> > > > > > > >    Vector params = new Vector();
> > > > > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > > >
> > > > > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > >     dh2, null));
> > > > > > > >
> > > > > > > >    call.setParams(params);
> > > > > > > >
> > > > > > > >    // Invoke the call.
> > > > > > > >    Response resp;
> > > > > > > >
> > > > > > > >    try {
> > > > > > > >     resp = call.invoke(url, "");
> > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > >    } catch (SOAPException e) {
> > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > >     e.printStackTrace();
> > > > > > > >    }
> > > > > > > >   } catch (Exception e) {
> > > > > > > >    e.printStackTrace();
> > > > > > > >   }
> > > > > > > >  }
> > > > > > > > }
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > > For additional commands, e-mail:
<ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>


Re: Urgent: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
What does uploadContentObject return, specifically, what is the Java
type?  If you have provided a mapping for it in the server's deployment
descriptor, what is the mapping?

Scott Nichol

P.S.: I appreciate that you are probably working on something with a
deadline and require help to move forward, but putting "urgent" in the
subject and asking me to "look at the error ASAP" is not the greatest
etiquette for this list.  I am committed to helping Apache SOAP users
and improving the Apache SOAP code, but I do so as an unpaid volunteer!
I am also committed to making my mortgage payments ;-), so I cannot
always get to things in a timely manner.  Please try to be patient.
And, if I (or someone else on the list) cannot respond quickly enough,
there's always the source code available for you to trace through, as
well.

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Cc: <sn...@scottnichol.com>
Sent: Tuesday, January 07, 2003 4:22 PM
Subject: Urgent: Soap With attachments example


> Hi Scott,
> Could you please look at the error ASAP and let me know whats wrong in
my
> code. I need to fix it ASAP.
>
> Thanks in Advance.
>
> Praveen
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 11:50 AM
> Subject: Re: Soap With attachments example
>
>
> > I updated my jar file with the current jar file that I got from the
> nightly
> > build. Now this is the error I get when I pass null for DataHandler.
> >
> > Uploading ....
> > uploadContentObjectUsingAttachments...
> > Generated fault:
> >   Fault Code   = SOAP-ENV:Client
> >   Fault String = Can't yet deserialize non-null Objects
> > java.lang.Exception: Can't yet deserialize non-null Objects
> >         at
> >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > entObjectWithAttachments(ContentObjectUtils.java:750)
> >         at
> >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > er.actionPerformed(NewContentObjectDialog.java:275)
> >         at
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
> >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > istener.java:211)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at java.awt.Dialog.show(Dialog.java:375)
> >         at java.awt.Component.show(Component.java:941)
> >         at java.awt.Component.setVisible(Component.java:898)
> >         at
> >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > rmed(SimplexFrame.java:391)
> >         at
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> >         at
> >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > d(BasicMenuItemUI.java:882)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> >         at
java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> >
> > Praveen
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 9:59 AM
> > Subject: Re: Soap With attachments example
> >
> >
> > > The newest nightly is right here:
> > > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, January 07, 2003 9:35 AM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > Hey Scott,
> > > > I could not find a nightly build dated yesterday or today. Could
you
> > > please
> > > > check it out. If not, where can find the insturctions on how to
> > > compile the
> > > > src, so that I can compile it and use it. Can I just replace the
old
> > > > MimePartSerializer class file with the new one or do I have to
replece
> > > the
> > > > whole jar.
> > > >
> > > > Thanks
> > > >
> > > > Praveen
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Monday, January 06, 2003 1:00 PM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > This is a "quirk" of the MimePartSerializer.  It is used to
> > > serialize
> > > > > InputStream, DataSource, MimeBodyPart and DataHandler.  When a
null
> > > > > value is passed in for serialization, the serializer (for some
> > > reason)
> > > > > chooses to serialize it as an Object.  That's why you get the
> > > mismatch.
> > > > >
> > > > > I'm going to change the code to use the type specified to the
> > > serializer
> > > > > when serializing a null.  You can either grab the source
> > > > >
> > >
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > > >
> > >
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > > ext/plain), compile it and use it, or wait until tomorrow and
get a
> > > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > Hi Scott,
> > > > >
> > > > > Eveyrthing seems to work fine now, except one minor problem.
When
> > > there
> > > > > is nothing to send as argument I am passing in null and thats
> > > throwing
> > > > > exception. Please look at the bold lines of my code below. I
am
> > > passing
> > > > > in the type of the argument as
javax.activation.DataHandler.class,
> > > but
> > > > > it still takes it as Object. See the exception after the code.
Look
> > > at
> > > > > the 6th argument of the method. It is assuming the object type
as
> > > > > "Object" not "javax.activation.DataHandler"
> > > > >
> > > > > Vector params = new Vector();
> > > > >         params.addElement(new Parameter("sessionID",
long.class,
> > > > >                 new Long(sessionID), null));
> > > > >         params.addElement(new Parameter("containerID",
> > > > > containerID.getClass(),
> > > > >                 new String(containerID), null));
> > > > >         params.addElement(new Parameter("xmlString",
> > > > > xmlString.getClass(),
> > > > >                 new String(xmlString), null));
> > > > >
> > > > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > "application/octet-stream");
> > > > >         DataHandler dh = new DataHandler(ds);
> > > > >         params.addElement(new Parameter("source",
> > > > >                 javax.activation.DataHandler.class, dh,
null));
> > > > >
> > > > >         //            params.addElement(new
> > > Parameter("encodedSource",
> > > > > encodedSource.getClass(), new String(encodedSource), null));
> > > > >         params.addElement(new Parameter("sourceFileName",
> > > > >                 sourceFileName.getClass(), new
> > > String(sourceFileName),
> > > > > null));
> > > > >
> > > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > > "application/octet-stream");
> > > > >             dh = new DataHandler(ds);
> > > > >             params.addElement(new Parameter("thumb",
> > > > >                     javax.activation.DataHandler.class, dh,
null));
> > > > >             params.addElement(new Parameter("thumbFileName",
> > > > >                     thumbFileName.getClass(), new
> > > String(thumbFileName),
> > > > > null));
> > > > >         } else {
> > > > >             params.addElement(new Parameter("thumb",
> > > > >                     javax.activation.DataHandler.class, null,
> > > null));
> > > > >             params.addElement(new Parameter("thumbFileName",
> > > > >                     new String().getClass(), null, null));
> > > > >         }
> > > > >
> > > > > Exception trace is as follows:
> > > > >
> > > > > Generated fault:
> > > > >   Fault Code   = SOAP-ENV:Server
> > > > >   Fault String = Exception while handling service request:
> > > > > com.contextmedia.ip.s
> > > > >
> > >
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > > ing,java
> > > > >
> > >
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > > ect,java
> > > > > .lang.String) -- no signature match
> > > > > java.lang.Exception: Exception while handling service request:
> > > > > com.contextmedia.
> > > > >
> > >
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > > .String,
> > > > >
> > >
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > > .Object,
> > > > > java.lang.String) -- no signature match
> > > > >         at
> > > > >
> > >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > > >         at
> > > > >
> > >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > > >         at
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > > >
> > >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > > istener.java:211)
> > > > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at
java.awt.Component.processEvent(Component.java:3539)
> > > > >         at
java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > > >         at java.awt.Component.show(Component.java:941)
> > > > >         at java.awt.Component.setVisible(Component.java:898)
> > > > >         at
> > > > >
> > >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > > rmed(SimplexFrame.java:391)
> > > > >         at
> > > > >
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > > 45)
> > > > >         at
> > > > >
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > > ctButton.java:1499)
> > > > >         at
> > > > >
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > > .java:373)
> > > > >         at
> > > > >
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > > )
> > > > >         at
> > > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > > >         at
> > > > >
> > >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > > d(BasicMenuItemUI.java:882)
> > > > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > > > >         at
java.awt.Component.processEvent(Component.java:3539)
> > > > >         at
java.awt.Container.processEvent(Container.java:1159)
> > > > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
> > > > >
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > > )
> > > > >         at
> > > > >
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > > >
> > > > >         at
> > > > >
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > > >         at
java.awt.Component.dispatchEvent(Component.java:2492)
> > > > >         at
java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > > >         at
> > > > >
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > > read.java:126)
> > > > >         at
> > > > >
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > > ad.java:93)
> > > > >         at
> > > > >
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > > >         at
> > > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > > >
> > > > >
> > > > >
> > > > > Praveen
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > As a general recommendation, I encourage you to capture a
stack
> > > trace
> > > > > > for your exceptions.  Just having the exception message
makes it
> > > > > harder
> > > > > > to understand the cause of most exceptions.
> > > > > >
> > > > > > This particular exception means that a ByteArrayDataSource
was
> > > created
> > > > > > with no data array, such as passing a null for the byte
array.
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > > >
> > > > > > > BUt I have another problem. When I execute that method, I
get
> > > the
> > > > > > following
> > > > > > > exception.
> > > > > > >
> > > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > > >
> > > > > > > What does this mean? I double checked that my soap method
exists
> > > in
> > > > > > the
> > > > > > > descriptor and the implementation also exists on the
server
> > > side.
> > > > > But
> > > > > > the
> > > > > > > call doesn't reach the server at all.
> > > > > > >
> > > > > > > Praveen
> > > > > > > ----- Original Message -----
> > > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > > To: <so...@xml.apache.org>
> > > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > > Subject: Re: Soap With attachments example
> > > > > > >
> > > > > > >
> > > > > > > > This sample that I created from you code works for me,
i.e. it
> > > > > does
> > > > > > not
> > > > > > > > throw an NPE.
> > > > > > > >
> > > > > > > > Scott Nichol
> > > > > > > >
> > > > > > > > import java.io.*;
> > > > > > > > import java.util.*;
> > > > > > > > import java.net.*;
> > > > > > > > import org.w3c.dom.*;
> > > > > > > > import org.xml.sax.*;
> > > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > > import org.apache.soap.*;
> > > > > > > > import org.apache.soap.transport.*;
> > > > > > > > import org.apache.soap.encoding.*;
> > > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > > import org.apache.soap.rpc.*;
> > > > > > > > import org.apache.soap.messaging.*;
> > > > > > > > import javax.activation.*;
> > > > > > > > import javax.mail.internet.*;
> > > > > > > > import javax.xml.parsers.*;
> > > > > > > >
> > > > > > > > public class TestAttachments {
> > > > > > > >  public static void main(String[] args) {
> > > > > > > >   try {
> > > > > > > >       URL url = new URL(args[0]);
> > > > > > > >
> > > > > > > >    // Build the call.
> > > > > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > > > > >    Call call = new Call();
> > > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > > >    call.setMethodName("myMethodName");
> > > > > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > > >
> > > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > > >
> > > > > > > >    Vector params = new Vector();
> > > > > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > > >    params.addElement(new Parameter("source",
> > > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > > >
> > > > > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > > > > "application/octet-stream");
> > > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > > >      javax.activation.DataHandler.class,
> > > > > > > >     dh2, null));
> > > > > > > >
> > > > > > > >    call.setParams(params);
> > > > > > > >
> > > > > > > >    // Invoke the call.
> > > > > > > >    Response resp;
> > > > > > > >
> > > > > > > >    try {
> > > > > > > >     resp = call.invoke(url, "");
> > > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > > >    } catch (SOAPException e) {
> > > > > > > >     System.err.println("Caught SOAPException");
> > > > > > > >     e.printStackTrace();
> > > > > > > >    }
> > > > > > > >   } catch (Exception e) {
> > > > > > > >    e.printStackTrace();
> > > > > > > >   }
> > > > > > > >  }
> > > > > > > > }
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > > For additional commands, e-mail:
<ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Hi Scott,
Could you please look at the error ASAP and let me know whats wrong in my
code. I need to fix it ASAP.

Thanks in Advance.

Praveen

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 11:50 AM
Subject: Re: Soap With attachments example


> I updated my jar file with the current jar file that I got from the
nightly
> build. Now this is the error I get when I pass null for DataHandler.
>
> Uploading ....
> uploadContentObjectUsingAttachments...
> Generated fault:
>   Fault Code   = SOAP-ENV:Client
>   Fault String = Can't yet deserialize non-null Objects
> java.lang.Exception: Can't yet deserialize non-null Objects
>         at
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> entObjectWithAttachments(ContentObjectUtils.java:750)
>         at
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> er.actionPerformed(NewContentObjectDialog.java:275)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> istener.java:211)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at java.awt.Dialog.show(Dialog.java:375)
>         at java.awt.Component.show(Component.java:941)
>         at java.awt.Component.setVisible(Component.java:898)
>         at
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> rmed(SimplexFrame.java:391)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> d(BasicMenuItemUI.java:882)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
>
> Praveen
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 9:59 AM
> Subject: Re: Soap With attachments example
>
>
> > The newest nightly is right here:
> > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 9:35 AM
> > Subject: Re: Soap With attachments example
> >
> >
> > > Hey Scott,
> > > I could not find a nightly build dated yesterday or today. Could you
> > please
> > > check it out. If not, where can find the insturctions on how to
> > compile the
> > > src, so that I can compile it and use it. Can I just replace the old
> > > MimePartSerializer class file with the new one or do I have to replece
> > the
> > > whole jar.
> > >
> > > Thanks
> > >
> > > Praveen
> > >
> > >
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Monday, January 06, 2003 1:00 PM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > This is a "quirk" of the MimePartSerializer.  It is used to
> > serialize
> > > > InputStream, DataSource, MimeBodyPart and DataHandler.  When a null
> > > > value is passed in for serialization, the serializer (for some
> > reason)
> > > > chooses to serialize it as an Object.  That's why you get the
> > mismatch.
> > > >
> > > > I'm going to change the code to use the type specified to the
> > serializer
> > > > when serializing a null.  You can either grab the source
> > > >
> > (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > >
> > he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > ext/plain), compile it and use it, or wait until tomorrow and get a
> > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > Hi Scott,
> > > >
> > > > Eveyrthing seems to work fine now, except one minor problem. When
> > there
> > > > is nothing to send as argument I am passing in null and thats
> > throwing
> > > > exception. Please look at the bold lines of my code below. I am
> > passing
> > > > in the type of the argument as javax.activation.DataHandler.class,
> > but
> > > > it still takes it as Object. See the exception after the code. Look
> > at
> > > > the 6th argument of the method. It is assuming the object type as
> > > > "Object" not "javax.activation.DataHandler"
> > > >
> > > > Vector params = new Vector();
> > > >         params.addElement(new Parameter("sessionID", long.class,
> > > >                 new Long(sessionID), null));
> > > >         params.addElement(new Parameter("containerID",
> > > > containerID.getClass(),
> > > >                 new String(containerID), null));
> > > >         params.addElement(new Parameter("xmlString",
> > > > xmlString.getClass(),
> > > >                 new String(xmlString), null));
> > > >
> > > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > "application/octet-stream");
> > > >         DataHandler dh = new DataHandler(ds);
> > > >         params.addElement(new Parameter("source",
> > > >                 javax.activation.DataHandler.class, dh, null));
> > > >
> > > >         //            params.addElement(new
> > Parameter("encodedSource",
> > > > encodedSource.getClass(), new String(encodedSource), null));
> > > >         params.addElement(new Parameter("sourceFileName",
> > > >                 sourceFileName.getClass(), new
> > String(sourceFileName),
> > > > null));
> > > >
> > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > "application/octet-stream");
> > > >             dh = new DataHandler(ds);
> > > >             params.addElement(new Parameter("thumb",
> > > >                     javax.activation.DataHandler.class, dh, null));
> > > >             params.addElement(new Parameter("thumbFileName",
> > > >                     thumbFileName.getClass(), new
> > String(thumbFileName),
> > > > null));
> > > >         } else {
> > > >             params.addElement(new Parameter("thumb",
> > > >                     javax.activation.DataHandler.class, null,
> > null));
> > > >             params.addElement(new Parameter("thumbFileName",
> > > >                     new String().getClass(), null, null));
> > > >         }
> > > >
> > > > Exception trace is as follows:
> > > >
> > > > Generated fault:
> > > >   Fault Code   = SOAP-ENV:Server
> > > >   Fault String = Exception while handling service request:
> > > > com.contextmedia.ip.s
> > > >
> > ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > ing,java
> > > >
> > .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > ect,java
> > > > .lang.String) -- no signature match
> > > > java.lang.Exception: Exception while handling service request:
> > > > com.contextmedia.
> > > >
> > ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > .String,
> > > >
> > java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > .Object,
> > > > java.lang.String) -- no signature match
> > > >         at
> > > >
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > >         at
> > > >
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > >         at
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > 45)
> > > >         at
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > ctButton.java:1499)
> > > >         at
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > .java:373)
> > > >         at
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > )
> > > >         at
> > > >
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > istener.java:211)
> > > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > )
> > > >         at
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > >
> > > >         at
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > >         at
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > read.java:126)
> > > >         at
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > ad.java:93)
> > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > >         at java.awt.Component.show(Component.java:941)
> > > >         at java.awt.Component.setVisible(Component.java:898)
> > > >         at
> > > >
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > rmed(SimplexFrame.java:391)
> > > >         at
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > 45)
> > > >         at
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > ctButton.java:1499)
> > > >         at
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > .java:373)
> > > >         at
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > )
> > > >         at
> > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > >         at
> > > >
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > d(BasicMenuItemUI.java:882)
> > > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > )
> > > >         at
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > >
> > > >         at
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > >         at
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > read.java:126)
> > > >         at
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > ad.java:93)
> > > >         at
> > > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > >         at
> > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > >
> > > >
> > > >
> > > > Praveen
> > > >
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > As a general recommendation, I encourage you to capture a stack
> > trace
> > > > > for your exceptions.  Just having the exception message makes it
> > > > harder
> > > > > to understand the cause of most exceptions.
> > > > >
> > > > > This particular exception means that a ByteArrayDataSource was
> > created
> > > > > with no data array, such as passing a null for the byte array.
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > >
> > > > > > BUt I have another problem. When I execute that method, I get
> > the
> > > > > following
> > > > > > exception.
> > > > > >
> > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > >
> > > > > > What does this mean? I double checked that my soap method exists
> > in
> > > > > the
> > > > > > descriptor and the implementation also exists on the server
> > side.
> > > > But
> > > > > the
> > > > > > call doesn't reach the server at all.
> > > > > >
> > > > > > Praveen
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > This sample that I created from you code works for me, i.e. it
> > > > does
> > > > > not
> > > > > > > throw an NPE.
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > import java.io.*;
> > > > > > > import java.util.*;
> > > > > > > import java.net.*;
> > > > > > > import org.w3c.dom.*;
> > > > > > > import org.xml.sax.*;
> > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > import org.apache.soap.*;
> > > > > > > import org.apache.soap.transport.*;
> > > > > > > import org.apache.soap.encoding.*;
> > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > import org.apache.soap.rpc.*;
> > > > > > > import org.apache.soap.messaging.*;
> > > > > > > import javax.activation.*;
> > > > > > > import javax.mail.internet.*;
> > > > > > > import javax.xml.parsers.*;
> > > > > > >
> > > > > > > public class TestAttachments {
> > > > > > >  public static void main(String[] args) {
> > > > > > >   try {
> > > > > > >       URL url = new URL(args[0]);
> > > > > > >
> > > > > > >    // Build the call.
> > > > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > > > >    Call call = new Call();
> > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > >    call.setMethodName("myMethodName");
> > > > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > >
> > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > >
> > > > > > >    Vector params = new Vector();
> > > > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > > "application/octet-stream");
> > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > >    params.addElement(new Parameter("source",
> > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > >
> > > > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > > > "application/octet-stream");
> > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > >      javax.activation.DataHandler.class,
> > > > > > >     dh2, null));
> > > > > > >
> > > > > > >    call.setParams(params);
> > > > > > >
> > > > > > >    // Invoke the call.
> > > > > > >    Response resp;
> > > > > > >
> > > > > > >    try {
> > > > > > >     resp = call.invoke(url, "");
> > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > >    } catch (SOAPException e) {
> > > > > > >     System.err.println("Caught SOAPException");
> > > > > > >     e.printStackTrace();
> > > > > > >    }
> > > > > > >   } catch (Exception e) {
> > > > > > >    e.printStackTrace();
> > > > > > >   }
> > > > > > >  }
> > > > > > > }
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Urgent: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Hi Scott,
Could you please look at the error ASAP and let me know whats wrong in my
code. I need to fix it ASAP.

Thanks in Advance.

Praveen

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 11:50 AM
Subject: Re: Soap With attachments example


> I updated my jar file with the current jar file that I got from the
nightly
> build. Now this is the error I get when I pass null for DataHandler.
>
> Uploading ....
> uploadContentObjectUsingAttachments...
> Generated fault:
>   Fault Code   = SOAP-ENV:Client
>   Fault String = Can't yet deserialize non-null Objects
> java.lang.Exception: Can't yet deserialize non-null Objects
>         at
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> entObjectWithAttachments(ContentObjectUtils.java:750)
>         at
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> er.actionPerformed(NewContentObjectDialog.java:275)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> istener.java:211)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at java.awt.Dialog.show(Dialog.java:375)
>         at java.awt.Component.show(Component.java:941)
>         at java.awt.Component.setVisible(Component.java:898)
>         at
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> rmed(SimplexFrame.java:391)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> d(BasicMenuItemUI.java:882)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
>
> Praveen
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 9:59 AM
> Subject: Re: Soap With attachments example
>
>
> > The newest nightly is right here:
> > http://cvs.apache.org/dist/soap/nightly/2003-01-07/
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, January 07, 2003 9:35 AM
> > Subject: Re: Soap With attachments example
> >
> >
> > > Hey Scott,
> > > I could not find a nightly build dated yesterday or today. Could you
> > please
> > > check it out. If not, where can find the insturctions on how to
> > compile the
> > > src, so that I can compile it and use it. Can I just replace the old
> > > MimePartSerializer class file with the new one or do I have to replece
> > the
> > > whole jar.
> > >
> > > Thanks
> > >
> > > Praveen
> > >
> > >
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Monday, January 06, 2003 1:00 PM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > This is a "quirk" of the MimePartSerializer.  It is used to
> > serialize
> > > > InputStream, DataSource, MimeBodyPart and DataHandler.  When a null
> > > > value is passed in for serialization, the serializer (for some
> > reason)
> > > > chooses to serialize it as an Object.  That's why you get the
> > mismatch.
> > > >
> > > > I'm going to change the code to use the type specified to the
> > serializer
> > > > when serializing a null.  You can either grab the source
> > > >
> > (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > > >
> > he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > > ext/plain), compile it and use it, or wait until tomorrow and get a
> > > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Monday, January 06, 2003 11:28 AM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > Hi Scott,
> > > >
> > > > Eveyrthing seems to work fine now, except one minor problem. When
> > there
> > > > is nothing to send as argument I am passing in null and thats
> > throwing
> > > > exception. Please look at the bold lines of my code below. I am
> > passing
> > > > in the type of the argument as javax.activation.DataHandler.class,
> > but
> > > > it still takes it as Object. See the exception after the code. Look
> > at
> > > > the 6th argument of the method. It is assuming the object type as
> > > > "Object" not "javax.activation.DataHandler"
> > > >
> > > > Vector params = new Vector();
> > > >         params.addElement(new Parameter("sessionID", long.class,
> > > >                 new Long(sessionID), null));
> > > >         params.addElement(new Parameter("containerID",
> > > > containerID.getClass(),
> > > >                 new String(containerID), null));
> > > >         params.addElement(new Parameter("xmlString",
> > > > xmlString.getClass(),
> > > >                 new String(xmlString), null));
> > > >
> > > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > "application/octet-stream");
> > > >         DataHandler dh = new DataHandler(ds);
> > > >         params.addElement(new Parameter("source",
> > > >                 javax.activation.DataHandler.class, dh, null));
> > > >
> > > >         //            params.addElement(new
> > Parameter("encodedSource",
> > > > encodedSource.getClass(), new String(encodedSource), null));
> > > >         params.addElement(new Parameter("sourceFileName",
> > > >                 sourceFileName.getClass(), new
> > String(sourceFileName),
> > > > null));
> > > >
> > > >         if (thumbBytes != null && thumbFileName!=null) {
> > > >             ds = new ByteArrayDataSource(thumbBytes,
> > > > "application/octet-stream");
> > > >             dh = new DataHandler(ds);
> > > >             params.addElement(new Parameter("thumb",
> > > >                     javax.activation.DataHandler.class, dh, null));
> > > >             params.addElement(new Parameter("thumbFileName",
> > > >                     thumbFileName.getClass(), new
> > String(thumbFileName),
> > > > null));
> > > >         } else {
> > > >             params.addElement(new Parameter("thumb",
> > > >                     javax.activation.DataHandler.class, null,
> > null));
> > > >             params.addElement(new Parameter("thumbFileName",
> > > >                     new String().getClass(), null, null));
> > > >         }
> > > >
> > > > Exception trace is as follows:
> > > >
> > > > Generated fault:
> > > >   Fault Code   = SOAP-ENV:Server
> > > >   Fault String = Exception while handling service request:
> > > > com.contextmedia.ip.s
> > > >
> > ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > > ing,java
> > > >
> > .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > > ect,java
> > > > .lang.String) -- no signature match
> > > > java.lang.Exception: Exception while handling service request:
> > > > com.contextmedia.
> > > >
> > ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > > .String,
> > > >
> > java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > > .Object,
> > > > java.lang.String) -- no signature match
> > > >         at
> > > >
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > > >         at
> > > >
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > > er.actionPerformed(NewContentObjectDialog.java:275)
> > > >         at
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > 45)
> > > >         at
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > ctButton.java:1499)
> > > >         at
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > .java:373)
> > > >         at
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > )
> > > >         at
> > > >
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > > istener.java:211)
> > > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > )
> > > >         at
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > >
> > > >         at
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > >         at
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > read.java:126)
> > > >         at
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > ad.java:93)
> > > >         at java.awt.Dialog.show(Dialog.java:375)
> > > >         at java.awt.Component.show(Component.java:941)
> > > >         at java.awt.Component.setVisible(Component.java:898)
> > > >         at
> > > >
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > > rmed(SimplexFrame.java:391)
> > > >         at
> > > >
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > > 45)
> > > >         at
> > > >
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > > ctButton.java:1499)
> > > >         at
> > > >
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > > .java:373)
> > > >         at
> > > >
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > > )
> > > >         at
> > javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > > >         at
> > > >
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > > d(BasicMenuItemUI.java:882)
> > > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > > >         at java.awt.Component.processEvent(Component.java:3539)
> > > >         at java.awt.Container.processEvent(Container.java:1159)
> > > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at
> > > >
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > > )
> > > >         at
> > > >
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > > >
> > > >         at
> > > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > > >         at
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > > read.java:126)
> > > >         at
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > > ad.java:93)
> > > >         at
> > > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > > >         at
> > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > > >
> > > >
> > > >
> > > > Praveen
> > > >
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Friday, January 03, 2003 4:41 PM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > As a general recommendation, I encourage you to capture a stack
> > trace
> > > > > for your exceptions.  Just having the exception message makes it
> > > > harder
> > > > > to understand the cause of most exceptions.
> > > > >
> > > > > This particular exception means that a ByteArrayDataSource was
> > created
> > > > > with no data array, such as passing a null for the byte array.
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > > >
> > > > > > BUt I have another problem. When I execute that method, I get
> > the
> > > > > following
> > > > > > exception.
> > > > > >
> > > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > > >
> > > > > > What does this mean? I double checked that my soap method exists
> > in
> > > > > the
> > > > > > descriptor and the implementation also exists on the server
> > side.
> > > > But
> > > > > the
> > > > > > call doesn't reach the server at all.
> > > > > >
> > > > > > Praveen
> > > > > > ----- Original Message -----
> > > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > > To: <so...@xml.apache.org>
> > > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > > Subject: Re: Soap With attachments example
> > > > > >
> > > > > >
> > > > > > > This sample that I created from you code works for me, i.e. it
> > > > does
> > > > > not
> > > > > > > throw an NPE.
> > > > > > >
> > > > > > > Scott Nichol
> > > > > > >
> > > > > > > import java.io.*;
> > > > > > > import java.util.*;
> > > > > > > import java.net.*;
> > > > > > > import org.w3c.dom.*;
> > > > > > > import org.xml.sax.*;
> > > > > > > import org.apache.soap.util.xml.*;
> > > > > > > import org.apache.soap.util.mime.*;
> > > > > > > import org.apache.soap.*;
> > > > > > > import org.apache.soap.transport.*;
> > > > > > > import org.apache.soap.encoding.*;
> > > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > > import org.apache.soap.rpc.*;
> > > > > > > import org.apache.soap.messaging.*;
> > > > > > > import javax.activation.*;
> > > > > > > import javax.mail.internet.*;
> > > > > > > import javax.xml.parsers.*;
> > > > > > >
> > > > > > > public class TestAttachments {
> > > > > > >  public static void main(String[] args) {
> > > > > > >   try {
> > > > > > >       URL url = new URL(args[0]);
> > > > > > >
> > > > > > >    // Build the call.
> > > > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > > > >    Call call = new Call();
> > > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > > >    call.setMethodName("myMethodName");
> > > > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > > >
> > > > > > >    byte[] sourceBytes = new byte[0];
> > > > > > >
> > > > > > >    Vector params = new Vector();
> > > > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > > "application/octet-stream");
> > > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > > >    params.addElement(new Parameter("source",
> > > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > > >
> > > > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > > > "application/octet-stream");
> > > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > > >    params.addElement(new Parameter("thumb",
> > > > > > >      javax.activation.DataHandler.class,
> > > > > > >     dh2, null));
> > > > > > >
> > > > > > >    call.setParams(params);
> > > > > > >
> > > > > > >    // Invoke the call.
> > > > > > >    Response resp;
> > > > > > >
> > > > > > >    try {
> > > > > > >     resp = call.invoke(url, "");
> > > > > > >     //System.out.println("Response is: " + resp);
> > > > > > >    } catch (SOAPException e) {
> > > > > > >     System.err.println("Caught SOAPException");
> > > > > > >     e.printStackTrace();
> > > > > > >    }
> > > > > > >   } catch (Exception e) {
> > > > > > >    e.printStackTrace();
> > > > > > >   }
> > > > > > >  }
> > > > > > > }
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > > <ma...@xml.apache.org>
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
I updated my jar file with the current jar file that I got from the nightly
build. Now this is the error I get when I pass null for DataHandler.

Uploading ....
uploadContentObjectUsingAttachments...
Generated fault:
  Fault Code   = SOAP-ENV:Client
  Fault String = Can't yet deserialize non-null Objects
java.lang.Exception: Can't yet deserialize non-null Objects
        at
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
entObjectWithAttachments(ContentObjectUtils.java:750)
        at
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
er.actionPerformed(NewContentObjectDialog.java:275)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:211)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.Dialog.show(Dialog.java:375)
        at java.awt.Component.show(Component.java:941)
        at java.awt.Component.setVisible(Component.java:898)
        at
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
rmed(SimplexFrame.java:391)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
        at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
d(BasicMenuItemUI.java:882)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)

Praveen
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 9:59 AM
Subject: Re: Soap With attachments example


> The newest nightly is right here:
> http://cvs.apache.org/dist/soap/nightly/2003-01-07/
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 9:35 AM
> Subject: Re: Soap With attachments example
>
>
> > Hey Scott,
> > I could not find a nightly build dated yesterday or today. Could you
> please
> > check it out. If not, where can find the insturctions on how to
> compile the
> > src, so that I can compile it and use it. Can I just replace the old
> > MimePartSerializer class file with the new one or do I have to replece
> the
> > whole jar.
> >
> > Thanks
> >
> > Praveen
> >
> >
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Monday, January 06, 2003 1:00 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > This is a "quirk" of the MimePartSerializer.  It is used to
> serialize
> > > InputStream, DataSource, MimeBodyPart and DataHandler.  When a null
> > > value is passed in for serialization, the serializer (for some
> reason)
> > > chooses to serialize it as an Object.  That's why you get the
> mismatch.
> > >
> > > I'm going to change the code to use the type specified to the
> serializer
> > > when serializing a null.  You can either grab the source
> > >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > ext/plain), compile it and use it, or wait until tomorrow and get a
> > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Monday, January 06, 2003 11:28 AM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > Hi Scott,
> > >
> > > Eveyrthing seems to work fine now, except one minor problem. When
> there
> > > is nothing to send as argument I am passing in null and thats
> throwing
> > > exception. Please look at the bold lines of my code below. I am
> passing
> > > in the type of the argument as javax.activation.DataHandler.class,
> but
> > > it still takes it as Object. See the exception after the code. Look
> at
> > > the 6th argument of the method. It is assuming the object type as
> > > "Object" not "javax.activation.DataHandler"
> > >
> > > Vector params = new Vector();
> > >         params.addElement(new Parameter("sessionID", long.class,
> > >                 new Long(sessionID), null));
> > >         params.addElement(new Parameter("containerID",
> > > containerID.getClass(),
> > >                 new String(containerID), null));
> > >         params.addElement(new Parameter("xmlString",
> > > xmlString.getClass(),
> > >                 new String(xmlString), null));
> > >
> > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >         DataHandler dh = new DataHandler(ds);
> > >         params.addElement(new Parameter("source",
> > >                 javax.activation.DataHandler.class, dh, null));
> > >
> > >         //            params.addElement(new
> Parameter("encodedSource",
> > > encodedSource.getClass(), new String(encodedSource), null));
> > >         params.addElement(new Parameter("sourceFileName",
> > >                 sourceFileName.getClass(), new
> String(sourceFileName),
> > > null));
> > >
> > >         if (thumbBytes != null && thumbFileName!=null) {
> > >             ds = new ByteArrayDataSource(thumbBytes,
> > > "application/octet-stream");
> > >             dh = new DataHandler(ds);
> > >             params.addElement(new Parameter("thumb",
> > >                     javax.activation.DataHandler.class, dh, null));
> > >             params.addElement(new Parameter("thumbFileName",
> > >                     thumbFileName.getClass(), new
> String(thumbFileName),
> > > null));
> > >         } else {
> > >             params.addElement(new Parameter("thumb",
> > >                     javax.activation.DataHandler.class, null,
> null));
> > >             params.addElement(new Parameter("thumbFileName",
> > >                     new String().getClass(), null, null));
> > >         }
> > >
> > > Exception trace is as follows:
> > >
> > > Generated fault:
> > >   Fault Code   = SOAP-ENV:Server
> > >   Fault String = Exception while handling service request:
> > > com.contextmedia.ip.s
> > >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > ing,java
> > >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > ect,java
> > > .lang.String) -- no signature match
> > > java.lang.Exception: Exception while handling service request:
> > > com.contextmedia.
> > >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > .String,
> > >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > .Object,
> > > java.lang.String) -- no signature match
> > >         at
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > >         at
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > er.actionPerformed(NewContentObjectDialog.java:275)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > istener.java:211)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at java.awt.Dialog.show(Dialog.java:375)
> > >         at java.awt.Component.show(Component.java:941)
> > >         at java.awt.Component.setVisible(Component.java:898)
> > >         at
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > rmed(SimplexFrame.java:391)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > >         at
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > d(BasicMenuItemUI.java:882)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > >         at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > >
> > >
> > >
> > > Praveen
> > >
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Friday, January 03, 2003 4:41 PM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > As a general recommendation, I encourage you to capture a stack
> trace
> > > > for your exceptions.  Just having the exception message makes it
> > > harder
> > > > to understand the cause of most exceptions.
> > > >
> > > > This particular exception means that a ByteArrayDataSource was
> created
> > > > with no data array, such as passing a null for the byte array.
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > >
> > > > > BUt I have another problem. When I execute that method, I get
> the
> > > > following
> > > > > exception.
> > > > >
> > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > >
> > > > > What does this mean? I double checked that my soap method exists
> in
> > > > the
> > > > > descriptor and the implementation also exists on the server
> side.
> > > But
> > > > the
> > > > > call doesn't reach the server at all.
> > > > >
> > > > > Praveen
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > This sample that I created from you code works for me, i.e. it
> > > does
> > > > not
> > > > > > throw an NPE.
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > import java.io.*;
> > > > > > import java.util.*;
> > > > > > import java.net.*;
> > > > > > import org.w3c.dom.*;
> > > > > > import org.xml.sax.*;
> > > > > > import org.apache.soap.util.xml.*;
> > > > > > import org.apache.soap.util.mime.*;
> > > > > > import org.apache.soap.*;
> > > > > > import org.apache.soap.transport.*;
> > > > > > import org.apache.soap.encoding.*;
> > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > import org.apache.soap.rpc.*;
> > > > > > import org.apache.soap.messaging.*;
> > > > > > import javax.activation.*;
> > > > > > import javax.mail.internet.*;
> > > > > > import javax.xml.parsers.*;
> > > > > >
> > > > > > public class TestAttachments {
> > > > > >  public static void main(String[] args) {
> > > > > >   try {
> > > > > >       URL url = new URL(args[0]);
> > > > > >
> > > > > >    // Build the call.
> > > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > > >    Call call = new Call();
> > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > >    call.setMethodName("myMethodName");
> > > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > >
> > > > > >    byte[] sourceBytes = new byte[0];
> > > > > >
> > > > > >    Vector params = new Vector();
> > > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > "application/octet-stream");
> > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > >    params.addElement(new Parameter("source",
> > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > >
> > > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > > "application/octet-stream");
> > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > >    params.addElement(new Parameter("thumb",
> > > > > >      javax.activation.DataHandler.class,
> > > > > >     dh2, null));
> > > > > >
> > > > > >    call.setParams(params);
> > > > > >
> > > > > >    // Invoke the call.
> > > > > >    Response resp;
> > > > > >
> > > > > >    try {
> > > > > >     resp = call.invoke(url, "");
> > > > > >     //System.out.println("Response is: " + resp);
> > > > > >    } catch (SOAPException e) {
> > > > > >     System.err.println("Caught SOAPException");
> > > > > >     e.printStackTrace();
> > > > > >    }
> > > > > >   } catch (Exception e) {
> > > > > >    e.printStackTrace();
> > > > > >   }
> > > > > >  }
> > > > > > }
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
I updated my jar file with the current jar file that I got from the nightly
build. Now this is the error I get when I pass null for DataHandler.

Uploading ....
uploadContentObjectUsingAttachments...
Generated fault:
  Fault Code   = SOAP-ENV:Client
  Fault String = Can't yet deserialize non-null Objects
java.lang.Exception: Can't yet deserialize non-null Objects
        at
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
entObjectWithAttachments(ContentObjectUtils.java:750)
        at
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
er.actionPerformed(NewContentObjectDialog.java:275)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:211)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.Dialog.show(Dialog.java:375)
        at java.awt.Component.show(Component.java:941)
        at java.awt.Component.setVisible(Component.java:898)
        at
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
rmed(SimplexFrame.java:391)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
        at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
d(BasicMenuItemUI.java:882)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)

Praveen
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 9:59 AM
Subject: Re: Soap With attachments example


> The newest nightly is right here:
> http://cvs.apache.org/dist/soap/nightly/2003-01-07/
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, January 07, 2003 9:35 AM
> Subject: Re: Soap With attachments example
>
>
> > Hey Scott,
> > I could not find a nightly build dated yesterday or today. Could you
> please
> > check it out. If not, where can find the insturctions on how to
> compile the
> > src, so that I can compile it and use it. Can I just replace the old
> > MimePartSerializer class file with the new one or do I have to replece
> the
> > whole jar.
> >
> > Thanks
> >
> > Praveen
> >
> >
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Monday, January 06, 2003 1:00 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > This is a "quirk" of the MimePartSerializer.  It is used to
> serialize
> > > InputStream, DataSource, MimeBodyPart and DataHandler.  When a null
> > > value is passed in for serialization, the serializer (for some
> reason)
> > > chooses to serialize it as an Object.  That's why you get the
> mismatch.
> > >
> > > I'm going to change the code to use the type specified to the
> serializer
> > > when serializing a null.  You can either grab the source
> > >
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> > >
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > > ext/plain), compile it and use it, or wait until tomorrow and get a
> > > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Monday, January 06, 2003 11:28 AM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > Hi Scott,
> > >
> > > Eveyrthing seems to work fine now, except one minor problem. When
> there
> > > is nothing to send as argument I am passing in null and thats
> throwing
> > > exception. Please look at the bold lines of my code below. I am
> passing
> > > in the type of the argument as javax.activation.DataHandler.class,
> but
> > > it still takes it as Object. See the exception after the code. Look
> at
> > > the 6th argument of the method. It is assuming the object type as
> > > "Object" not "javax.activation.DataHandler"
> > >
> > > Vector params = new Vector();
> > >         params.addElement(new Parameter("sessionID", long.class,
> > >                 new Long(sessionID), null));
> > >         params.addElement(new Parameter("containerID",
> > > containerID.getClass(),
> > >                 new String(containerID), null));
> > >         params.addElement(new Parameter("xmlString",
> > > xmlString.getClass(),
> > >                 new String(xmlString), null));
> > >
> > >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >         DataHandler dh = new DataHandler(ds);
> > >         params.addElement(new Parameter("source",
> > >                 javax.activation.DataHandler.class, dh, null));
> > >
> > >         //            params.addElement(new
> Parameter("encodedSource",
> > > encodedSource.getClass(), new String(encodedSource), null));
> > >         params.addElement(new Parameter("sourceFileName",
> > >                 sourceFileName.getClass(), new
> String(sourceFileName),
> > > null));
> > >
> > >         if (thumbBytes != null && thumbFileName!=null) {
> > >             ds = new ByteArrayDataSource(thumbBytes,
> > > "application/octet-stream");
> > >             dh = new DataHandler(ds);
> > >             params.addElement(new Parameter("thumb",
> > >                     javax.activation.DataHandler.class, dh, null));
> > >             params.addElement(new Parameter("thumbFileName",
> > >                     thumbFileName.getClass(), new
> String(thumbFileName),
> > > null));
> > >         } else {
> > >             params.addElement(new Parameter("thumb",
> > >                     javax.activation.DataHandler.class, null,
> null));
> > >             params.addElement(new Parameter("thumbFileName",
> > >                     new String().getClass(), null, null));
> > >         }
> > >
> > > Exception trace is as follows:
> > >
> > > Generated fault:
> > >   Fault Code   = SOAP-ENV:Server
> > >   Fault String = Exception while handling service request:
> > > com.contextmedia.ip.s
> > >
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > > ing,java
> > >
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > > ect,java
> > > .lang.String) -- no signature match
> > > java.lang.Exception: Exception while handling service request:
> > > com.contextmedia.
> > >
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > > .String,
> > >
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > > .Object,
> > > java.lang.String) -- no signature match
> > >         at
> > >
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > entObjectWithAttachments(ContentObjectUtils.java:742)
> > >         at
> > >
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > er.actionPerformed(NewContentObjectDialog.java:275)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> > >
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > istener.java:211)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at java.awt.Dialog.show(Dialog.java:375)
> > >         at java.awt.Component.show(Component.java:941)
> > >         at java.awt.Component.setVisible(Component.java:898)
> > >         at
> > >
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > rmed(SimplexFrame.java:391)
> > >         at
> > >
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > >         at
> > >
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > d(BasicMenuItemUI.java:882)
> > >         at java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > >         at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > >
> > >
> > >
> > > Praveen
> > >
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Friday, January 03, 2003 4:41 PM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > As a general recommendation, I encourage you to capture a stack
> trace
> > > > for your exceptions.  Just having the exception message makes it
> > > harder
> > > > to understand the cause of most exceptions.
> > > >
> > > > This particular exception means that a ByteArrayDataSource was
> created
> > > > with no data array, such as passing a null for the byte array.
> > > >
> > > > Scott Nichol
> > > >
> > > > ----- Original Message -----
> > > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Friday, January 03, 2003 4:18 PM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > Yeah. It works now. Its my bad. Sorry about that.
> > > > >
> > > > > BUt I have another problem. When I execute that method, I get
> the
> > > > following
> > > > > exception.
> > > > >
> > > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > > >
> > > > > What does this mean? I double checked that my soap method exists
> in
> > > > the
> > > > > descriptor and the implementation also exists on the server
> side.
> > > But
> > > > the
> > > > > call doesn't reach the server at all.
> > > > >
> > > > > Praveen
> > > > > ----- Original Message -----
> > > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > > Subject: Re: Soap With attachments example
> > > > >
> > > > >
> > > > > > This sample that I created from you code works for me, i.e. it
> > > does
> > > > not
> > > > > > throw an NPE.
> > > > > >
> > > > > > Scott Nichol
> > > > > >
> > > > > > import java.io.*;
> > > > > > import java.util.*;
> > > > > > import java.net.*;
> > > > > > import org.w3c.dom.*;
> > > > > > import org.xml.sax.*;
> > > > > > import org.apache.soap.util.xml.*;
> > > > > > import org.apache.soap.util.mime.*;
> > > > > > import org.apache.soap.*;
> > > > > > import org.apache.soap.transport.*;
> > > > > > import org.apache.soap.encoding.*;
> > > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > > import org.apache.soap.rpc.*;
> > > > > > import org.apache.soap.messaging.*;
> > > > > > import javax.activation.*;
> > > > > > import javax.mail.internet.*;
> > > > > > import javax.xml.parsers.*;
> > > > > >
> > > > > > public class TestAttachments {
> > > > > >  public static void main(String[] args) {
> > > > > >   try {
> > > > > >       URL url = new URL(args[0]);
> > > > > >
> > > > > >    // Build the call.
> > > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > > >    Call call = new Call();
> > > > > >    call.setSOAPMappingRegistry(smr);
> > > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > > >    call.setMethodName("myMethodName");
> > > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > > >
> > > > > >    byte[] sourceBytes = new byte[0];
> > > > > >
> > > > > >    Vector params = new Vector();
> > > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > > "application/octet-stream");
> > > > > >    DataHandler dh = new DataHandler(ds);
> > > > > >    params.addElement(new Parameter("source",
> > > > > >     javax.activation.DataHandler.class, dh, null));
> > > > > >
> > > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > > "application/octet-stream");
> > > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > > >    params.addElement(new Parameter("thumb",
> > > > > >      javax.activation.DataHandler.class,
> > > > > >     dh2, null));
> > > > > >
> > > > > >    call.setParams(params);
> > > > > >
> > > > > >    // Invoke the call.
> > > > > >    Response resp;
> > > > > >
> > > > > >    try {
> > > > > >     resp = call.invoke(url, "");
> > > > > >     //System.out.println("Response is: " + resp);
> > > > > >    } catch (SOAPException e) {
> > > > > >     System.err.println("Caught SOAPException");
> > > > > >     e.printStackTrace();
> > > > > >    }
> > > > > >   } catch (Exception e) {
> > > > > >    e.printStackTrace();
> > > > > >   }
> > > > > >  }
> > > > > > }
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@xml.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
The newest nightly is right here:
http://cvs.apache.org/dist/soap/nightly/2003-01-07/

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 9:35 AM
Subject: Re: Soap With attachments example


> Hey Scott,
> I could not find a nightly build dated yesterday or today. Could you
please
> check it out. If not, where can find the insturctions on how to
compile the
> src, so that I can compile it and use it. Can I just replace the old
> MimePartSerializer class file with the new one or do I have to replece
the
> whole jar.
>
> Thanks
>
> Praveen
>
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Monday, January 06, 2003 1:00 PM
> Subject: Re: Soap With attachments example
>
>
> > This is a "quirk" of the MimePartSerializer.  It is used to
serialize
> > InputStream, DataSource, MimeBodyPart and DataHandler.  When a null
> > value is passed in for serialization, the serializer (for some
reason)
> > chooses to serialize it as an Object.  That's why you get the
mismatch.
> >
> > I'm going to change the code to use the type specified to the
serializer
> > when serializing a null.  You can either grab the source
> >
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> >
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > ext/plain), compile it and use it, or wait until tomorrow and get a
> > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Monday, January 06, 2003 11:28 AM
> > Subject: Re: Soap With attachments example
> >
> >
> > Hi Scott,
> >
> > Eveyrthing seems to work fine now, except one minor problem. When
there
> > is nothing to send as argument I am passing in null and thats
throwing
> > exception. Please look at the bold lines of my code below. I am
passing
> > in the type of the argument as javax.activation.DataHandler.class,
but
> > it still takes it as Object. See the exception after the code. Look
at
> > the 6th argument of the method. It is assuming the object type as
> > "Object" not "javax.activation.DataHandler"
> >
> > Vector params = new Vector();
> >         params.addElement(new Parameter("sessionID", long.class,
> >                 new Long(sessionID), null));
> >         params.addElement(new Parameter("containerID",
> > containerID.getClass(),
> >                 new String(containerID), null));
> >         params.addElement(new Parameter("xmlString",
> > xmlString.getClass(),
> >                 new String(xmlString), null));
> >
> >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > "application/octet-stream");
> >         DataHandler dh = new DataHandler(ds);
> >         params.addElement(new Parameter("source",
> >                 javax.activation.DataHandler.class, dh, null));
> >
> >         //            params.addElement(new
Parameter("encodedSource",
> > encodedSource.getClass(), new String(encodedSource), null));
> >         params.addElement(new Parameter("sourceFileName",
> >                 sourceFileName.getClass(), new
String(sourceFileName),
> > null));
> >
> >         if (thumbBytes != null && thumbFileName!=null) {
> >             ds = new ByteArrayDataSource(thumbBytes,
> > "application/octet-stream");
> >             dh = new DataHandler(ds);
> >             params.addElement(new Parameter("thumb",
> >                     javax.activation.DataHandler.class, dh, null));
> >             params.addElement(new Parameter("thumbFileName",
> >                     thumbFileName.getClass(), new
String(thumbFileName),
> > null));
> >         } else {
> >             params.addElement(new Parameter("thumb",
> >                     javax.activation.DataHandler.class, null,
null));
> >             params.addElement(new Parameter("thumbFileName",
> >                     new String().getClass(), null, null));
> >         }
> >
> > Exception trace is as follows:
> >
> > Generated fault:
> >   Fault Code   = SOAP-ENV:Server
> >   Fault String = Exception while handling service request:
> > com.contextmedia.ip.s
> >
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > ing,java
> >
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > ect,java
> > .lang.String) -- no signature match
> > java.lang.Exception: Exception while handling service request:
> > com.contextmedia.
> >
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > .String,
> >
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > .Object,
> > java.lang.String) -- no signature match
> >         at
> >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > entObjectWithAttachments(ContentObjectUtils.java:742)
> >         at
> >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > er.actionPerformed(NewContentObjectDialog.java:275)
> >         at
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
> >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > istener.java:211)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at java.awt.Dialog.show(Dialog.java:375)
> >         at java.awt.Component.show(Component.java:941)
> >         at java.awt.Component.setVisible(Component.java:898)
> >         at
> >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > rmed(SimplexFrame.java:391)
> >         at
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> >         at
> >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > d(BasicMenuItemUI.java:882)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> >         at
java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> >
> >
> >
> > Praveen
> >
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, January 03, 2003 4:41 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > As a general recommendation, I encourage you to capture a stack
trace
> > > for your exceptions.  Just having the exception message makes it
> > harder
> > > to understand the cause of most exceptions.
> > >
> > > This particular exception means that a ByteArrayDataSource was
created
> > > with no data array, such as passing a null for the byte array.
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Friday, January 03, 2003 4:18 PM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > Yeah. It works now. Its my bad. Sorry about that.
> > > >
> > > > BUt I have another problem. When I execute that method, I get
the
> > > following
> > > > exception.
> > > >
> > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > >
> > > > What does this mean? I double checked that my soap method exists
in
> > > the
> > > > descriptor and the implementation also exists on the server
side.
> > But
> > > the
> > > > call doesn't reach the server at all.
> > > >
> > > > Praveen
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > This sample that I created from you code works for me, i.e. it
> > does
> > > not
> > > > > throw an NPE.
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > import java.io.*;
> > > > > import java.util.*;
> > > > > import java.net.*;
> > > > > import org.w3c.dom.*;
> > > > > import org.xml.sax.*;
> > > > > import org.apache.soap.util.xml.*;
> > > > > import org.apache.soap.util.mime.*;
> > > > > import org.apache.soap.*;
> > > > > import org.apache.soap.transport.*;
> > > > > import org.apache.soap.encoding.*;
> > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > import org.apache.soap.rpc.*;
> > > > > import org.apache.soap.messaging.*;
> > > > > import javax.activation.*;
> > > > > import javax.mail.internet.*;
> > > > > import javax.xml.parsers.*;
> > > > >
> > > > > public class TestAttachments {
> > > > >  public static void main(String[] args) {
> > > > >   try {
> > > > >       URL url = new URL(args[0]);
> > > > >
> > > > >    // Build the call.
> > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > >    Call call = new Call();
> > > > >    call.setSOAPMappingRegistry(smr);
> > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > >    call.setMethodName("myMethodName");
> > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > >
> > > > >    byte[] sourceBytes = new byte[0];
> > > > >
> > > > >    Vector params = new Vector();
> > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > "application/octet-stream");
> > > > >    DataHandler dh = new DataHandler(ds);
> > > > >    params.addElement(new Parameter("source",
> > > > >     javax.activation.DataHandler.class, dh, null));
> > > > >
> > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > "application/octet-stream");
> > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > >    params.addElement(new Parameter("thumb",
> > > > >      javax.activation.DataHandler.class,
> > > > >     dh2, null));
> > > > >
> > > > >    call.setParams(params);
> > > > >
> > > > >    // Invoke the call.
> > > > >    Response resp;
> > > > >
> > > > >    try {
> > > > >     resp = call.invoke(url, "");
> > > > >     //System.out.println("Response is: " + resp);
> > > > >    } catch (SOAPException e) {
> > > > >     System.err.println("Caught SOAPException");
> > > > >     e.printStackTrace();
> > > > >    }
> > > > >   } catch (Exception e) {
> > > > >    e.printStackTrace();
> > > > >   }
> > > > >  }
> > > > > }
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
The newest nightly is right here:
http://cvs.apache.org/dist/soap/nightly/2003-01-07/

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Tuesday, January 07, 2003 9:35 AM
Subject: Re: Soap With attachments example


> Hey Scott,
> I could not find a nightly build dated yesterday or today. Could you
please
> check it out. If not, where can find the insturctions on how to
compile the
> src, so that I can compile it and use it. Can I just replace the old
> MimePartSerializer class file with the new one or do I have to replece
the
> whole jar.
>
> Thanks
>
> Praveen
>
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Monday, January 06, 2003 1:00 PM
> Subject: Re: Soap With attachments example
>
>
> > This is a "quirk" of the MimePartSerializer.  It is used to
serialize
> > InputStream, DataSource, MimeBodyPart and DataHandler.  When a null
> > value is passed in for serialization, the serializer (for some
reason)
> > chooses to serialize it as an Object.  That's why you get the
mismatch.
> >
> > I'm going to change the code to use the type specified to the
serializer
> > when serializing a null.  You can either grab the source
> >
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> >
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> > ext/plain), compile it and use it, or wait until tomorrow and get a
> > nightly build (http://cvs.apache.org/dist/soap/nightly/).
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Monday, January 06, 2003 11:28 AM
> > Subject: Re: Soap With attachments example
> >
> >
> > Hi Scott,
> >
> > Eveyrthing seems to work fine now, except one minor problem. When
there
> > is nothing to send as argument I am passing in null and thats
throwing
> > exception. Please look at the bold lines of my code below. I am
passing
> > in the type of the argument as javax.activation.DataHandler.class,
but
> > it still takes it as Object. See the exception after the code. Look
at
> > the 6th argument of the method. It is assuming the object type as
> > "Object" not "javax.activation.DataHandler"
> >
> > Vector params = new Vector();
> >         params.addElement(new Parameter("sessionID", long.class,
> >                 new Long(sessionID), null));
> >         params.addElement(new Parameter("containerID",
> > containerID.getClass(),
> >                 new String(containerID), null));
> >         params.addElement(new Parameter("xmlString",
> > xmlString.getClass(),
> >                 new String(xmlString), null));
> >
> >         DataSource ds = new ByteArrayDataSource(sourceBytes,
> > "application/octet-stream");
> >         DataHandler dh = new DataHandler(ds);
> >         params.addElement(new Parameter("source",
> >                 javax.activation.DataHandler.class, dh, null));
> >
> >         //            params.addElement(new
Parameter("encodedSource",
> > encodedSource.getClass(), new String(encodedSource), null));
> >         params.addElement(new Parameter("sourceFileName",
> >                 sourceFileName.getClass(), new
String(sourceFileName),
> > null));
> >
> >         if (thumbBytes != null && thumbFileName!=null) {
> >             ds = new ByteArrayDataSource(thumbBytes,
> > "application/octet-stream");
> >             dh = new DataHandler(ds);
> >             params.addElement(new Parameter("thumb",
> >                     javax.activation.DataHandler.class, dh, null));
> >             params.addElement(new Parameter("thumbFileName",
> >                     thumbFileName.getClass(), new
String(thumbFileName),
> > null));
> >         } else {
> >             params.addElement(new Parameter("thumb",
> >                     javax.activation.DataHandler.class, null,
null));
> >             params.addElement(new Parameter("thumbFileName",
> >                     new String().getClass(), null, null));
> >         }
> >
> > Exception trace is as follows:
> >
> > Generated fault:
> >   Fault Code   = SOAP-ENV:Server
> >   Fault String = Exception while handling service request:
> > com.contextmedia.ip.s
> >
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> > ing,java
> >
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> > ect,java
> > .lang.String) -- no signature match
> > java.lang.Exception: Exception while handling service request:
> > com.contextmedia.
> >
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> > .String,
> >
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> > .Object,
> > java.lang.String) -- no signature match
> >         at
> >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > entObjectWithAttachments(ContentObjectUtils.java:742)
> >         at
> >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > er.actionPerformed(NewContentObjectDialog.java:275)
> >         at
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
> >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > istener.java:211)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at java.awt.Dialog.show(Dialog.java:375)
> >         at java.awt.Component.show(Component.java:941)
> >         at java.awt.Component.setVisible(Component.java:898)
> >         at
> >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > rmed(SimplexFrame.java:391)
> >         at
> >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> >         at
> >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > d(BasicMenuItemUI.java:882)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> >         at
java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> >
> >
> >
> > Praveen
> >
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, January 03, 2003 4:41 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > As a general recommendation, I encourage you to capture a stack
trace
> > > for your exceptions.  Just having the exception message makes it
> > harder
> > > to understand the cause of most exceptions.
> > >
> > > This particular exception means that a ByteArrayDataSource was
created
> > > with no data array, such as passing a null for the byte array.
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "Praveen Peddi" <pp...@contextmedia.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Friday, January 03, 2003 4:18 PM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > Yeah. It works now. Its my bad. Sorry about that.
> > > >
> > > > BUt I have another problem. When I execute that method, I get
the
> > > following
> > > > exception.
> > > >
> > > > Caught SOAPException (SOAP-ENV:Client): No data.
> > > >
> > > > What does this mean? I double checked that my soap method exists
in
> > > the
> > > > descriptor and the implementation also exists on the server
side.
> > But
> > > the
> > > > call doesn't reach the server at all.
> > > >
> > > > Praveen
> > > > ----- Original Message -----
> > > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Friday, January 03, 2003 2:28 PM
> > > > Subject: Re: Soap With attachments example
> > > >
> > > >
> > > > > This sample that I created from you code works for me, i.e. it
> > does
> > > not
> > > > > throw an NPE.
> > > > >
> > > > > Scott Nichol
> > > > >
> > > > > import java.io.*;
> > > > > import java.util.*;
> > > > > import java.net.*;
> > > > > import org.w3c.dom.*;
> > > > > import org.xml.sax.*;
> > > > > import org.apache.soap.util.xml.*;
> > > > > import org.apache.soap.util.mime.*;
> > > > > import org.apache.soap.*;
> > > > > import org.apache.soap.transport.*;
> > > > > import org.apache.soap.encoding.*;
> > > > > import org.apache.soap.encoding.soapenc.*;
> > > > > import org.apache.soap.rpc.*;
> > > > > import org.apache.soap.messaging.*;
> > > > > import javax.activation.*;
> > > > > import javax.mail.internet.*;
> > > > > import javax.xml.parsers.*;
> > > > >
> > > > > public class TestAttachments {
> > > > >  public static void main(String[] args) {
> > > > >   try {
> > > > >       URL url = new URL(args[0]);
> > > > >
> > > > >    // Build the call.
> > > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > > >    Call call = new Call();
> > > > >    call.setSOAPMappingRegistry(smr);
> > > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > > >    call.setMethodName("myMethodName");
> > > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > > >
> > > > >    byte[] sourceBytes = new byte[0];
> > > > >
> > > > >    Vector params = new Vector();
> > > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > > "application/octet-stream");
> > > > >    DataHandler dh = new DataHandler(ds);
> > > > >    params.addElement(new Parameter("source",
> > > > >     javax.activation.DataHandler.class, dh, null));
> > > > >
> > > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > > "application/octet-stream");
> > > > >    DataHandler dh2 = new DataHandler(ds);
> > > > >    params.addElement(new Parameter("thumb",
> > > > >      javax.activation.DataHandler.class,
> > > > >     dh2, null));
> > > > >
> > > > >    call.setParams(params);
> > > > >
> > > > >    // Invoke the call.
> > > > >    Response resp;
> > > > >
> > > > >    try {
> > > > >     resp = call.invoke(url, "");
> > > > >     //System.out.println("Response is: " + resp);
> > > > >    } catch (SOAPException e) {
> > > > >     System.err.println("Caught SOAPException");
> > > > >     e.printStackTrace();
> > > > >    }
> > > > >   } catch (Exception e) {
> > > > >    e.printStackTrace();
> > > > >   }
> > > > >  }
> > > > > }
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Hey Scott,
I could not find a nightly build dated yesterday or today. Could you please
check it out. If not, where can find the insturctions on how to compile the
src, so that I can compile it and use it. Can I just replace the old
MimePartSerializer class file with the new one or do I have to replece the
whole jar.

Thanks

Praveen


----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Monday, January 06, 2003 1:00 PM
Subject: Re: Soap With attachments example


> This is a "quirk" of the MimePartSerializer.  It is used to serialize
> InputStream, DataSource, MimeBodyPart and DataHandler.  When a null
> value is passed in for serialization, the serializer (for some reason)
> chooses to serialize it as an Object.  That's why you get the mismatch.
>
> I'm going to change the code to use the type specified to the serializer
> when serializing a null.  You can either grab the source
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> ext/plain), compile it and use it, or wait until tomorrow and get a
> nightly build (http://cvs.apache.org/dist/soap/nightly/).
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Monday, January 06, 2003 11:28 AM
> Subject: Re: Soap With attachments example
>
>
> Hi Scott,
>
> Eveyrthing seems to work fine now, except one minor problem. When there
> is nothing to send as argument I am passing in null and thats throwing
> exception. Please look at the bold lines of my code below. I am passing
> in the type of the argument as javax.activation.DataHandler.class, but
> it still takes it as Object. See the exception after the code. Look at
> the 6th argument of the method. It is assuming the object type as
> "Object" not "javax.activation.DataHandler"
>
> Vector params = new Vector();
>         params.addElement(new Parameter("sessionID", long.class,
>                 new Long(sessionID), null));
>         params.addElement(new Parameter("containerID",
> containerID.getClass(),
>                 new String(containerID), null));
>         params.addElement(new Parameter("xmlString",
> xmlString.getClass(),
>                 new String(xmlString), null));
>
>         DataSource ds = new ByteArrayDataSource(sourceBytes,
> "application/octet-stream");
>         DataHandler dh = new DataHandler(ds);
>         params.addElement(new Parameter("source",
>                 javax.activation.DataHandler.class, dh, null));
>
>         //            params.addElement(new Parameter("encodedSource",
> encodedSource.getClass(), new String(encodedSource), null));
>         params.addElement(new Parameter("sourceFileName",
>                 sourceFileName.getClass(), new String(sourceFileName),
> null));
>
>         if (thumbBytes != null && thumbFileName!=null) {
>             ds = new ByteArrayDataSource(thumbBytes,
> "application/octet-stream");
>             dh = new DataHandler(ds);
>             params.addElement(new Parameter("thumb",
>                     javax.activation.DataHandler.class, dh, null));
>             params.addElement(new Parameter("thumbFileName",
>                     thumbFileName.getClass(), new String(thumbFileName),
> null));
>         } else {
>             params.addElement(new Parameter("thumb",
>                     javax.activation.DataHandler.class, null, null));
>             params.addElement(new Parameter("thumbFileName",
>                     new String().getClass(), null, null));
>         }
>
> Exception trace is as follows:
>
> Generated fault:
>   Fault Code   = SOAP-ENV:Server
>   Fault String = Exception while handling service request:
> com.contextmedia.ip.s
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> ing,java
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> ect,java
> .lang.String) -- no signature match
> java.lang.Exception: Exception while handling service request:
> com.contextmedia.
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> .String,
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> .Object,
> java.lang.String) -- no signature match
>         at
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> entObjectWithAttachments(ContentObjectUtils.java:742)
>         at
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> er.actionPerformed(NewContentObjectDialog.java:275)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> istener.java:211)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at java.awt.Dialog.show(Dialog.java:375)
>         at java.awt.Component.show(Component.java:941)
>         at java.awt.Component.setVisible(Component.java:898)
>         at
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> rmed(SimplexFrame.java:391)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> d(BasicMenuItemUI.java:882)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
>
>
>
> Praveen
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 4:41 PM
> Subject: Re: Soap With attachments example
>
>
> > As a general recommendation, I encourage you to capture a stack trace
> > for your exceptions.  Just having the exception message makes it
> harder
> > to understand the cause of most exceptions.
> >
> > This particular exception means that a ByteArrayDataSource was created
> > with no data array, such as passing a null for the byte array.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, January 03, 2003 4:18 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > Yeah. It works now. Its my bad. Sorry about that.
> > >
> > > BUt I have another problem. When I execute that method, I get the
> > following
> > > exception.
> > >
> > > Caught SOAPException (SOAP-ENV:Client): No data.
> > >
> > > What does this mean? I double checked that my soap method exists in
> > the
> > > descriptor and the implementation also exists on the server side.
> But
> > the
> > > call doesn't reach the server at all.
> > >
> > > Praveen
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Friday, January 03, 2003 2:28 PM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > This sample that I created from you code works for me, i.e. it
> does
> > not
> > > > throw an NPE.
> > > >
> > > > Scott Nichol
> > > >
> > > > import java.io.*;
> > > > import java.util.*;
> > > > import java.net.*;
> > > > import org.w3c.dom.*;
> > > > import org.xml.sax.*;
> > > > import org.apache.soap.util.xml.*;
> > > > import org.apache.soap.util.mime.*;
> > > > import org.apache.soap.*;
> > > > import org.apache.soap.transport.*;
> > > > import org.apache.soap.encoding.*;
> > > > import org.apache.soap.encoding.soapenc.*;
> > > > import org.apache.soap.rpc.*;
> > > > import org.apache.soap.messaging.*;
> > > > import javax.activation.*;
> > > > import javax.mail.internet.*;
> > > > import javax.xml.parsers.*;
> > > >
> > > > public class TestAttachments {
> > > >  public static void main(String[] args) {
> > > >   try {
> > > >       URL url = new URL(args[0]);
> > > >
> > > >    // Build the call.
> > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > >    Call call = new Call();
> > > >    call.setSOAPMappingRegistry(smr);
> > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > >    call.setMethodName("myMethodName");
> > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > >
> > > >    byte[] sourceBytes = new byte[0];
> > > >
> > > >    Vector params = new Vector();
> > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > "application/octet-stream");
> > > >    DataHandler dh = new DataHandler(ds);
> > > >    params.addElement(new Parameter("source",
> > > >     javax.activation.DataHandler.class, dh, null));
> > > >
> > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > "application/octet-stream");
> > > >    DataHandler dh2 = new DataHandler(ds);
> > > >    params.addElement(new Parameter("thumb",
> > > >      javax.activation.DataHandler.class,
> > > >     dh2, null));
> > > >
> > > >    call.setParams(params);
> > > >
> > > >    // Invoke the call.
> > > >    Response resp;
> > > >
> > > >    try {
> > > >     resp = call.invoke(url, "");
> > > >     //System.out.println("Response is: " + resp);
> > > >    } catch (SOAPException e) {
> > > >     System.err.println("Caught SOAPException");
> > > >     e.printStackTrace();
> > > >    }
> > > >   } catch (Exception e) {
> > > >    e.printStackTrace();
> > > >   }
> > > >  }
> > > > }
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Hey Scott,
I could not find a nightly build dated yesterday or today. Could you please
check it out. If not, where can find the insturctions on how to compile the
src, so that I can compile it and use it. Can I just replace the old
MimePartSerializer class file with the new one or do I have to replece the
whole jar.

Thanks

Praveen


----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Monday, January 06, 2003 1:00 PM
Subject: Re: Soap With attachments example


> This is a "quirk" of the MimePartSerializer.  It is used to serialize
> InputStream, DataSource, MimeBodyPart and DataHandler.  When a null
> value is passed in for serialization, the serializer (for some reason)
> chooses to serialize it as an Object.  That's why you get the mismatch.
>
> I'm going to change the code to use the type specified to the serializer
> when serializing a null.  You can either grab the source
> (http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
> he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
> ext/plain), compile it and use it, or wait until tomorrow and get a
> nightly build (http://cvs.apache.org/dist/soap/nightly/).
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Monday, January 06, 2003 11:28 AM
> Subject: Re: Soap With attachments example
>
>
> Hi Scott,
>
> Eveyrthing seems to work fine now, except one minor problem. When there
> is nothing to send as argument I am passing in null and thats throwing
> exception. Please look at the bold lines of my code below. I am passing
> in the type of the argument as javax.activation.DataHandler.class, but
> it still takes it as Object. See the exception after the code. Look at
> the 6th argument of the method. It is assuming the object type as
> "Object" not "javax.activation.DataHandler"
>
> Vector params = new Vector();
>         params.addElement(new Parameter("sessionID", long.class,
>                 new Long(sessionID), null));
>         params.addElement(new Parameter("containerID",
> containerID.getClass(),
>                 new String(containerID), null));
>         params.addElement(new Parameter("xmlString",
> xmlString.getClass(),
>                 new String(xmlString), null));
>
>         DataSource ds = new ByteArrayDataSource(sourceBytes,
> "application/octet-stream");
>         DataHandler dh = new DataHandler(ds);
>         params.addElement(new Parameter("source",
>                 javax.activation.DataHandler.class, dh, null));
>
>         //            params.addElement(new Parameter("encodedSource",
> encodedSource.getClass(), new String(encodedSource), null));
>         params.addElement(new Parameter("sourceFileName",
>                 sourceFileName.getClass(), new String(sourceFileName),
> null));
>
>         if (thumbBytes != null && thumbFileName!=null) {
>             ds = new ByteArrayDataSource(thumbBytes,
> "application/octet-stream");
>             dh = new DataHandler(ds);
>             params.addElement(new Parameter("thumb",
>                     javax.activation.DataHandler.class, dh, null));
>             params.addElement(new Parameter("thumbFileName",
>                     thumbFileName.getClass(), new String(thumbFileName),
> null));
>         } else {
>             params.addElement(new Parameter("thumb",
>                     javax.activation.DataHandler.class, null, null));
>             params.addElement(new Parameter("thumbFileName",
>                     new String().getClass(), null, null));
>         }
>
> Exception trace is as follows:
>
> Generated fault:
>   Fault Code   = SOAP-ENV:Server
>   Fault String = Exception while handling service request:
> com.contextmedia.ip.s
> ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
> ing,java
> .lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
> ect,java
> .lang.String) -- no signature match
> java.lang.Exception: Exception while handling service request:
> com.contextmedia.
> ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
> .String,
> java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
> .Object,
> java.lang.String) -- no signature match
>         at
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> entObjectWithAttachments(ContentObjectUtils.java:742)
>         at
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> er.actionPerformed(NewContentObjectDialog.java:275)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> istener.java:211)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at java.awt.Dialog.show(Dialog.java:375)
>         at java.awt.Component.show(Component.java:941)
>         at java.awt.Component.setVisible(Component.java:898)
>         at
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> rmed(SimplexFrame.java:391)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> d(BasicMenuItemUI.java:882)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
>
>
>
> Praveen
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 4:41 PM
> Subject: Re: Soap With attachments example
>
>
> > As a general recommendation, I encourage you to capture a stack trace
> > for your exceptions.  Just having the exception message makes it
> harder
> > to understand the cause of most exceptions.
> >
> > This particular exception means that a ByteArrayDataSource was created
> > with no data array, such as passing a null for the byte array.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, January 03, 2003 4:18 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > Yeah. It works now. Its my bad. Sorry about that.
> > >
> > > BUt I have another problem. When I execute that method, I get the
> > following
> > > exception.
> > >
> > > Caught SOAPException (SOAP-ENV:Client): No data.
> > >
> > > What does this mean? I double checked that my soap method exists in
> > the
> > > descriptor and the implementation also exists on the server side.
> But
> > the
> > > call doesn't reach the server at all.
> > >
> > > Praveen
> > > ----- Original Message -----
> > > From: "Scott Nichol" <sn...@scottnichol.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Friday, January 03, 2003 2:28 PM
> > > Subject: Re: Soap With attachments example
> > >
> > >
> > > > This sample that I created from you code works for me, i.e. it
> does
> > not
> > > > throw an NPE.
> > > >
> > > > Scott Nichol
> > > >
> > > > import java.io.*;
> > > > import java.util.*;
> > > > import java.net.*;
> > > > import org.w3c.dom.*;
> > > > import org.xml.sax.*;
> > > > import org.apache.soap.util.xml.*;
> > > > import org.apache.soap.util.mime.*;
> > > > import org.apache.soap.*;
> > > > import org.apache.soap.transport.*;
> > > > import org.apache.soap.encoding.*;
> > > > import org.apache.soap.encoding.soapenc.*;
> > > > import org.apache.soap.rpc.*;
> > > > import org.apache.soap.messaging.*;
> > > > import javax.activation.*;
> > > > import javax.mail.internet.*;
> > > > import javax.xml.parsers.*;
> > > >
> > > > public class TestAttachments {
> > > >  public static void main(String[] args) {
> > > >   try {
> > > >       URL url = new URL(args[0]);
> > > >
> > > >    // Build the call.
> > > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > >    Call call = new Call();
> > > >    call.setSOAPMappingRegistry(smr);
> > > >    call.setTargetObjectURI("urn:MyServiceName");
> > > >    call.setMethodName("myMethodName");
> > > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > >
> > > >    byte[] sourceBytes = new byte[0];
> > > >
> > > >    Vector params = new Vector();
> > > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > > "application/octet-stream");
> > > >    DataHandler dh = new DataHandler(ds);
> > > >    params.addElement(new Parameter("source",
> > > >     javax.activation.DataHandler.class, dh, null));
> > > >
> > > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > > "application/octet-stream");
> > > >    DataHandler dh2 = new DataHandler(ds);
> > > >    params.addElement(new Parameter("thumb",
> > > >      javax.activation.DataHandler.class,
> > > >     dh2, null));
> > > >
> > > >    call.setParams(params);
> > > >
> > > >    // Invoke the call.
> > > >    Response resp;
> > > >
> > > >    try {
> > > >     resp = call.invoke(url, "");
> > > >     //System.out.println("Response is: " + resp);
> > > >    } catch (SOAPException e) {
> > > >     System.err.println("Caught SOAPException");
> > > >     e.printStackTrace();
> > > >    }
> > > >   } catch (Exception e) {
> > > >    e.printStackTrace();
> > > >   }
> > > >  }
> > > > }
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
This is a "quirk" of the MimePartSerializer.  It is used to serialize
InputStream, DataSource, MimeBodyPart and DataHandler.  When a null
value is passed in for serialization, the serializer (for some reason)
chooses to serialize it as an Object.  That's why you get the mismatch.

I'm going to change the code to use the type specified to the serializer
when serializing a null.  You can either grab the source
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
ext/plain), compile it and use it, or wait until tomorrow and get a
nightly build (http://cvs.apache.org/dist/soap/nightly/).

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Monday, January 06, 2003 11:28 AM
Subject: Re: Soap With attachments example


Hi Scott,

Eveyrthing seems to work fine now, except one minor problem. When there
is nothing to send as argument I am passing in null and thats throwing
exception. Please look at the bold lines of my code below. I am passing
in the type of the argument as javax.activation.DataHandler.class, but
it still takes it as Object. See the exception after the code. Look at
the 6th argument of the method. It is assuming the object type as
"Object" not "javax.activation.DataHandler"

Vector params = new Vector();
        params.addElement(new Parameter("sessionID", long.class,
                new Long(sessionID), null));
        params.addElement(new Parameter("containerID",
containerID.getClass(),
                new String(containerID), null));
        params.addElement(new Parameter("xmlString",
xmlString.getClass(),
                new String(xmlString), null));

        DataSource ds = new ByteArrayDataSource(sourceBytes,
"application/octet-stream");
        DataHandler dh = new DataHandler(ds);
        params.addElement(new Parameter("source",
                javax.activation.DataHandler.class, dh, null));

        //            params.addElement(new Parameter("encodedSource",
encodedSource.getClass(), new String(encodedSource), null));
        params.addElement(new Parameter("sourceFileName",
                sourceFileName.getClass(), new String(sourceFileName),
null));

        if (thumbBytes != null && thumbFileName!=null) {
            ds = new ByteArrayDataSource(thumbBytes,
"application/octet-stream");
            dh = new DataHandler(ds);
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, dh, null));
            params.addElement(new Parameter("thumbFileName",
                    thumbFileName.getClass(), new String(thumbFileName),
null));
        } else {
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, null, null));
            params.addElement(new Parameter("thumbFileName",
                    new String().getClass(), null, null));
        }

Exception trace is as follows:

Generated fault:
  Fault Code   = SOAP-ENV:Server
  Fault String = Exception while handling service request:
com.contextmedia.ip.s
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
ing,java
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
ect,java
.lang.String) -- no signature match
java.lang.Exception: Exception while handling service request:
com.contextmedia.
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
.String,
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
.Object,
java.lang.String) -- no signature match
        at
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
entObjectWithAttachments(ContentObjectUtils.java:742)
        at
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
er.actionPerformed(NewContentObjectDialog.java:275)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:211)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.Dialog.show(Dialog.java:375)
        at java.awt.Component.show(Component.java:941)
        at java.awt.Component.setVisible(Component.java:898)
        at
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
rmed(SimplexFrame.java:391)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
        at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
d(BasicMenuItemUI.java:882)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)



Praveen

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 4:41 PM
Subject: Re: Soap With attachments example


> As a general recommendation, I encourage you to capture a stack trace
> for your exceptions.  Just having the exception message makes it
harder
> to understand the cause of most exceptions.
>
> This particular exception means that a ByteArrayDataSource was created
> with no data array, such as passing a null for the byte array.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 4:18 PM
> Subject: Re: Soap With attachments example
>
>
> > Yeah. It works now. Its my bad. Sorry about that.
> >
> > BUt I have another problem. When I execute that method, I get the
> following
> > exception.
> >
> > Caught SOAPException (SOAP-ENV:Client): No data.
> >
> > What does this mean? I double checked that my soap method exists in
> the
> > descriptor and the implementation also exists on the server side.
But
> the
> > call doesn't reach the server at all.
> >
> > Praveen
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, January 03, 2003 2:28 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > This sample that I created from you code works for me, i.e. it
does
> not
> > > throw an NPE.
> > >
> > > Scott Nichol
> > >
> > > import java.io.*;
> > > import java.util.*;
> > > import java.net.*;
> > > import org.w3c.dom.*;
> > > import org.xml.sax.*;
> > > import org.apache.soap.util.xml.*;
> > > import org.apache.soap.util.mime.*;
> > > import org.apache.soap.*;
> > > import org.apache.soap.transport.*;
> > > import org.apache.soap.encoding.*;
> > > import org.apache.soap.encoding.soapenc.*;
> > > import org.apache.soap.rpc.*;
> > > import org.apache.soap.messaging.*;
> > > import javax.activation.*;
> > > import javax.mail.internet.*;
> > > import javax.xml.parsers.*;
> > >
> > > public class TestAttachments {
> > >  public static void main(String[] args) {
> > >   try {
> > >       URL url = new URL(args[0]);
> > >
> > >    // Build the call.
> > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > >    Call call = new Call();
> > >    call.setSOAPMappingRegistry(smr);
> > >    call.setTargetObjectURI("urn:MyServiceName");
> > >    call.setMethodName("myMethodName");
> > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > >
> > >    byte[] sourceBytes = new byte[0];
> > >
> > >    Vector params = new Vector();
> > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >    DataHandler dh = new DataHandler(ds);
> > >    params.addElement(new Parameter("source",
> > >     javax.activation.DataHandler.class, dh, null));
> > >
> > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >    DataHandler dh2 = new DataHandler(ds);
> > >    params.addElement(new Parameter("thumb",
> > >      javax.activation.DataHandler.class,
> > >     dh2, null));
> > >
> > >    call.setParams(params);
> > >
> > >    // Invoke the call.
> > >    Response resp;
> > >
> > >    try {
> > >     resp = call.invoke(url, "");
> > >     //System.out.println("Response is: " + resp);
> > >    } catch (SOAPException e) {
> > >     System.err.println("Caught SOAPException");
> > >     e.printStackTrace();
> > >    }
> > >   } catch (Exception e) {
> > >    e.printStackTrace();
> > >   }
> > >  }
> > > }
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
This is a "quirk" of the MimePartSerializer.  It is used to serialize
InputStream, DataSource, MimeBodyPart and DataHandler.  When a null
value is passed in for serialization, the serializer (for some reason)
chooses to serialize it as an Object.  That's why you get the mismatch.

I'm going to change the code to use the type specified to the serializer
when serializing a null.  You can either grab the source
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/src/org/apac
he/soap/encoding/soapenc/MimePartSerializer.java?rev=HEAD&content-type=t
ext/plain), compile it and use it, or wait until tomorrow and get a
nightly build (http://cvs.apache.org/dist/soap/nightly/).

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Monday, January 06, 2003 11:28 AM
Subject: Re: Soap With attachments example


Hi Scott,

Eveyrthing seems to work fine now, except one minor problem. When there
is nothing to send as argument I am passing in null and thats throwing
exception. Please look at the bold lines of my code below. I am passing
in the type of the argument as javax.activation.DataHandler.class, but
it still takes it as Object. See the exception after the code. Look at
the 6th argument of the method. It is assuming the object type as
"Object" not "javax.activation.DataHandler"

Vector params = new Vector();
        params.addElement(new Parameter("sessionID", long.class,
                new Long(sessionID), null));
        params.addElement(new Parameter("containerID",
containerID.getClass(),
                new String(containerID), null));
        params.addElement(new Parameter("xmlString",
xmlString.getClass(),
                new String(xmlString), null));

        DataSource ds = new ByteArrayDataSource(sourceBytes,
"application/octet-stream");
        DataHandler dh = new DataHandler(ds);
        params.addElement(new Parameter("source",
                javax.activation.DataHandler.class, dh, null));

        //            params.addElement(new Parameter("encodedSource",
encodedSource.getClass(), new String(encodedSource), null));
        params.addElement(new Parameter("sourceFileName",
                sourceFileName.getClass(), new String(sourceFileName),
null));

        if (thumbBytes != null && thumbFileName!=null) {
            ds = new ByteArrayDataSource(thumbBytes,
"application/octet-stream");
            dh = new DataHandler(ds);
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, dh, null));
            params.addElement(new Parameter("thumbFileName",
                    thumbFileName.getClass(), new String(thumbFileName),
null));
        } else {
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, null, null));
            params.addElement(new Parameter("thumbFileName",
                    new String().getClass(), null, null));
        }

Exception trace is as follows:

Generated fault:
  Fault Code   = SOAP-ENV:Server
  Fault String = Exception while handling service request:
com.contextmedia.ip.s
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.Str
ing,java
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Obj
ect,java
.lang.String) -- no signature match
java.lang.Exception: Exception while handling service request:
com.contextmedia.
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang
.String,
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang
.Object,
java.lang.String) -- no signature match
        at
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
entObjectWithAttachments(ContentObjectUtils.java:742)
        at
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
er.actionPerformed(NewContentObjectDialog.java:275)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:211)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.Dialog.show(Dialog.java:375)
        at java.awt.Component.show(Component.java:941)
        at java.awt.Component.setVisible(Component.java:898)
        at
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
rmed(SimplexFrame.java:391)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
        at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
d(BasicMenuItemUI.java:882)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)



Praveen

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 4:41 PM
Subject: Re: Soap With attachments example


> As a general recommendation, I encourage you to capture a stack trace
> for your exceptions.  Just having the exception message makes it
harder
> to understand the cause of most exceptions.
>
> This particular exception means that a ByteArrayDataSource was created
> with no data array, such as passing a null for the byte array.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 4:18 PM
> Subject: Re: Soap With attachments example
>
>
> > Yeah. It works now. Its my bad. Sorry about that.
> >
> > BUt I have another problem. When I execute that method, I get the
> following
> > exception.
> >
> > Caught SOAPException (SOAP-ENV:Client): No data.
> >
> > What does this mean? I double checked that my soap method exists in
> the
> > descriptor and the implementation also exists on the server side.
But
> the
> > call doesn't reach the server at all.
> >
> > Praveen
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, January 03, 2003 2:28 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > This sample that I created from you code works for me, i.e. it
does
> not
> > > throw an NPE.
> > >
> > > Scott Nichol
> > >
> > > import java.io.*;
> > > import java.util.*;
> > > import java.net.*;
> > > import org.w3c.dom.*;
> > > import org.xml.sax.*;
> > > import org.apache.soap.util.xml.*;
> > > import org.apache.soap.util.mime.*;
> > > import org.apache.soap.*;
> > > import org.apache.soap.transport.*;
> > > import org.apache.soap.encoding.*;
> > > import org.apache.soap.encoding.soapenc.*;
> > > import org.apache.soap.rpc.*;
> > > import org.apache.soap.messaging.*;
> > > import javax.activation.*;
> > > import javax.mail.internet.*;
> > > import javax.xml.parsers.*;
> > >
> > > public class TestAttachments {
> > >  public static void main(String[] args) {
> > >   try {
> > >       URL url = new URL(args[0]);
> > >
> > >    // Build the call.
> > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > >    Call call = new Call();
> > >    call.setSOAPMappingRegistry(smr);
> > >    call.setTargetObjectURI("urn:MyServiceName");
> > >    call.setMethodName("myMethodName");
> > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > >
> > >    byte[] sourceBytes = new byte[0];
> > >
> > >    Vector params = new Vector();
> > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >    DataHandler dh = new DataHandler(ds);
> > >    params.addElement(new Parameter("source",
> > >     javax.activation.DataHandler.class, dh, null));
> > >
> > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >    DataHandler dh2 = new DataHandler(ds);
> > >    params.addElement(new Parameter("thumb",
> > >      javax.activation.DataHandler.class,
> > >     dh2, null));
> > >
> > >    call.setParams(params);
> > >
> > >    // Invoke the call.
> > >    Response resp;
> > >
> > >    try {
> > >     resp = call.invoke(url, "");
> > >     //System.out.println("Response is: " + resp);
> > >    } catch (SOAPException e) {
> > >     System.err.println("Caught SOAPException");
> > >     e.printStackTrace();
> > >    }
> > >   } catch (Exception e) {
> > >    e.printStackTrace();
> > >   }
> > >  }
> > > }
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Hi Scott,

Eveyrthing seems to work fine now, except one minor problem. When there is nothing to send as argument I am passing in null and thats throwing exception. Please look at the bold lines of my code below. I am passing in the type of the argument as javax.activation.DataHandler.class, but it still takes it as Object. See the exception after the code. Look at the 6th argument of the method. It is assuming the object type as "Object" not "javax.activation.DataHandler"

Vector params = new Vector();
        params.addElement(new Parameter("sessionID", long.class,
                new Long(sessionID), null));
        params.addElement(new Parameter("containerID", containerID.getClass(),
                new String(containerID), null));
        params.addElement(new Parameter("xmlString", xmlString.getClass(),
                new String(xmlString), null));

        DataSource ds = new ByteArrayDataSource(sourceBytes, "application/octet-stream");
        DataHandler dh = new DataHandler(ds);
        params.addElement(new Parameter("source",
                javax.activation.DataHandler.class, dh, null));

        //            params.addElement(new Parameter("encodedSource", encodedSource.getClass(), new String(encodedSource), null));
        params.addElement(new Parameter("sourceFileName",
                sourceFileName.getClass(), new String(sourceFileName), null));

        if (thumbBytes != null && thumbFileName!=null) {
            ds = new ByteArrayDataSource(thumbBytes, "application/octet-stream");
            dh = new DataHandler(ds);
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, dh, null));
            params.addElement(new Parameter("thumbFileName",
                    thumbFileName.getClass(), new String(thumbFileName), null));
        } else {
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, null, null));
            params.addElement(new Parameter("thumbFileName",
                    new String().getClass(), null, null));
        }

Exception trace is as follows:

Generated fault:
  Fault Code   = SOAP-ENV:Server
  Fault String = Exception while handling service request: com.contextmedia.ip.s
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.String,java
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Object,java
.lang.String) -- no signature match
java.lang.Exception: Exception while handling service request: com.contextmedia.
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang.String,
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Object,
java.lang.String) -- no signature match
        at com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
entObjectWithAttachments(ContentObjectUtils.java:742)
        at com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
er.actionPerformed(NewContentObjectDialog.java:275)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:211)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.Dialog.show(Dialog.java:375)
        at java.awt.Component.show(Component.java:941)
        at java.awt.Component.setVisible(Component.java:898)
        at com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
rmed(SimplexFrame.java:391)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
        at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
d(BasicMenuItemUI.java:882)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)



Praveen

----- Original Message ----- 
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 4:41 PM
Subject: Re: Soap With attachments example


> As a general recommendation, I encourage you to capture a stack trace
> for your exceptions.  Just having the exception message makes it harder
> to understand the cause of most exceptions.
> 
> This particular exception means that a ByteArrayDataSource was created
> with no data array, such as passing a null for the byte array.
> 
> Scott Nichol
> 
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 4:18 PM
> Subject: Re: Soap With attachments example
> 
> 
> > Yeah. It works now. Its my bad. Sorry about that.
> >
> > BUt I have another problem. When I execute that method, I get the
> following
> > exception.
> >
> > Caught SOAPException (SOAP-ENV:Client): No data.
> >
> > What does this mean? I double checked that my soap method exists in
> the
> > descriptor and the implementation also exists on the server side. But
> the
> > call doesn't reach the server at all.
> >
> > Praveen
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, January 03, 2003 2:28 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > This sample that I created from you code works for me, i.e. it does
> not
> > > throw an NPE.
> > >
> > > Scott Nichol
> > >
> > > import java.io.*;
> > > import java.util.*;
> > > import java.net.*;
> > > import org.w3c.dom.*;
> > > import org.xml.sax.*;
> > > import org.apache.soap.util.xml.*;
> > > import org.apache.soap.util.mime.*;
> > > import org.apache.soap.*;
> > > import org.apache.soap.transport.*;
> > > import org.apache.soap.encoding.*;
> > > import org.apache.soap.encoding.soapenc.*;
> > > import org.apache.soap.rpc.*;
> > > import org.apache.soap.messaging.*;
> > > import javax.activation.*;
> > > import javax.mail.internet.*;
> > > import javax.xml.parsers.*;
> > >
> > > public class TestAttachments {
> > >  public static void main(String[] args) {
> > >   try {
> > >       URL url = new URL(args[0]);
> > >
> > >    // Build the call.
> > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > >    Call call = new Call();
> > >    call.setSOAPMappingRegistry(smr);
> > >    call.setTargetObjectURI("urn:MyServiceName");
> > >    call.setMethodName("myMethodName");
> > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > >
> > >    byte[] sourceBytes = new byte[0];
> > >
> > >    Vector params = new Vector();
> > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >    DataHandler dh = new DataHandler(ds);
> > >    params.addElement(new Parameter("source",
> > >     javax.activation.DataHandler.class, dh, null));
> > >
> > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >    DataHandler dh2 = new DataHandler(ds);
> > >    params.addElement(new Parameter("thumb",
> > >      javax.activation.DataHandler.class,
> > >     dh2, null));
> > >
> > >    call.setParams(params);
> > >
> > >    // Invoke the call.
> > >    Response resp;
> > >
> > >    try {
> > >     resp = call.invoke(url, "");
> > >     //System.out.println("Response is: " + resp);
> > >    } catch (SOAPException e) {
> > >     System.err.println("Caught SOAPException");
> > >     e.printStackTrace();
> > >    }
> > >   } catch (Exception e) {
> > >    e.printStackTrace();
> > >   }
> > >  }
> > > }
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
> 
> 

Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Hi Scott,

Eveyrthing seems to work fine now, except one minor problem. When there is nothing to send as argument I am passing in null and thats throwing exception. Please look at the bold lines of my code below. I am passing in the type of the argument as javax.activation.DataHandler.class, but it still takes it as Object. See the exception after the code. Look at the 6th argument of the method. It is assuming the object type as "Object" not "javax.activation.DataHandler"

Vector params = new Vector();
        params.addElement(new Parameter("sessionID", long.class,
                new Long(sessionID), null));
        params.addElement(new Parameter("containerID", containerID.getClass(),
                new String(containerID), null));
        params.addElement(new Parameter("xmlString", xmlString.getClass(),
                new String(xmlString), null));

        DataSource ds = new ByteArrayDataSource(sourceBytes, "application/octet-stream");
        DataHandler dh = new DataHandler(ds);
        params.addElement(new Parameter("source",
                javax.activation.DataHandler.class, dh, null));

        //            params.addElement(new Parameter("encodedSource", encodedSource.getClass(), new String(encodedSource), null));
        params.addElement(new Parameter("sourceFileName",
                sourceFileName.getClass(), new String(sourceFileName), null));

        if (thumbBytes != null && thumbFileName!=null) {
            ds = new ByteArrayDataSource(thumbBytes, "application/octet-stream");
            dh = new DataHandler(ds);
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, dh, null));
            params.addElement(new Parameter("thumbFileName",
                    thumbFileName.getClass(), new String(thumbFileName), null));
        } else {
            params.addElement(new Parameter("thumb",
                    javax.activation.DataHandler.class, null, null));
            params.addElement(new Parameter("thumbFileName",
                    new String().getClass(), null, null));
        }

Exception trace is as follows:

Generated fault:
  Fault Code   = SOAP-ENV:Server
  Fault String = Exception while handling service request: com.contextmedia.ip.s
ession.soap.CMISOAPContentService.uploadContentObject(long,java.lang.String,java
.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Object,java
.lang.String) -- no signature match
java.lang.Exception: Exception while handling service request: com.contextmedia.
ip.session.soap.CMISOAPContentService.uploadContentObject(long,java.lang.String,
java.lang.String,javax.activation.DataHandler,java.lang.String,java.lang.Object,
java.lang.String) -- no signature match
        at com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
entObjectWithAttachments(ContentObjectUtils.java:742)
        at com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
er.actionPerformed(NewContentObjectDialog.java:275)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:211)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.Dialog.show(Dialog.java:375)
        at java.awt.Component.show(Component.java:941)
        at java.awt.Component.setVisible(Component.java:898)
        at com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
rmed(SimplexFrame.java:391)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
        at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
d(BasicMenuItemUI.java:882)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)



Praveen

----- Original Message ----- 
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 4:41 PM
Subject: Re: Soap With attachments example


> As a general recommendation, I encourage you to capture a stack trace
> for your exceptions.  Just having the exception message makes it harder
> to understand the cause of most exceptions.
> 
> This particular exception means that a ByteArrayDataSource was created
> with no data array, such as passing a null for the byte array.
> 
> Scott Nichol
> 
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 4:18 PM
> Subject: Re: Soap With attachments example
> 
> 
> > Yeah. It works now. Its my bad. Sorry about that.
> >
> > BUt I have another problem. When I execute that method, I get the
> following
> > exception.
> >
> > Caught SOAPException (SOAP-ENV:Client): No data.
> >
> > What does this mean? I double checked that my soap method exists in
> the
> > descriptor and the implementation also exists on the server side. But
> the
> > call doesn't reach the server at all.
> >
> > Praveen
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, January 03, 2003 2:28 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > This sample that I created from you code works for me, i.e. it does
> not
> > > throw an NPE.
> > >
> > > Scott Nichol
> > >
> > > import java.io.*;
> > > import java.util.*;
> > > import java.net.*;
> > > import org.w3c.dom.*;
> > > import org.xml.sax.*;
> > > import org.apache.soap.util.xml.*;
> > > import org.apache.soap.util.mime.*;
> > > import org.apache.soap.*;
> > > import org.apache.soap.transport.*;
> > > import org.apache.soap.encoding.*;
> > > import org.apache.soap.encoding.soapenc.*;
> > > import org.apache.soap.rpc.*;
> > > import org.apache.soap.messaging.*;
> > > import javax.activation.*;
> > > import javax.mail.internet.*;
> > > import javax.xml.parsers.*;
> > >
> > > public class TestAttachments {
> > >  public static void main(String[] args) {
> > >   try {
> > >       URL url = new URL(args[0]);
> > >
> > >    // Build the call.
> > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > >    Call call = new Call();
> > >    call.setSOAPMappingRegistry(smr);
> > >    call.setTargetObjectURI("urn:MyServiceName");
> > >    call.setMethodName("myMethodName");
> > >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > >
> > >    byte[] sourceBytes = new byte[0];
> > >
> > >    Vector params = new Vector();
> > >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >    DataHandler dh = new DataHandler(ds);
> > >    params.addElement(new Parameter("source",
> > >     javax.activation.DataHandler.class, dh, null));
> > >
> > >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > > "application/octet-stream");
> > >    DataHandler dh2 = new DataHandler(ds);
> > >    params.addElement(new Parameter("thumb",
> > >      javax.activation.DataHandler.class,
> > >     dh2, null));
> > >
> > >    call.setParams(params);
> > >
> > >    // Invoke the call.
> > >    Response resp;
> > >
> > >    try {
> > >     resp = call.invoke(url, "");
> > >     //System.out.println("Response is: " + resp);
> > >    } catch (SOAPException e) {
> > >     System.err.println("Caught SOAPException");
> > >     e.printStackTrace();
> > >    }
> > >   } catch (Exception e) {
> > >    e.printStackTrace();
> > >   }
> > >  }
> > > }
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> <ma...@xml.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
> 
> 

Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
As a general recommendation, I encourage you to capture a stack trace
for your exceptions.  Just having the exception message makes it harder
to understand the cause of most exceptions.

This particular exception means that a ByteArrayDataSource was created
with no data array, such as passing a null for the byte array.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 4:18 PM
Subject: Re: Soap With attachments example


> Yeah. It works now. Its my bad. Sorry about that.
>
> BUt I have another problem. When I execute that method, I get the
following
> exception.
>
> Caught SOAPException (SOAP-ENV:Client): No data.
>
> What does this mean? I double checked that my soap method exists in
the
> descriptor and the implementation also exists on the server side. But
the
> call doesn't reach the server at all.
>
> Praveen
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 2:28 PM
> Subject: Re: Soap With attachments example
>
>
> > This sample that I created from you code works for me, i.e. it does
not
> > throw an NPE.
> >
> > Scott Nichol
> >
> > import java.io.*;
> > import java.util.*;
> > import java.net.*;
> > import org.w3c.dom.*;
> > import org.xml.sax.*;
> > import org.apache.soap.util.xml.*;
> > import org.apache.soap.util.mime.*;
> > import org.apache.soap.*;
> > import org.apache.soap.transport.*;
> > import org.apache.soap.encoding.*;
> > import org.apache.soap.encoding.soapenc.*;
> > import org.apache.soap.rpc.*;
> > import org.apache.soap.messaging.*;
> > import javax.activation.*;
> > import javax.mail.internet.*;
> > import javax.xml.parsers.*;
> >
> > public class TestAttachments {
> >  public static void main(String[] args) {
> >   try {
> >       URL url = new URL(args[0]);
> >
> >    // Build the call.
> >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> >    Call call = new Call();
> >    call.setSOAPMappingRegistry(smr);
> >    call.setTargetObjectURI("urn:MyServiceName");
> >    call.setMethodName("myMethodName");
> >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> >
> >    byte[] sourceBytes = new byte[0];
> >
> >    Vector params = new Vector();
> >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > "application/octet-stream");
> >    DataHandler dh = new DataHandler(ds);
> >    params.addElement(new Parameter("source",
> >     javax.activation.DataHandler.class, dh, null));
> >
> >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > "application/octet-stream");
> >    DataHandler dh2 = new DataHandler(ds);
> >    params.addElement(new Parameter("thumb",
> >      javax.activation.DataHandler.class,
> >     dh2, null));
> >
> >    call.setParams(params);
> >
> >    // Invoke the call.
> >    Response resp;
> >
> >    try {
> >     resp = call.invoke(url, "");
> >     //System.out.println("Response is: " + resp);
> >    } catch (SOAPException e) {
> >     System.err.println("Caught SOAPException");
> >     e.printStackTrace();
> >    }
> >   } catch (Exception e) {
> >    e.printStackTrace();
> >   }
> >  }
> > }
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
As a general recommendation, I encourage you to capture a stack trace
for your exceptions.  Just having the exception message makes it harder
to understand the cause of most exceptions.

This particular exception means that a ByteArrayDataSource was created
with no data array, such as passing a null for the byte array.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 4:18 PM
Subject: Re: Soap With attachments example


> Yeah. It works now. Its my bad. Sorry about that.
>
> BUt I have another problem. When I execute that method, I get the
following
> exception.
>
> Caught SOAPException (SOAP-ENV:Client): No data.
>
> What does this mean? I double checked that my soap method exists in
the
> descriptor and the implementation also exists on the server side. But
the
> call doesn't reach the server at all.
>
> Praveen
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 2:28 PM
> Subject: Re: Soap With attachments example
>
>
> > This sample that I created from you code works for me, i.e. it does
not
> > throw an NPE.
> >
> > Scott Nichol
> >
> > import java.io.*;
> > import java.util.*;
> > import java.net.*;
> > import org.w3c.dom.*;
> > import org.xml.sax.*;
> > import org.apache.soap.util.xml.*;
> > import org.apache.soap.util.mime.*;
> > import org.apache.soap.*;
> > import org.apache.soap.transport.*;
> > import org.apache.soap.encoding.*;
> > import org.apache.soap.encoding.soapenc.*;
> > import org.apache.soap.rpc.*;
> > import org.apache.soap.messaging.*;
> > import javax.activation.*;
> > import javax.mail.internet.*;
> > import javax.xml.parsers.*;
> >
> > public class TestAttachments {
> >  public static void main(String[] args) {
> >   try {
> >       URL url = new URL(args[0]);
> >
> >    // Build the call.
> >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> >    Call call = new Call();
> >    call.setSOAPMappingRegistry(smr);
> >    call.setTargetObjectURI("urn:MyServiceName");
> >    call.setMethodName("myMethodName");
> >    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> >
> >    byte[] sourceBytes = new byte[0];
> >
> >    Vector params = new Vector();
> >    DataSource ds = new ByteArrayDataSource(sourceBytes,
> > "application/octet-stream");
> >    DataHandler dh = new DataHandler(ds);
> >    params.addElement(new Parameter("source",
> >     javax.activation.DataHandler.class, dh, null));
> >
> >    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> > "application/octet-stream");
> >    DataHandler dh2 = new DataHandler(ds);
> >    params.addElement(new Parameter("thumb",
> >      javax.activation.DataHandler.class,
> >     dh2, null));
> >
> >    call.setParams(params);
> >
> >    // Invoke the call.
> >    Response resp;
> >
> >    try {
> >     resp = call.invoke(url, "");
> >     //System.out.println("Response is: " + resp);
> >    } catch (SOAPException e) {
> >     System.err.println("Caught SOAPException");
> >     e.printStackTrace();
> >    }
> >   } catch (Exception e) {
> >    e.printStackTrace();
> >   }
> >  }
> > }
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Yeah. It works now. Its my bad. Sorry about that.

BUt I have another problem. When I execute that method, I get the following
exception.

Caught SOAPException (SOAP-ENV:Client): No data.

What does this mean? I double checked that my soap method exists in the
descriptor and the implementation also exists on the server side. But the
call doesn't reach the server at all.

Praveen
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 2:28 PM
Subject: Re: Soap With attachments example


> This sample that I created from you code works for me, i.e. it does not
> throw an NPE.
>
> Scott Nichol
>
> import java.io.*;
> import java.util.*;
> import java.net.*;
> import org.w3c.dom.*;
> import org.xml.sax.*;
> import org.apache.soap.util.xml.*;
> import org.apache.soap.util.mime.*;
> import org.apache.soap.*;
> import org.apache.soap.transport.*;
> import org.apache.soap.encoding.*;
> import org.apache.soap.encoding.soapenc.*;
> import org.apache.soap.rpc.*;
> import org.apache.soap.messaging.*;
> import javax.activation.*;
> import javax.mail.internet.*;
> import javax.xml.parsers.*;
>
> public class TestAttachments {
>  public static void main(String[] args) {
>   try {
>       URL url = new URL(args[0]);
>
>    // Build the call.
>    SOAPMappingRegistry smr = new SOAPMappingRegistry();
>    Call call = new Call();
>    call.setSOAPMappingRegistry(smr);
>    call.setTargetObjectURI("urn:MyServiceName");
>    call.setMethodName("myMethodName");
>    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
>
>    byte[] sourceBytes = new byte[0];
>
>    Vector params = new Vector();
>    DataSource ds = new ByteArrayDataSource(sourceBytes,
> "application/octet-stream");
>    DataHandler dh = new DataHandler(ds);
>    params.addElement(new Parameter("source",
>     javax.activation.DataHandler.class, dh, null));
>
>    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> "application/octet-stream");
>    DataHandler dh2 = new DataHandler(ds);
>    params.addElement(new Parameter("thumb",
>      javax.activation.DataHandler.class,
>     dh2, null));
>
>    call.setParams(params);
>
>    // Invoke the call.
>    Response resp;
>
>    try {
>     resp = call.invoke(url, "");
>     //System.out.println("Response is: " + resp);
>    } catch (SOAPException e) {
>     System.err.println("Caught SOAPException");
>     e.printStackTrace();
>    }
>   } catch (Exception e) {
>    e.printStackTrace();
>   }
>  }
> }
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
Yeah. It works now. Its my bad. Sorry about that.

BUt I have another problem. When I execute that method, I get the following
exception.

Caught SOAPException (SOAP-ENV:Client): No data.

What does this mean? I double checked that my soap method exists in the
descriptor and the implementation also exists on the server side. But the
call doesn't reach the server at all.

Praveen
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 2:28 PM
Subject: Re: Soap With attachments example


> This sample that I created from you code works for me, i.e. it does not
> throw an NPE.
>
> Scott Nichol
>
> import java.io.*;
> import java.util.*;
> import java.net.*;
> import org.w3c.dom.*;
> import org.xml.sax.*;
> import org.apache.soap.util.xml.*;
> import org.apache.soap.util.mime.*;
> import org.apache.soap.*;
> import org.apache.soap.transport.*;
> import org.apache.soap.encoding.*;
> import org.apache.soap.encoding.soapenc.*;
> import org.apache.soap.rpc.*;
> import org.apache.soap.messaging.*;
> import javax.activation.*;
> import javax.mail.internet.*;
> import javax.xml.parsers.*;
>
> public class TestAttachments {
>  public static void main(String[] args) {
>   try {
>       URL url = new URL(args[0]);
>
>    // Build the call.
>    SOAPMappingRegistry smr = new SOAPMappingRegistry();
>    Call call = new Call();
>    call.setSOAPMappingRegistry(smr);
>    call.setTargetObjectURI("urn:MyServiceName");
>    call.setMethodName("myMethodName");
>    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
>
>    byte[] sourceBytes = new byte[0];
>
>    Vector params = new Vector();
>    DataSource ds = new ByteArrayDataSource(sourceBytes,
> "application/octet-stream");
>    DataHandler dh = new DataHandler(ds);
>    params.addElement(new Parameter("source",
>     javax.activation.DataHandler.class, dh, null));
>
>    DataSource ds2 = new ByteArrayDataSource(sourceBytes,
> "application/octet-stream");
>    DataHandler dh2 = new DataHandler(ds);
>    params.addElement(new Parameter("thumb",
>      javax.activation.DataHandler.class,
>     dh2, null));
>
>    call.setParams(params);
>
>    // Invoke the call.
>    Response resp;
>
>    try {
>     resp = call.invoke(url, "");
>     //System.out.println("Response is: " + resp);
>    } catch (SOAPException e) {
>     System.err.println("Caught SOAPException");
>     e.printStackTrace();
>    }
>   } catch (Exception e) {
>    e.printStackTrace();
>   }
>  }
> }
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
This sample that I created from you code works for me, i.e. it does not
throw an NPE.

Scott Nichol

import java.io.*;
import java.util.*;
import java.net.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.util.mime.*;
import org.apache.soap.*;
import org.apache.soap.transport.*;
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;
import org.apache.soap.rpc.*;
import org.apache.soap.messaging.*;
import javax.activation.*;
import javax.mail.internet.*;
import javax.xml.parsers.*;

public class TestAttachments {
 public static void main(String[] args) {
  try {
      URL url = new URL(args[0]);

   // Build the call.
   SOAPMappingRegistry smr = new SOAPMappingRegistry();
   Call call = new Call();
   call.setSOAPMappingRegistry(smr);
   call.setTargetObjectURI("urn:MyServiceName");
   call.setMethodName("myMethodName");
   call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

   byte[] sourceBytes = new byte[0];

   Vector params = new Vector();
   DataSource ds = new ByteArrayDataSource(sourceBytes,
"application/octet-stream");
   DataHandler dh = new DataHandler(ds);
   params.addElement(new Parameter("source",
    javax.activation.DataHandler.class, dh, null));

   DataSource ds2 = new ByteArrayDataSource(sourceBytes,
"application/octet-stream");
   DataHandler dh2 = new DataHandler(ds);
   params.addElement(new Parameter("thumb",
     javax.activation.DataHandler.class,
    dh2, null));

   call.setParams(params);

   // Invoke the call.
   Response resp;

   try {
    resp = call.invoke(url, "");
    //System.out.println("Response is: " + resp);
   } catch (SOAPException e) {
    System.err.println("Caught SOAPException");
    e.printStackTrace();
   }
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
}


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
This sample that I created from you code works for me, i.e. it does not
throw an NPE.

Scott Nichol

import java.io.*;
import java.util.*;
import java.net.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.util.mime.*;
import org.apache.soap.*;
import org.apache.soap.transport.*;
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;
import org.apache.soap.rpc.*;
import org.apache.soap.messaging.*;
import javax.activation.*;
import javax.mail.internet.*;
import javax.xml.parsers.*;

public class TestAttachments {
 public static void main(String[] args) {
  try {
      URL url = new URL(args[0]);

   // Build the call.
   SOAPMappingRegistry smr = new SOAPMappingRegistry();
   Call call = new Call();
   call.setSOAPMappingRegistry(smr);
   call.setTargetObjectURI("urn:MyServiceName");
   call.setMethodName("myMethodName");
   call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

   byte[] sourceBytes = new byte[0];

   Vector params = new Vector();
   DataSource ds = new ByteArrayDataSource(sourceBytes,
"application/octet-stream");
   DataHandler dh = new DataHandler(ds);
   params.addElement(new Parameter("source",
    javax.activation.DataHandler.class, dh, null));

   DataSource ds2 = new ByteArrayDataSource(sourceBytes,
"application/octet-stream");
   DataHandler dh2 = new DataHandler(ds);
   params.addElement(new Parameter("thumb",
     javax.activation.DataHandler.class,
    dh2, null));

   call.setParams(params);

   // Invoke the call.
   Response resp;

   try {
    resp = call.invoke(url, "");
    //System.out.println("Response is: " + resp);
   } catch (SOAPException e) {
    System.err.println("Caught SOAPException");
    e.printStackTrace();
   }
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
}


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
> Can you post your full client code?

On second thought, don't: I see from your stack trace you have a GUI,
etc.  I'll just build on what you've posted.

Scott Nichol


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
Did you do that for all the constructor calls?

The sample specifies a null content type because it uses the ctor with a
File parameter, for which the code assigns the content type based on the
mapping between the filename extension and content type.  You use byte
arrays, so you need to specify the content type.

Can you post your full client code?

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 2:05 PM
Subject: Re: Soap With attachments example


> I added application/octet-stream as the type and I still get the same
> exception.
>
> Praveen
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 12:42 PM
> Subject: Re: Soap With attachments example
>
>
> > Although I am not sure it is the problem, I am wary of the lines
like
> >
> >     DataSource ds = new ByteArrayDataSource(sourceBytes, null);
> >
> > The second parameter is supposed to be the MIME content type for the
> > byte array, e.g. text/plain, application/octet-stream.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, January 03, 2003 12:38 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > I am getting the following exception when I used soap with
attachments
> > from
> > > mime example.
> > > My client code looks something like:
> > > // Build the call.
> > > SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > Call call = new Call();
> > > call.setSOAPMappingRegistry(smr);
> > > call.setTargetObjectURI("urn:MyServiceName");
> > > call.setMethodName("myMethodName");
> > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > >
> > > Vector params = new Vector();
> > > params.addElement(new Parameter("sessionID", long.class, new
> > > Long(sessionID), null));
> > > params.addElement(new Parameter("containerID",
containerID.getClass(),
> > new
> > > String(containerID), null));
> > > params.addElement(new Parameter("xmlString", xmlString.getClass(),
new
> > > String(xmlString), null));
> > >
> > > DataSource ds = new ByteArrayDataSource(sourceBytes, null);
> > > DataHandler dh = new DataHandler(ds);
> > > params.addElement(new Parameter("source",
> > > javax.activation.DataHandler.class, dh, null));
> > > params.addElement(new Parameter("sourceFileName",
> > sourceFileName.getClass(),
> > > new String(sourceFileName), null));
> > >
> > > DataSource ds2 = new ByteArrayDataSource(sourceBytes, null);
> > > DataHandler dh2 = new DataHandler(ds);
> > > params.addElement(new Parameter("thumb",
> > javax.activation.DataHandler.class,
> > > dh2, null));
> > > params.addElement(new Parameter("thumbFileName",
> > thumbFileName.getClass(),
> > > new String(thumbFileName), null));
> > >
> > > call.setParams(params);
> > >
> > > // Invoke the call.
> > > Response resp;
> > >
> > > try {
> > > resp = call.invoke(url, "");
> > > //System.out.println("Response is: " + resp);
> > > } catch (SOAPException e) {
> > > System.err.println("Caught SOAPException (" + e.getFaultCode()
+"): "
> > +
> > > e.getMessage());
> > > return null;
> > > }
> > >
> > > And the Error looks something like this.
> > > java.lang.NullPointerException
> > >         at javax.activation.MimeType.parse(MimeType.java:86)
> > >         at javax.activation.MimeType.<init>(MimeType.java:54)
> > >         at
> > org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:328)
> > >         at
> > org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:300)
> > >         at
> > >
org.apache.soap.encoding.soapenc.MimePartSerializer.marshall(MimePart
> > > Serializer.java:153)
> > >         at
> > >
org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
> > > erSerializer.java:102)
> > >         at
> > >
org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:333)
> > >         at
> > org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
> > >         at org.apache.soap.Body.marshall(Body.java:145)
> > >         at org.apache.soap.Envelope.marshall(Envelope.java:195)
> > >         at
> > >
org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
> > > tion.java:246)
> > >         at org.apache.soap.rpc.Call.invoke(Call.java:205)
> > >         at
> > >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > entObjectWithAttachments(ContentObjectUtils.java:715)
> > >         at
> > >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > er.actionPerformed(NewContentObjectDialog.java:275)
> > >         at
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> > >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > istener.java:211)
> > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at java.awt.Dialog.show(Dialog.java:375)
> > >         at java.awt.Component.show(Component.java:941)
> > >         at java.awt.Component.setVisible(Component.java:898)
> > >         at
> > >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > rmed(SimplexFrame.java:391)
> > >         at
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > >         at
> > >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > d(BasicMenuItemUI.java:882)
> > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at
> > >
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > >         at
> > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > >
> > > Am I missing something here. Its not even reaching the server. The
> > exception
> > > is occuring at the client side itself I think.
> > >
> > > Praveen
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
Did you do that for all the constructor calls?

The sample specifies a null content type because it uses the ctor with a
File parameter, for which the code assigns the content type based on the
mapping between the filename extension and content type.  You use byte
arrays, so you need to specify the content type.

Can you post your full client code?

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 2:05 PM
Subject: Re: Soap With attachments example


> I added application/octet-stream as the type and I still get the same
> exception.
>
> Praveen
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 12:42 PM
> Subject: Re: Soap With attachments example
>
>
> > Although I am not sure it is the problem, I am wary of the lines
like
> >
> >     DataSource ds = new ByteArrayDataSource(sourceBytes, null);
> >
> > The second parameter is supposed to be the MIME content type for the
> > byte array, e.g. text/plain, application/octet-stream.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Praveen Peddi" <pp...@contextmedia.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, January 03, 2003 12:38 PM
> > Subject: Re: Soap With attachments example
> >
> >
> > > I am getting the following exception when I used soap with
attachments
> > from
> > > mime example.
> > > My client code looks something like:
> > > // Build the call.
> > > SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > > Call call = new Call();
> > > call.setSOAPMappingRegistry(smr);
> > > call.setTargetObjectURI("urn:MyServiceName");
> > > call.setMethodName("myMethodName");
> > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > >
> > > Vector params = new Vector();
> > > params.addElement(new Parameter("sessionID", long.class, new
> > > Long(sessionID), null));
> > > params.addElement(new Parameter("containerID",
containerID.getClass(),
> > new
> > > String(containerID), null));
> > > params.addElement(new Parameter("xmlString", xmlString.getClass(),
new
> > > String(xmlString), null));
> > >
> > > DataSource ds = new ByteArrayDataSource(sourceBytes, null);
> > > DataHandler dh = new DataHandler(ds);
> > > params.addElement(new Parameter("source",
> > > javax.activation.DataHandler.class, dh, null));
> > > params.addElement(new Parameter("sourceFileName",
> > sourceFileName.getClass(),
> > > new String(sourceFileName), null));
> > >
> > > DataSource ds2 = new ByteArrayDataSource(sourceBytes, null);
> > > DataHandler dh2 = new DataHandler(ds);
> > > params.addElement(new Parameter("thumb",
> > javax.activation.DataHandler.class,
> > > dh2, null));
> > > params.addElement(new Parameter("thumbFileName",
> > thumbFileName.getClass(),
> > > new String(thumbFileName), null));
> > >
> > > call.setParams(params);
> > >
> > > // Invoke the call.
> > > Response resp;
> > >
> > > try {
> > > resp = call.invoke(url, "");
> > > //System.out.println("Response is: " + resp);
> > > } catch (SOAPException e) {
> > > System.err.println("Caught SOAPException (" + e.getFaultCode()
+"): "
> > +
> > > e.getMessage());
> > > return null;
> > > }
> > >
> > > And the Error looks something like this.
> > > java.lang.NullPointerException
> > >         at javax.activation.MimeType.parse(MimeType.java:86)
> > >         at javax.activation.MimeType.<init>(MimeType.java:54)
> > >         at
> > org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:328)
> > >         at
> > org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:300)
> > >         at
> > >
org.apache.soap.encoding.soapenc.MimePartSerializer.marshall(MimePart
> > > Serializer.java:153)
> > >         at
> > >
org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
> > > erSerializer.java:102)
> > >         at
> > >
org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:333)
> > >         at
> > org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
> > >         at org.apache.soap.Body.marshall(Body.java:145)
> > >         at org.apache.soap.Envelope.marshall(Envelope.java:195)
> > >         at
> > >
org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
> > > tion.java:246)
> > >         at org.apache.soap.rpc.Call.invoke(Call.java:205)
> > >         at
> > >
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > > entObjectWithAttachments(ContentObjectUtils.java:715)
> > >         at
> > >
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > > er.actionPerformed(NewContentObjectDialog.java:275)
> > >         at
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
> > >
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > > istener.java:211)
> > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at java.awt.Dialog.show(Dialog.java:375)
> > >         at java.awt.Component.show(Component.java:941)
> > >         at java.awt.Component.setVisible(Component.java:898)
> > >         at
> > >
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > > rmed(SimplexFrame.java:391)
> > >         at
> > >
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > > 45)
> > >         at
> > >
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > > ctButton.java:1499)
> > >         at
> > >
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > > .java:373)
> > >         at
> > >
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > > )
> > >         at
javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> > >         at
> > >
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > > d(BasicMenuItemUI.java:882)
> > >         at
java.awt.Component.processMouseEvent(Component.java:3710)
> > >         at java.awt.Component.processEvent(Component.java:3539)
> > >         at java.awt.Container.processEvent(Container.java:1159)
> > >         at
java.awt.Component.dispatchEventImpl(Component.java:2588)
> > >         at
java.awt.Container.dispatchEventImpl(Container.java:1208)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at
> > >
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > > )
> > >         at
> > >
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> > >
> > >         at
> > java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> > >         at
java.awt.Container.dispatchEventImpl(Container.java:1195)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> > >         at java.awt.Component.dispatchEvent(Component.java:2492)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> > >         at
> > >
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > > read.java:126)
> > >         at
> > >
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > > ad.java:93)
> > >         at
> > >
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> > >         at
> > java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> > >
> > > Am I missing something here. Its not even reaching the server. The
> > exception
> > > is occuring at the client side itself I think.
> > >
> > > Praveen
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
I added application/octet-stream as the type and I still get the same
exception.

Praveen

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 12:42 PM
Subject: Re: Soap With attachments example


> Although I am not sure it is the problem, I am wary of the lines like
>
>     DataSource ds = new ByteArrayDataSource(sourceBytes, null);
>
> The second parameter is supposed to be the MIME content type for the
> byte array, e.g. text/plain, application/octet-stream.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 12:38 PM
> Subject: Re: Soap With attachments example
>
>
> > I am getting the following exception when I used soap with attachments
> from
> > mime example.
> > My client code looks something like:
> > // Build the call.
> > SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > Call call = new Call();
> > call.setSOAPMappingRegistry(smr);
> > call.setTargetObjectURI("urn:MyServiceName");
> > call.setMethodName("myMethodName");
> > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> >
> > Vector params = new Vector();
> > params.addElement(new Parameter("sessionID", long.class, new
> > Long(sessionID), null));
> > params.addElement(new Parameter("containerID", containerID.getClass(),
> new
> > String(containerID), null));
> > params.addElement(new Parameter("xmlString", xmlString.getClass(), new
> > String(xmlString), null));
> >
> > DataSource ds = new ByteArrayDataSource(sourceBytes, null);
> > DataHandler dh = new DataHandler(ds);
> > params.addElement(new Parameter("source",
> > javax.activation.DataHandler.class, dh, null));
> > params.addElement(new Parameter("sourceFileName",
> sourceFileName.getClass(),
> > new String(sourceFileName), null));
> >
> > DataSource ds2 = new ByteArrayDataSource(sourceBytes, null);
> > DataHandler dh2 = new DataHandler(ds);
> > params.addElement(new Parameter("thumb",
> javax.activation.DataHandler.class,
> > dh2, null));
> > params.addElement(new Parameter("thumbFileName",
> thumbFileName.getClass(),
> > new String(thumbFileName), null));
> >
> > call.setParams(params);
> >
> > // Invoke the call.
> > Response resp;
> >
> > try {
> > resp = call.invoke(url, "");
> > //System.out.println("Response is: " + resp);
> > } catch (SOAPException e) {
> > System.err.println("Caught SOAPException (" + e.getFaultCode() +"): "
> +
> > e.getMessage());
> > return null;
> > }
> >
> > And the Error looks something like this.
> > java.lang.NullPointerException
> >         at javax.activation.MimeType.parse(MimeType.java:86)
> >         at javax.activation.MimeType.<init>(MimeType.java:54)
> >         at
> org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:328)
> >         at
> org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:300)
> >         at
> > org.apache.soap.encoding.soapenc.MimePartSerializer.marshall(MimePart
> > Serializer.java:153)
> >         at
> > org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
> > erSerializer.java:102)
> >         at
> > org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:333)
> >         at
> org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
> >         at org.apache.soap.Body.marshall(Body.java:145)
> >         at org.apache.soap.Envelope.marshall(Envelope.java:195)
> >         at
> > org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
> > tion.java:246)
> >         at org.apache.soap.rpc.Call.invoke(Call.java:205)
> >         at
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > entObjectWithAttachments(ContentObjectUtils.java:715)
> >         at
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > er.actionPerformed(NewContentObjectDialog.java:275)
> >         at
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > istener.java:211)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at java.awt.Dialog.show(Dialog.java:375)
> >         at java.awt.Component.show(Component.java:941)
> >         at java.awt.Component.setVisible(Component.java:898)
> >         at
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > rmed(SimplexFrame.java:391)
> >         at
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> >         at
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > d(BasicMenuItemUI.java:882)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> >         at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> >
> > Am I missing something here. Its not even reaching the server. The
> exception
> > is occuring at the client side itself I think.
> >
> > Praveen
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
I added application/octet-stream as the type and I still get the same
exception.

Praveen

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 12:42 PM
Subject: Re: Soap With attachments example


> Although I am not sure it is the problem, I am wary of the lines like
>
>     DataSource ds = new ByteArrayDataSource(sourceBytes, null);
>
> The second parameter is supposed to be the MIME content type for the
> byte array, e.g. text/plain, application/octet-stream.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 12:38 PM
> Subject: Re: Soap With attachments example
>
>
> > I am getting the following exception when I used soap with attachments
> from
> > mime example.
> > My client code looks something like:
> > // Build the call.
> > SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > Call call = new Call();
> > call.setSOAPMappingRegistry(smr);
> > call.setTargetObjectURI("urn:MyServiceName");
> > call.setMethodName("myMethodName");
> > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> >
> > Vector params = new Vector();
> > params.addElement(new Parameter("sessionID", long.class, new
> > Long(sessionID), null));
> > params.addElement(new Parameter("containerID", containerID.getClass(),
> new
> > String(containerID), null));
> > params.addElement(new Parameter("xmlString", xmlString.getClass(), new
> > String(xmlString), null));
> >
> > DataSource ds = new ByteArrayDataSource(sourceBytes, null);
> > DataHandler dh = new DataHandler(ds);
> > params.addElement(new Parameter("source",
> > javax.activation.DataHandler.class, dh, null));
> > params.addElement(new Parameter("sourceFileName",
> sourceFileName.getClass(),
> > new String(sourceFileName), null));
> >
> > DataSource ds2 = new ByteArrayDataSource(sourceBytes, null);
> > DataHandler dh2 = new DataHandler(ds);
> > params.addElement(new Parameter("thumb",
> javax.activation.DataHandler.class,
> > dh2, null));
> > params.addElement(new Parameter("thumbFileName",
> thumbFileName.getClass(),
> > new String(thumbFileName), null));
> >
> > call.setParams(params);
> >
> > // Invoke the call.
> > Response resp;
> >
> > try {
> > resp = call.invoke(url, "");
> > //System.out.println("Response is: " + resp);
> > } catch (SOAPException e) {
> > System.err.println("Caught SOAPException (" + e.getFaultCode() +"): "
> +
> > e.getMessage());
> > return null;
> > }
> >
> > And the Error looks something like this.
> > java.lang.NullPointerException
> >         at javax.activation.MimeType.parse(MimeType.java:86)
> >         at javax.activation.MimeType.<init>(MimeType.java:54)
> >         at
> org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:328)
> >         at
> org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:300)
> >         at
> > org.apache.soap.encoding.soapenc.MimePartSerializer.marshall(MimePart
> > Serializer.java:153)
> >         at
> > org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
> > erSerializer.java:102)
> >         at
> > org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:333)
> >         at
> org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
> >         at org.apache.soap.Body.marshall(Body.java:145)
> >         at org.apache.soap.Envelope.marshall(Envelope.java:195)
> >         at
> > org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
> > tion.java:246)
> >         at org.apache.soap.rpc.Call.invoke(Call.java:205)
> >         at
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > entObjectWithAttachments(ContentObjectUtils.java:715)
> >         at
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > er.actionPerformed(NewContentObjectDialog.java:275)
> >         at
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > istener.java:211)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at java.awt.Dialog.show(Dialog.java:375)
> >         at java.awt.Component.show(Component.java:941)
> >         at java.awt.Component.setVisible(Component.java:898)
> >         at
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > rmed(SimplexFrame.java:391)
> >         at
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> >         at
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > d(BasicMenuItemUI.java:882)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> >         at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> >
> > Am I missing something here. Its not even reaching the server. The
> exception
> > is occuring at the client side itself I think.
> >
> > Praveen
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
But this is the code I took from the soap samples, mime example. If thats
the problem, then the sample is also wrong?

Praveen


----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 12:42 PM
Subject: Re: Soap With attachments example


> Although I am not sure it is the problem, I am wary of the lines like
>
>     DataSource ds = new ByteArrayDataSource(sourceBytes, null);
>
> The second parameter is supposed to be the MIME content type for the
> byte array, e.g. text/plain, application/octet-stream.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 12:38 PM
> Subject: Re: Soap With attachments example
>
>
> > I am getting the following exception when I used soap with attachments
> from
> > mime example.
> > My client code looks something like:
> > // Build the call.
> > SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > Call call = new Call();
> > call.setSOAPMappingRegistry(smr);
> > call.setTargetObjectURI("urn:MyServiceName");
> > call.setMethodName("myMethodName");
> > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> >
> > Vector params = new Vector();
> > params.addElement(new Parameter("sessionID", long.class, new
> > Long(sessionID), null));
> > params.addElement(new Parameter("containerID", containerID.getClass(),
> new
> > String(containerID), null));
> > params.addElement(new Parameter("xmlString", xmlString.getClass(), new
> > String(xmlString), null));
> >
> > DataSource ds = new ByteArrayDataSource(sourceBytes, null);
> > DataHandler dh = new DataHandler(ds);
> > params.addElement(new Parameter("source",
> > javax.activation.DataHandler.class, dh, null));
> > params.addElement(new Parameter("sourceFileName",
> sourceFileName.getClass(),
> > new String(sourceFileName), null));
> >
> > DataSource ds2 = new ByteArrayDataSource(sourceBytes, null);
> > DataHandler dh2 = new DataHandler(ds);
> > params.addElement(new Parameter("thumb",
> javax.activation.DataHandler.class,
> > dh2, null));
> > params.addElement(new Parameter("thumbFileName",
> thumbFileName.getClass(),
> > new String(thumbFileName), null));
> >
> > call.setParams(params);
> >
> > // Invoke the call.
> > Response resp;
> >
> > try {
> > resp = call.invoke(url, "");
> > //System.out.println("Response is: " + resp);
> > } catch (SOAPException e) {
> > System.err.println("Caught SOAPException (" + e.getFaultCode() +"): "
> +
> > e.getMessage());
> > return null;
> > }
> >
> > And the Error looks something like this.
> > java.lang.NullPointerException
> >         at javax.activation.MimeType.parse(MimeType.java:86)
> >         at javax.activation.MimeType.<init>(MimeType.java:54)
> >         at
> org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:328)
> >         at
> org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:300)
> >         at
> > org.apache.soap.encoding.soapenc.MimePartSerializer.marshall(MimePart
> > Serializer.java:153)
> >         at
> > org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
> > erSerializer.java:102)
> >         at
> > org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:333)
> >         at
> org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
> >         at org.apache.soap.Body.marshall(Body.java:145)
> >         at org.apache.soap.Envelope.marshall(Envelope.java:195)
> >         at
> > org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
> > tion.java:246)
> >         at org.apache.soap.rpc.Call.invoke(Call.java:205)
> >         at
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > entObjectWithAttachments(ContentObjectUtils.java:715)
> >         at
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > er.actionPerformed(NewContentObjectDialog.java:275)
> >         at
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > istener.java:211)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at java.awt.Dialog.show(Dialog.java:375)
> >         at java.awt.Component.show(Component.java:941)
> >         at java.awt.Component.setVisible(Component.java:898)
> >         at
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > rmed(SimplexFrame.java:391)
> >         at
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> >         at
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > d(BasicMenuItemUI.java:882)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> >         at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> >
> > Am I missing something here. Its not even reaching the server. The
> exception
> > is occuring at the client side itself I think.
> >
> > Praveen
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
But this is the code I took from the soap samples, mime example. If thats
the problem, then the sample is also wrong?

Praveen


----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 12:42 PM
Subject: Re: Soap With attachments example


> Although I am not sure it is the problem, I am wary of the lines like
>
>     DataSource ds = new ByteArrayDataSource(sourceBytes, null);
>
> The second parameter is supposed to be the MIME content type for the
> byte array, e.g. text/plain, application/octet-stream.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Praveen Peddi" <pp...@contextmedia.com>
> To: <so...@xml.apache.org>
> Sent: Friday, January 03, 2003 12:38 PM
> Subject: Re: Soap With attachments example
>
>
> > I am getting the following exception when I used soap with attachments
> from
> > mime example.
> > My client code looks something like:
> > // Build the call.
> > SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > Call call = new Call();
> > call.setSOAPMappingRegistry(smr);
> > call.setTargetObjectURI("urn:MyServiceName");
> > call.setMethodName("myMethodName");
> > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> >
> > Vector params = new Vector();
> > params.addElement(new Parameter("sessionID", long.class, new
> > Long(sessionID), null));
> > params.addElement(new Parameter("containerID", containerID.getClass(),
> new
> > String(containerID), null));
> > params.addElement(new Parameter("xmlString", xmlString.getClass(), new
> > String(xmlString), null));
> >
> > DataSource ds = new ByteArrayDataSource(sourceBytes, null);
> > DataHandler dh = new DataHandler(ds);
> > params.addElement(new Parameter("source",
> > javax.activation.DataHandler.class, dh, null));
> > params.addElement(new Parameter("sourceFileName",
> sourceFileName.getClass(),
> > new String(sourceFileName), null));
> >
> > DataSource ds2 = new ByteArrayDataSource(sourceBytes, null);
> > DataHandler dh2 = new DataHandler(ds);
> > params.addElement(new Parameter("thumb",
> javax.activation.DataHandler.class,
> > dh2, null));
> > params.addElement(new Parameter("thumbFileName",
> thumbFileName.getClass(),
> > new String(thumbFileName), null));
> >
> > call.setParams(params);
> >
> > // Invoke the call.
> > Response resp;
> >
> > try {
> > resp = call.invoke(url, "");
> > //System.out.println("Response is: " + resp);
> > } catch (SOAPException e) {
> > System.err.println("Caught SOAPException (" + e.getFaultCode() +"): "
> +
> > e.getMessage());
> > return null;
> > }
> >
> > And the Error looks something like this.
> > java.lang.NullPointerException
> >         at javax.activation.MimeType.parse(MimeType.java:86)
> >         at javax.activation.MimeType.<init>(MimeType.java:54)
> >         at
> org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:328)
> >         at
> org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:300)
> >         at
> > org.apache.soap.encoding.soapenc.MimePartSerializer.marshall(MimePart
> > Serializer.java:153)
> >         at
> > org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
> > erSerializer.java:102)
> >         at
> > org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:333)
> >         at
> org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
> >         at org.apache.soap.Body.marshall(Body.java:145)
> >         at org.apache.soap.Envelope.marshall(Envelope.java:195)
> >         at
> > org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
> > tion.java:246)
> >         at org.apache.soap.rpc.Call.invoke(Call.java:205)
> >         at
> > com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> > entObjectWithAttachments(ContentObjectUtils.java:715)
> >         at
> > com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> > er.actionPerformed(NewContentObjectDialog.java:275)
> >         at
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at
> > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> > istener.java:211)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at java.awt.Dialog.show(Dialog.java:375)
> >         at java.awt.Component.show(Component.java:941)
> >         at java.awt.Component.setVisible(Component.java:898)
> >         at
> > com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> > rmed(SimplexFrame.java:391)
> >         at
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> > 45)
> >         at
> > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> > ctButton.java:1499)
> >         at
> > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> > .java:373)
> >         at
> > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> > )
> >         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
> >         at
> > javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> > d(BasicMenuItemUI.java:882)
> >         at java.awt.Component.processMouseEvent(Component.java:3710)
> >         at java.awt.Component.processEvent(Component.java:3539)
> >         at java.awt.Container.processEvent(Container.java:1159)
> >         at java.awt.Component.dispatchEventImpl(Component.java:2588)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1208)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> > )
> >         at
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
> >
> >         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
> >         at java.awt.Container.dispatchEventImpl(Container.java:1195)
> >         at java.awt.Window.dispatchEventImpl(Window.java:923)
> >         at java.awt.Component.dispatchEvent(Component.java:2492)
> >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
> >         at
> > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> > read.java:126)
> >         at
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> > ad.java:93)
> >         at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
> >         at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
> >
> > Am I missing something here. Its not even reaching the server. The
> exception
> > is occuring at the client side itself I think.
> >
> > Praveen
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
Although I am not sure it is the problem, I am wary of the lines like

    DataSource ds = new ByteArrayDataSource(sourceBytes, null);

The second parameter is supposed to be the MIME content type for the
byte array, e.g. text/plain, application/octet-stream.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 12:38 PM
Subject: Re: Soap With attachments example


> I am getting the following exception when I used soap with attachments
from
> mime example.
> My client code looks something like:
> // Build the call.
> SOAPMappingRegistry smr = new SOAPMappingRegistry();
> Call call = new Call();
> call.setSOAPMappingRegistry(smr);
> call.setTargetObjectURI("urn:MyServiceName");
> call.setMethodName("myMethodName");
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
>
> Vector params = new Vector();
> params.addElement(new Parameter("sessionID", long.class, new
> Long(sessionID), null));
> params.addElement(new Parameter("containerID", containerID.getClass(),
new
> String(containerID), null));
> params.addElement(new Parameter("xmlString", xmlString.getClass(), new
> String(xmlString), null));
>
> DataSource ds = new ByteArrayDataSource(sourceBytes, null);
> DataHandler dh = new DataHandler(ds);
> params.addElement(new Parameter("source",
> javax.activation.DataHandler.class, dh, null));
> params.addElement(new Parameter("sourceFileName",
sourceFileName.getClass(),
> new String(sourceFileName), null));
>
> DataSource ds2 = new ByteArrayDataSource(sourceBytes, null);
> DataHandler dh2 = new DataHandler(ds);
> params.addElement(new Parameter("thumb",
javax.activation.DataHandler.class,
> dh2, null));
> params.addElement(new Parameter("thumbFileName",
thumbFileName.getClass(),
> new String(thumbFileName), null));
>
> call.setParams(params);
>
> // Invoke the call.
> Response resp;
>
> try {
> resp = call.invoke(url, "");
> //System.out.println("Response is: " + resp);
> } catch (SOAPException e) {
> System.err.println("Caught SOAPException (" + e.getFaultCode() +"): "
+
> e.getMessage());
> return null;
> }
>
> And the Error looks something like this.
> java.lang.NullPointerException
>         at javax.activation.MimeType.parse(MimeType.java:86)
>         at javax.activation.MimeType.<init>(MimeType.java:54)
>         at
org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:328)
>         at
org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:300)
>         at
> org.apache.soap.encoding.soapenc.MimePartSerializer.marshall(MimePart
> Serializer.java:153)
>         at
> org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
> erSerializer.java:102)
>         at
> org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:333)
>         at
org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
>         at org.apache.soap.Body.marshall(Body.java:145)
>         at org.apache.soap.Envelope.marshall(Envelope.java:195)
>         at
> org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
> tion.java:246)
>         at org.apache.soap.rpc.Call.invoke(Call.java:205)
>         at
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> entObjectWithAttachments(ContentObjectUtils.java:715)
>         at
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> er.actionPerformed(NewContentObjectDialog.java:275)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> istener.java:211)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at java.awt.Dialog.show(Dialog.java:375)
>         at java.awt.Component.show(Component.java:941)
>         at java.awt.Component.setVisible(Component.java:898)
>         at
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> rmed(SimplexFrame.java:391)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> d(BasicMenuItemUI.java:882)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
>         at
java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
>
> Am I missing something here. Its not even reaching the server. The
exception
> is occuring at the client side itself I think.
>
> Praveen
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
Although I am not sure it is the problem, I am wary of the lines like

    DataSource ds = new ByteArrayDataSource(sourceBytes, null);

The second parameter is supposed to be the MIME content type for the
byte array, e.g. text/plain, application/octet-stream.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 12:38 PM
Subject: Re: Soap With attachments example


> I am getting the following exception when I used soap with attachments
from
> mime example.
> My client code looks something like:
> // Build the call.
> SOAPMappingRegistry smr = new SOAPMappingRegistry();
> Call call = new Call();
> call.setSOAPMappingRegistry(smr);
> call.setTargetObjectURI("urn:MyServiceName");
> call.setMethodName("myMethodName");
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
>
> Vector params = new Vector();
> params.addElement(new Parameter("sessionID", long.class, new
> Long(sessionID), null));
> params.addElement(new Parameter("containerID", containerID.getClass(),
new
> String(containerID), null));
> params.addElement(new Parameter("xmlString", xmlString.getClass(), new
> String(xmlString), null));
>
> DataSource ds = new ByteArrayDataSource(sourceBytes, null);
> DataHandler dh = new DataHandler(ds);
> params.addElement(new Parameter("source",
> javax.activation.DataHandler.class, dh, null));
> params.addElement(new Parameter("sourceFileName",
sourceFileName.getClass(),
> new String(sourceFileName), null));
>
> DataSource ds2 = new ByteArrayDataSource(sourceBytes, null);
> DataHandler dh2 = new DataHandler(ds);
> params.addElement(new Parameter("thumb",
javax.activation.DataHandler.class,
> dh2, null));
> params.addElement(new Parameter("thumbFileName",
thumbFileName.getClass(),
> new String(thumbFileName), null));
>
> call.setParams(params);
>
> // Invoke the call.
> Response resp;
>
> try {
> resp = call.invoke(url, "");
> //System.out.println("Response is: " + resp);
> } catch (SOAPException e) {
> System.err.println("Caught SOAPException (" + e.getFaultCode() +"): "
+
> e.getMessage());
> return null;
> }
>
> And the Error looks something like this.
> java.lang.NullPointerException
>         at javax.activation.MimeType.parse(MimeType.java:86)
>         at javax.activation.MimeType.<init>(MimeType.java:54)
>         at
org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:328)
>         at
org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:300)
>         at
> org.apache.soap.encoding.soapenc.MimePartSerializer.marshall(MimePart
> Serializer.java:153)
>         at
> org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
> erSerializer.java:102)
>         at
> org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:333)
>         at
org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
>         at org.apache.soap.Body.marshall(Body.java:145)
>         at org.apache.soap.Envelope.marshall(Envelope.java:195)
>         at
> org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
> tion.java:246)
>         at org.apache.soap.rpc.Call.invoke(Call.java:205)
>         at
> com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
> entObjectWithAttachments(ContentObjectUtils.java:715)
>         at
> com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
> er.actionPerformed(NewContentObjectDialog.java:275)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
> istener.java:211)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at java.awt.Dialog.show(Dialog.java:375)
>         at java.awt.Component.show(Component.java:941)
>         at java.awt.Component.setVisible(Component.java:898)
>         at
> com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
> rmed(SimplexFrame.java:391)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
> 45)
>         at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
> ctButton.java:1499)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
> .java:373)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
> )
>         at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
> d(BasicMenuItemUI.java:882)
>         at java.awt.Component.processMouseEvent(Component.java:3710)
>         at java.awt.Component.processEvent(Component.java:3539)
>         at java.awt.Container.processEvent(Container.java:1159)
>         at java.awt.Component.dispatchEventImpl(Component.java:2588)
>         at java.awt.Container.dispatchEventImpl(Container.java:1208)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
> )
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
>
>         at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
>         at java.awt.Container.dispatchEventImpl(Container.java:1195)
>         at java.awt.Window.dispatchEventImpl(Window.java:923)
>         at java.awt.Component.dispatchEvent(Component.java:2492)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
>         at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
> read.java:126)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
> ad.java:93)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
>         at
java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
>
> Am I missing something here. Its not even reaching the server. The
exception
> is occuring at the client side itself I think.
>
> Praveen
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
I am getting the following exception when I used soap with attachments from
mime example.
My client code looks something like:
// Build the call.
SOAPMappingRegistry smr = new SOAPMappingRegistry();
Call call = new Call();
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI("urn:MyServiceName");
call.setMethodName("myMethodName");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

Vector params = new Vector();
params.addElement(new Parameter("sessionID", long.class, new
Long(sessionID), null));
params.addElement(new Parameter("containerID", containerID.getClass(), new
String(containerID), null));
params.addElement(new Parameter("xmlString", xmlString.getClass(), new
String(xmlString), null));

DataSource ds = new ByteArrayDataSource(sourceBytes, null);
DataHandler dh = new DataHandler(ds);
params.addElement(new Parameter("source",
javax.activation.DataHandler.class, dh, null));
params.addElement(new Parameter("sourceFileName", sourceFileName.getClass(),
new String(sourceFileName), null));

DataSource ds2 = new ByteArrayDataSource(sourceBytes, null);
DataHandler dh2 = new DataHandler(ds);
params.addElement(new Parameter("thumb", javax.activation.DataHandler.class,
dh2, null));
params.addElement(new Parameter("thumbFileName", thumbFileName.getClass(),
new String(thumbFileName), null));

call.setParams(params);

// Invoke the call.
Response resp;

try {
resp = call.invoke(url, "");
//System.out.println("Response is: " + resp);
} catch (SOAPException e) {
System.err.println("Caught SOAPException (" + e.getFaultCode() +"): " +
e.getMessage());
return null;
}

And the Error looks something like this.
java.lang.NullPointerException
        at javax.activation.MimeType.parse(MimeType.java:86)
        at javax.activation.MimeType.<init>(MimeType.java:54)
        at org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:328)
        at org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:300)
        at
org.apache.soap.encoding.soapenc.MimePartSerializer.marshall(MimePart
Serializer.java:153)
        at
org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
erSerializer.java:102)
        at
org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:333)
        at org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
        at org.apache.soap.Body.marshall(Body.java:145)
        at org.apache.soap.Envelope.marshall(Envelope.java:195)
        at
org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
tion.java:246)
        at org.apache.soap.rpc.Call.invoke(Call.java:205)
        at
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
entObjectWithAttachments(ContentObjectUtils.java:715)
        at
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
er.actionPerformed(NewContentObjectDialog.java:275)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:211)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.Dialog.show(Dialog.java:375)
        at java.awt.Component.show(Component.java:941)
        at java.awt.Component.setVisible(Component.java:898)
        at
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
rmed(SimplexFrame.java:391)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
        at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
d(BasicMenuItemUI.java:882)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)

Am I missing something here. Its not even reaching the server. The exception
is occuring at the client side itself I think.

Praveen


Re: Soap With attachments example

Posted by Praveen Peddi <pp...@contextmedia.com>.
I am getting the following exception when I used soap with attachments from
mime example.
My client code looks something like:
// Build the call.
SOAPMappingRegistry smr = new SOAPMappingRegistry();
Call call = new Call();
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI("urn:MyServiceName");
call.setMethodName("myMethodName");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

Vector params = new Vector();
params.addElement(new Parameter("sessionID", long.class, new
Long(sessionID), null));
params.addElement(new Parameter("containerID", containerID.getClass(), new
String(containerID), null));
params.addElement(new Parameter("xmlString", xmlString.getClass(), new
String(xmlString), null));

DataSource ds = new ByteArrayDataSource(sourceBytes, null);
DataHandler dh = new DataHandler(ds);
params.addElement(new Parameter("source",
javax.activation.DataHandler.class, dh, null));
params.addElement(new Parameter("sourceFileName", sourceFileName.getClass(),
new String(sourceFileName), null));

DataSource ds2 = new ByteArrayDataSource(sourceBytes, null);
DataHandler dh2 = new DataHandler(ds);
params.addElement(new Parameter("thumb", javax.activation.DataHandler.class,
dh2, null));
params.addElement(new Parameter("thumbFileName", thumbFileName.getClass(),
new String(thumbFileName), null));

call.setParams(params);

// Invoke the call.
Response resp;

try {
resp = call.invoke(url, "");
//System.out.println("Response is: " + resp);
} catch (SOAPException e) {
System.err.println("Caught SOAPException (" + e.getFaultCode() +"): " +
e.getMessage());
return null;
}

And the Error looks something like this.
java.lang.NullPointerException
        at javax.activation.MimeType.parse(MimeType.java:86)
        at javax.activation.MimeType.<init>(MimeType.java:54)
        at org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:328)
        at org.apache.soap.rpc.SOAPContext.addBodyPart(SOAPContext.java:300)
        at
org.apache.soap.encoding.soapenc.MimePartSerializer.marshall(MimePart
Serializer.java:153)
        at
org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
erSerializer.java:102)
        at
org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:333)
        at org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
        at org.apache.soap.Body.marshall(Body.java:145)
        at org.apache.soap.Envelope.marshall(Envelope.java:195)
        at
org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
tion.java:246)
        at org.apache.soap.rpc.Call.invoke(Call.java:205)
        at
com.contextmedia.simplex.domain.content.ContentObjectUtils.uploadCont
entObjectWithAttachments(ContentObjectUtils.java:715)
        at
com.contextmedia.simplex.ui.NewContentObjectDialog$DialogActionListen
er.actionPerformed(NewContentObjectDialog.java:275)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:211)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at java.awt.Dialog.show(Dialog.java:375)
        at java.awt.Component.show(Component.java:941)
        at java.awt.Component.setVisible(Component.java:898)
        at
com.contextmedia.simplex.SimplexFrame$FrameActionListener.actionPerfo
rmed(SimplexFrame.java:391)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
45)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1499)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:373)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245
)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:274)
        at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease
d(BasicMenuItemUI.java:882)
        at java.awt.Component.processMouseEvent(Component.java:3710)
        at java.awt.Component.processEvent(Component.java:3539)
        at java.awt.Container.processEvent(Container.java:1159)
        at java.awt.Component.dispatchEventImpl(Component.java:2588)
        at java.awt.Container.dispatchEventImpl(Container.java:1208)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
        at java.awt.Container.dispatchEventImpl(Container.java:1195)
        at java.awt.Window.dispatchEventImpl(Window.java:923)
        at java.awt.Component.dispatchEvent(Component.java:2492)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:126)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:93)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)

Am I missing something here. Its not even reaching the server. The exception
is occuring at the client side itself I think.

Praveen


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
Have you looked at the mime sample that ships with Apache SOAP?  It
demonstrates attachments both to and from the server.  I think it shows
both attachments sent as RPC parameters and standalone attachments.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 9:41 AM
Subject: Soap With attachments example


Hi all,
I read the example at
http://www-106.ibm.com/developerworks/webservices/library/ws-soapatt/?op
en&l=930,t=grws and it was very helpful. I have a small problem. I am
using Apache SOAP 2.2 both on the client side and the server side and I
am not using WSDL, but simple RPC based invocation.

The server side code DocumentManagementImpl is fine and my code is
similar to that. But the client side code uses WSTK and Apache SOAP I
guess. It also uses WSDL based invocation. I need to add attachments
using Apache SOAP only (may be using SOAPContext) and with out using
WSDL. Does anyone has a sample code to add attachments using apache soap
only. My server url looks like
http://<hostname>:<port>/soap/servlet/rpcrouter
My client code before using attachments looks something like below. Now
I need to code related to attachments to this code.
// Build the call.

Call call = new Call();

trace("after calling Call");

call.setTargetObjectURI("urn:SOAPServiceName");

call.setMethodName("methodName");

call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

Vector params = new Vector();

params.addElement(new Parameter("arg1", userField.getText().getClass(),
new String(userField.getText()),null));

params.addElement(new Parameter("arg2", passField.getText().getClass(),
new String(passField.getText()), null));

call.setParams(params);

Response resp;

resp = call.invoke(url, "");


Any help would be appreciated.

Thanks

Praveen


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Soap With attachments example

Posted by Scott Nichol <sn...@scottnichol.com>.
Have you looked at the mime sample that ships with Apache SOAP?  It
demonstrates attachments both to and from the server.  I think it shows
both attachments sent as RPC parameters and standalone attachments.

Scott Nichol

----- Original Message -----
From: "Praveen Peddi" <pp...@contextmedia.com>
To: <so...@xml.apache.org>
Sent: Friday, January 03, 2003 9:41 AM
Subject: Soap With attachments example


Hi all,
I read the example at
http://www-106.ibm.com/developerworks/webservices/library/ws-soapatt/?op
en&l=930,t=grws and it was very helpful. I have a small problem. I am
using Apache SOAP 2.2 both on the client side and the server side and I
am not using WSDL, but simple RPC based invocation.

The server side code DocumentManagementImpl is fine and my code is
similar to that. But the client side code uses WSTK and Apache SOAP I
guess. It also uses WSDL based invocation. I need to add attachments
using Apache SOAP only (may be using SOAPContext) and with out using
WSDL. Does anyone has a sample code to add attachments using apache soap
only. My server url looks like
http://<hostname>:<port>/soap/servlet/rpcrouter
My client code before using attachments looks something like below. Now
I need to code related to attachments to this code.
// Build the call.

Call call = new Call();

trace("after calling Call");

call.setTargetObjectURI("urn:SOAPServiceName");

call.setMethodName("methodName");

call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

Vector params = new Vector();

params.addElement(new Parameter("arg1", userField.getText().getClass(),
new String(userField.getText()),null));

params.addElement(new Parameter("arg2", passField.getText().getClass(),
new String(passField.getText()), null));

call.setParams(params);

Response resp;

resp = call.invoke(url, "");


Any help would be appreciated.

Thanks

Praveen