We help IT Professionals succeed at work.

undefined element in wsdl

hi, i am getting undefined element for "Trantruct" in the following part of my wsdl. what could be here the issue:

<types>
             <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:tns="http://localhost/wsdl/Mplex.wsdl"
        targetNamespace="http://localhost/wsdl/Mplex.wsdl">
       <ComplexType name="Tran" maxOccurs="999">
    <sequence>
    <element name="Conate" type="xsd:string"/>
    <element name="Conount" type="xsd:string"/>
    <element name="Conency" type="xsd:string"/>
    <element name="Conype" type="xsd:string"/>
    <element name="Contion" type="xsd:string"/>
    <element name="Condit" type="xsd:string"/>
    <element name="Conence" type="xsd:string"/>
    </sequence>
    </ComplexType>
        <element name="Trantruct" type="tns:Tran"/>
 <xsd:/schema>
 </types>

<message name="ponse">
                     <part name="Isl" type="xsd:string"/>
                     <part name="Use" type="xsd:string"/>
                      <part name="Ori" type="xsd:string"/>
                     <part name="Accype" type="xsd:string"/>
                     <part name="Accer" type="xsd:string"/>
                     <part name="Tranrence" type="xsd:string"/>
                     <part name="Timp" type="xsd:DateTime"/>
                      <part name="Resde" type="xsd:string"/>
                      <part element="tns:Trantruct" name="Transaction"/>
                     </message>
Comment
Watch Question

Commented:
Shouldn't :-

<element name="Trantruct" type="tns:Tran"/>

read :-

<element name="tns:Trantruct" type="tns:Tran"/>

Author

Commented:
i try it but it keep showing as broken. when loading the script in e.g. eclipse in the output section it keeps showing as a broken link.
see image attachment
broken-link.JPG

Commented:
What exactly is defined in ="http://localhost/wsdl/Mplex.wsdl" and is it accessible?

Author

Commented:
Mplex.wsdl is the file itself that when loading it in eclipse i get the error

Commented:
I missed the fact that it is the target namespace. So why is it redefined as tns? I'd remove all references to tns.

Author

Commented:
Attached is the sample file i am testing with of the mplex.wsdl
Mplex.txt

Author

Commented:
hi,

any suggestions of what could be wrong in this file?
Principal Solutions Architect
Top Expert 2006
Commented:
Here is the complete WSDL

some of the problems were

1) <xsd:/schema> should have been </xsd:schema>
2) namespace tns and target namespace were same leading to confusion.

<?xml version="1.0"?>
<definitions name="THURouter" targetNamespace="http://localhost/wsdl/Mplex.wsdl"
	xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns:tns="http://localhost/wsdl/Mplex.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<types>
		<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
			targetNamespace="http://localhost/wsdl/Mplex.wsdl">
			<xsd:element name="Transaction_Construct" type="tns:Tran"></xsd:element>
			<xsd:complexType name="Tran" maxOccurs="999">
				<xsd:sequence>
					<xsd:element name="Construct_Date" type="xsd:string" />
					<xsd:element name="Construct_Amount" type="xsd:string" />
					<xsd:element name="Construct_Currency" type="xsd:string" />
					<xsd:element name="Construct_DebitCredit" type="xsd:string" />
					<xsd:element name="Construct_Type" type="xsd:string" />
					<xsd:element name="Construct_Description" type="xsd:string" />
					<xsd:element name="Construct_DebitCredit" type="xsd:string" />
					<xsd:element name="Construct_Reference" type="xsd:string" />
				</xsd:sequence>
			</xsd:complexType>
		</xsd:schema>
	</types>

	<message name="THUAccountInquiryRequest">
		<part name="Island" type="xsd:string" />
		<part name="User" type="xsd:string" />
		<part name="Originating_Phone" type="xsd:string" />
		<part name="AccountType" type="xsd:string" />
		<part name="AccountNumber" type="xsd:string" />
		<part name="Transaction_Reference" type="xsd:string" />
		<part name="TimeStamp" type="xsd:DateTime" />
	</message>
	<message name="THUAccountInquiryResponse">
		<part name="Island" type="xsd:string" />
		<part name="User" type="xsd:string" />
		<part name="Originating_Phone" type="xsd:string" />
		<part name="AccountType" type="xsd:string" />
		<part name="AccountNumber" type="xsd:string" />
		<part name="Transaction_Reference" type="xsd:string" />
		<part name="Response_code" type="xsd:string" />
		<part name="Available_Balance" type="xsd:string" />
		<part name="Account_Currency" type="xsd:string" />
		<part name="Current_Balance" type="xsd:string" />
		<part name="Account_Status" type="xsd:string" />
		<part name="TimeStamp" type="xsd:DateTime" />
	</message>
	<message name="THUTransferRequest">
		<part name="Island" type="xsd:string" />
		<part name="User" type="xsd:string" />
		<part name="Originating_Phone" type="xsd:string" />
		<part name="AccountTypeFrom" type="xsd:string" />
		<part name="AccountNumberFrom" type="xsd:string" />
		<part name="Transaction_Reference" type="xsd:string" />
		<part name="AccountTypeTo" type="xsd:string" />
		<part name="AccountNumberTo" type="xsd:string" />
		<part name="TransferAmount" type="xsd:string" />
		<part name="TransferCurrency" type="xsd:string" />
		<part name="TimeStamp" type="xsd:DateTime" />
	</message>
	<message name="THUTransferResponse">
		<part name="Island" type="xsd:string" />
		<part name="User" type="xsd:string" />
		<part name="Originating_Phone" type="xsd:string" />
		<part name="Transaction_Reference" type="xsd:string" />
		<part name="Response_code" type="xsd:string" />
		<part name="TimeStamp" type="xsd:DateTime" />
	</message>
	<message name="THUHistoryRequest">
		<part name="Island" type="xsd:string" />
		<part name="User" type="xsd:string" />
		<part name="Originating_Phone" type="xsd:string" />
		<part name="AccountType" type="xsd:string" />
		<part name="AccountNumber" type="xsd:string" />
		<part name="Transaction_Reference" type="xsd:string" />
		<part name="TimeStamp" type="xsd:DateTime" />
	</message>
	<message name="THUHistoryResponse">
		<part name="Island" type="xsd:string" />
		<part name="User" type="xsd:string" />
		<part name="Originating_Phone" type="xsd:string" />
		<part name="AccountType" type="xsd:string" />
		<part name="AccountNumber" type="xsd:string" />
		<part name="Transaction_Reference" type="xsd:string" />
		<part name="TimeStamp" type="xsd:DateTime" />
		<part name="Response_code" type="xsd:string" />
		<part name="Transaction" element="tns:Transaction_Construct"></part>
	</message>

	<portType name="THU_PortType">
		<operation name="THUAccountInquiry">
			<input message="tns:THUAccountInquiryRequest" />
			<output message="tns:THUAccountInquiryResponse" />
		</operation>
		<operation name="THUAccountTransfer">
			<input message="tns:THUTransferRequest" />
			<output message="tns:THUTransferResponse" />
		</operation>
		<operation name="THUHistoryInquiry">
			<input message="tns:THUHistoryRequest" />
			<output message="tns:THUHistoryResponse" />
		</operation>
	</portType>

	<binding name="THU_Binding" type="tns:THU_PortType">
		<soap:binding style="document"
			transport="http://schemas.xmlsoap.org/soap/http" />
		<operation name="THUAccountInquiry">
			<soap:operation soapAction="THUAccountInquiry" />
			<input>
				<soap:body use="literal" />
			</input>
			<output>
				<soap:body use="literal" />
			</output>
		</operation>
		<operation name="THUAccountTransfer">
			<soap:operation soapAction="THUAccountTransfer" />
			<input>
				<soap:body use="literal" />
			</input>
			<output>
				<soap:body use="literal" />
			</output>
		</operation>
		<operation name="THUHistoryInquiry">
			<soap:operation soapAction="THUHistoryInquiry" />
			<input>
				<soap:body use="literal" />
			</input>
			<output>
				<soap:body use="literal" />
			</output>
		</operation>
	</binding>

	<service name="THURouter">
		<documentation>WSDL File for THU Account Inquiry</documentation>
		<port binding="tns:THU_Binding" name="THU_Binding">
			<soap:address location="https://localhost:8079/" />
		</port>
	</service>
</definitions>

Open in new window

Author

Commented:
thanks,
one more thing i don't understand.

when SoapUI makes the sample request, it creates a prefix (bolded) that I don't understand and don't have in my wsdl , e.g. it starts with tag "<boa:System_Request_Element>". <?xml:namespace prefix = boa />is that normal?
 

Commented:
You don't have to have this prefix in your wsdl or anywhere else for that matter.

The namespace mechanism is a way of identifing elements. One usually (but not always) uses a web address, eg: http://www.somestandard.com/standard/standard.xsd. The elements in the XML file which corresond to this namespace *could* be written :-

    <?xml version="1.0"?>
   <root>
       <http://www.somestandard.com/standard/standard.xsd:elementname ....>

but that is very longwinded and the URL might not be compliant with the syntax of a name (it is in fact never is). So one INVENTS AN ARBITARY PREFIX, eg: rat, and uses it like :-

    <?xml version="1.0"?>
   <root xmlns:rat="http://www.somestandard.com/standard/standard.xsd">
       <rat:elementname ....>

so that the prefix rat refers to the namespace. When a DOM is built the parser assigns the elements to the namespace by means of the prefix. The attribute xmlns:rat defines the namespace for all nodes containing this node which have the rat namespace.

So long as a prefix is unambiguous it may be used several times :-

    <?xml version="1.0"?>
   <root>
       <level1 xmlns:rat="http://www.somestandard.com/standard/standard.xsd">
          <rat:elementname ....>
          <rat:elementname ....>
          .....................
      </level1>
       <level2 xmlns:rat="http://www.somestandard.com/otherstandard/otherstandard.xsd">
          <rat:elementname ....>
          <rat:elementname ....>
          .....................
      </level2>
and so on.


     
Siva Prasanna KumarPrincipal Solutions Architect
Top Expert 2006

Commented:
Don't really worry about the SOAP UI prefix you can manually change it to any thing, all you need is to make sure  that the namespace URI referred by the namespace prefix.

if you don't want see "boa" you just copy that xml message to notepad

change the "xmlns:boa" to "xmlns" and replace all "boa" with ""

Thanks.