Is it possible to use python suds to read a wsdl file from the file system?
From suds documentation, I can create a Client
if I have a url for the WSDL.
from suds.client import Client
url = 'http://localhost:7080/webservices/WebServiceTestBean?wsdl'
client = Client(url)
I currently have the WSDL file on my file system. Is it possible to use suds to read the WSDL file from my file system instead of hosting it on a web server?
python soap wsdl suds
add a comment |
From suds documentation, I can create a Client
if I have a url for the WSDL.
from suds.client import Client
url = 'http://localhost:7080/webservices/WebServiceTestBean?wsdl'
client = Client(url)
I currently have the WSDL file on my file system. Is it possible to use suds to read the WSDL file from my file system instead of hosting it on a web server?
python soap wsdl suds
add a comment |
From suds documentation, I can create a Client
if I have a url for the WSDL.
from suds.client import Client
url = 'http://localhost:7080/webservices/WebServiceTestBean?wsdl'
client = Client(url)
I currently have the WSDL file on my file system. Is it possible to use suds to read the WSDL file from my file system instead of hosting it on a web server?
python soap wsdl suds
From suds documentation, I can create a Client
if I have a url for the WSDL.
from suds.client import Client
url = 'http://localhost:7080/webservices/WebServiceTestBean?wsdl'
client = Client(url)
I currently have the WSDL file on my file system. Is it possible to use suds to read the WSDL file from my file system instead of hosting it on a web server?
python soap wsdl suds
python soap wsdl suds
asked Oct 28 '10 at 19:49
Thierry Lam
19k3396136
19k3396136
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
try to use url='file:///path/to/file'
This is the correct answer.
– jathanism
Oct 28 '10 at 22:36
5
I had to add an extra slash, thanks for the answer.
– Thierry Lam
Nov 1 '10 at 14:38
8
To add to Thierry's comment, it also has to be an absolute path. (eg. file:///home/admin/service.xml)
– trinth
May 9 '12 at 16:14
add a comment |
Oneliner
# Python 3
import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
This is a more complete one liner that will:
- let you specify just the local path,
- get you the absolute path,
- and then format it as a file-url.
Based upon:
- the comments in the accepted answer and
- this https://stackoverflow.com/a/14298190/622276
- and thanks to user Sebastian the updated Python 3 implementation since we should avoid writing legacy python at this time.
Original for reference
# Python 2 (Legacy Python)
import urlparse, urllib, os
url = urlparse.urljoin('file:', urllib.pathname2url(os.path.abspath("service.xml")))
1
In case someone is using python3, the names have changed:import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
– Sebastian
Jul 1 '17 at 9:51
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4046628%2fis-it-possible-to-use-python-suds-to-read-a-wsdl-file-from-the-file-system%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
try to use url='file:///path/to/file'
This is the correct answer.
– jathanism
Oct 28 '10 at 22:36
5
I had to add an extra slash, thanks for the answer.
– Thierry Lam
Nov 1 '10 at 14:38
8
To add to Thierry's comment, it also has to be an absolute path. (eg. file:///home/admin/service.xml)
– trinth
May 9 '12 at 16:14
add a comment |
try to use url='file:///path/to/file'
This is the correct answer.
– jathanism
Oct 28 '10 at 22:36
5
I had to add an extra slash, thanks for the answer.
– Thierry Lam
Nov 1 '10 at 14:38
8
To add to Thierry's comment, it also has to be an absolute path. (eg. file:///home/admin/service.xml)
– trinth
May 9 '12 at 16:14
add a comment |
try to use url='file:///path/to/file'
try to use url='file:///path/to/file'
edited Jan 28 '14 at 15:19
sherpya
4,04712144
4,04712144
answered Oct 28 '10 at 19:51
Gabi Purcaru
23.8k75882
23.8k75882
This is the correct answer.
– jathanism
Oct 28 '10 at 22:36
5
I had to add an extra slash, thanks for the answer.
– Thierry Lam
Nov 1 '10 at 14:38
8
To add to Thierry's comment, it also has to be an absolute path. (eg. file:///home/admin/service.xml)
– trinth
May 9 '12 at 16:14
add a comment |
This is the correct answer.
– jathanism
Oct 28 '10 at 22:36
5
I had to add an extra slash, thanks for the answer.
– Thierry Lam
Nov 1 '10 at 14:38
8
To add to Thierry's comment, it also has to be an absolute path. (eg. file:///home/admin/service.xml)
– trinth
May 9 '12 at 16:14
This is the correct answer.
– jathanism
Oct 28 '10 at 22:36
This is the correct answer.
– jathanism
Oct 28 '10 at 22:36
5
5
I had to add an extra slash, thanks for the answer.
– Thierry Lam
Nov 1 '10 at 14:38
I had to add an extra slash, thanks for the answer.
– Thierry Lam
Nov 1 '10 at 14:38
8
8
To add to Thierry's comment, it also has to be an absolute path. (eg. file:///home/admin/service.xml)
– trinth
May 9 '12 at 16:14
To add to Thierry's comment, it also has to be an absolute path. (eg. file:///home/admin/service.xml)
– trinth
May 9 '12 at 16:14
add a comment |
Oneliner
# Python 3
import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
This is a more complete one liner that will:
- let you specify just the local path,
- get you the absolute path,
- and then format it as a file-url.
Based upon:
- the comments in the accepted answer and
- this https://stackoverflow.com/a/14298190/622276
- and thanks to user Sebastian the updated Python 3 implementation since we should avoid writing legacy python at this time.
Original for reference
# Python 2 (Legacy Python)
import urlparse, urllib, os
url = urlparse.urljoin('file:', urllib.pathname2url(os.path.abspath("service.xml")))
1
In case someone is using python3, the names have changed:import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
– Sebastian
Jul 1 '17 at 9:51
add a comment |
Oneliner
# Python 3
import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
This is a more complete one liner that will:
- let you specify just the local path,
- get you the absolute path,
- and then format it as a file-url.
Based upon:
- the comments in the accepted answer and
- this https://stackoverflow.com/a/14298190/622276
- and thanks to user Sebastian the updated Python 3 implementation since we should avoid writing legacy python at this time.
Original for reference
# Python 2 (Legacy Python)
import urlparse, urllib, os
url = urlparse.urljoin('file:', urllib.pathname2url(os.path.abspath("service.xml")))
1
In case someone is using python3, the names have changed:import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
– Sebastian
Jul 1 '17 at 9:51
add a comment |
Oneliner
# Python 3
import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
This is a more complete one liner that will:
- let you specify just the local path,
- get you the absolute path,
- and then format it as a file-url.
Based upon:
- the comments in the accepted answer and
- this https://stackoverflow.com/a/14298190/622276
- and thanks to user Sebastian the updated Python 3 implementation since we should avoid writing legacy python at this time.
Original for reference
# Python 2 (Legacy Python)
import urlparse, urllib, os
url = urlparse.urljoin('file:', urllib.pathname2url(os.path.abspath("service.xml")))
Oneliner
# Python 3
import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
This is a more complete one liner that will:
- let you specify just the local path,
- get you the absolute path,
- and then format it as a file-url.
Based upon:
- the comments in the accepted answer and
- this https://stackoverflow.com/a/14298190/622276
- and thanks to user Sebastian the updated Python 3 implementation since we should avoid writing legacy python at this time.
Original for reference
# Python 2 (Legacy Python)
import urlparse, urllib, os
url = urlparse.urljoin('file:', urllib.pathname2url(os.path.abspath("service.xml")))
edited Nov 13 '18 at 3:11
answered Feb 20 '15 at 2:11
Josh Peak
1,2131827
1,2131827
1
In case someone is using python3, the names have changed:import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
– Sebastian
Jul 1 '17 at 9:51
add a comment |
1
In case someone is using python3, the names have changed:import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
– Sebastian
Jul 1 '17 at 9:51
1
1
In case someone is using python3, the names have changed:
import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
– Sebastian
Jul 1 '17 at 9:51
In case someone is using python3, the names have changed:
import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
– Sebastian
Jul 1 '17 at 9:51
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4046628%2fis-it-possible-to-use-python-suds-to-read-a-wsdl-file-from-the-file-system%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown