Service Virtualization

  • 1.  How to handle “WorkContext” tag in SOAP header?

    Posted Apr 10, 2019 07:34 AM

    Hello Team,

     

    I am trying to create a soap virtual service using RR pairs but unable to parse soap header in request.

    Header information is given below…

     

    <S:Header>

             <WorkContext xmlns="http://oracle.com/weblogic/soap/workarea/">

                     appRRr888aPudcEpddwEwe2aw6wqwe00Xqwq8dgjskm1J3OO4wwd

             </WorkContext>

    </S:Header>

     

    WorkContext tag value is dynamic, so have to use wild card to accept any values in request and same entries should present in response.

     

    In request side DPH selecting “Web Services (SOAP Headers) Data Protocol” & “Web Services SOAP data protocol” and processing the request but not getting any operation name and request arguments in transaction.

     

    How can we handle “WorkContext” tag in SOAP header?

    Your inputs would be very much appreciated.

     

    Thanks in advance.



  • 2.  Re: How to handle “WorkContext” tag in SOAP header?

    Broadcom Employee
    Posted Apr 10, 2019 07:59 AM

    If I understand the problem then I would say there is no need to process the "WorkContext" element with a SOAP Header request-DPH.

    Main reason: this is not used in the matching process to select the correct response, you just want to return the same content in the response header. So, no need to run a DPH on it to try to turn this into a request argument

    Second reason, you don't know what is going to be the name of the element tag, now it is "WorkContext" but it might be something else, so even if processed as an argument, how would you know which argument it is.

     

    I would try the following:

    • Add an XML XPath filter to your Listen Step, position it as the first filter (even before the SOAP DPH), construct an XPath that selects the needed information out of the header (independent of the actual name tag), and store that information in a property (so the property would contain an actual xml snippet with element tags included, eg. headerSnippet=

      <WorkContext xmlns="http://oracle.com/weblogic/soap/workarea/">appRRr888aPudcEpddwEwe2aw6wqwe00Xqwq8dgjskm1J3OO4wwd</WorkContext>

    •  In your response header, you put that property {{headerSnippet}}

     

    • Second filter would be your SOAP DPH, that should give you your operation, arguments, etc...

     

    Cheers,

    Danny



  • 3.  Re: How to handle “WorkContext” tag in SOAP header?

    Posted Apr 11, 2019 08:17 AM

    Thanks for your reply Danny..

     

    SOAP Header with "WorkContext" element  is used for matching too also.

    “Web Services (SOAP Headers) Data Protocol” DPH is not working as expected.

    Is there any other approach to add these header in matching process?

     

    Thanks in advance.



  • 4.  Re: How to handle “WorkContext” tag in SOAP header?
    Best Answer

    Broadcom Employee
    Posted Apr 11, 2019 09:14 AM

    Is this standards compliant SOAP-header?

    If so,

    I have seen the SOAP-header DPH in action and it works, so it might be worthwile to open a case with support and figure out why it doesn't work in your case

     

    If not,

    Add a "Generic XML Payload Prser Data Protocol" before your SOAP DPH in your Listen Step and search through your complete SOAP-Envelope to select the information you want and create an argument from it.

     

    Cheers,

    Danny