For testing i made an easy hello world webservice, add a
web reference from my application to the WS, when my apllication starts,
an ASP.net development server notification icon starts up, and idd i can
invoke the webmethod HelloWorld,
The url in app.config is "http://localhost:2170/Test/Service.asmx"
My first question : is it possible to change the port 2170, when i
trying ex 4990 i get an error "Unable to connect to the remote server",
Now i like to set up the webservice to a public IP adres: say
"http://W.X.Y.Z:PORT",
i give the WSDL interface to a third party, last one builds up the WB
with the WSDL, so a third party has nothing to do with the
implementation class "Service" notified with the "Service.asmx".
My second question what must the url be in my app.config or the one in
the app.config form the third party,
http://W.X.Y.Z:PORT/Project/nameWebReference ???
Proberly not because i get an error,
Last question, If everything went ok would i again see the notification icon buth now referring to an ip+port??
Thx
nelo
March 25th, 2008, 01:48 PM
The url in app.config is "http://localhost:2170/Test/Service.asmx"
My first question : is it possible to change the port 2170, when i
trying ex 4990 i get an error "Unable to connect to the remote server",
That port number indicates that the your web service is hosted by the Visual Studio development web server. That number will change and you cannot depend on it. If you want a semi permanent arrangement I suggest setting up a virtual directory on your local machine through IIS. Then you can update your web reference in your application. It should then say "http://localhost/Test/Service.asmx".
Now i like to set up the webservice to a public IP adres: say
"http://W.X.Y.Z:PORT",
i give the WSDL interface to a third party, last one builds up the WB
with the WSDL, so a third party has nothing to do with the
implementation class "Service" notified with the "Service.asmx".
My second question what must the url be in my app.config or the one in
the app.config form the third party,
I'm not sure I understand you here. If you or the third party publish the web service you or they will have full control over how it is accessed. For example I've just published a web service just to test. I've got a web site http://www.aspspider.info/chosenbreed. I added my Service.asmx in the root folder. I also added the Service.cs in the App_Code under the root folder on the web server. Then I can add a web reference and point to http://www.aspspider.info/chosenbreed/Service.asmx. No need for the port.
Smetje
March 26th, 2008, 03:35 AM
Thx for responding buth i think i gave to reform my question,
A third company has wrote a webservice that will send data to another
webservice on the customer side in periods off time, from the last webservice (customer) i got the WSDL interface,
now i have to set up the customer webservice on a public ip adress + port,
makes connection to the webservice from the third company and give the url off my client webservice, from then the third party webservice will start sending data each time slice,
My question?
In my project i do not see a .asmx or a Service class,
Keeping your repsons in mind the fault must be here,
so i probably have to create the .asmx myself?,
Many Thx
nelo
March 26th, 2008, 04:39 AM
now i have to set up the customer webservice on a public ip adress + port,
Why do you have to do this? Is the customer webservice not public?
makes connection to the webservice from the third company and give the url off my client webservice, from then the third party webservice will start sending data each time slice,
So are you writing a your own web service that will connect your customer web service to your third party web service. Is that correct?
I'm trying to understand the situation so that I can give the best answer.
Smetje
March 26th, 2008, 06:02 AM
"Why do you have to do this? Is the customer webservice not public?"
Yes, the third party api can only work if they can send info to a fixed IP address.
"So are you writing a your own web service that will connect your customer web service to your third party web service. Is that correct?"
There are two webservices, one on my Pc, and one on de third company,
my pc ip is rooted to an public ip adress, the intention is to make the
third party webservice aware that i have a client webservice that he
must connect on and start sending certain data each period off time.
So i got two WSDL files from the third party,
---------
The first one is an interface from their webservice, containing methods like
setURL (Must set the url off my client webservice), methods to define witch
data he has to send to my webservice.
Anyway, calling those methods succeeds, so the webservice on the third
party knows enough to starts sending data to my webservice,
----------
The second WSDL, also created by third party, is an customer interface,
i have to set up this one on my pc with an url i have already given to the
third party webservice, from that moment the third party webservice
can connect to my webservice and start sending data,
So i should make a asmx
In the wsdl i see :
<wsdl:service name="PushAPICustomerService">
How should the url be?
http://IP:PORT/service.asmx
thanks in advance,
i hope the stuff above makes sense,
nelo
March 26th, 2008, 06:10 AM
I understand better now. You don't need the port number. You can always try to see if works for yourself. So set the url and try to access it from a browser.
Smetje
March 26th, 2008, 09:36 AM
Hopefully last question,
To set up the customer webservice i started again from scratch,
witch means created a new website and declared all methods
from the customer WSDL into the service class, then added
a new project and linked it with a web reference to the website,
When i run my application, i see a notification icon
"ASP.NET Development Server" http://localhost:3307/pushWS
When i type in browser "http://localhost:3307/pushWS/Service.asmx"
then i see all the needed methods,
so far so good, now i want to change the url to my ip adres,
(witch is connected to our public adres)
so i change the url in "app.config" and "Settings.settings" to:
http://IP:PORT/service.asmx (tested with or without PORT)
When i now run my application i get still the
"http://localhost:3307/pushWS/Service.asmx" url,
what can the reason be for this?
Is theire something i forgot?, or because i'm in debug mode?,...
Grtz
nelo
March 26th, 2008, 09:45 AM
You now have to deploy your web application/web service. I assume that your files are on the local file system. In that case you can do it manually. To do it manually you can go to IIS (Control Panel -> Administrative Tools) and set up a new virtual directory. You can put the files under the wwwroot folder or just point to the current location of the files on your file system. Once that is done you will be able to access it locally through localhost (e.g. http://localhost/pushWS/Service.asmx). You will also be able to use your ip address instead of localhost. You have control over the url. I just put pushWS because that is what you had earlier. When you name your virtual directory you can call it anything you want. And since your ip address is public you should be able to test it. I'm willing to test it from my browser once you're set up.
Now if you run your application from visual studio by pressing F5 you will always get the development server (e.g. localhost:3307 or whatever number it decides to use). That's normal. If you want to run through IIS it easier to go through the web browser (you must set the virtual directory before you can access it in the browser directly). If you need to debug you can attach the debugger to the aspnet_wp.exe.
Smetje
March 26th, 2008, 11:23 AM
Done, first tried with simple hello world example, but get this error,
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.