Hi I wanted to invoke simple method using SimpleAxisServer. This method is invoked fine when used without soapenv:mustUnderstand attribute. But when I add this attribute to the header, I was expecting that method wont be called as server can not understand the security related attributes ( which is true ). But somehow I see that method is also invoked as I have simple print statement in the method ( while the proper fault message is generated )
Am I doing something wrong here ? Just sending the sample request response for the same. ===================SOAP Request ========================= <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext" soapenv:mustUnderstand="1"> <wsse:UsernameToken> <wsse:Username>test</wsse:Username> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <getQuote xmlns=""> <Stock xsi:type="xsd:string">IBM</Stock> </getQuote> </soapenv:Body> </soapenv:Envelope> ===================SOAP Request End ========================= ===================SOAP Response ========================= <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:MustUnderstand</faultcode> <faultstring>Did not understand "MustUnderstand" header(s):</faultstring> <detail> <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}MustUnderstand faultSubcode: faultString: faultActor: faultNode: faultDetail: at org.apache.axis.handlers.soap.SOAPService$SOAPResponseHandler.invoke(SOA PService.java:203) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.j ava:71) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:481) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323) at org.apache.axis.transport.http.SimpleAxisWorker.run(SimpleAxisWorker.jav a:424) at org.apache.axis.transport.http.SimpleAxisServer.run(SimpleAxisServer.jav a:173) at org.apache.axis.transport.http.SimpleAxisServer.start(SimpleAxisServer.j ava:212) at org.apache.axis.transport.http.SimpleAxisServer.start(SimpleAxisServer.j ava:220) at org.apache.axis.transport.http.SimpleAxisServer.main(SimpleAxisServer.ja va:283) </ns1:stackTrace> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> ===================SOAP Response End ========================= ===================== Service start =========================== public class Trader { public int getQuote(String stockName){ System.out.println("Returning value for " + stockName ); return stockName.length() * 33; } } ====================== Service End ============================= ==================== Server output ============================== - SimpleAxisServer starting up on port 22222. Returning value for IBM ===================================== Server output end ======================= Regards Ravi
