You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by RonnieMJ <ro...@hotmail.com> on 2009/12/04 20:41:52 UTC

Re: Could not get a Java Date type from a Schema complex type

Hi, did you ever find an answer to this?  I'm having the exact same issue
(working with the same company).

Thanks,
Ronnie


bottabing wrote:
> 
> I am getting the following exception.  I am using XMLBeans and Axis.
> 
> org.apache.xmlbeans.impl.values.XmlValueNotSupportedException: Could not
> get a Java Date type from a Schema complex type
> 
> The object that is being SOAPified doesn’t contain a date value. Below is
> the SOAP call, the completed response prior to sending across the wire
> (which looks fine), the stack trace and the WSDL.  Thanks.
> 
> 1-       SOAP Call
> <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:end="http://endpoint.webservice.cssng.nis.cingular.com">
> 
>    <soapenv:Header/>
>    <soapenv:Body>
>       <end:getLocationByKey
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>          <locationId xsi:type="xsd:int">7</locationId>
>       </end:getLocationByKey>
>    </soapenv:Body>
> 
> </soapenv:Envelope>
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Could-not-get-a-Java-Date-type-from-a-Schema-complex-type-tp13028826p26636382.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Could not get a Java Date type from a Schema complex type

Posted by bottabing <pa...@hotmail.com>.
I hope that the workaround that I describe is the correct solution.  I
encountered a few and from what I best recall, this was the fix for this
issue.  Feel free to contact me at paul_botta@hotmail.com.

There was an issue (either AXIS or with the XML beans generated classes)
where the namespace was not always being correctly appended with the
trailing '/'.  I used some debug output statements to output the value.  I
was not successful at uncovering the cause, but arrived at a workaround.  I
ended up getting into the auto-gen stub that extends
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver and added the
following method:


	public org.apache.axiom.soap.SOAPEnvelope
validateNamespace(org.apache.axiom.soap.SOAPEnvelope envelope) {
	  java.util.Iterator namespaceIterator = envelope.getBody().getChildren();
	  while (namespaceIterator.hasNext()) {
			org.apache.axiom.om.OMNode ns = (org.apache.axiom.om.OMNode)
namespaceIterator.next();
			org.apache.axiom.om.OMElement element = null;

			if ( ns instanceof org.apache.axiom.om.OMElement){
			   element = (org.apache.axiom.om.OMElement)ns;
				  if ( element.getDefaultNamespace().getNamespaceURI() != null
					 &&
element.getDefaultNamespace().getNamespaceURI().equals("http://xyz.com/mobility/network/sector/schemas")
) {
					
element.declareDefaultNamespace("http://xyz.com/mobility/network/sector/schemas/");
				  }
			  }
	  }
	  return envelope;



In the various toEnvelope() methods within the same class I added the
following checks:


        if (param != null) {
            envelope.getBody().addChild(toOM(param, optimizeContent));
            return validateNamespace(envelope);
        }
	

Hope this helps.
-- 
View this message in context: http://old.nabble.com/Could-not-get-a-Java-Date-type-from-a-Schema-complex-type-tp13028826p26639796.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org