using System.Web.Services; namespace soapWebService { [WebService(Namespace = "http://sanirimbuyok.blogspot.com/WebServisSoapHeader")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] public class Service1 : WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } } }
Web Servisinin Temel Halinden Ne Nedir?
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]If web service code aren't compliant to WS-I, it still don't generate compilation error, but it will generate error while client add or update web reference.
[WebService(Namespace = "http://tempuri.org/")]
In .NET programming, namespaces are used to prevent name collisions:
namespace A {public class C {}}
namespace B {public class C {}}
Even though the two classes are named "C", they really have different names. One is "A.C" and the other is "B.C". The use of namespaces has prevented a collision between the names.
XML namespaces like the one you're talking about have the same purpose, but for XML. It helps prevent name collisions.
You could start with a simple namespace like http://www.abc.com/, but the problem is that you may experience collisions even within your company. Instead, you may want to get more specific and use something like http://www.abc.com/services/serviceName. You're unlikely to have two names in your one service that collide with each other.
Hiç yorum yok:
Yorum Gönder