views:

54

answers:

2

Hi,

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 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 http://stackoverflow.com/questions/2108349/problem-creating-proxy-class-with-wsdl-exe

A: 

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

Cheers

RameshVel

Ramesh Vel
This way you'll need to re-edit your code every time you run svcutil
Dmitry Ornatsky
A: 

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
uhh thanks that looks good.. i'll test it and than accept it if it works :-)
nWorx