开发者

Configuration of webservice client

I've created proxy classes using svcutil with a given "sap crm" wsdl file. It worked great and it generated a output.cs. So added thi开发者_JS百科s output.cs in my visual studio project und created a simple test application. The test application can be compiled and even run, but I dont know why. I didn't enter any service url.

How can this be and how can i configure the test application to use the propper sap url?

Thanks

it's a follow up question to this Problem creating proxy class with wsdl.exe


You'll have following constructors in your generated proxy:

 public SampleServiceClient(string endpointConfigurationName)
        :
            base(endpointConfigurationName)
    {
    }

public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress)
    :
        base(binding, remoteAddress)
    {
    }

The first one references endpoint description in your config file, the other accepts programmatically created binding and endpoint address.

As for username/password part, with your binding properly configured, use the proxy.ClientCredentials.UserName property.


in the ouput.cs file check the constructor, URL is propably appended in it. Change the default constructor to accept URL as parameter and assign the given URL ..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜