0

I followed some internal documentation about how to write SOAP request and my SOAP envelope looks like this

<soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/ xmlns:proc=http://example.org/rt/myprocess>
    <soapenv:Body>
        <proc:myprocessRequest>
            <INPUT_DATA>
               Data which I'm receiving in my app
            </INPUT_DATA>
        </proc:myprocessRequest>
    </soapenv:Body>
</soapenv:Envelope>

It's working well when I hit SOAP URL from Postman, but I want to know what the exact function of proc attribute inside envelope is. I'm seeing on the net that other developers use it too, but I just don't see any definition anywhere about what this attribute actually does and what would be the disadvantage of its absence from the envelope.

Any help would be much appreciated.

Ivan_M2
  • 37
  • 1
  • 7

1 Answers1

1

I just don't see any definition anywhere about what this attribute actually does

It's used for XML namespace prefixes. There is a relationship between these two things:

... xmlns:proc="http://example.org/rt/myprocess" ...
...
<proc:myprocessRequest>

It doesn't matter what it's called, as long as it identifies the correct namespace and then you use the same name for identifying the elements that belong to that namespace. It's just like soapenv identifies the proper SOAP namespace.

See here for details:

and what would be the disadvantage of its absence from the envelope.

Without it or without an equivalent XML namespace declaration, your myprocessRequest element will belong to a different namespace than what the service expects, and your call will fail.

Bogdan
  • 23,890
  • 3
  • 69
  • 61