Is there away

  • Thread starter Thread starter Kenneth
  • Start date Start date
K

Kenneth

Is there away to take a webservice connection with me to another project
like the code , I want to use the same web service connection .

If I do like the code I get error



Project 1

Public oWebb As New AdminNetWebService.Service

Dim oViewOrder As New Project2

With oViewOrder

.oWebb = oWebb (error here)

End With

---------------------------------------------------------

Project 2

Public WriteOnly Property oWebb() As AdminNetWebService.Service

Set(ByVal Value As AdminNetWebService.Service)

_oWebb = Value

End Set

End Property





//Kenneth
 
I dont' believe so, when you create a web service reference it uses CodeGen
to generate simple methods for communicating with the service via soap.

I don't have the greatest experience with web services, but I have the same
situation with a project at home. And I had to just do new services.

-CJ
 
Hi Kenneth,

Sorry, I do not see the problem.

The purpose from a webservice is that you from diverent situations easily
can made a new connection.

Just set a webrefrence and you are almost ready.

In my idea is copying the code more work.

Cor
 
my problem is that the my progarms whole backend is a webservice and the web
service is talking to the database
I have a project who deals with all printing funcktions.

I have a webservice connection in my base program and I don't want to make a
new one in my printing project because it only make a new database
connection and a new user session on the web server.

so I want to take the webservice object with me over to the other project, I
can to that with a database connection object so I hope I can do it with
this too.

//Kenneth
 
Ahh

see remoting.


Kenneth said:
my problem is that the my progarms whole backend is a webservice and the web
service is talking to the database
I have a project who deals with all printing funcktions.

I have a webservice connection in my base program and I don't want to make a
new one in my printing project because it only make a new database
connection and a new user session on the web server.

so I want to take the webservice object with me over to the other project, I
can to that with a database connection object so I hope I can do it with
this too.

//Kenneth
 
Wait..

a web service connection...

Um... I may be wrong again, but aren't web services stateless as well? I
think you need to clarify what your trying to do... To transfer a connection
object is one thing, I understand that... however, transfering a connection
object, across programs, that doesn't necessarily retain state info is
another...

Second, the web service should be dealing with the number of connections to
the SQL server... not the project itself.

-CJ
 
From what I heard I have my own Session for about 20 minutes on the
webservice and it die after 20 idle time minutes.
So my webservice have my database connection object, in my main prog there
is no one.
And I can keep the webservice alive by asking the webservice something every
10 minutes.

this works fine for me

Before I used webserver I had a project where I took the connection object
with me in to other projects and now I want to do the same with the
webservice
It's OK for me to make a web service reference but I want to use the same
session I already have in the IIS

IM I on deep water or what?

//Kenneth
 
I think my trouble comes from the idea of keeping the webservice alive.
Which would imply a stateful connectoin, and in all my understanding of the
web this doesn't exist.

yes, a session object can be kept alive inside IIS for a specified period of
time and dissolve with certain amount of inactivity...

However, this is NOT a consisitant connection (there is no "stream" of data
between the two...). A web service in all my understanding transmits a SOAP
envelope that conforms to the WDSL contract when it was created. The
response object then writes back another SOAP envelope that is received by
the program for processing. at this point, the connection between the web
server and the client is dead. Now, by using cookies and IP tracking and
all sorts of other methods you can maintain the concept of a persistant
session state, but its not.

Now, IE can uses cookies across windows to maintain state, however I don't
know how its done (could be built in, could not, again, I don't have a clear
answer on it.)

So the best way to do so would be to use remoting to transfer the object to
your other program. I can't guaruntee it will work, but it would be the way
I would approach it.

-CJ
 
Hi CJ,

I agree with almost all, except with the last alinea.

When you think to a webservice or any webapplication than in my opinion you
have always to think that the Server is in Europe and the Client in the US
or visa versa or any other place on the world.

I think that it would not work with remoting (although Internet becomes
faster and faster so maybe I am wrong in that).

:-)

I keep it with my first answer, and when Kenneth has procedures in his
program that uses the webservice I do not see why he cannot just copy that.

Cor
 
Cor,

I understand your statement with the two server locations... My
understanding was that the two programs he is developing are on the same
machine... Including in deployment... So overall... 3 programs (1 WS, 2 .NET
Executable Assemblies).

But maybe I'm getting it wrong. Kenneth are you trying to transfer an
object between prgrams on the same machine or different locations... I
thought it was the same location with a web service somewhere else.

-CJ
 
I try to share the webservice connection between one exe file and one dll in
my client program

the webS connection is in the exe file and I want to use that in my dll
file.

If I make a new webS connection in my dll for every print job it will be
very many sessions in the IIS and I want no avoid that.

In my exe file I have the webS public so I can use it in all classes.

//Kenneth
 
Hi Kenneth,

What is a connection with your webservice.

There can be a session with your client on the IIS but not a connection.

CJ did write that already very carefully to you.

So I do not see the problem, as far as I know stays the client the client
and the IIS has a session with that what ever he sends or retrieves.

Cor
 
Back
Top