Hi Barry and Kuntal,

This exact topic was covered several days ago. There are archives available
from the mailing list page at: http://xml.apache.org/soap/mail.

Either way, the question is: "How do you specify literal XML encoding for
the return value, while sending the input parameters using a different
encoding (usually SOAP encoding)?"

The answer is: "Specify the encoding style of the call to be literal XML,
and the encoding style of each Parameter (the last constructor arg) as SOAP
encoding. The Response will determine its encoding style by first looking at
the encoding style of the call, and if there is none, then by looking at the
encoding style of the parameters (in document order)."

Thanks,
-Matt

> -----Original Message-----
> From: Barry Fortune [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 30, 2001 5:13 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Illegal argument Exception.....
>
>
> We are experiencing exactly the same problem. My guess is that
> the encoding
> style applies to both inputs and outputs: the literal encoding
> style applies
> to the output (Element) but the input parameters in my case are
> strings, so
> the encoding does not apply.
>
> Can any developer please give some guidance!
>
> -----Original Message-----
> From: Das, Kuntal [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 25, 2001 3:22 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Illegal argument Exception.....
>
>
> Guess what ? I tried that first time, and all it got was :
>
> ************ SOAPException caught *************
> Caught SOAPException (SOAP-ENV:Client): I only know how to serialize an
> 'org.w3c
> .dom.Element'.
>
> And my remote method does return an "Element", just like the
> AddressBook.getAllListings() method, only in my case I'm passing some
> parameters to the method. If I don't pass any parameters, then
> it's working
> fine as in the AddressBook example. But the moment I'm passing any
> parameters to the method it's not being able to serialize
> something, in this
> case the parameters. I tried all the NS_URI's listed in the Constants
> class...but none of them worked.....
>
> Thanks,
> Kuntal Das
> Charles Schwab & Co., Inc.
> Wireless Technology
> 45 Fremont, SF
> Email : [EMAIL PROTECTED]
> Phone : (415)667-4322
> Live life to the brim.................
>
>
>
> -----Original Message-----
> From: Trang K. Duong [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 25, 2001 3:17 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Illegal argument Exception.....
>
>
> I think i know what you did wrong...at:
>
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
>
> use: Constants.NS_URI_LITERAL_XML instead beacause you get back not
> primitive
> encoded type but the xml doc.
>
>
>
>
>
> > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> > list-help: <mailto:[EMAIL PROTECTED]>
> > list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> > list-post: <mailto:[EMAIL PROTECTED]>
> > Delivered-To: mailing list [EMAIL PROTECTED]
> > Received-Date: Fri, 25 May 2001 18:04:57 -0400 (EDT)
> > From: "Das, Kuntal" <[EMAIL PROTECTED]>
> > To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> > Subject: RE: Illegal argument Exception.....
> > Date: Fri, 25 May 2001 15:04:59 -0700
> > MIME-Version: 1.0
> > X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
> >
> > Nope, I used the Constants.String NS_URI_SOAP_ENC  as my Encoding URI,
> which
> > when I do a System.out.println, prints the sorrect URI, with
> the trailing
> > "/". Here's the main chunk of my code....it's very simple, but
> don't know
> > what I'm missing ....?
> >
> >     Call call = new Call();
> >
> >     call.setTargetObjectURI("urn:sessionManagement");
> >     call.setMethodName("signOn");
> >     call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> >         Vector params = new Vector();
> >
> >     params.addElement(new Parameter("acctId", java.lang.String.class,
> >                                     acctId, null));
> >     params.addElement(new Parameter("wirelessId",
> java.lang.String.class,
> >                                     wirelessId, null));
> >     params.addElement(new Parameter("passwd", java.lang.String.class,
> >                                     passwd, null));
> >     params.addElement(new Parameter("softwareVersion",
> > java.lang.String.class,
> >                                     softwareVersion, null));
> >
> >     call.setParams(params);
> >
> >     // Invoke the call.
> >     Response resp;
> >
> >     try
> >     {
> >       resp = call.invoke(url, "");
> >     }
> >     catch (SOAPException e)
> >     {
> >             System.out.println("************ SOAPException caught
> > *************");
> >       System.err.println("Caught SOAPException (" +
> >                          e.getFaultCode() + "): " +
> >                          e.getMessage());
> >       return;
> >     }
> >
> >     // Check the response.
> >     if (!resp.generatedFault())
> >     {
> >       Parameter ret = resp.getReturnValue();
> >       org.w3c.dom.Element accountSignOn =
> > (org.w3c.dom.Element)ret.getValue();
> >
> >       System.out.println(DOM2Writer.nodeToString(accountSignOn));
> >     }
> >     else
> >     {
> >             System.out.println("************* Fault created
> > **************");
> >       Fault fault = resp.getFault();
> >
> >       System.err.println("Generated fault: ");
> >       System.out.println ("  Fault Code   = " + fault.getFaultCode());
> >       System.out.println ("  Fault String = " + fault.getFaultString());
> >     }
> >   }
> >
> > And the exception is in my previous mail......
> >
> > Any hints ?
> >
> >
> > Thanks,
> > Kuntal Das
> > Charles Schwab & Co., Inc.
> > Wireless Technology
> > 45 Fremont, SF
> > Email : [EMAIL PROTECTED]
> > Phone : (415)667-4322
> > Live life to the brim.................
> >
> >
> >
> > -----Original Message-----
> > From: Trang K. Duong [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, May 25, 2001 2:56 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Illegal argument Exception.....
> >
> >
> > Hi Kuntal,
> >
> > Is the exception is at when you use soap client to invoke your remote
> > method?
> > Did you try to explixitly put '/' at the end of the coding style:
> >     "http://schemas.xmlsoap.org/soap/encoding";
> > because I saw this line in your stackTrace.  Adding '/' at the end fixed
> my
> > problem.
> >
> >
> >
> > > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> > > list-help: <mailto:[EMAIL PROTECTED]>
> > > list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> > > list-post: <mailto:[EMAIL PROTECTED]>
> > > Delivered-To: mailing list [EMAIL PROTECTED]
> > > Received-Date: Fri, 25 May 2001 16:41:52 -0400 (EDT)
> > > From: "Das, Kuntal" <[EMAIL PROTECTED]>
> > > To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>,
> > "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> > > Subject: Illegal argument Exception.....
> > > Date: Fri, 25 May 2001 13:41:15 -0700
> > > MIME-Version: 1.0
> > > X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
> > >
> > > Hi all,
> > >       I NEVER GOT ANY ANSWER TO MY PROBLEMS from the
> SOAP-mailing list,
> > i.e.
> > > [EMAIL PROTECTED], and that's why I thought that maybe
> I can get
> > some
> > > help here. Please forgive me if I'm in the wrong place with the wrong
> > > question. Thanks ....
> > >       Here's the scenario. I have a remote SOAP method which
> takes three
> > > string
> > > values as parameters, and returns an Element. And here's where I get
> this
> > > exception :
> > >
> > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > >
> > > org.xml.sax.SAXParseException: The markup in the document
> following the
> > > root ele
> > > ment must be well-formed.
> > >         at org.apache.xerces.framework.XMLParser.reportError
> > > (XMLParser.java:1056
> > > )
> > >         at
> > > org.apache.xerces.framework.XMLDocumentScanner$TrailingMiscDispatcher
> > > .dispatch(XMLDocumentScanner.java, Compiled Code)
> > >         at org.apache.xerces.framework.XMLDocumentScanner.parseSome
> > > (XMLDocumentS
> > > canner.java, Compiled Code)
> > >         at
> org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948)
> > >         at org.apache.soap.util.xml.XercesParserLiaison.read
> > > (XercesParserLiaison
> > > .java:85)
> > >         at org.apache.soap.rpc.Call.invoke(Call.java:157)
> > >         at AccountSignOnClient.main(AccountSignOnClient.java:64)
> > > ************ SOAPException caught *************
> > > Caught SOAPException (SOAP-ENV:Protocol): <h1>Error: 500</h1>
> > > <h2>Location: /soap/servlet/rpcrouter</h2><b>Internal Servlet
> > > Error:</b><br><pre
> > > >javax.servlet.ServletException: Error building response envelope
> > >         at org.apache.soap.server.http.RPCRouterServlet.doPost
> > > (RPCRouterServlet.
> > > java:345)
> > >         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> > >         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >         at org.apache.tomcat.core.ServletWrapper.doService
> > > (ServletWrapper.java:4
> > > 04)
> > >         at org.apache.tomcat.core.Handler.service(Handler.java:286)
> > >         at org.apache.tomcat.core.ServletWrapper.service
> > > (ServletWrapper.java:372
> > > )
> > >         at org.apache.tomcat.core.ContextManager.internalService
> > > (ContextManager.
> > > java:797)
> > >         at org.apache.tomcat.core.ContextManager.service
> > > (ContextManager.java:743
> > > )
> > >         at
> > > org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
> > > n(HttpConnectionHandler.java:210)
> > >         at org.apache.tomcat.service.TcpWorkerThread.runIt
> > > (PoolTcpEndpoint.java:
> > > 416)
> > >         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run
> > > (ThreadPool.java
> > > :498)
> > >         at java.lang.Thread.run(Thread.java:479)
> > > </pre>
> > > <b>Root cause:</b>
> > > <pre>java.lang.IllegalArgumentException: No Serializer found to
> serialize
> > > a 'org
> > > .w3c.dom.Element' using encoding
> > > style 'http://schemas.xmlsoap.org/soap/encoding
> > > /'.
> > >         at
> org.apache.soap.util.xml.XMLJavaMappingRegistry.querySerializer
> > > (XMLJa
> > > vaMappingRegistry.java:125)
> > >         at
> org.apache.soap.encoding.SOAPMappingRegistry.querySerializer
> > > (SOAPMapp
> > > ingRegistry.java:297)
> > >         at
> org.apache.soap.encoding.soapenc.ParameterSerializer.marshall
> > > (Paramet
> > > erSerializer.java:98)
> > >         at
> org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:260)
> > >         at org.apache.soap.Body.marshall(Body.java:141)
> > >         at org.apache.soap.Envelope.marshall(Envelope.java:180)
> > >         at org.apache.soap.server.http.RPCRouterServlet.doPost
> > > (RPCRouterServlet.
> > > java:343)
> > >         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> > >         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >         at org.apache.tomcat.core.ServletWrapper.doService
> > > (ServletWrapper.java:4
> > > 04)
> > >         at org.apache.tomcat.core.Handler.service(Handler.java:286)
> > >         at org.apache.tomcat.core.ServletWrapper.service
> > > (ServletWrapper.java:372
> > > )
> > >         at org.apache.tomcat.core.ContextManager.internalService
> > > (ContextManager.
> > > java:797)
> > >         at org.apache.tomcat.core.ContextManager.service
> > > (ContextManager.java:743
> > > )
> > >         at
> > > org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
> > > n(HttpConnectionHandler.java:210)
> > >         at org.apache.tomcat.service.TcpWorkerThread.runIt
> > > (PoolTcpEndpoint.java:
> > > 416)
> > >         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run
> > > (ThreadPool.java
> > > :498)
> > >         at java.lang.Thread.run(Thread.java:479)
> > > </pre>
> > >
> > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > >
> > > Any help is appreciated....
> > >
> > > Thanks
> > > Kuntal
> > >
> > >
> > > Thanks,
> > > Kuntal Das
> > > Charles Schwab & Co., Inc.
> > > Wireless Technology
> > > 45 Fremont, SF
> > > Email : [EMAIL PROTECTED]
> > > Phone : (415)667-4322
> > > Live life to the brim.................
> > >
> > >
> > >
> > > Thanks,
> > > Kuntal Das
> > > Charles Schwab & Co., Inc.
> > > Wireless Technology
> > > 45 Fremont, SF
> > > Email : [EMAIL PROTECTED]
> > > Phone : (415)667-4322
> > > Live life to the brim.................
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, email: [EMAIL PROTECTED]
> >
> >
> > Trang K Duong
> > [EMAIL PROTECTED]
> >
> >
> > 650-604-3989 (P)       650-604-2238 (F)
> > ELORET - Thermosciences Institute
> > NASA Ames Research Center
> > M/S 258-1
> > Moffett Field, CA 94035-1000
> > http://www.eloret.com/
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
>
>
> Trang K Duong
> [EMAIL PROTECTED]
>
>
> 650-604-3989 (P)         650-604-2238 (F)
> ELORET - Thermosciences Institute
> NASA Ames Research Center
> M/S 258-1
> Moffett Field, CA 94035-1000
> http://www.eloret.com/
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to