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

namespacing issue #820

Closed
wstaples opened this issue Jul 26, 2017 · 7 comments
Closed

namespacing issue #820

wstaples opened this issue Jul 26, 2017 · 7 comments

Comments

@wstaples
Copy link

wstaples commented Jul 26, 2017

I have an issue that I believe is in regards to namespaces. The WSDL is attached or can be downloaded from here: http://promostandards.org/content/wsdl/Order%20Shipment%20NotificationService/1.0.0/OSN-1-0-0.zip

When the request is generated it looks like this:

<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.promostandards.org/WSDL/OrderShipmentNotificationService/1.0.0/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>
    <tns:GetOrderShipmentNotificationRequest>
      <tns:wsVersion>1.0.0</tns:wsVersion>
      <tns:id>myusername</tns:id>
      <tns:password>mypassword</tns:password>
      <tns:queryType>3</tns:queryType>
      <tns:shipmentDateTimeStamp>2017-07-19</tns:shipmentDateTimeStamp>
    </tns:GetOrderShipmentNotificationRequest>
  </soapenv:Body>
</soapenv:Envelope>

This results in a soap fault.

When SoapUI constructs the request using the same WSDL it looks like this

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.promostandards.org/WSDL/OrderShipmentNotificationService/1.0.0/" xmlns:shar="http://www.promostandards.org/WSDL/OrderShipmentNotificationService/1.0.0/SharedObjects/">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:GetOrderShipmentNotificationRequest>
         <shar:wsVersion>1.0.0</shar:wsVersion>
         <shar:id>myusername</shar:id>
         <shar:password>mypassword</shar:password>
         <ns:queryType>3</ns:queryType>
         <ns:shipmentDateTimeStamp>2017-07-19</ns:shipmentDateTimeStamp>
      </ns:GetOrderShipmentNotificationRequest>
   </soapenv:Body>
</soapenv:Envelope>

You can see that SoapUI has placed the username and password inside the "shar" namespace. I noticed that this is not directly listed in the WSDL or in any XSD file directly loaded by the WSDL. It gets loaded something like WSDL => XSD file => XSD file containing shar namespace. could that be the issue? How can I add the namespace to just 3 of the keys? I'm using savon 2.11.1 and nori 2.6.0

WSDL:
OSN-1-0-0.zip

@reinisla
Copy link

Any updates on this? Have the same issue

@wstaples
Copy link
Author

I'm don't have any new information on this issue. I did find that you can manually add the namespace to the client call like this:

my_namespaces = {
	"xmlns:shar" => "http://www.promostandards.org/WSDL/OrderShipmentNotificationService/1.0.0/SharedObjects/"
}

client = Savon.client(
	wsdl: 'my_wsdl',
	endpoint: my_endpoint,
	namespaces: my_namespaces
)

response = client.call(:get_order_shipment_notification, message: {
	'shar:ws_version': my_version,
	'shar:id': my_username, 
	'shar:password': my_password,
	other_thing: test123
})

When you are creating the client you need

@reinisla
Copy link

Found a way around this by writing raw xml and adding namespaces manually.

@aledustet
Copy link

Having the same issue here

    savon (2.11.1)
      akami (~> 1.2)
      builder (>= 2.1.2)
      gyoku (~> 1.2)
      httpi (~> 2.3)
      nokogiri (>= 1.4.0)
      nori (~> 2.4)
      wasabi (~> 3.4)

@stale
Copy link

stale bot commented Feb 19, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 19, 2018
@stale
Copy link

stale bot commented Feb 26, 2018

This issue is now closed due to inactivity. If you believe this needs further action, please re-open to discuss.

@stale stale bot closed this as completed Feb 26, 2018
@Ecco
Copy link

Ecco commented May 4, 2019

Same as #874 and #895

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

4 participants