Which WSDL? Domino web service/.Net consumer

I wonder if anyone can help me with this … I’m fairly new to web service development (Domino background) and have been having problems with a web service I’m trying to develop in a Domino application that will be consumed by a .net client web site. I’ll try to summarise it but if more detail is needed then let me know …

After reading the various online docs here and elsewhere I created a basic web serivce in Domino (7.0.2FP2) that returns a complex data type … couldn’t for the life of me get it work in .net as a client until after re-reading online and finding some others I changed the WSDL to a Doc/Literal and hey presto all worked! Great I thought until …

… enhancing the web service to develop it for production use I needed an array type and again using the guides in the various online docs that seemed fairly staright forward to incorporate into the complex data type … however …

… no matter what I tried (hours and days of testing) I kept getting errors in .net with unregonised type (array) and various things that seemed to imply it wasn’t resolving the namespaces etc etc … and then after much web searching I found an article that addressed just this issue and …

… changing the WSDL to RPC/Encoded hey presto it finally worked!!! Hurrah I thought and went to bed happy ready to employ the strategy in my production .net project, however …

… the next day starting a new project in .net (actually Visual Web Developer) and adding the web reference to the (yesterday working) Domino web service WSDL it suddenly wasn’t wasn’t reconising the returned structure and it didn’t even show the detail of parameters and returned values …

… again after much trial and error I finally found what (seems) to be happening in that a Domino web service has to be defined as a Doc/Literal type when first being added to .net as a web reference but at this stage arrays aren’t reconised in .net … then … change the web service to RPC/Encoded and save, switch back to .net and refresh/update the web reference and then it will recognise the array and things will work!

The problem in all of this solution is it’s no good for production and it’s not possible to keep switching between WSDL types for a web service as new clients are created etc.

So the question I’m trying to answer is as follows :

Is there a way to create a web service in Domino of type Doc/Literal (to enable .net to have it added and working) that uses arrays ok or is there maybe a bug in .net that’s casuing this problem or am I missing something and there’s another solution that’s out there?

Any help or pointers at all on thiswould be so helpful thanks!

Derek

Subject: Which WSDL? Domino web service/.Net consumer

There’s no bugs in the .NET web service environment. I’ve used it extensively and it is VERY mature in that respect. Domino, however, is like a toddler pitching a temper tantrum when it comes to web services…so you have my empathy.

See if this article helps you:

The article addresses the complex data type issue about half way down the page.

Cheers!

Subject: RE: Which WSDL? Domino web service/.Net consumer

Hi J, thanks for the response …

You’re right, it’s a Domino issue and not a .Net as I finally managed to track down. The answer came towards the end of this article :

The following extract gave the answer as it turns out that using doc/literal or wrapped (which one tends to use for .Net) aren’t fully compliant (with 7.0.2) with arrays! Following it’s tip to manually adjust the WSDL to make it conform did the trick … just a shame this isn’t actually documented anywhere offically as anyone else having this problem would save a whole bunch of time tracking down the answer!

Derek

Here’s the relevant extract :

Array representation

Lotus Domino V7.0.2 -generated WSDLs for Web services containing arrays are not WS-I compliant. This affects the following encodings:

Domino V7 Document Literal

Domino V7 Document Wrapped

Domino V7 Document RPC Literal

The WS-I tests failed with the following error:

"An Array declaration uses - restricts or extends - the soapenc:Array type,

or the wsdl:arrayType attribute is used in the type declaration."

For the three different encodings, arrays are represented in the WSDL by the code in listing 16.

Listing 16. Generated WSDL

<complexContent>

	<restriction base="soapenc:Array">

		<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>

	</restriction>

</complexContent>

The workaround for this problem is to manually edit the WSDLs and to import them into Lotus Domino Designer (for more information on importing WSDLs into Lotus Domino Designer, see the section, “Importing WSDLs”). To make it WS-I compliant, remove the tag and replace it with tag as shown in listing 17.

Listing 17. Compliant WSDL

<sequence>

	<element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:string"/>

</sequence>