Linux, Curl, send a -X POST without xml file
I have a little sh script in Linux for an -X POST with curl:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --data @uManInTheMiddle.xml | grep -o 'true|false'
this works fine but i have to write first the ManInTheMiddle.xml and as second step i can send the curl command.
ManInTheMiddle.xml
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<InsertPruefResultatFromXMLFile xmlns="http://tempuri.org/">
<FilePath>\serveripscript.xml</FilePath>
</InsertPruefResultatFromXMLFile>
</Body>
</Envelope>
is there a way to do this without the xml file? send direct the "serveripscript.xml"
like:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --d "\serveripscript.xml" | grep -o 'true|false'
any ideas?
EDIT1:
I just want to handle the intermediate step with the ManInTheMiddle.xml so that the server gets directly the link to the import file (serveripscript.xml).
EDIT2:
with python it works:
url = "http://serverip/WebServices/WebServiceSQLTestresult.svc?wsdl"
import suds
import suds.client
client = suds.client.Client(url)
result = client.service.InsertPruefResultatFromXMLFile("\\serveripscript.xml")
thank you...
xml linux curl
add a comment |
I have a little sh script in Linux for an -X POST with curl:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --data @uManInTheMiddle.xml | grep -o 'true|false'
this works fine but i have to write first the ManInTheMiddle.xml and as second step i can send the curl command.
ManInTheMiddle.xml
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<InsertPruefResultatFromXMLFile xmlns="http://tempuri.org/">
<FilePath>\serveripscript.xml</FilePath>
</InsertPruefResultatFromXMLFile>
</Body>
</Envelope>
is there a way to do this without the xml file? send direct the "serveripscript.xml"
like:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --d "\serveripscript.xml" | grep -o 'true|false'
any ideas?
EDIT1:
I just want to handle the intermediate step with the ManInTheMiddle.xml so that the server gets directly the link to the import file (serveripscript.xml).
EDIT2:
with python it works:
url = "http://serverip/WebServices/WebServiceSQLTestresult.svc?wsdl"
import suds
import suds.client
client = suds.client.Client(url)
result = client.service.InsertPruefResultatFromXMLFile("\\serveripscript.xml")
thank you...
xml linux curl
You are asking if you can send the\serveripscript.xml
directly, instead of sending a request to ask the service to load that file from a windows shared folder using the\serveripscript.xml
syntax. But we don't know anything about thehttp://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl
service, so that is impossible to answer. You need to go and talk to the people that wrote this web service and ask them - we have no clue how that service works.
– nos
Nov 16 '18 at 9:43
ok so i understand the curl a little bit more... thank you ... I thought if file or link is the same for the server.
– odusnano
Nov 16 '18 at 9:47
add a comment |
I have a little sh script in Linux for an -X POST with curl:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --data @uManInTheMiddle.xml | grep -o 'true|false'
this works fine but i have to write first the ManInTheMiddle.xml and as second step i can send the curl command.
ManInTheMiddle.xml
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<InsertPruefResultatFromXMLFile xmlns="http://tempuri.org/">
<FilePath>\serveripscript.xml</FilePath>
</InsertPruefResultatFromXMLFile>
</Body>
</Envelope>
is there a way to do this without the xml file? send direct the "serveripscript.xml"
like:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --d "\serveripscript.xml" | grep -o 'true|false'
any ideas?
EDIT1:
I just want to handle the intermediate step with the ManInTheMiddle.xml so that the server gets directly the link to the import file (serveripscript.xml).
EDIT2:
with python it works:
url = "http://serverip/WebServices/WebServiceSQLTestresult.svc?wsdl"
import suds
import suds.client
client = suds.client.Client(url)
result = client.service.InsertPruefResultatFromXMLFile("\\serveripscript.xml")
thank you...
xml linux curl
I have a little sh script in Linux for an -X POST with curl:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --data @uManInTheMiddle.xml | grep -o 'true|false'
this works fine but i have to write first the ManInTheMiddle.xml and as second step i can send the curl command.
ManInTheMiddle.xml
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<InsertPruefResultatFromXMLFile xmlns="http://tempuri.org/">
<FilePath>\serveripscript.xml</FilePath>
</InsertPruefResultatFromXMLFile>
</Body>
</Envelope>
is there a way to do this without the xml file? send direct the "serveripscript.xml"
like:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --d "\serveripscript.xml" | grep -o 'true|false'
any ideas?
EDIT1:
I just want to handle the intermediate step with the ManInTheMiddle.xml so that the server gets directly the link to the import file (serveripscript.xml).
EDIT2:
with python it works:
url = "http://serverip/WebServices/WebServiceSQLTestresult.svc?wsdl"
import suds
import suds.client
client = suds.client.Client(url)
result = client.service.InsertPruefResultatFromXMLFile("\\serveripscript.xml")
thank you...
xml linux curl
xml linux curl
edited Nov 16 '18 at 9:54
odusnano
asked Nov 15 '18 at 9:16
odusnanoodusnano
11
11
You are asking if you can send the\serveripscript.xml
directly, instead of sending a request to ask the service to load that file from a windows shared folder using the\serveripscript.xml
syntax. But we don't know anything about thehttp://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl
service, so that is impossible to answer. You need to go and talk to the people that wrote this web service and ask them - we have no clue how that service works.
– nos
Nov 16 '18 at 9:43
ok so i understand the curl a little bit more... thank you ... I thought if file or link is the same for the server.
– odusnano
Nov 16 '18 at 9:47
add a comment |
You are asking if you can send the\serveripscript.xml
directly, instead of sending a request to ask the service to load that file from a windows shared folder using the\serveripscript.xml
syntax. But we don't know anything about thehttp://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl
service, so that is impossible to answer. You need to go and talk to the people that wrote this web service and ask them - we have no clue how that service works.
– nos
Nov 16 '18 at 9:43
ok so i understand the curl a little bit more... thank you ... I thought if file or link is the same for the server.
– odusnano
Nov 16 '18 at 9:47
You are asking if you can send the
\serveripscript.xml
directly, instead of sending a request to ask the service to load that file from a windows shared folder using the \serveripscript.xml
syntax. But we don't know anything about the http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl
service, so that is impossible to answer. You need to go and talk to the people that wrote this web service and ask them - we have no clue how that service works.– nos
Nov 16 '18 at 9:43
You are asking if you can send the
\serveripscript.xml
directly, instead of sending a request to ask the service to load that file from a windows shared folder using the \serveripscript.xml
syntax. But we don't know anything about the http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl
service, so that is impossible to answer. You need to go and talk to the people that wrote this web service and ask them - we have no clue how that service works.– nos
Nov 16 '18 at 9:43
ok so i understand the curl a little bit more... thank you ... I thought if file or link is the same for the server.
– odusnano
Nov 16 '18 at 9:47
ok so i understand the curl a little bit more... thank you ... I thought if file or link is the same for the server.
– odusnano
Nov 16 '18 at 9:47
add a comment |
2 Answers
2
active
oldest
votes
Use @ before filename path:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" -d @"\serveripscript.xml" | grep -o 'true|false'
add a comment |
$() to the rescue, replace
--data @uManInTheMiddle.xml
with
--data-raw "$(curl --silent \serveripscript.xml)"
something like
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --data-raw "$(curl --silent \serveripscript.xml)" | grep -o 'true|false'
note that idk how portable $() is, it certainly wouldn't work on microsoft's cmd.exe for instance, but at least it'll work on bash
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%2f53315983%2flinux-curl-send-a-x-post-without-xml-file%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
Use @ before filename path:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" -d @"\serveripscript.xml" | grep -o 'true|false'
add a comment |
Use @ before filename path:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" -d @"\serveripscript.xml" | grep -o 'true|false'
add a comment |
Use @ before filename path:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" -d @"\serveripscript.xml" | grep -o 'true|false'
Use @ before filename path:
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" -d @"\serveripscript.xml" | grep -o 'true|false'
answered Nov 15 '18 at 9:37
Andrey StarkovAndrey Starkov
894
894
add a comment |
add a comment |
$() to the rescue, replace
--data @uManInTheMiddle.xml
with
--data-raw "$(curl --silent \serveripscript.xml)"
something like
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --data-raw "$(curl --silent \serveripscript.xml)" | grep -o 'true|false'
note that idk how portable $() is, it certainly wouldn't work on microsoft's cmd.exe for instance, but at least it'll work on bash
add a comment |
$() to the rescue, replace
--data @uManInTheMiddle.xml
with
--data-raw "$(curl --silent \serveripscript.xml)"
something like
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --data-raw "$(curl --silent \serveripscript.xml)" | grep -o 'true|false'
note that idk how portable $() is, it certainly wouldn't work on microsoft's cmd.exe for instance, but at least it'll work on bash
add a comment |
$() to the rescue, replace
--data @uManInTheMiddle.xml
with
--data-raw "$(curl --silent \serveripscript.xml)"
something like
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --data-raw "$(curl --silent \serveripscript.xml)" | grep -o 'true|false'
note that idk how portable $() is, it certainly wouldn't work on microsoft's cmd.exe for instance, but at least it'll work on bash
$() to the rescue, replace
--data @uManInTheMiddle.xml
with
--data-raw "$(curl --silent \serveripscript.xml)"
something like
curl -X POST http://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl -H "Content-Type: text/xml; charset="utf-8"" -H "SOAPAction: "http://tempuri.org/IWebServiceSQLTestresult/InsertPruefResultatFromXMLFile"" --data-raw "$(curl --silent \serveripscript.xml)" | grep -o 'true|false'
note that idk how portable $() is, it certainly wouldn't work on microsoft's cmd.exe for instance, but at least it'll work on bash
edited Nov 15 '18 at 10:37
answered Nov 15 '18 at 10:28
hanshenrikhanshenrik
10.2k21839
10.2k21839
add a comment |
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.
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%2f53315983%2flinux-curl-send-a-x-post-without-xml-file%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
You are asking if you can send the
\serveripscript.xml
directly, instead of sending a request to ask the service to load that file from a windows shared folder using the\serveripscript.xml
syntax. But we don't know anything about thehttp://serverip:8081/WebServices/WebServiceSQLTestresult.svc?wsdl
service, so that is impossible to answer. You need to go and talk to the people that wrote this web service and ask them - we have no clue how that service works.– nos
Nov 16 '18 at 9:43
ok so i understand the curl a little bit more... thank you ... I thought if file or link is the same for the server.
– odusnano
Nov 16 '18 at 9:47