You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Gagnon, David" <Da...@iaah.ca> on 2013/02/06 20:27:00 UTC
Look like CXF expects wrong namespace for this request ....
Hi All,
I just started with CXF, So I anyone can help me solving that issues...
I get a fault for the following request complaining that XXXX:EL1 shall in fact be from the namespace https://yyyy.com/Services/.
I included the WSDL below. It`s probably a misunderstood from my part regarding namespace. But this example comes from a production env and the request is generated using SoapUi...
I rather not disable the validation.
Is anyone can tell me where exactly is my mistake or how I can have CXF accepts this request ?
Thanks for your help
David
REQUEST
---------------------------------------------------------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ser="https://yyyy.com/Services/"
xmlns:xxxx="http://www.xxx.ca/WS/XXXX">
<soapenv:Header/>
<soapenv:Body>
<ser:Request>
<xxxx:EL1/>
</ser:Request>
</soapenv:Body>
</soapenv:Envelope>
RESPONSE FAULT
---------------------------------------------------------------------------
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element 'xxxx:EL1'. One of '{"https://yyyy.com/Services/":EL1}' is expected.</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
WSDL
------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s1="http://www.xxx.ca/WS/XXXX" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:tns="https://yyyy.com/Services/"
targetNamespace="https://yyyy.com/Services/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="https://yyyy.com/Services/">
<s:import namespace="http://www.xxx.ca/WS/XXXX" />
<s:element name="Request">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" ref="s1:EL1" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Response">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="RequestResult" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.xxx.ca/WS/XXXX">
<s:element name="EL1" type="s1:EL1" />
<s:complexType name="EL1">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="EL2" type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>
<wsdl:message name="RequestSoapIn">
<wsdl:part name="parameters" element="tns:Request" />
</wsdl:message>
<wsdl:message name="RequestSoapOut">
<wsdl:part name="parameters" element="tns:Response" />
</wsdl:message>
<wsdl:portType name="WSSoap">
<wsdl:operation name="Request">
<wsdl:input message="tns:RequestSoapIn" />
<wsdl:output message="tns:RequestSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WSSoap" type="tns:WSSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="Request">
<soap:operation soapAction="https://yyyy.com/Services/Request" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TestService">
<wsdl:port name="WSSoap" binding="tns:WSSoap">
<soap:address location="https://xxx.com/OnlineServices/Service" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Re: Look like CXF expects wrong namespace for this request ....
Posted by Daniel Kulp <dk...@apache.org>.
On Feb 6, 2013, at 2:27 PM, "Gagnon, David" <Da...@iaah.ca> wrote:
> I just started with CXF, So I anyone can help me solving that issues…
If you are using code generated from the WSDL using the CXF wsdl2java tool for both server and client, then this would be completely down inside the JAXB runtime on the server side. I would definitely check the stack traces and such there.
You don't mention what version of CXF you are using. Older versions of CXF had older versions of JAXB included that did have some issues related to element references. Definitely make sure you are using the latest 2.7.3.
Dan
>
> I get a fault for the following request complaining that XXXX:EL1 shall in fact be from the namespace https://yyyy.com/Services/.
>
> I included the WSDL below. It`s probably a misunderstood from my part regarding namespace. But this example comes from a production env and the request is generated using SoapUi...
>
> I rather not disable the validation.
>
> Is anyone can tell me where exactly is my mistake or how I can have CXF accepts this request ?
>
> Thanks for your help
>
> David
>
>
> REQUEST
> ---------------------------------------------------------------------------
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:ser="https://yyyy.com/Services/"
> xmlns:xxxx="http://www.xxx.ca/WS/XXXX">
> <soapenv:Header/>
> <soapenv:Body>
> <ser:Request>
> <xxxx:EL1/>
> </ser:Request>
> </soapenv:Body>
> </soapenv:Envelope>
>
>
> RESPONSE FAULT
> ---------------------------------------------------------------------------
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body>
> <soap:Fault>
> <faultcode>soap:Client</faultcode>
> <faultstring>Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element 'xxxx:EL1'. One of '{"https://yyyy.com/Services/":EL1}' is expected.</faultstring>
> </soap:Fault>
> </soap:Body>
> </soap:Envelope>
>
>
> WSDL
> ------------------------------------------------------------
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions xmlns:s1="http://www.xxx.ca/WS/XXXX" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:s="http://www.w3.org/2001/XMLSchema"
> xmlns:tns="https://yyyy.com/Services/"
> targetNamespace="https://yyyy.com/Services/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
> <wsdl:types>
> <s:schema elementFormDefault="qualified" targetNamespace="https://yyyy.com/Services/">
> <s:import namespace="http://www.xxx.ca/WS/XXXX" />
> <s:element name="Request">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" ref="s1:EL1" />
> </s:sequence>
> </s:complexType>
> </s:element>
> <s:element name="Response">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="1" maxOccurs="1" name="RequestResult" type="s:int" />
> </s:sequence>
> </s:complexType>
> </s:element>
> </s:schema>
> <s:schema elementFormDefault="qualified" targetNamespace="http://www.xxx.ca/WS/XXXX">
> <s:element name="EL1" type="s1:EL1" />
> <s:complexType name="EL1">
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="EL2" type="s:string" />
> </s:sequence>
> </s:complexType>
> </s:schema>
> </wsdl:types>
> <wsdl:message name="RequestSoapIn">
> <wsdl:part name="parameters" element="tns:Request" />
> </wsdl:message>
> <wsdl:message name="RequestSoapOut">
> <wsdl:part name="parameters" element="tns:Response" />
> </wsdl:message>
> <wsdl:portType name="WSSoap">
> <wsdl:operation name="Request">
> <wsdl:input message="tns:RequestSoapIn" />
> <wsdl:output message="tns:RequestSoapOut" />
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="WSSoap" type="tns:WSSoap">
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
> <wsdl:operation name="Request">
> <soap:operation soapAction="https://yyyy.com/Services/Request" style="document" />
> <wsdl:input>
> <soap:body use="literal" />
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal" />
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="TestService">
> <wsdl:port name="WSSoap" binding="tns:WSSoap">
> <soap:address location="https://xxx.com/OnlineServices/Service" />
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: Look like CXF expects wrong namespace for this request ....
Posted by Freeman Fang <fr...@gmail.com>.
Hi,
You can use CXF transform feature to change the namespace for incoming soap message, take a look at [1] to get more details.
[1]http://cxf.apache.org/docs/transformationfeature.html
-------------
Freeman(Yue) Fang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋
On 2013-2-7, at 上午3:27, Gagnon, David wrote:
> Hi All,
>
> I just started with CXF, So I anyone can help me solving that issues...
>
> I get a fault for the following request complaining that XXXX:EL1 shall in fact be from the namespace https://yyyy.com/Services/.
>
> I included the WSDL below. It`s probably a misunderstood from my part regarding namespace. But this example comes from a production env and the request is generated using SoapUi...
>
> I rather not disable the validation.
>
> Is anyone can tell me where exactly is my mistake or how I can have CXF accepts this request ?
>
> Thanks for your help
>
> David
>
>
> REQUEST
> ---------------------------------------------------------------------------
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:ser="https://yyyy.com/Services/"
> xmlns:xxxx="http://www.xxx.ca/WS/XXXX">
> <soapenv:Header/>
> <soapenv:Body>
> <ser:Request>
> <xxxx:EL1/>
> </ser:Request>
> </soapenv:Body>
> </soapenv:Envelope>
>
>
> RESPONSE FAULT
> ---------------------------------------------------------------------------
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body>
> <soap:Fault>
> <faultcode>soap:Client</faultcode>
> <faultstring>Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element 'xxxx:EL1'. One of '{"https://yyyy.com/Services/":EL1}' is expected.</faultstring>
> </soap:Fault>
> </soap:Body>
> </soap:Envelope>
>
>
> WSDL
> ------------------------------------------------------------
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions xmlns:s1="http://www.xxx.ca/WS/XXXX" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:s="http://www.w3.org/2001/XMLSchema"
> xmlns:tns="https://yyyy.com/Services/"
> targetNamespace="https://yyyy.com/Services/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
> <wsdl:types>
> <s:schema elementFormDefault="qualified" targetNamespace="https://yyyy.com/Services/">
> <s:import namespace="http://www.xxx.ca/WS/XXXX" />
> <s:element name="Request">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" ref="s1:EL1" />
> </s:sequence>
> </s:complexType>
> </s:element>
> <s:element name="Response">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="1" maxOccurs="1" name="RequestResult" type="s:int" />
> </s:sequence>
> </s:complexType>
> </s:element>
> </s:schema>
> <s:schema elementFormDefault="qualified" targetNamespace="http://www.xxx.ca/WS/XXXX">
> <s:element name="EL1" type="s1:EL1" />
> <s:complexType name="EL1">
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="EL2" type="s:string" />
> </s:sequence>
> </s:complexType>
> </s:schema>
> </wsdl:types>
> <wsdl:message name="RequestSoapIn">
> <wsdl:part name="parameters" element="tns:Request" />
> </wsdl:message>
> <wsdl:message name="RequestSoapOut">
> <wsdl:part name="parameters" element="tns:Response" />
> </wsdl:message>
> <wsdl:portType name="WSSoap">
> <wsdl:operation name="Request">
> <wsdl:input message="tns:RequestSoapIn" />
> <wsdl:output message="tns:RequestSoapOut" />
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="WSSoap" type="tns:WSSoap">
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
> <wsdl:operation name="Request">
> <soap:operation soapAction="https://yyyy.com/Services/Request" style="document" />
> <wsdl:input>
> <soap:body use="literal" />
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal" />
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="TestService">
> <wsdl:port name="WSSoap" binding="tns:WSSoap">
> <soap:address location="https://xxx.com/OnlineServices/Service" />
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>