?
Solved

How can I update a field in the Perl output?

Posted on 2011-03-02
5
Medium Priority
?
308 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
Six Sigma Control Plans

752 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