VB.Net - Testing Exe for WebService

Good Day Experts!

I am having one heck of a time testing my little vb.net project.  The project was based on a sample project provided the vendor to retrieve the distance between two zipcodes.  I have that project working fine.

Now I want to test like it will be used in Production which is calling the exe returning the mileage.  So, to test I created a project and put a button and a textbox on the Form.  I used ProcessStartInfo to set the file and arguments.  Then Process.Start to fire it off.  

Unfortunately I am getting an error --> Could not find default endpoint element that references contract 'Serv.IService' in the ServiceModel client configuration section. This might  be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.  

Can anyone help me translate what I am doing wrong and give me some direction what I need to do?

Thanks,
jimbo99999
Jimbo99999Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
Do you consume the web service or do you provide a web service?

When it's about consuming a web service, then the error message indicates that you are using an app.config which is incomplete. Thus go back to your project and check the content - it must contain the web service configuration sections.

Then where is your executable located? Have you also copied the app.config?
Jimbo99999Author Commented:
Hello There, thanks for responding:

I am a consumer.  I am also new to working with WebServices.  It is confusing why I can get the sample project working to retrieve the mileage from their WebService but when I try to build the exe and call it from a test project I can't get it to run.  

Do I have to take something from that sample project that works and put it in the test project that I am trying to call the exe from?  Do I just replace the whole sample project app.config or cut an paste part of it?

 My exe is just located here on my local machine.  But the future location when I can  get all this working the exe will be located out on a server.

Thanks for helping and please ask questions if my explanations are unclear as I am new to WebServices.

Jimbo99999
ste5anSenior DeveloperCommented:
A web service client needs to know how to talk to the service. This information is normally stored in the app.config.

Have you checked the folder where your executable is located? Does the app.config exist?
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Jimbo99999Author Commented:
Hello there ste5an:

I did not have an app.config file in the folder where the exe of the sample project is located.  So I put a copy there and tried calling the exe from my test project an unfortunately received the same error.  

jimbo99999
Jimbo99999Author Commented:
I added some debugging messageboxes and found the error is occurring on this line:

Dim service as New Serv.ServiceClient()
ste5anSenior DeveloperCommented:
Copy the config from your Bin folder.
Jimbo99999Author Commented:
ste5an, do you mind if I bullet point outline what I am trying to do so I can make sure I am explaining properly?

1) Received Sample project, containing a WebService,  from vendor to retrieve mileage between two ZipCodes
2) After a bit of time I have that working with no problems returning the mileage
3) I need to be able to use this functionality in a current application so I created the exe
4) To test this conceptually I created a testing project with just a button and textbox
5) I put the exe from 3) in a folder on my C: and referenced that location in the button click event
6) I put the App.Config from the Sample project bin directory 1)  in the folder on the C: where the exe is located
7) Unfortunately I am receiving the same error

Is this ok or do I have something wrong?

Thanks,
jimbo9999
ste5anSenior DeveloperCommented:
Here are the steps with the free SOAPweb service at http://www.service-repository.com/service/overview/-537094317:

Capture1.PNGCapture2.PNGCapture3.PNGCapture4.PNGCapture5.PNG

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jimbo99999Author Commented:
Thanks you kindly...I was out for a couple of days. I will try your suggestion.

Thanks again,
jimbo99999
Jimbo99999Author Commented:
Still working on this it is not neglected...too many fires the last 2 days.  Hope to get back to it tomm morning.
Jimbo99999Author Commented:
I was finally able to dedicate a few hrs and with your screen prints was able to get the exe to run from a testing project!

I was putting the wrong XML Configuration File alongside the exe that I was trying to call.  Without the screen prints, I would have never figured it out.

Thanks for your patience.  I now have that in my knowledge toolbox for next time.

jimbo99999
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.