Hi,
I'am writting a simple SOAP client in python (2.4) using SOAPpy lib.
I've met with this problem:
when I want to send a list of complex type using
some method from WebService(java ,WAS),
I'v got an exception:
*************** *******
SOAPpy.Types.fa ultType:
<Fault Server.generalE xception: org.xml.sax.SAX Exception:
WSWS3136E: Error: No deserializer defined for
array type {http://www.w3.org/1999/XMLSchema}insta nce: >
I understand that this exception comes from WebService
server(WAS,java ),
and I know the reason of this exception,
A SOAP request genereted by SOAPpy contains invalid information
about Type of objects (which I've send).
Example:
*******
ServerSide (I know a list o methods and data types, so I don't read
WSDL)
----------------------------------------------------------------------------
server serve method:
sendMyElements( MyClass input)
where
'MyClass' is a class which contains two fields:
'sessionId' --------- just STRING
'myElements'--------- an array of 'MyElement'
where
'MyElement' is class which contains some simple string fields (name,
desecr)
ClientSide
--------------------
from SOAPpy import WSDL
url =
'http://localhost:9080/RouterTestWeb/services/Test/wsdl/Test.wsdl'
serv = WSDL.Proxy(url)
print serv.methods.ke ys()
class MyElement:
def __init__(self,x ,y):
self.name=x
self.descr=y
class MyClass:
def __init__(self):
self.sessionId= "someSessio nId-someSessionId-someSessionId"
#!!!!!!!!!!!!!! !!!!!!!! LOOK THIS LINE
self.myElements
=MyElement("a", "a"),MyElement( "b","b"),MyElem ent("c","")]
print serv.sendMyElem ents(MyClass())
Look at the line where I create list of elements MyElement,
In python type 'list' is able to store object of any type
(example: [123,"sddsf",MyE lement()]),
Maybe this type ('list') gives me to abstract level, cause whey:
list=['a',213,MyEleme nt('as',''),MyE lement('adsf',' '),MyElement('a sdsad','')]
print type(list)
for a in list:
print a,type(a)
I get ...
<type 'list'> -------for list, below for list's elements
a <type 'str'>
213 <type 'int'>
<__main__.MyEle ment instance at 0x00D4ABC0> <type 'instance'>
<__main__.MyEle ment instance at 0x00D56C10> <type 'instance'>
<__main__.MyEle ment instance at 0x00D56CD8> <type 'instance'>
Important, the type(MyElement( "sadas","sa d")) returns <type
'instance'>
and this information (I think) is used by SOAPpy lib while creating
SOAP request,
a piece of SOAP request:
<saveArrayOfDat a SOAP-ENC:arrayType=" xsd:instance[3]"
xsi:type="SOAP-ENC:Array" SOAP-ENC:root="0" id="i2">
<item href="#i4"/>
<item href="#i5"/>
<item href="#i6"/>
</saveArrayOfData >
I see here, that I'am sending an array of object 'instance'
(SOAP-ENC:arrayType=" xsd:instance[3]"),
but a want to send an array of MyElements.
QUESTIONs
*********
1. What shoud I do send an array of objects only one type (MyElement) ?
- create more strict data type than 'list'?
- force object - an instance of MyElement class to return proper
info
about 'type' (type(MyElement ('','')))
2. Maybe, I should use 'wsdl2py' to create valid structures (but
'wsdl2py' sometimes fails
while parsing my WSDLs - with error RuntimeError: maximum recursion
depth exceeded)
3. Maybe, I should use other library than SOAPpy
Thanks for any help,
Bartek 0 2300 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Harry George |
last post by:
I'm trying to setup a SOAPpy service under xinetd. Has someone done
this sort of thing? Didn't find it from google searches or
documentation. This is probably a sockets-level issue, but I was
hoping someone in python land had done this with SOAPpy before.
The server works fine as simple SOAP server and client pair on
localhost. But when I try to put it under xinetd, it fails. Using
"xinetd -d" I can see it is failing due to address...
|
by: Sameer Deshpande |
last post by:
Hi,
I am using python SOAPpy module to call a web service. Call to web
service gets executed successfully. I am facing a problem if the call
to WS results into redirect. I get "HTTPError: <HTTPError 302 Moved
Temporarily>"
If I enable the debug info, I do get the new redirected url. How do I
divert my WS request to new url?
|
by: benboals |
last post by:
Note: this is in reply to a message from August 2 which i found
searching for help on my own problem. I couldn't seem to reply to it,
but a friend suggested that simply using the same subject would put it
in that thread. In case he's wrong, i quoted the previous comments .
Odd-R. wrote:
> I use the following piece of code to contact a webservice,
> and read a wsdl file.
>
> from SOAPpy import WSDL
> from SOAPpy import URLopener
|
by: Steve |
last post by:
Hi All,
I have a Python script that uses SOAPpy and I'm outputting all of the
methods and info about the parameters... I'm having trouble getting
information out of the __init__ parameter.
My code :
from SOAPpy import WSDL
|
by: icius |
last post by:
Hello all,
I am trying to use a web services API with Python and SOAPpy as a
client. Some of the method paramters in this web service's WSDL are
asking for an "ArrayOfString" type. Here is my code so far:
#!/usr/bin/python
from SOAPpy import WSDL
| |
by: linuxprog |
last post by:
hi all
i'm building a webservice client with soappy
when i send some informations it's returns an error
here is the informations that generates the error
var = SOAPpy.structType()
var._addItem("code", u"XysZjd")
var._addItem("value", 1)
when i send the var variable SOAPpy prints this
|
by: Alex Ezell |
last post by:
Can anyone offer any assistance as to how to convert a basic python
dictionary, list, or even tuple into the SOAP type "ArrayOfKeyValue"?
I am currently using SOAPpy, but would be willing to change to ZSI or
something else if it made this conversion easier.
I have tried with the arrayType and structType methods in
SOAPpy.Types, yet they don't seem to do what I need. I suspect there
might not be just a single method call, so, I wrote...
|
by: pion |
last post by:
Hello
I'm trying to make a web service client in python, and so to start out, I found this simple example that are supposed to parse an wsdl file using SOAPPy. I'm using Windows and got SOAPPy installed using the Enthought Python Distribution. I've tried several wsdl files and commenting out parts of the code etc. but I just can't twist my head around what's the problem here. Any help would be greatly appreciated.
soappyTest.py:
from...
|
by: matheussousuke |
last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails.
The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg
instead of
http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg
As u see, there's the website URL before the image URL.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| | |