From: Lukasz S. <szy...@gm...> - 2012-08-27 14:21:25
|
On Sat, Aug 25, 2012 at 12:42 PM, Marco Bizzarri <mar...@gm...>wrote: > According to your wsdl, you should be able to either use directly those > parameters in the call. > > Take a look at the wsdl: if the first method takes the parameters > myusername and mypassword, you can try with: > > s.GetUsername(myusername='lukas', mypassword='mypassword') > > > It does not. From wsdl2py code that got created it looks like it wants "requestdata". Here is the wsdl part that talks about it. Can you tell from below how I should specify the request data? I have tried two approaches. One is to use soapproxy but I have no idea how to supply complex type of request to it. Above code does not work. The second approach I tried was to use the code generated by wsdl2py: from Service_services_types import * from Service_services import * iq=ns1.GetUsername_Request_Dec() iq._Username='lucas' # I also Tried just .Username..This function is of type "null" and does not accept input parameters.etc iq._Password='mysecretpassword' kw = { 'tracefile' : sys.stdout } loc=ServiceLocator() port=loc.getILoginService(**kw) port.GetUsername(iq) but that doesn't work. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns=" http://schemas.xxxx.GetUsername" elementFormDefault="qualified" targetNamespace="http://schemas.xxx.GetUsername"> <xs:import schemaLocation="http://xxxService.svc?xsd=xsd6" namespace=" http://schemas.datacontract.org/2004/07/xxxx"/> <xs:import schemaLocation="http://xxxxService.svc?xsd=xsd9" namespace=" http://schemas.datacontract.org/2004/07/xxxxx"/> <xs:import schemaLocation="http://xxxxService.svc?xsd=xsd2" namespace=" http://schemas.datacontract.org/2004/07/xxxxx"/> <xs:complexType name="RequestData"> <xs:complexContent mixed="false"> <xs:extension xmlns:q1="http://schemas.datacontract.org/2004/07/xxxx" base=" q1:RequestDataBase"> <xs:sequence> <xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/xxxx" minOccurs="0" name="BusinessInterfaceSourceId" type=" q2:BusinessInterfaceSourceType"/> <xs:element minOccurs="0" name="LoginDomain" nillable="true" type="xs:string "/> <xs:element minOccurs="0" name="LoginName" nillable="true" type="xs:string" /> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="RequestData" nillable="true" type="tns:RequestData"/> <xs:complexType name="ResponseData"> <xs:complexContent mixed="false"> <xs:extension xmlns:q3="http://schemas.datacontract.org/2004/07/xxxx" base=" q3:ResponseDataBase"> <xs:sequence> <xs:element xmlns:q4="http://schemas.datacontract.org/2004/07/xxxx" minOccurs="0" name="SecurityToken" nillable="true" type="q4:SecurityToken"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="ResponseData" nillable="true" type="tns:ResponseData"/> </xs:schema> _________________________________ Mon Aug 27 09:14:00 2012 REQUEST: <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI=" http://www.zolera.com/schemas/ZSI/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body xmlns:ns1="http://tempuri.org/ "><ns1:GetUsername.Request></ns1:GetUsername.Request></SOAP-ENV:Body></SOAP-ENV:Envelope> _________________________________ Mon Aug 27 09:14:00 2012 RESPONSE: 500 Internal Server Error ------- All I get is that I did not supply username and password, the value="nothing". Thanks, Lucas > > On Sat, Aug 25, 2012 at 7:18 PM, Lukasz Szybalski <szy...@gm...>wrote: > >> Yes, I load the whole service from our purchased software wsdl service. >> >> url=http....wsdl >> from ZSI.ServiceProxy import ServiceProxy as sp >> s=sp(url) >> >> Are you saying I should look at the wsdl to figure out what to send >> exactly? I know the service needs "loginname and password" the problem is >> the structure I need to pass it as. I know it has to be of type "request" >> but I have no idea what that exactly is. >> >> >> Thanks, >> Lucas >> >> >> >> >> >> On Sat, Aug 25, 2012 at 1:23 AM, Marco Bizzarri <mar...@gm... >> > wrote: >> >>> Hi, Lukasz; is there any WSDL? >>> >>> Regards >>> Marco >>> >>> On Sat, Aug 25, 2012 at 4:02 AM, Lukasz Szybalski <szy...@gm...>wrote: >>> >>>> Hello, >>>> >>>> I have a soap service that I'm trying to use but the input parameters >>>> is called "parameter" and its of type "request"?! How do I find out what >>>> request/parameter do I exactly pass to it? >>>> >>>> >>>> s._methods['GetUsername'][0].callinfo.inparams[0].type >>>> (u'http://tempuri.org/', u'GetUsername.Request') >>>> >>>> s._methods['GetUsername'][0].callinfo.inparams[0].name >>>> >>>> >>>> I have tried passing a list and dictionary but no lock. The function is >>>> not recognizing neither myusername nor mypassword. It says that I've >>>> passwed in "Nothing" >>>> >>>> >>>> service.GetUsername(parameters={'myusername':'lucas','mypassword':'mypassowrd'}) >>>> >>>> >>>> Any idea what can I do to figure out what I need to pass? >>>> >>>> Thanks, >>>> Lucas >>>> >>>> >>>> >>>> >>> > > > > -- http://lucasmanual.com/ <http://lucasmanual.com/blog/> |