Hi David, I guess I will need something to play around a bit in order to have a full understanding of what's going wrong. But I have got a few questions first:
a) Are you using a mapping file ? Or b) Did you start with an XML schema and generate domain/descriptor classes from it ? Having said that, looking at the stack trace, you might be right with you initial assessment about Castor not knowing about the SOAP-ENV namespace (prefix) at unmarshalling time. One general observation as well: looking at some (fully qualified) class names in the (quite complete) stack trace, it looks like you are using DOM (rather than SAX for (un-)marshalling. That would be an issue to me .... Regards Werner Read, David wrote: > Good day, > > I am successfully using Castor to marshall data to a SOAP endpoint. The > endpoint accepts the data, runs its processing and returns what appears > to be a valid response. However, Castor throws and unmarshalling > exception. > > I am on Java 1.4 using Castor 1.2, Spring WS 1.5.2, Spring Core 2.5.4, > and Axoim 1.2 6. > > I noticed that the last line before the exception is: > > 2008-06-11 19:14:54,437 [Thread-00000] (UnmarshalHandler.java:1434) > DEBUG org.exolab.castor.xml.UnmarshalHandler - #startElement: > ns:AgentRegisterResponse > > So it seems that something doesn't like the SOAP-ENV namespace being > used within the Body. > > Here is the response I am receiving: > > <SOAP-ENV:Envelope > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:ns="urn:RuleEngine:SOAP:TI:Event"> > <SOAP-ENV:Body> > <ns:AgentRegisterResponse > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> > </ns:AgentRegisterResponse> > </SOAP-ENV:Body> > </SOAP-ENV:Envelope> > > And the stack trace: > > org.springframework.oxm.castor.CastorUnmarshallingFailureException: > Castor unmarshalling exception: The namespace associated with the prefix > 'SOAP-ENV' could not be resolved.; nested exception is > org.exolab.castor.xml.MarshalException: The namespace associated with > the prefix 'SOAP-ENV' could not be resolved. > at > org.springframework.oxm.castor.CastorUtils.convertXmlException(CastorUti > ls.java:50) > at > org.springframework.oxm.castor.CastorMarshaller.convertCastorException(C > astorMarshaller.java:431) > at > org.springframework.oxm.castor.CastorMarshaller.unmarshalDomNode(CastorM > arshaller.java:335) > at > org.springframework.oxm.AbstractMarshaller.unmarshalDomSource(AbstractMa > rshaller.java:292) > at > org.springframework.oxm.AbstractMarshaller.unmarshal(AbstractMarshaller. > java:122) > at > org.springframework.ws.support.MarshallingUtils.unmarshal(MarshallingUti > ls.java:65) > at > org.springframework.ws.client.core.WebServiceTemplate$2.extractData(WebS > erviceTemplate.java:337) > at > org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(W > ebServiceTemplate.java:523) > at > org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(Web > ServiceTemplate.java:465) > at > org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndRece > ive(WebServiceTemplate.java:314) > at > org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndRece > ive(WebServiceTemplate.java:308) > at > com.ba.servicegovernor.webservice.WorkflowServiceGateway.sendPhoneReques > t(WorkflowServiceGateway.java:130) > at > com.ba.servicegovernor.webservice.WorkflowServiceGateway.sendRequest(Wor > kflowServiceGateway.java:63) > at > com.ba.servicegovernor.handler.EventHandler.sendToWorkflow(EventHandler. > java:175) > at > com.ba.servicegovernor.handler.EventHandler.processEvent(EventHandler.ja > va:151) > at > com.ba.servicegovernor.handler.EventHandler.run(EventHandler.java:117) > at > com.ba.servicegovernor.thread.ReusableThread.run(ReusableThread.java:160 > ) > Caused by: org.exolab.castor.xml.MarshalException: The namespace > associated with the prefix 'SOAP-ENV' could not be resolved. > at > org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException > (Unmarshaller.java:761) > at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:640) > at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:747) > at > org.springframework.oxm.castor.CastorMarshaller.unmarshalDomNode(CastorM > arshaller.java:332) > ... 14 more > Caused by: org.xml.sax.SAXException: The namespace associated with the > prefix 'SOAP-ENV' could not be resolved. > at > org.exolab.castor.xml.UnmarshalHandler.processAttributeList(UnmarshalHan > dler.java:3321) > at > org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav > a:1471) > at > org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.jav > a:246) > at > org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.jav > a:183) > at > org.exolab.castor.xml.util.DOMEventProducer.start(DOMEventProducer.java: > 111) > at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:637) > ... 16 more > > > I appreciate any guidance you can provide on where to look for a root > cause. > > Thank you, > > -Dave > > > > > > This e-mail and any files transmitted with it are for the sole use of > Blue Slate Solutions and the intended recipient(s) and may contain > confidential and privileged information. If you are not the intended > recipient, please contact the sender by reply e-mail and destroy all > copies of the original message. Any unauthorized review, use, > disclosure, dissemination, forwarding, printing or copying of this email > or any action taken in reliance on this e-mail is strictly prohibited > and may be unlawful. > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

