comparison flys-client/src/main/java/de/intevation/flys/client/server/was/Response.java @ 2945:927a3bd932d5

Fix String comparision in WAS Response class flys-client/trunk@4912 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Ricks <bjoern.ricks@intevation.de>
date Tue, 10 Jul 2012 11:11:10 +0000
parents 7683d4e43afa
children 645c774b3b98
comparison
equal deleted inserted replaced
2944:0889ec33249c 2945:927a3bd932d5
42 42
43 SAXBuilder builder = new SAXBuilder(); 43 SAXBuilder builder = new SAXBuilder();
44 Document doc = builder.build(in); 44 Document doc = builder.build(in);
45 Element root = doc.getRootElement(); 45 Element root = doc.getRootElement();
46 46
47 if (root.getName() == "ServiceExceptionReport") { 47 if (root.getName() != null && root.getName().equals("ServiceExceptionReport")) {
48 throw new ServiceException(root.getChildText("ServiceException")); 48 throw new ServiceException(root.getChildText("ServiceException"));
49 } 49 }
50 50
51 this.root = root; 51 this.root = root;
52 } 52 }
61 public Element getRoot() { 61 public Element getRoot() {
62 return this.root; 62 return this.root;
63 } 63 }
64 64
65 public Boolean isSuccess() { 65 public Boolean isSuccess() {
66 return this.getStatus() == "samlp:Success"; 66 return (this.getStatus() != null && this.getStatus().equals("samlp:Success"));
67 } 67 }
68 68
69 public String getStatus() { 69 public String getStatus() {
70 Element status = this.root.getChild("Status", Namespaces.SAML_NS_PROTO); 70 Element status = this.root.getChild("Status", Namespaces.SAML_NS_PROTO);
71 if (status == null) { 71 if (status == null) {

http://dive4elements.wald.intevation.org