Hi Dan, I'm a bit confused. According to the WSDL 1.1 spec: "The following types of definitions contained in a WSDL document may be referenced: WSDL definitions: service, port, message, bindings, and portType ... The use of the import element allows the separation of the different elements of a service definition into independent documents, which can then be imported as needed. This technique helps writing clearer service definitions, by separating the definitions according to their level of abstraction. It also maximizes the ability to reuse service definitions of all kinds. As a result, WSDL documents structured in this way are easier to use and maintain."
This contradicts your statement: "...when you 'resolve' a WSDL by importing the WSDLs mentioned in its <import/> elements, the <message/> elements get moved from one namespace (in this case, WS-MEX) to another (your custom namespace)..." So beginning with Muse 2.2.0, having to copy the message elements from one wsdl to another defeats the purpose of the "import" feature for WSDL 1.1. This reminds me of the old C programming style were code is "inlined" at compile time, versus the C++/Java style of include/imports so that code in other APIs can be referenced without having to be rewritten. -----Original Message----- From: Daniel Jemiolo [mailto:[EMAIL PROTECTED] Sent: Friday, March 30, 2007 5:42 AM To: [email protected] Subject: Re: NotDocLiteral Error The problem has to do with WSDL formatting - you need to have all of your <message/> elements in your actual WSDL (not imported). The problem is that the 'name' attribute on <message/> elements is not qualified, so it takes whatever namespace is in the current WSDL; well, when you 'resolve' a WSDL by importing the WSDLs mentioned in its <import/> elements, the <message/> elements get moved from one namespace (in this case, WS-MEX) to another (your custom namespace), and WSDL4J can't resolve them. All you need to do is copy the <message/> elements in. It's still fine to keep the actual schema definitions in separate XSD files. Once you move the <message/> elements, change the 'message' attributes on your <operation/> elements (below) to use the target namespace of your WSDL, not wsmex-w. Dan "Mrityunjay Hubli \(mjay\)" <[EMAIL PROTECTED]> wrote on 03/30/2007 06:52:18 AM: > Hi All, > > I have the following operation in my wsdl > > <wsdl:import namespace="http://schemas.xmlsoap.org/ws/2004/09/mex" > location="WS-MetadataExchange-2004_09.wsdl"/> > ... > <wsdl:operation name="GetMetadata"> > <wsdl:input name="GetMetadataMsg" > message="wsmex-w:GetMetadataMsg" > wsa:Action="http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata"/> > <wsdl:output name="GetMetadataResponseMsg" > message="wsmex-w:GetMetadataResponseMsg" > wsa:Action="http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadataRespons > e"/> > </wsdl:operation> > > ... > > In WS-MetadataExchange-2004_09.wsdl the messages are defined as : > <wsdl:message name="GetMetadataMsg"> > <wsdl:part name="body" element="tns:GetMetadata"/> > </wsdl:message> > <wsdl:message name="GetMetadataResponseMsg"> > <wsdl:part name="body" element="tns:Metadata"/> > </wsdl:message> > > When I run wsdl2java, I get the following error: > java.lang.RuntimeException: [ID = 'NotDocLiteral'] The WSDL operation > 'GetMetada > ta' is not doc-literal because it defines a message with more than one > message p > art for its SOAP Body. The SOAP Body of a doc-literal message should > contain one > root request element (with the operation name) with zero or more child > elements > (the parameters). > > I have Muse version 2.2.0 > > Any ideas about what could be the problem ? > > Thanks, > M'Jay > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
