You define the schemas in the <types> section of the WSDL document. For example:
<wsdl:definitions name='twoNamepsaces'
targetNamespace='urn:twonamespaces/wsdl'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns:ns1='urn:twoNamespaces/ns1'
xmlns:ns2='urn:twoNamespaces/ns2'
xmlns:tns='urn:twoNamespaces/wsdl'> <wsdl:types>
<xsd:schema targetNamespace='urn:twoNamespaces/ns1'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<xsd:element name='op1' type='string'/>
</xsd:schema>
<xsd:schema targetNamespace='urn:twoNamespaces/ns2'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<xsd:element name='op2' type='string'/>
</xsd:schema>
</wsdl:types> <wsdl:message name='op1'>
<wsdl:part name='body' element='ns1:op1'/>
</wsdl:message>
<wsdl:message name='op2'>
<wsdl:part name='body' element='ns2:op2'/>
</wsdl:message> <wsdl:portType name='interface'>
<wsdl:operation name='op1'>
<wsdl:input message='tns:op1'/>
</wsdl:operation>
<wsdl:operation name='op2'>
<wsdl:input message='tns:op2'/>
</wsdl:operation>
</wsdl:portType> <wsdl:binding name='interfaceSOAP' type='tns:interface'>
<soap:binding
transport='http://schemas.xmlsoap.org/soap/http'
style='document'/>
<wsdl:operation name='op1'>
<soap:operation
soapAction='op1'
style='document'/>
<wsdl:input>
<soap:body use='literal'/>
</wsdl:input>
</wsdl:operation>
<wsdl:operation name='op2'>
<soap:operation
soapAction='op2'
style='document'/>
<wsdl:input>
<soap:body use='literal'/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>At 08:58 AM 9/25/2003 +0200, you wrote:
Are you using rpc/encoded or doc/literal?
I am using message service.
If you are using doc/literal, then the namespace of the top-level element in your SOAP body is determined by the targetNamespace attribute of the <schema> that defines the input element. If you want to use different namespaces, you need to define each message structure in a different schema.
How can I tell Axis in deployment, where the XML Schema is? Could you meybe give simple example?
Regards, Marcin
Regards, Anne At 09:16 PM 9/20/2003 +0200, you wrote:
Hi.
I would like to make a message service that has two operations in different namespaces. So one would be invoked by messages <ns1:op1/> and <ns2:op2/>.
Unfortunately if I try to do it, I get an error, that Axis can't match an operation. When I set a namespace attribute in deploying I can run only one of those messages.
Is it possible to do it? Maybe it even isn't possible to describe in WSDL?
-- ------------------------------------------------------------- Marcin Okraszewski [EMAIL PROTECTED] GG: 341942 [EMAIL PROTECTED] PGP: www.okrasz.prv.pl/pgp.asc -------------------------------------------------------------
