Stefano, The proper way to install Apache SOAP on Tomcat 4 is at http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-soap/java/docs/install/ tomcat.html. All you need to do is copy soap.war to %CATALINA_HOME%\webapps.
Please undo the changes you made to catalina.bat, remove soap.jar from %CATALINA_HOME%\common\lib and copy JSX.jar to %CATALINA_HOME%\lib. See http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html for more information on Tomcat's class loaders. Scott Nichol ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "soap-user" <[EMAIL PROTECTED]> Sent: Thursday, October 17, 2002 10:27 AM Subject: Re: Help4Problem with custom serializer (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> > > ------------------------------------------------------------------------ -------- > -- > 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>