none
WebHTTP POST Method issue from one BizTalk App to Other RRS feed

  • Question

  • I am doing a POST from my BTSApp1 trying to send JSON message (request Response Send port). My Orchestration Logical Operation is Operation_1. I am using JSON encoder pipeline with RemoveOuterEvelope to True.
    Under Messages Tab, set Content-Type:application/json and Outboubd Message as POST

    <BtsHttpUrlMapping>
    <Operation Name='Operation_1' Method='POST' />
    </BtsHttpUrlMapping>


    I have another BTSApp2  which expects JSON from BTSAPP1. I am using Request Response on Receive Location with with JSON encoder pipeline.
    This is HTTP Method and URL Mapping

    <BtsHttpUrlMapping>
        <Operation Name='GetOrder' Method='POST'  Url= '/GetOrder' />    
    </BtsHttpUrlMapping>

    The frustating part is when I am taking the JSON from BTSApp1 and using POSTMAN doing a post, I am receiving 200 and response back.
    But if I am trying to do from BizTalk BTSApp1, I am receiving 500 Internal error. Not sure what I am doing wrong.

    Errors :
    1)Error Description: System.Net.WebException: (500) Internal Server Error
    2) Source: "JSON decoder" Receive Port: "WcfReceivePort_NETRET/Service1" URI: "/NETRET/Service1.svc" Reason: Object reference not set to an instance of an object.


    Please advise


    RH

    Tuesday, August 20, 2019 7:24 PM

All replies

  • Anything in the Windows Event logs?

    Any suspended messages?

    What does the outgoing message from BTSApp1 look like?  

    Are BTSApp1 and BTSApp2 both running on the same BizTalk server?  In which case, which do both BTSApp1 & BTSApp2 use the same schema?

    Wednesday, August 21, 2019 1:46 AM
  • Hi Colin, thanks for the reply. I was able to figure out, it was IIS issue.

    Question : currently when I publish my schema as a WCF service exposing to outer world as API by creating Request Response port...it creates something like http://<servername>/BTSWCFService/Method.svc/GetOrder

    It works fine on my Dev environment. 

    But when I move to QA and PROD, that has 2 BizTalk servers (say Q1 and Q2)

    How do I need to create my REST API here ? Please advise 


    RH

    Wednesday, August 21, 2019 2:32 AM
  • To deploy REST API in UAT/PROD with more than one server you will need a load balancer.

    Deploy the WCF service on both the servers.

    For example, in UAT you have 2 servers (server1 and server2) then your infrastructure team needs to provision a load balancer (btsserveruat) on top of these two servers and redirect the traffic to one of the two servers on the specific port (port 80 or 443, etc.)

    Once load balancer is provisioned and configured as per the desired port you can use the same for the REST API. Your REST API will look something like this:

    http://btsserveruat/BTSWCFService/Method.svc/GetOrder

    Then the requests coming to the load balancer will resolve to either one of the server.

    Thanks,

    Raghav

    Sunday, August 25, 2019 5:22 AM