How to isolate the contents of an xml tag after a soap request
up vote
0
down vote
favorite
I just created a soap request using curl and I'm trying to isolate the content of an xml tag in order to use it in another soap request.
Here is my code :
$xml_data = '<soapenv:Envelope xmlns:ns1="qsfd" xmlns:ns2="qsdf" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<ns2:GetStock>
<ns2:request>
<ns1:StockRequests>
<ns1:StockRequest>
<ns1:CustomerNo>qsf</ns1:CustomerNo>
<ns1:Division>qsdf</ns1:Division>
<ns1:Item>qsdf</ns1:Item>
</ns1:StockRequest>
</ns1:StockRequests>
</ns2:request>
</ns2:GetStock>
$URL = "qsdf";
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml', 'SOAPAction:qsdf'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo htmlentities($output);
die();
php xml curl soap
New contributor
John Doe1245 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
favorite
I just created a soap request using curl and I'm trying to isolate the content of an xml tag in order to use it in another soap request.
Here is my code :
$xml_data = '<soapenv:Envelope xmlns:ns1="qsfd" xmlns:ns2="qsdf" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<ns2:GetStock>
<ns2:request>
<ns1:StockRequests>
<ns1:StockRequest>
<ns1:CustomerNo>qsf</ns1:CustomerNo>
<ns1:Division>qsdf</ns1:Division>
<ns1:Item>qsdf</ns1:Item>
</ns1:StockRequest>
</ns1:StockRequests>
</ns2:request>
</ns2:GetStock>
$URL = "qsdf";
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml', 'SOAPAction:qsdf'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo htmlentities($output);
die();
php xml curl soap
New contributor
John Doe1245 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am not sure if I understand your question. Please clarify which content you want to get. If you want to parse XML you can user SimpleXML and (if the structure is more complex) XPath to get your desired content.
– Philipp Palmtag
2 days ago
In the xml answer I get, there is a tag <a:stock> that I want to use.
– John Doe1245
yesterday
I see please post the answer from the XML too.
– Philipp Palmtag
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I just created a soap request using curl and I'm trying to isolate the content of an xml tag in order to use it in another soap request.
Here is my code :
$xml_data = '<soapenv:Envelope xmlns:ns1="qsfd" xmlns:ns2="qsdf" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<ns2:GetStock>
<ns2:request>
<ns1:StockRequests>
<ns1:StockRequest>
<ns1:CustomerNo>qsf</ns1:CustomerNo>
<ns1:Division>qsdf</ns1:Division>
<ns1:Item>qsdf</ns1:Item>
</ns1:StockRequest>
</ns1:StockRequests>
</ns2:request>
</ns2:GetStock>
$URL = "qsdf";
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml', 'SOAPAction:qsdf'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo htmlentities($output);
die();
php xml curl soap
New contributor
John Doe1245 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I just created a soap request using curl and I'm trying to isolate the content of an xml tag in order to use it in another soap request.
Here is my code :
$xml_data = '<soapenv:Envelope xmlns:ns1="qsfd" xmlns:ns2="qsdf" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<ns2:GetStock>
<ns2:request>
<ns1:StockRequests>
<ns1:StockRequest>
<ns1:CustomerNo>qsf</ns1:CustomerNo>
<ns1:Division>qsdf</ns1:Division>
<ns1:Item>qsdf</ns1:Item>
</ns1:StockRequest>
</ns1:StockRequests>
</ns2:request>
</ns2:GetStock>
$URL = "qsdf";
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml', 'SOAPAction:qsdf'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo htmlentities($output);
die();
php xml curl soap
php xml curl soap
New contributor
John Doe1245 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
John Doe1245 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
John Doe1245 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 days ago
John Doe1245
12
12
New contributor
John Doe1245 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
John Doe1245 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
John Doe1245 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am not sure if I understand your question. Please clarify which content you want to get. If you want to parse XML you can user SimpleXML and (if the structure is more complex) XPath to get your desired content.
– Philipp Palmtag
2 days ago
In the xml answer I get, there is a tag <a:stock> that I want to use.
– John Doe1245
yesterday
I see please post the answer from the XML too.
– Philipp Palmtag
yesterday
add a comment |
I am not sure if I understand your question. Please clarify which content you want to get. If you want to parse XML you can user SimpleXML and (if the structure is more complex) XPath to get your desired content.
– Philipp Palmtag
2 days ago
In the xml answer I get, there is a tag <a:stock> that I want to use.
– John Doe1245
yesterday
I see please post the answer from the XML too.
– Philipp Palmtag
yesterday
I am not sure if I understand your question. Please clarify which content you want to get. If you want to parse XML you can user SimpleXML and (if the structure is more complex) XPath to get your desired content.
– Philipp Palmtag
2 days ago
I am not sure if I understand your question. Please clarify which content you want to get. If you want to parse XML you can user SimpleXML and (if the structure is more complex) XPath to get your desired content.
– Philipp Palmtag
2 days ago
In the xml answer I get, there is a tag <a:stock> that I want to use.
– John Doe1245
yesterday
In the xml answer I get, there is a tag <a:stock> that I want to use.
– John Doe1245
yesterday
I see please post the answer from the XML too.
– Philipp Palmtag
yesterday
I see please post the answer from the XML too.
– Philipp Palmtag
yesterday
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
John Doe1245 is a new contributor. Be nice, and check out our Code of Conduct.
John Doe1245 is a new contributor. Be nice, and check out our Code of Conduct.
John Doe1245 is a new contributor. Be nice, and check out our Code of Conduct.
John Doe1245 is a new contributor. Be nice, and check out our Code of Conduct.
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%2f53373406%2fhow-to-isolate-the-contents-of-an-xml-tag-after-a-soap-request%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
I am not sure if I understand your question. Please clarify which content you want to get. If you want to parse XML you can user SimpleXML and (if the structure is more complex) XPath to get your desired content.
– Philipp Palmtag
2 days ago
In the xml answer I get, there is a tag <a:stock> that I want to use.
– John Doe1245
yesterday
I see please post the answer from the XML too.
– Philipp Palmtag
yesterday