Hello,

I'm new in the list so I'll try to do my best.

I'm using axis2 1.5.4, but I also tried this with the last snapshot of
version 1.5.5.

I think there' s a missing typeof in class
org.apache.axis2.databinding.types.Union

I'm trying to use this type in my webservice:

<simpleType name="relativeOrAbsoluteDateType">
                <annotation>
                    <documentation>Absolute and relative
time</documentation>
                </annotation>
                <union memberTypes="dateTime duration"/>
            </simpleType>

When I try to send a message from  my  ws client using dateTime it works
smooth. But when i try to use duration i get this exception:

org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Error
in parsing value
    at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:446)
    at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
    at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
    at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at
com.naevatec.www.testws.definitions.NaevatecTestStub.testSubmit(NaevatecTestStub.java:181)
    at com.naevatec.Test.main(Test.java:59)

I have attached the wsdl prepared to show you the maybe "possible bug".

To patch this issue I would include this lines in the Union class:

else if ("duration".equals(type)) {
            setObject(ConverterUtil.convertToDuration(value));
}



More info:

This is the way I'm using this type in the object  I create in the ws
client:

 It causes the excepction i've posted a few lines up;

import org.apache.axis2.databinding.types.Duration;


      RelativeOrAbsoluteDateType date= new RelativeOrAbsoluteDateType();
      Duration dur= new Duration(false, 0, 0, 0, 1, 0, 0);
      date.setObject(dur);



If i create the object RelativeOrAbsoluteType  using Calendar It works:

import java.util.Calendar;

  RelativeOrAbsoluteDateType date1= new RelativeOrAbsoluteDateType();
  Calendar cal= Calendar.getInstance();
  cal.set(2011, Calendar.MAY, 18, 10, 0, 0);
  date1.setObject(cal);


Obviously i would like both ways to work.

Thanks for your help.  And my apologies if this isn't the right place to
post this issue or the right way.

--
Juan Ángel
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:xsd1="http://www.naevatec.com/testWS/schemas"; xmlns:tns="http://www.naevatec.com/testWS/definitions"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns="http://schemas.xmlsoap.org/wsdl/"; xmlns:ns="http://www.w3.org/2001/XMLSchema"; targetNamespace="http://www.naevatec.com/testWS/definitions";>
	<types>
		<schema targetNamespace="http://www.naevatec.com/testWS/schemas"; xmlns="http://www.w3.org/2001/XMLSchema";>
			
			<simpleType name="relativeOrAbsoluteDateType">
				<annotation>
					<documentation>Absolute and relative time</documentation>
				</annotation>
				<union memberTypes="dateTime duration"/>
			</simpleType>
			<simpleType name="versionType">
				<annotation>
					<documentation>Version of the protocol used</documentation>
				</annotation>
				<restriction base="string">
					<enumeration value="1.0"/>
				</restriction>
			</simpleType>
	
			<element name="TestReq">
				<annotation>
					<documentation>Test request to get to know if Absolute and relative time works</documentation>
				</annotation>
				<complexType>
					<sequence>
						<element name="Version" type="xsd1:versionType"/>
						<element name="ExpiryDate" type="xsd1:relativeOrAbsoluteDateType"/>
					</sequence>
				</complexType>
			</element>

		<element name="DeliverRes">
				<annotation>
					<documentation>Test response message</documentation>
				</annotation>
			<complexType>
				<sequence>
					<element name="Version" type="xsd1:versionType"/>
					<element name="Date" type="xsd1:relativeOrAbsoluteDateType"/>
				</sequence>
			</complexType>
			</element>
		</schema>
    </types>
    
	<message name="TestReq">
		<part name="msgTestReq" element="xsd1:TestReq"/>
	</message>
	
	<message name="DeliverRes">
		<part name="msgDeliverRes" element="xsd1:DeliverRes"/>
	</message>
	
	<portType name="Naevatec-PortType">
		<operation name="testSubmit">
			<input message="tns:TestReq"/>
			<output message="tns:DeliverRes"/>
		</operation>
	</portType>

	<binding name="Naevatec-Binding" type="tns:Naevatec-PortType">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<operation name="testSubmit">
			<soap:operation soapAction="testSubmit"/>
			<input>
				<soap:body use="literal"/>
			</input>
			<output>
				<soap:body use="literal"/>
			</output>
		</operation>
	</binding>
	<service name="naevatec-test">
		<port name="Naevatec-Port" binding="tns:Naevatec-Binding">
			<soap:address location="http://localhost:9080/naevatecTest/services/Naevatec-Port"/>
		</port>
	</service>
</definitions>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to