Solved

How can I update a field in the Perl output?

Posted on 2011-03-02
5
302 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
ID: 35018217
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
ID: 35018234
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
ID: 35018252
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
ID: 35018259
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
ID: 35018279
.= 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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.…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

809 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