Error during call a Web Service in .NET3.5 and Infopath 2008 - InfoPath Dev
in

InfoPath Dev

Error during call a Web Service in .NET3.5 and Infopath 2008

Last post 03-22-2010 07:29 AM by uheber - DRS. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-19-2010 08:17 AM

    Error during call a Web Service in .NET3.5 and Infopath 2008

    Hello together,

    I have some problems to call a web service with .NET 3.5 and InfoPath 2008.

    The project (solution) implements a web service, which was automatically included as service reference from a WSDL. The service and therefore the file is provided by a JBoss instance, which is accessible through the browser. Visual Studio has created in this context, the app.config file.

    When I instantiate this service in VS2008 with

    ValidationServiceWSClient validationService = new ValidationServiceWSClient("ValidationServiceWS");
    

    an error occurs with message

    No standard endpoint was found for "ValidationServiceWS". Possible causes may be: no config file was found or no suitable endpoint found in the client element.
    

    The automatically generated app.conf contains following entry in client element:

    <client>
     <endpoint address="http://<server-address>/ValidationServiceWS"
      binding="basicHttpBinding" bindingConfiguration="ValidationServiceWSBinding"
      contract="ValidationService.ValidationServiceWS" name="ValidationServiceWSPort" />
    </client> 
    

    Has anybody an idea as the configuration to call the Web service should be properly? Does the parameters for ValidationServiceWSClient(string endPointAddress) are different? Are there examples anywhere?

    Thanks for Your help.

    Best regards,
    Uwe

  • 03-22-2010 07:29 AM In reply to

    Re: Error during call a Web Service in .NET3.5 and Infopath 2008

    Hi folks,

    I figured it out, why the Web Service using InfoPath 2008 could not be established. The reason is simple if you know him. Here me solution:

    Add the external Web Service as Web Reference (Main » Project » Web Reference). Follow the wizard, insert the URL for WSDL and give the service an appropriate name.

    Include this namespace in your solution and now you can access all partial classes, functions and args within this service.

    Here the code snippet from InfoPath template, which interacts with the service:

    public void btnSubmit_Clicked(object sender, ClickedEventArgs e)

    {

    ValidationServiceWSService proxy = new ValidationServiceWSService();

    validate2 v = new validate2();

    v.arg0 = "temp";

    string[] str = proxy.validate2(v);

    MessageBox.Show(str[0]);

    }

    Currently, I dont know what is the difference between the import of a Service and a Web Reference in Infopath and why the Web Service works in the console application as a Service reference?!

    But maybe someone has an answer?!

    Nice day,

    Uwe

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.