cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Exception while receiving response from SOAP service.
Date Thu, 11 Sep 2008 17:54:45 GMT

What JDK version are you using?   I've seen this with versions between 
1.5.0_06 and 1.5.0_12.   (The jax-ws TCK doesn't pass with CXF with those 
versions due to this bug in the XML stuff in the JDK)

Dan


On Thursday 11 September 2008 2:30:30 am t-hunter wrote:
> Hi,
>
> I'm using CXF to call a web service, which gives me xml response.
> But I'm getting exception, can anybody please help me.
>
> Here is my code .
>
>
> import java.io.FileInputStream;
> import java.io.InputStream;
>
> import javax.xml.namespace.QName;
> import javax.xml.transform.Source;
> import javax.xml.transform.stream.StreamSource;
> import javax.xml.ws.Dispatch;
> import javax.xml.ws.Service;
> import javax.xml.ws.Service.Mode;
> import javax.xml.ws.soap.SOAPBinding;
>
> import org.apache.cxf.helpers.XMLUtils;
>
> public class Test {
>
> 	public static void main(String args[]) throws Exception
> 	{
> 				final long time = System.currentTimeMillis();
> 				QName portName = new
> QName("http://com.project.my/my","ServiceEndpoint");
> 		        QName serviceName = new
> QName("http://com.project.my/my","Service");
>
> 		        Service serviceInstance = Service.create( serviceName);
> 				serviceInstance.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING,
> "http://150.123.78.39:8192/Service/");
> 				Dispatch<Source> dispSourceMsg =
> serviceInstance.createDispatch(portName, Source.class, Mode.PAYLOAD);
>
> 				InputStream requestStream = new FileInputStream("D:/REQ.xml");
>
> 				Source req = new StreamSource(requestStream);
>
> 				Source resp = dispSourceMsg.invoke(req);
>
> 				System.out.print("\tTime taken: "+(System.currentTimeMillis()-time)+"
> ms");
> 			    System.out.println(XMLUtils.toString(resp));
> 	}
>
> }
>
> When I'm running this, it's hitting the service but I'm not able to receive
> response
>
> I'm getting this exception
>
>   Sep 11, 2008 11:50:18 AM
> org.apache.cxf.configuration.spring.ConfigurerImpl getBeanName
> INFO: Could not determine bean name for instance of class
> org.apache.cxf.jaxws.DispatchImpl.
> ERROR:  'NAMESPACE_ERR: An attempt is made to create or change an object in
> a way which is incorrect with regard to namespaces.'
> Sep 11, 2008 11:50:22 AM com.sun.xml.messaging.saaj.soap.EnvelopeFactory
> createEnvelope
> SEVERE: SAAJ0511: Unable to create envelope from given source
> Sep 11, 2008 11:50:22 AM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Unable to create envelope from given
> source:
> 	at
> org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMe
>ssage(DispatchInDatabindingInterceptor.java:182) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>n.java:220) at
> org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:332) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespons
>e(HTTPConduit.java:2029) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCon
>duit.java:1865) at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:593) at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInte
>rceptor.handleMessage(MessageSenderInterceptor.java:62) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>n.java:220) at
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:179) at
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:124) at
> Test.main(Test.java:30)
> Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create
> envelope from given source:
> 	at
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFact
>ory.java:114) at
> com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSo
>urce(SOAPPart1_1Impl.java:71) at
> com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:
>125) at
> org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMe
>ssage(DispatchInDatabindingInterceptor.java:126) ... 11 more
> Caused by: javax.xml.transform.TransformerException:
> org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or
> change an object in a way which is incorrect with regard to namespaces.
> 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unkn
>own Source)
> 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unkn
>own Source)
> 	at
> com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransformer.tra
>nsform(EfficientStreamingTransformer.java:390) at
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFact
>ory.java:102) ... 14 more
> Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to
> create or change an object in a way which is incorrect with regard to
> namespaces.
> 	at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(Unknown
> Source)
> 	at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(Unknown
> Source) at
> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(U
>nknown Source)
> 	at
> com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.createAttributeNS(SOAPDocu
>mentImpl.java:161) at
> com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(Unknown
> Source)
> 	at
> com.sun.xml.messaging.saaj.soap.impl.ElementImpl.setAttributeNS(ElementImpl
>.java:1213) at
> com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.startElement(Unknown
> Source)
> 	at
> com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.closeStartTag(Un
>known Source)
> 	at
> com.sun.org.apache.xml.internal.serializer.ToSAXHandler.flushPending(Unknow
>n Source)
> 	at
> com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.startElement(Unk
>nown Source)
> 	at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
> 	at
> com.sun.xml.messaging.saaj.util.RejectDoctypeSaxFilter.startElement(RejectD
>octypeSaxFilter.java:176) at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(U
>nknown Source)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartE
>lement(Unknown Source)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Frag
>mentContentDispatcher.dispatch(Unknown Source)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scan
>Document(Unknown Source)
> 	at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
> 	at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
> Source)
> 	at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
> Source)
> 	at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
> 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdent
>ity(Unknown Source)
> 	... 18 more
> Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Unable to
> create envelope from given source:
> 	at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:194)
> 	at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:124)
> 	at Test.main(Test.java:30)
> Caused by: org.apache.cxf.interceptor.Fault: Unable to create envelope from
> given source:
> 	at
> org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMe
>ssage(DispatchInDatabindingInterceptor.java:182) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>n.java:220) at
> org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:332) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespons
>e(HTTPConduit.java:2029) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCon
>duit.java:1865) at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:593) at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInte
>rceptor.handleMessage(MessageSenderInterceptor.java:62) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>n.java:220) at
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:179) ... 2 more
> Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create
> envelope from given source:
> 	at
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFact
>ory.java:114) at
> com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSo
>urce(SOAPPart1_1Impl.java:71) at
> com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:
>125) at
> org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMe
>ssage(DispatchInDatabindingInterceptor.java:126) ... 11 more
> Caused by: javax.xml.transform.TransformerException:
> org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or
> change an object in a way which is incorrect with regard to namespaces.
> 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unkn
>own Source)
> 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unkn
>own Source)
> 	at
> com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransformer.tra
>nsform(EfficientStreamingTransformer.java:390) at
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFact
>ory.java:102) ... 14 more
> Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to
> create or change an object in a way which is incorrect with regard to
> namespaces.
> 	at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(Unknown
> Source)
> 	at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(Unknown
> Source) at
> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(U
>nknown Source)
> 	at
> com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.createAttributeNS(SOAPDocu
>mentImpl.java:161) at
> com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(Unknown
> Source)
> 	at
> com.sun.xml.messaging.saaj.soap.impl.ElementImpl.setAttributeNS(ElementImpl
>.java:1213) at
> com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.startElement(Unknown
> Source)
> 	at
> com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.closeStartTag(Un
>known Source)
> 	at
> com.sun.org.apache.xml.internal.serializer.ToSAXHandler.flushPending(Unknow
>n Source)
> 	at
> com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.startElement(Unk
>nown Source)
> 	at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
> 	at
> com.sun.xml.messaging.saaj.util.RejectDoctypeSaxFilter.startElement(RejectD
>octypeSaxFilter.java:176) at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(U
>nknown Source)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartE
>lement(Unknown Source)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Frag
>mentContentDispatcher.dispatch(Unknown Source)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scan
>Document(Unknown Source)
> 	at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
> 	at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
> Source)
> 	at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
> Source)
> 	at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
> 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdent
>ity(Unknown Source)
> 	... 18 more
>
>
>
> List of jars I'm using are,
>
> abdera-core-0.4.0-incubating.jar
> abdera-extensions-json-0.4.0-incubating.jar
> abdera-extensions-main-0.4.0-incubating.jar
> abdera-i18n-0.4.0-incubating.jar
> abdera-parser-0.4.0-incubating.jar
> ant-1.6.5.jar
> antlr-2.7.7.jar
> aopalliance-1.0.jar
> asm-2.2.3.jar
> axiom-api-1.2.7.jar
> axiom-impl-1.2.7.jar
> commons-codec-1.3.jar
> commons-httpclient-3.1.jar
> commons-lang-2.4.jar
> commons-logging-1.1.1.jar
> cxf-2.1.2.jar
> cxf-manifest.jar
> FastInfoset-1.2.2.jar
> geronimo-activation_1.1_spec-1.0.2.jar
> geronimo-annotation_1.0_spec-1.1.1.jar
> geronimo-javamail_1.4_spec-1.3.jar
> geronimo-jaxws_2.1_spec-1.0.jar
> geronimo-jms_1.1_spec-1.1.1.jar
> geronimo-servlet_2.5_spec-1.2.jar
> geronimo-stax-api_1.0_spec-1.0.1.jar
> geronimo-ws-metadata_2.0_spec-1.1.2.jar
> jaxb-api-2.1.jar
> jaxb-impl-2.1.7.jar
> jaxb-xjc-2.1.7.jar
> jaxen-1.1.jar
> jdom-1.0.jar
> jettison-1.0.1.jar
> jetty-6.1.9.jar
> jetty-util-6.1.9.jar
> jra-1.0-alpha-4.jar
> js-1.6R7.jar
> jsr311-api-0.8.jar
> neethi-2.0.4.jar
> opensaml-1.1.jar
> saaj-api-1.3.jar
> saaj-impl-1.3.jar
> slf4j-api-1.3.1.jar
> slf4j-jdk14-1.3.1.jar
> spring-beans-2.0.8.jar
> spring-context-2.0.8.jar
> spring-core-2.0.8.jar
> spring-web-2.0.8.jar
> stax-utils-20060502.jar
> velocity-1.4.jar
> velocity-dep-1.4.jar
> WHICH_JARS
> wsdl4j-1.6.2.jar
> wss4j-1.5.4.jar
> wstx-asl-3.2.4.jar
> xml-resolver-1.2.jar
> xmlbeans-2.3.0.jar
> XmlSchema-1.4.2.jar
> xmlsec-1.4.0.jar



-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message