0

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?

1
  • I would be chasing them up harder about the WSDL as if they have developed a web service for consumption then they will have a WSDL. It doesn't mean it is publically available via the url but they should be able to supply you one, even if they email it to you. If they can't even do that I would be concerned. Commented Jan 16, 2012 at 21:01

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

3 Comments

fair enough. They'll have to give you wsdl file or URL from which one can be retrieved otherwise you won't be able to create a service proxy by adding a service reference (or web reference). It is possible to create a service client manually if you have sample requests and responses but it is not easy if the requests and responses are complex. I would definitely push for the wsdl. Hope my answer helped.
This is not true. You don't need the metadata to create the proxy. You can create the proxy on the fly using ChannelFactory and this is very easy indeed. See my example.
Hi Hugh, your approach below is good, but it pre-supposes that the hosted service was developed using WCF (and .NET) which it may not have been. If the team developing the hosted service had the capability to supply a contract assembly, you'd imagine it'd be even easier for them to supply or expose a wsdl (just my tuppenceworth).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.