[JBossWS] - Re: NullPointerException when processing response
by pramod_bs
Here are some code snippets from JBoss code. I am not sure if you already loked at this. If not you can use eclipse debugger to see what is coming in the parameters. I am assuming the header is null. I might be wrong. Try it out.
WSSecurityDispatcher.java
|
| public static void handleInbound(CommonMessageContext ctx) throws SOAPException, SOAPFaultException
| {
| WSSecurityConfiguration config = getSecurityConfig(ctx);
| SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
|
| SOAPHeader soapHeader = soapMessage.getSOAPHeader(); QName secQName = new QName(Constants.WSSE_NS, "Security");
| Element secHeaderElement = Util.findElement(soapHeader, secQName);
|
|
|
|
| Util.java
|
| public static Element findElement(Element root, QName name)
| {
| // Here lies your standard recusive DFS.....
| if (matchNode(root, name))
| return root;
|
|
|
| public static boolean matchNode(Node node, QName name, boolean local)
| {
| return equalStrings(node.getLocalName(), name.getLocalPart())
| && (local || equalStrings(node.getNamespaceURI(), name.getNamespaceURI()));
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4142363#4142363
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4142363
18 years
[JBossWS] - Web Service Response problem
by Karnan
Hi,
Im using JBossws203GA with jboss405GA.
I generated interfaces and service classes with wsconsume from wsdl file
And i also wrote my client which will consume the service.
BUt i have a prob with the response of the server.
Details:
here is my web method:
|
| @WebMethod(operationName = "OpenSession", action = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/OpenSession")
| @RequestWrapper(localName = "OpenSession", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/", className = "net.webservicestoolkit.sv.sessioncontext.v1.OpenSession")
| @ResponseWrapper(localName = "OpenSessionResponse", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/", className = "net.webservicestoolkit.sv.sessioncontext.v1.OpenSessionResponse")
| public void openSession(
| @WebParam(name = "UserName", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/")
| String userName,
| @WebParam(name = "Password", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/")
| String password,
| @WebParam(name = "projectLanguage", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/")
| SVLanguage projectLanguage,
| @WebParam(name = "OpenSessionResult", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/", mode = WebParam.Mode.OUT)
| Holder<Result> openSessionResult,
| @WebParam(name = "SessionId", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/", mode = WebParam.Mode.OUT)
| Holder<String> sessionId){
|
| Holder<String> tmp = new Holder<String>("12345");
| sessionId = tmp;
| openSessionResult = new Holder<Result>();
| System.out.println("openSession");
| }
|
here is the client:
When i call the this remote method from the client, i always get the value 0.
I checked the type of the response (0) with getClass().getName(), and i got String.
Where is the prob,
can someone help me
thx a lot
| serviceName = new QName("http://WebServicesToolkit.net/SV/SessionContext/v1.0/", "SessionContext");
| SessionContext service = new SessionContext(wsdlLocation, serviceName);
| SessionContextSoap scs = service.getSessionContextSoap();
|
| Holder<Result> openSessionResult = new Holder<Result>();
| Holder<String> sessionId = new Holder<String>();
| System.out.println("sessionId avant appel: " + sessionId.value);
| scs.openSession("Karnan","azerty",SVLanguage.CONTEXT_DEFAULT,openSessionResult,sessionId);
| System.out.println("Karnan sessionId: " + sessionId);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4142350#4142350
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4142350
18 years