views:

27

answers:

1

HI Guys, I have created a web service. And I m able to hit the web service using SOAPUI but when i try to call through my code I get this error. Any ideas?

ok the web service code looks like this:

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[WebServiceBindingAttribute(Name = "SoapBinding", Namespace = "xyz")]
[System.ComponentModel.ToolboxItem(false)]
[WebService(Namespace = "http://Search")]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class Stub : System.Web.Services.WebService
{
    public Stub()
    {
        Log.Debug(this,string.Format("this is just a test message"));
    }


    [WebMethod]
    public Response searchAsset(Request serviceTag)
    {
    }

And my client code is:

Search _search = new Search();
_search.url;
_search.n.wcred;
_search.searchAsset(request);
A: 

The most common cause I've heard of this is that the value in whatever the real code of:

[WebService(Namespace = "http://Search")]

If this value isn't what the server expects, the error message you report will happen.

Jon Hanna