Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Unable to import binding

Reply
Thread Tools

Unable to import binding

 
 
imonline
Guest
Posts: n/a
 
      11-16-2006
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/"
xmlnsta="http://www.opentravel.org/OTA/2003/05"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlnss="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">
<wsdlart name="parameters" element="ota:OTA_HotelResRQ"/>
</wsdl:message>
<wsdl:message name="HotelReservationResponse">
<wsdlart name="parameters" element="ota:OTA_HotelResRS"/>
</wsdl:message>
<!-- Define operation and reference messages-->
<wsdlortType name="HotelReservationPortType">
<wsdlperation name="OTA_HotelResRQ">
<wsdl:input message="ota:HotelReservationRequest"/>
<wsdlutput message="ota:HotelReservationResponse"/>
</wsdlperation>
</wsdlortType>
<wsdl:binding name="HotelReservationBinding"
type="ota:HotelReservationPortType">
<!-- Use document style and not rpc-->
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdlperation name="OTA_HotelResRQ">
<!-- Use 'literal' to include OTA XML as-is-->
<soapperation soapAction="CreateReservation" style="document"/>
<wsdl:input>
<soap:body use="literal"
namespace="http://www.opentravel.org/OTA/2003/05"/>
</wsdl:input>
<wsdlutput>
<soap:body use="literal"
namespace="http://www.opentravel.org/OTA/2003/05"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>m
<!-- Define SOAP interface with previously declared binding-->
<wsdl:service name="OTAHotelReservationService">
<wsdlort name="HotelReservationPort"
binding="ota:HotelReservationBinding">
<!-- Replace "http://mydomain/myservicename" with actual service
endpoint-->
<soap:address
location="http://localhost/Ota_Webservice/Service.asmx"/>
</wsdlort>
</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

 
Reply With Quote
 
 
 
 
RYoung
Guest
Posts: n/a
 
      11-17-2006
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/Resource...t/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: oups.com...
> 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/"
> xmlnsta="http://www.opentravel.org/OTA/2003/05"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlnss="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">
> <wsdlart name="parameters" element="ota:OTA_HotelResRQ"/>
> </wsdl:message>
> <wsdl:message name="HotelReservationResponse">
> <wsdlart name="parameters" element="ota:OTA_HotelResRS"/>
> </wsdl:message>
> <!-- Define operation and reference messages-->
> <wsdlortType name="HotelReservationPortType">
> <wsdlperation name="OTA_HotelResRQ">
> <wsdl:input message="ota:HotelReservationRequest"/>
> <wsdlutput message="ota:HotelReservationResponse"/>
> </wsdlperation>
> </wsdlortType>
> <wsdl:binding name="HotelReservationBinding"
> type="ota:HotelReservationPortType">
> <!-- Use document style and not rpc-->
> <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdlperation name="OTA_HotelResRQ">
> <!-- Use 'literal' to include OTA XML as-is-->
> <soapperation soapAction="CreateReservation" style="document"/>
> <wsdl:input>
> <soap:body use="literal"
> namespace="http://www.opentravel.org/OTA/2003/05"/>
> </wsdl:input>
> <wsdlutput>
> <soap:body use="literal"
> namespace="http://www.opentravel.org/OTA/2003/05"/>
> </wsdlutput>
> </wsdlperation>
> </wsdl:binding>m
> <!-- Define SOAP interface with previously declared binding-->
> <wsdl:service name="OTAHotelReservationService">
> <wsdlort name="HotelReservationPort"
> binding="ota:HotelReservationBinding">
> <!-- Replace "http://mydomain/myservicename" with actual service
> endpoint-->
> <soap:address
> location="http://localhost/Ota_Webservice/Service.asmx"/>
> </wsdlort>
> </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
>



 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      11-17-2006
"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


 
Reply With Quote
 
RYoung
Guest
Posts: n/a
 
      11-17-2006
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"
xmlnss="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
>
>



 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      11-18-2006
"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"
> xmlnss="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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView binding - how to stop initial binding Amit ASP .Net 6 10-24-2006 08:06 AM
Unable to import Binding "xxx" from namespace "xxx" while running the WSDL tool for a Java Webservice punit.raizada@gmail.com ASP .Net Web Services 0 06-21-2006 08:59 PM
Unable to import binding robert.p.king@gmail.com ASP .Net Web Services 6 12-14-2005 09:08 PM
Data Binding - using inline code vs. functions vs. straight binding Jordan ASP .Net 2 02-10-2004 08:32 PM
WSDL failing to parse Unable to import binding Besharam ASP .Net Web Services 0 10-01-2003 08:14 PM



Advertisments