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

Disable wsdl in Savon 2.0 #398

Closed
rankin opened this issue Feb 22, 2013 · 9 comments · Fixed by #416
Closed

Disable wsdl in Savon 2.0 #398

rankin opened this issue Feb 22, 2013 · 9 comments · Fixed by #416

Comments

@rankin
Copy link

rankin commented Feb 22, 2013

There was another issue with this problem but that was version 0.8. I'm using Savon 2 and I cannot figure out how to disable wsdl in my client.

The client is prepending wsdl: to my soap request literally

<wsdl:AuthRequest/>

It should be

<AuthRequest/>
@rankin
Copy link
Author

rankin commented Feb 22, 2013

So I found that you can set the namespace identifier with namespace_identifier on your client. However if you set it to "" you'll end up with the following:

<env:Body>
  <:AuthRequest/>
</env:Body>

If the namespace identifier is blank there should be no preceding colon. This is breaking the request I just want to be able to send:

<env:Body>
  <AuthRequest/>
</env:Body>

when not using a wsdl. Savon 2 forces you to have the preceding wsdl:

@rankin
Copy link
Author

rankin commented Feb 22, 2013

I made a patch for this. Can be see in my pull request #400

@rankin rankin closed this as completed Feb 22, 2013
@rubiii
Copy link
Contributor

rubiii commented Feb 26, 2013

could you please provide the wsdl for debugging, because you shouldn't need to change the namespace identifier.
i'm open to add support for removing the namespace identifier, but i would like to add specs for this based on your wsdl to ensure future versions "just work".

@rubiii rubiii reopened this Feb 26, 2013
@rankin
Copy link
Author

rankin commented Feb 26, 2013

That's just it, there is no wsdl. This is for the Zimbra SOAP API which does not use a wsdl.

@r4um
Copy link
Contributor

r4um commented Mar 12, 2013

I see a similar problem, but with namespace identifier being added to the message(s).
For example the UltraDNS SOAP API http://ultra-api.ultradns.com:8008/UltraDNS_WS?wsdl

The following is a valid request (skipping headers), namespace is tns.

<env:Body>
<tns:getZonesOfAccount>
<accountId>0123FOO</accountId>
<zoneType>all</zoneType>
</tns:getZonesOfAccount>
</env:Body>

Whereas the following doesn't work, which is built and sent via savon

<env:Body>
<tns:getZonesOfAccount>
<tns:accountId>0123FOO</tns:accountId>
<tns:zoneType>all</tns:zoneType>
</tns:getZonesOfAccount>
</env:Body>

Gives error

soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Found element {http://webservice.api.ultra.neustar.com/}accountId but could not find matching RPC/Literal part</faultstring></soap:Fault></soap:Body></soap:Envelope>
Savon::SOAPFault: (soap:Server) Found element {http://webservice.api.ultra.neustar.com/}accountId but could not find matching RPC/Literal part

savon code

client = Savon.client do
  wsdl "http://ultra-api.ultradns.com:8008/UltraDNS_WS?wsdl"
  wsse_auth("USER", "PASS")
end
client.call(:get_zones_of_account, message: { account_id: '01023FOO', zone_type: 'all' } )

Not sure what is the correct behavior/approach is in this case, perhaps a ignore_namespace_identifier
option while building the message ?

@r4um
Copy link
Contributor

r4um commented Mar 13, 2013

just need to set element_form_default :unqualified in above case.

@camol
Copy link

camol commented Aug 28, 2013

Hi I have a small problem connected with the namespace identifier. When I don't set it I get:

<soap:Body>
 <tns:SaleFromBankAccount>
  <tns:storeId>xxxxx</tns:storeId>

When I set it to nil I get:

  <soap:Body>
   <:SaleFromBankAccount>
    <storeId>xxxxxx</storeId>

The ":" remain and it generates error.

@rubiii
Copy link
Contributor

rubiii commented Sep 7, 2013

@camol which version are you using and can you provide code to reproduce the problem?

@vladlena
Copy link

What is the status for this?
Is it possible to completely remove the wsdl tag from inside the body?

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

Successfully merging a pull request may close this issue.

5 participants