Error during import WSDL for Webservice from C#

0
When I import a WSDL for a consumed webserver which I create in C# in Mendix (using an URL) I get the following error: An error occurred while parsing the XML Schema in the WSDL document: The 'http://www.w3.org/2001/XMLSchema:schema' element is not declared. Can somebody help me ??? The C# service returns a DataSet to Mendix, The WSDL: <?xml version="1.0" encoding="UTF-8"?> <DataSet xmlns="http://CustomerSrv.org/"><xs:schema xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="NewDataSet"><xs:element msdata:UseCurrentLocale="true" msdata:IsDataSet="true" name="NewDataSet"><xs:complexType><xs:choice maxOccurs="unbounded" minOccurs="0"><xs:element name="Customer"><xs:complexType><xs:sequence><xs:element name="CustomerName" minOccurs="0" type="xs:string"/><xs:element name="CustomerStreet" minOccurs="0" type="xs:string"/><xs:element name="CustomerHouseNr" minOccurs="0" type="xs:decimal"/></xs:sequence></xs:complexType></xs:element></xs:choice></xs:complexType></xs:element></xs:schema><diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"><NewDataSet xmlns=""><Customer diffgr:id="Customer1" msdata:rowOrder="0"><CustomerName>KPN </CustomerName><CustomerStreet>Maanweg </CustomerStreet><CustomerHouseNr>156</CustomerHouseNr></Customer><Customer diffgr:id="Customer2" msdata:rowOrder="1"><CustomerName>T-Mobile </CustomerName><CustomerStreet>Waldorpstraat </CustomerStreet><CustomerHouseNr>1</CustomerHouseNr></Customer></NewDataSet></diffgr:diffgram></DataSet>
asked
4 answers
1

Hi Rik,

The xml fragment I see is formatted:
 

<?xml version="1.0" encoding="UTF-8"?>

<xs:element name="CustomerName" minOccurs="0" type="xs:string"/>
<xs:element name="CustomerStreet" minOccurs="0" type="xs:string"/>
<xs:element name="CustomerHouseNr" minOccurs="0" type="xs:decimal"/>
		</xs:sequence></xs:complexType></xs:element>
			</xs:choice>
		</xs:complexType>
	</xs:element>
</xs:schema>
					<CustomerName>KPN </CustomerName>
					<CustomerStreet>Maanweg </CustomerStreet>
					<CustomerHouseNr>156</CustomerHouseNr>
				</Customer>
				<CustomerName>T-Mobile </CustomerName>
				<CustomerStreet>Waldorpstraat </CustomerStreet>
				<CustomerHouseNr>1</CustomerHouseNr>
			</Customer>
		</NewDataSet>
	</diffgr:diffgram>
</DataSet>

There's not much correct in that 'xml' fragment. Is this really intended as a wdsl? it's partly xsd and some mallformed xml containing data loosly based on that xsd. Are you sure this is what you get?

This is my first post on this forum. So, correct me please if I do not understand what I see.

Regards, Jan

answered
0

Hi Jan,

Sorry for my misinformation. The issue is in the WSDL which C# generates (see below) in case the output fields are not specified (e.g. select * from ....) which causes this error (see the bold/underlined lines). So I think I have to look for another solution to return a QUERY result from C# to Mendix. Any suggestions?

Regards,

Rik

 

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://CustomerSrv.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://CustomerSrv.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://CustomerSrv.org/">
      <s:element name="HelloWorld">
        <s:complexType />
      </s:element>
      <s:element name="HelloWorldResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="Mulitiply">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="a" type="s:long" />
            <s:element minOccurs="1" maxOccurs="1" name="b" type="s:long" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="MulitiplyResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="MulitiplyResult" type="s:long" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="GetCustomers">
        <s:complexType />
      </s:element>
      <s:element name="GetCustomersResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="GetCustomersResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema" />
                  <s:any />

                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="HelloWorldSoapIn">
    <wsdl:part name="parameters" element="tns:HelloWorld" />
  </wsdl:message>
  <wsdl:message name="HelloWorldSoapOut">
    <wsdl:part name="parameters" element="tns:HelloWorldResponse" />
  </wsdl:message>
  <wsdl:message name="MulitiplySoapIn">
    <wsdl:part name="parameters" element="tns:Mulitiply" />
  </wsdl:message>
  <wsdl:message name="MulitiplySoapOut">
    <wsdl:part name="parameters" element="tns:MulitiplyResponse" />
  </wsdl:message>
  <wsdl:message name="GetCustomersSoapIn">
    <wsdl:part name="parameters" element="tns:GetCustomers" />
  </wsdl:message>
  <wsdl:message name="GetCustomersSoapOut">
    <wsdl:part name="parameters" element="tns:GetCustomersResponse" />
  </wsdl:message>
  <wsdl:portType name="WebService1Soap">
    <wsdl:operation name="HelloWorld">
      <wsdl:input message="tns:HelloWorldSoapIn" />
      <wsdl:output message="tns:HelloWorldSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="Mulitiply">
      <wsdl:input message="tns:MulitiplySoapIn" />
      <wsdl:output message="tns:MulitiplySoapOut" />
    </wsdl:operation>
    <wsdl:operation name="GetCustomers">
      <wsdl:input message="tns:GetCustomersSoapIn" />
      <wsdl:output message="tns:GetCustomersSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="WebService1Soap" type="tns:WebService1Soap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="HelloWorld">
      <soap:operation soapAction="http://CustomerSrv.org/HelloWorld" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="Mulitiply">
      <soap:operation soapAction="http://CustomerSrv.org/Mulitiply" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetCustomers">
      <soap:operation soapAction="http://CustomerSrv.org/GetCustomers" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="WebService1Soap12" type="tns:WebService1Soap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="HelloWorld">
      <soap12:operation soapAction="http://CustomerSrv.org/HelloWorld" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="Mulitiply">
      <soap12:operation soapAction="http://CustomerSrv.org/Mulitiply" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetCustomers">
      <soap12:operation soapAction="http://CustomerSrv.org/GetCustomers" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="WebService1">
    <wsdl:port name="WebService1Soap" binding="tns:WebService1Soap">
      <soap:address location="http://localhost/WebService1.asmx" />
    </wsdl:port>
    <wsdl:port name="WebService1Soap12" binding="tns:WebService1Soap12">
      <soap12:address location="http://localhost/WebService1.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

answered
0

Hi Rik,

 

No, not really an alternative suggestion. The only thing I can say is that your xsd has to be specific. Mapping is meaningingless this way.

 

Succes.

answered
0

Hi Jan (or others),

I now changed the WSDL a bit to make the missing field specific this WSDL I have created a mapping and imported the WSDL (see sample below).

Next hurdle is: how can I make the webserver and miniflow return a list instead of an object? I want that list as a datasource for a datagrid. So how can I have a webserver return a list instead of an object?

Regards,

Rik

 

 

     <s:element name="GetCustomersResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="unbounded" name="GetCustomersResult">
              <s:complexType>
                <s:sequence>
             <s:element minOccurs="1" maxOccurs="1" name="CustomerName" type="s:string" />
             <s:element minOccurs="1" maxOccurs="1" name="CustomerStreet" type="s:string" />
             <s:element minOccurs="1" maxOccurs="1" name="CustomerHouseNr " type="s:long" />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>

answered