How can I call a RESTful .Net WCF Service from cURL?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I created a WCF service, which I am hosting on a server. I can successfully call the service from a desktop application successfully, but I have trouble calling the service from curl
at a terminal prompt.
Here is the server call:
http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact
If I wanted to call a method, say, GetVersionInfo, I would do:
http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo
In a .Net application, I would append /mex/
before the method call, but that is neither here nor there.
cURL communicates with the server to a level, because if I specify any other URI than the first, I get a 404 error, as expected.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Not Found</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Not Found</h2>
<hr><p>HTTP Error 404. The requested resource is not found.</p>
</BODY></HTML>
If I call just the base without any method, I get what I would see inside a browser, namely a screen showing how to call the service from C# or VB. If I call using any method, even a made up one, I get nothing, literally, just a blank line. I even captured the output to a file and nothing.
cURL lines that I tried:
$ curl http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/mex/GetVersionInfo
$ curl http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo
$ curl -H "Accept: application/xml" http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/mex/GetVersionInfo
I tried several other variants, but always empty.
How do I get XML back from a RESTful WCF service?
terminal windows curl .net
migrated from unix.stackexchange.com Aug 8 at 3:47
This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems.
add a comment |Â
up vote
0
down vote
favorite
I created a WCF service, which I am hosting on a server. I can successfully call the service from a desktop application successfully, but I have trouble calling the service from curl
at a terminal prompt.
Here is the server call:
http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact
If I wanted to call a method, say, GetVersionInfo, I would do:
http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo
In a .Net application, I would append /mex/
before the method call, but that is neither here nor there.
cURL communicates with the server to a level, because if I specify any other URI than the first, I get a 404 error, as expected.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Not Found</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Not Found</h2>
<hr><p>HTTP Error 404. The requested resource is not found.</p>
</BODY></HTML>
If I call just the base without any method, I get what I would see inside a browser, namely a screen showing how to call the service from C# or VB. If I call using any method, even a made up one, I get nothing, literally, just a blank line. I even captured the output to a file and nothing.
cURL lines that I tried:
$ curl http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/mex/GetVersionInfo
$ curl http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo
$ curl -H "Accept: application/xml" http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/mex/GetVersionInfo
I tried several other variants, but always empty.
How do I get XML back from a RESTful WCF service?
terminal windows curl .net
migrated from unix.stackexchange.com Aug 8 at 3:47
This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems.
Might be helpful - social.msdn.microsoft.com/Forums/en-US/â¦.
â slm
Aug 8 at 3:46
Even though you're asking a Q aboutcurl
that is on topic on this site, I feel your Q would probably be better served on SO, so I'm going to migrate it.
â slm
Aug 8 at 3:47
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I created a WCF service, which I am hosting on a server. I can successfully call the service from a desktop application successfully, but I have trouble calling the service from curl
at a terminal prompt.
Here is the server call:
http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact
If I wanted to call a method, say, GetVersionInfo, I would do:
http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo
In a .Net application, I would append /mex/
before the method call, but that is neither here nor there.
cURL communicates with the server to a level, because if I specify any other URI than the first, I get a 404 error, as expected.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Not Found</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Not Found</h2>
<hr><p>HTTP Error 404. The requested resource is not found.</p>
</BODY></HTML>
If I call just the base without any method, I get what I would see inside a browser, namely a screen showing how to call the service from C# or VB. If I call using any method, even a made up one, I get nothing, literally, just a blank line. I even captured the output to a file and nothing.
cURL lines that I tried:
$ curl http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/mex/GetVersionInfo
$ curl http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo
$ curl -H "Accept: application/xml" http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/mex/GetVersionInfo
I tried several other variants, but always empty.
How do I get XML back from a RESTful WCF service?
terminal windows curl .net
I created a WCF service, which I am hosting on a server. I can successfully call the service from a desktop application successfully, but I have trouble calling the service from curl
at a terminal prompt.
Here is the server call:
http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact
If I wanted to call a method, say, GetVersionInfo, I would do:
http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo
In a .Net application, I would append /mex/
before the method call, but that is neither here nor there.
cURL communicates with the server to a level, because if I specify any other URI than the first, I get a 404 error, as expected.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Not Found</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Not Found</h2>
<hr><p>HTTP Error 404. The requested resource is not found.</p>
</BODY></HTML>
If I call just the base without any method, I get what I would see inside a browser, namely a screen showing how to call the service from C# or VB. If I call using any method, even a made up one, I get nothing, literally, just a blank line. I even captured the output to a file and nothing.
cURL lines that I tried:
$ curl http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/mex/GetVersionInfo
$ curl http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo
$ curl -H "Accept: application/xml" http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/GetVersionInfo http://192.168.1.80:9000/WcfServiceLibrary1.CRUDContact/mex/GetVersionInfo
I tried several other variants, but always empty.
How do I get XML back from a RESTful WCF service?
terminal windows curl .net
terminal windows curl .net
asked Aug 7 at 22:26
Sarah Weinberger
6,302135892
6,302135892
migrated from unix.stackexchange.com Aug 8 at 3:47
This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems.
migrated from unix.stackexchange.com Aug 8 at 3:47
This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems.
Might be helpful - social.msdn.microsoft.com/Forums/en-US/â¦.
â slm
Aug 8 at 3:46
Even though you're asking a Q aboutcurl
that is on topic on this site, I feel your Q would probably be better served on SO, so I'm going to migrate it.
â slm
Aug 8 at 3:47
add a comment |Â
Might be helpful - social.msdn.microsoft.com/Forums/en-US/â¦.
â slm
Aug 8 at 3:46
Even though you're asking a Q aboutcurl
that is on topic on this site, I feel your Q would probably be better served on SO, so I'm going to migrate it.
â slm
Aug 8 at 3:47
Might be helpful - social.msdn.microsoft.com/Forums/en-US/â¦.
â slm
Aug 8 at 3:46
Might be helpful - social.msdn.microsoft.com/Forums/en-US/â¦.
â slm
Aug 8 at 3:46
Even though you're asking a Q about
curl
that is on topic on this site, I feel your Q would probably be better served on SO, so I'm going to migrate it.â slm
Aug 8 at 3:47
Even though you're asking a Q about
curl
that is on topic on this site, I feel your Q would probably be better served on SO, so I'm going to migrate it.â slm
Aug 8 at 3:47
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51738348%2fhow-can-i-call-a-restful-net-wcf-service-from-curl%23new-answer', 'question_page');
);
Post as a guest
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
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
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
Might be helpful - social.msdn.microsoft.com/Forums/en-US/â¦.
â slm
Aug 8 at 3:46
Even though you're asking a Q about
curl
that is on topic on this site, I feel your Q would probably be better served on SO, so I'm going to migrate it.â slm
Aug 8 at 3:47