-1

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 this output.cs in my visual studio project und created a simple test application. The test application can be compiled and even run, but I don't know why. I didn't enter any service URL.

How can this be and how can I configure the test application to use the proper SAP URL?

Thanks

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

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
nWorx
  • 2,145
  • 16
  • 37

2 Answers2

0

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 ..

RameshVel
  • 64,778
  • 30
  • 169
  • 213
0

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.

Dmitry Ornatsky
  • 2,237
  • 2
  • 18
  • 25