Giter Site home page Giter Site logo

Can't Create object from class c506_2 that nested from class RFF_2 that nested from class RFFLoop1 that nested from class CNILoop1 about edi.net HOT 8 CLOSED

indice-co avatar indice-co commented on May 17, 2024
Can't Create object from class c506_2 that nested from class RFF_2 that nested from class RFFLoop1 that nested from class CNILoop1

from edi.net.

Comments (8)

cleftheris avatar cleftheris commented on May 17, 2024

Hi @hamed22222 on a first look it seems that you have nested EdiMessage inside an EdiSegment class. This is not permitted. If you need a structure like that you will have to use SegmentGroupAttribute on the outter class and the segment & element attributes inside. You can check for an example here. In order to help you out further I will need to see the code model that is failing along with the sample.edi file.

from edi.net.

gk7gk7 avatar gk7gk7 commented on May 17, 2024

EFACT_D95B_CUSCAR.txt

from edi.net.

gk7gk7 avatar gk7gk7 commented on May 17, 2024

@hamed22222 can you send us a sample EDI payload?

from edi.net.

hamed22222 avatar hamed22222 commented on May 17, 2024

Sample EDI.txt

from edi.net.

hamed22222 avatar hamed22222 commented on May 17, 2024

untitled
that's my problem class called (c506_2) doesn't generate instance

from edi.net.

cleftheris avatar cleftheris commented on May 17, 2024

We will create a new test for this using the SegmentGroupAttribute and get back to you

from edi.net.

hamed22222 avatar hamed22222 commented on May 17, 2024

Waiting for your Response ,thank u

from edi.net.

gk7gk7 avatar gk7gk7 commented on May 17, 2024

We made some of the mapping involved using your sample and your model. You can find it here:
EdiFact_D95B_CUSCAR.cs
I have also created a test case with the assertions. Off-course this is a huge transmission & we did not cover everything but you will get the point.

Just for the sake of completeness there are some rules to have in mind when mapping EDI transmissions to CLR classes:

Classes that are decorated with Segment, SegmentGroup, Message, Group or Interchange consume the segment that defines the contrainer and cannot be reused inside them. If that makes sense you cannot have a Segment loop class RffLoop and an otherone inside Rff mapped to the same segment. The inner one will not map. The solution is simple: just map the properties of the segment to the container class (RffLoop in the example above).

Regards

ps: As documentation for the D95B transmission we used this resource https://www.stylusstudio.com/edifact/D95B/CUSCAR.htm.

from edi.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.