WS in Primary datasource recover error message - InfoPath Dev
in

InfoPath Dev

WS in Primary datasource recover error message

Last post 11-20-2006 09:58 AM by Greg Collins. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 10-27-2006 02:46 AM

    WS in Primary datasource recover error message

    Hi,

    I want to know if it's possible to have the xml returned by the webservice when I do :

    thisXDocument.Query();


    Because if that send me another XML that is waiting by Infopath that make me an error but I cant find this "invalid" xml.

    It's because this xml contain the error message that I want to recup for make a better message alert.

    I Know that I can catch the error with Try...catch but I cant see the xml return by my query ?

    Do you know how can I do?

    Thanks

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 10-27-2006 11:27 AM In reply to

    Re: WS in Primary datasource recover error message

    Yes, you can do this, but it requires the WS to return the XML.
    Patrick Halstead
    Project Manager at Qdabra
  • 10-31-2006 01:56 AM In reply to

    Re: WS in Primary datasource recover error message

    Hi Patrick,

    My problem is that If I return another xml that schema want I cant see it in my code. Infopath send his default error message and I dont know which methode or propertie I need to use for see this "error" xml:

    try
    {

    thisXDocument.Query();
    }
    catch (System.Runtime.InteropServices.COMException ex)
    {
    thisXDocument.UI.Alert("no data find!\n");// + ex.ToString());
    }


    in ex I can't find my "error" xml. Do you know how can I do?

    Thanks

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 11-14-2006 07:11 AM In reply to

    Re: WS in Primary datasource recover error message

    Anybody has an Idea ?

    The error message is :
    quote:
    {System.Runtime.InteropServices.COMException (0x80043032): The query method on the Document object failed.
    #65279;#65279;
    InfoPath cannot run the specified query.
    The element 'Succ' is used but not declared in the DTD/Schema.

    à Microsoft.Office.Interop.InfoPath.SemiTrust._XDocument.Query()
    à Microsoft.Office.Interop.InfoPath.SemiTrust.XDocumentWrapper.Query()
    à HRGSearch.HRGSearch.Query_OnClick(DocActionEvent e) dans C:\Dev\Visual Studio Projects\HRGSearch\HRGSearch\FormCode.cs:ligne 591}


    I want to know if he send me back: <Succ nr="3"/> or <Error Nr="323"/>? the correct result is <CaseList>.....</CaseList>.

    Thanks for your help

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 11-14-2006 10:38 AM In reply to

    Re: WS in Primary datasource recover error message

    Hi Thierry,
    Sorry for the delay. We have done this before. I've asked two of our developers to respond and you should have a reply soon. Thanks for your patience!
    Patrick Halstead
    Project Manager at Qdabra
  • 11-15-2006 09:15 AM In reply to

    Re: WS in Primary datasource recover error message

    It sounds like you have a Web service that returns a certain schema, but in the case of an error it returns a different schema. This is not possible.

    Two solutions:

    1. Create a combined schema for success and failure. That way no matter which XML you return, the schema will match.

    2. Use a try/catch block and if there is an error, query a different Web service to find out what the error was.


    Solution 1 is probably the better choice.
  • 11-19-2006 11:58 PM In reply to

    Re: WS in Primary datasource recover error message

    Hi Greg,

    Thanks for your answer!

    I have choose the first solution and that work great!

    ++

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 11-20-2006 09:58 AM In reply to

    Re: WS in Primary datasource recover error message

    Great! Glad to hear you got it working!
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.