none
Root element is missing. RRS feed

  • Question

  • Tried following the walk through on MSDN for Publishing WCF Services with the WCF-NetMsmq Adapter (http://msdn.microsoft.com/en-us/library/bb259950(BTS.10).aspx) . Tried using the sample application on the website and tried integratinga that with my existing BizTalk solution as well. It let me do the bindings properly but when I try to browse teh WCF application through IIS7 as mentioned in the steps, I am getting following error :

    Root element is missing.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Xml.XmlException: Root element is missing.

    Any help willl be appreciated. Thanks



    • Edited by WizBiz Tuesday, August 4, 2009 7:42 PM typo
    Tuesday, August 4, 2009 7:39 PM

Answers

  • I have gotten this error before in the same situation as you. Ironically, it usually occurs when the app pool identity for the published web service does not have access to the BizTalk databases. You usually need to modfy the app pool identity to be the one for the BizTalk isolated host account or the BizTalk host account or one that matches one of these in regards to group membership and permissions.

    I think the error could be better named - it is misleading what the actual problem is.

    Thanks,
    If this answers your question, please use the "Answer" button to say so | Ben Cline
    • Marked as answer by WizBiz Wednesday, August 5, 2009 12:57 PM
    Wednesday, August 5, 2009 12:53 AM
    Moderator

All replies

  • I have gotten this error before in the same situation as you. Ironically, it usually occurs when the app pool identity for the published web service does not have access to the BizTalk databases. You usually need to modfy the app pool identity to be the one for the BizTalk isolated host account or the BizTalk host account or one that matches one of these in regards to group membership and permissions.

    I think the error could be better named - it is misleading what the actual problem is.

    Thanks,
    If this answers your question, please use the "Answer" button to say so | Ben Cline
    • Marked as answer by WizBiz Wednesday, August 5, 2009 12:57 PM
    Wednesday, August 5, 2009 12:53 AM
    Moderator
  • Thanks Ben, that certainly did the trick as I don't see the same error message now, I am getting a new error and still can't  browse the WCF

    An error occurred while opening the queue:The queue does not exist or you do not have sufficient permissions to perform the operation. (-1072824317, 0xc00e0003). The  message cannot be sent or received from the queue. Ensure that MSMQ is installed and running. Also ensure that the queue is available to open with the required access mode and authorization.

    The queue does exist and I am running it as a Administrator so have all the required permissions as well. Any ideas, why I am getting this message

    Thanks again.....
    Wednesday, August 5, 2009 12:57 PM
  • So I guess you are using the netMSMQ binding. The path in the BizTalk port uses different conventions than the traditional queue path. Please check the path to make sure it conforms to what BizTalk is expecting.

    Are using a private queue or a public queue? Also, is your queue on a different box than BizTalk?

    Did you grant permissions on the queue to the host user?

    Thanks,
    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Wednesday, August 5, 2009 3:14 PM
    Moderator
  • I am using WCF-netmsmq as a transport type in BizTalk

    I am using a private Transactional queue. Queue is on the same box with all the permission.
    Publishing a WCF using BizTalk WCF Service Publishing Wizard

     Bindings in web.config after completing the publishing wizard looks like this :

     <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehaviorConfiguration">
              <serviceDebug httpHelpPageEnabled="true" httpsHelpPageEnabled="false" includeExceptionDetailInFaults="false" />
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <!-- Note: the service name must match the configuration name for the service implementation. -->
          <service name="Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance" behaviorConfiguration="ServiceBehaviorConfiguration">
            <endpoint name="HttpMexEndpoint" address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" />
            <!--<endpoint name="HttpsMexEndpoint" address="mex" binding="mexHttpsBinding" bindingConfiguration="" contract="IMetadataExchange" />-->
          </service>
        </services>
      </system.serviceModel>

    Still getting the same error as described in previous post.
    Thanks
    Wednesday, August 5, 2009 3:33 PM
  • Did you specify the path to the queue during the wizard? I would check in the port settings to see if it is there. It would have a path like net.msmq://localhost/private/queueName. I did not see the queue endpoint listed in the config file.

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    • Proposed as answer by Aishraj Sharma Thursday, March 10, 2011 5:20 AM
    • Unproposed as answer by Aishraj Sharma Thursday, March 10, 2011 5:21 AM
    Wednesday, August 5, 2009 4:47 PM
    Moderator
  • Yes I did... below is th sanpshot of BizTalk Settings in the web.config....

      <bizTalkSettings>
        <!--
          mexServiceHostFactory debug:
          Set to "true" to launch debugger when MexServiceHostFactory.CreateServiceHost(...) is called by IIS.
          Used to debug from initial point of activation by IIS.
          Default value is "false" for normal operation.
        -->
        <mexServiceHostFactory debug="true">
          <receiveLocationMappings>
            <!--add markupFileName="*.svc" receiveLocationName="?" publicBaseAddress="protocol://host[:port]" /-->
            <add markupFileName="Microsoft_Samples_BizTalk_WCF_NetMsmqPublishing_BizTalkApp_OrderProcess_PurchaseOrderRequestPort.svc" receiveLocationName="WCFNetMsmqAdapterPublishing.ReceivePurchaseOrder.NetMsmq" publicBaseAddress="http://localhost/" />
          </receiveLocationMappings>
        </mexServiceHostFactory>
        <!--
          webServiceHostFactory debug:
          Set to "true" to launch debugger when WebServiceHostFactory.CreateServiceHost(...) is called by IIS.
          Used to debug from initial point of activation by IIS.
          Default value is "false" for normal operation.
        -->
        <webServiceHostFactory debug="false" />
        <!--
          isolatedReceiver disable:
          Set to "true" to skip IBTTransportProxy.RegisterIsolatedReceiver(...) and IBTTransportProxy.TerminateIsolatedReceiver(...) calls.
          Used for testing metadata exchange without having to setup receive location.
          Default value is "false" for normal operation.
        -->
        <isolatedReceiver disable="false" />
        <!--
          btsWsdlExporter disable:
          Set to "true" to skip adding BtsWsdlExporter behavior extension to service endpoint.
          Used for testing or comparing strongly-typed WSDL customization versus weakly-typed WSDL of generic WCF service.
          Default value is "false" for normal operation.
        -->
        <btsWsdlExporter disable="false" />
      </bizTalkSettings>

    Thanks..
    Wednesday, August 5, 2009 5:25 PM
  • I am able to run the walk through sample on MSDN,  I am trying to implement the same on my BizTalk solution. I have an ongoing issue with my custom pipeline but I will open a new thread for that as the issue is not related.
    Thanks Ben for all your help !!
    • Edited by WizBiz Thursday, August 6, 2009 1:06 PM typo
    Thursday, August 6, 2009 1:06 PM
  • Ben, I was reading your thread for converting through ActiveXMessageformatter http://msinnovations.spaces.live.com/blog/cns!62E68922E47BC425!198.entry, but that didn't;t help much in my scenario. Can you shed some light on that.
    I have a X12 format file I am able to send through client application.
     
    MessageQueue mq = new MessageQueue(@".\private$\testqueue");
                  mq.Send(File.ReadAllText(@"D:\hcfa20090723-0.x12"));
                    mq.Formatter = new  ActiveXMessageFormatter();

    If I check journal message in MSMQ after using the ActiveXMessageformatter I do have everything in string format with no extra headers in it, but due to some reason my pipeline component have EDI disassembler at the disassembler stage doesn't like it
     biz talk error log states that no disassemble stage component can recognize the data?

    Thanks
    • Edited by WizBiz Thursday, August 6, 2009 9:21 PM information missing
    Thursday, August 6, 2009 8:59 PM
  • You should try to validate instance for the X12 file in VS to see if it can parse the EDI content. You will need to choose the validate type as Native.

    Thanks,
    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Friday, August 7, 2009 2:53 AM
    Moderator
  • I think what you meant is to add EDI batch schema. I have added EDIfact batch schema and X12 Batch schema and I am changing the properties as you suggested. Still not sure how this is going to help in the given scenario ? Thanks
    Friday, August 7, 2009 1:12 PM
  • If I add X12_batch schema change the instance input to "Native" and added the X12 document I got "Instance input FileName" and when I run validate instance schema. It throws an error"Failed to create instance for schema X12_BatchSchema.xsd. How come that text file works just fine if it is not coming from MSMQ ?
    • Edited by WizBiz Friday, August 7, 2009 1:31 PM Typo
    Friday, August 7, 2009 1:31 PM
  • No, I was not thinking about a batch schema. In VS you can right-click on a BizTalk schema and then go to validate instance and it can validate a file for you. You were getting parse errors so this is a way to ensure that the X12 instance matches the schema.

    You can also open the MSMQ message up and see the first part of the payload to see if there are extra characters.

    Thanks,
    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Friday, August 7, 2009 10:13 PM
    Moderator
  • Same X12 can be easily disassemble if I am picking it from FILE location not MSMQ location. I am using ActiveX Formatter to decode the data in MSMQ to remove extra character. I tried using pass through pipeline and the result I am getting is exactly the same as original X12 file looks alike with no special characters. But if I introduce EDI disassemble piece it just start giving me error that No Disassemble Stage Component Can Recognize the Data. ? I am stuck at this point as I have tried all the possible ways I can think of to defeat this error.

    I am still not sure how just picking the message from MSMQ location not FILE could cause this as if I check the body of my MSMQ it looks exactly similar to what the original X12 should look alike before it goes to EDI dissembler..:(

     

    • Edited by WizBiz Monday, August 10, 2009 1:46 PM typo
    Monday, August 10, 2009 1:41 PM
  • There are a couple of other options that could occur. For example, the encoding can change like from UTF-8 to UTF-16 and you have extra characters that make unreadable. If the MSMQ message (first characters) look good then maybe something at the end of the file is causing a problem. Could you share the X12 message from MSMQ here - I may be able to identify the problem by looking at it.

    Did you do a file comparison of the two different messages (one from file and the other from MSMQ)?

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Tuesday, August 11, 2009 2:05 AM
    Moderator
  • I have tried both UTF-8 and UTF-16 as well and I am changing the encoding type before I convert the message through ActiveXFormat and send It to the queue and I have compared both files in a TextPad they are exactly similar including the first character..Do you want me to paste the X12 in the thread? I would prefer if I can send you the X12 in your email if that is okay with you..
    Tuesday, August 11, 2009 3:41 AM
  • Any ideas in regards to my last post ?
    Wednesday, August 12, 2009 1:17 PM
  • The line breaks are not in the original right? Just in what you copied. Right?

    Also, the ISA and GS fields were modified prior to pasting, is this correct? If not, I am guessing that the EDI disassembler cannot determine which party to use for the schema and then uses the default schemas rather than the custom ones.

    It is possible to lose the original ISA and GS values along the way so this could be the problem.

    As for the encoding stuff, I meant that the encoding could change along the way and you did not know. You should not change anything about the pipeline encoding if you do not have to. If you open a file in WordPad and it does not look like it does in NotePad, then you probably have an encoding problem. In WordPad you can check for squares after every character which means it is in double-bytes and you would need to build a custom pipeline component to remove these. You could check on this.

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Wednesday, August 12, 2009 3:02 PM
    Moderator
  • Yes, there are no line breaks in the orignal X12. But I am not sure what is missing here or I am not understanding the process straight.
    I tried copying the body of MSMQ message and pasted that in a notepad and tried sending that notepad through the FILE transport and that gave me XML's in send location with no error at all, unless it is not just the body of a message which is going forward I don't think it should break like this. MSMQ is only suppose to send the message what it see in the body of it, will this be a correct statement to say ?
    I am kind of getting out of options here as it is not making much sense to me how the exact same file can break just with two different transport type ? even tried writin the file from MSQ in the flat file and having file transport pick it up that work just fine... is that a MS bug or something ?
    Thursday, August 13, 2009 1:02 PM
  • Thanks Ben for all your help, I am moving on to another issues from here on as this is just going in loop. Just as a workaround what I did is using MSMQ to receive file from the client and then trigger my console app to write the message in the text file and have biztalk pick it up using "FILE" transport and that work just fine. So if you get any lead on this or any poossible solution I will aprreicte it..

    Thanks again
    Thursday, August 13, 2009 6:29 PM
  • I get the same error message.
    I use Windows 2003 R2 with BizTalk 2009.

    My Receivelocation is also MSMQ.
    The first time (after removing dll's and redeployed the solution) when I create a WCF endpoint (mexonly) I can look into the WSDL.

    When I want update the underlying schema, redeploy the solution and recreate the WCF endpoint.
    Then I get the message Root element is missing.

    I'm quite sure it's not security. The App-pool is running under the same serviceaccount as BizTalk itself.

    Friday, October 30, 2009 5:50 PM
  • I have gotten this error before in the same situation as you. Ironically, it usually occurs when the app pool identity for the published web service does not have access to the BizTalk databases. You usually need to modfy the app pool identity to be the one for the BizTalk isolated host account or the BizTalk host account or one that matches one of these in regards to group membership and permissions.

    I think the error could be better named - it is misleading what the actual problem is.

    Thanks,
    If this answers your question, please use the "Answer" button to say so | Ben Cline

    Hi To All,

     i am facing problem regarding netmsmqbinding , when i am reading the messager from my PUBLIC TRANSACTIONAL QUEUE that  ROOT NODE IS MISSING.

     

    Actually i am sending here an xml to my msmq, xml is as below :

    <?xml version="1.0" encoding="ISO-8859-1" ?><note><to>Arvind Sharma</to><from>Always</from><heading>Reminder</heading></note>

    my msmq message body as below :

    ----------------------------------------------------start

    00 01 00 01 04 02 30 6E ......0n
    65 74 2E 6D 73 6D 71 3A et.msmq:
    2F 2F 6C 6F 63 61 6C 68 //localh
    6F 73 74 2F 4D 73 6D 71 ost/Msmq
    53 65 72 76 69 63 65 2F Service/
    4D 73 6D 71 53 65 72 76 MsmqServ
    69 63 65 2E 73 76 63 03 ice.svc.
    07 56 02 0B 01 73 04 0B .V...s..
    01 61 06 56 08 44 0A 1E .a.V.D..
    00 82 99 50 68 74 74 70 .‚™Phttp
    3A 2F 2F 73 63 68 65 6D ://schem
    61 73 2E 63 6C 61 73 73 as.class
    2D 61 2E 6E 6C 2F 6D 73 -a.nl/ms
    6D 71 2F 65 78 61 6D 70 mq/examp
    6C 65 30 31 2F 32 30 30 le01/200
    38 2F 30 32 2F 49 53 65 8/02/ISe
    6E 64 4D 61 69 6C 2F 53 ndMail/S
    75 62 6D 69 74 43 6F 6D ubmitCom
    70 6C 65 74 65 4D 65 73 pleteMes
    73 61 67 65 44 0C 1E 00 sageD...
    82 99 30 6E 65 74 2E 6D ‚™0net.m
    73 6D 71 3A 2F 2F 6C 6F smq://lo
    63 61 6C 68 6F 73 74 2F calhost/
    4D 73 6D 71 53 65 72 76 MsmqServ
    69 63 65 2F 4D 73 6D 71 ice/Msmq
    53 65 72 76 69 63 65 2E Service.
    73 76 63 01 56 0E 40 15 svc.V.@.
    53 75 62 6D 69 74 43 6F SubmitCo
    6D 70 6C 65 74 65 4D 65 mpleteMe
    73 73 61 67 65 08 31 68 ssage.1h
    74 74 70 3A 2F 2F 73 63 ttp://sc
    68 65 6D 61 73 2E 63 6C hemas.cl
    61 73 73 2D 61 2E 6E 6C ass-a.nl
    2F 6D 73 6D 71 2F 65 78 /msmq/ex
    61 6D 70 6C 65 30 31 2F ample01/
    32 30 30 38 2F 30 32 2F 2008/02/
    40 07 6D 65 73 73 61 67 @.messag
    65 98 74 3C 3F 78 6D 6C e˜t<?xml
    20 76 65 72 73 69 6F 6E  version
    3D 22 31 2E 30 22 20 65 ="1.0" e
    6E 63 6F 64 69 6E 67 3D ncoding=
    22 49 53 4F 2D 38 38 35 "ISO-885
    39 2D 31 22 20 3F 3E 3C 9-1" ?><
    6E 6F 74 65 3E 3C 74 6F note><to
    3E 41 72 76 69 6E 64 3C >Arvind<
    2F 74 6F 3E 3C 66 72 6F /to><fro
    6D 3E 4A 61 6E 69 3C 2F m>Jani</
    66 72 6F 6D 3E 3C 68 65 from><he
    61 64 69 6E 67 3E 52 65 ading>Re
    6D 69 6E 64 65 72 3C 2F minder</
    68 65 61 64 69 6E 67 3E heading>
    3C 2F 6E 6F 74 65 3E 01 </note>.
    01 01 01                ...

    --------------------------------------------------------------End

    Thanks in Advance

    Aishraj sharma

     

     

     

     

     

    Thursday, March 10, 2011 5:20 AM