You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ParvathyR <pa...@gmail.com> on 2013/07/01 11:42:41 UTC
Re: schema-validation-enabled=true
Jeffrey Knight wrote
> I'm pretty sure my wsdl and xsd are ok. It passes WSI-Compliance in
> SoapUI.
>
> The issue seems to be that I'm neglecting to set a required property
> on an object that then gets serialized.
> So when my code returns and CXF tries to serialize it to XML, it fails
> the validation on the way out.
> But there's no record of what went wrong and the payload comes up blank.
>
> Would it help if I wrote up a test case?
>
>
> On Thu, Mar 3, 2011 at 11:17 PM, Daniel Kulp <
> dkulp@
> > wrote:
>>
>> This sounds like a problem with the wsdl/schema. The runtime should
>> pick up
>> the same schema on the incoming and outgoing sides. Thus, that doesn't
>> sound
>> like the issue. It really does sound like more of a wsdl/schema issues.
>> Like Freeman suggested, check the use of imports where includes should be
>> used
>> and such.
>>
>> Dan
Hi,
We are facing the same issue too. We are on CXF2.4.3 and use SOAPUI as the
client for testing. I tried the same scenario on CXF2.7.6 and faced the same
issue there too.
When schema validation fails for the response, the marshalling error gets
logged in the error log but SOAPUI shows a blank response message.
Parvathy
--
View this message in context: http://cxf.547215.n5.nabble.com/schema-validation-enabled-true-tp3408876p5730112.html
Sent from the cxf-user mailing list archive at Nabble.com.
RE: Question about IdP
Posted by Andrei Shakirin <as...@talend.com>.
Hi,
Could you describe your test case a little bit in details? If application already authenticates user, how you will use SAML token?
What do you understand under SAMLResponse - WS-Trust RequestSecurityTokenResponse?
Normally SAML token is issued by SecurityTokenService in federated scenarios. STS checks user authentication and Proof of Possession.
Is it applicable for your case?
Regards,
Andrei.
> -----Original Message-----
> From: Manasi Lonkar [mailto:manasilonkar@yahoo.com]
> Sent: Montag, 1. Juli 2013 21:09
> To: users@cxf.apache.org
> Subject: Question about IdP
>
> Hello,
>
> I am new to SAML and Apache cxf.
>
> I have a requirement to generate SAMLResponse. The application already
> authenticates the user. The user information is in session. In effect, I do not
> want the IdP to do authentication. What I want it to do is to get the
> information from session and generate the SAMLResponse.
>
>
> Can anybody suggest if this is possible using Apache CXF or Fediz IDP? Where
> can I find documentation/example for this? Is there any other framework
> you can suggest?
>
>
> Thanks for your help,
>
> - Manasi Lonkar
Question about IdP
Posted by Manasi Lonkar <ma...@yahoo.com>.
Hello,
I am new to SAML and Apache cxf.
I have a requirement to generate SAMLResponse. The application already authenticates the user. The user information is in session. In effect, I do not want the IdP to do authentication. What I want it to do is to get the information from session and generate the SAMLResponse.
Can anybody suggest if this is possible using Apache CXF or Fediz IDP? Where can I find documentation/example for this? Is there any other framework you can suggest?
Thanks for your help,
- Manasi Lonkar
Re: schema-validation-enabled=true
Posted by ParvathyR <pa...@gmail.com>.
I might have added my text to the quote in my previous response. Reposting
here:
Hi Dan,
This behaviour was noted for jms services and not for ones exposed over
http. For webservices over http, the marshalling error is shown as part of
the Fault body, while for the same webservice, if I change the transport to
jms in the binding, the fault body that comes up is empty.
Tried with the "org.apache.cxf.output.buffering" set as a jaxws property
in the endpoint configuration, but the issue persists. Would I be missing
something in the configuration here?
I can share the wsdl and the schema files if required too.
I'm including the server log below.
The log shows the Marshalling Error:
2 Jul, 2013 12:07:38 PM org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLogging
WARNING: Interceptor for
{webservices/SampleService/standard/2013/06}SampleService#{webservices/SampleService/standard/2013/06}sampleOperation
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error:
cvc-complex-type.2.4.a: Invalid content was found starting with element
'optionalValue'. One of '{mandatoryValue}' is expected.
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:258)
at
org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:123)
at
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at
org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at
org.apache.cxf.transport.jms.JMSDestination.onMessage(JMSDestination.java:235)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:535)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:495)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.bind.MarshalException
- with linked exception:
[org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was
found starting with element 'optionalValue'. One of '{mandatoryValue}' is
expected.]
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:318)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:172)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:537)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:233)
... 17 more
Parvathy
--
View this message in context: http://cxf.547215.n5.nabble.com/schema-validation-enabled-true-tp3408876p5730157.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: schema-validation-enabled=true
Posted by ParvathyR <pa...@gmail.com>.
Daniel Kulp wrote
> Due to CXF's streaming, if there is any error writing out a message, there
> is not much that can be done to properly recover. You can set a
> property of:
>
> "org.apache.cxf.output.buffering", "true"
>
> on the endpoint to cause it to buffer the output while writing so if there
> is a validation problem it can possibly send an OK fault. However, any
> large messages will consume a LOT of memory.
>
> Normally, I just suggest to make sure you (as the developer) properly fill
> in whatever data is needed and turn off the schema validation for the
> outgoing messages. With the latest versions of CXF, the
> schema-validation can be set for only the incoming messages (that you
> don't have control over). (set the schema-validation property to "in")
>
> Dan
>
>
> Hi Dan,
> This behaviour was noted for jms services and not for ones exposed over
> http. For webservices over http, the marshalling error is shown as part of
> the Fault body, while for the same webservice, if I change the transport
> to jms in the binding, the fault body that comes up is empty.
>
> Tried with the "org.apache.cxf.output.buffering" set as a jaxws property
> in the endpoint configuration, but the issue persists. Would I be missing
> something in the configuration here?
>
>
> I'm including the server log below.
>
> The log shows the Marshalling Error:
> 2 Jul, 2013 12:07:38 PM org.apache.cxf.phase.PhaseInterceptorChain
> doDefaultLogging
> WARNING: Interceptor for
> {webservices/SampleService/standard/2013/06}SampleService#{webservices/SampleService/standard/2013/06}sampleOperation
> has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Marshalling Error:
> cvc-complex-type.2.4.a: Invalid content was found starting with element
> 'optionalValue'. One of '{mandatoryValue}' is expected.
> at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:258)
> at
> org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
> at
> org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:123)
> at
> org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
> at
> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> at
> org.apache.cxf.transport.jms.JMSDestination.onMessage(JMSDestination.java:235)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:535)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:495)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: javax.xml.bind.MarshalException
> - with linked exception:
> [org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content
> was found starting with element 'optionalValue'. One of '{mandatoryValue}'
> is expected.]
> at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:318)
> at
> com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:172)
> at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:537)
> at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:233)
> ... 17 more
>
>
> Parvathy
>
> On Jul 1, 2013, at 5:42 AM, ParvathyR <
> parvthi@
> > wrote:
>
>> Jeffrey Knight wrote
>>> I'm pretty sure my wsdl and xsd are ok. It passes WSI-Compliance in
>>> SoapUI.
>>>
>>> The issue seems to be that I'm neglecting to set a required property
>>> on an object that then gets serialized.
>>> So when my code returns and CXF tries to serialize it to XML, it fails
>>> the validation on the way out.
>>> But there's no record of what went wrong and the payload comes up blank.
>>>
>>> Would it help if I wrote up a test case?
>>>
>>>
>>> On Thu, Mar 3, 2011 at 11:17 PM, Daniel Kulp <
>>
>>> dkulp@
>>
>>> > wrote:
>>>>
>>>> This sounds like a problem with the wsdl/schema. The runtime should
>>>> pick up
>>>> the same schema on the incoming and outgoing sides. Thus, that
>>>> doesn't
>>>> sound
>>>> like the issue. It really does sound like more of a wsdl/schema
>>>> issues.
>>>> Like Freeman suggested, check the use of imports where includes should
>>>> be
>>>> used
>>>> and such.
>>>>
>>>> Dan
>>
>> Hi,
>> We are facing the same issue too. We are on CXF2.4.3 and use SOAPUI as
>> the
>> client for testing. I tried the same scenario on CXF2.7.6 and faced the
>> same
>> issue there too.
>> When schema validation fails for the response, the marshalling error gets
>> logged in the error log but SOAPUI shows a blank response message.
>>
>>
>> Parvathy
>>
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/schema-validation-enabled-true-tp3408876p5730112.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>
> --
> Daniel Kulp
> dkulp@
> - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
--
View this message in context: http://cxf.547215.n5.nabble.com/schema-validation-enabled-true-tp3408876p5730156.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: schema-validation-enabled=true
Posted by Daniel Kulp <dk...@apache.org>.
Due to CXF's streaming, if there is any error writing out a message, there is not much that can be done to properly recover. You can set a property of:
"org.apache.cxf.output.buffering", "true"
on the endpoint to cause it to buffer the output while writing so if there is a validation problem it can possibly send an OK fault. However, any large messages will consume a LOT of memory.
Normally, I just suggest to make sure you (as the developer) properly fill in whatever data is needed and turn off the schema validation for the outgoing messages. With the latest versions of CXF, the schema-validation can be set for only the incoming messages (that you don't have control over). (set the schema-validation property to "in")
Dan
On Jul 1, 2013, at 5:42 AM, ParvathyR <pa...@gmail.com> wrote:
> Jeffrey Knight wrote
>> I'm pretty sure my wsdl and xsd are ok. It passes WSI-Compliance in
>> SoapUI.
>>
>> The issue seems to be that I'm neglecting to set a required property
>> on an object that then gets serialized.
>> So when my code returns and CXF tries to serialize it to XML, it fails
>> the validation on the way out.
>> But there's no record of what went wrong and the payload comes up blank.
>>
>> Would it help if I wrote up a test case?
>>
>>
>> On Thu, Mar 3, 2011 at 11:17 PM, Daniel Kulp <
>
>> dkulp@
>
>> > wrote:
>>>
>>> This sounds like a problem with the wsdl/schema. The runtime should
>>> pick up
>>> the same schema on the incoming and outgoing sides. Thus, that doesn't
>>> sound
>>> like the issue. It really does sound like more of a wsdl/schema issues.
>>> Like Freeman suggested, check the use of imports where includes should be
>>> used
>>> and such.
>>>
>>> Dan
>
> Hi,
> We are facing the same issue too. We are on CXF2.4.3 and use SOAPUI as the
> client for testing. I tried the same scenario on CXF2.7.6 and faced the same
> issue there too.
> When schema validation fails for the response, the marshalling error gets
> logged in the error log but SOAPUI shows a blank response message.
>
>
> Parvathy
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/schema-validation-enabled-true-tp3408876p5730112.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com