Link to home
Start Free TrialLog in
Avatar of speedygonzalez
speedygonzalez

asked on

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!
Avatar of Asim Nazir
Asim Nazir
Flag of Pakistan image

Here is full specification: http://www.w3.org/TR/soap12-part1/
ASKER CERTIFIED SOLUTION
Avatar of Asim Nazir
Asim Nazir
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of colr__
colr__

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.
Avatar of speedygonzalez

ASKER

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