views:

506

answers:

1

Hi

I am developing webservices usin CXF-WS 2.2.1. I had developed and tested the services earlier but now the generated wsdl is different from the earlier one here is the old one

<?xml version="1.0" ?> 
- <wsdl:definitions name="ICodeTableServiceService" targetNamespace="http://codetable.service.esps.cvs.com/" xmlns:ns1="http://cxf.apache.org/bindings/xformat" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://codetable.service.esps.cvs.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
- <wsdl:types>
- <xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://codetable.service.esps.cvs.com/" xmlns:tns="http://codetable.service.esps.cvs.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  <xsd:element name="ESPSException" type="tns:ESPSException" /> 
- <xsd:complexType name="ESPSException">
- <xsd:sequence>
  <xsd:element name="logged" nillable="true" type="xsd:boolean" /> 
  <xsd:element name="priority" nillable="true" type="xsd:int" /> 
  </xsd:sequence>
  </xsd:complexType>
  <xsd:element name="getCodeTableDataMultiple" type="tns:getCodeTableDataMultiple" /> 
- <xsd:complexType name="getCodeTableDataMultiple">
- <xsd:sequence>
  <xsd:element minOccurs="0" name="codeTypeName" type="xsd:string" /> 
  </xsd:sequence>
  </xsd:complexType>
  <xsd:element name="getCodeTableDataMultipleResponse" type="tns:getCodeTableDataMultipleResponse" />

and the old one is like

<?xml version="1.0" encoding="UTF-8" ?> 
- <wsdl:definitions name="ICodeTableServiceService" targetNamespace="http://codetable.service.esps.cvs.com/" xmlns:ns1="http://cxf.apache.org/bindings/xformat" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://codetable.service.esps.cvs.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
- <wsdl:types>
- <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://codetable.service.esps.cvs.com/" xmlns:tns="http://codetable.service.esps.cvs.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  <xs:element name="sayHello" nillable="true" type="tns:sayHello" /> 
  <xs:element name="sayHelloResponse" nillable="true" type="tns:sayHelloResponse" /> 
  <xs:element name="ESPSException" type="tns:ESPSException" /> 
- <xs:complexType name="ESPSException">
- <xs:sequence>
  <xs:element name="logged" nillable="true" type="xs:boolean" /> 
  <xs:element name="priority" nillable="true" type="xs:int" /> 
  </xs:sequence>
  </xs:complexType>
  <xs:element name="getCodeTableData" nillable="true" type="tns:getCodeTableData" /> 
  <xs:element name="getCodeTableDataResponse" nillable="true" type="tns:getCodeTableDataResponse" />

As you can see the wsdl is different right from the first line.. With no change in configurations or the jars used in the project. Could anyone please help me out with why such a thing is happening. As soon as possible would be appreciated cos this has to move to a build day after tomorrow.

Thanks in advance Adhir Aima

+2  A: 

A lot of things could cause some of this. The encoding="UTF-8" is the strange one to me. Not sure what would cause that one to appear short of a different parser being picked up somehow. Maybe different JDK? I'm not really sure.

The rest of the changes just look like ordering differences in the order of the elements/types in the schema and the attribute ordering. In both cases, the answer is the same. Those things are stored in HashMaps in memory. Ordering of HashMaps are not guaranteed and can easily differ under various circumstances. A different parser (see above) can call put(..) in a different order which affects things. A different JRE can order them differently. Also, the order of the Method[] returned from getClass().getMethods() can have an effect (IBM JDK is known to return them in a different order than the Sun JDK for example) as CXF would introspect things in a different order. A different compiler could put the methods in the .class files in a different order. Etc....

Daniel Kulp