Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
.NET .DLL error with VFP
Message
 
À
03/02/2015 11:46:19
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
COMCodebook
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01614786
Message ID:
01614806
Vues:
30
>>>Hi All,
>>>
>>>I read Rick Strahl's article at Codemag:
>>>
>>>http://www.codemag.com/Article/0703062
>>>
>>>I developed hello world .DLL with .NET and it worked well with VFP. After that I developed a web service client .DLL and it gave an error me:
>>>
>>>OLE IDispatch exception code 0 from System.ServiceModel: ServiceModel (after this point error message in turkish and I translated to english, might translate errors) client contruction section "Sorgula.KPSPublicSoap" contract default ending point cannot be found. Reason might be, there is no construction point or there is no ending point with this contract at client...
>>>
>>>I converted my web service client .DLL to a .NET forms .EXE and it worked very well...
>>>
>>>Any idea?
>>
>>If you're using WCF the connection information gets stored into a .config file. The name of the .config is based on the executing app. When you call this component from the VFP dev. environment, it will attempt to load this information from vfp.exe.config. If you attempt to call this component from your own EXE it will look for a file YourAppName.exe.config. So more than likely it's not finding this .config file so the endpoint (URL) isn't getting set.
>>
>>If you create a .config file with the correct name, it should work. An alternative is to create the binding and configure this in your .NET code instead of loading it. Something like this:
>>
>>
>>var binding = new BasicHttpBinding();
>>binding.MaxBufferSize = 214783600;
>>// Configure other properties here
>>var client = new NameOfServiceReference(binding, new EndpointAddress("http://www.nameofthewebsitehere.com"));
>>
>
>Thank you, but I couldn't try. I assume I should be do some using ... for basichttpbinding, nameofservicereference and endpointaddress?
>
>my web service address is https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx . Should I put this at endpointaddress ?
>
>Update: Found basichttpbinding and endpointaddress but couldn't find out nameofservicereference.

Your binding needs to match whatever you've configured in the .config file. I just used BasicHttpBinding as an example but there are a number of different bindings available.

You need to substitute your own web service class name for "NameOfServiceReference" and it's dependent on the service reference you added to the project. This is the class you're using and making web service calls on. There is an overload on the constructor that takes those 2 parameters.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform