Jesus Zamora
Jesus Zamora

Reputation: 839

Adding a SOAP web service reference

I am trying to add a SOAP web service in the VS.NET 2010 interface, but I get that the server refused the connection. The people in charge of the service tell me it is working. I asked if they had a wsdl file, but supposedly they have none.

Is the problem caused by their lack of wsdl, or can I assume there is a problem on my side?

Upvotes: 0

Views: 2296

Answers (2)

tom redfern
tom redfern

Reputation: 31750

If they are not willing to expose their service metadata on the service then see if they will give you access to the assemblies containing the service contract, operations, and data contracts. Then you can create a proxy to the service without needing any metadata.

// Create service proxy on the fly
var factory = new ChannelFactory<IMyServiceContract>("NameOfMyClientEndpointInConfigFile");
var proxy = factory.CreateChannel();

// Create data contract
var requestDataContract = new MyDataContract();

// Call service operation.
var responseDataContract = proxy.MyServiceOperation(requestDataContract);

It also helps if you have access to the service-side config file so you can copy the endpoint details out of there into your client config.

Upvotes: 1

Nick Ryan
Nick Ryan

Reputation: 2670

It looks like their service is not exposing metadata. Try and browse to the wsdl url and see if you get back anything. http://server/blah/blah?wsdl

Upvotes: 0

Related Questions