Change web service response [message #985445] |
Thu, 15 November 2012 06:56  |
Eclipse User |
|
|
|
Hi all,
I wish to change the output of a web service response where a particular XML tag is currently <worker_name>Joe Bloggs</worker_name> and I want to change it to <name>Joe Bloggs</name>
In the XML schema document that the WSDL uses I changed the relevant tag from this;
<xs:element name="worker_name" type="xs:string"
minOccurs="0" />
to this;
<xs:element type="xs:string" name="name"
maxOccurs="1" minOccurs="1"/>
Then in the relevant class in Eclipse I changed the code below;
private String worker_name;
public void setWorker_name(String worker_name) {
this.worker_name = worker_name;
}
@javax.jws.WebResult(name="WorkerName")
public String getWorker_name() {
return worker_name;
}
to the following below. But when I test it in SoapUI it still did not work. I receive an exception and the message in the console is that there is a java.lang.NullPointerException
private String name;
public void setName(String worker_name) {
this.name = worker_name;
}
@javax.jws.WebResult(name="Name")
public String getName() {
return name;
}
What am I doing wrong? Any help would be appreciated. Quite new to Java, Eclipse and web services. Unix background.
Thanks in advnace for your assistance
Regards
AJF
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09296 seconds