cancel
Showing results for 
Search instead for 
Did you mean: 

NFe B2B de entrada - Recebendo email com várias NFes em anexo e PDF

Former Member
0 Kudos

Prezados,

Estou com dificuldades para tratar as notas de entrada devido ao grande numero de fornecedores que enviam notas com o PDF no primeiro anexo ao invés do XML e alguns enviam várias notas em apenas um mail.

Localizei a solução abaixo:

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=233474286

Gostaria de saber se realmente vale apena implementar o cenário da solução ou se já existe algo mais definitivo para tratar o problema.

Edited by: Nanim_es on Jan 17, 2012 12:52 PM

Accepted Solutions (1)

Accepted Solutions (1)

bruno_renzo
Active Contributor
0 Kudos

Olá Nanim,

Esta é a melhor solução se você quer tratar os e-mails direto na camada do PI.

Outra possibilidade é usar outro método fora do PI para extrair os anexos dos e-mail, separando somente os XMLs em uma determinada pasta, e fazer o PI ler da pasta (File System) ao invés dos e-mails.

Abs

Former Member
0 Kudos

Caros,

Vocês conseguiram implementar essa funcionalidade?

Estou com alguns erros que acredito serem de configuração durante o desenvolvimento, como não sou muito experiente em Java e SAP NETWeaver, gostaria de ajuda para implementa-la.

Se puderem ajudar, seguem os erros:

No codigo da classe existem 4 warnings,

o primeiro é na descrição  "* @stateless" que ao mudar o primeiro s para maiúsculo o erro some, mas não sei se isso está correto, erro apresentado "The word @stateless is not correctly spelled"

O segundo é da criação do metodo "public class readMultipleAttachment", erro apresentado "The serializable class readMultipleAttachment does not declare a static final serialVersionUID field of type long"

O terceiro é na declaração do myContext "private SessionContext myContext;"  erro apresentado "The field readMultipleAttachment.myContext is never read locally"

O quarto é na declarção do iterador "Iterator attachmentIterator = mailMessage.getAttachmentIterator();" erro apresentado "Iterator is a raw type. References to generic type Iterator<E> should be parameterized".

No arquivo ejb-j2ee-engine.xml

Na linha "<!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">" apresenta o seguinte warning "

The file cannot be validated as the XML Schema "C:\workspace\MultipleAttachmentSender\ejbModule\META-INF\ejb-j2ee-engine.dtd (O sistema não pode

encontrar o arquivo especificado)" that is specified as describing the syntax of the file cannot be located."

No arquivo ejb-jar.xml

Na linha "<ejb-jar>" informa o erro "

DescriptionResourcePathLocationType
The content of element type "ejb-jar" must match "(description?,display-name?,small-icon?,large-icon?,enterprise-beans,relationships?,assembly-descriptor?,ejb-client-jar?)".ejb-jar.xml/MultipleAttachmentSender/ejbModule/META-INFline 3XML Problem

"

e na linha  "<session>" o erro: "

DescriptionResourcePathLocationType
The content of element type "session" must match "(description?,display-name?,small-icon?,large-icon?,ejb-name,home?,remote?,local-home?,local?,ejb-class,session-type,transaction-type,env-entry*,ejb-ref*,ejb-local-ref*,security-role-ref*,security-identity?,resource-ref*,resource-env-ref*)".ejb-jar.xml/MultipleAttachmentSender/ejbModule/META-INFline 7XML Problem

No arquivo application-j2ee-engine.xml na linha "<!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd"> " apresenta o seguinte warning "

The file cannot be validated as the XML Schema "C:\workspace\CustomAdapterModule\EarContent\META-INF\application-j2ee-engine.dtd (O sistema não

pode encontrar o arquivo especificado)" that is specified as describing the syntax of the file cannot be located.

"

Segui todos os passos descritos na wiki http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=233474286

e além dos erros warnings anteriores quando tento efetuar o deploy do EAR o visual administrator do PI apresenta o seguinte erro de java que para falar a verdade só me confundiu mais..

ERRO DE DEPLOY JAVA

Error occurred while trying to load ear :

CustomAdapterModule.ear

java.io.IOException: Can't find ra.xml in rar file.

          at com.sap.engine.services.connector.jca.deploy.descriptor.jar.ReadRar.getDescriptor(ReadRar.java:105)

          at com.sap.engine.deploy.tool.deployer.ExtendedEarReader.loadDescriptorFromFile(ExtendedEarReader.java:258)

          at com.sap.engine.deploy.tool.deployer.ExtendedEarReader.getFullEarDescriptor(ExtendedEarReader.java:153)

          at com.sap.engine.services.deploy.gui.runtime.EarLoader.loadEar(EarLoader.java:137)

          at com.sap.engine.services.deploy.gui.runtime.MainDeployPanelLogical.loadEarAction(MainDeployPanelLogical.java:169)

          at com.sap.engine.services.deploy.gui.runtime.EarDialog.setEar(EarDialog.java:79)

          at com.sap.engine.services.deploy.gui.DeployDialogLogical.okButtonAction(DeployDialogLogical.java:294)

          at com.sap.engine.services.deploy.gui.DeployDialogLogical.actionPerformed(DeployDialogLogical.java:71)

          at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

          at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

          at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

          at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

          at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)

          at java.awt.Component.processMouseEvent(Unknown Source)

          at javax.swing.JComponent.processMouseEvent(Unknown Source)

          at java.awt.Component.processEvent(Unknown Source)

          at java.awt.Container.processEvent(Unknown Source)

          at java.awt.Component.dispatchEventImpl(Unknown Source)

          at java.awt.Container.dispatchEventImpl(Unknown Source)

          at java.awt.Component.dispatchEvent(Unknown Source)

          at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

          at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

          at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

          at java.awt.Container.dispatchEventImpl(Unknown Source)

          at java.awt.Window.dispatchEventImpl(Unknown Source)

          at java.awt.Component.dispatchEvent(Unknown Source)

          at java.awt.EventQueue.dispatchEvent(Unknown Source)

          at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

          at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

          at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

          at java.awt.Dialog$1.run(Unknown Source)

          at java.awt.Dialog$3.run(Unknown Source)

          at java.security.AccessController.doPrivileged(Native Method)

          at java.awt.Dialog.show(Unknown Source)

          at java.awt.Component.show(Unknown Source)

          at java.awt.Component.setVisible(Unknown Source)

          at java.awt.Window.setVisible(Unknown Source)

          at java.awt.Dialog.setVisible(Unknown Source)

          at com.sap.engine.services.deploy.gui.DeployDialogLogical.showDialog(DeployDialogLogical.java:378)

          at com.sap.engine.services.deploy.gui.ApplicationsPanel.deployAction(ApplicationsPanel.java:413)

          at com.sap.engine.services.deploy.gui.ApplicationsPanel.actionPerformed(ApplicationsPanel.java:357)

          at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

          at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

          at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

          at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

          at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)

          at java.awt.Component.processMouseEvent(Unknown Source)

          at javax.swing.JComponent.processMouseEvent(Unknown Source)

          at java.awt.Component.processEvent(Unknown Source)

          at java.awt.Container.processEvent(Unknown Source)

          at java.awt.Component.dispatchEventImpl(Unknown Source)

          at java.awt.Container.dispatchEventImpl(Unknown Source)

          at java.awt.Component.dispatchEvent(Unknown Source)

          at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

          at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

          at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

          at java.awt.Container.dispatchEventImpl(Unknown Source)

          at java.awt.Window.dispatchEventImpl(Unknown Source)

          at java.awt.Component.dispatchEvent(Unknown Source)

          at java.awt.EventQueue.dispatchEvent(Unknown Source)

          at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

          at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

          at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

          at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

          at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

          at java.awt.EventDispatchThread.run(Unknown Source)

Se alguem puder me dar uma luz para concluir essa ferramente, show de bola, pelo que vi acredito que sejam as configurações, código por código está correto.

Abraços.

Answers (0)