Hello,

I have a question.

Lets say I have 1 SOAP driver. In this driver i would like to call 8 different endpoints. Here are 2 of them shown:

https://something.com/service/Organi...Organization/1
https://something.com/service/Organi...tionfunction/1

I know that with operation data, you can determine which one to call. That is not a problem. But for each of them, the same namespaces must be used, but the rules are different for each endpoint. By that i mean, that for Orgazation, the attribute OrganisationName is mandatory, but for the Organizationfunction, it is not.

Code:
<soapenv:Envelope xmlns:ns="http://something.com/xml/wsdl/soap11/Organization/Organization/1/" xmlns:ns1="http://something.com/xml/schemas/CallContext/1/" xmlns:ns2="http://something.com/xml/schemas/AuthorityContext/1/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:xox:faf:Organization:Organization:1.1.1" xmlns:urn1="urn:xox:labdok:3.0.0" xmlns:urn2="urn:xox:faf:Organization:1.1.1">

<soapenv:Envelope xmlns:ns="http://something.com/xml/wsdl/soap11/Organization/Organizationfunction/1/" xmlns:ns1="http://something.com/xml/schemas/CallContext/1/" xmlns:ns2="http://something.com/xml/schemas/AuthorityContext/1/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:xox:faf:Organization:Organizationfunction:1.1.1" xmlns:urn1="urn:xox:labdok:3.0.0" xmlns:urn2="urn:xox:faf:Organization:1.1.1">
We have tried to get around this, by creating a stylesheet, that looks at the type of object coming in on the subscriber channel:

Code:
			<xsl:when test="@class-name='urn:Organization'">
				<xsl:message>Output: add SOAP header to urn:Organization</xsl:message>
				<soapenv:Envelope xmlns:ns="http://something.com/xml/wsdl/soap11/Organization/Organization/1/" xmlns:ns1="http://something.com/xml/schemas/CallContext/1/" xmlns:ns2="http://something.com/xml/schemas/AuthorityContext/1/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:xox:faf:Organization:Organization:1.1.1" xmlns:urn1="urn:xox:labdok:3.0.0" xmlns:urn2="urn:xox:faf:Organization:1.1.1">
					<soapenv:Body>
						<xsl:copy>
							<xsl:apply-templates select="node()|@*"/>
						</xsl:copy>
					</soapenv:Body>
				</soapenv:Envelope>
			</xsl:when>
And so on, in the same stylesheet.

And then a seperate stylesheet, after this one, for each of the cases, meaning Organization, Organizationfunction and so on. Like so:

Code:
	<xsl:template match="add[@class-name='urn:Organization']">
...
So the problem is that the same namespaces are used for each endpoint, but the rules for the same namespaces vary. That is why we have made a seperate stylesheet for each case.

Is this the best way of doing this? Would it be better to make 1 stylesheet, that takes care of all the cases? I suspect it will become very complex. Is it even possible?

Thanks in advance,

Jacob.