??? wrote at 2011-11-29 11:04 +0800:
> ...
>What I need now is to invoke a method  sendMt provided by the web service
>server(prehaps the server is made by java language using a framwork named
>Axis).
>
>I try to invoke the sendMt method provided by the server, then failded.
>There are the tests as follows:
>
>method 1:
>
>import suds
>
>def test_sms():
>    #TODO: it's failed
>    url = "
>http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl";
>    #client = suds.client.Client(url,faults=False)
>    client = suds.client.Client(url)
>    print 'client', client
>    a = ['jia','xiao']
>    output = client.service.sendMt(a)
>    print 'output', output
>
>
># the output:
>
>client
>Suds ( https://fedorahosted.org/suds/ )  version: 0.3.7 GA  build:
>R580-20091016
>
>Service ( LNXxtSyncServiceService )
>tns="service.global.v1_0.wsdl.protocol.xxt"
>   Prefixes (3)
>      ns0 = "http://common.v1_0.obj.protocol.xxt";
>      ns1 = "http://schemas.xmlsoap.org/soap/encoding/";
>      ns2 = "service.global.v1_0.wsdl.protocol.xxt"
>   Ports (1):
>      (LNXxtSyncService)
>         Methods (5):
>            sendMo(ArrayOf_soapenc_string moInfo, )
>            sendMt(ArrayOf_soapenc_string mtInfo, )
>            syncCorp(ArrayOf_tns2_GroupOrderInfo orderInfo, )
>            syncResponseRpt(ArrayOf_soapenc_string rpt, )
>            syncStaff(ArrayOf_tns2_UserOrderInfo orderInfo, )
>         Types (54):
>            ns1:Array
>            ArrayOf_soapenc_string
>            ArrayOf_tns2_GroupOrderInfo
>            ArrayOf_tns2_UserOrderInfo
>            ns1:ENTITIES
>            ns1:ENTITY
>            ...
>No handlers could be found for logger "suds.client"

You could avoid this warning message by initializing Python's logging.
This would give you in addition a log entry for the response, I think.

Logging initialization could be performed, e.g., by

from logging import INFO, basicConfig
basicConfig(level=INFO)

>Traceback (most recent call last):
>  File "suds_client.py", line 124, in <module>
> ...
>  File
>"/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/bindings/binding.py",
>
>line 235, in get_fault
>    raise WebFault(p, faultroot)
>suds.WebFault: Server raised fault: 'No such operation 'sendMt''

This looks as if something where wrong on the server side.

While the WSDL apparently lists a "sendMt" method, the server seems not
to know about it.


At your place, I would activate "suds.client" logging (the "suds"
documentation tells you how) and carefully check the SOAP messages
sent and received.


Maybe, only the server message is misleading. "sendMt" might be known
but its parameters might be unexpected ("Java" tends to bind functions
and their signature and may tell "I do not know this function" when
it means "I do not know this function with this signature").

With respect to the parameters, you are using "suds" slightly non standard.
The WSDL tells you that "sendMT" expects an "ArrayOf_soapenc_string"
parameter. However, you are passing a list. "suds" will try to
convert but it may do something wrong.
The "standard" way is to construct the parameters of the correct type
using the client's "factory" and pass these.

> ...
>#Note:
>1: the url "
>http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl";
>is develped in Internet, anyone can use it.
>2: in my view, the server is made by java Axis, and the inparams of sendmt
>is ArrayOf_soapenc_string(In java, it means a array of String, in python,
>it means a list whose items are string).

It may be necessary to encapsulate the "list of strings" in
an explicite "ArrayOf_soapenc_string". In fact, I expect that this is
indeed necessary.

>3: the problem has puzzled me for nearly a week, please someone can give me
>some points.



--
Dieter
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to