Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 414 | espaco | 1 | |
| 2 | /** |
||
| 3 | * NFeDistribuicaoDFeStub.java |
||
| 4 | * |
||
| 5 | * This file was auto-generated from WSDL |
||
| 6 | * by the Apache Axis2 version: 1.6.2 Built on : Apr 17, 2012 (05:33:49 IST) |
||
| 7 | */ |
||
| 8 | package br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe; |
||
| 9 | |||
| 10 | |||
| 11 | |||
| 12 | /* |
||
| 13 | * NFeDistribuicaoDFeStub java implementation |
||
| 14 | */ |
||
| 15 | |||
| 16 | |||
| 17 | import org.apache.axis2.client.Stub; |
||
| 18 | |||
| 19 | public class NFeDistribuicaoDFeStub extends org.apache.axis2.client.Stub |
||
| 20 | { |
||
| 21 | protected org.apache.axis2.description.AxisOperation[] _operations; |
||
| 22 | |||
| 23 | //hashmaps to keep the fault mapping |
||
| 24 | private java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); |
||
| 25 | private java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); |
||
| 26 | private java.util.HashMap faultMessageMap = new java.util.HashMap(); |
||
| 27 | |||
| 28 | private static int counter = 0; |
||
| 29 | |||
| 30 | private static synchronized java.lang.String getUniqueSuffix(){ |
||
| 31 | // reset the counter if it is greater than 99999 |
||
| 32 | if (counter > 99999){ |
||
| 33 | counter = 0; |
||
| 34 | } |
||
| 35 | counter = counter + 1; |
||
| 36 | return java.lang.Long.toString(java.lang.System.currentTimeMillis()) + "_" + counter; |
||
| 37 | } |
||
| 38 | |||
| 39 | |||
| 40 | private void populateAxisService() throws org.apache.axis2.AxisFault { |
||
| 41 | |||
| 42 | //creating the Service with a unique name |
||
| 43 | _service = new org.apache.axis2.description.AxisService("br/com/swconsultoria/nfe/wsdl/NFeDistribuicaoDFe" + getUniqueSuffix()); |
||
| 44 | addAnonymousOperations(); |
||
| 45 | |||
| 46 | //creating the operations |
||
| 47 | org.apache.axis2.description.AxisOperation __operation; |
||
| 48 | |||
| 49 | _operations = new org.apache.axis2.description.AxisOperation[1]; |
||
| 50 | |||
| 51 | __operation = new org.apache.axis2.description.OutInAxisOperation(); |
||
| 52 | |||
| 53 | |||
| 54 | __operation.setName(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe", "nfeDistDFeInteresse")); |
||
| 55 | _service.addOperation(__operation); |
||
| 56 | |||
| 57 | |||
| 58 | |||
| 59 | |||
| 60 | _operations[0]=__operation; |
||
| 61 | |||
| 62 | |||
| 63 | } |
||
| 64 | |||
| 65 | //populates the faults |
||
| 66 | private void populateFaults(){ |
||
| 67 | |||
| 68 | |||
| 69 | |||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | *Constructor that takes in a configContext |
||
| 74 | */ |
||
| 75 | |||
| 76 | public NFeDistribuicaoDFeStub(org.apache.axis2.context.ConfigurationContext configurationContext, |
||
| 77 | java.lang.String targetEndpoint) |
||
| 78 | throws org.apache.axis2.AxisFault { |
||
| 79 | this(configurationContext,targetEndpoint,false); |
||
| 80 | } |
||
| 81 | |||
| 82 | |||
| 83 | /** |
||
| 84 | * Constructor that takes in a configContext and useseperate listner |
||
| 85 | */ |
||
| 86 | public NFeDistribuicaoDFeStub(org.apache.axis2.context.ConfigurationContext configurationContext, |
||
| 87 | java.lang.String targetEndpoint, boolean useSeparateListener) |
||
| 88 | throws org.apache.axis2.AxisFault { |
||
| 89 | //To populate AxisService |
||
| 90 | populateAxisService(); |
||
| 91 | populateFaults(); |
||
| 92 | |||
| 93 | _serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service); |
||
| 94 | |||
| 95 | |||
| 96 | _serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference( |
||
| 97 | targetEndpoint)); |
||
| 98 | _serviceClient.getOptions().setUseSeparateListener(useSeparateListener); |
||
| 99 | |||
| 100 | //Set the soap version |
||
| 101 | _serviceClient.getOptions().setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI); |
||
| 102 | |||
| 103 | |||
| 104 | } |
||
| 105 | |||
| 106 | /** |
||
| 107 | * Default Constructor |
||
| 108 | */ |
||
| 109 | public NFeDistribuicaoDFeStub(org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { |
||
| 110 | |||
| 111 | this(configurationContext,"https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx" ); |
||
| 112 | |||
| 113 | } |
||
| 114 | |||
| 115 | /** |
||
| 116 | * Default Constructor |
||
| 117 | */ |
||
| 118 | public NFeDistribuicaoDFeStub() throws org.apache.axis2.AxisFault { |
||
| 119 | |||
| 120 | this("https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx" ); |
||
| 121 | |||
| 122 | } |
||
| 123 | |||
| 124 | /** |
||
| 125 | * Constructor taking the target endpoint |
||
| 126 | */ |
||
| 127 | public NFeDistribuicaoDFeStub(java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { |
||
| 128 | this(null,targetEndpoint); |
||
| 129 | } |
||
| 130 | |||
| 131 | |||
| 132 | |||
| 133 | |||
| 134 | /** |
||
| 135 | * Auto generated method signature |
||
| 136 | * |
||
| 137 | * @see br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFe#nfeDistDFeInteresse |
||
| 138 | * @param nfeDistDFeInteresse0 |
||
| 139 | |||
| 140 | */ |
||
| 141 | |||
| 142 | |||
| 143 | |||
| 144 | public br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresseResponse nfeDistDFeInteresse( |
||
| 145 | |||
| 146 | br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresse nfeDistDFeInteresse0) |
||
| 147 | |||
| 148 | |||
| 149 | throws java.rmi.RemoteException |
||
| 150 | |||
| 151 | { |
||
| 152 | org.apache.axis2.context.MessageContext _messageContext = null; |
||
| 153 | try{ |
||
| 154 | org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName()); |
||
| 155 | _operationClient.getOptions().setAction("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe/nfeDistDFeInteresse"); |
||
| 156 | _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); |
||
| 157 | |||
| 158 | |||
| 159 | |||
| 160 | addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); |
||
| 161 | |||
| 162 | |||
| 163 | // create a message context |
||
| 164 | _messageContext = new org.apache.axis2.context.MessageContext(); |
||
| 165 | |||
| 166 | |||
| 167 | |||
| 168 | // create SOAP envelope with that payload |
||
| 169 | org.apache.axiom.soap.SOAPEnvelope env = null; |
||
| 170 | |||
| 171 | |||
| 172 | env = toEnvelope(Stub.getFactory(_operationClient.getOptions().getSoapVersionURI()), |
||
| 173 | nfeDistDFeInteresse0, |
||
| 174 | optimizeContent(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe", |
||
| 175 | "nfeDistDFeInteresse")), new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe", |
||
| 176 | "nfeDistDFeInteresse")); |
||
| 177 | |||
| 178 | //adding SOAP soap_headers |
||
| 179 | _serviceClient.addHeadersToEnvelope(env); |
||
| 180 | // set the message context with that soap envelope |
||
| 181 | _messageContext.setEnvelope(env); |
||
| 182 | |||
| 183 | // add the message contxt to the operation client |
||
| 184 | _operationClient.addMessageContext(_messageContext); |
||
| 185 | |||
| 186 | //execute the operation client |
||
| 187 | _operationClient.execute(true); |
||
| 188 | |||
| 189 | |||
| 190 | org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( |
||
| 191 | org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); |
||
| 192 | org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); |
||
| 193 | |||
| 194 | |||
| 195 | java.lang.Object object = fromOM( |
||
| 196 | _returnEnv.getBody().getFirstElement() , |
||
| 197 | br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresseResponse.class, |
||
| 198 | getEnvelopeNamespaces(_returnEnv)); |
||
| 199 | |||
| 200 | |||
| 201 | return (br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresseResponse)object; |
||
| 202 | |||
| 203 | }catch(org.apache.axis2.AxisFault f){ |
||
| 204 | |||
| 205 | org.apache.axiom.om.OMElement faultElt = f.getDetail(); |
||
| 206 | if (faultElt!=null){ |
||
| 207 | if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"nfeDistDFeInteresse"))){ |
||
| 208 | //make the fault by reflection |
||
| 209 | try{ |
||
| 210 | java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"nfeDistDFeInteresse")); |
||
| 211 | java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); |
||
| 212 | java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class); |
||
| 213 | java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage()); |
||
| 214 | //message class |
||
| 215 | java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"nfeDistDFeInteresse")); |
||
| 216 | java.lang.Class messageClass = java.lang.Class.forName(messageClassName); |
||
| 217 | java.lang.Object messageObject = fromOM(faultElt,messageClass,null); |
||
| 218 | java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", |
||
| 219 | new java.lang.Class[]{messageClass}); |
||
| 220 | m.invoke(ex,new java.lang.Object[]{messageObject}); |
||
| 221 | |||
| 222 | |||
| 223 | throw new java.rmi.RemoteException(ex.getMessage(), ex); |
||
| 224 | }catch(java.lang.ClassCastException e){ |
||
| 225 | // we cannot intantiate the class - throw the original Axis fault |
||
| 226 | throw f; |
||
| 227 | } catch (java.lang.ClassNotFoundException e) { |
||
| 228 | // we cannot intantiate the class - throw the original Axis fault |
||
| 229 | throw f; |
||
| 230 | }catch (java.lang.NoSuchMethodException e) { |
||
| 231 | // we cannot intantiate the class - throw the original Axis fault |
||
| 232 | throw f; |
||
| 233 | } catch (java.lang.reflect.InvocationTargetException e) { |
||
| 234 | // we cannot intantiate the class - throw the original Axis fault |
||
| 235 | throw f; |
||
| 236 | } catch (java.lang.IllegalAccessException e) { |
||
| 237 | // we cannot intantiate the class - throw the original Axis fault |
||
| 238 | throw f; |
||
| 239 | } catch (java.lang.InstantiationException e) { |
||
| 240 | // we cannot intantiate the class - throw the original Axis fault |
||
| 241 | throw f; |
||
| 242 | } |
||
| 243 | }else{ |
||
| 244 | throw f; |
||
| 245 | } |
||
| 246 | }else{ |
||
| 247 | throw f; |
||
| 248 | } |
||
| 249 | } finally { |
||
| 250 | if (_messageContext.getTransportOut() != null) { |
||
| 251 | _messageContext.getTransportOut().getSender().cleanup(_messageContext); |
||
| 252 | } |
||
| 253 | } |
||
| 254 | } |
||
| 255 | |||
| 256 | /** |
||
| 257 | * Auto generated method signature for Asynchronous Invocations |
||
| 258 | * |
||
| 259 | * @see br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFe#startnfeDistDFeInteresse |
||
| 260 | * @param nfeDistDFeInteresse0 |
||
| 261 | |||
| 262 | */ |
||
| 263 | public void startnfeDistDFeInteresse( |
||
| 264 | |||
| 265 | br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresse nfeDistDFeInteresse0, |
||
| 266 | |||
| 267 | final br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeCallbackHandler callback) |
||
| 268 | |||
| 269 | throws java.rmi.RemoteException{ |
||
| 270 | |||
| 271 | org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName()); |
||
| 272 | _operationClient.getOptions().setAction("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe/nfeDistDFeInteresse"); |
||
| 273 | _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); |
||
| 274 | |||
| 275 | |||
| 276 | |||
| 277 | addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); |
||
| 278 | |||
| 279 | |||
| 280 | |||
| 281 | // create SOAP envelope with that payload |
||
| 282 | org.apache.axiom.soap.SOAPEnvelope env=null; |
||
| 283 | final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); |
||
| 284 | |||
| 285 | |||
| 286 | //Style is Doc. |
||
| 287 | |||
| 288 | |||
| 289 | env = toEnvelope(Stub.getFactory(_operationClient.getOptions().getSoapVersionURI()), |
||
| 290 | nfeDistDFeInteresse0, |
||
| 291 | optimizeContent(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe", |
||
| 292 | "nfeDistDFeInteresse")), new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe", |
||
| 293 | "nfeDistDFeInteresse")); |
||
| 294 | |||
| 295 | // adding SOAP soap_headers |
||
| 296 | _serviceClient.addHeadersToEnvelope(env); |
||
| 297 | // create message context with that soap envelope |
||
| 298 | _messageContext.setEnvelope(env); |
||
| 299 | |||
| 300 | // add the message context to the operation client |
||
| 301 | _operationClient.addMessageContext(_messageContext); |
||
| 302 | |||
| 303 | |||
| 304 | |||
| 305 | _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { |
||
| 306 | public void onMessage(org.apache.axis2.context.MessageContext resultContext) { |
||
| 307 | try { |
||
| 308 | org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); |
||
| 309 | |||
| 310 | java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), |
||
| 311 | br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresseResponse.class, |
||
| 312 | getEnvelopeNamespaces(resultEnv)); |
||
| 313 | callback.receiveResultnfeDistDFeInteresse( |
||
| 314 | (br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresseResponse)object); |
||
| 315 | |||
| 316 | } catch (org.apache.axis2.AxisFault e) { |
||
| 317 | callback.receiveErrornfeDistDFeInteresse(e); |
||
| 318 | } |
||
| 319 | } |
||
| 320 | |||
| 321 | public void onError(java.lang.Exception error) { |
||
| 322 | if (error instanceof org.apache.axis2.AxisFault) { |
||
| 323 | org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; |
||
| 324 | org.apache.axiom.om.OMElement faultElt = f.getDetail(); |
||
| 325 | if (faultElt!=null){ |
||
| 326 | if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"nfeDistDFeInteresse"))){ |
||
| 327 | //make the fault by reflection |
||
| 328 | try{ |
||
| 329 | java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"nfeDistDFeInteresse")); |
||
| 330 | java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); |
||
| 331 | java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class); |
||
| 332 | java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage()); |
||
| 333 | //message class |
||
| 334 | java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"nfeDistDFeInteresse")); |
||
| 335 | java.lang.Class messageClass = java.lang.Class.forName(messageClassName); |
||
| 336 | java.lang.Object messageObject = fromOM(faultElt,messageClass,null); |
||
| 337 | java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", |
||
| 338 | new java.lang.Class[]{messageClass}); |
||
| 339 | m.invoke(ex,new java.lang.Object[]{messageObject}); |
||
| 340 | |||
| 341 | |||
| 342 | callback.receiveErrornfeDistDFeInteresse(new java.rmi.RemoteException(ex.getMessage(), ex)); |
||
| 343 | } catch(java.lang.ClassCastException e){ |
||
| 344 | // we cannot intantiate the class - throw the original Axis fault |
||
| 345 | callback.receiveErrornfeDistDFeInteresse(f); |
||
| 346 | } catch (java.lang.ClassNotFoundException e) { |
||
| 347 | // we cannot intantiate the class - throw the original Axis fault |
||
| 348 | callback.receiveErrornfeDistDFeInteresse(f); |
||
| 349 | } catch (java.lang.NoSuchMethodException e) { |
||
| 350 | // we cannot intantiate the class - throw the original Axis fault |
||
| 351 | callback.receiveErrornfeDistDFeInteresse(f); |
||
| 352 | } catch (java.lang.reflect.InvocationTargetException e) { |
||
| 353 | // we cannot intantiate the class - throw the original Axis fault |
||
| 354 | callback.receiveErrornfeDistDFeInteresse(f); |
||
| 355 | } catch (java.lang.IllegalAccessException e) { |
||
| 356 | // we cannot intantiate the class - throw the original Axis fault |
||
| 357 | callback.receiveErrornfeDistDFeInteresse(f); |
||
| 358 | } catch (java.lang.InstantiationException e) { |
||
| 359 | // we cannot intantiate the class - throw the original Axis fault |
||
| 360 | callback.receiveErrornfeDistDFeInteresse(f); |
||
| 361 | } catch (org.apache.axis2.AxisFault e) { |
||
| 362 | // we cannot intantiate the class - throw the original Axis fault |
||
| 363 | callback.receiveErrornfeDistDFeInteresse(f); |
||
| 364 | } |
||
| 365 | } else { |
||
| 366 | callback.receiveErrornfeDistDFeInteresse(f); |
||
| 367 | } |
||
| 368 | } else { |
||
| 369 | callback.receiveErrornfeDistDFeInteresse(f); |
||
| 370 | } |
||
| 371 | } else { |
||
| 372 | callback.receiveErrornfeDistDFeInteresse(error); |
||
| 373 | } |
||
| 374 | } |
||
| 375 | |||
| 376 | public void onFault(org.apache.axis2.context.MessageContext faultContext) { |
||
| 377 | org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); |
||
| 378 | onError(fault); |
||
| 379 | } |
||
| 380 | |||
| 381 | public void onComplete() { |
||
| 382 | try { |
||
| 383 | _messageContext.getTransportOut().getSender().cleanup(_messageContext); |
||
| 384 | } catch (org.apache.axis2.AxisFault axisFault) { |
||
| 385 | callback.receiveErrornfeDistDFeInteresse(axisFault); |
||
| 386 | } |
||
| 387 | } |
||
| 388 | }); |
||
| 389 | |||
| 390 | |||
| 391 | org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; |
||
| 392 | if ( _operations[0].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { |
||
| 393 | _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); |
||
| 394 | _operations[0].setMessageReceiver( |
||
| 395 | _callbackReceiver); |
||
| 396 | } |
||
| 397 | |||
| 398 | //execute the operation client |
||
| 399 | _operationClient.execute(false); |
||
| 400 | |||
| 401 | } |
||
| 402 | |||
| 403 | |||
| 404 | |||
| 405 | /** |
||
| 406 | * A utility method that copies the namepaces from the SOAPEnvelope |
||
| 407 | */ |
||
| 408 | private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){ |
||
| 409 | java.util.Map returnMap = new java.util.HashMap(); |
||
| 410 | java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); |
||
| 411 | while (namespaceIterator.hasNext()) { |
||
| 412 | org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); |
||
| 413 | returnMap.put(ns.getPrefix(),ns.getNamespaceURI()); |
||
| 414 | } |
||
| 415 | return returnMap; |
||
| 416 | } |
||
| 417 | |||
| 418 | |||
| 419 | |||
| 420 | private javax.xml.namespace.QName[] opNameArray = null; |
||
| 421 | private boolean optimizeContent(javax.xml.namespace.QName opName) { |
||
| 422 | |||
| 423 | |||
| 424 | if (opNameArray == null) { |
||
| 425 | return false; |
||
| 426 | } |
||
| 427 | for (int i = 0; i < opNameArray.length; i++) { |
||
| 428 | if (opName.equals(opNameArray[i])) { |
||
| 429 | return true; |
||
| 430 | } |
||
| 431 | } |
||
| 432 | return false; |
||
| 433 | } |
||
| 434 | //https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx |
||
| 435 | public static class NfeDistDFeInteresseResult_type0 |
||
| 436 | implements org.apache.axis2.databinding.ADBBean{ |
||
| 437 | /* This type was generated from the piece of schema that had |
||
| 438 | name = nfeDistDFeInteresseResult_type0 |
||
| 439 | Namespace URI = http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe |
||
| 440 | Namespace Prefix = |
||
| 441 | */ |
||
| 442 | |||
| 443 | |||
| 444 | /** |
||
| 445 | * field for ExtraElement |
||
| 446 | */ |
||
| 447 | |||
| 448 | |||
| 449 | protected org.apache.axiom.om.OMElement localExtraElement ; |
||
| 450 | |||
| 451 | |||
| 452 | /** |
||
| 453 | * Auto generated getter method |
||
| 454 | * @return org.apache.axiom.om.OMElement |
||
| 455 | */ |
||
| 456 | public org.apache.axiom.om.OMElement getExtraElement(){ |
||
| 457 | return localExtraElement; |
||
| 458 | } |
||
| 459 | |||
| 460 | |||
| 461 | |||
| 462 | /** |
||
| 463 | * Auto generated setter method |
||
| 464 | * @param param ExtraElement |
||
| 465 | */ |
||
| 466 | public void setExtraElement(org.apache.axiom.om.OMElement param){ |
||
| 467 | |||
| 468 | this.localExtraElement=param; |
||
| 469 | |||
| 470 | |||
| 471 | } |
||
| 472 | |||
| 473 | |||
| 474 | |||
| 475 | |||
| 476 | /** |
||
| 477 | * |
||
| 478 | * @param parentQName |
||
| 479 | * @param factory |
||
| 480 | * @return org.apache.axiom.om.OMElement |
||
| 481 | */ |
||
| 482 | public org.apache.axiom.om.OMElement getOMElement ( |
||
| 483 | final javax.xml.namespace.QName parentQName, |
||
| 484 | final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ |
||
| 485 | |||
| 486 | |||
| 487 | |||
| 488 | org.apache.axiom.om.OMDataSource dataSource = |
||
| 489 | new org.apache.axis2.databinding.ADBDataSource(this,parentQName); |
||
| 490 | return factory.createOMElement(dataSource,parentQName); |
||
| 491 | |||
| 492 | } |
||
| 493 | |||
| 494 | public void serialize(final javax.xml.namespace.QName parentQName, |
||
| 495 | javax.xml.stream.XMLStreamWriter xmlWriter) |
||
| 496 | throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ |
||
| 497 | serialize(parentQName,xmlWriter,false); |
||
| 498 | } |
||
| 499 | |||
| 500 | public void serialize(final javax.xml.namespace.QName parentQName, |
||
| 501 | javax.xml.stream.XMLStreamWriter xmlWriter, |
||
| 502 | boolean serializeType) |
||
| 503 | throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ |
||
| 504 | |||
| 505 | |||
| 506 | |||
| 507 | |||
| 508 | java.lang.String prefix = null; |
||
| 509 | java.lang.String namespace = null; |
||
| 510 | |||
| 511 | |||
| 512 | prefix = parentQName.getPrefix(); |
||
| 513 | namespace = parentQName.getNamespaceURI(); |
||
| 514 | writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); |
||
| 515 | |||
| 516 | if (serializeType){ |
||
| 517 | |||
| 518 | |||
| 519 | java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe"); |
||
| 520 | if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ |
||
| 521 | writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", |
||
| 522 | namespacePrefix+":nfeDistDFeInteresseResult_type0", |
||
| 523 | xmlWriter); |
||
| 524 | } else { |
||
| 525 | writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", |
||
| 526 | "nfeDistDFeInteresseResult_type0", |
||
| 527 | xmlWriter); |
||
| 528 | } |
||
| 529 | |||
| 530 | |||
| 531 | } |
||
| 532 | |||
| 533 | |||
| 534 | if (localExtraElement != null) { |
||
| 535 | localExtraElement.serialize(xmlWriter); |
||
| 536 | } else { |
||
| 537 | throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); |
||
| 538 | } |
||
| 539 | |||
| 540 | xmlWriter.writeEndElement(); |
||
| 541 | |||
| 542 | |||
| 543 | } |
||
| 544 | |||
| 545 | private static java.lang.String generatePrefix(java.lang.String namespace) { |
||
| 546 | if(namespace.equals("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe")){ |
||
| 547 | return ""; |
||
| 548 | } |
||
| 549 | return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); |
||
| 550 | } |
||
| 551 | |||
| 552 | /** |
||
| 553 | * Utility method to write an element start tag. |
||
| 554 | */ |
||
| 555 | private void writeStartElement(java.lang.String prefix, java.lang.String namespace, java.lang.String localPart, |
||
| 556 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 557 | java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); |
||
| 558 | if (writerPrefix != null) { |
||
| 559 | xmlWriter.writeStartElement(namespace, localPart); |
||
| 560 | } else { |
||
| 561 | if (namespace.length() == 0) { |
||
| 562 | prefix = ""; |
||
| 563 | } else if (prefix == null) { |
||
| 564 | prefix = generatePrefix(namespace); |
||
| 565 | } |
||
| 566 | |||
| 567 | xmlWriter.writeStartElement(prefix, localPart, namespace); |
||
| 568 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 569 | xmlWriter.setPrefix(prefix, namespace); |
||
| 570 | } |
||
| 571 | } |
||
| 572 | |||
| 573 | /** |
||
| 574 | * Util method to write an attribute with the ns prefix |
||
| 575 | */ |
||
| 576 | private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, |
||
| 577 | java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ |
||
| 578 | if (xmlWriter.getPrefix(namespace) == null) { |
||
| 579 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 580 | xmlWriter.setPrefix(prefix, namespace); |
||
| 581 | } |
||
| 582 | xmlWriter.writeAttribute(namespace,attName,attValue); |
||
| 583 | } |
||
| 584 | |||
| 585 | /** |
||
| 586 | * Util method to write an attribute without the ns prefix |
||
| 587 | */ |
||
| 588 | private void writeAttribute(java.lang.String namespace,java.lang.String attName, |
||
| 589 | java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ |
||
| 590 | if (namespace.equals("")) { |
||
| 591 | xmlWriter.writeAttribute(attName,attValue); |
||
| 592 | } else { |
||
| 593 | registerPrefix(xmlWriter, namespace); |
||
| 594 | xmlWriter.writeAttribute(namespace,attName,attValue); |
||
| 595 | } |
||
| 596 | } |
||
| 597 | |||
| 598 | |||
| 599 | /** |
||
| 600 | * Util method to write an attribute without the ns prefix |
||
| 601 | */ |
||
| 602 | private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, |
||
| 603 | javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 604 | |||
| 605 | java.lang.String attributeNamespace = qname.getNamespaceURI(); |
||
| 606 | java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); |
||
| 607 | if (attributePrefix == null) { |
||
| 608 | attributePrefix = registerPrefix(xmlWriter, attributeNamespace); |
||
| 609 | } |
||
| 610 | java.lang.String attributeValue; |
||
| 611 | if (attributePrefix.trim().length() > 0) { |
||
| 612 | attributeValue = attributePrefix + ":" + qname.getLocalPart(); |
||
| 613 | } else { |
||
| 614 | attributeValue = qname.getLocalPart(); |
||
| 615 | } |
||
| 616 | |||
| 617 | if (namespace.equals("")) { |
||
| 618 | xmlWriter.writeAttribute(attName, attributeValue); |
||
| 619 | } else { |
||
| 620 | registerPrefix(xmlWriter, namespace); |
||
| 621 | xmlWriter.writeAttribute(namespace, attName, attributeValue); |
||
| 622 | } |
||
| 623 | } |
||
| 624 | /** |
||
| 625 | * method to handle Qnames |
||
| 626 | */ |
||
| 627 | |||
| 628 | private void writeQName(javax.xml.namespace.QName qname, |
||
| 629 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 630 | java.lang.String namespaceURI = qname.getNamespaceURI(); |
||
| 631 | if (namespaceURI != null) { |
||
| 632 | java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); |
||
| 633 | if (prefix == null) { |
||
| 634 | prefix = generatePrefix(namespaceURI); |
||
| 635 | xmlWriter.writeNamespace(prefix, namespaceURI); |
||
| 636 | xmlWriter.setPrefix(prefix,namespaceURI); |
||
| 637 | } |
||
| 638 | |||
| 639 | if (prefix.trim().length() > 0){ |
||
| 640 | xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 641 | } else { |
||
| 642 | // i.e this is the default namespace |
||
| 643 | xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 644 | } |
||
| 645 | |||
| 646 | } else { |
||
| 647 | xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 648 | } |
||
| 649 | } |
||
| 650 | |||
| 651 | private void writeQNames(javax.xml.namespace.QName[] qnames, |
||
| 652 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 653 | |||
| 654 | if (qnames != null) { |
||
| 655 | // we have to store this data until last moment since it is not possible to write any |
||
| 656 | // namespace data after writing the charactor data |
||
| 657 | java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); |
||
| 658 | java.lang.String namespaceURI = null; |
||
| 659 | java.lang.String prefix = null; |
||
| 660 | |||
| 661 | for (int i = 0; i < qnames.length; i++) { |
||
| 662 | if (i > 0) { |
||
| 663 | stringToWrite.append(" "); |
||
| 664 | } |
||
| 665 | namespaceURI = qnames[i].getNamespaceURI(); |
||
| 666 | if (namespaceURI != null) { |
||
| 667 | prefix = xmlWriter.getPrefix(namespaceURI); |
||
| 668 | if ((prefix == null) || (prefix.length() == 0)) { |
||
| 669 | prefix = generatePrefix(namespaceURI); |
||
| 670 | xmlWriter.writeNamespace(prefix, namespaceURI); |
||
| 671 | xmlWriter.setPrefix(prefix,namespaceURI); |
||
| 672 | } |
||
| 673 | |||
| 674 | if (prefix.trim().length() > 0){ |
||
| 675 | stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 676 | } else { |
||
| 677 | stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 678 | } |
||
| 679 | } else { |
||
| 680 | stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 681 | } |
||
| 682 | } |
||
| 683 | xmlWriter.writeCharacters(stringToWrite.toString()); |
||
| 684 | } |
||
| 685 | |||
| 686 | } |
||
| 687 | |||
| 688 | |||
| 689 | /** |
||
| 690 | * Register a namespace prefix |
||
| 691 | */ |
||
| 692 | private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { |
||
| 693 | java.lang.String prefix = xmlWriter.getPrefix(namespace); |
||
| 694 | if (prefix == null) { |
||
| 695 | prefix = generatePrefix(namespace); |
||
| 696 | javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); |
||
| 697 | while (true) { |
||
| 698 | java.lang.String uri = nsContext.getNamespaceURI(prefix); |
||
| 699 | if (uri == null || uri.length() == 0) { |
||
| 700 | break; |
||
| 701 | } |
||
| 702 | prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); |
||
| 703 | } |
||
| 704 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 705 | xmlWriter.setPrefix(prefix, namespace); |
||
| 706 | } |
||
| 707 | return prefix; |
||
| 708 | } |
||
| 709 | |||
| 710 | |||
| 711 | |||
| 712 | /** |
||
| 713 | * databinding method to get an XML representation of this object |
||
| 714 | * |
||
| 715 | */ |
||
| 716 | public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) |
||
| 717 | throws org.apache.axis2.databinding.ADBException{ |
||
| 718 | |||
| 719 | |||
| 720 | |||
| 721 | java.util.ArrayList elementList = new java.util.ArrayList(); |
||
| 722 | java.util.ArrayList attribList = new java.util.ArrayList(); |
||
| 723 | |||
| 724 | |||
| 725 | if (localExtraElement != null){ |
||
| 726 | elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); |
||
| 727 | elementList.add(localExtraElement); |
||
| 728 | } else { |
||
| 729 | throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); |
||
| 730 | } |
||
| 731 | |||
| 732 | |||
| 733 | return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); |
||
| 734 | |||
| 735 | |||
| 736 | |||
| 737 | } |
||
| 738 | |||
| 739 | |||
| 740 | |||
| 741 | /** |
||
| 742 | * Factory class that keeps the parse method |
||
| 743 | */ |
||
| 744 | public static class Factory{ |
||
| 745 | |||
| 746 | |||
| 747 | |||
| 748 | |||
| 749 | /** |
||
| 750 | * static method to create the object |
||
| 751 | * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable |
||
| 752 | * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element |
||
| 753 | * Postcondition: If this object is an element, the reader is positioned at its end element |
||
| 754 | * If this object is a complex type, the reader is positioned at the end element of its outer element |
||
| 755 | */ |
||
| 756 | public static NfeDistDFeInteresseResult_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ |
||
| 757 | NfeDistDFeInteresseResult_type0 object = |
||
| 758 | new NfeDistDFeInteresseResult_type0(); |
||
| 759 | |||
| 760 | int event; |
||
| 761 | java.lang.String nillableValue = null; |
||
| 762 | java.lang.String prefix =""; |
||
| 763 | java.lang.String namespaceuri =""; |
||
| 764 | try { |
||
| 765 | |||
| 766 | while (!reader.isStartElement() && !reader.isEndElement()) |
||
| 767 | reader.next(); |
||
| 768 | |||
| 769 | |||
| 770 | if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ |
||
| 771 | java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", |
||
| 772 | "type"); |
||
| 773 | if (fullTypeName!=null){ |
||
| 774 | java.lang.String nsPrefix = null; |
||
| 775 | if (fullTypeName.indexOf(":") > -1){ |
||
| 776 | nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); |
||
| 777 | } |
||
| 778 | nsPrefix = nsPrefix==null?"":nsPrefix; |
||
| 779 | |||
| 780 | java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); |
||
| 781 | |||
| 782 | if (!"nfeDistDFeInteresseResult_type0".equals(type)){ |
||
| 783 | //find namespace for the prefix |
||
| 784 | java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); |
||
| 785 | return (NfeDistDFeInteresseResult_type0)ExtensionMapper.getTypeObject( |
||
| 786 | nsUri,type,reader); |
||
| 787 | } |
||
| 788 | |||
| 789 | |||
| 790 | } |
||
| 791 | |||
| 792 | |||
| 793 | } |
||
| 794 | |||
| 795 | |||
| 796 | |||
| 797 | |||
| 798 | // Note all attributes that were handled. Used to differ normal attributes |
||
| 799 | // from anyAttributes. |
||
| 800 | java.util.Vector handledAttributes = new java.util.Vector(); |
||
| 801 | |||
| 802 | |||
| 803 | |||
| 804 | |||
| 805 | reader.next(); |
||
| 806 | |||
| 807 | |||
| 808 | while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); |
||
| 809 | |||
| 810 | if (reader.isStartElement()){ |
||
| 811 | |||
| 812 | |||
| 813 | |||
| 814 | //use the QName from the parser as the name for the builder |
||
| 815 | javax.xml.namespace.QName startQname1 = reader.getName(); |
||
| 816 | |||
| 817 | // We need to wrap the reader so that it produces a fake START_DOCUMENT event |
||
| 818 | // this is needed by the builder classes |
||
| 819 | org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 = |
||
| 820 | new org.apache.axis2.databinding.utils.NamedStaxOMBuilder( |
||
| 821 | new org.apache.axis2.util.StreamWrapper(reader),startQname1); |
||
| 822 | object.setExtraElement(builder1.getOMElement()); |
||
| 823 | |||
| 824 | reader.next(); |
||
| 825 | |||
| 826 | } // End of if for expected property start element |
||
| 827 | |||
| 828 | else{ |
||
| 829 | // A start element we are not expecting indicates an invalid parameter was passed |
||
| 830 | throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); |
||
| 831 | } |
||
| 832 | |||
| 833 | while (!reader.isStartElement() && !reader.isEndElement()) |
||
| 834 | reader.next(); |
||
| 835 | |||
| 836 | if (reader.isStartElement()) |
||
| 837 | // A start element we are not expecting indicates a trailing invalid property |
||
| 838 | throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); |
||
| 839 | |||
| 840 | |||
| 841 | |||
| 842 | |||
| 843 | } catch (javax.xml.stream.XMLStreamException e) { |
||
| 844 | throw new java.lang.Exception(e); |
||
| 845 | } |
||
| 846 | |||
| 847 | return object; |
||
| 848 | } |
||
| 849 | |||
| 850 | }//end of factory class |
||
| 851 | |||
| 852 | |||
| 853 | |||
| 854 | } |
||
| 855 | |||
| 856 | |||
| 857 | public static class ExtensionMapper{ |
||
| 858 | |||
| 859 | public static java.lang.Object getTypeObject(java.lang.String namespaceURI, |
||
| 860 | java.lang.String typeName, |
||
| 861 | javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ |
||
| 862 | |||
| 863 | |||
| 864 | if ( |
||
| 865 | "http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe".equals(namespaceURI) && |
||
| 866 | "nfeDadosMsg_type0".equals(typeName)){ |
||
| 867 | |||
| 868 | return NfeDadosMsg_type0.Factory.parse(reader); |
||
| 869 | |||
| 870 | |||
| 871 | } |
||
| 872 | |||
| 873 | |||
| 874 | if ( |
||
| 875 | "http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe".equals(namespaceURI) && |
||
| 876 | "nfeDistDFeInteresseResult_type0".equals(typeName)){ |
||
| 877 | |||
| 878 | return NfeDistDFeInteresseResult_type0.Factory.parse(reader); |
||
| 879 | |||
| 880 | |||
| 881 | } |
||
| 882 | |||
| 883 | |||
| 884 | throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); |
||
| 885 | } |
||
| 886 | |||
| 887 | } |
||
| 888 | |||
| 889 | public static class NfeDadosMsg_type0 |
||
| 890 | implements org.apache.axis2.databinding.ADBBean{ |
||
| 891 | /* This type was generated from the piece of schema that had |
||
| 892 | name = nfeDadosMsg_type0 |
||
| 893 | Namespace URI = http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe |
||
| 894 | Namespace Prefix = |
||
| 895 | */ |
||
| 896 | |||
| 897 | |||
| 898 | /** |
||
| 899 | * field for ExtraElement |
||
| 900 | */ |
||
| 901 | |||
| 902 | |||
| 903 | protected org.apache.axiom.om.OMElement localExtraElement ; |
||
| 904 | |||
| 905 | |||
| 906 | /** |
||
| 907 | * Auto generated getter method |
||
| 908 | * @return org.apache.axiom.om.OMElement |
||
| 909 | */ |
||
| 910 | public org.apache.axiom.om.OMElement getExtraElement(){ |
||
| 911 | return localExtraElement; |
||
| 912 | } |
||
| 913 | |||
| 914 | |||
| 915 | |||
| 916 | /** |
||
| 917 | * Auto generated setter method |
||
| 918 | * @param param ExtraElement |
||
| 919 | */ |
||
| 920 | public void setExtraElement(org.apache.axiom.om.OMElement param){ |
||
| 921 | |||
| 922 | this.localExtraElement=param; |
||
| 923 | |||
| 924 | |||
| 925 | } |
||
| 926 | |||
| 927 | |||
| 928 | |||
| 929 | |||
| 930 | /** |
||
| 931 | * |
||
| 932 | * @param parentQName |
||
| 933 | * @param factory |
||
| 934 | * @return org.apache.axiom.om.OMElement |
||
| 935 | */ |
||
| 936 | public org.apache.axiom.om.OMElement getOMElement ( |
||
| 937 | final javax.xml.namespace.QName parentQName, |
||
| 938 | final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ |
||
| 939 | |||
| 940 | |||
| 941 | |||
| 942 | org.apache.axiom.om.OMDataSource dataSource = |
||
| 943 | new org.apache.axis2.databinding.ADBDataSource(this,parentQName); |
||
| 944 | return factory.createOMElement(dataSource,parentQName); |
||
| 945 | |||
| 946 | } |
||
| 947 | |||
| 948 | public void serialize(final javax.xml.namespace.QName parentQName, |
||
| 949 | javax.xml.stream.XMLStreamWriter xmlWriter) |
||
| 950 | throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ |
||
| 951 | serialize(parentQName,xmlWriter,false); |
||
| 952 | } |
||
| 953 | |||
| 954 | public void serialize(final javax.xml.namespace.QName parentQName, |
||
| 955 | javax.xml.stream.XMLStreamWriter xmlWriter, |
||
| 956 | boolean serializeType) |
||
| 957 | throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ |
||
| 958 | |||
| 959 | |||
| 960 | |||
| 961 | |||
| 962 | java.lang.String prefix = null; |
||
| 963 | java.lang.String namespace = null; |
||
| 964 | |||
| 965 | |||
| 966 | prefix = parentQName.getPrefix(); |
||
| 967 | namespace = parentQName.getNamespaceURI(); |
||
| 968 | writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); |
||
| 969 | |||
| 970 | if (serializeType){ |
||
| 971 | |||
| 972 | |||
| 973 | java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe"); |
||
| 974 | if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ |
||
| 975 | writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", |
||
| 976 | namespacePrefix+":nfeDadosMsg_type0", |
||
| 977 | xmlWriter); |
||
| 978 | } else { |
||
| 979 | writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", |
||
| 980 | "nfeDadosMsg_type0", |
||
| 981 | xmlWriter); |
||
| 982 | } |
||
| 983 | |||
| 984 | |||
| 985 | } |
||
| 986 | |||
| 987 | |||
| 988 | if (localExtraElement != null) { |
||
| 989 | localExtraElement.serialize(xmlWriter); |
||
| 990 | } else { |
||
| 991 | throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); |
||
| 992 | } |
||
| 993 | |||
| 994 | xmlWriter.writeEndElement(); |
||
| 995 | |||
| 996 | |||
| 997 | } |
||
| 998 | |||
| 999 | private static java.lang.String generatePrefix(java.lang.String namespace) { |
||
| 1000 | if(namespace.equals("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe")){ |
||
| 1001 | return ""; |
||
| 1002 | } |
||
| 1003 | return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); |
||
| 1004 | } |
||
| 1005 | |||
| 1006 | /** |
||
| 1007 | * Utility method to write an element start tag. |
||
| 1008 | */ |
||
| 1009 | private void writeStartElement(java.lang.String prefix, java.lang.String namespace, java.lang.String localPart, |
||
| 1010 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1011 | java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); |
||
| 1012 | if (writerPrefix != null) { |
||
| 1013 | xmlWriter.writeStartElement(namespace, localPart); |
||
| 1014 | } else { |
||
| 1015 | if (namespace.length() == 0) { |
||
| 1016 | prefix = ""; |
||
| 1017 | } else if (prefix == null) { |
||
| 1018 | prefix = generatePrefix(namespace); |
||
| 1019 | } |
||
| 1020 | |||
| 1021 | xmlWriter.writeStartElement(prefix, localPart, namespace); |
||
| 1022 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 1023 | xmlWriter.setPrefix(prefix, namespace); |
||
| 1024 | } |
||
| 1025 | } |
||
| 1026 | |||
| 1027 | /** |
||
| 1028 | * Util method to write an attribute with the ns prefix |
||
| 1029 | */ |
||
| 1030 | private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, |
||
| 1031 | java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ |
||
| 1032 | if (xmlWriter.getPrefix(namespace) == null) { |
||
| 1033 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 1034 | xmlWriter.setPrefix(prefix, namespace); |
||
| 1035 | } |
||
| 1036 | xmlWriter.writeAttribute(namespace,attName,attValue); |
||
| 1037 | } |
||
| 1038 | |||
| 1039 | /** |
||
| 1040 | * Util method to write an attribute without the ns prefix |
||
| 1041 | */ |
||
| 1042 | private void writeAttribute(java.lang.String namespace,java.lang.String attName, |
||
| 1043 | java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ |
||
| 1044 | if (namespace.equals("")) { |
||
| 1045 | xmlWriter.writeAttribute(attName,attValue); |
||
| 1046 | } else { |
||
| 1047 | registerPrefix(xmlWriter, namespace); |
||
| 1048 | xmlWriter.writeAttribute(namespace,attName,attValue); |
||
| 1049 | } |
||
| 1050 | } |
||
| 1051 | |||
| 1052 | |||
| 1053 | /** |
||
| 1054 | * Util method to write an attribute without the ns prefix |
||
| 1055 | */ |
||
| 1056 | private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, |
||
| 1057 | javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1058 | |||
| 1059 | java.lang.String attributeNamespace = qname.getNamespaceURI(); |
||
| 1060 | java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); |
||
| 1061 | if (attributePrefix == null) { |
||
| 1062 | attributePrefix = registerPrefix(xmlWriter, attributeNamespace); |
||
| 1063 | } |
||
| 1064 | java.lang.String attributeValue; |
||
| 1065 | if (attributePrefix.trim().length() > 0) { |
||
| 1066 | attributeValue = attributePrefix + ":" + qname.getLocalPart(); |
||
| 1067 | } else { |
||
| 1068 | attributeValue = qname.getLocalPart(); |
||
| 1069 | } |
||
| 1070 | |||
| 1071 | if (namespace.equals("")) { |
||
| 1072 | xmlWriter.writeAttribute(attName, attributeValue); |
||
| 1073 | } else { |
||
| 1074 | registerPrefix(xmlWriter, namespace); |
||
| 1075 | xmlWriter.writeAttribute(namespace, attName, attributeValue); |
||
| 1076 | } |
||
| 1077 | } |
||
| 1078 | /** |
||
| 1079 | * method to handle Qnames |
||
| 1080 | */ |
||
| 1081 | |||
| 1082 | private void writeQName(javax.xml.namespace.QName qname, |
||
| 1083 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1084 | java.lang.String namespaceURI = qname.getNamespaceURI(); |
||
| 1085 | if (namespaceURI != null) { |
||
| 1086 | java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); |
||
| 1087 | if (prefix == null) { |
||
| 1088 | prefix = generatePrefix(namespaceURI); |
||
| 1089 | xmlWriter.writeNamespace(prefix, namespaceURI); |
||
| 1090 | xmlWriter.setPrefix(prefix,namespaceURI); |
||
| 1091 | } |
||
| 1092 | |||
| 1093 | if (prefix.trim().length() > 0){ |
||
| 1094 | xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 1095 | } else { |
||
| 1096 | // i.e this is the default namespace |
||
| 1097 | xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 1098 | } |
||
| 1099 | |||
| 1100 | } else { |
||
| 1101 | xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 1102 | } |
||
| 1103 | } |
||
| 1104 | |||
| 1105 | private void writeQNames(javax.xml.namespace.QName[] qnames, |
||
| 1106 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1107 | |||
| 1108 | if (qnames != null) { |
||
| 1109 | // we have to store this data until last moment since it is not possible to write any |
||
| 1110 | // namespace data after writing the charactor data |
||
| 1111 | java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); |
||
| 1112 | java.lang.String namespaceURI = null; |
||
| 1113 | java.lang.String prefix = null; |
||
| 1114 | |||
| 1115 | for (int i = 0; i < qnames.length; i++) { |
||
| 1116 | if (i > 0) { |
||
| 1117 | stringToWrite.append(" "); |
||
| 1118 | } |
||
| 1119 | namespaceURI = qnames[i].getNamespaceURI(); |
||
| 1120 | if (namespaceURI != null) { |
||
| 1121 | prefix = xmlWriter.getPrefix(namespaceURI); |
||
| 1122 | if ((prefix == null) || (prefix.length() == 0)) { |
||
| 1123 | prefix = generatePrefix(namespaceURI); |
||
| 1124 | xmlWriter.writeNamespace(prefix, namespaceURI); |
||
| 1125 | xmlWriter.setPrefix(prefix,namespaceURI); |
||
| 1126 | } |
||
| 1127 | |||
| 1128 | if (prefix.trim().length() > 0){ |
||
| 1129 | stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 1130 | } else { |
||
| 1131 | stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 1132 | } |
||
| 1133 | } else { |
||
| 1134 | stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 1135 | } |
||
| 1136 | } |
||
| 1137 | xmlWriter.writeCharacters(stringToWrite.toString()); |
||
| 1138 | } |
||
| 1139 | |||
| 1140 | } |
||
| 1141 | |||
| 1142 | |||
| 1143 | /** |
||
| 1144 | * Register a namespace prefix |
||
| 1145 | */ |
||
| 1146 | private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { |
||
| 1147 | java.lang.String prefix = xmlWriter.getPrefix(namespace); |
||
| 1148 | if (prefix == null) { |
||
| 1149 | prefix = generatePrefix(namespace); |
||
| 1150 | javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); |
||
| 1151 | while (true) { |
||
| 1152 | java.lang.String uri = nsContext.getNamespaceURI(prefix); |
||
| 1153 | if (uri == null || uri.length() == 0) { |
||
| 1154 | break; |
||
| 1155 | } |
||
| 1156 | prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); |
||
| 1157 | } |
||
| 1158 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 1159 | xmlWriter.setPrefix(prefix, namespace); |
||
| 1160 | } |
||
| 1161 | return prefix; |
||
| 1162 | } |
||
| 1163 | |||
| 1164 | |||
| 1165 | |||
| 1166 | /** |
||
| 1167 | * databinding method to get an XML representation of this object |
||
| 1168 | * |
||
| 1169 | */ |
||
| 1170 | public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) |
||
| 1171 | throws org.apache.axis2.databinding.ADBException{ |
||
| 1172 | |||
| 1173 | |||
| 1174 | |||
| 1175 | java.util.ArrayList elementList = new java.util.ArrayList(); |
||
| 1176 | java.util.ArrayList attribList = new java.util.ArrayList(); |
||
| 1177 | |||
| 1178 | |||
| 1179 | if (localExtraElement != null){ |
||
| 1180 | elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); |
||
| 1181 | elementList.add(localExtraElement); |
||
| 1182 | } else { |
||
| 1183 | throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); |
||
| 1184 | } |
||
| 1185 | |||
| 1186 | |||
| 1187 | return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); |
||
| 1188 | |||
| 1189 | |||
| 1190 | |||
| 1191 | } |
||
| 1192 | |||
| 1193 | |||
| 1194 | |||
| 1195 | /** |
||
| 1196 | * Factory class that keeps the parse method |
||
| 1197 | */ |
||
| 1198 | public static class Factory{ |
||
| 1199 | |||
| 1200 | |||
| 1201 | |||
| 1202 | |||
| 1203 | /** |
||
| 1204 | * static method to create the object |
||
| 1205 | * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable |
||
| 1206 | * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element |
||
| 1207 | * Postcondition: If this object is an element, the reader is positioned at its end element |
||
| 1208 | * If this object is a complex type, the reader is positioned at the end element of its outer element |
||
| 1209 | */ |
||
| 1210 | public static NfeDadosMsg_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ |
||
| 1211 | NfeDadosMsg_type0 object = |
||
| 1212 | new NfeDadosMsg_type0(); |
||
| 1213 | |||
| 1214 | int event; |
||
| 1215 | java.lang.String nillableValue = null; |
||
| 1216 | java.lang.String prefix =""; |
||
| 1217 | java.lang.String namespaceuri =""; |
||
| 1218 | try { |
||
| 1219 | |||
| 1220 | while (!reader.isStartElement() && !reader.isEndElement()) |
||
| 1221 | reader.next(); |
||
| 1222 | |||
| 1223 | |||
| 1224 | if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ |
||
| 1225 | java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", |
||
| 1226 | "type"); |
||
| 1227 | if (fullTypeName!=null){ |
||
| 1228 | java.lang.String nsPrefix = null; |
||
| 1229 | if (fullTypeName.indexOf(":") > -1){ |
||
| 1230 | nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); |
||
| 1231 | } |
||
| 1232 | nsPrefix = nsPrefix==null?"":nsPrefix; |
||
| 1233 | |||
| 1234 | java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); |
||
| 1235 | |||
| 1236 | if (!"nfeDadosMsg_type0".equals(type)){ |
||
| 1237 | //find namespace for the prefix |
||
| 1238 | java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); |
||
| 1239 | return (NfeDadosMsg_type0)ExtensionMapper.getTypeObject( |
||
| 1240 | nsUri,type,reader); |
||
| 1241 | } |
||
| 1242 | |||
| 1243 | |||
| 1244 | } |
||
| 1245 | |||
| 1246 | |||
| 1247 | } |
||
| 1248 | |||
| 1249 | |||
| 1250 | |||
| 1251 | |||
| 1252 | // Note all attributes that were handled. Used to differ normal attributes |
||
| 1253 | // from anyAttributes. |
||
| 1254 | java.util.Vector handledAttributes = new java.util.Vector(); |
||
| 1255 | |||
| 1256 | |||
| 1257 | |||
| 1258 | |||
| 1259 | reader.next(); |
||
| 1260 | |||
| 1261 | |||
| 1262 | while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); |
||
| 1263 | |||
| 1264 | if (reader.isStartElement()){ |
||
| 1265 | |||
| 1266 | |||
| 1267 | |||
| 1268 | //use the QName from the parser as the name for the builder |
||
| 1269 | javax.xml.namespace.QName startQname1 = reader.getName(); |
||
| 1270 | |||
| 1271 | // We need to wrap the reader so that it produces a fake START_DOCUMENT event |
||
| 1272 | // this is needed by the builder classes |
||
| 1273 | org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 = |
||
| 1274 | new org.apache.axis2.databinding.utils.NamedStaxOMBuilder( |
||
| 1275 | new org.apache.axis2.util.StreamWrapper(reader),startQname1); |
||
| 1276 | object.setExtraElement(builder1.getOMElement()); |
||
| 1277 | |||
| 1278 | reader.next(); |
||
| 1279 | |||
| 1280 | } // End of if for expected property start element |
||
| 1281 | |||
| 1282 | else{ |
||
| 1283 | // A start element we are not expecting indicates an invalid parameter was passed |
||
| 1284 | throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); |
||
| 1285 | } |
||
| 1286 | |||
| 1287 | while (!reader.isStartElement() && !reader.isEndElement()) |
||
| 1288 | reader.next(); |
||
| 1289 | |||
| 1290 | if (reader.isStartElement()) |
||
| 1291 | // A start element we are not expecting indicates a trailing invalid property |
||
| 1292 | throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); |
||
| 1293 | |||
| 1294 | |||
| 1295 | |||
| 1296 | |||
| 1297 | } catch (javax.xml.stream.XMLStreamException e) { |
||
| 1298 | throw new java.lang.Exception(e); |
||
| 1299 | } |
||
| 1300 | |||
| 1301 | return object; |
||
| 1302 | } |
||
| 1303 | |||
| 1304 | }//end of factory class |
||
| 1305 | |||
| 1306 | |||
| 1307 | |||
| 1308 | } |
||
| 1309 | |||
| 1310 | |||
| 1311 | public static class NfeDistDFeInteresse |
||
| 1312 | implements org.apache.axis2.databinding.ADBBean{ |
||
| 1313 | |||
| 1314 | public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( |
||
| 1315 | "http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe", |
||
| 1316 | "nfeDistDFeInteresse", |
||
| 1317 | ""); |
||
| 1318 | |||
| 1319 | |||
| 1320 | |||
| 1321 | /** |
||
| 1322 | * field for NfeDadosMsg |
||
| 1323 | */ |
||
| 1324 | |||
| 1325 | |||
| 1326 | protected NfeDadosMsg_type0 localNfeDadosMsg ; |
||
| 1327 | |||
| 1328 | /* This tracker boolean wil be used to detect whether the user called the set method |
||
| 1329 | * for this attribute. It will be used to determine whether to include this field |
||
| 1330 | * in the serialized XML |
||
| 1331 | */ |
||
| 1332 | protected boolean localNfeDadosMsgTracker = false ; |
||
| 1333 | |||
| 1334 | public boolean isNfeDadosMsgSpecified(){ |
||
| 1335 | return localNfeDadosMsgTracker; |
||
| 1336 | } |
||
| 1337 | |||
| 1338 | |||
| 1339 | |||
| 1340 | /** |
||
| 1341 | * Auto generated getter method |
||
| 1342 | * @return NfeDadosMsg_type0 |
||
| 1343 | */ |
||
| 1344 | public NfeDadosMsg_type0 getNfeDadosMsg(){ |
||
| 1345 | return localNfeDadosMsg; |
||
| 1346 | } |
||
| 1347 | |||
| 1348 | |||
| 1349 | |||
| 1350 | /** |
||
| 1351 | * Auto generated setter method |
||
| 1352 | * @param param NfeDadosMsg |
||
| 1353 | */ |
||
| 1354 | public void setNfeDadosMsg(NfeDadosMsg_type0 param){ |
||
| 1355 | localNfeDadosMsgTracker = param != null; |
||
| 1356 | |||
| 1357 | this.localNfeDadosMsg=param; |
||
| 1358 | |||
| 1359 | |||
| 1360 | } |
||
| 1361 | |||
| 1362 | |||
| 1363 | |||
| 1364 | |||
| 1365 | /** |
||
| 1366 | * |
||
| 1367 | * @param parentQName |
||
| 1368 | * @param factory |
||
| 1369 | * @return org.apache.axiom.om.OMElement |
||
| 1370 | */ |
||
| 1371 | public org.apache.axiom.om.OMElement getOMElement ( |
||
| 1372 | final javax.xml.namespace.QName parentQName, |
||
| 1373 | final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ |
||
| 1374 | |||
| 1375 | |||
| 1376 | |||
| 1377 | org.apache.axiom.om.OMDataSource dataSource = |
||
| 1378 | new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME); |
||
| 1379 | return factory.createOMElement(dataSource,MY_QNAME); |
||
| 1380 | |||
| 1381 | } |
||
| 1382 | |||
| 1383 | public void serialize(final javax.xml.namespace.QName parentQName, |
||
| 1384 | javax.xml.stream.XMLStreamWriter xmlWriter) |
||
| 1385 | throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ |
||
| 1386 | serialize(parentQName,xmlWriter,false); |
||
| 1387 | } |
||
| 1388 | |||
| 1389 | public void serialize(final javax.xml.namespace.QName parentQName, |
||
| 1390 | javax.xml.stream.XMLStreamWriter xmlWriter, |
||
| 1391 | boolean serializeType) |
||
| 1392 | throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ |
||
| 1393 | |||
| 1394 | |||
| 1395 | |||
| 1396 | |||
| 1397 | java.lang.String prefix = null; |
||
| 1398 | java.lang.String namespace = null; |
||
| 1399 | |||
| 1400 | |||
| 1401 | prefix = parentQName.getPrefix(); |
||
| 1402 | namespace = parentQName.getNamespaceURI(); |
||
| 1403 | writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); |
||
| 1404 | |||
| 1405 | if (serializeType){ |
||
| 1406 | |||
| 1407 | |||
| 1408 | java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe"); |
||
| 1409 | if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ |
||
| 1410 | writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", |
||
| 1411 | namespacePrefix+":nfeDistDFeInteresse", |
||
| 1412 | xmlWriter); |
||
| 1413 | } else { |
||
| 1414 | writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", |
||
| 1415 | "nfeDistDFeInteresse", |
||
| 1416 | xmlWriter); |
||
| 1417 | } |
||
| 1418 | |||
| 1419 | |||
| 1420 | } |
||
| 1421 | if (localNfeDadosMsgTracker){ |
||
| 1422 | if (localNfeDadosMsg==null){ |
||
| 1423 | throw new org.apache.axis2.databinding.ADBException("nfeDadosMsg cannot be null!!"); |
||
| 1424 | } |
||
| 1425 | localNfeDadosMsg.serialize(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe","nfeDadosMsg"), |
||
| 1426 | xmlWriter); |
||
| 1427 | } |
||
| 1428 | xmlWriter.writeEndElement(); |
||
| 1429 | |||
| 1430 | |||
| 1431 | } |
||
| 1432 | |||
| 1433 | private static java.lang.String generatePrefix(java.lang.String namespace) { |
||
| 1434 | if(namespace.equals("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe")){ |
||
| 1435 | return ""; |
||
| 1436 | } |
||
| 1437 | return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); |
||
| 1438 | } |
||
| 1439 | |||
| 1440 | /** |
||
| 1441 | * Utility method to write an element start tag. |
||
| 1442 | */ |
||
| 1443 | private void writeStartElement(java.lang.String prefix, java.lang.String namespace, java.lang.String localPart, |
||
| 1444 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1445 | java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); |
||
| 1446 | if (writerPrefix != null) { |
||
| 1447 | xmlWriter.writeStartElement(namespace, localPart); |
||
| 1448 | } else { |
||
| 1449 | if (namespace.length() == 0) { |
||
| 1450 | prefix = ""; |
||
| 1451 | } else if (prefix == null) { |
||
| 1452 | prefix = generatePrefix(namespace); |
||
| 1453 | } |
||
| 1454 | |||
| 1455 | xmlWriter.writeStartElement(prefix, localPart, namespace); |
||
| 1456 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 1457 | xmlWriter.setPrefix(prefix, namespace); |
||
| 1458 | } |
||
| 1459 | } |
||
| 1460 | |||
| 1461 | /** |
||
| 1462 | * Util method to write an attribute with the ns prefix |
||
| 1463 | */ |
||
| 1464 | private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, |
||
| 1465 | java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ |
||
| 1466 | if (xmlWriter.getPrefix(namespace) == null) { |
||
| 1467 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 1468 | xmlWriter.setPrefix(prefix, namespace); |
||
| 1469 | } |
||
| 1470 | xmlWriter.writeAttribute(namespace,attName,attValue); |
||
| 1471 | } |
||
| 1472 | |||
| 1473 | /** |
||
| 1474 | * Util method to write an attribute without the ns prefix |
||
| 1475 | */ |
||
| 1476 | private void writeAttribute(java.lang.String namespace,java.lang.String attName, |
||
| 1477 | java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ |
||
| 1478 | if (namespace.equals("")) { |
||
| 1479 | xmlWriter.writeAttribute(attName,attValue); |
||
| 1480 | } else { |
||
| 1481 | registerPrefix(xmlWriter, namespace); |
||
| 1482 | xmlWriter.writeAttribute(namespace,attName,attValue); |
||
| 1483 | } |
||
| 1484 | } |
||
| 1485 | |||
| 1486 | |||
| 1487 | /** |
||
| 1488 | * Util method to write an attribute without the ns prefix |
||
| 1489 | */ |
||
| 1490 | private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, |
||
| 1491 | javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1492 | |||
| 1493 | java.lang.String attributeNamespace = qname.getNamespaceURI(); |
||
| 1494 | java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); |
||
| 1495 | if (attributePrefix == null) { |
||
| 1496 | attributePrefix = registerPrefix(xmlWriter, attributeNamespace); |
||
| 1497 | } |
||
| 1498 | java.lang.String attributeValue; |
||
| 1499 | if (attributePrefix.trim().length() > 0) { |
||
| 1500 | attributeValue = attributePrefix + ":" + qname.getLocalPart(); |
||
| 1501 | } else { |
||
| 1502 | attributeValue = qname.getLocalPart(); |
||
| 1503 | } |
||
| 1504 | |||
| 1505 | if (namespace.equals("")) { |
||
| 1506 | xmlWriter.writeAttribute(attName, attributeValue); |
||
| 1507 | } else { |
||
| 1508 | registerPrefix(xmlWriter, namespace); |
||
| 1509 | xmlWriter.writeAttribute(namespace, attName, attributeValue); |
||
| 1510 | } |
||
| 1511 | } |
||
| 1512 | /** |
||
| 1513 | * method to handle Qnames |
||
| 1514 | */ |
||
| 1515 | |||
| 1516 | private void writeQName(javax.xml.namespace.QName qname, |
||
| 1517 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1518 | java.lang.String namespaceURI = qname.getNamespaceURI(); |
||
| 1519 | if (namespaceURI != null) { |
||
| 1520 | java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); |
||
| 1521 | if (prefix == null) { |
||
| 1522 | prefix = generatePrefix(namespaceURI); |
||
| 1523 | xmlWriter.writeNamespace(prefix, namespaceURI); |
||
| 1524 | xmlWriter.setPrefix(prefix,namespaceURI); |
||
| 1525 | } |
||
| 1526 | |||
| 1527 | if (prefix.trim().length() > 0){ |
||
| 1528 | xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 1529 | } else { |
||
| 1530 | // i.e this is the default namespace |
||
| 1531 | xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 1532 | } |
||
| 1533 | |||
| 1534 | } else { |
||
| 1535 | xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 1536 | } |
||
| 1537 | } |
||
| 1538 | |||
| 1539 | private void writeQNames(javax.xml.namespace.QName[] qnames, |
||
| 1540 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1541 | |||
| 1542 | if (qnames != null) { |
||
| 1543 | // we have to store this data until last moment since it is not possible to write any |
||
| 1544 | // namespace data after writing the charactor data |
||
| 1545 | java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); |
||
| 1546 | java.lang.String namespaceURI = null; |
||
| 1547 | java.lang.String prefix = null; |
||
| 1548 | |||
| 1549 | for (int i = 0; i < qnames.length; i++) { |
||
| 1550 | if (i > 0) { |
||
| 1551 | stringToWrite.append(" "); |
||
| 1552 | } |
||
| 1553 | namespaceURI = qnames[i].getNamespaceURI(); |
||
| 1554 | if (namespaceURI != null) { |
||
| 1555 | prefix = xmlWriter.getPrefix(namespaceURI); |
||
| 1556 | if ((prefix == null) || (prefix.length() == 0)) { |
||
| 1557 | prefix = generatePrefix(namespaceURI); |
||
| 1558 | xmlWriter.writeNamespace(prefix, namespaceURI); |
||
| 1559 | xmlWriter.setPrefix(prefix,namespaceURI); |
||
| 1560 | } |
||
| 1561 | |||
| 1562 | if (prefix.trim().length() > 0){ |
||
| 1563 | stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 1564 | } else { |
||
| 1565 | stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 1566 | } |
||
| 1567 | } else { |
||
| 1568 | stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 1569 | } |
||
| 1570 | } |
||
| 1571 | xmlWriter.writeCharacters(stringToWrite.toString()); |
||
| 1572 | } |
||
| 1573 | |||
| 1574 | } |
||
| 1575 | |||
| 1576 | |||
| 1577 | /** |
||
| 1578 | * Register a namespace prefix |
||
| 1579 | */ |
||
| 1580 | private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { |
||
| 1581 | java.lang.String prefix = xmlWriter.getPrefix(namespace); |
||
| 1582 | if (prefix == null) { |
||
| 1583 | prefix = generatePrefix(namespace); |
||
| 1584 | javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); |
||
| 1585 | while (true) { |
||
| 1586 | java.lang.String uri = nsContext.getNamespaceURI(prefix); |
||
| 1587 | if (uri == null || uri.length() == 0) { |
||
| 1588 | break; |
||
| 1589 | } |
||
| 1590 | prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); |
||
| 1591 | } |
||
| 1592 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 1593 | xmlWriter.setPrefix(prefix, namespace); |
||
| 1594 | } |
||
| 1595 | return prefix; |
||
| 1596 | } |
||
| 1597 | |||
| 1598 | |||
| 1599 | |||
| 1600 | /** |
||
| 1601 | * databinding method to get an XML representation of this object |
||
| 1602 | * |
||
| 1603 | */ |
||
| 1604 | public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) |
||
| 1605 | throws org.apache.axis2.databinding.ADBException{ |
||
| 1606 | |||
| 1607 | |||
| 1608 | |||
| 1609 | java.util.ArrayList elementList = new java.util.ArrayList(); |
||
| 1610 | java.util.ArrayList attribList = new java.util.ArrayList(); |
||
| 1611 | |||
| 1612 | if (localNfeDadosMsgTracker){ |
||
| 1613 | elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe", |
||
| 1614 | "nfeDadosMsg")); |
||
| 1615 | |||
| 1616 | |||
| 1617 | if (localNfeDadosMsg==null){ |
||
| 1618 | throw new org.apache.axis2.databinding.ADBException("nfeDadosMsg cannot be null!!"); |
||
| 1619 | } |
||
| 1620 | elementList.add(localNfeDadosMsg); |
||
| 1621 | } |
||
| 1622 | |||
| 1623 | return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); |
||
| 1624 | |||
| 1625 | |||
| 1626 | |||
| 1627 | } |
||
| 1628 | |||
| 1629 | |||
| 1630 | |||
| 1631 | /** |
||
| 1632 | * Factory class that keeps the parse method |
||
| 1633 | */ |
||
| 1634 | public static class Factory{ |
||
| 1635 | |||
| 1636 | |||
| 1637 | |||
| 1638 | |||
| 1639 | /** |
||
| 1640 | * static method to create the object |
||
| 1641 | * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable |
||
| 1642 | * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element |
||
| 1643 | * Postcondition: If this object is an element, the reader is positioned at its end element |
||
| 1644 | * If this object is a complex type, the reader is positioned at the end element of its outer element |
||
| 1645 | */ |
||
| 1646 | public static NfeDistDFeInteresse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ |
||
| 1647 | NfeDistDFeInteresse object = |
||
| 1648 | new NfeDistDFeInteresse(); |
||
| 1649 | |||
| 1650 | int event; |
||
| 1651 | java.lang.String nillableValue = null; |
||
| 1652 | java.lang.String prefix =""; |
||
| 1653 | java.lang.String namespaceuri =""; |
||
| 1654 | try { |
||
| 1655 | |||
| 1656 | while (!reader.isStartElement() && !reader.isEndElement()) |
||
| 1657 | reader.next(); |
||
| 1658 | |||
| 1659 | |||
| 1660 | if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ |
||
| 1661 | java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", |
||
| 1662 | "type"); |
||
| 1663 | if (fullTypeName!=null){ |
||
| 1664 | java.lang.String nsPrefix = null; |
||
| 1665 | if (fullTypeName.indexOf(":") > -1){ |
||
| 1666 | nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); |
||
| 1667 | } |
||
| 1668 | nsPrefix = nsPrefix==null?"":nsPrefix; |
||
| 1669 | |||
| 1670 | java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); |
||
| 1671 | |||
| 1672 | if (!"nfeDistDFeInteresse".equals(type)){ |
||
| 1673 | //find namespace for the prefix |
||
| 1674 | java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); |
||
| 1675 | return (NfeDistDFeInteresse)ExtensionMapper.getTypeObject( |
||
| 1676 | nsUri,type,reader); |
||
| 1677 | } |
||
| 1678 | |||
| 1679 | |||
| 1680 | } |
||
| 1681 | |||
| 1682 | |||
| 1683 | } |
||
| 1684 | |||
| 1685 | |||
| 1686 | |||
| 1687 | |||
| 1688 | // Note all attributes that were handled. Used to differ normal attributes |
||
| 1689 | // from anyAttributes. |
||
| 1690 | java.util.Vector handledAttributes = new java.util.Vector(); |
||
| 1691 | |||
| 1692 | |||
| 1693 | |||
| 1694 | |||
| 1695 | reader.next(); |
||
| 1696 | |||
| 1697 | |||
| 1698 | while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); |
||
| 1699 | |||
| 1700 | if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe","nfeDadosMsg").equals(reader.getName())){ |
||
| 1701 | |||
| 1702 | object.setNfeDadosMsg(NfeDadosMsg_type0.Factory.parse(reader)); |
||
| 1703 | |||
| 1704 | reader.next(); |
||
| 1705 | |||
| 1706 | } // End of if for expected property start element |
||
| 1707 | |||
| 1708 | else { |
||
| 1709 | |||
| 1710 | } |
||
| 1711 | |||
| 1712 | while (!reader.isStartElement() && !reader.isEndElement()) |
||
| 1713 | reader.next(); |
||
| 1714 | |||
| 1715 | if (reader.isStartElement()) |
||
| 1716 | // A start element we are not expecting indicates a trailing invalid property |
||
| 1717 | throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); |
||
| 1718 | |||
| 1719 | |||
| 1720 | |||
| 1721 | |||
| 1722 | } catch (javax.xml.stream.XMLStreamException e) { |
||
| 1723 | throw new java.lang.Exception(e); |
||
| 1724 | } |
||
| 1725 | |||
| 1726 | return object; |
||
| 1727 | } |
||
| 1728 | |||
| 1729 | }//end of factory class |
||
| 1730 | |||
| 1731 | |||
| 1732 | |||
| 1733 | } |
||
| 1734 | |||
| 1735 | |||
| 1736 | public static class NfeDistDFeInteresseResponse |
||
| 1737 | implements org.apache.axis2.databinding.ADBBean{ |
||
| 1738 | |||
| 1739 | public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( |
||
| 1740 | "http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe", |
||
| 1741 | "nfeDistDFeInteresseResponse", |
||
| 1742 | ""); |
||
| 1743 | |||
| 1744 | |||
| 1745 | |||
| 1746 | /** |
||
| 1747 | * field for NfeDistDFeInteresseResult |
||
| 1748 | */ |
||
| 1749 | |||
| 1750 | |||
| 1751 | protected NfeDistDFeInteresseResult_type0 localNfeDistDFeInteresseResult ; |
||
| 1752 | |||
| 1753 | /* This tracker boolean wil be used to detect whether the user called the set method |
||
| 1754 | * for this attribute. It will be used to determine whether to include this field |
||
| 1755 | * in the serialized XML |
||
| 1756 | */ |
||
| 1757 | protected boolean localNfeDistDFeInteresseResultTracker = false ; |
||
| 1758 | |||
| 1759 | public boolean isNfeDistDFeInteresseResultSpecified(){ |
||
| 1760 | return localNfeDistDFeInteresseResultTracker; |
||
| 1761 | } |
||
| 1762 | |||
| 1763 | |||
| 1764 | |||
| 1765 | /** |
||
| 1766 | * Auto generated getter method |
||
| 1767 | * @return NfeDistDFeInteresseResult_type0 |
||
| 1768 | */ |
||
| 1769 | public NfeDistDFeInteresseResult_type0 getNfeDistDFeInteresseResult(){ |
||
| 1770 | return localNfeDistDFeInteresseResult; |
||
| 1771 | } |
||
| 1772 | |||
| 1773 | |||
| 1774 | |||
| 1775 | /** |
||
| 1776 | * Auto generated setter method |
||
| 1777 | * @param param NfeDistDFeInteresseResult |
||
| 1778 | */ |
||
| 1779 | public void setNfeDistDFeInteresseResult(NfeDistDFeInteresseResult_type0 param){ |
||
| 1780 | localNfeDistDFeInteresseResultTracker = param != null; |
||
| 1781 | |||
| 1782 | this.localNfeDistDFeInteresseResult=param; |
||
| 1783 | |||
| 1784 | |||
| 1785 | } |
||
| 1786 | |||
| 1787 | |||
| 1788 | |||
| 1789 | |||
| 1790 | /** |
||
| 1791 | * |
||
| 1792 | * @param parentQName |
||
| 1793 | * @param factory |
||
| 1794 | * @return org.apache.axiom.om.OMElement |
||
| 1795 | */ |
||
| 1796 | public org.apache.axiom.om.OMElement getOMElement ( |
||
| 1797 | final javax.xml.namespace.QName parentQName, |
||
| 1798 | final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ |
||
| 1799 | |||
| 1800 | |||
| 1801 | |||
| 1802 | org.apache.axiom.om.OMDataSource dataSource = |
||
| 1803 | new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME); |
||
| 1804 | return factory.createOMElement(dataSource,MY_QNAME); |
||
| 1805 | |||
| 1806 | } |
||
| 1807 | |||
| 1808 | public void serialize(final javax.xml.namespace.QName parentQName, |
||
| 1809 | javax.xml.stream.XMLStreamWriter xmlWriter) |
||
| 1810 | throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ |
||
| 1811 | serialize(parentQName,xmlWriter,false); |
||
| 1812 | } |
||
| 1813 | |||
| 1814 | public void serialize(final javax.xml.namespace.QName parentQName, |
||
| 1815 | javax.xml.stream.XMLStreamWriter xmlWriter, |
||
| 1816 | boolean serializeType) |
||
| 1817 | throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ |
||
| 1818 | |||
| 1819 | |||
| 1820 | |||
| 1821 | |||
| 1822 | java.lang.String prefix = null; |
||
| 1823 | java.lang.String namespace = null; |
||
| 1824 | |||
| 1825 | |||
| 1826 | prefix = parentQName.getPrefix(); |
||
| 1827 | namespace = parentQName.getNamespaceURI(); |
||
| 1828 | writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); |
||
| 1829 | |||
| 1830 | if (serializeType){ |
||
| 1831 | |||
| 1832 | |||
| 1833 | java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe"); |
||
| 1834 | if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ |
||
| 1835 | writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", |
||
| 1836 | namespacePrefix+":nfeDistDFeInteresseResponse", |
||
| 1837 | xmlWriter); |
||
| 1838 | } else { |
||
| 1839 | writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", |
||
| 1840 | "nfeDistDFeInteresseResponse", |
||
| 1841 | xmlWriter); |
||
| 1842 | } |
||
| 1843 | |||
| 1844 | |||
| 1845 | } |
||
| 1846 | if (localNfeDistDFeInteresseResultTracker){ |
||
| 1847 | if (localNfeDistDFeInteresseResult==null){ |
||
| 1848 | throw new org.apache.axis2.databinding.ADBException("nfeDistDFeInteresseResult cannot be null!!"); |
||
| 1849 | } |
||
| 1850 | localNfeDistDFeInteresseResult.serialize(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe","nfeDistDFeInteresseResult"), |
||
| 1851 | xmlWriter); |
||
| 1852 | } |
||
| 1853 | xmlWriter.writeEndElement(); |
||
| 1854 | |||
| 1855 | |||
| 1856 | } |
||
| 1857 | |||
| 1858 | private static java.lang.String generatePrefix(java.lang.String namespace) { |
||
| 1859 | if(namespace.equals("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe")){ |
||
| 1860 | return ""; |
||
| 1861 | } |
||
| 1862 | return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); |
||
| 1863 | } |
||
| 1864 | |||
| 1865 | /** |
||
| 1866 | * Utility method to write an element start tag. |
||
| 1867 | */ |
||
| 1868 | private void writeStartElement(java.lang.String prefix, java.lang.String namespace, java.lang.String localPart, |
||
| 1869 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1870 | java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); |
||
| 1871 | if (writerPrefix != null) { |
||
| 1872 | xmlWriter.writeStartElement(namespace, localPart); |
||
| 1873 | } else { |
||
| 1874 | if (namespace.length() == 0) { |
||
| 1875 | prefix = ""; |
||
| 1876 | } else if (prefix == null) { |
||
| 1877 | prefix = generatePrefix(namespace); |
||
| 1878 | } |
||
| 1879 | |||
| 1880 | xmlWriter.writeStartElement(prefix, localPart, namespace); |
||
| 1881 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 1882 | xmlWriter.setPrefix(prefix, namespace); |
||
| 1883 | } |
||
| 1884 | } |
||
| 1885 | |||
| 1886 | /** |
||
| 1887 | * Util method to write an attribute with the ns prefix |
||
| 1888 | */ |
||
| 1889 | private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, |
||
| 1890 | java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ |
||
| 1891 | if (xmlWriter.getPrefix(namespace) == null) { |
||
| 1892 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 1893 | xmlWriter.setPrefix(prefix, namespace); |
||
| 1894 | } |
||
| 1895 | xmlWriter.writeAttribute(namespace,attName,attValue); |
||
| 1896 | } |
||
| 1897 | |||
| 1898 | /** |
||
| 1899 | * Util method to write an attribute without the ns prefix |
||
| 1900 | */ |
||
| 1901 | private void writeAttribute(java.lang.String namespace,java.lang.String attName, |
||
| 1902 | java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ |
||
| 1903 | if (namespace.equals("")) { |
||
| 1904 | xmlWriter.writeAttribute(attName,attValue); |
||
| 1905 | } else { |
||
| 1906 | registerPrefix(xmlWriter, namespace); |
||
| 1907 | xmlWriter.writeAttribute(namespace,attName,attValue); |
||
| 1908 | } |
||
| 1909 | } |
||
| 1910 | |||
| 1911 | |||
| 1912 | /** |
||
| 1913 | * Util method to write an attribute without the ns prefix |
||
| 1914 | */ |
||
| 1915 | private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, |
||
| 1916 | javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1917 | |||
| 1918 | java.lang.String attributeNamespace = qname.getNamespaceURI(); |
||
| 1919 | java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); |
||
| 1920 | if (attributePrefix == null) { |
||
| 1921 | attributePrefix = registerPrefix(xmlWriter, attributeNamespace); |
||
| 1922 | } |
||
| 1923 | java.lang.String attributeValue; |
||
| 1924 | if (attributePrefix.trim().length() > 0) { |
||
| 1925 | attributeValue = attributePrefix + ":" + qname.getLocalPart(); |
||
| 1926 | } else { |
||
| 1927 | attributeValue = qname.getLocalPart(); |
||
| 1928 | } |
||
| 1929 | |||
| 1930 | if (namespace.equals("")) { |
||
| 1931 | xmlWriter.writeAttribute(attName, attributeValue); |
||
| 1932 | } else { |
||
| 1933 | registerPrefix(xmlWriter, namespace); |
||
| 1934 | xmlWriter.writeAttribute(namespace, attName, attributeValue); |
||
| 1935 | } |
||
| 1936 | } |
||
| 1937 | /** |
||
| 1938 | * method to handle Qnames |
||
| 1939 | */ |
||
| 1940 | |||
| 1941 | private void writeQName(javax.xml.namespace.QName qname, |
||
| 1942 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1943 | java.lang.String namespaceURI = qname.getNamespaceURI(); |
||
| 1944 | if (namespaceURI != null) { |
||
| 1945 | java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); |
||
| 1946 | if (prefix == null) { |
||
| 1947 | prefix = generatePrefix(namespaceURI); |
||
| 1948 | xmlWriter.writeNamespace(prefix, namespaceURI); |
||
| 1949 | xmlWriter.setPrefix(prefix,namespaceURI); |
||
| 1950 | } |
||
| 1951 | |||
| 1952 | if (prefix.trim().length() > 0){ |
||
| 1953 | xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 1954 | } else { |
||
| 1955 | // i.e this is the default namespace |
||
| 1956 | xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 1957 | } |
||
| 1958 | |||
| 1959 | } else { |
||
| 1960 | xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); |
||
| 1961 | } |
||
| 1962 | } |
||
| 1963 | |||
| 1964 | private void writeQNames(javax.xml.namespace.QName[] qnames, |
||
| 1965 | javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { |
||
| 1966 | |||
| 1967 | if (qnames != null) { |
||
| 1968 | // we have to store this data until last moment since it is not possible to write any |
||
| 1969 | // namespace data after writing the charactor data |
||
| 1970 | java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); |
||
| 1971 | java.lang.String namespaceURI = null; |
||
| 1972 | java.lang.String prefix = null; |
||
| 1973 | |||
| 1974 | for (int i = 0; i < qnames.length; i++) { |
||
| 1975 | if (i > 0) { |
||
| 1976 | stringToWrite.append(" "); |
||
| 1977 | } |
||
| 1978 | namespaceURI = qnames[i].getNamespaceURI(); |
||
| 1979 | if (namespaceURI != null) { |
||
| 1980 | prefix = xmlWriter.getPrefix(namespaceURI); |
||
| 1981 | if ((prefix == null) || (prefix.length() == 0)) { |
||
| 1982 | prefix = generatePrefix(namespaceURI); |
||
| 1983 | xmlWriter.writeNamespace(prefix, namespaceURI); |
||
| 1984 | xmlWriter.setPrefix(prefix,namespaceURI); |
||
| 1985 | } |
||
| 1986 | |||
| 1987 | if (prefix.trim().length() > 0){ |
||
| 1988 | stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 1989 | } else { |
||
| 1990 | stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 1991 | } |
||
| 1992 | } else { |
||
| 1993 | stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); |
||
| 1994 | } |
||
| 1995 | } |
||
| 1996 | xmlWriter.writeCharacters(stringToWrite.toString()); |
||
| 1997 | } |
||
| 1998 | |||
| 1999 | } |
||
| 2000 | |||
| 2001 | |||
| 2002 | /** |
||
| 2003 | * Register a namespace prefix |
||
| 2004 | */ |
||
| 2005 | private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { |
||
| 2006 | java.lang.String prefix = xmlWriter.getPrefix(namespace); |
||
| 2007 | if (prefix == null) { |
||
| 2008 | prefix = generatePrefix(namespace); |
||
| 2009 | javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); |
||
| 2010 | while (true) { |
||
| 2011 | java.lang.String uri = nsContext.getNamespaceURI(prefix); |
||
| 2012 | if (uri == null || uri.length() == 0) { |
||
| 2013 | break; |
||
| 2014 | } |
||
| 2015 | prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); |
||
| 2016 | } |
||
| 2017 | xmlWriter.writeNamespace(prefix, namespace); |
||
| 2018 | xmlWriter.setPrefix(prefix, namespace); |
||
| 2019 | } |
||
| 2020 | return prefix; |
||
| 2021 | } |
||
| 2022 | |||
| 2023 | |||
| 2024 | |||
| 2025 | /** |
||
| 2026 | * databinding method to get an XML representation of this object |
||
| 2027 | * |
||
| 2028 | */ |
||
| 2029 | public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) |
||
| 2030 | throws org.apache.axis2.databinding.ADBException{ |
||
| 2031 | |||
| 2032 | |||
| 2033 | |||
| 2034 | java.util.ArrayList elementList = new java.util.ArrayList(); |
||
| 2035 | java.util.ArrayList attribList = new java.util.ArrayList(); |
||
| 2036 | |||
| 2037 | if (localNfeDistDFeInteresseResultTracker){ |
||
| 2038 | elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe", |
||
| 2039 | "nfeDistDFeInteresseResult")); |
||
| 2040 | |||
| 2041 | |||
| 2042 | if (localNfeDistDFeInteresseResult==null){ |
||
| 2043 | throw new org.apache.axis2.databinding.ADBException("nfeDistDFeInteresseResult cannot be null!!"); |
||
| 2044 | } |
||
| 2045 | elementList.add(localNfeDistDFeInteresseResult); |
||
| 2046 | } |
||
| 2047 | |||
| 2048 | return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); |
||
| 2049 | |||
| 2050 | |||
| 2051 | |||
| 2052 | } |
||
| 2053 | |||
| 2054 | |||
| 2055 | |||
| 2056 | /** |
||
| 2057 | * Factory class that keeps the parse method |
||
| 2058 | */ |
||
| 2059 | public static class Factory{ |
||
| 2060 | |||
| 2061 | |||
| 2062 | |||
| 2063 | |||
| 2064 | /** |
||
| 2065 | * static method to create the object |
||
| 2066 | * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable |
||
| 2067 | * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element |
||
| 2068 | * Postcondition: If this object is an element, the reader is positioned at its end element |
||
| 2069 | * If this object is a complex type, the reader is positioned at the end element of its outer element |
||
| 2070 | */ |
||
| 2071 | public static NfeDistDFeInteresseResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ |
||
| 2072 | NfeDistDFeInteresseResponse object = |
||
| 2073 | new NfeDistDFeInteresseResponse(); |
||
| 2074 | |||
| 2075 | int event; |
||
| 2076 | java.lang.String nillableValue = null; |
||
| 2077 | java.lang.String prefix =""; |
||
| 2078 | java.lang.String namespaceuri =""; |
||
| 2079 | try { |
||
| 2080 | |||
| 2081 | while (!reader.isStartElement() && !reader.isEndElement()) |
||
| 2082 | reader.next(); |
||
| 2083 | |||
| 2084 | |||
| 2085 | if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ |
||
| 2086 | java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", |
||
| 2087 | "type"); |
||
| 2088 | if (fullTypeName!=null){ |
||
| 2089 | java.lang.String nsPrefix = null; |
||
| 2090 | if (fullTypeName.indexOf(":") > -1){ |
||
| 2091 | nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); |
||
| 2092 | } |
||
| 2093 | nsPrefix = nsPrefix==null?"":nsPrefix; |
||
| 2094 | |||
| 2095 | java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); |
||
| 2096 | |||
| 2097 | if (!"nfeDistDFeInteresseResponse".equals(type)){ |
||
| 2098 | //find namespace for the prefix |
||
| 2099 | java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); |
||
| 2100 | return (NfeDistDFeInteresseResponse)ExtensionMapper.getTypeObject( |
||
| 2101 | nsUri,type,reader); |
||
| 2102 | } |
||
| 2103 | |||
| 2104 | |||
| 2105 | } |
||
| 2106 | |||
| 2107 | |||
| 2108 | } |
||
| 2109 | |||
| 2110 | |||
| 2111 | |||
| 2112 | |||
| 2113 | // Note all attributes that were handled. Used to differ normal attributes |
||
| 2114 | // from anyAttributes. |
||
| 2115 | java.util.Vector handledAttributes = new java.util.Vector(); |
||
| 2116 | |||
| 2117 | |||
| 2118 | |||
| 2119 | |||
| 2120 | reader.next(); |
||
| 2121 | |||
| 2122 | |||
| 2123 | while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); |
||
| 2124 | |||
| 2125 | if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe","nfeDistDFeInteresseResult").equals(reader.getName())){ |
||
| 2126 | |||
| 2127 | object.setNfeDistDFeInteresseResult(NfeDistDFeInteresseResult_type0.Factory.parse(reader)); |
||
| 2128 | |||
| 2129 | reader.next(); |
||
| 2130 | |||
| 2131 | } // End of if for expected property start element |
||
| 2132 | |||
| 2133 | else { |
||
| 2134 | |||
| 2135 | } |
||
| 2136 | |||
| 2137 | while (!reader.isStartElement() && !reader.isEndElement()) |
||
| 2138 | reader.next(); |
||
| 2139 | |||
| 2140 | if (reader.isStartElement()) |
||
| 2141 | // A start element we are not expecting indicates a trailing invalid property |
||
| 2142 | throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); |
||
| 2143 | |||
| 2144 | |||
| 2145 | |||
| 2146 | |||
| 2147 | } catch (javax.xml.stream.XMLStreamException e) { |
||
| 2148 | throw new java.lang.Exception(e); |
||
| 2149 | } |
||
| 2150 | |||
| 2151 | return object; |
||
| 2152 | } |
||
| 2153 | |||
| 2154 | }//end of factory class |
||
| 2155 | |||
| 2156 | |||
| 2157 | |||
| 2158 | } |
||
| 2159 | |||
| 2160 | |||
| 2161 | private org.apache.axiom.om.OMElement toOM(br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresse param, boolean optimizeContent) |
||
| 2162 | throws org.apache.axis2.AxisFault { |
||
| 2163 | |||
| 2164 | |||
| 2165 | try{ |
||
| 2166 | return param.getOMElement(br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresse.MY_QNAME, |
||
| 2167 | org.apache.axiom.om.OMAbstractFactory.getOMFactory()); |
||
| 2168 | } catch(org.apache.axis2.databinding.ADBException e){ |
||
| 2169 | throw org.apache.axis2.AxisFault.makeFault(e); |
||
| 2170 | } |
||
| 2171 | |||
| 2172 | |||
| 2173 | } |
||
| 2174 | |||
| 2175 | private org.apache.axiom.om.OMElement toOM(br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresseResponse param, boolean optimizeContent) |
||
| 2176 | throws org.apache.axis2.AxisFault { |
||
| 2177 | |||
| 2178 | |||
| 2179 | try{ |
||
| 2180 | return param.getOMElement(br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresseResponse.MY_QNAME, |
||
| 2181 | org.apache.axiom.om.OMAbstractFactory.getOMFactory()); |
||
| 2182 | } catch(org.apache.axis2.databinding.ADBException e){ |
||
| 2183 | throw org.apache.axis2.AxisFault.makeFault(e); |
||
| 2184 | } |
||
| 2185 | |||
| 2186 | |||
| 2187 | } |
||
| 2188 | |||
| 2189 | |||
| 2190 | private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresse param, boolean optimizeContent, javax.xml.namespace.QName methodQName) |
||
| 2191 | throws org.apache.axis2.AxisFault{ |
||
| 2192 | |||
| 2193 | |||
| 2194 | try{ |
||
| 2195 | |||
| 2196 | org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); |
||
| 2197 | emptyEnvelope.getBody().addChild(param.getOMElement(br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresse.MY_QNAME,factory)); |
||
| 2198 | return emptyEnvelope; |
||
| 2199 | } catch(org.apache.axis2.databinding.ADBException e){ |
||
| 2200 | throw org.apache.axis2.AxisFault.makeFault(e); |
||
| 2201 | } |
||
| 2202 | |||
| 2203 | |||
| 2204 | } |
||
| 2205 | |||
| 2206 | |||
| 2207 | /* methods to provide back word compatibility */ |
||
| 2208 | |||
| 2209 | |||
| 2210 | |||
| 2211 | |||
| 2212 | /** |
||
| 2213 | * get the default envelope |
||
| 2214 | */ |
||
| 2215 | private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){ |
||
| 2216 | return factory.getDefaultEnvelope(); |
||
| 2217 | } |
||
| 2218 | |||
| 2219 | |||
| 2220 | private java.lang.Object fromOM( |
||
| 2221 | org.apache.axiom.om.OMElement param, |
||
| 2222 | java.lang.Class type, |
||
| 2223 | java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{ |
||
| 2224 | |||
| 2225 | try { |
||
| 2226 | |||
| 2227 | if (br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresse.class.equals(type)){ |
||
| 2228 | |||
| 2229 | return br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); |
||
| 2230 | |||
| 2231 | |||
| 2232 | } |
||
| 2233 | |||
| 2234 | if (br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresseResponse.class.equals(type)){ |
||
| 2235 | |||
| 2236 | return br.com.swconsultoria.nfe.wsdl.NFeDistribuicaoDFe.NFeDistribuicaoDFeStub.NfeDistDFeInteresseResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); |
||
| 2237 | |||
| 2238 | |||
| 2239 | } |
||
| 2240 | |||
| 2241 | } catch (java.lang.Exception e) { |
||
| 2242 | throw org.apache.axis2.AxisFault.makeFault(e); |
||
| 2243 | } |
||
| 2244 | return null; |
||
| 2245 | } |
||
| 2246 | |||
| 2247 | |||
| 2248 | |||
| 2249 | |||
| 2250 | } |
||
| 2251 |