Hello!

I think there is a bug in the wsdl2java tool (versions 1.2.x 1.3).
I'm using the wsdl that I'm attaching to this e-mail.

The problem is that the generated code for each type is similar to the
following:

(This is from the class timestampumurequesttype)...

static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("urn:schema",
"timeStampUMURequestType"));
        org.apache.axis.description.ElementDesc elemField = new
org.apache.axis.description.ElementDesc();
        elemField.setFieldName("serialNumber");
        elemField.setXmlName(new javax.xml.namespace.QName("",
"serialNumber"));
        elemField.setXmlType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";, "string"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("hashAlgorithm");
        elemField.setXmlName(new javax.xml.namespace.QName("",
"hashAlgorithm"));
        elemField.setXmlType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";, "anyURI"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("hashValue");
        elemField.setXmlName(new javax.xml.namespace.QName("",
"hashValue"));
        elemField.setXmlType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";,
"base64Binary"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

This code I think that should be the following:
static {
        typeDesc.setXmlType(new
javax.xml.namespace.QName("urn:umu:diic:ants:pki:timeStampService:schema",
"timeStampUMURequestType"));
        org.apache.axis.description.ElementDesc elemField = new
org.apache.axis.description.ElementDesc();
        elemField.setFieldName("serialNumber");
        elemField.setXmlName(new
javax.xml.namespace.QName("urn:umu:diic:ants:pki:timeStampService:schema",
"serialNumber"));
        elemField.setXmlType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";, "string"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("hashAlgorithm");
        elemField.setXmlName(new
javax.xml.namespace.QName("urn:umu:diic:ants:pki:timeStampService:schema",
"hashAlgorithm"));
        elemField.setXmlType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";, "anyURI"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("hashValue");
        elemField.setXmlName(new
javax.xml.namespace.QName("urn:umu:diic:ants:pki:timeStampService:schema",
"hashValue"));
        elemField.setXmlType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";,
"base64Binary"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

The problem is that, with the generated code the result of a request is
similar to:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soapenv:Body><timeSta
mpUMURequest xmlns="urn:schema"><serialNumber
xmlns="">serialNumber</serialNumber><hashAlgorithm
xmlns="">http://hashAlgorithm</hashAlgorithm><hashValue
xmlns="">aGFzaFZhbHVl</hashValue></timeStampUMURequest></soapenv:Body></soap
env:Envelope>

The problem is that the elements contained in timestampUmuRequest have as
xmlns, xmlns="", and it should be xmlns="urn:schema".


Is it a bug, or is there any problem with my wsdl?

Could you guide me, please?

Regards,
Antonio.
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"; xmlns:y="urn:umu:diic:ants:pki:timeStampService" xmlns:ys="urn:umu:diic:ants:pki:timeStampService:schema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; targetNamespace="urn:umu:diic:ants:pki:timeStampService" name="urn:umu:diic:ants:pki:timeStampService">
	<types>
		<xs:schema targetNamespace="urn:umu:diic:ants:pki:timeStampService:schema" xmlns:tn="urn:umu:diic:ants:pki:timeStampService:schema" xmlns:xs="http://www.w3.org/2001/XMLSchema";>
			<xs:complexType name="timeStampUMURequestType">
				<xs:sequence>
					<xs:element name="serialNumber" type="xs:string"/>
					<xs:element name="hashAlgorithm" type="xs:anyURI"/>
					<xs:element name="hashValue" type="xs:base64Binary"/>
				</xs:sequence>
			</xs:complexType>
			<xs:complexType name="timeStampUMUResponseType">
				<xs:sequence>
					<xs:element name="timeStampToken" type="xs:base64Binary"/>
				</xs:sequence>
			</xs:complexType>
			<xs:complexType name="validateTimeStampUMURequestType">
				<xs:sequence>
					<xs:element name="timeStampToken" type="xs:base64Binary"/>
					<xs:element name="hashValue" type="xs:base64Binary" minOccurs="0"/>
				</xs:sequence>
			</xs:complexType>
			<xs:complexType name="infoTimeStampUMUType">
				<xs:sequence>
					<xs:element name="serialNumber" type="xs:string"/>
					<xs:element name="dateTime" type="xs:dateTime"/>
					<xs:element name="hashAlgorithm" type="xs:anyURI"/>
					<xs:element name="hashValue" type="xs:base64Binary"/>
				</xs:sequence>
			</xs:complexType>
			<xs:complexType name="resultType">
				<xs:sequence>
					<xs:element name="returnCode" type="xs:int"/>
					<xs:element name="returnMessage" type="xs:string" minOccurs="0"/>
					<xs:element name="infoTimeStamp" type="tn:infoTimeStampUMUType" minOccurs="0"/>
				</xs:sequence>
			</xs:complexType>
			<xs:element name="timeStampUMURequest" type="tn:timeStampUMURequestType"/>
			<xs:element name="timeStampUMUResponse" type="tn:timeStampUMUResponseType"/>
			<xs:element name="validateTimeStampUMURequest" type="tn:validateTimeStampUMURequestType"/>
			<xs:element name="resultValidation" type="tn:resultType"/>
		</xs:schema>
	</types>
	<message name="timeStampUMURequestIn">
		<part name="timeStampUMURequest" element="ys:timeStampUMURequest"/>
	</message>
	<message name="timeStampUMURequestOut">
		<part name="timeStampUMUResponse" element="ys:timeStampUMUResponse"/>
	</message>
	<message name="validateTimeStampUMUIn">
		<part name="validateTimeStampUMURequest" element="ys:validateTimeStampUMURequest"/>
	</message>
	<message name="validateTimeStampUMUOut">
		<part name="resultValidation" element="ys:resultValidation"/>
	</message>
	<portType name="timeStampServiceUMUSOAP">
		<operation name="requestTimeStampUMU">
			<input message="y:timeStampUMURequestIn"/>
			<output message="y:timeStampUMURequestOut"/>
		</operation>
		<operation name="validateTimeStampUMU">
			<input message="y:validateTimeStampUMUIn"/>
			<output message="y:validateTimeStampUMUOut"/>
		</operation>
	</portType>
	<binding name="timeStampServiceUMUSOAPBinding" type="y:timeStampServiceUMUSOAP">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<operation name="requestTimeStampUMU">
			<soap:operation soapAction="urn:timeStampServiceUMU#requestTimeStampUMU"/>
			<input>
				<soap:body use="literal"/>
			</input>
			<output>
				<soap:body use="literal"/>
			</output>
		</operation>
		<operation name="validateTimeStampUMU">
			<soap:operation soapAction="urn:timeStampServiceUMU#validateTimeStampUMU"/>
			<input>
				<soap:body use="literal"/>
			</input>
			<output>
				<soap:body use="literal"/>
			</output>
		</operation>
	</binding>
	<service name="timeStampServiceUMU">
		<port name="timeStampServiceUMU" binding="y:timeStampServiceUMUSOAPBinding">
			<soap:address location="http://micropeich.dif.um.es:8080/axis/services/timeStampServiceUMU"/>
		</port>
	</service>
</definitions>

Reply via email to