Doubts about information passed in SOAP

1

I'm researching the operation and use of the SOAP protocol, but I came across some doubts in the structural part of the protocol. For years I have been working on low-level programming for microcontrollers. I have never needed to use tools in the higher layers, especially in the communication part, so I have some difficulty understanding very abstract things.

I have been analyzing some requests using SOAP and I noticed that in the SOAP elements go http links, as in the "envelope" element. Here is an excerpt from a SOAP code (the code is incomplete, but for my doubt the rest is not needed):

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <ns2:RecepcionarLoteRpsRequest
            xmlns:ns2="http://ws.bhiss.pbh.gov.br">
            <nfseCabecMsg>
                <?xml version='1.0' encoding='UTF-8'?>
                <cabecalho xmlns="http://www.abrasf.org.br/nfse.xsd"versao="1.00">
                    <versaoDados>1.00</versaoDados>
                </cabecalho>
            </nfseCabecMsg>
            <nfseDadosMsg>
            </nfseDadosMsg>
        </ns2:RecepcionarLoteRpsRequest>
    </S:Body>
</S:Envelope>

On the envelope is the following link: " link ".  I wonder why these links go. Will they be accessed at some point? Or is it just for information?

    
asked by anonymous 18.05.2018 / 16:38

1 answer

3

XML XML XML / strong>. The NameSpace feature is required in XML because it is a free and extensible language in which you can create your own tags, and NameSpace gives a context to the tag signed with a namespace , thus providing a means of avoiding possible name conflicts between different tags, see more about this here .

In addition, by signing a tag with an xmlns, you can assign an expected tags / properties structure, set an XML standard to be sent, xmlns can receive any valid URI, but in these cases it is common for this URI to point for your Schema , see more information on schemas here .

So, this link serves to: define a context and structure to be followed by its XML, and it can rather be accessed by the receiver, to validate its XML, because as said, this link points to the schema that your XML should follow, ie its expected structure.

I hope I have helped.

PS: If there is a possibility, I recommend using Rest, which is much simpler than SOAP.

    
18.05.2018 / 16:58