simple example for custom wsdl autogeneration
Hi.
Please give some simple example for custom wsdl autogeneration.
Thanks
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- ladon Edit question
- Assignee:
- jsgaarde Edit question
- Solved by:
- romankrv
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Hi
Can you tell me what you meen by custom wsdl?
Revision history for this message
|
#2 |
for example:
I want to hav in wsdl
<portType name="myname.
<service name=
<operation name="RequestFe
etc
thanks
Revision history for this message
|
#3 |
That is:
exist code (ladon code) which generation wsdl" as
class SOAPServiceDesc
xsd_type_map = type_to_xsd
_content_type = 'text/xml'
def generate(
and I want to set "servicename" from generate meth
can simple example for that
Thanks
Revision history for this message
|
#4 |
Ladon follows the wsdl 1.1 specification completely as far as I know:
http://
The servicename comes from the name of your serviceclass. Why do you want Ladon to use another name than the one you gave it while implementing your serviceclass?
/ Jakob Simon-Gaarde
Revision history for this message
|
#5 |
Hi Jakob.
I want to continue discuss about create wsdl file:
Can you explain how to create custom wsdl on demaind (auto generation) via ladon ?
Maybe you have some simple example for that.
(custom wsdl --> it is like http://
Thanks
Revision history for this message
|
#6 |
What changes should the custom wsdl make?
Revision history for this message
|
#7 |
For example i want to set
soapAction = "myURI"
your lib not have in
def generate(
that definition.
that have only soapAction tag with NULL definition
as:
for m in methodlist:
soapaction.
-------
so that parametr not configurable but i don't want override that function
Can you made more flexible for that?
Thanks
Revision history for this message
|
#8 |
Hi.
See that was more specific. You have to remember that this is a community project. It's better you tell me exactly if there is a problem so I can fix it for everyone rather that you make your own custom fix that noone else benefits from - that's the way open source works :-)
And in this case you found something that might even be a bug, so please report it as a bug instead of a question.
About the possibility to make custom wsdl, all you have to do is:
1. copy the ladon/interface
2. edit ladon/interface
3. edit ladon/interface
When you have done that you have two identical interfaces soap and mysoap, changing generate() method in mysoap.py will not affect the soap interface.
The best and most open sourcely thing to do is ofcourse fix/enhance the soap interface on your local system and commit a bug fix, that way you will be credited as a contributer - sounds nice ;-)
Best Regards
Jakob Simon-Gaarde
Revision history for this message
|
#9 |
ok. thanks for instruction.
I done like that but i get error when I start ladon-server
error is:
"""
File "/home/
from ladon.interfaces import mysoap # added here
File "/home/
from ladon.interfaces import expose
ImportError: cannot import name expose
"""
What is problem?
Thanks
Revision history for this message
|
#10 |
Please pastebin mysoap.py
Den 02/08/2011 14.16 skrev "romankrv" <<email address hidden>
>:
> Question #165951 on ladon changed:
> https:/
>
> Status: Answered => Open
>
> romankrv is still having a problem:
> ok. thanks for instruction.
> I done like that but i get error when I start ladon-server
>
> error is:
>
> """
> File
"/home/
line 5, in <module>
> from ladon.interfaces import mysoap # added here
> File
"/home/
line 4, in <module>
> from ladon.interfaces import expose
> ImportError: cannot import name expose
>
>
> """
>
>
> What is problem?
>
> Thanks
>
> --
> You received this question notification because you are an answer
> contact for ladon.
Revision history for this message
|
#11 |
Revision history for this message
|
#12 |
Look at my 1. 2. 3. steps again especially step 3 which says: "at the bottom of the file"
Best regards
Jakob Simon-Gaarde
Revision history for this message
|
#13 |
BTW - you don't have to remove the "soap" interface. "soap" and "mysoap" can happily coexist without a problem :-)
Revision history for this message
|
#14 |
Ok. It work(import not crash) but i not see that my def generate in mysoap.py is work only work from soap.py
Why?
Thanks
Revision history for this message
|
#15 |
in debuging i go to soap not mysoap
Revision history for this message
|
#16 |
right like this in __init__.py:
import ladon.interface
import ladon.interface
or right:
import ladon.interface
import ladon.interface
?
Revision history for this message
|
#17 |
The new interface you made is called mysoap so you have to use that. I just tried it, it works perfectly:
ladon/interface
Revision history for this message
|
#18 |
You should see a small difference in the wsdl that is created:
<definition
...
mysoap=
...>
</definition>
Revision history for this message
|
#19 |
I copy paste your http://
and it not show me "his_is_mysoap"
what can problem maybe for that?
tnx
Revision history for this message
|
#20 |
if I even delete content in mysoap.py it work. work from soap.py
please help me about that
Revision history for this message
|
#21 |
what is the url to your wsdl?
Revision history for this message
|
#22 |
Have you gone to your web service's webpage with a browser?
1. Open your browser and go to: http://
2. Select the service
3. Find the interface "mysoap" press the description link
Best Regards
Jakob Simon-Gaarde
Revision history for this message
|
#24 |
I want to continue issue:
when I try use code for mysoap.py :
from suds.client import Client;
url = 'http://
client1 = Client(url)
i get error:
"""
In [20]: client1 = Client(url)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (279, 0))
-------
Exception Traceback (most recent call last)
/home/krv/
----> 1 client1 = Client(url)
/home/krv/
110 self.set_
111 reader = DefinitionsRead
--> 112 self.wsdl = reader.open(url)
113 plugins = PluginContainer
114 plugins.
/home/krv/
150 d = cache.get(id)
151 if d is None:
--> 152 d = self.fn(url, self.options)
153 cache.put(id, d)
154 else:
/home/krv/
156 pmd.wrappers[
157 self.open_imports()
--> 158 self.resolve()
159 self.build_schema()
160 self.set_wrapped()
/home/krv/
205 """ Tell all children to resolve themselves """
206 for c in self.children:
--> 207 c.resolve(self)
208
209 def build_schema(self):
/home/krv/
492 qref = qualify(op.input, self.root, definitions.tns)
493 msg = definitions.
--> 494 if msg is None:
495 raise Exception("msg '%s', not-found" % op.input)
496 else:
Exception: msg 'tns:RequestInt
"""
If i turn on to default soap.py (in ladon) it is no errors.
Because in mysoap.py it is only copy/paste code from soap.py with changed name class MYSOAPInterface and
@staticmethod
def _interface_name():
return 'mysoap'
Can you reproduce that or what is error and why?
Thanks.
Revision history for this message
|
#25 |
one needs to reloads ipython shell
thx