Note that there are some explanatory texts on larger screens.

plurals
  1. POnamespaces in SOAPpy not working as expected
    primarykey
    data
    text
    <p>I'm having an issue correctly interfacing with a SOAP API running on Axis2:</p> <p>What happens is I should call the login method with two arguments (loginName and password) and it returns an authentication token that I will use for subsequent interaction.</p> <pre><code>#!/usr/bin/python from SOAPpy import SOAPProxy s_user = 'Administrator' s_pass = 'securityThroughObscurity' s_host = '192.168.76.130:8998' namespace = 'http://bcc.inc.com/IncSecurity' url = 'http://' + s_host + '/axis2/services/IncSecurityService' DHCPServ = SOAPProxy(url, namespace) DHCPServ.config.dumpSOAPOut = 1 DHCPServ.config.dumpSOAPIn = 1 DHCPResp = DHCPServ.login(loginName=s_user, password=s_pass) </code></pre> <p>The Axis2 server on the other side returns an XML error stating <code>Data element of the OM Node is NULL</code>. Looking at the Axis2 logs, I see the error is <code>adb_login.c(383) non nillable or minOuccrs != 0 element loginName missing</code></p> <p>I then packet captured the <code>login</code> XML from a known working Java client versus the XML from this client and these are the differences between the two:</p> <p>SOAPpy:</p> <pre><code>&lt;ns1:login xmlns:ns1="http://bcc.inc.com/IncSecurity" SOAP-ENC:root="1"&gt; &lt;password xsi:type="xsd:string"&gt;securityThroughObscurity&lt;/password&gt; &lt;loginName xsi:type="xsd:string"&gt;Administrator&lt;/loginName&gt; &lt;/ns1:login&gt; </code></pre> <p>Java:</p> <pre><code>&lt;ns2:login xmlns:ns2="http://bcc.inc.com/IncSecurity"&gt; &lt;ns2:loginName&gt;Administrator&lt;/ns2:loginName&gt; &lt;ns2:password&gt;securityThroughObscurity&lt;/ns2:password&gt; &lt;/ns2:login&gt; </code></pre> <p>So this means that for some reason (probably related to my lack of knowledge in Python and SOAPpy) the namespace is not being applied to the variables being used in the <code>login</code> method, so by all accounts they don't actually exist and the error is warranted.</p> <p>Also, it seems to be flipping the variables around and putting the password before loginName but I don't think that matters much.</p> <p>What am I doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload