Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ServiceStack - generate ASP.NET webservice -reference issue

Tags:

servicestack

I am using the very excellent servicestack libaries and trying to generate a ASP.NET web-service reference (old style not WCF) from within VS2010 across my servicestack WSDL - Soap11. To nicely wrap the service WSDL.

The DTO's are in a seperate assembly/namespace (My.WS.DTO) from the AppHost/services and are following the request/response naming convention.. when I try to generate the reference through visual studio I get the following error in VS.

Custom tool error: Unable to import WebService/Schema. Unable to import binding 'BasicHttpBinding_ISyncReply' from namespace 'http://schemas.servicestack.net/types'. Unable to import operation 'GetMyDetails'. The element 'http://schemas.servicestack.net/types:GetMyDetails' is missing.

NOTE: GetMyDetails is just the first service that appears in the list - so I dont believe this is the problem.

I have tried adding the assembly namespace in the AppHost file using EndpointHostConfig.Instance.WsdlServiceNamespace = "My.WS.DTO"; and this just causes the same generation error (as above) but with 'My.WS.DTO' instead of 'http://schemas.servicestack.net/types'.

I assume it is perhaps some sort of referencing problem but any guidance as to what I might be doing wrong would be great. cheers

like image 202
rhawk Avatar asked Nov 07 '12 03:11

rhawk


1 Answers

I don't know if this is still an issue for you but I had a similar problem and found that I had not decorated one of my DTOs with [DataContract] and [DataMember] attributes, as described on the SOAP Support wiki page. Once you have added these to your DTO it will be declared in the type section of the WSDL.

like image 195
mickfold Avatar answered Sep 19 '22 14:09

mickfold