You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Morten S. Mortensen" <mo...@tietoenator.com> on 2004/09/19 13:07:14 UTC

Why does 'WSDL2Java' change my WSDL!!

Hi,

Does anyone know why the WSDL used to feed Axis' WSDL2Java' differs from
the WSDL returned by the final online web-service?

I begin with a piece like -

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:CertificateValidator.FrontDoor"
xmlns:impl="urn:CertificateValidator.FrontDoor"
xmlns:intf="urn:CertificateValidator.FrontDoor"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL created by Apache Axis version: 1.2alpha
Built on Dec 01, 2003 (04:33:24 EST)-->
 <wsdl:types>
  <schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:CertificateValidator.FrontDoor">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="CertificateValidationResult">
    <sequence>
     <element name="UID" nillable="true" type="xsd:string"/>
     <element name="certificateValid" type="xsd:boolean"/>
     <element name="description" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <complexType name="CertificateValidationException">
    <sequence>
     <element name="message" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>
 ...


- but the online service returns -

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:CertificateValidator.FrontDoor"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:CertificateValidator.FrontDoor"
xmlns:intf="urn:CertificateValidator.FrontDoor"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://www.w3.org/2003/05/soap-encoding"
xmlns:tns2="http://www.w3.org/1999/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.2alpha
Built on Dec 01, 2003 (04:33:24 EST)-->
 <wsdl:types>
  <schema targetNamespace="urn:CertificateValidator.FrontDoor"
xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="CertificateValidationResult">
    <sequence>
     <element name="UID" nillable="true" type="tns1:string"/>
     <element name="certificateValid" type="xsd:boolean"/>
     <element name="description" nillable="true" type="tns1:string"/>
    </sequence>
   </complexType>
   <complexType name="CertificateValidationException">
    <sequence>
     <element name="message" nillable="true" type="tns1:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>
 ...


As you can tell, e.g. the "UID" element is no longer of type
"xsd:string" - for some real odd reason. This is bad, because .NET's
'WSDL' can handle the first, not the second - and I need to call the
service from .NET. The service implemented matches the second, not the
first.

I get the first piece of WSDL by running 'Java2WSDL'. This first piece
is supposed to be fixed. This WSDL is fed into 'WSDL2Java' - which I
compile and deploy - and from which I get a final service - and an
online query to the service gives the second piece of WSDL.

I have another - "simpler" - service with which there are no problems.
It does not have any 'string' in it.

I do this with Axis 1.2Alpha and VS .NET 2003/1.1.
I have build my web-services into my own WAR-file, which I run on a TC
5.0.27.

Anyone have any clues, which can help me to solve this?

Regards,
Morten Sabroe Mortensen


Re: Why does 'WSDL2Java' change my WSDL!!

Posted by to...@gsk.com.
Morten,

Have you told Axis where to find your WSDL? It's a setting in the WSDD 
file. If you haven't told it, it will generate the WSDL and this may be 
what you are seeing.

Tony



Hi,

Does anyone know why the WSDL used to feed Axis' WSDL2Java' differs from
the WSDL returned by the final online web-service?