Unable to import binding

Discussion in 'ASP .Net Web Services' started by imonline, Nov 16, 2006.

  1. imonline

    imonline Guest

    Hi,
    I have created a WSDL file and now I am trying to create
    server class from it using WSDL.exe. My WSDL is as follows:


    <?xml version="1.0" encoding="utf-8" ?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:eek:ta="http://www.opentravel.org/OTA/2003/05"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.opentravel.org/OTA/2003/05"
    name="HotelReservationService">
    <!-- Define data types (import OTA schemas) -->
    <wsdl:types>
    <xs:schema targetNamespace
    ="http://www.opentravel.org/OTA/2003/05">
    <xs:include schemaLocation="OTA_HotelResRQ.xsd"/>
    </xs:schema>
    <xs:schema targetNamespace
    ="http://www.opentravel.org/OTA/2003/05">
    <xs:include schemaLocation="OTA_HotelResRS.xsd" />
    </xs:schema>
    </wsdl:types>
    <!-- Define request and response messages-->
    <wsdl:message name="HotelReservationRequest">
    <wsdl:part name="parameters" element="ota:OTA_HotelResRQ"/>
    </wsdl:message>
    <wsdl:message name="HotelReservationResponse">
    <wsdl:part name="parameters" element="ota:OTA_HotelResRS"/>
    </wsdl:message>
    <!-- Define operation and reference messages-->
    <wsdl:portType name="HotelReservationPortType">
    <wsdl:eek:peration name="OTA_HotelResRQ">
    <wsdl:input message="ota:HotelReservationRequest"/>
    <wsdl:eek:utput message="ota:HotelReservationResponse"/>
    </wsdl:eek:peration>
    </wsdl:portType>
    <wsdl:binding name="HotelReservationBinding"
    type="ota:HotelReservationPortType">
    <!-- Use document style and not rpc-->
    <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:eek:peration name="OTA_HotelResRQ">
    <!-- Use 'literal' to include OTA XML as-is-->
    <soap:eek:peration soapAction="CreateReservation" style="document"/>
    <wsdl:input>
    <soap:body use="literal"
    namespace="http://www.opentravel.org/OTA/2003/05"/>
    </wsdl:input>
    <wsdl:eek:utput>
    <soap:body use="literal"
    namespace="http://www.opentravel.org/OTA/2003/05"/>
    </wsdl:eek:utput>
    </wsdl:eek:peration>
    </wsdl:binding>m
    <!-- Define SOAP interface with previously declared binding-->
    <wsdl:service name="OTAHotelReservationService">
    <wsdl:port name="HotelReservationPort"
    binding="ota:HotelReservationBinding">
    <!-- Replace "http://mydomain/myservicename" with actual service
    endpoint-->
    <soap:address
    location="http://localhost/Ota_Webservice/Service.asmx"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

    And I am getting the following error for it:
    Error: Unable to import binding 'HotelReservationBinding' from
    namespace 'http:
    /www.opentravel.org/OTA/2003/05'.
    - Unable to import operation 'OTA_HotelResRQ'.
    - The datatype
    'http://www.opentravel.org/OTA/2003/05:HotelResRequestType' is
    missing.

    What am I doing wrong? Any help is highly
    appreciated.


    Thanks,
    Nis
     
    imonline, Nov 16, 2006
    #1
    1. Advertising

  2. imonline

    RYoung Guest

    Oh man, the OTA specs. I've been messing with these too. The problem is that
    OTA_HotelResRQ.xsd <xs:include>s the OTA_CommonTypes.xsd and a couple
    others. But the issue is that wsdl.exe is not handling the include
    correctly. I doubt we would have this problem generating service code if the
    <xs:import> were used, but then the OTA_CommonTypes.xsd would need a
    targetNamespace, which it doesn't have. The Open Travel Alliance mention
    that in their specs, they wanted to not tie the common type definitions to a
    singular namespace, and allow other companies to integrate it with thier
    systems.

    Heres the MSDN KB on the issue: http://support.microsoft.com/kb/820122

    I know the error in the KB does not match what you've got, but believe me
    I've seen that error too, and I was working with OTA_PingRQ. I tried all
    kinds of ways, couldn't get anything to work in XmlSpy either.

    What I did get to work though is described here:
    http://inkspotdev.com/wscf_ota/details.htm

    If you want to try that out, you'll need to install the WSCF from
    thinktecture.com:
    http://www.thinktecture.com/Resources/Software/WSContractFirst/default.html

    If you haven't used WSCF before, then I'd recommend going through the
    walkthrough available on the site first - it's written very well.

    But, as I mentioned, I did get it work using the flattened OTA schemas and
    WSCF.

    Ron

    "imonline" <> wrote in message
    news:...
    > Hi,
    > I have created a WSDL file and now I am trying to create
    > server class from it using WSDL.exe. My WSDL is as follows:
    >
    >
    > <?xml version="1.0" encoding="utf-8" ?>
    > <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    > xmlns:eek:ta="http://www.opentravel.org/OTA/2003/05"
    > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    > xmlns:xs="http://www.w3.org/2001/XMLSchema"
    > targetNamespace="http://www.opentravel.org/OTA/2003/05"
    > name="HotelReservationService">
    > <!-- Define data types (import OTA schemas) -->
    > <wsdl:types>
    > <xs:schema targetNamespace
    > ="http://www.opentravel.org/OTA/2003/05">
    > <xs:include schemaLocation="OTA_HotelResRQ.xsd"/>
    > </xs:schema>
    > <xs:schema targetNamespace
    > ="http://www.opentravel.org/OTA/2003/05">
    > <xs:include schemaLocation="OTA_HotelResRS.xsd" />
    > </xs:schema>
    > </wsdl:types>
    > <!-- Define request and response messages-->
    > <wsdl:message name="HotelReservationRequest">
    > <wsdl:part name="parameters" element="ota:OTA_HotelResRQ"/>
    > </wsdl:message>
    > <wsdl:message name="HotelReservationResponse">
    > <wsdl:part name="parameters" element="ota:OTA_HotelResRS"/>
    > </wsdl:message>
    > <!-- Define operation and reference messages-->
    > <wsdl:portType name="HotelReservationPortType">
    > <wsdl:eek:peration name="OTA_HotelResRQ">
    > <wsdl:input message="ota:HotelReservationRequest"/>
    > <wsdl:eek:utput message="ota:HotelReservationResponse"/>
    > </wsdl:eek:peration>
    > </wsdl:portType>
    > <wsdl:binding name="HotelReservationBinding"
    > type="ota:HotelReservationPortType">
    > <!-- Use document style and not rpc-->
    > <soap:binding style="document"
    > transport="http://schemas.xmlsoap.org/soap/http"/>
    > <wsdl:eek:peration name="OTA_HotelResRQ">
    > <!-- Use 'literal' to include OTA XML as-is-->
    > <soap:eek:peration soapAction="CreateReservation" style="document"/>
    > <wsdl:input>
    > <soap:body use="literal"
    > namespace="http://www.opentravel.org/OTA/2003/05"/>
    > </wsdl:input>
    > <wsdl:eek:utput>
    > <soap:body use="literal"
    > namespace="http://www.opentravel.org/OTA/2003/05"/>
    > </wsdl:eek:utput>
    > </wsdl:eek:peration>
    > </wsdl:binding>m
    > <!-- Define SOAP interface with previously declared binding-->
    > <wsdl:service name="OTAHotelReservationService">
    > <wsdl:port name="HotelReservationPort"
    > binding="ota:HotelReservationBinding">
    > <!-- Replace "http://mydomain/myservicename" with actual service
    > endpoint-->
    > <soap:address
    > location="http://localhost/Ota_Webservice/Service.asmx"/>
    > </wsdl:port>
    > </wsdl:service>
    > </wsdl:definitions>
    >
    > And I am getting the following error for it:
    > Error: Unable to import binding 'HotelReservationBinding' from
    > namespace 'http:
    > /www.opentravel.org/OTA/2003/05'.
    > - Unable to import operation 'OTA_HotelResRQ'.
    > - The datatype
    > 'http://www.opentravel.org/OTA/2003/05:HotelResRequestType' is
    > missing.
    >
    > What am I doing wrong? Any help is highly
    > appreciated.
    >
    >
    > Thanks,
    > Nis
    >
     
    RYoung, Nov 17, 2006
    #2
    1. Advertising

  3. "RYoung" <rcyoungatinkspotdev.com> wrote in message
    news:%...
    > Oh man, the OTA specs. I've been messing with these too. The problem is
    > that OTA_HotelResRQ.xsd <xs:include>s the OTA_CommonTypes.xsd and a couple
    > others. But the issue is that wsdl.exe is not handling the include
    > correctly. I doubt we would have this problem generating service code if
    > the <xs:import> were used, but then the OTA_CommonTypes.xsd would need a
    > targetNamespace, which it doesn't have. The Open Travel Alliance mention
    > that in their specs, they wanted to not tie the common type definitions to
    > a singular namespace, and allow other companies to integrate it with thier
    > systems.



    I've never gotten wsdl.exe to properly handle includes. However, if you
    specify the xsd file on the command line it will have the same effect.

    John
     
    John Saunders, Nov 17, 2006
    #3
  4. imonline

    RYoung Guest

    Yeah, that's where I've seen that error: xsd OTA_PingRQ.xsd /classes

    Error - The attribute group OTA_PayloadStdAttributes is missing

    and the following is from OTA_PingRQ.xsd

    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace="http://www.opentravel.org/OTA/2003/05"
    elementFormDefault="qualified" version="1.004" id="OTA2006A"
    xmlns="http://www.opentravel.org/OTA/2003/05"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="OTA_SimpleTypes.xsd"/>
    <xs:include schemaLocation="OTA_CommonTypes.xsd"/>
    <xs:include schemaLocation="OTA_AirCommonTypes.xsd"/>

    where the OTA_PayloadStdAttributes is in OTA_CommonTypes.xsd I believe.

    Too bad it won't work with includes, would have service development pretty
    easy using Xml Spy and wsdl.exe. Heck, even if xsd.exe would work, I'd just
    go ahead and code-first the web services.

    Ron

    "John Saunders" <john.saunders at trizetto.com> wrote in message
    news:...
    > "RYoung" <rcyoungatinkspotdev.com> wrote in message
    > news:%...
    >> Oh man, the OTA specs. I've been messing with these too. The problem is
    >> that OTA_HotelResRQ.xsd <xs:include>s the OTA_CommonTypes.xsd and a
    >> couple others. But the issue is that wsdl.exe is not handling the include
    >> correctly. I doubt we would have this problem generating service code if
    >> the <xs:import> were used, but then the OTA_CommonTypes.xsd would need a
    >> targetNamespace, which it doesn't have. The Open Travel Alliance mention
    >> that in their specs, they wanted to not tie the common type definitions
    >> to a singular namespace, and allow other companies to integrate it with
    >> thier systems.

    >
    >
    > I've never gotten wsdl.exe to properly handle includes. However, if you
    > specify the xsd file on the command line it will have the same effect.
    >
    > John
    >
    >
     
    RYoung, Nov 17, 2006
    #4
  5. "RYoung" <rcyoungatinkspotdev.com> wrote in message
    news:...
    > Yeah, that's where I've seen that error: xsd OTA_PingRQ.xsd /classes
    >
    > Error - The attribute group OTA_PayloadStdAttributes is missing
    >
    > and the following is from OTA_PingRQ.xsd
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    > <xs:schema targetNamespace="http://www.opentravel.org/OTA/2003/05"
    > elementFormDefault="qualified" version="1.004" id="OTA2006A"
    > xmlns="http://www.opentravel.org/OTA/2003/05"
    > xmlns:xs="http://www.w3.org/2001/XMLSchema">
    > <xs:include schemaLocation="OTA_SimpleTypes.xsd"/>
    > <xs:include schemaLocation="OTA_CommonTypes.xsd"/>
    > <xs:include schemaLocation="OTA_AirCommonTypes.xsd"/>
    >
    > where the OTA_PayloadStdAttributes is in OTA_CommonTypes.xsd I believe.


    I mean that I use wsdl.exe and specify the wsdl file and all of the included
    ..xsd files on the command line.

    Also, do you have "nested" attribute groups in there? I found a bug in
    wsdl.exe in processing attribute groups which reference other attribute
    groups. I had to "flatten" my attribute groups. Could that be your problem?

    John
     
    John Saunders, Nov 18, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jordan
    Replies:
    2
    Views:
    2,549
    Jordan
    Feb 10, 2004
  2. Amit
    Replies:
    6
    Views:
    13,848
    Assimalyst
    Oct 24, 2006
  3. Besharam

    WSDL failing to parse Unable to import binding

    Besharam, Oct 1, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    287
    Besharam
    Oct 1, 2003
  4. Unable to import binding

    , Dec 8, 2005, in forum: ASP .Net Web Services
    Replies:
    6
    Views:
    353
  5. Replies:
    0
    Views:
    1,050
Loading...

Share This Page