I've tried wsdl2java -v to validate the wsdl and it found one problem,
the soap:body tag specified a namespace when it shouldn't.
However this has not solved the initial error.
I am now debugging the source. The error occurs in:
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor line 102
(I am using cxf 2.2.3).
From what i can see it is finding a definitions tag from namespace
http://schemas.xmlsoap.org/wsdl/ when it is expecting a envelope tag
from namespace http://schemas.xmlsoap.org/soap/envelope/.
I have no idea what it is doing in this part of the code, is this the
request soap message being sent?
Is something wrong in the wsdl that is causing invalid messages to be
generated?
If anyone could shed some light on this i would be grateful.
On 08/26/2010 04:33 PM, Max Pimm wrote:
Hi,
i am trying to write a client for web service using cxf. I can use
SoapUI as a client with no problems but with cxf i am getting the
error in the subject of this mail.
What does it mean? That the wsdl does not validate against
http://schemas.xmlsoap.org/wsdl/ (the namespace for the definitions
element)?
If this is the case where can i look to find the problem? Is there any
additional debugging that i can turn on?
Any help would be greatly appreciated.
Max
Here goes the code:
The java client:
factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new
LoggingInInterceptor());
factory.getOutInterceptors().add(new
LoggingOutInterceptor());
factory.setServiceClass(PortalUserSyncService.class);
factory.setAddress(portal.getUpdateUsersServiceUrl());
client = (PortalUserSyncService) factory.create();
client.updateUsersPortal(users);
The wsdl that i can't consume:
<wsdl:definitions
targetNamespace="http://www.schneiderelectric.es/cud/wsdl"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:impl="http://www.schneiderelectric.es/cud/wsdl"
xmlns:intf="http://www.schneiderelectric.es/cud/wsdl"
xmlns:tns1="http://www.schneiderelectric.es/cud/schema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="http://www.schneiderelectric.es/cud/schema"
xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType name="portalId">
<restriction base="xsd:string">
<enumeration value="E"/>
<enumeration value="C"/>
</restriction>
</simpleType>
<complexType name="client">
<sequence>
<element maxOccurs="1" minOccurs="0" name="address" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="cif" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="clientSizeId" type="xsd:int"/>
<element maxOccurs="1" minOccurs="0" name="clientelaId" type="xsd:int"/>
<element maxOccurs="1" minOccurs="0" name="corporateName"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="dateCreate"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModAddress"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModCif"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModClientSize"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModClientela"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModCorpName"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModPopulation"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModPostcode"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModTelephone"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="idWeb" type="xsd:int"/>
<element maxOccurs="1" minOccurs="0" name="idMkr" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="lastRemoteUpdate"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="populationId"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="postcode" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="procedence"
type="tns1:portalId"/>
<element maxOccurs="1" minOccurs="0" name="telephone" type="xsd:string"/>
</sequence>
</complexType>
<simpleType name="passwordEnc">
<restriction base="xsd:string">
<enumeration value="MD5"/>
<enumeration value="SHA1"/>
</restriction>
</simpleType>
<simpleType name="promoId">
<restriction base="xsd:string">
<enumeration value="E"/>
<enumeration value="C"/>
</restriction>
</simpleType>
<simpleType name="userState">
<restriction base="xsd:string">
<enumeration value="A"/>
<enumeration value="D"/>
<enumeration value="P"/>
</restriction>
</simpleType>
<complexType name="userPortal">
<sequence>
<element maxOccurs="1" minOccurs="0" name="data" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="dateCreate"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateLastLogin"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="portalId"
type="tns1:portalId"/>
<element maxOccurs="1" minOccurs="0" name="state" type="tns1:userState"/>
</sequence>
</complexType>
<simpleType name="userType">
<restriction base="xsd:string">
<enumeration value="C"/>
<enumeration value="I"/>
<enumeration value="M"/>
</restriction>
</simpleType>
<complexType name="user">
<sequence>
<element maxOccurs="1" minOccurs="0" name="client" type="tns1:client"/>
<element maxOccurs="1" minOccurs="0" name="contactAreaId"
type="xsd:int"/>
<element maxOccurs="1" minOccurs="0" name="dateCreate"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModArea"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModClient"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModEmail"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModEmailBounce"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModEncType"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModJobTitle"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModName"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModPassword"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModPortals"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModReceivePromos"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModSurname1"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModSurname2"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="dateModTelMob"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="email" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="emailBounce"
type="xsd:boolean"/>
<element maxOccurs="1" minOccurs="0" name="encType"
type="tns1:passwordEnc"/>
<element maxOccurs="1" minOccurs="0" name="idWeb" type="xsd:int"/>
<element maxOccurs="1" minOccurs="0" name="idMkr" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="jobTitleId" type="xsd:int"/>
<element maxOccurs="1" minOccurs="0" name="lastRemoteUpdate"
type="xsd:dateTime"/>
<element maxOccurs="1" minOccurs="0" name="name" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="password" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="procedence"
type="tns1:portalId"/>
<element maxOccurs="unbounded" minOccurs="0" name="receivePromos"
nillable="true" type="tns1:promoId"/>
<element maxOccurs="1" minOccurs="0" name="surname1" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="surname2" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="telephoneMobile"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="userPortals"
nillable="true" type="tns1:userPortal"/>
<element maxOccurs="1" minOccurs="0" name="userType"
type="tns1:userType"/>
</sequence>
</complexType>
</schema>
<schema targetNamespace="http://www.schneiderelectric.es/cud/wsdl"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://www.schneiderelectric.es/cud/schema"/>
<element name="updateUsersPortal">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="users"
type="tns1:user"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="updateUsersPortalRequest">
<wsdl:part element="impl:updateUsersPortal" name="updateUsersPortal"/>
</wsdl:message>
<wsdl:portType name="UserServicePortType">
<wsdl:operation name="updateUsersPortal"
parameterOrder="updateUsersPortal">
<wsdl:input message="impl:updateUsersPortalRequest"
name="updateUsersPortalRequest"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="UserServiceBinding" type="impl:UserServicePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="updateUsersPortal">
<soap:operation
soapAction="http://eventos-sch-sinc.tecfa.com/service/call/user&method=updateUsersLocal"
style="document"/>
<wsdl:input name="updateUsersPortalRequest">
<soap:body use="literal"
namespace="http://www.schneiderelectric.es/cud/wsdl"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="UserService">
<wsdl:port name="UserServicePort" binding="impl:UserServiceBinding">
<soap:address
location="http://eventos-sch-sinc.tecfa.com/service/call/user"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
--
-------------------------------------------------------------
*TECFA Group*
Ciutat de Granada, 55
08005 Barcelona
Tel. 93 300 86 11
Fax 93 300 35 26
http://www.tecfa.com
-------------------------------------------------------------