How can I call a RESTful .Net WCF Service from cURL?

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question













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 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














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?










share|improve this question













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 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












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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 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
















  • 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















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

















active

oldest

votes











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',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay