Disable wsdl in Savon 2.0 #398

Closed
rankin opened this Issue Feb 22, 2013 · 9 comments

Projects

None yet

5 participants

@rankin

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

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

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

@rankin rankin closed this Feb 22, 2013
@rubiii
savonrb member

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

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

@r4um

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

just need to set element_form_default :unqualified in above case.

@rubiii rubiii closed this in 548c836 Mar 31, 2013
@camol

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
savonrb member

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

@vladlena

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