Some XML/SOAP Terminologies Explained & How To Code?

Hello,

I'm fairly new to webservices & have some questions on them which you may be able to help with. I've found it hard to find actual explanations of what each element or attribute means etc....

What is:
(i) A "DataName"
(ii) A "DataNamespace"
(iii) A "DefaultNamespace"
(iv) A "Namespace"

In the following XML, what is a Dataname/DataNamespace/DefaultNamespac/NameSpace etc from the above

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <ServiceAuthHeader xmlns="http://dummyNameForExpertsExc">
      <User>string</User>
      <Password>string</Password>
    </ServiceAuthHeader>
  </soap12:Header>
  <soap12:Body>
    <create_record xmlns="http://dummyNameForExpertsExc">
      <packet>
        <ID>string</ID>
        <Address>string</Address>
        <Phone>string</Phone>
        <Email>string</Email>
      </packet>
    </create_record>
  </soap12:Body>
</soap12:Envelope>

How would I code to request/response to the above service? Examples welcome in any language (Java, ASP, PHP etc). The reason I ask is I reckon I'd probably understand it better by seeing how it can be programmed as going forward I need to how to programme for calling web services.

Thanks in advance!
speedygonzalezAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Asim NazirCommented:
Here is full specification: http://www.w3.org/TR/soap12-part1/
0
Asim NazirCommented:
Namespace names of the general form "http://example.org/..." and "http://example.com/..." represent application or context-dependent URIs

SOAP Building Blocks
A SOAP message is an ordinary XML document containing the following elements:

•An Envelope element that identifies the XML document as a SOAP message
•A Header element that contains header information
•A Body element that contains call and response information
•A Fault element containing errors and status information
All the elements above are declared in the default namespace for the SOAP envelope:

http://www.w3.org/2001/12/soap-envelope

and the default namespace for SOAP encoding and data types is:

http://www.w3.org/2001/12/soap-encoding


--------------------------------------------------------------------------------

Syntax Rules
Here are some important syntax rules:

•A SOAP message MUST be encoded using XML
•A SOAP message MUST use the SOAP Envelope namespace
•A SOAP message MUST use the SOAP Encoding namespace
•A SOAP message must NOT contain a DTD reference
•A SOAP message must NOT contain XML Processing Instructions

--------------------------------------------------------------------------------

Skeleton SOAP Message
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Header>
...
</soap:Header>

<soap:Body>
...
  <soap:Fault>
  ...
  </soap:Fault>
</soap:Body>

</soap:Envelope>

Details: http://www.w3schools.com/SOAP/soap_syntax.asp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
colr__Commented:
In order to produce code, you'd need to see the wsdl - what you've listed above looks like it is a SOAP response, which would have been generated using the wsdl. Most languages (java anyway) have tools that automate a lot of the code plumbing - provided you have a wsdl to point to, tools will produce some client code for you to get started with.

I'm not 100% sure abotu the terminology tyou've used, did that come from a book? DataName in particular isnt somethnig Ive heard before.
0
speedygonzalezAuthor Commented:
Hello,

Thank you all for your help. The links & answers provided are very helpful.

Colr,  Some of the terminologies I've used I've come across on various websites. I guess these may be incorrect.

Re: Importing a wsdl file. I have tried to do so but receive many errors.  Disregarding these errors as I'd like to understand what I'm doing anyhow & it may take a very long time to troubleshoot the WSDL errors, I have tried to code my Request/Response requirements using code as per the snippet I have attached.  This is based on Salesforce.com's Apex language.

For the most part I think I am coding it correctly. However I'm not sure what I should do re: "Header" element.  I presume I should not have included this in the Body as I have done?
Should it somehow be added using the req.setHeader(); method also? I would have thought so but I didn't really understand how.

The following is a reference from Salessforce.com but if you have any examples of the above or attached code in any language I'd be interested in viewing them
http://wiki.developerforce.com/index.php/Apex_Web_Services_and_Callouts

Thanks for the help on this.  As you can guess I'm very new to this & very much struggling.

code-1.txt
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.