none
The adapter failed to transmit message going to send port RRS feed

  • Question

  • Hi,

     am using Biztalk 2013 R2. i have created the api and right now its accepting the input in xml format and giving the result in xml format.

    i want to pass the input in json format so i have created the custom receive  pipeline for this.  i am getting the warning while running the application. 

    B

    Tuesday, May 31, 2016 11:49 AM

Answers

  • Hi

    The root node in pipeline should be LoginJsonRoot. Open the LoginJSONSchema.xsd file in visual studio. Check Target Namespace property value in the schema properties page. Set that value as Namespace in the jsonreceive pipeline. This will generate the correct input message for your map. Once you change the above you may have to change the input message type in the orch- but this comes later. Correct the pipeline values first. For clarity, the input msg to the orch should also be of loginjsonschema.xsd type.


    Thanks Arindam


    Thursday, June 2, 2016 8:57 AM
    Moderator
  • Hi Rajeshwari

    This looks like the Oracle response that got suspended while the JSON Encoder was processing it. Please see if what I wrote earlier helps-

    For some reason JSON Encoder is failing on ReceiveLocation to convert the XML response from Oracle to JSON while trying to send it back to client -Invalid cast from 'System.String' to 'System.Byte[]'.

    Can you share the suspended XML message contents?

    There are online utilities that can convert XML to JSON. Can you check if the coversion works here. You have to provide the XML response from Oracle here.

    It could be that the Oracle response has some complex/invalid elements. The way to get around that problem is to create another map - which will convert from the Oracle XML response to a simple XML schema that has the fields needed in your JSON output to client.

    The idea is similar to what you did with the first map - this new map will work in reverse direction - from Oracle response to an intermediate XML format that can be easily encoded to JSON. You can apply this map to the ReceivePort as Outbound Map.


    Thanks Arindam

    • Marked as answer by Rajeshwari ML Thursday, June 2, 2016 5:18 PM
    Thursday, June 2, 2016 12:06 PM
    Moderator
  • Hi Rajeshwari

    You can create the destination schema yourself, something like the one shown below(click Add on the Project -> New Item -> Schema. Then map the fields from Oracle schema to this new schema. Note: For the X_IMAGE blob field from Oracle, you need to check what needs to be transmitted. You can simply transmit that value as it is as a string, but it all depends on how the client interprets that value. Does it expect a base64 encoded string, etc. Anyways, that is not something BizTalk should deal with. Basically, map to the below schema - simple one-to-one link between respective source and destination fields. Apply the map in ReceivePort Outbound Maps.

    Note: You can change field names below as per your need as those will be the JSON property names that the client receives in the response.

    <removed image due to PII>


    Thanks Arindam







    Thursday, June 2, 2016 12:48 PM
    Moderator

All replies

  • Hi Rajeshwari

    The message is your JSON XML input message. You need a map that maps from this message to your Oracle operation message. When you ran the Consume Adapter Service wizard, the wizard should have created the Oracle schema for you. That Oracle schema message type should be the output of your map and be sent to the SendPort. You need to probably change the destination schema in your map to the correct Oracle operation schema, that was generated by the Wizard.

    Right now, the message JSON XML input message is going to the WCF-Oracle SendPort, and hence the error.


    Thanks Arindam





    Tuesday, May 31, 2016 11:54 AM
    Moderator
  • Where is your map being executed - in an orchestration or in a SendPort? It seems that your map is not being executed.

    Did you restart your Host Instance(s) after deployment?

    Note that the error states that you are not sending correct messagetype to the SendPort -

    Unexpected start node "[NodeName]" with namespace "" found.

    In the wizard generated schema, you will find a valid namespace - you can go the Oracle schema in Visual Studio -> Click on Schema node in top-left pane once the schema opens and check the Target Namespace property. Your output messagetype currently has a blank namespace. If the map executes properly, the output message will have the namespace you see in the Target Namespace property.


    Thanks Arindam





    Tuesday, May 31, 2016 12:11 PM
    Moderator
  • Hi Arindam,

    Destination schema is the one  which was created When i ran the Consume Adapter Service wizard.


    Hold On!

    Rajeshwari,

    Your Map shared above as screenshot is NOT getting executed.

    Error says: Unexpected start node "[NodeName]" with namespace "" found. 

    Whereas your Oracle schema has RootNode as "Login". You have to debug your code, if you have orchestration you can make use of Orchestration Debugger.

    If you have recently made any changes, then they are not reflecting properly. You have to restart the Host instances and remove any old DLL present in C:\Windows\assembly\temp.

    I also wonder if it is possible anything has changed in Oracle since you generated the schema. Maybe try generating the schema again. 


    Rachit Sikroria (Microsoft Azure MVP)


    Tuesday, May 31, 2016 12:34 PM
    Moderator
  • Hi ,

    The first option I would see is whether I can validate my map with the request message or not ?

    If you are using mapping translation at Orchestration or send port ,I would suggest to enable tracing and look for the exact request you are sending to the Oracle .

    There is mismatch to what you are sending to Oracle and what Oracle is expecting and the problem lies in your message construct either at send port or Orchestration .

    Thanks

    Abhishek   


    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

    Tuesday, May 31, 2016 12:49 PM
  • Hi Rajeshwari,

    As pointed out before by others the map is not getting executed properly hence there is an issue with the output of the map. Validate if the message coming to the source is a valid one or not then

    You can do the following,

    1) get a sample message for the source and try to test the map you have created.

    2) you can debug the  map step by step if need arisies. The debug option will let you know the exact point at which your transformation fails.

    This will provide you the idea of what the issue is.

    As the message says it encountered an unexpected start node at the message begining hence do check if the message fed to the map is correct or not.

    Regards,

    Mandar Dharmadhikari


    Mandar Dharmadhikari

    Wednesday, June 1, 2016 5:34 AM
  • Hi Rajeshwari,

    Can you pls check your JSON Decoder is working as expected. Check the RootNode and RootNodeNamespace specified in the settings.

    You should not be getting a message with blank TargetNamespace  if you have specified it in JSON decoder component. 

    Check the JSON schema as well.

    <Removed image due to PII>

    As I have specified before You have to debug your code, if you have orchestration you can make use of Orchestration Debugger.

    If you have recently made any changes, then they are not reflecting properly. You have to restart the Host instances and remove any old DLL present in C:\Windows\assembly\temp.


    Rachit Sikroria (Microsoft Azure MVP)




    Wednesday, June 1, 2016 8:19 AM
    Moderator
  • Hi Rajeshwari

    Where have you placed the map - in the SendPort or in an orchestration? If it is SendPort, can you launch the SendPort in Admin console, and check if your map is showing in Outbound Maps?

    If it is orchestration,  can you launch the orchestration debugger and check if your Transform shape is getting executed?

    Maybe you can do a fresh deploy of your application and restart the Host Instances - if not done already?


    Thanks Arindam



    Wednesday, June 1, 2016 8:21 AM
    Moderator
  • Hi Rajeshwari

    Probably your orch is paused on Breakpoint. You have click Debug on the menu and choose Continue for the flow to proceed-

    https://msdn.microsoft.com/en-us/library/aa953746(v=bts.20).aspx

    Place breakpoint after the transform shape that contains your map. In Visual Studio make sure your Transform Shape is pointing to correct map that you need.

    Also, make sure that this same map and orch is deployed in Admin Console. To be sure, you can deploy again and restart the Host Instances.


    Thanks Arindam



    Wednesday, June 1, 2016 10:29 AM
    Moderator
  • Hi Rajeshwari

    Can you check on this as well-

    Probably your orch is paused on Breakpoint. You have click Debug on the menu and choose Continue for the flow to proceed. Refer this on how to debug orchestrations-

    https://msdn.microsoft.com/en-us/library/aa953746(v=bts.20).aspx

    Place breakpoint after the transform shape that contains your map. In Visual Studio make sure your Transform Shape is pointing to correct map that you need.


    Thanks Arindam

    Wednesday, June 1, 2016 10:40 AM
    Moderator
  • Hi Rajeshwari

    Are you using the map within the orchestration? If yes, you would have used a transform shape in your orchestration. The icon for it looks like this-

    Click on this shape, and in Properties pane, you will find Map Name property. Make sure this map name is pointing to the map you are testing in Visual Studio.

    If you don't have this shape in orch, you need to add it. OR, call the map in your Oracle Send Port from Outbound maps.


    Thanks Arindam

    Wednesday, June 1, 2016 11:03 AM
    Moderator
  • Hi Rajeshwari

    The project was not compiled in Debug mode, but Release mode.

    Did you confirm that the map specified in Outbound Maps on SendPort is the correct one, and is the one you are testing in Visual Studio?


    Thanks Arindam

    • Marked as answer by Rajeshwari ML Wednesday, June 1, 2016 1:15 PM
    • Unmarked as answer by Rajeshwari ML Wednesday, June 1, 2016 1:15 PM
    Wednesday, June 1, 2016 12:16 PM
    Moderator
  • Ok then do this-

    Turn on message body tracking in your orchestration.

    Then, trigger a message to BizTalk and locate your completed orchestration instance and do 'View Tracked Message Events' on your completed orch instance in Admin console.

    There will be entries for Receive and Send.

    Open the Send event and launch the Message Details. Does this message have correct namespace? You can right-click and save this message to file from the above Send event and use this as Input file instance while testing map from Visual Studio. It could be that the message  that is going to the SendPort is not the same as the source schema type expected by the map - hence your map is not executing.


    Thanks Arindam









    Wednesday, June 1, 2016 1:52 PM
    Moderator
  • Hi Rajeshwari,

    Your JSON conversion is as expected.

    Two observation:

    1) IMO, Your JSON Receive Pipeline configuration should have RootNode as "LOGIN" (Note: upper case).

    2) Your map Input schema should be your JSON Schema with the root node "LOGIN" and your destination schema should be your Oracle Schema with the root node "LoginJsonRoot". Because you are sending the message in oracle format at the send port. 


    Rachit Sikroria (Microsoft Azure MVP)

    Thursday, June 2, 2016 8:11 AM
    Moderator
  • Hi

    The root node in pipeline should be LoginJsonRoot. Open the LoginJSONSchema.xsd file in visual studio. Check Target Namespace property value in the schema properties page. Set that value as Namespace in the jsonreceive pipeline. This will generate the correct input message for your map. Once you change the above you may have to change the input message type in the orch- but this comes later. Correct the pipeline values first. For clarity, the input msg to the orch should also be of loginjsonschema.xsd type.


    Thanks Arindam


    Thursday, June 2, 2016 8:57 AM
    Moderator
  • Yes correct. I got confused between the two schemas, my bad.

    Your pipeline RootNode should be LoginJsonRoot and check the JSON schema for the namespace you gave while creating the schema. 

    Provide the same RootNode and RootNodeNamespace in your receive pipeline component.

     

    Rachit Sikroria (Microsoft Azure MVP)

    Thursday, June 2, 2016 10:02 AM
    Moderator
  • Hi Rajeshwari

    So looks like you are getting the response back from Oracle now!

    For some reason JSON Encoder is failing on ReceiveLocation to convert the XML response from Oracle to JSON while trying to send it back to client - Invalid cast from 'System.String' to 'System.Byte[]'.

    Can you share the suspended XML message contents?

    There are online utilities that can convert XML to JSON. Can you check if the coversion works here. You have to provide the XML response from Oracle here.

    It could be that the Oracle response has some complex/invalid elements. The way to get around that problem is to create another map - which will convert from the Oracle XML response to a simple XML schema that has the fields needed in your JSON output to client.

    The idea is similar to what you did with the first map - this new map will work in reverse direction - from Oracle response to an intermediate XML format that can be easily encoded to JSON. You can apply this map to the ReceivePort as Outbound Map.


    Thanks Arindam













    Thursday, June 2, 2016 11:09 AM
    Moderator
  • Hi Rajeshwari

    This looks like the Oracle response that got suspended while the JSON Encoder was processing it. Please see if what I wrote earlier helps-

    For some reason JSON Encoder is failing on ReceiveLocation to convert the XML response from Oracle to JSON while trying to send it back to client -Invalid cast from 'System.String' to 'System.Byte[]'.

    Can you share the suspended XML message contents?

    There are online utilities that can convert XML to JSON. Can you check if the coversion works here. You have to provide the XML response from Oracle here.

    It could be that the Oracle response has some complex/invalid elements. The way to get around that problem is to create another map - which will convert from the Oracle XML response to a simple XML schema that has the fields needed in your JSON output to client.

    The idea is similar to what you did with the first map - this new map will work in reverse direction - from Oracle response to an intermediate XML format that can be easily encoded to JSON. You can apply this map to the ReceivePort as Outbound Map.


    Thanks Arindam

    • Marked as answer by Rajeshwari ML Thursday, June 2, 2016 5:18 PM
    Thursday, June 2, 2016 12:06 PM
    Moderator
  • Hi Rajeshwari

    You can create the destination schema yourself, something like the one shown below(click Add on the Project -> New Item -> Schema. Then map the fields from Oracle schema to this new schema. Note: For the X_IMAGE blob field from Oracle, you need to check what needs to be transmitted. You can simply transmit that value as it is as a string, but it all depends on how the client interprets that value. Does it expect a base64 encoded string, etc. Anyways, that is not something BizTalk should deal with. Basically, map to the below schema - simple one-to-one link between respective source and destination fields. Apply the map in ReceivePort Outbound Maps.

    Note: You can change field names below as per your need as those will be the JSON property names that the client receives in the response.

    <removed image due to PII>


    Thanks Arindam







    Thursday, June 2, 2016 12:48 PM
    Moderator
  • Hi Arindam,

    yes its working !! Thank you so much :-) 

    Thursday, June 2, 2016 5:18 PM