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 Ia...@dola.wa.gov.au on 2003/06/10 09:14:06 UTC

xsi-type - Desperate to get rid of it.

Hi,

I'm calling a .NET web service using Axis client code.  I'm desperately
trying to find out if it is possible to remove the xsi:type from the
envelope.  I've read so many messages on the Axis groups about this issue,
and as other posters have done, I've tried unsuccessfully to disable the
sending of this attribute in many ways, including (individually and using
various combinations of) the following:

call.setOption(Call.SEND_TYPE_ATTR,Boolean.FALSE);
call.setProperty(Call.SEND_TYPE_ATTR,Boolean.FALSE);
call.setScopedProperty(Call.SEND_TYPE_ATTR,Boolean.FALSE);
call.setOption(AxisEngine.PROP_SEND_XSI,Boolean.FALSE);
call.setProperty(AxisEngine.PROP_SEND_XSI,Boolean.FALSE);
call.setScopedProperty(AxisEngine.PROP_SEND_XSI,Boolean.FALSE);
call.getMessageContext
().setProperty(AxisEngine.PROP_SEND_XSI,Boolean.FALSE);
call.getService().getAxisEngine
().setOption(AxisEngine.PROP_SEND_XSI,Boolean.FALSE);

None of these actually remove the xsi:type from all the fields.

I've also read from one poster that this is a bug, and from another that
only some types of parameters will allow this removal.  Surely int and long
parameters don't need it, or the successful .NET client (to the same web
service), which doesn't set the xsi:type would fail.  One thing is for
sure, though: the only difference between what gets sent from the
unsuccessful Axis client and what gets sent from the successful .NET client
is the xsi:type attributes on the parameters.

Those people who've posted about this in the past - how did you solve it?
Anybody else have any ideas?  I'll paste in what the Axis client is sending
below.  And below that I'll post in the returned error.

Ian

<?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>
 <doBlah xmlns="http://tempuri.org">
  <requestNumber xsi:type="xsd:long">1</requestNumber>
  <someId xsi:type="xsd:int">1</someId>
<xmlData>[snip]</xmlData>
  </doBlah>
  </soapenv:Body>
  </soapenv:Envelope>

System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---&gt; System.ArgumentNullException: Array cannot be null.
Parameter name: bytes
   at System.Text.ASCIIEncoding.GetString(Byte[] bytes)
   --- End of inner exception stack trace ---
        at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:251)
        at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:168)
        at
org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
        at
org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:568)
        at
org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNamespaceBinder.java:853)
        at
org.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.java:643)
        at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:3006)
        at
org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:930)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleEndElement(XMLDocumentFragmentScannerImpl.java:1145)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:988)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1446)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
        at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:525)
        at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:581)
        at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
        at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1157)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2545)
        at org.apache.axis.client.Call.invoke(Call.java:2515)
        at org.apache.axis.client.Call.invoke(Call.java:2210)
        at org.apache.axis.client.Call.invoke(Call.java:2133)
        at org.apache.axis.client.Call.invoke(Call.java:1656)
        at MyInterfaceClient.doBlah(MyInterfaceClient.java:98)