Solved

How can I update a field in the Perl output?

Posted on 2011-03-02
5
299 Views
Last Modified: 2012-08-14
As you have described before, I can now get the value from the Perl output.

Now I want  to update this field, which means I want to overwrite it. Let's say I want to change the status field to 'incomplete'.

I tried the following but it did not work:

$ssc->{geckStates}[0]{status} = 'THIS IS A WSDL TEST';

Open in new window


Can you please explain me how to do it?

Note: I am not sure it it matters but I communicate with a web application via a web service. And I try to upload a field in this application.

Thanks,
0
Comment
Question by:Tolgar
  • 3
  • 2
5 Comments
 

Author Comment

by:Tolgar
Comment Utility
Actually, overwrite is not a right word in the question. I want to add someother text to that field like 'THIS IS A WSDL TEST'
0
 
LVL 26

Expert Comment

by:wilcoxon
Comment Utility
That line of code will update the value in the perl data structure.  You can see this by doing

print Dumper $ssc->{geckStates};

after the update line.

How to update the value in your web application completely depends on your web service and web app.
0
 

Author Comment

by:Tolgar
Comment Utility
Sorry for the confusion. Actually this overwrites the solution field. But I wan to append it to that field. How can I do it?

Thanks,
0
 
LVL 26

Expert Comment

by:wilcoxon
Comment Utility
So are you saying that you want to replace status 'Completed' with 'THIS IS A WSDL TEST' or that you want to add the string after Completed?  The code you posted will do the former.  For the latter, this will work:

$ssc->{geckStates}[0]{status} .= ' THIS IS A WSDL TEST';
0
 
LVL 26

Accepted Solution

by:
wilcoxon earned 500 total points
Comment Utility
.= appends to the existing value (rather than = overwriting).  If you don't add a space in the string to be appended (like I did), you end up with something like 'CompletedTHIS IS A WSDL TEST'.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now