python26 and ZSI

have any one worked with wsdl in python26?

Page 1 of 1

0 Replies - 2176 Views - Last Post: 18 March 2010 - 05:38 PM Rate Topic: -----

#1 watsg0in0n  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 18-March 10

python26 and ZSI

Posted 18 March 2010 - 05:38 PM

Im trying to access REMEDY SOAP API using ZSI.wstools in python2.6

there is no good documentation online either for ZSI.wstools.WSDL or for remedy

I think im doing everything right but i kept getting the following err:
ZSI.FaultException: ARERR [149] A user name must be supplied in the control record



This err is coming from Remedy which means that SOAP post is working but the script cant authenticate.
I sure im using the correct username and password but i think the problem is the SOAP thats being posted. when i ran the script..
this what the output looks like

$ ./remedy.py 
_________________________________ Thu Mar 18 19:26:48 2010 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><ZSI:BasicAuth><ZSI:Name>USERNAME</ZSI:Name><ZSI:Password>PASSWORD</ZSI:Password></ZSI:BasicAuth></SOAP-ENV:Header><SOAP-ENV:Body xmlns:ns1="urn:HPD_IncidentInterface_WS"><ns1:HelpDesk_QueryList_Service xsi:type="ns1:GetListInputMap"><ns1:Qualification>'Incident Number'='INC000000318866'</ns1:Qualification><ns1:startRecord>0</ns1:startRecord><ns1:maxLimit>1000</ns1:maxLimit></ns1:HelpDesk_QueryList_Service></SOAP-ENV:Body></SOAP-ENV:Envelope>
_________________________________ Thu Mar 18 19:26:48 2010 RESPONSE:
500
Internal Server Error
-------
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=71A112DFC3B41E0402E8B591B4F6BFFA; Path=/arsys
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Fri, 19 Mar 2010 00:26:48 GMT
Connection: close

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>ARERR [149] A user name must be supplied in the control record</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">rmdy01vip</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
----  ZSI.TC.AnyElement  ----
    [ERROR]   Give up, parse (http://xml.apache.org/axis/,hostname) as a String
Traceback (most recent call last):
  File "./remedy.py", line 30, in <module>
    response = portType.HelpDesk_QueryList_Service(request)
  File "/home/ughani/p1svn/ughani/socmetrics/backend/HPD_IncidentInterface_WSService_services.py", line 49, in HelpDesk_QueryList_Service
    response = self.binding.Receive(HelpDesk_QueryList_ServiceSoapOut.typecode)
  File "build/bdist.linux-i686/egg/ZSI/client.py", line 502, in Receive
  File "build/bdist.linux-i686/egg/ZSI/client.py", line 430, in Receive
ZSI.FaultException: ARERR [149] A user name must be supplied in the control record
rmdy01vip




In the SOAP I substituted my username with USERNAME and passwd with PASSWORD.
i have tried using AUTH.zsibasic , AUTH.httpbasic and AUTH.none. All of them returns the same error..

Here is my code

#!/bin/env python2.6

from ZSI import ServiceProxy
from ZSI.wstools import WSDLTools
from ZSI.auth import AUTH
from HPD_IncidentInterface_WSService_services import *
import users, sys, os

remedy = HPD_IncidentInterface_WSServiceLocator()
auth = (AUTH.zsibasic, 'USERNAME', 'PASSWORD' )
kw = { 'tracefile' : sys.stdout , 'auth' : auth }
portType = remedy.getHPD_IncidentInterface_WSPortType(**kw)

request = HelpDesk_QueryList_ServiceSoapIn()
request._maxLimit = 1000
request._startRecord = 0
request._Qualification = """'Incident Number'='INC000000318866'"""
response = portType.HelpDesk_QueryList_Service(request)




i have already done wsld2py ..

if anybody have any idea ...please help me out..
thanks

Is This A Good Question/Topic? 0
  • +

Page 1 of 1