[Mono-aspnet-list] creating new web service from wsdl

Alberto León leontiscar at gmail.com
Thu Sep 2 10:50:22 EDT 2010


You need inherit MyServices in other class.
An abtract class can't be instantiated, created, and can't store data.
Allways need to be inherited.



2010/9/2 Devin Venable <venable.devin at gmail.com>

> Background:  Linux developer new to .NET.  In the past I've successfully
> deployed simple web services by creating asmx files and running them under
> Apache via XSP.
> Need: Create web service implementation from WSDL defined by 3rd party
>
> This is what I've tried so far...
>
> 1. Used wsdl2 to generate server stubs.
>
> wsdl2 -server MyServices.wsdl
> Web Services Description Language Utility
> Mono Framework v2.0.50727.1433
>
> There where some warnings while generating the code:
>
>   MyServices.wsdl
>     - This web reference does not conform to WS-I Basic Profile v1.1
>         R2718: A wsdl:binding in a DESCRIPTION MUST have the same set of
>         wsdl:operations as the wsdl:portType to which it refers.
>           * Binding 'BasicHttpBinding_IMyServices', in Service Description
>             'http://tempuri.org/'
>
>
> (should this warning make me nervous?)
>
> 2. Renamed resulting cs file to MyServices.asmx
> 3. Added header to file:
>
> <%@ WebService Language="c#" Codebehind="MyServices.asmx.cs"
> Class="MyServices" %>
>
> This KINDA worked.  I can load up and view the page in my browser:
>
> http://localhost/MyServices.asmx
>
> But when I try to invoke a method on the service from the web forms that
> display, I get a message like:
>
> *500 - Internal Server Error*
>
> System.MissingMethodException: Cannot create an abstract class 'MyServices'.
>   at System.Activator.CheckAbstractType (System.Type type) [0x00000]
>
>   at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000]
>   at System.Activator.CreateInstance (System.Type type) [0x00000]
>
>   at System.Web.Services.Protocols.WebServiceHandler.CreateServerInstance () [0x00000]
>
>   at System.Web.Services.Protocols.HttpSimpleWebServiceHandler.Invoke (System.Web.Services.Protocols.LogicalMethodInfo method, System.Object[] parameters) [0x00000]
>
>   at System.Web.Services.Protocols.HttpSimpleWebServiceHandler.ProcessRequest (System.Web.HttpContext context) [0x00000]
>
>
> Though I'm not a .NET developer, I'm a developer and can see why trying to
> create an instance of an abstract class would be an issue.  What I'm not
> clear on is what is the best
> pattern to implement the concrete methods.   I've tried implementing a
> concrete class with all of the methods in the asmx and made the class
> inherit from the class generated by
> wsdl2, but when I run the application, the methods disappear.  I'm guessing
> I need to copy all of the blocks that look like this into the concrete
> class:
>
>  [System.Web.Services.WebMethodAttribute()]
>     [System.Web.Services.Protocols.SoapDocumentMethodAttribute("
> http://tempuri.org/IGTPServices/EnrollTransmitter", RequestNamespace="
> http://tempuri.org/", ResponseNamespace="http://tempuri.org/",
> ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped,
> Use=System.Web.Services.Description.SoapBindingUse.Literal)]
>     [return: System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
>
> If anyone can point me to a short tutorial for creating a web service in
> Mono using an existing WSDL, or give me tips herre, I would appreciate it.
>
>
> _______________________________________________
> Mono-aspnet-list mailing list
> Mono-aspnet-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20100902/7fb4440e/attachment.html 


More information about the Mono-aspnet-list mailing list