Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Change web service response
Change web service response [message #985445] Thu, 15 November 2012 11:56 Go to next message
Alan Farroll is currently offline Alan FarrollFriend
Messages: 60
Registered: June 2012
Member
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
Re: Change web service response [message #985643 is a reply to message #985445] Thu, 15 November 2012 15:12 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 11/15/2012 4:56 AM, Alan Farroll wrote:
> 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.
> [snip]

Alan,

You are so not going to get a response to this in this forum. It's not a
forum for web services, SOAP/WSDL, etc. help.

I'd try http://www.coderanch.com/forums/f-51/Web-Services .

Russ
Re: Change web service response [message #985686 is a reply to message #985643] Thu, 15 November 2012 16:57 Go to previous messageGo to next message
Alan Farroll is currently offline Alan FarrollFriend
Messages: 60
Registered: June 2012
Member
Hi Russell,

Thanks again for your guidance

Regards

AJF
Re: Change web service response [message #985755 is a reply to message #985445] Thu, 15 November 2012 23:20 Go to previous message
Melody Magaw is currently offline Melody MagawFriend
Messages: 1
Registered: November 2012
Junior Member
Sorry to bother anyone but I can't seem to post a new topic. There is no post button. Am I doing something wrong?
Previous Topic:BIRT-Viewer DB connection error
Next Topic:Change of display string in editor after content assist
Goto Forum:
  


Current Time: Thu Apr 25 01:09:59 GMT 2024

Powered by FUDForum. Page generated in 0.08416 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top