headers[\"X-Requested-By\"] = [\"test\"]\nrequest.requestHeaders = headers
Update: Be careful to set headers to a new List rather than using the add method because this actually modifies the request definition rather than the outgoing request instance. The add method will keep adding a new copy of the header on every run
","body@stripHtml({\"removeProcessingText\":true,\"removeSpoilerMarkup\":true,\"removeTocMarkup\":true,\"truncateLength\":200})@stringLength":"213","postTime":"2016-01-05T11:11:07.397-08:00","lastPublishTime":"2016-01-05T12:58:26.579-08:00","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"attachments":{"__typename":"AttachmentConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"solution":true,"metrics":{"__typename":"MessageMetrics","views":8078},"placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"videos":{"__typename":"VideoConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"isEscalated":null,"customFields":[],"readOnly":false,"repliesCount":3,"body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"213","kudosSumWeight":0,"visibilityScope":"PUBLIC","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjUuNHwyLjF8b3wzfDE0OjAsMzk6MXwx","node":{"__ref":"ForumReplyMessage:message:137842"}},{"__typename":"MessageEdge","cursor":"MjUuNHwyLjF8b3wzfDE0OjAsMzk6MXwy","node":{"__ref":"ForumReplyMessage:message:185324"}}]}},"Rank:rank:26":{"__typename":"Rank","id":"rank:26","position":9,"name":"Community Hero","color":"00537C","icon":null,"rankStyle":"OUTLINE"},"Revision:revision:111426_1":{"__typename":"Revision","id":"revision:111426_1","lastEditTime":"2016-01-05T10:51:23.434-08:00"},"QueryVariables:ReplyList:message:111426:1":{"__typename":"QueryVariables","id":"ReplyList:message:111426:1","value":{"id":"message:111426","first":10,"sorts":{"kudosSumWeight":{"direction":"DESC","order":0},"postTime":{"direction":"ASC","order":1}},"repliesFirst":3,"repliesFirstDepthThree":1,"repliesSorts":{"kudosSumWeight":{"direction":"DESC","order":0},"postTime":{"direction":"ASC","order":1}},"useAvatar":true,"useAuthorLogin":true,"useAuthorRank":true,"useBody":true,"useKudosCount":true,"useTimeToRead":false,"useMedia":false,"useReadOnlyIcon":false,"useRepliesCount":true,"useSearchSnippet":false,"useAcceptedSolutionButton":true,"useSolvedBadge":false,"useAttachments":false,"attachmentsFirst":5,"useTags":false,"useNodeAncestors":false,"useUserHoverCard":false,"useNodeHoverCard":false,"useModerationStatus":true,"usePreviewSubjectModal":false,"useMessageStatus":true}},"CachedAsset:text:en_US-shared/client/components/users/UserAvatar-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserAvatar-1749759380271","value":{"altText":"{login}'s avatar","altTextGeneric":"User's avatar"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/ranks/UserRankLabel-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/ranks/UserRankLabel-1749759380271","value":{"altTitle":"Icon for {rankName} rank"},"localOverride":false},"CachedAsset:text:en_US-components/common/ExternalLinkWarningModal-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/common/ExternalLinkWarningModal-1749759380271","value":{"title":"Leaving the Community","description":"You're about to leave this site and navigate to an external domain. Are you sure you want to continue?","action.submit":"Continue","action.cancel":"Go Back"},"localOverride":false},"CachedAsset:text:en_US-components/tags/TagView/TagViewChip-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/tags/TagView/TagViewChip-1749759380271","value":{"tagLabelName":"Tag name {tagName}"},"localOverride":false},"CachedAsset:text:en_US-components/messages/AcceptedSolutionButton-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/AcceptedSolutionButton-1749759380271","value":{"accept":"Mark as Solution","accepted":"Marked as Solution","errorHeader":"Error!","errorAdd":"There was an error marking as solution.","errorRemove":"There was an error unmarking as solution.","solved":"Solved","topicAlreadySolvedErrorTitle":"Solution Already Exists","topicAlreadySolvedErrorDesc":"Refresh the browser to view the existing solution"},"localOverride":false},"CachedAsset:text:en_US-components/messages/ThreadedReplyList-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/ThreadedReplyList-1749759380271","value":{"title":"{count, plural, one{# Reply} other{# Replies}}","title@board:BLOG":"{count, plural, one{# Comment} other{# Comments}}","title@board:TKB":"{count, plural, one{# Comment} other{# Comments}}","title@board:IDEA":"{count, plural, one{# Comment} other{# Comments}}","title@board:OCCASION":"{count, plural, one{# Comment} other{# Comments}}","noRepliesTitle":"No Replies","noRepliesTitle@board:BLOG":"No Comments","noRepliesTitle@board:TKB":"No Comments","noRepliesTitle@board:IDEA":"No Comments","noRepliesTitle@board:OCCASION":"No Comments","noRepliesDescription":"Be the first to reply","noRepliesDescription@board:BLOG":"Be the first to comment","noRepliesDescription@board:TKB":"Be the first to comment","noRepliesDescription@board:IDEA":"Be the first to comment","noRepliesDescription@board:OCCASION":"Be the first to comment","messageReadOnlyAlert:BLOG":"Comments have been turned off for this post","messageReadOnlyAlert:TKB":"Comments have been turned off for this article","messageReadOnlyAlert:IDEA":"Comments have been turned off for this idea","messageReadOnlyAlert:FORUM":"Replies have been turned off for this discussion","messageReadOnlyAlert:OCCASION":"Comments have been turned off for this event"},"localOverride":false},"User:user:73925":{"__typename":"User","id":"user:73925","uid":73925,"login":"sudhagowri","biography":null,"registrationData":{"__typename":"RegistrationData","status":null,"registrationTime":"2017-03-09T21:24:20.227-08:00"},"deleted":false,"email":"","avatar":{"__typename":"UserAvatar","url":"https://community.smartbear.com/t5/s/nwkab66374/m_assets/avatars/default/avatar-7.svg?time=0"},"rank":{"__ref":"Rank:rank:14"},"entityType":"USER","eventPath":"community:nwkab66374/user:73925"},"ModerationData:moderation_data:137842":{"__typename":"ModerationData","id":"moderation_data:137842","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"Rank:rank:4":{"__typename":"Rank","id":"rank:4","position":8,"name":"Community Expert","color":"00537C","icon":null,"rankStyle":"OUTLINE"},"User:user:39107":{"__typename":"User","id":"user:39107","uid":39107,"login":"SiKing","biography":null,"registrationData":{"__typename":"RegistrationData","status":null,"registrationTime":"2010-12-10T13:26:10.000-08:00"},"deleted":false,"email":"","avatar":{"__typename":"UserAvatar","url":"https://community.smartbear.com/t5/s/nwkab66374/m_assets/avatars/default/avatar-6.svg?time=0"},"rank":{"__ref":"Rank:rank:4"},"entityType":"USER","eventPath":"community:nwkab66374/user:39107"},"ForumReplyMessage:message:137842":{"__typename":"ForumReplyMessage","uid":137842,"id":"message:137842","entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:111419/message:137842","revisionNum":1,"author":{"__ref":"User:user:73925"},"readOnly":false,"repliesCount":1,"depth":3,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"AcceptedSolutionMessage:message:111434"},"conversation":{"__ref":"Conversation:conversation:111419"},"subject":"Re: Default headers for all resources","moderationData":{"__ref":"ModerationData:moderation_data:137842"},"body":"Hi,
Im new to SOAP UI and i came across this post and used RequestFilter.filterRequest to be used as a global header. However, as mentioned in the post below \"add method will keep adding a new copy of the header on every run\" - as seen in the image attached every time i run the the TestCase 1 test suite, the \"Headers(4)\" tab increments by 2 as there are 2 headers. After i run the TestCase many times, the test steps dont run any more as the Header are keep on adding on top.
May i know how can i set the header as global but not get incremented everytinme i run the test case?
Thanks for helping,
Sudha
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"213","kudosSumWeight":0,"postTime":"2017-03-09T22:21:54.286-08:00","lastPublishTime":"2017-03-09T22:21:54.286-08:00","metrics":{"__typename":"MessageMetrics","views":7589},"visibilityScope":"PUBLIC","placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjUuNHwyLjF8b3wxfDE0OjAsMzk6MXwx","node":{"__ref":"ForumReplyMessage:message:186963"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[{"__typename":"AttachmentEdge","cursor":"MjUuNHwyLjF8b3w1fF9OVl98MQ","node":{"__ref":"Attachment:{\"id\":\"attachment:message137842AttachmentNumber1\",\"url\":\"https://community.smartbear.com/t5/s/nwkab66374/attachments/nwkab66374/readyapi-questions/38412/1/2017-03-10_1412.png\"}"}}],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:186963":{"__typename":"ModerationData","id":"moderation_data:186963","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:186963":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:39107"},"id":"message:186963","entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:111419/message:186963","revisionNum":1,"uid":186963,"depth":4,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"ForumReplyMessage:message:137842"},"conversation":{"__ref":"Conversation:conversation:111419"},"subject":"Re: Default headers for all resources","moderationData":{"__ref":"ModerationData:moderation_data:186963"},"body":"If you are still looking for a solution, there is one here.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"61","kudosSumWeight":0,"repliesCount":0,"postTime":"2019-07-03T09:56:36.604-07:00","lastPublishTime":"2019-07-03T09:56:36.604-07:00","metrics":{"__typename":"MessageMetrics","views":4922},"visibilityScope":"PUBLIC","placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"Rank:rank:16":{"__typename":"Rank","id":"rank:16","position":22,"name":"Senior Member","color":"00537C","icon":null,"rankStyle":"OUTLINE"},"User:user:84115":{"__typename":"User","id":"user:84115","uid":84115,"login":"Aksel","biography":null,"registrationData":{"__typename":"RegistrationData","status":null,"registrationTime":"2019-05-29T05:31:58.495-07:00"},"deleted":false,"email":"","avatar":{"__typename":"UserAvatar","url":"https://community.smartbear.com/t5/s/nwkab66374/m_assets/avatars/default/avatar-10.svg?time=0"},"rank":{"__ref":"Rank:rank:16"},"entityType":"USER","eventPath":"community:nwkab66374/user:84115"},"ModerationData:moderation_data:185324":{"__typename":"ModerationData","id":"moderation_data:185324","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:185324":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:84115"},"id":"message:185324","entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:111419/message:185324","revisionNum":1,"uid":185324,"depth":3,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"AcceptedSolutionMessage:message:111434"},"conversation":{"__ref":"Conversation:conversation:111419"},"subject":"Re: Default headers for all resources","moderationData":{"__ref":"ModerationData:moderation_data:185324"},"body":"Hi,
\n\n
I tried to update in the OnRequest script, the header of the request by using the code below, I have this error :
\n\n
import com.eviware.soapui.support.types.StringToStringMap
def headers = mockRequest.requestHeaders//.each {log.info it}
def header = new StringToStringMap(headers)
header.remove('SOAPAction')
log.info header
\nmockRequest.requestHeaders = header; // the error comes from this line.
\ncom.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: requestHeaders for class: com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.
Can you help me?
\n","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"213","kudosSumWeight":0,"repliesCount":0,"postTime":"2019-06-02T13:45:18.253-07:00","lastPublishTime":"2019-06-02T13:45:18.253-07:00","metrics":{"__typename":"MessageMetrics","views":5042},"visibilityScope":"PUBLIC","placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"Attachment:{\"id\":\"attachment:message137842AttachmentNumber1\",\"url\":\"https://community.smartbear.com/t5/s/nwkab66374/attachments/nwkab66374/readyapi-questions/38412/1/2017-03-10_1412.png\"}":{"__typename":"Attachment","id":"attachment:message137842AttachmentNumber1","filename":"2017-03-10_1412.png","filesize":275532,"contentType":"image/png","url":"https://community.smartbear.com/t5/s/nwkab66374/attachments/nwkab66374/readyapi-questions/38412/1/2017-03-10_1412.png"},"CachedAsset:text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1749759380271","value":{"errorTitle":"Failed!","previewFile":"Preview File","downloadFile":"Download File {name}","removeFile":"Remove File {name}","errorBadExtension":"This file does not have a valid extension. \"{extensions}\" are the valid extensions.","errorFileEmpty":"This file is empty or does not exist.","errorTooLarge":"The maximum file size is: {maxFileSize}.","errorTooMany":"Too many attachments. The maximum number of attachments per message is: {maxAttachmentCount, number, integer}.","errorDuplicate":"This file is already attached."},"localOverride":false}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"readyapi-questions","messageSubject":"default-headers-for-all-resources","messageId":"111419","replyId":"111426"},"buildId":"3XH0qYWYCnEYycuN5W4S8","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","surveysEnabled":true,"openTelemetry":{"clientEnabled":false,"configName":"smartbear","serviceVersion":"25.4.0","universe":"prod","collector":"http://localhost:4318","logLevel":"error","routeChangeAllowedTime":"5000","headers":"","enableDiagnostic":"false","maxAttributeValueLength":"4095"},"apolloDevToolsEnabled":false,"quiltLazyLoadThreshold":"3"},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["components_seo_QAPageSchema","components_community_Navbar_NavbarWidget","components_community_Breadcrumb_BreadcrumbWidget","components_messages_TopicWithThreadedReplyListWidget","components_messages_MessageListForNodeByRecentActivityWidget","components_messages_RelatedContentWidget","components_customComponent_CustomComponent","components_messages_MessageView_MessageViewStandard","components_messages_EscalatedMessageBanner","shared_client_components_common_List_UnstyledList","components_messages_MessageView","components_messages_MessageView_MessageViewInline","shared_client_components_common_Pager_PagerLoadMore","components_customComponent_CustomComponentContent_TemplateContent","shared_client_components_common_List_UnwrappedList","components_tags_TagView","components_tags_TagView_TagViewChip","components_attachments_AttachmentView","components_attachments_AttachmentView_AttachmentViewChip"],"appGip":true,"scriptLoader":[]}