fmichail
asked on
problem in creating a service reference in vs2008
I am trying to reference the wcf service
http://ExpRefund.tst.retro.mycompany.net/ExpRefundFacade.svc/ExpRefundFacade
after entering this url and press GO it says could not find service
I tried the following without success:
http://ExpRefund.tst.retro.pacificlife.net/ExpRefundFacade.svc
However, if I use http://ExpRefund.tst.retro.pacificlife.net/ExpRefundFacade.svc in the browser, I get the service.... By the way the service is working fine in the application, however I want to add a reference to it in another new application but is not accepting... I must be doing something wrong, could anyone help please. Thanks
by the way if the svc is in the localhost, and I use [discover] button, it is correctly selected.
http://ExpRefund.tst.retro.mycompany.net/ExpRefundFacade.svc/ExpRefundFacade
after entering this url and press GO it says could not find service
I tried the following without success:
http://ExpRefund.tst.retro.pacificlife.net/ExpRefundFacade.svc
However, if I use http://ExpRefund.tst.retro.pacificlife.net/ExpRefundFacade.svc in the browser, I get the service.... By the way the service is working fine in the application, however I want to add a reference to it in another new application but is not accepting... I must be doing something wrong, could anyone help please. Thanks
by the way if the svc is in the localhost, and I use [discover] button, it is correctly selected.
can we see your wcf service config please. Do you get any error inside VS2008 ?
ASKER
Hi apeter
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled ="true" />
<bindings>
<basicHttpBinding>
<binding name = "secureMsg" maxReceivedMessageSize="94 371840">
<readerQuotas maxStringContentLength="94 371840" />
<security mode="TransportCredentialO nly">
<transport clientCredentialType="Wind ows" proxyCredentialType="Windo ws" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="FI.Facade.FIFacade" behaviorConfiguration="Deb ug_Behavio ur">
<host>
<baseAddresses>
<add baseAddress = "http://fi.tst.retro.mycompany.net" />
</baseAddresses>
</host>
<endpoint
address="FIFacade"
binding="basicHttpBinding"
bindingConfiguration="secu reMsg"
contract="FI.Interface.IFI Facade" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Debug_Behaviour">
<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFa ults="true " />
<serviceMetadata httpGetEnabled="true" />
<serviceAuthorization principalPermissionMode="U seWindowsG roups" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.serviceModel>
<serviceHostingEnvironment
<bindings>
<basicHttpBinding>
<binding name = "secureMsg" maxReceivedMessageSize="94
<readerQuotas maxStringContentLength="94
<security mode="TransportCredentialO
<transport clientCredentialType="Wind
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="FI.Facade.FIFacade" behaviorConfiguration="Deb
<host>
<baseAddresses>
<add baseAddress = "http://fi.tst.retro.mycompany.net" />
</baseAddresses>
</host>
<endpoint
address="FIFacade"
binding="basicHttpBinding"
bindingConfiguration="secu
contract="FI.Interface.IFI
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Debug_Behaviour">
<serviceDebug httpHelpPageEnabled="true"
<serviceMetadata httpGetEnabled="true" />
<serviceAuthorization principalPermissionMode="U
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Aren't you missing Mex endpoint for your service? Returning metadata about an WCF service allows consumers of a service to easily create clients for the service
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchang e" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchang
ASKER
apeter,
I will try that and let you know. do you mean that I just add this end point, and then I can create a service reference to it? what should I use,
http://ExpRefund.tst.retro.mycompany.net/ExpRefundFacade.svc/ExpRefundFacade
or
http://ExpRefund.tst.retro.mycompany.net/ExpRefundFacade.svc
I will try that and let you know. do you mean that I just add this end point, and then I can create a service reference to it? what should I use,
http://ExpRefund.tst.retro.mycompany.net/ExpRefundFacade.svc/ExpRefundFacade
or
http://ExpRefund.tst.retro.mycompany.net/ExpRefundFacade.svc
ASKER
Hi apeter
I did add the Mex endpoint. and when I tried to create a service reference, entered the url (I tried both), and when I press GO I get the message indicating not able to reach the url
It may look like I do not have permission, however, if I use the url in the browser, I get the service displayed correctly. what do you think?
I did add the Mex endpoint. and when I tried to create a service reference, entered the url (I tried both), and when I press GO I get the message indicating not able to reach the url
It may look like I do not have permission, however, if I use the url in the browser, I get the service displayed correctly. what do you think?
You should create a proxy/reference using this URL, http://ExpRefund.tst.retro.mycompany.net/ExpRefundFacade.svc.
ASKER
You have create a proxy to the service and not to a method in a service directly. You should use this url, http://ExpRefund.tst.retro.mycompany.net/ExpRefundFacade.svc
to create a service reference.
to create a service reference.
ASKER
Can you please click on the "Details" link and get error details ?
ASKER
Hi apeter
sorry for the delay, I was out of country for few days.
The main part in the error is
Metadata contains a reference that cannot be resolved: 'http://exprefund.stg.retro.pacificlife.net/ExpRefundFacade.svc'.
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.
The remote server returned an error: (401) Unauthorized.
If the service is defined in the current solution, try building the solution and adding the service reference again.
What is confusing is that when I use this url in the browser (on the same PC with the same credential) I get the service operations showing normally
sorry for the delay, I was out of country for few days.
The main part in the error is
Metadata contains a reference that cannot be resolved: 'http://exprefund.stg.retro.pacificlife.net/ExpRefundFacade.svc'.
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.
The remote server returned an error: (401) Unauthorized.
If the service is defined in the current solution, try building the solution and adding the service reference again.
What is confusing is that when I use this url in the browser (on the same PC with the same credential) I get the service operations showing normally
ASKER
Hi apeter
I read the link, and tried the followng:
and every time I restarted the www publishing service. Still getting an error that the url could not be resolved. I tried again the direct targeting the url from the browser, and it works OK. It is just the problem in trying to create a service reference in VS 2008. Sorry apeter, to bug you again. Thanks
I read the link, and tried the followng:
set the application pool to work for Anonymous access
Tried change the service web.config to set the clientCredentialType="Ntlm "
proxyCredentialType="None"
and every time I restarted the www publishing service. Still getting an error that the url could not be resolved. I tried again the direct targeting the url from the browser, and it works OK. It is just the problem in trying to create a service reference in VS 2008. Sorry apeter, to bug you again. Thanks
Can you please try opening VS2008 in "Administration" mode and try adding reference.
Check out this link, https://social.msdn.microsoft.com/Forums/en-US/0071720f-68e0-4d29-bc7c-3b96d33cb38c/problem-while-adding-reference-of-my-wcf-service?forum=wcf Hope it helps.
Check out this link, https://social.msdn.microsoft.com/Forums/en-US/0071720f-68e0-4d29-bc7c-3b96d33cb38c/problem-while-adding-reference-of-my-wcf-service?forum=wcf Hope it helps.
ASKER
Hi apeter
I tied opening vs2008 as administrator, and got te same problem. I tried to create a service on my machine, and tried to reference it. This is OK but not from the server. Keep on please. Thanks
I tied opening vs2008 as administrator, and got te same problem. I tried to create a service on my machine, and tried to reference it. This is OK but not from the server. Keep on please. Thanks
Enable tracing on wcf service. It might give more clues of the error.
Use this link to enable tracing, https://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx
Use this link to enable tracing, https://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx
ASKER
Sorry apeter, nothing was written to the trace file when I try to create a service reference from VS 2008.
That mean, your request didn't reach WCF service. something is preventing your call.
ASKER
Looks like, however,
I cannot understand
If I try to access the webservice from the browser using same url it works indicating I have the correct URL and correct permissions
If I use the same steps on a service on my local drive it works indicating I am following the corerct steps
I cannot understand
Within visual studio we can browse. Can you access your service in the visual studio browser.
ASKER
Sorry apeter I almost gave up. and did not check the question status for the last period, please accept my apologies.
What is the visual studeo browser? It would be great if you can provide a screenshot. I appreciate your help.
What is the visual studeo browser? It would be great if you can provide a screenshot. I appreciate your help.
Go to VS Menu : View -> other windows -> web browser. This opens a browser inside VS.
ASKER
I will try this on Monday when I am back at work. however, I tried the url from the normal browser (outside of vs 2008) and it works fine
ASKER
Hi apeter,
I tried again and this time, I could not even open the link in the browser (the general browser). I see this as at least consistent. Here is the message
Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service
The application is running on IIS6, and is hosted in an application pool. I tried to open the properties of the pool, however, I could not find anything about security it is as shown here
How to change the setting to enable windows Authentication?. I think we are getting there. Thanks apeter
I tried again and this time, I could not even open the link in the browser (the general browser). I see this as at least consistent. Here is the message
Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service
The application is running on IIS6, and is hosted in an application pool. I tried to open the properties of the pool, however, I could not find anything about security it is as shown here
How to change the setting to enable windows Authentication?. I think we are getting there. Thanks apeter
ASKER
ASKER
I checked the authentication, and it indicates windows authentication is enabled (however, it indicates "No Anonymous access".
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
apeter,
It Worked..... !!!
I appreciate your help so much .. I followed the last part of the Microsoft link you sent me, and here are the steps I followed:
It looks like for some reason, I had a compatibility issue (I do not know what it is) which was resolved by using the compatibility mode (compatible with Framework 2. Thanks so much apeter.
It Worked..... !!!
I appreciate your help so much .. I followed the last part of the Microsoft link you sent me, and here are the steps I followed:
In the [Add service reference] Dialog click [Advanced Button]
In the [service reference setting] dialog click [Add web reference] button
In the [Add web reference] dialog enter the URL, and the service interface will show. click [Add Reference] after setting the name
It looks like for some reason, I had a compatibility issue (I do not know what it is) which was resolved by using the compatibility mode (compatible with Framework 2. Thanks so much apeter.