0

There is a external web services.

I can invoke it from my winform application, but I cannot invoke it from my asp.net mvc web application.

Error message is like this :

System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://ihexds.nist.gov:9080/tf6/services/xdsrepositoryb that could accept the message. This is often caused by an incorrect address or SOAP action.

Is there anything to configure for my mvc web application to consume it?

Edit :

following is my code to invoke web services

WCF.Message msgInput, msgOutput;
msgInput = WCF.Message.CreateMessage(MESSAGE_VERSION, PROVIDEANDREGISTERDOCUMENTSETB_WSAACTION, request);
msgOutput = WCF.Message.CreateMessage(WCF.MessageVersion.Soap12WSAddressing10, "");

string endpointName = GetRepositoryEndPointName();
XDSRepository.XDSRepositoryClient client = new XDSRepository.XDSRepositoryClient(endpointName);

msgOutput = client.ProvideAndRegisterDocumentSet(msgInput);
4
  • There should be no difference in consuming a web service from webforms or from mvc... how exactly do you call the service? Commented Jun 8, 2011 at 9:54
  • So you're using WCF. There must be a difference in the configuration between the two web apps. Check your web.config file. Btw, you can edit your question (to include the code). Commented Jun 8, 2011 at 10:12
  • I checked web.config file, but I think it is not the problem. Weird thing is that exception (EndPointNotFoundException). I am using local IIS Express and seems like a web application on the IIS Express does not have authority to access external web services. Do you know how to give a authority for this? Commented Jun 8, 2011 at 10:22
  • I found very very weird thing. If I run Fiddler and invoking the web service is succeeded. If not, failed. Commented Jun 8, 2011 at 10:50

1 Answer 1

1

Judging from your comments, I think your problem is proxy server related. I think you're using a proxy server internal to your company. You have to specify in you web.config file that you want the dotnet code to use the credentials you're logged on with. Add this to your web.config and try again:

<system.net>
    <defaultProxy enabled="true" useDefaultCredentials="true" >
    </defaultProxy>
</system.net>

It's also possible that you're working with a .pac script. In that case you have to explicitly specify the proxy server like so:

<system.net>
    <defaultProxy useDefaultCredentials="true">
        <proxy proxyaddress="http://proxyserver:proxyport"/>
    </defaultProxy>
</system.net>
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you fretje, you are right.. After adding proxy configuration on my web.config, it is working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.