[Fedora-suds-list] suds.WebFault: Server raised fault: 'The arguments supplied to the function were not valid: Missing <argument name>

Jeff Ortel jortel at redhat.com
Tue Oct 6 15:11:44 UTC 2009



On 10/06/2009 10:07 AM, Jeff Ortel wrote:
> Hey Lucy,
>
> This wsdl isn't written in a way that is unconventional for a
> rcp/encoded soap service and contrary to the documentation:
> https://api.verticalresponse.com/partner-wsdl/1.0/documentation.html#login.
> I'm not sure how the PHP example works because the argument to the
> login() method is of type ns0:loginArgs.
>
> The message for this operation is defined as:
>
> <wsdl:message name="loginRequest">
> <wsdl:part name="args" type="vrtypens:loginArgs"/>
> </wsdl:message>
>
> and
>
> <xsd:complexType name="loginArgs">
> <xsd:sequence>
> <xsd:element name="username" type="xsd:string"/>
> <xsd:element name="password" type="xsd:string"/>
> <xsd:element name="session_duration_minutes" type="xsd:integer"/>
> <xsd:element name="impersonate_user" type="xsd:string"/>
> <xsd:element name="impersonate_partner_integration_user"
> type="xsd:string"/>
> <xsd:element name="partner_integration" type="xsd:string"/>
> </xsd:sequence>
> </xsd:complexType>
>
> If the arguments were really intended to be:
>
> login(username, password, session_duration_minutes, ...)
>
> I would expect the message for rpc/encoded to be:
>
> <wsdl:message name="loginRequest">
> <wsdl:part name="username" type="xsd:string"/>
> <wsdl:part name="password" type="xsd:string"/>
> <wsdl:part name="session_duration_minutes" type="xsd:integer"/>
> <wsdl:part name="impersonate_user" type="xsd:string"/>
> <wsdl:part name="impersonate_partner_integration_user" type="xsd:string"/>
> <wsdl:part name="partner_integration" type="xsd:string"/>
> </wsdl:message>
>
> But, with that said, I will review the WSDL/SOAP specifications to see
> if there is anything I missed regarding this type of message.
>
> For now, though - the best way to see what suds believes the arguments
> to be for any given method, you should (print) the client as below and
> supply the arguments as it describes. I did the following and the server
> complained about invalid username or password which suggests the message
> is correct.
>
> Hope this helps,
>
> Jeff
>
>
>  > client = Client(url, cache=None)
>  > print client
>
> [see: attached]
>
>  > credentials = client.factory.create('ns0:loginArgs')
>  > print login
>  > credentials.username='jeff'
>  > credentials.password='xxx'
>  > credentials.session_duration_minutes=30
>  > print client.service.login(credentials)

I renamed the 'credentials' variable for the email.  This ^^ should be:


 > credentials = client.factory.create('ns0:loginArgs')
 > print credentials
 > credentials.username='jeff'
 > credentials.password='xxx'
 > credentials.session_duration_minutes=30
 > print client.service.login(credentials)

>
> [fault]
>
> 2009-10-06 09:45:20,517 [ERROR] send() @client.py:629
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns0="http://api.verticalresponse.com/1.0/VRAPI.xsd"
> xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:ns2="VR/API/1_0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org
> /soap/envelope/"
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <SOAP-ENV:Header/>
> <SOAP-ENV:Body>
> <ns2:login>
> <args xsi:type="ns0:loginArgs">
> <username xsi:type="ns1:string">jeff</username>
> <password xsi:type="ns1:string">xxx</password>
> <session_duration_minutes
> xsi:type="ns1:integer">30</session_duration_minutes>
> </args>
> </ns2:login>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> Server raised fault: 'The username or password supplied was incorrect.'
> (Fault){
> faultcode = "SOAP-ENV:VRAPI.InvalidLogin"
> faultstring = "The username or password supplied was incorrect."
> }
>
>
> On 10/05/2009 10:42 PM, Lucy Mendel wrote:
>> Hi,
>>
>> I'm new to suds and soap in general, so please bear with my imprecise
>> terminology (and feel free to correct me).
>>
>> Namely, the following fails inexplicably with a Missing argument server
>> fault, yet I've supplied the exact argument requested, both as named
>> parameters, positional parameters, **dict.
>>
>>> >> from suds.client import Client
>>> >> url = 'https://api.verticalresponse.com/partner-wsdl/1.0/VRAPI.wsdl'
>>> >> client = Client(url)
>>> >> client.service.login(username="clay at bilumi.org
>> <mailto:clay at bilumi.org>", password="XXX", session_duration_minutes=30)
>> <<< python 2.6 on os X.5 >>>
>> No handlers could be found for logger "suds.client"
>> Traceback (most recent call last):
>> Â File "<stdin>", line 1, in <module>
>> Â File "build/bdist.macosx-10.3-fat/egg/suds/client.py", line 535, in
>> __call__
>> Â File "build/bdist.macosx-10.3-fat/egg/suds/client.py", line 595, in
>> invoke
>> Â File "build/bdist.macosx-10.3-fat/egg/suds/client.py", line 630, in
>> send
>> Â File "build/bdist.macosx-10.3-fat/egg/suds/client.py", line 681, in
>> failed
>> Â File "build/bdist.macosx-10.3-fat/egg/suds/bindings/binding.py", line
>> 235, in get_fault
>> suds.WebFault: Server raised fault: 'The arguments supplied to the
>> function were not valid: Missing username'
>>
>> <<< python 2.5 on ubuntu 8.04 >>>
>> No handlers could be found for logger "suds.client"
>> Traceback (most recent call last):
>> Â File "<stdin>", line 1, in <module>
>> Â File "build/bdist.linux-i686/egg/suds/client.py", line 535, in __call__
>> Â File "build/bdist.linux-i686/egg/suds/client.py", line 595, in invoke
>> Â File "build/bdist.linux-i686/egg/suds/client.py", line 630, in send
>> Â File "build/bdist.linux-i686/egg/suds/client.py", line 681, in failed
>> Â File "build/bdist.linux-i686/egg/suds/bindings/binding.py", line 235,
>> in get_fault
>> suds.WebFault: Server raised fault: 'The arguments supplied to the
>> function were not valid: Missing username'
>>
>> <<< ipython 2.6 on mac >>>
>> ---------------------------------------------------------------------------
>>
>> WebFault                                Â
>> Traceback (most recent call last)
>>
>> /Users/lucy/sandbox/CalmProcrasDonate/procrasdonate/applib/<ipython
>> console> in <module>()
>>
>> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/suds-0.3.7-py2.6.egg/suds/client.pyc
>>
>> in __call__(self, *args, **kwargs)
>> Â Â Â 533Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return (500, e)
>> Â Â Â 534Â Â Â Â Â Â Â Â else:
>> --> 535Â Â Â Â Â Â Â Â Â Â Â Â return client.invoke(args, kwargs)
>> Â Â Â 536
>> Â Â Â 537Â Â Â Â def faults(self):
>>
>> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/suds-0.3.7-py2.6.egg/suds/client.pyc
>>
>> in invoke(self, args, kwargs)
>> Â Â Â 593Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â self.method.name
>> <http://self.method.name>, timer)
>> Â Â Â 594Â Â Â Â Â Â Â Â timer.start()
>> --> 595Â Â Â Â Â Â Â Â result = self.send(msg)
>> Â Â Â 596Â Â Â Â Â Â Â Â timer.stop()
>> Â Â Â 597Â Â Â Â Â Â Â Â metrics.log.debug(
>>
>> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/suds-0.3.7-py2.6.egg/suds/client.pyc
>>
>> in send(self, msg)
>> Â Â Â 628Â Â Â Â Â Â Â Â Â Â Â Â else:
>> Â Â Â 629Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â log.error(self.last_sent())
>> --> 630Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â result = self.failed(binding, e)
>> Â Â Â 631Â Â Â Â Â Â Â Â return result
>> Â Â Â 632
>>
>> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/suds-0.3.7-py2.6.egg/suds/client.pyc
>>
>> in failed(self, binding, error)
>> Â Â Â 679Â Â Â Â Â Â Â Â if status == 500:
>> Â Â Â 680Â Â Â Â Â Â Â Â Â Â Â Â if len(reply) > 0:
>> --> 681Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â r, p = binding.get_fault(reply)
>> Â Â Â 682Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â self.last_received(r)
>> Â Â Â 683Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return (status, p)
>>
>> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/suds-0.3.7-py2.6.egg/suds/bindings/binding.pyc
>>
>> in get_fault(self, reply)
>> Â Â Â 233Â Â Â Â Â Â Â Â p = unmarshaller.process(fault)
>> Â Â Â 234Â Â Â Â Â Â Â Â if self.options.faults:
>> --> 235Â Â Â Â Â Â Â Â Â Â Â Â raise WebFault(p, faultroot)
>> Â Â Â 236Â Â Â Â Â Â Â Â return (faultroot, p.detail)
>> Â Â Â 237
>>
>> WebFault: Server raised fault: 'The arguments supplied to the function
>> were not valid: Missing username'
>>
>> just in case:
>> client.service.login(username="clay at bilumi.org
>> <mailto:clay at bilumi.org>", password="XXX", session_duration_minutes=30)
>> client.service.login("clay at bilumi.org <mailto:clay at bilumi.org>",
>> "XXX", 30)
>> d = {'username':"clay at bilumi.org <mailto:clay at bilumi.org>",
>> 'password':"XXX", 'session_duration_minutes':3}
>> client.service.login(**d)
>>
>> I tried to get suds to work with a different wsdl to determine whether
>> the problem is user error. I could not find a simple soap server to
>> point at. Maybe that is all I really need....suggestions?
>>
>> I'm using revision 577 of the suds repo.
>>
>> I am in communication with a VerticalResponse engineer; VerticalResponse
>> is the company whose API I'd like to communicate with. People there have
>> barely heard of python, though, so if I can be certain the problem is
>> not on my end (it likely is) that would be awesome.
>>
>> Thanks for your help.
>> I've heard excellent things about suds on stackoverflow, so keep up the
>> good work.
>>
>> Lucy.
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> fedora-suds-list mailing list
>> fedora-suds-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/fedora-suds-list
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> fedora-suds-list mailing list
> fedora-suds-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-suds-list

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3360 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/fedora-suds-list/attachments/20091006/bcde36f2/attachment.p7s>


More information about the fedora-suds-list mailing list