PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, November 10, 2022

[FIXED] What is the function of proc attribute in SOAP envelope

 November 10, 2022     api, attributes, proc, soap     No comments   

Issue

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.


Solution

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:

  • What are XML namespaces for?

  • Creating your own xml namespace

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.



Answered By - Bogdan
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing