You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Sergio Eduardo (JIRA)" <ax...@ws.apache.org> on 2010/11/19 14:44:17 UTC
[jira] Commented: (AXIS-2758) faultString:
org.xml.sax.SAXException: Invalid element foo
[ https://issues.apache.org/jira/browse/AXIS-2758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933805#action_12933805 ]
Sergio Eduardo commented on AXIS-2758:
--------------------------------------
I've got this problem and found a solution:
If the WS has operations wich returns more then one elements, consider the following implementation:
org.apache.axis.description.OperationDesc oper = new org.apache.axis.description.OperationDesc();
oper.setName("getDemandas");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "dataInicio"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime"), java.util.Calendar.class, false, false);
param.setOmittable(true);
param.setNillable(true);
oper.addParameter(param);
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "dataFim"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime"), java.util.Calendar.class, false, false);
param.setOmittable(true);
param.setNillable(true);
oper.addParameter(param);
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "tipoConsulta"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false);
param.setOmittable(true);
param.setNillable(true);
oper.addParameter(param);
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "situacao"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), java.lang.Integer.class, false, false);
param.setOmittable(true);
oper.addParameter(param);
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pagina"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), java.lang.Integer.class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("http://objetos.siscapws.rdr.bcb.gov.br", "DemandaOUT"));
oper.setReturnClass(br.gov.bcb.rdr.siscapws.objetos.xsd.DemandaOUT.class);
oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
this call:
oper.setReturnClass(br.gov.bcb.rdr.siscapws.objetos.xsd.DemandaOUT.class);
must not have an array as a parameter, it has to be the real class... the following implementation led me to that bug: oper.setReturnClass(br.gov.bcb.rdr.siscapws.objetos.xsd.DemandaOUT[].class);
> faultString: org.xml.sax.SAXException: Invalid element foo
> ----------------------------------------------------------
>
> Key: AXIS-2758
> URL: https://issues.apache.org/jira/browse/AXIS-2758
> Project: Axis
> Issue Type: Bug
> Components: Serialization/Deserialization
> Affects Versions: 1.4
> Reporter: Dominique Jean-Prost
>
> Axis generated stub does not handle correctly changes in wsdl if fields are added in a "method" result. I think it could handle it transparently.
> Maybe you could add an option in wsdl2java letting us to choose if we want to be strict or not.
> In my example, typeIban was added in wsdl after stub generation.
> AxisFault
> faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> faultSubcode:
> faultString: org.xml.sax.SAXException: Invalid element in com.dexia.sofaxis.test.RibWSDTO - typeIban
> faultActor:
> faultNode:
> faultDetail:
> {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Invalid element in com.dexia.sofaxis.test.RibWSDTO - typeIban
> at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
> at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
> at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
> at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
> at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
> at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
> at org.apache.axis.client.Call.invoke(Call.java:2467)
> at org.apache.axis.client.Call.invoke(Call.java:2366)
> at org.apache.axis.client.Call.invoke(Call.java:1812)
> at com.dexia.sofaxis.test.ReferentielIbanBindingStub.rechercheRibsByIdsTiers(ReferentielIbanBindingStub.java:224)
> at com.dexia.sofaxis.clientws.TestReferentielIban.main(TestReferentielIban.java:32)
> {http://xml.apache.org/axis/}hostname:PODJP
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org