Products | Versions |
---|---|
TIBCO ActiveMatrix BusinessWorks | - |
Not Applicable | - |
Resolution:
When using Microsoft Visual Studio .Net to reference a BW generated WSDL, it throws the following error:
Type name='string' from targetNamespace='http://www.w3.org/2001/XMLSchema' cannot be used as top-level any element
The reason is because:
In the BW generated WSDL, customer defined one of messages as:
<wsdl:message name="HostRequest">
<wsdl:part name="HostMsgRQ" type="xs:string"/>
</wsdl:message>
Message part "HostMsgRQ" is a type of string. This should be OK according to WSDL specification. This WSDL passed the XMLspy validation too. But Visual Studio complains about this, it requires to define a wrapper element for the string, then reference the element in the message part.
After adding this line into the wsdl schema definition:
<xs:element name="HostMsgRQElement" type="xs:string"/>
Then change the message definition to:
<wsdl:message name="HostRequest">
<wsdl:part name="HostMsgRQ" element="ns1:HostMsgRQElement"/>
</wsdl:message>
Visual Studio can reference the wsdl without problem.
KEYWORDS: Visual, Studio, .Net, WSDL