locked
Razor C# Web Pages web service for the Quickbooks Web Connector SOAP - need guidance on this implementation RRS feed

  • Question

  • User379720387 posted

    No clue what I need to do.

    Quickbooks says:

    "

    The .NET framework SDK includes the wsdl.exe tool for generating web service skeleton code or web service client proxy classes from a pre-existing WSDL, by default it will create a client proxy class, but with the /server switch will cause it to instead generate a skeleton class for use in a web service, we therefore start by generating the service skeleton, we’ll use C# for our example, though the same principles apply for VB.NET, all that needs to change is the /language flag to wsdl.exe.

    Wsdl.exe /server /language:cs http://developer.intuit.com/uploadedFiles/Support/QBWebConnectorSvc.wsdl

    This will generate a file called QBWebConnectorSvc.cs containing an abstract class with methods for each of the SOAP WebMethods that the web connector expects:

    // This source code was auto-generated by wsdl, Version=1.1.4322.2032.
    using System.Diagnostics;
    using System.Xml.Serialization;
    using System;
    using System.Web.Services.Protocols;
    using System.ComponentModel;
    using System.Web.Services;

    /// <remarks/>
    [WebServiceBindingAttribute(Name="QBWebConnectorSvcSoap", 
    Namespace="http://developer.intuit.com/")]
    public abstract class QBWebConnectorSvc : WebService {

       /// <remarks/>
       [WebMethodAttribute()]
       [SoapDocumentMethodAttribute("http://developer.intuit.com/authenticate", 
                                RequestNamespace="http://developer.intuit.com/", 
                                ResponseNamespace="http://developer.intuit.com/", 

    "

    Got this class file sitting in App_Code called QbWebConnectorSvc.cs as per the above instructions.

    NEXT Quickbooks says:

    his file can then be added (Add>Add Existing Item) to a Web project in Visual Studio and then we can add a new web service (Add>Add Web Service) to inherit from this class and implement each of the interfaces defined by the parent class. Intellisense makes this quite easy, as shown in Figure 3-1.

    <div class="Fg_002eFigure">Figure 3-1 Implementing the Web Service</div>

    The highlighted areas of Figure 3-1 represent changes made to the standard template created by Visual Studio, in particular note that we must add the WebService and WebServiceBinding attributes to the class (they are not inherited from the abstract base class and the Namespace is particularly important) and, similarly, we must add [WebMethod] attributes to each of the web methods we define (again, they are unfortunately not inherited from the base class. For absolute completeness we could also copy over the SoapDocumentMethod attributes from the base class, but it seems as though those are either properly inherited or the defaults are correct in .NET.

    Looks to me this is the result of WSDL as it gives the available services.

    What is my next step? Not understanding the paragraph above.

    EDIT: I found example to create a web service app, but what I am after is to have this web service part of my Razor C# Web Pages site.

    Wednesday, August 8, 2018 5:45 PM

Answers

  • User379720387 posted

    Figured it out.

    The Visual Studio 2017 dialog is confusing for someone who has no clue what functional elements make up a Web Service. 

    Turns out there is a checkbox in the dialog that says something along the lines of "put code in a separate file".

    Then two files are created .asmx and a class file. The class file opens up, but the asmx file just appears in Solution Explorer without further notice.

    @Nan Yu...

    My app is actually going to be the Web Service and the Quickbooks Web Connector will be consuming things.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 9, 2018 2:02 PM
  • User379720387 posted

    Turns out Quickbooks' instructions are nowhere near useful.

    The magic of the web service comes from adding a reference to the web service.

    Nicely explained here

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 17, 2018 7:16 PM

All replies

  • User1724605321 posted

    Hi wavemaster ,

    EDIT: I found example to create a web service app, but what I am after is to have this web service part of my Razor C# Web Pages site.

    Your image is not correct showing . BTW, you can refer to below article for how to consume SOAP Web Services In Razor Web Pages :

    https://www.mikesdotnetting.com/article/209/consuming-feeds-and-web-services-in-razor-web-pages 

    Best Regrds,

    Nan Yu

    Thursday, August 9, 2018 5:39 AM
  • User379720387 posted

    Figured it out.

    The Visual Studio 2017 dialog is confusing for someone who has no clue what functional elements make up a Web Service. 

    Turns out there is a checkbox in the dialog that says something along the lines of "put code in a separate file".

    Then two files are created .asmx and a class file. The class file opens up, but the asmx file just appears in Solution Explorer without further notice.

    @Nan Yu...

    My app is actually going to be the Web Service and the Quickbooks Web Connector will be consuming things.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 9, 2018 2:02 PM
  • User379720387 posted

    Turns out Quickbooks' instructions are nowhere near useful.

    The magic of the web service comes from adding a reference to the web service.

    Nicely explained here

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 17, 2018 7:16 PM