Hi All,

I was trying to invoke a webservice with CXF client using dynamic client
approach but failing with following exception

Exception in thread "main" java.lang.RuntimeException:
org.apache.cxf.binding.soap.SoapFault: Unmarshalling Error: cvc-elt.4.3:
Type 'xs:string' is not validly derived from the type definition,
'getAlertDataRequest', of element 'ns2:getAlertDataRequest'.

Caused by: org.apache.cxf.binding.soap.SoapFault: Unmarshalling Error:
cvc-elt.4.3: Type 'xs:string' is not validly derived from the type
definition, 'getAlertDataRequest', of element 'ns2:getAlertDataRequest'. 
        at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)
        at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
        at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
        at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:99)
        at
org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
        at
org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
        at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:672)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2254)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2134)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1988)
        at
org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
        at 
org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188)
        at 
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
        at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639)
        at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:484)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:310)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:262)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:282)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:268)



However the webservice invocation is fine with soapUI.

On investigation I found that, the request (soap) message sent was not
correct:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>

<soap:Body>

<ns2:getAlertDataRequest xmlns:ns2="http://ws.alerts.sbm.savvion.com/";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="xs:string">

ebms

</ns2:getAlertDataRequest>

</soap:Body>

</soap:Envelope>

 

Instead it should be:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>

<soap:Body>

<ns2:getAlertDataRequest xmlns:ns2="http://ws.alerts.sbm.savvion.com/";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="xs:string">

<user>ebms</user>

</ns2:getAlertDataRequest>

</soap:Body>

</soap:Envelope>


I am not able to findout, why CXF client request message does not contain
<user> </user> inside </ns2:getAlertDataRequest>.

Any help appreciated.

Thanks

--
View this message in context: 
http://cxf.547215.n5.nabble.com/Problem-with-CXF-tp4341066p4341066.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to