none
Add cookies on request message for dynamic send port RRS feed

  • Question

  • Hi,

    I have a requirement to connect a service by “Dynamic WCF-Custom” adapter. Before submitting request to service we also need to add a cookies variable.

    Please advise how can I add cookies on request message for dynamic send port.

    Thanks.

    Monday, February 27, 2017 11:25 AM

Answers

All replies

  • Can you be more detailed about the requirement. What is the requirement here ? What type of service is this. 

    Connecting to service by Dynamic WCF is not a requirement but solution to a problem.

    What is the service expecting, and when you say pass cookies in request message can you pls explain more requirement here.


    Pi_xel_xar

    Blog: My Blog

    BizTalkApplicationDeploymentTool: BizTalk Application Deployment Tool/

    Monday, February 27, 2017 11:56 AM
    Answerer
  • Hi,

    What is the service contract ?

    Have you tested the service through testing tool like postman or SOAP UI ? If you have valid request payload then you can easily construct similar request within your Orchestration workflow 


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply

    Monday, February 27, 2017 12:23 PM
  • This is SOAP web services and need to male request as like below.

    REQ_msg(WCF.OutboundCustomHeaders) =  "<headers><Cookies></Cookies></headers>";
    REQ_msg(WCF.BindingType) = "basicHttpBinding";
    REQ_msg(WCF.BindingConfiguration) = @"<binding name='basicHttpBinding' allowCookies='true'></binding>";
    REQ_msg(WCF.SecurityMode) = "Transport";
    REQ_msg(WCF.TransportClientCredentialType) = "None";
    REQ_msg(WCF.OpenTimeout) = "00:10:00";
    REQ_msg(WCF.CloseTimeout) = "00:10:00";
    REQ_msg(WCF.SendTimeout) = "00:10:00";
    REQ_msg(WCF.MaxReceivedMessageSize) = 65536000;

    Port_Dynamic(Microsoft.XLANGs.BaseTypes.Address) = "https://uri";
    Port_Dynamic(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-Custom";

    Monday, February 27, 2017 12:23 PM
  • try running a test using SOAP UI. You can try your options there. Once confirmed, the same payload can be constructed using BizTalk.

    Why are you using dynamic port , if ur service end point is known and fixed. You should use static port bindings.


    Pi_xel_xar

    Blog: My Blog

    BizTalkApplicationDeploymentTool: BizTalk Application Deployment Tool/

    Monday, February 27, 2017 12:28 PM
    Answerer
  • Hi ,

    You can write WCF-Custom behavior  to set the outbound HTTP header and use at your send port

    http://www.c-sharpcorner.com/UploadFile/f27cee/custom-cookies-in-wcf-with-C-Sharp/


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply

    Monday, February 27, 2017 12:33 PM
  • service is working by SOAP UI

    This service is  maintaining cookie session to authenticate the request. And this is working properly by static port when process is exciting one by one. But in case of parallel excision, its getting fail that's why i am using dynamic send port and trying to pass cookies on request message .

    Thanks

    Monday, February 27, 2017 12:41 PM
  • Can you clarify something real important?

    This is not a Cookie:

    REQ_msg(WCF.OutboundCustomHeaders) =  "<headers><Cookies></Cookies></headers>";

    Do you mean SOAP Headers or actual http cookies?  It makes a huge difference.

    Monday, February 27, 2017 1:31 PM
    Moderator
  • Hi Johns

    i am just trying to possible way to pass cookies on services request by WCF-Custom adapter. Is there another way to pass or create cookies for service request.

    Thanks

    Wednesday, March 1, 2017 2:38 PM
  • That's why I'm asking, are you sure it's an Http Cookie you have to use?

    If so, the property you need to use is WCF.HttpHeaders.

    There's nothing special about the Cookie header so you set it just like any other header.

    This thread from just a few days ago address how to do this: https://social.msdn.microsoft.com/Forums/en-US/5d8b2feb-6a50-4b77-8c29-9a6d4ee79319/wcf-webhttp-header-propertieswcfhttpheaders-setting-dynamically?forum=biztalkgeneral#9027b521-2354-4075-8981-0bd704208f2d

    Wednesday, March 1, 2017 3:41 PM
    Moderator