(There wasn't the attachment, in the other message...) 1) No, it isn't; 2) I think it's deployed because if I use other service (without custom serializer) they run correctly; 3) The only places where there is the serializer are %CATALINA_HOME%\webapps\soap\WEB-INF\classes and the directory where I compile the code (i.e. F:\j\corso\seria\prova); 4) yes, excuse me, it was a typographical error. ...at this point I don't know what to do. Maybe to re-install Tomcat? However I attach my catalina file so you can see it. Thanx. Stefano Pedon > Some things that come to mind. > > 1. Is DataFeedMessageSerializer in a package? If so, it must be in a > subdirectory of classes. > > 2. Is Apache SOAP deployed to %CATALINA_HOME%\webapps\soap? If not, you > should copy the class file to the correct webapp location. Did you > restart Tomcat after copying the file? > > 3. Is there a DataFeedMessageSerializer any other place that Tomcat > loads from, e.g. %CATALINA_HOME%\classes? If so, remove it and restart > Tomcat. > > 4. Below you said "I tried to place DataFeedMessageSerializer.class in > %CATALINA_HOME% > \webapps\soap\classes". Is that a typographical error? The location > should be %CATALINA_HOME%\webapps\soap\WEB-INF\classes. > > Scott Nichol > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: "soap-user" <[EMAIL PROTECTED]> > Sent: Wednesday, October 16, 2002 3:16 PM > Subject: Re: Help4Problem with custom serializer > > > > Hello Scott, > I tried to place DataFeedMessageSerializer.class in %CATALINA_HOME% > \webapps\soap\classes > but it don't run. Same error. I have implemented the Serializer as > follow: > > public class DataFeedMessageSerializer > implements Serializer, Deserializer > { > > public DataFeedMessageSerializer() > {} > public void marshall(String inScopeEncStyle, Class javaType, Object > src, Object context, Writer sink, > NSStack nsStack, XMLJavaMappingRegistry xjmr, > SOAPContext ctx) > throws IllegalArgumentException, IOException > { > > if(!(src instanceof DataFeedMessage)) { > throw new IllegalArgumentException( > "Posso serializzare solo istanze di DataFeedMessage."); > } > try > { > nsStack.pushScope(); > > if (src != null) > { > SoapEncUtils.generateStructureHeader(inScopeEncStyle, > javaType, context, > sink, nsStack, xjmr); > sink.write(StringUtils.lineSeparator); > > ObjOut out=new ObjOut(new PrintWriter(sink)); > out.writeObject(src); > > ObjOut out2=new ObjOut(); > out2.writeObject(src); > > sink.write("</" + context + '>'); > } > else > { > SoapEncUtils.generateNullStructure(inScopeEncStyle,javaType, > context, > sink, nsStack, xjmr); > } > nsStack.popScope(); > } > catch(Exception e) > { > e.printStackTrace(); > System.err.println(e.toString()); > } > } > > public Bean unmarshall(String inScopeEncStyle, QName elementType, > org.w3c.dom.Node src, > XMLJavaMappingRegistry xjmr, SOAPContext ctx) > throws IllegalArgumentException > { > DataFeedMessage oggetto=null; > StringWriter strout=new StringWriter(); > PrintWriter writer=new PrintWriter(strout); > try > { > ObjOut serializer=new ObjOut(writer); > Element elem = DOMUtils.getFirstChildElement((Element)src); > > System.err.println("***"+src); > serializer.writeObject(elem); > > StringReader lettore = new StringReader(writer.toString()); > > ObjIn in = new ObjIn(lettore); > oggetto= (DataFeedMessage)in.readObject(); > } > catch(Exception e) > { > e.printStackTrace(); > System.err.println(e.toString()); > } > > return new Bean(DataFeedMessage.class, oggetto); > } > } > > I think I respect the interface of Serializer ... or not? > > Stefano Pedon > > > Either the class DataFeedMessageSerializer cannot be loaded by Tomcat > or > > it cannot be cast to Serializer. Assuming is does indeed implement t > he > > Serializer interface, you must put the class file in > > %CATALINA_HOME%\webapps\soap\WEB-INF\classes. > > > > Scott Nichol > > > > ----- Original Message ----- > > From: <[EMAIL PROTECTED]> > > To: "soap-user" <[EMAIL PROTECTED]> > > Sent: Wednesday, October 16, 2002 7:59 AM > > Subject: Help4Problem with custom serializer > > > > > > Hi all, I've a problem with my custom (de) > serializer. I'm using Apache- > > soap2.3.1 & TomCat4.01. > > The client code is: > > .... > > URL url = new URL("http://localhost:8080/soap/servlet/rpcrouter"); > > > > Call call = new Call(); > > > > SOAPMappingRegistry smr = new SOAPMappingRegistry(); > > call.setTargetObjectURI("urn:DataFeedService"); > > call.setMethodName("sendMessage"); > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); > > call.setSOAPMappingRegistry(smr); > > DataFeedMessageSerializer msgSer = new DataFeedMessageSerialize > r > > (); > > > > smr.mapTypes(Constants.NS_URI_SOAP_ENC, > > new QName("urn:DataFeedService", "DataFeedMessage"), > > DataFeedMessage.class, msgSer, msgSer); > > DataFeedMessage msg = new DataFeedMessage(); > > > > Vector params = new Vector(); > > params.addElement(new Parameter("msg", > > DataFeedMessage.class, msg, null)); > > > > call.setParams(params); > > > > try { > > Response resp = call.invoke(url, ""); > > if(!resp.generatedFault()) > > { > > Parameter ret = resp.getReturnValue(); > > Object value = ret.getValue(); > > System.out.println("*\n"+value); > > } > > else > > { > > Fault fault = resp.getFault(); > > System.err.println("--------------------------------"); > > System.err.println("Attention: Fault Condition"); > > System.err.println("Code: "+ fault.getFaultCode()); > > System.err.println("Description: "+ > > fault.getFaultString()); > > System.err.println("--------------------------------"); > > > > } > > > > } > > catch (SOAPException e) { > > System.err.println("Caught SOAPException (" + > > e.getFaultCode() + "): " + > > e.getMessage()); > > } > > } > > .... > > > > and the Deployement Descriptor is: > > <isd:service > > xmlns:isd="http://xml.apache.org/xml-soap/deployment" > > id="urn:DataFeedService"> > > <isd:provider > > type="java" > > scope="Request" > > methods="sendMessage"> > > <isd:java > > class="DataFeedService" > > static="false"/> > > </isd:provider> > > > > <isd:faultListener>org.apache.soap.server.DOMFaultListener > > </isd:faultListener> > > <isd:mappings> > > <isd:map > > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > > xmlns:x="urn:DataFeedService" qname="x:DataFeedMessage" > > javaType="DataFeedMessage" > > xml2JavaClassName="DataFeedMessageSerializer" > > java2XMLClassName="DataFeedMessageSerializer" > > /> > > </isd:mappings> > > </isd:service> > > > > Now, when I run the client, my custom serializer send this: > > > > POST /soap/servlet/rpcrouter HTTP/1.0 > > Host: localhost:8080 > > Content-Type: text/xml; charset=utf-8 > > Content-Length: 524 > > SOAPAction: "" > > > > <?xml version='1.0' encoding='UTF-8'?> > > <SOAP-ENV:Envelope xmlns:SOAP- > > ENV="http://schemas.xmlsoap.org/soap/envelope/" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > <SOAP-ENV:Body> > > <ns1:sendMessage xmlns:ns1="urn:DataFeedService" SOAP- > > ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> > > <msg xsi:type="ns1:DataFeedMessage"> > > <?jsx version="1"?> > > <DataFeedMessage alias-ID="0" > > n="0"/> > > > > </msg> > > </ns1:sendMessage> > > </SOAP-ENV:Body> > > </SOAP-ENV:Envelope> > > > > and, as you can see, I used JSX in my custom (de)serializer > > and "DataFeedMessage" is a generic > > object (not a Javabean). But the response is: > > > > HTTP/1.1 500 Internal Server Error > > Content-Type: text/xml; charset=utf-8 > > Content-Length: 613 > > Date: Wed, 16 Oct 2002 12:21:37 GMT > > Server: Java Web Services Developer Pack/1.0-ea1 (HTTP/1.1 Connector) > > Set-Cookie: JSESSIONID=9D5D04EFBB4F2D38FE2F24808B3C22E7;Path=/soap > > > > <?xml version='1.0' encoding='UTF-8'?> > > <SOAP-ENV:Envelope xmlns:SOAP- > > ENV="http://schemas.xmlsoap.org/soap/envelope/" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > <SOAP-ENV:Body> > > <SOAP-ENV:Fault> > > <faultcode>SOAP-ENV:Client</faultcode> > > <faultstring>Deployment error in SOAP service > > 'urn:DataFeedService': class name > > 'DataFeedMessageSerializer' could not be resolved as a > > serializer: DataFeedMessageSerializer</faultstring> > > <faultactor>/soap/servlet/rpcrouter</faultactor> > > </SOAP-ENV:Fault> > > > > </SOAP-ENV:Body> > > </SOAP-ENV:Envelope> > > > > Maybe I have to change the encoding-style? > > Can you help me? > > Thank you in advance! > > > > Stefano Pedon > > > > > > -- > > To unsubscribe, e-mail: <mailto:soap-user- > [EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:soap-user- > [EMAIL PROTECTED]> > > > > > > > > > > -- > > To unsubscribe, e-mail: <mailto:soap-user- > [EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:soap-user- > [EMAIL PROTECTED]> > > > > > > > -- > To unsubscribe, e-mail: <mailto:soap-user-unsubscribe@;xml.apache.org> > For additional commands, e-mail: <mailto:soap-user-help@;xml.apache.org> > > > > > -- > To unsubscribe, e-mail: <mailto:soap-user-unsubscribe@;xml.apache.org> > For additional commands, e-mail: <mailto:soap-user-help@;xml.apache.org> > >
@set CATALINA_HOME=C:\PROGRA~1\JWSDP-~1 @echo off if "%OS%" == "Windows_NT" setlocal rem --------------------------------------------------------------------------- rem Start/Stop Script for the CATALINA Server rem rem Environment Variable Prequisites rem rem CATALINA_HOME May point at your Catalina "build" directory. rem rem CATALINA_BASE (Optional) Base directory for resolving dynamic portions rem of a Catalina installation. If not present, resolves to rem the same directory that CATALINA_HOME points to. rem rem CATALINA_OPTS (Optional) Java runtime options used when the "start", rem "stop", or "run" command is executed. rem rem JAVA_HOME Must point at your Java Development Kit installation. rem rem JAVA_OPTS (Optional) Java runtime options used when the "start", rem "stop", or "run" command is executed. rem rem JPDA_OPTS (Optional) Java runtime options used when the "jpda start" rem command is executed. rem rem $Id: catalina.bat,v 1.15.2.4 2002/01/15 19:22:27 pluby Exp $ rem --------------------------------------------------------------------------- if not "%CATALINA_HOME%" == "" goto okHome echo The CATALINA_HOME environment variable is not defined echo This environment variable is needed to run this program goto end :okHome rem Get standard environment variables if exist "%CATALINA_HOME%\bin\setenv.bat" goto okSetenv echo Cannot find %CATALINA_HOME%\bin\setenv.bat echo This file is needed to run this program goto end :okSetenv call "%CATALINA_HOME%\bin\setenv.bat" rem Get standard Java environment variables if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath echo Cannot find %CATALINA_HOME%\bin\setclasspath.bat echo This file is needed to run this program goto end :okSetclasspath call "%CATALINA_HOME%\bin\setclasspath.bat" rem Add on extra jar files to CLASSPATH set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_HOME%\common\lib\jcert.jar;%CATALINA_HOME%\common\lib\jnet.jar;%CATALINA_HOME%\common\lib\jsse.jar;%JAVA_HOME%\lib\JSX.jar;%CATALINA_HOME%\common\lib\soap.jar;%CATALINA_HOME%\common\lib\activation.jar set CLASSPATH=%CLASSPATH% if not "%CATALINA_BASE%" == "" goto gotBase set CATALINA_BASE=%CATALINA_HOME% :gotBase rem ----- Execute The Requested Command --------------------------------------- echo Using CATALINA_BASE: %CATALINA_BASE% echo Using CATALINA_HOME: %CATALINA_HOME% echo Using JAVA_HOME: %JAVA_HOME% if not "%1" == "jpda" goto noJpda set CATALINA_OPTS=%CATALINA_OPTS% %JPDA_OPTS% shift :noJpda set _EXECJAVA=%_RUNJAVA% set MAINCLASS=org.apache.catalina.startup.Bootstrap set ACTION=start set SECURITY_PROPS= set DEBUG_OPTS= if ""%1"" == ""debug"" goto doDebug if ""%1"" == ""embedded"" goto doEmbedded if ""%1"" == ""run"" goto doRun if ""%1"" == ""start"" goto doStart if ""%1"" == ""stop"" goto doStop echo Usage: catalina ( commands ... ) echo commands: echo debug Start Catalina in a debugger echo debug -security Debug Catalina with a security manager echo embedded Start Catalina in embedded mode echo jpda start Start Catalina under JPDA debugger echo run Start Catalina in the current window echo run -security Start in the current window with security manager echo start Start Catalina in a separate window echo start -security Start in a separate window with security manager echo stop Stop Catalina goto end :doDebug shift set _EXECJAVA=%_RUNJDB% set DEBUG_OPTS=-sourcepath "%CATALINA_HOME%\..\..\jakarta-tomcat-4.0\catalina\src\share" if not ""%1"" == ""-security"" goto execCmd shift echo Using Security Manager set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy goto execCmd :doEmbedded shift set MAINCLASS=org.apache.catalina.startup.Embedded goto execCmd :doRun shift if not ""%1"" == ""-security"" goto execCmd shift echo Using Security Manager set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy goto execCmd :doStart shift if not "%OS%" == "Windows_NT" goto noTitle set _EXECJAVA=start "Tomcat" %_RUNJAVA% goto gotTitle :noTitle set _EXECJAVA=start %_RUNJAVA% :gotTitle if not ""%1"" == ""-security"" goto execCmd shift echo Using Security Manager set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy goto execCmd :doStop shift set ACTION=stop goto execCmd :execCmd rem Get remaining unshifted command line arguments and save them in the set CMD_LINE_ARGS= :setArgs if ""%1""=="""" goto doneSetArgs set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 shift goto setArgs :doneSetArgs rem Execute Java with the applicable properties if exist "%SECURITY_POLICY_FILE%" goto doSecurity %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Xbootclasspath/p:"%BOOTCLASSPATHP%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% goto end :doSecurity %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Xbootclasspath/p:"%BOOTCLASSPATHP%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy==%SECURITY_POLICY_FILE% -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% goto end :end
-- To unsubscribe, e-mail: <mailto:soap-user-unsubscribe@;xml.apache.org> For additional commands, e-mail: <mailto:soap-user-help@;xml.apache.org>