Return-Path: Delivered-To: apmail-xml-soap-user-archive@xml.apache.org Received: (qmail 69966 invoked by uid 500); 2 Apr 2001 23:18:51 -0000 Mailing-List: contact soap-user-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: soap-user@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list soap-user@xml.apache.org Received: (qmail 69957 invoked from network); 2 Apr 2001 23:18:50 -0000 Received: from ext-37140.rational.com (HELO sus-ma1it00.rational.com) (192.229.37.140) by h31.sny.collab.net with SMTP; 2 Apr 2001 23:18:50 -0000 Received: from 192.168.215.70 by sus-ma1it00.rational.com (InterScan E-Mail VirusWall NT); Mon, 02 Apr 2001 18:19:41 -0400 Received: by sus-ma1it00.rational.com with Internet Mail Service (5.5.2653.19) id ; Mon, 2 Apr 2001 19:19:41 -0400 Message-ID: <982A819715AC804D915E8A053B48CBB88E9F54@sus-ma1it04.rational.com> From: "Toomey, Joe" To: "'soap-user@xml.apache.org'" Subject: RE: Array Serialization Date: Mon, 2 Apr 2001 19:19:40 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-2" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Unless you attached the code after you starting chaging it, you are not setting the parameter type to a string array when you build your parameter vector in your client call. You're setting it to a string. Instead of the line: params.addElement (new Parameter("inBoard", String.class, inBoard, null)); Try using: params.addElement (new Parameter("inBoard", inBoard.getClass(), inBoard, null)); --Joe -----Original Message----- From: Terry_Truta@i2.com [mailto:Terry_Truta@i2.com] Sent: Monday, April 02, 2001 6:20 PM To: soap-user@xml.apache.org Subject: Re: Array Serialization I tried "doing nothing" for array serialization and I got the following error. Fault detected = tictactoe.TicTacToeServer.moveTest(java.lang.String,boolean) -- no signature match java.lang.Exception at tictactoe.TicTacToeClient.getMove(TicTacToeClient.java:157) at tictactoe.TicTacToeClient.main(TicTacToeClient.java:65) Exception in thread "main" java.lang.NullPointerException at tictactoe.TicTacToeClient.main(TicTacToeClient.java:67) Below is my client and server code. Note that when I modified this code to just to send a String (non array) it worked fine. So I think I need to do something else in order to get it to work with arrays. I also included the XML envelopes from the TCP Tunnel tool. As you can see the client seems is serializing the String array but it doesn't look like the data is being serialized - just the information about the array object. The fault is happening on the server side since it is looking for the method with the signature (String, boolean) and not (String[], boolean). Can you see what I'm doing wrong? Thanks. Client code: public String[] getMove(String[] inBoard) { // Build the call. Call call = new Call(); // Service uses standard SOAP encoding String encodingStyleURI = Constants.NS_URI_SOAP_ENC; call.setEncodingStyleURI(encodingStyleURI); // Set service locator parameters call.setTargetObjectURI ("urn:TicTacToeServer"); call.setMethodName ("moveTest"); // Create input parameter vector Vector params = new Vector (); params.addElement (new Parameter("inBoard", String.class, inBoard, null)); params.addElement (new Parameter("isX", Boolean.class, new Boolean(true), null)); call.setParams (params); try { // Invoke the service .... log("Invoking service..."); Response resp = call.invoke (url,""); ... My server code is just this: public String[] moveTest(String[] board, boolean isX) { System.out.println("Processing move request..."); if (isX) { board[4] = "X"; return board; } else { board[4] = "O"; return board; } } Finally, Here is the XML Envelopes for the request and response: --------------------------- Request ----------------------------------- [Ljava.lang.String;@43c749 false ------------------------------ Response --------------------------------- SOAP-ENV:Server tictactoe.TicTacToeServer.moveTest(java.lang.String,boolean) -- no signature match /soap/servlet/rpcrouter java.lang.NoSuchMethodException: tictactoe.TicTacToeServer.moveTest(java.lang.String,boolean) -- no signature match at org.apache.soap.util.MethodUtils.getEntryPoint(MethodUtils.java:194) at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:548) at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:528) at org.apache.soap.server.RPCRouter.invoke(RPCRouter.java:102) at org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java:124) at org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:26 7) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC onnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Rainer Faller cc: Subject: Re: Array Serialization 04/02/01 06:20 AM Please respond to soap-user > Terry_Truta@i2.com schrieb: > > Has anyone done array serialization? None of the examples do this. What do > you put for the javaType parameter for the mapTypes method of the > SOAPMappingRegistry object? Better yet does any have some sample code? > Thanks. If you want to use the standard datatypes like String or int, nothing has to be done. No changes to the mapping, no own serializer/deserializer. For user-defined datatypes follow the instructions of St�phane B�langer posted in this thread. Rainer --------------------------------------------------------------------- To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org For additional commands, email: soap-user-help@xml.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org For additional commands, email: soap-user-help@xml.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org For additional commands, email: soap-user-help@xml.apache.org