SOAP Assistance

Dear List,

I am currently in the process of researching SOAP with a view to
implementing it in our products in favour of existing, proprietary
API's. Unfortunately I am new to SOAP so my questions may appear to be a
bit dumb to you experts, please except my apologies! 

The first question I have is around the way in which SOAP can be
described by WSDL which in turn uses XML Schema to describe the simple
and complex types that make up the messages for SOAP.  I have set myself
up a test environment. I have crated a WSDL file by hand and put it on
to my local web server. I have also created a small web server which
dumps the requests it gets so I can see the header and body of every
request, my WSDL points to that server as its service URL.  Using Visual
Studio .NET I add a web reference to a project and point it at my WSDL,
and sure enough it creates me some code that I can use to invoke my web
service.  Run the code and my monitor web server shows me the SOAP
message.

In my WSDL I declare a complexType called "params" and in that I declare
a simple type called "numberVal" setting minOccurs=0 and
maxOccurs="unbounded".  In XML Schema, the following document would be
valid: -

<params>
	<numberVal>10</numberVal>
	<numberVal>20</numberVal>
	<numberVal>30</numberVal>
</params>

and my home-grown XML parser/validation can take the XML Schema and
validate the above document, as I would expect.

When I look at the SOAP request I observe two things: -

1. Unlike my example document above, the simple types in the SOAP
message have a "type" attribute which contains the simple type
information, in this instance "xsd:int".

2. The SOAP message creates an array instead of just the list of values
as I would have expected (given that SOAP I thought was meant to use XML
Schema). I get something like this: -

<soapenc:Array id="id2" soapenc:arrayType="xsd:int[5]">
	<Item>10</Item>
	<Item>20</Item>
	<Item>30</Item>
</soapenc:Array>

So, finally here are my questions: -

- Is what I am observing something that is normal for SOAP or, is this
just how Microsoft have implemented this in VS2005?  

- What is the normal flow for a SOAP server, my initial impression was,
once the request was received you would take the parameters, get the
Schema out of the WSDL and validate it. Given how it appears to work,
that does not seem to be the case. 

- If it should be validated against the schema, its it expected to
unroll the SOAP representation of the message values back into the
document that the validater could use. 

- I am guessing that SOAP does not need the WSDL to work, but in that
case how does one enforce mandatory values, I thought that's where XML
Schema comes in? Or is that left up to the business logic?

Can anyone offer any insight, I am clearly confused by the whole thing
;-)

Regards

Gerry

Received on Wednesday, 30 August 2006 18:43:02 UTC