Skip to main content

'Hello null' , when call web service

2 replies [Last post]
flowerlin
Offline
Joined: 2006-03-03

Hi all,

I have the following web service, deployed on tomcat for JWSDP 2.0

package server;

import javax.jws.WebService;

@WebService
public class HelloImpl {
/**
* @param name
* @return Say hello to the person.
*/
public String sayHello(String name) {
return "Hello, " + name + "!";
}
}

I made a Java client invoking the web service with param 'ceco' and the result is Hello. ceco!

I made one more client, and when I invoke the web service's method sayHello, the result is Hello, null!

This is the SAOP request with the Java client (working fine)
POST /jaxws-ajax/hello HTTP/1.1
Content-Length: 264
SOAPAction: ""
Content-Type: text/xml; charset=utf-8
Accept: text/xml, application/xop+xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
User-Agent: Java/1.5.0-p2
Host: localhost:8080
Connection: keep-alive

<?xml version="1.0" ?>

ceco

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=686B2F5A20FA1EA1743FF271EDB6C235; Path=/jaxws-ajax
Content-Type: text/xml;charset=utf-8
Content-Length: 292
Date: Sat, 04 Mar 2006 18:29:42 GMT
Server: Sun-Java-System/Web-Services-Pack-1.4

<?xml version="1.0" ?>

Hello, ceco!

And this is the SOAP request from the other client

POST /jaxws-ajax/hello HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8) Gecko/20051225 Firefox/1.5
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: bg,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: close
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 145
Cookie: JSESSIONID=D9C3E56E20F133382E87F39599E8B583
Pragma: no-cache
Cache-Control: no-cache

ceco

HTTP/1.1 200 OK
Content-Type: text/xml;charset=utf-8
Content-Length: 292
Date: Sun, 05 Mar 2006 09:15:22 GMT
Server: Sun-Java-System/Web-Services-Pack-1.4
Connection: close

<?xml version="1.0" ?>

Hello, null!

I have no idea why this is happening. Is it because the SOAP request or something in the HTTP header?

Thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
flowerlin
Offline
Joined: 2006-03-03

Hi,

I solved the problem by sending exact the same SOAP message from the secomd client.




Ceco


Can somebody tell me the difference between the SOAP messages, and why in the second case it soesno work

jitu
Offline
Joined: 2003-06-14

- "arg0" is in no namespace in the following


...
Ceco

- "arg0" is in default namespace "http://server/" in the following.


ceco