Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Help coderanch get a
new server
by contributing to the
fundraiser
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Devaka Cooray
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
paul wheaton
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Carey Brown
Mikalai Zaikin
Bartenders:
Lou Hamers
Piet Souris
Frits Walraven
Forum:
Java in General
Getting faultcode from xpath ?
Frank Jacobsen
Ranch Hand
Posts: 378
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
This gives me a empty
string
, i try to get the faultstring out, how to do with xpath ?
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>The security token could not be authenticated or authorized; nested exception is org.apache.ws.security.WSSecurityException: The security token could not be authenticated or authorized</faultstring> </soap:Fault> </soap:Body> </soap:Envelope>
XPath xPath = XPathFactory.newInstance().newXPath(); String expression = "..//faultstring"; //read a string value try { String soapFault = xPath.compile(expression).evaluate(doc); System.out.println("FJA soapFault: " + soapFault); } catch (XPathExpressionException e2) { // TODO Auto-generated catch block, please consider logging the exception }
Frank
Marco Ehrentreich
best scout
Posts: 1294
I like...
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
a correct XPath expression to get the text content of element <faultstring> would be
//faultstring/text()
Marco
Frank Jacobsen
Ranch Hand
Posts: 378
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
THANKS ... IT WORKS
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Web service in Jboss EAP 6.2 problem
Web service + xml + java
Problem creating Accounts using DynamicEntity in MsCrm4.0
Problem in soap response it gives me some faultcode..
xml:lang in faultstring
More...