Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Namespace ~ imported wsdl #532

Closed
stanl3y opened this issue Dec 11, 2013 · 3 comments
Closed

Nested Namespace ~ imported wsdl #532

stanl3y opened this issue Dec 11, 2013 · 3 comments

Comments

@stanl3y
Copy link

stanl3y commented Dec 11, 2013

Hello !

I am trying to use this webservice,
http://publicbetawebservices.hotel.de/V2_8/FreeHotelSearchWebService.svc?WSDL
which imports the wsdl from here
http://publicbetawebservices.hotel.de/V2_8/FreeHotelSearchWebService_ServiceContract.wsdl

Using SoapUI, I can get this template and it works fine.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://webservices.hotel.de/V2_8/">
   <soapenv:Header/>
   <soapenv:Body>
      <v2:DetermineLocationNumber>
         <v2:objRequest>
            <v2:Language>?</v2:Language>
            <v2:Token>?</v2:Token>
            <v2:AffiliateNumber>?</v2:AffiliateNumber>
            <v2:Destination>?</v2:Destination>
         </v2:objRequest>
      </v2:DetermineLocationNumber>
   </soapenv:Body>
</soapenv:Envelope>

While when using Savon

@client = Savon.client do
  wsdl "http://publicbetawebservices.hotel.de/V2_8/FreeHotelSearchWebService_ServiceContract.wsdl"
  endpoint "http://publicbetawebservices.hotel.de/V2_8/FreeHotelSearchWebService.svc?WSDL"
  namespace_identifier :v2
  env_namespace :soapenv
end

def determine_location_number destination
  response = client.call(:determine_location_number, message: {
   objRequest: { affiliate_number: 1, language: 'CS', destination: 'Prague'} })
end

I obtain the following. Please note the v2 namespace goes one level only. Is there a way to make it same as above without typing manually?

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:v2="http://webservices.hotel.de/V2_8/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>
    <v2:DetermineLocationNumber>
      <ObjRequest>
        <AffiliateNumber>1</AffiliateNumber>
        <Language>CS</Language>
        <Destination>Prague</Destination>
      </ObjRequest>
    </v2:DetermineLocationNumber>
  </soapenv:Body>
</soapenv:Envelope>
@tjarratt
Copy link
Contributor

Hey @stanl3y !

This would be a really great thing to support, since a fair amount of WSDLs actually have this. In the currently supported version of Savon (2.3.2), parsing WSDLs (and imported WSDLs in particular) are handled by [Wasabi][https://github.com/savonrb/wasabi).

There's an open issue there to support this that I'd love to close someday soon. (Yes, it's literally issue number 1)

savonrb/wasabi#1

If you'd like to take a shot at writing a pull request for Wasabi, I'd be more than happy to help provide some context for that code and to help figure out what the correct solution is for your WSDL.

Taking a look at your wsdl... I'd have to guess that maybe the problem is the relative path for location of the imported wsdl. That's a neat weird edge case that the current code probably does not handle.

@phspies
Copy link

phspies commented Oct 3, 2014

Sorry if this has been answered but wanted to know if this was ever fixed?

@tjarratt
Copy link
Contributor

tjarratt commented Oct 9, 2014

Hey @phspies, I regret to inform you that it is still an open issue. In fact, it's open issue # 1 on Wasabi.

savonrb/wasabi#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants