You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by carloc <ca...@yahoo.com> on 2008/08/09 22:20:49 UTC

How TO Handle Messages With No SOAP ENvelope

Hi  Everyone, 

I'm gettngs this exception.

org.apache.cxf.interceptor.Fault: Unable to create envelope from given
source: 
	at
org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMessage(DispatchInDatabindingInterceptor.java:182)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
	at org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:332)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
	at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:179)
	at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:124)
	at com.sxi.test.Dispatcher.main(Dispatcher.java:41)
Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create
envelope from given source: 
	at
com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:114)
	at
com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:71)
	at
com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122)
	at
org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMessage(DispatchInDatabindingInterceptor.java:126)
	... 11 more
Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create
envelope from given source because the root element is not named "Envelope"
	at
com.sun.xml.messaging.saaj.soap.SOAPPartImpl.lookForEnvelope(SOAPPartImpl.java:151)
	at
com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:118)
	at
com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:104)
	... 14 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 com.sxi.test.Dispatcher.main(Dispatcher.java:41)
Caused by: org.apache.cxf.interceptor.Fault: Unable to create envelope from
given source: 
	at
org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMessage(DispatchInDatabindingInterceptor.java:182)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
	at org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:332)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
	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(EnvelopeFactory.java:114)
	at
com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:71)
	at
com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122)
	at
org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMessage(DispatchInDatabindingInterceptor.java:126)
	... 11 more

The output message I'm getting starts like this

<?xml version = "1.0" encoding = "UTF-8"?>
<outputMessage>
	<cbl:SERVICEOUTPUTAREA xmlns:SOAP-ENV =
"http://schemas.xmlsoap.org/soap/envelope/" xmlns:cbl =
"http://www.DFHMADPL.0.Response.com">
		<dfhmah>

it's not container in a soap envelope.
Is there any way to fix this?
-- 
View this message in context: http://www.nabble.com/How-TO-Handle-Messages-With-No-SOAP-ENvelope-tp18908079p18908079.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How TO Handle Messages With No SOAP ENvelope

Posted by Benson Margulies <bi...@gmail.com>.
CXF includes a strange thing called the XML binding. It does raw XML over
SOAP. I don't know how to use it in only one direction, only in both
directions. It's described in the documentation.
http://cwiki.apache.org/CXF20DOC/pure-xml.html



On Sun, Aug 10, 2008 at 2:22 PM, Christian Schneider <
chris@die-schneider.net> wrote:

> Glen Mazza schrieb:
>
>> carloc wrote:
>>
>>
>>> it's not container in a soap envelope.
>>> Is there any way to fix this?
>>>
>>>
>>>
>>
>> To handle non-SOAP responses I would say would be beyond the scope of CXF,
>> because at that stage, how the response would be handled would just be
>> guesswork (no specification available to tell us what to do)  While I
>> think
>> WSDL has a few non-SOAP bindings, I'm not sure of CXF's support for them.
>>
>> Nonetheless, what you're trying to do might just be POX (plain old XML)
>> even
>> though the request is in a SOAP envelope (which is XML anyway).  I would
>> google CXF and POX--actually, to expand your returns, also Metro and POX.
>>
>> Glen
>>
>>
>>
> If you do not need soap then perhaps apache camel could be of use for you.
> They have many binding possibilities. You can even combine it with cxf if
> some of your bindings are soap and some not.
>
> Best regards
>
> Christian
>
>

Re: How TO Handle Messages With No SOAP ENvelope

Posted by Christian Schneider <ch...@die-schneider.net>.
Glen Mazza schrieb:
> carloc wrote:
>   
>> it's not container in a soap envelope.
>> Is there any way to fix this?
>>
>>     
>
> To handle non-SOAP responses I would say would be beyond the scope of CXF,
> because at that stage, how the response would be handled would just be
> guesswork (no specification available to tell us what to do)  While I think
> WSDL has a few non-SOAP bindings, I'm not sure of CXF's support for them.
>
> Nonetheless, what you're trying to do might just be POX (plain old XML) even
> though the request is in a SOAP envelope (which is XML anyway).  I would
> google CXF and POX--actually, to expand your returns, also Metro and POX.
>
> Glen
>
>   
If you do not need soap then perhaps apache camel could be of use for 
you. They have many binding possibilities. You can even combine it with 
cxf if some of your bindings are soap and some not.

Best regards

Christian


Re: How TO Handle Messages With No SOAP ENvelope

Posted by Glen Mazza <gl...@gmail.com>.

carloc wrote:
> 
> it's not container in a soap envelope.
> Is there any way to fix this?
> 

To handle non-SOAP responses I would say would be beyond the scope of CXF,
because at that stage, how the response would be handled would just be
guesswork (no specification available to tell us what to do)  While I think
WSDL has a few non-SOAP bindings, I'm not sure of CXF's support for them.

Nonetheless, what you're trying to do might just be POX (plain old XML) even
though the request is in a SOAP envelope (which is XML anyway).  I would
google CXF and POX--actually, to expand your returns, also Metro and POX.

Glen

-- 
View this message in context: http://www.nabble.com/How-TO-Handle-Messages-With-No-SOAP-ENvelope-tp18908079p18910537.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How TO Handle Messages With No SOAP ENvelope

Posted by Daniel Kulp <dk...@apache.org>.
How are you creating the Dispatch object you are using?

If it's the normal:
Service service = new Service();
service.addPort(...);
Dispatch disp = service.createDispatch(portName,...)

When you call "addPort", use:
"http://www.w3.org/2004/08/wsdl/http"
for the binding ID.

Dan



On Saturday 09 August 2008 4:20:49 pm carloc wrote:
> Hi  Everyone,
>
> I'm gettngs this exception.
>
> 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:221) at
> org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:332) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespons
>e(HTTPConduit.java:1996) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCon
>duit.java:1832) at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591) at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInte
>rceptor.handleMessage(MessageSenderInterceptor.java:62) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>n.java:221) at
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:179) at
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:124) at
> com.sxi.test.Dispatcher.main(Dispatcher.java:41)
> 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:
>122) at
> org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMe
>ssage(DispatchInDatabindingInterceptor.java:126) ... 11 more
> Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create
> envelope from given source because the root element is not named "Envelope"
> 	at
> com.sun.xml.messaging.saaj.soap.SOAPPartImpl.lookForEnvelope(SOAPPartImpl.j
>ava:151) at
> com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:
>118) at
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFact
>ory.java:104) ... 14 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 com.sxi.test.Dispatcher.main(Dispatcher.java:41)
> 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:221) at
> org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:332) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespons
>e(HTTPConduit.java:1996) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCon
>duit.java:1832) at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591) at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInte
>rceptor.handleMessage(MessageSenderInterceptor.java:62) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>n.java:221) 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:
>122) at
> org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor.handleMe
>ssage(DispatchInDatabindingInterceptor.java:126) ... 11 more
>
> The output message I'm getting starts like this
>
> <?xml version = "1.0" encoding = "UTF-8"?>
> <outputMessage>
> 	<cbl:SERVICEOUTPUTAREA xmlns:SOAP-ENV =
> "http://schemas.xmlsoap.org/soap/envelope/" xmlns:cbl =
> "http://www.DFHMADPL.0.Response.com">
> 		<dfhmah>
>
> it's not container in a soap envelope.
> Is there any way to fix this?



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