Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Saturday, March 31, 2012

Web server busy

Hi, I created access database and let people checkin and checkout. I created four buttons, but every time it seems that when people clcik the second one, it gives web server is busy message. It takes quite a while to retrive the page and then check in. It seems that not many people check in at that time. Would any expert look at my code? I really appreciate it and thanks!!!!

Sub Check_Test(sender as Object, e as EventArgs)



Dim currEmpNumber As String = employeeID.Text

currEmpNumber = checkUserInput(currEmpNumber.Trim())

strSQL="Select * from Employee WHERE IDEmployee= '" & currEmpNumber & "'"



call openDB()

Dim objDR as OleDbDataReader
Dim Cmd as New OleDbCommand(strSQL, connTemp)

objDR=Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)


While objDR.Read()
currName=ValidateInputForDB(objDR("Name"))

End While

call CloseDB()

Call OpenDB()



strSQL="Select IDEmployee from Employee WHERE IDEmployee= '" & currEmpNumber & "'"
Dim myCommand1 As New OleDbCommand(strSQL, connTemp)
currEmpID = myCommand1.ExecuteScalar()
If currEmpID = 0 Then
labelMessage.text = "<blockquote><font size=6 color='blue'><b>* Wrong No! Please try again!</font>"
labelMessage1.visible=false


Else
Dim myCountEmployee as Int32 = 0


strSQL="Select count(*) from Clock WHERE IDEmployee= '" & currEmpNumber & "' and serverDate = '" & currServerDate & "'"
Dim myCommand3 As New OledbCommand(strSQL, connTemp)
myCountEmployee = myCommand3.ExecuteScalar()


If myCountEmployee = 0 Then

labelMessage.text = "<blockquote><font size=6 color='blue'><b>* Sorry! </font>"
labelMessage1.visible=false
else

If myCountEmployee > 0 Then

strSQL="UPDATE Clock SET OutWork1 = '" & currServerTime & "' WHERE IDEmployee= '" & currEmpNumber & "' and serverDate = '" & currServerDate & "' and Outwork1 = '' "

call InsertUpdate(strSQL)

call CloseDB()

End IF
end if
end if
labelMessage1.text ="Bye, " & cstr(currName) &"!" & " "


End Sub

hi,

i'm not an expert, i'm neither familiar with VB. I'm coding in c#, but it looks to me that you don't close the db connection every time.

If myCountEmployee > 0 Then

strSQL="UPDATE Clock SET OutWork1 = '" & currServerTime &"' WHERE IDEmployee= '" & currEmpNumber & "' and serverDate= '" & currServerDate & "' and Outwork1 = '' "

call InsertUpdate(strSQL)

call CloseDB()

End IF

it think the connection is closed only when there are any employees ?

And it is opened before the if, so it should be closed not in the if clause.

If my assumption is right, it is possible to run out of sql connections very soon, which may causes your problem.

If i'm wrong sorry for puzzling you more :)

Cheers,

Yani

Web Server hangs

We have a problem with sites developed using Visual Studio 2003 that doesn't
occur with similar sites created in Notepad. Whilst browsing the site,
occasionally the site hangs completely and the only way to get it going
again is by restarting the web server.

Are there any known problems along these lines that people can point me in
the direction of?

ThanksHi,

From my experience the blame is always on our code. "Debugging tools for
windows" [1] got hang state that dump the running process and let you,
with symbols, find the lines that at least generate the problem.

By the way do you have multi threaded code in your application ?

[1] - http://www.microsoft.com/whdc/ddk/d...ng/default.mspx
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Wednesday, March 28, 2012

Web Service

I created a webservice at home last night. I got it to work but when I bring it to work, I cannot load the project. VS.Net tells me that it is not loaded or something.The exact error would be helpful ;)

DJ
Thank You for your reply but I was able to take care of this by recreating the project.
it probably would have moaned because you would not have the webservice virtual directory set up in iis.

it probably works now cos by recreating the project you set up the vd
I think I agree with you on that.

Web Service

Hello.
Hello.

I use a web service that I created through a custom
control on a windows form and it works fine. However, if iput this control
on a
webform usinf the <object...classid..> label, i get an security error when i
call the web service
saying:

"The application attempted to perform an operation not
allowed by the security policy. The operation required the
SecurityException. To grant this application the required
permission please contact your system administrator, or
use the Microsoft .NET security policy administration tool.

Request for the permission of type
System,Net.WebPermission..."

What can i do?
I don't know how to explicitly trust the assembly.

ThanksYou'll need to use CASPOL.exe from the command line, or use the
framework configuration UI [1] under the Administrative Tools menu on
the computer.

What I would do is use these tools to grant the additional permissions
through a new code group [2] based on either a strong name or a URL
membership condition. Since URLs can be spoofed I'd suggest you string
name the assembly with your custom control and use the strong name
membership.

--
Scott
http://www.OdeToCode.com/blogs/scott/

[1]
http://msdn.microsoft.com/library/d...mscorcfgmsc.asp

[2]
http://msdn.microsoft.com/library/d...odegroups .asp

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 30 Aug 2005 09:13:34 +0200, "Aurelio"
<corcharelliARROBAhotmail.com> wrote:

>Hello.
>Hello.
>I use a web service that I created through a custom
>control on a windows form and it works fine. However, if iput this control
>on a
>webform usinf the <object...classid..> label, i get an security error when i
>call the web service
>saying:
>"The application attempted to perform an operation not
>allowed by the security policy. The operation required the
>SecurityException. To grant this application the required
>permission please contact your system administrator, or
>use the Microsoft .NET security policy administration tool.
>Request for the permission of type
>System,Net.WebPermission..."
>What can i do?
>I don't know how to explicitly trust the assembly.
>Thanks

Web Service

Hello.
Hello.
I use a web service that I created through a custom
control on a windows form and it works fine. However, if iput this control
on a
webform usinf the <object...classid..> label, i get an security error when i
call the web service
saying:
"The application attempted to perform an operation not
allowed by the security policy. The operation required the
SecurityException. To grant this application the required
permission please contact your system administrator, or
use the Microsoft .NET security policy administration tool.
Request for the permission of type
System,Net.WebPermission..."
What can i do?
I don't know how to explicitly trust the assembly.
ThanksYou'll need to use CASPOL.exe from the command line, or use the
framework configuration UI [1] under the Administrative Tools menu on
the computer.
What I would do is use these tools to grant the additional permissions
through a new code group [2] based on either a strong name or a URL
membership condition. Since URLs can be spoofed I'd suggest you string
name the assembly with your custom control and use the strong name
membership.
Scott
http://www.OdeToCode.com/blogs/scott/
[1]
http://msdn.microsoft.com/library/d...gm
sc.asp
[2]
http://msdn.microsoft.com/library/d...r />
groups.asp
Scott
http://www.OdeToCode.com/blogs/scott/
On Tue, 30 Aug 2005 09:13:34 +0200, "Aurelio"
<corcharelliARROBAhotmail.com> wrote:

>Hello.
>Hello.
>I use a web service that I created through a custom
>control on a windows form and it works fine. However, if iput this control
>on a
>webform usinf the <object...classid..> label, i get an security error when
i
>call the web service
>saying:
>"The application attempted to perform an operation not
>allowed by the security policy. The operation required the
>SecurityException. To grant this application the required
>permission please contact your system administrator, or
>use the Microsoft .NET security policy administration tool.
>Request for the permission of type
>System,Net.WebPermission..."
>What can i do?
>I don't know how to explicitly trust the assembly.
>Thanks
>
>

Web Service & SQL Server Authentication

Hi there

I have this weird problem. I created a Web Service that extracts data from the SQL Server and then return it as a XML document.

The problem is when the Web Service gets to the code to open the Connection to the server it gives this error.

System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

Now my Win32 application works just fine, using the same code. Thus I believe the problem might be the settings of IIS.

But unfortunately I don't even know where to start looking.

Some help would really be appreciated.

Thanx in advanceIf you are trying to open a connection via sql server authentication (note: not windows), you need to grant access to that account in your db. If you are using windows authentication, you need to grant access to the asp.net account.
Sorry misread

Monday, March 26, 2012

web service and Flash MX professional

I created a simple .NET web service which selects data from a SQL server database and returns XML. Now I would like to bind a drop down component from flash mx professional to this webservice. Every time I try to add the web service to my flash project I get an error:

Flash was unable to find any Web Services from the following URL:
http://www.madisontitle.com/webservice1/service1.asmx/GetCats
what have i done wrong. if you go to that link it returns the xml that i need. do i need to do something to make the webservice public?

PLEASE HELP!
thanks.try just loading the xml to an xml object in flash and then working with it. I don't know though I have never worked with any of the components in flash. Although I'm looking forward to using them in mx 2004 because it has full .net support. It has a flash version of most DataControls in the framework and so on.
I want to do it with a webservice, because i have other things i will need to do, like pass parameters..
What i need to know is, when creating a web service do i need to do anything to make it accessible to the public?
As far as I know you add the WebService attribute and make properties public. I have never built a web service but the examples I read seem pretty straight forward you basicly just add the attribute in the right places. Sorry thats all I know.

Web Service created using 2003/2005 then access using PHP

We are having issues using a Web Service created in 2003/2005 when writing a PHP web app.
Is there anything special that needs to be done to allow PHP to use .NET web services?
WokaThe rrr we are getting is "request format is unrecognized"
Woka
You need to find the machine.config file on the web server and edit it and unremark the Post and Get bits.

<Protocols>
<add name="HttpSoap1.2"/>
<add name="HttpSoap"/>
<!--<add name="HttpPost"/>-->
<!--<add name="HttpGet"/>-->
<add name="HttpPostLocalhost" />
<add name="Documentation"/>
</protocols>

Thanks to Mike Hilder for this.
http://www.vbforums.com/showthread.php?t=283207

Woka
If you want,

SOAP for PHP (pear.php.net/package/SOAP)

Saturday, March 24, 2012

Web Service giving The data at the root level is invalid error

I created a web service in visual studio 2003, tested it with a sample.xml
file from a vendor we are using, and it worked exactly like it should. I
depoloyed it to our server, created a project calling the webservice with
the sample.xml file, and again it worked. Now the vendor is calling the web
service from their application and receiving the following error, and stating
that there is something with the Web Service or the SOAP Client on my end
that is expecting the data differently then what it is :

?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. --The data at the root
level is invalid. Line 1, position 1.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>

Any suggestions?"jmgro" <jmgro@.discussions.microsoft.comwrote in message
news:79C7CF1C-7888-4EBD-B508-57ADE1F47799@.microsoft.com...

Quote:

Originally Posted by

>I created a web service in visual studio 2003, tested it with a sample.xml
file from a vendor we are using, and it worked exactly like it should. I
depoloyed it to our server, created a project calling the webservice with
the sample.xml file, and again it worked. Now the vendor is calling the
web
service from their application and receiving the following error, and
stating
that there is something with the Web Service or the SOAP Client on my end
that is expecting the data differently then what it is :
>
?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. --The data at the
root
level is invalid. Line 1, position 1.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
>
>
Any suggestions?


Line 1, position 1 is the first character of the data. I suspect they aren't
sending any data, or are sending it in the wrong XML namespace.

You should use your favorite network monitoring tool to see the exchange
between the client and server, then look at it and see how it differs from
your expectations.
--
John Saunders [MVP]
They state that something in my environment is stripping the xml, so that is
why I am receiving it incorrectly. My web service is running on Windows
Server 2003, my IIS version is 6.0.

"John Saunders [MVP]" wrote:

Quote:

Originally Posted by

"jmgro" <jmgro@.discussions.microsoft.comwrote in message
news:79C7CF1C-7888-4EBD-B508-57ADE1F47799@.microsoft.com...

Quote:

Originally Posted by

I created a web service in visual studio 2003, tested it with a sample.xml
file from a vendor we are using, and it worked exactly like it should. I
depoloyed it to our server, created a project calling the webservice with
the sample.xml file, and again it worked. Now the vendor is calling the
web
service from their application and receiving the following error, and
stating
that there is something with the Web Service or the SOAP Client on my end
that is expecting the data differently then what it is :

?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. --The data at the
root
level is invalid. Line 1, position 1.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>

Any suggestions?


>
Line 1, position 1 is the first character of the data. I suspect they aren't
sending any data, or are sending it in the wrong XML namespace.
>
You should use your favorite network monitoring tool to see the exchange
between the client and server, then look at it and see how it differs from
your expectations.
--
John Saunders [MVP]
>
>
>

Web Service giving The data at the root level is invalid error

I created a web service in visual studio 2003, tested it with a sample.xml
file from a vendor we are using, and it worked exactly like it should. I
depoloyed it to our server, created a project calling the webservice with
the sample.xml file, and again it worked. Now the vendor is calling the web
service from their application and receiving the following error, and statin
g
that there is something with the Web Service or the SOAP Client on my end
that is expecting the data differently then what it is :
?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. --> The data at the root
level is invalid. Line 1, position 1.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
Any suggestions?"jmgro" <jmgro@.discussions.microsoft.com> wrote in message
news:79C7CF1C-7888-4EBD-B508-57ADE1F47799@.microsoft.com...
>I created a web service in visual studio 2003, tested it with a sample.xml
> file from a vendor we are using, and it worked exactly like it should. I
> depoloyed it to our server, created a project calling the webservice with
> the sample.xml file, and again it worked. Now the vendor is calling the
> web
> service from their application and receiving the following error, and
> stating
> that there is something with the Web Service or the SOAP Client on my end
> that is expecting the data differently then what it is :
> ?xml version="1.0" encoding="utf-8"?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <soap:Body>
> <soap:Fault>
> <faultcode>soap:Server</faultcode>
> <faultstring>Server was unable to process request. --> The data at the
> root
> level is invalid. Line 1, position 1.</faultstring>
> <detail />
> </soap:Fault>
> </soap:Body>
> </soap:Envelope>
>
> Any suggestions?
Line 1, position 1 is the first character of the data. I suspect they aren't
sending any data, or are sending it in the wrong XML namespace.
You should use your favorite network monitoring tool to see the exchange
between the client and server, then look at it and see how it differs from
your expectations.
--
John Saunders [MVP]
They state that something in my environment is stripping the xml, so that is
why I am receiving it incorrectly. My web service is running on Windows
Server 2003, my IIS version is 6.0.
"John Saunders [MVP]" wrote:

> "jmgro" <jmgro@.discussions.microsoft.com> wrote in message
> news:79C7CF1C-7888-4EBD-B508-57ADE1F47799@.microsoft.com...
> Line 1, position 1 is the first character of the data. I suspect they aren
't
> sending any data, or are sending it in the wrong XML namespace.
> You should use your favorite network monitoring tool to see the exchange
> between the client and server, then look at it and see how it differs from
> your expectations.
> --
> John Saunders [MVP]
>
>

web service issue

hi all
I created a web service with one web method:
<WebMethod()> Public Function RequestPremium(ByVal web_request As
XmlDocument) As XmlDocument
it basically accepts a xmldocument then queries a database and returns
results in a xmldocument
I've confirmed that the code in the web method works, it fails when
the web method tries to return the new xmldocument:
last couple of lines in web method...
o_xmlreturn.Save("C:\temp\WS.xml") ' this works, xmldocument has
data and saves to the web server in c:temp
RequestPremium = o_xmlreturn ' this fails when it returns back to
calling program
my calling program is just a test windows vb.net app. the calling
lines are
ws_webservice = New WebService.POCservice ' web reference
ws_webservice.Credentials = New System.Net.NetworkCredential("user",
"pwd", "domain")
xml_return = ws_WIS_webservice.RequestPremium(xml_send)
error message in calling program is:
"system.invalidcastexception: specified cast is not valid"
can you return a xmldocument in a web service? I passed one and it
worked fine, just won't return it
any help would be appreciated. thanksIf I recall correctly, it will be happier returning an XmlNodeList or
XmlDocumentFragment. Try that.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com
"esource" wrote:

> hi all
> I created a web service with one web method:
> <WebMethod()> Public Function RequestPremium(ByVal web_request As
> XmlDocument) As XmlDocument
> it basically accepts a xmldocument then queries a database and returns
> results in a xmldocument
> I've confirmed that the code in the web method works, it fails when
> the web method tries to return the new xmldocument:
> last couple of lines in web method...
> o_xmlreturn.Save("C:\temp\WS.xml") ' this works, xmldocument has
> data and saves to the web server in c:temp
> RequestPremium = o_xmlreturn ' this fails when it returns back to
> calling program
> my calling program is just a test windows vb.net app. the calling
> lines are
> ws_webservice = New WebService.POCservice ' web reference
> ws_webservice.Credentials = New System.Net.NetworkCredential("user",
> "pwd", "domain")
> xml_return = ws_WIS_webservice.RequestPremium(xml_send)
> error message in calling program is:
> "system.invalidcastexception: specified cast is not valid"
> can you return a xmldocument in a web service? I passed one and it
> worked fine, just won't return it
> any help would be appreciated. thanks
>
"esource" <darrenpaul@.shaw.ca> wrote in message
news:1186000686.219397.65420@.l70g2000hse.googlegroups.com...
> hi all
> I created a web service with one web method:
> <WebMethod()> Public Function RequestPremium(ByVal web_request As
> XmlDocument) As XmlDocument
> it basically accepts a xmldocument then queries a database and returns
> results in a xmldocument
> I've confirmed that the code in the web method works, it fails when
> the web method tries to return the new xmldocument:
> last couple of lines in web method...
> o_xmlreturn.Save("C:\temp\WS.xml") ' this works, xmldocument has
> data and saves to the web server in c:temp
> RequestPremium = o_xmlreturn ' this fails when it returns back to
> calling program
> my calling program is just a test windows vb.net app. the calling
> lines are
> ws_webservice = New WebService.POCservice ' web reference
> ws_webservice.Credentials = New System.Net.NetworkCredential("user",
> "pwd", "domain")
> xml_return = ws_WIS_webservice.RequestPremium(xml_send)
> error message in calling program is:
> "system.invalidcastexception: specified cast is not valid"
> can you return a xmldocument in a web service? I passed one and it
> worked fine, just won't return it
> any help would be appreciated. thanks
You say that the exception is in the calling code, yet you posted the code
of the service. Did you look at the calling code (that is, at the proxy
class)?
If you look at your proxy class (Reference.vb usually), you'll see that the
proxy method returns XmlNode, not XmlDocument.
--
John Saunders [MVP]
On Aug 1, 5:34 pm, "John Saunders [MVP]" <john.saunders at
trizetto.com> wrote:
> "esource" <darrenp...@.shaw.ca> wrote in message
> news:1186000686.219397.65420@.l70g2000hse.googlegroups.com...
>
>
>
>
>
>
>
> You say that the exception is in the calling code, yet you posted the code
> of the service. Did you look at the calling code (that is, at the proxy
> class)?
> If you look at your proxy class (Reference.vb usually), you'll see that th
e
> proxy method returns XmlNode, not XmlDocument.
> --
> John Saunders [MVP]- Hide quoted text -
> - Show quoted text -
thanks both of you.
Your right, I checked the web reference in my calling program in
reference.vb and the implementation was xmlnode even though I declared
it as xmldocument in my web service. I changed it and it worked.
thanks again

Web Service Problem

Hi, i created a web service and i published it, and i created a client. when the client calls the web service for the firs time everything is ok, but when the client calls the service for the second time the service is not responding, can someone help me please.On the second time, does it time out? Give an error? What happens?

How does the client call your web service?
I think it does time out. It can't find the service. the client calls the service through an instance of the service in client code
Can you put up some of your code from the client calling the webservice.

It could be something as simple as you missing the 'New' keyword when creating an object of the webservice. At least i think I had that problem when I initially started and I think that's what the solution was.

Web Service problem

I am using a web service that (given a zip code and a radius) returns movie theaters and movies with times. I have created the reference and coded the following:

Dim Theatre1As com.ignyte.www.MovieInformation =New com.ignyte.www.MovieInformation

Dim theatre2As com.ignyte.www.Theater =Theatre1.GetTheatersAndMovies(txtbxZip.Text, txtbxRadius.Text)

with the underlined area I get the error message: c:\inetpub\wwwroot\JohnHathcock_Unit5IP\WebForm1.aspx.vb(37): Value of type '1-dimensional array .com.ignyte.www.Theater' cannot be converted to .com.ignyte.www.Theater'.
Thanks in advance for your help in this matter.
John Hathcock

The web service is returning an array. Your variable declaration should read
Dim theatre2() As com.ignyte.www.Theater = Theatre1.xxx


That corrected that problem, but now I am having trouble posting the results. Here is what I have:
I did have lstbxtheatre.items.clear()
lstbxTheatre.Items.add(theatre2.Name)
lstbxTheatre.Items.add(theatre2.Address)

'display results

lstbxTheatre.Items.Clear()

lstbxTheatre.Items.Add(theatre2 Name)
and I get this message: 'Name' is not a member of 'System.Array'.

thanks again for your help.
John


Having returned an array of objects, you need to specify which array element you want.

The first one is theatre2(0).Name, the next one will be theatre2(1).Name, etc.


I did that and now I get the error of:

Input string was not in a correct format
The code is as follows:

Dim Theatre1As com.ignyte.www.MovieInformation =New com.ignyte.www.MovieInformation

Dim theatre2()As com.ignyte.www.Theater = Theatre1.GetTheatersAndMovies(txtbxZip.Text, txtbxRadius.Text)

Dim IAsInteger

For I = 0To theatre2.Length - 1

Next

'display results

lstbxTheatre.Items.Clear()

lstbxTheatre.Rows = (theatre2(0).Name)<--Error begins here

lstbxTheatre.Items.Add(theatre2(0).Address)

lstbxTheatre.Items.Add(theatre2(1).Name)

lstbxTheatre.Items.Add(theatre2(1).Address)

Web service protection and patents.

Hi I was wondering how are called the folders, which are created dynamically by VS and begins with "App_". Are they protected and secure enough to hide some classes? I was thinking to make some Web Services also, but to make them protected I have to do it by my self or there is already a way? And it is possible to copyright a class?

They are called application folders. Their content, except for App_Themes, is not served as response web requests, but if you look for protecting the code e.g the sources (intellectual stuff) using those folders is not the way. Instead you should then build the source code into a dll which is deployed to bin folder of the application.

More about the App_ folders:http://msdn2.microsoft.com/en-us/library/ex526337.aspx

Thursday, March 22, 2012

Web Service SOAP Question

i have created a web service with one method which returns a code. i
am currently trying to access the return value of this method through
a page which has not got the proxy.dll referenced. i.e. as if this
request is from an external company. at the moment my method is
returning the whole SOAP return message as a string. 2 questions
please:

1. how do i just get the value of the node CLIENTCODE. this is the
return parameter of my web service method so this is all i am
interested in, not the whole SOAP message.

2. my code below does not use the SoapExtension class. is my code
below wrong? is there a better way to send and receive data using
SOAP?

here is my method:

XmlDocument doc = new XmlDocument();
doc.Load(xmlfile);
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create(@dotnet.itags.org."http://localhost/test/webservicebridge/bridgeservice.asmx");
if (proxy != null)
req.Proxy = new WebProxy(proxy, true);
req.Headers.Add("SOAPAction",
@dotnet.itags.org."http://localhost/webservices/GetClientCode");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
string s = (r.ReadToEnd());You're going to a lot of unnecessary trouble here. The .Net platform has
built-in functionality for consuming Web Services. Basically, a Web Service
is a remote method call. A .Net method returns an object, whether that
object is a string, an integer, a class, or any other data type. In other
words, a Web Service returns an object in the same way that any other method
returns an object. The only difference is that the return value of a Web
Method is serialized. You de-serialize it back into an object. However, the
..Net framework has built-in functionality for doing this transparently. The
following is an MSDN article which demonstrates consuming a DataSet from a
Web Service. Note, however, that the return type isn't important. The
methodology is the same:

http://msdn.microsoft.com/library/d...mwebservice.asp

If you have Visual Studio.Net, creating your proxy is rather simple to do as
well. It is done by adding a Web Reference to your References. Visual
Studio.Net will build the proxy for you.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Wee Bubba" <martinthrelly@.yahoo-dot-com.no-spam.invalid> wrote in message
news:412620e3$1_1@.Usenet.com...
> i have created a web service with one method which returns a code. i
> am currently trying to access the return value of this method through
> a page which has not got the proxy.dll referenced. i.e. as if this
> request is from an external company. at the moment my method is
> returning the whole SOAP return message as a string. 2 questions
> please:
> 1. how do i just get the value of the node CLIENTCODE. this is the
> return parameter of my web service method so this is all i am
> interested in, not the whole SOAP message.
> 2. my code below does not use the SoapExtension class. is my code
> below wrong? is there a better way to send and receive data using
> SOAP?
> here is my method:
> XmlDocument doc = new XmlDocument();
> doc.Load(xmlfile);
> HttpWebRequest req = (HttpWebRequest)
WebRequest.Create(@."http://localhost/test/webservicebridge/bridgeservice.asm
x");
> if (proxy != null)
> req.Proxy = new WebProxy(proxy, true);
> req.Headers.Add("SOAPAction",
> @."http://localhost/webservices/GetClientCode");
> req.ContentType = "text/xml;charset=\"utf-8\"";
> req.Accept = "text/xml";
> req.Method = "POST";
> Stream stm = req.GetRequestStream();
> doc.Save(stm);
> stm.Close();
> WebResponse resp = req.GetResponse();
> stm = resp.GetResponseStream();
> StreamReader r = new StreamReader(stm);
> string s = (r.ReadToEnd());
"Wee Bubba" <martinthrelly@.yahoo-dot-com.no-spam.invalid> wrote in message
news:412620e3$1_1@.Usenet.com...

> here is my method:

Aren't you using Visual Studio? If you are, there's really no need for you
to do any of this, as it's all taken care of for you...

Web Service SOAP Question

i have created a web service with one method which returns a code. i
am currently trying to access the return value of this method through
a page which has not got the proxy.dll referenced. i.e. as if this
request is from an external company. at the moment my method is
returning the whole SOAP return message as a string. 2 questions
please:
1. how do i just get the value of the node CLIENTCODE. this is the
return parameter of my web service method so this is all i am
interested in, not the whole SOAP message.
2. my code below does not use the SoapExtension class. is my code
below wrong? is there a better way to send and receive data using
SOAP?
here is my method:
XmlDocument doc = new XmlDocument();
doc.Load(xmlfile);
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create(@dotnet.itags.org."http://localhost/test/webservicebridge/bridgeservice.asm
x");
if (proxy != null)
req.Proxy = new WebProxy(proxy, true);
req.Headers.Add("SOAPAction",
@dotnet.itags.org."http://localhost/webservices/GetClientCode");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
string s = (r.ReadToEnd());You're going to a lot of unnecessary trouble here. The .Net platform has
built-in functionality for consuming Web Services. Basically, a Web Service
is a remote method call. A .Net method returns an object, whether that
object is a string, an integer, a class, or any other data type. In other
words, a Web Service returns an object in the same way that any other method
returns an object. The only difference is that the return value of a Web
Method is serialized. You de-serialize it back into an object. However, the
.Net framework has built-in functionality for doing this transparently. The
following is an MSDN article which demonstrates consuming a DataSet from a
Web Service. Note, however, that the return type isn't important. The
methodology is the same:
http://msdn.microsoft.com/library/d...mwebservice.asp
If you have Visual Studio.Net, creating your proxy is rather simple to do as
well. It is done by adding a Web Reference to your References. Visual
Studio.Net will build the proxy for you.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Wee Bubba" <martinthrelly@.yahoo-dot-com.no-spam.invalid> wrote in message
news:412620e3$1_1@.mcse.ms...
> i have created a web service with one method which returns a code. i
> am currently trying to access the return value of this method through
> a page which has not got the proxy.dll referenced. i.e. as if this
> request is from an external company. at the moment my method is
> returning the whole SOAP return message as a string. 2 questions
> please:
> 1. how do i just get the value of the node CLIENTCODE. this is the
> return parameter of my web service method so this is all i am
> interested in, not the whole SOAP message.
> 2. my code below does not use the SoapExtension class. is my code
> below wrong? is there a better way to send and receive data using
> SOAP?
> here is my method:
> XmlDocument doc = new XmlDocument();
> doc.Load(xmlfile);
> HttpWebRequest req = (HttpWebRequest)
>
WebRequest.Create(@."http://localhost/test/webservicebridge/bridgeservice.asm
x");
> if (proxy != null)
> req.Proxy = new WebProxy(proxy, true);
> req.Headers.Add("SOAPAction",
> @."http://localhost/webservices/GetClientCode");
> req.ContentType = "text/xml;charset=\"utf-8\"";
> req.Accept = "text/xml";
> req.Method = "POST";
> Stream stm = req.GetRequestStream();
> doc.Save(stm);
> stm.Close();
> WebResponse resp = req.GetResponse();
> stm = resp.GetResponseStream();
> StreamReader r = new StreamReader(stm);
> string s = (r.ReadToEnd());
>
"Wee Bubba" <martinthrelly@.yahoo-dot-com.no-spam.invalid> wrote in message
news:412620e3$1_1@.mcse.ms...

> here is my method:
Aren't you using Visual Studio? If you are, there's really no need for you
to do any of this, as it's all taken care of for you...

web services

I have created some simple web services.

How can I access these from my web page code?

Any examples would be great, thanksnevermind found some samples.

check this out http://www.devcity.net/net/article.aspx?cid=8&y=2002&m=3&d=19

Monday, March 12, 2012

web services and ajax

I have created a web service on my local machine and left if alone
(HelloWorld) (vb.net)
Below is the code for the declarative portion:
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx"
/>
</Services>
</asp:ScriptManager>
<div>
<input id="Button1" onclick="GetMe()" type="button"
value="button" />
</div>
</form>
Following is the code for the javascript and the onclick
<script type="text/javascript">
function GetMe()
{
alert(WebService.HelloWorld());
}
</script>
When I run this program it aborts with the message WebService is undefined.
Would like some advice as to what is missing.
thanksHave found the answer you must have the following to describe your web servi
ce
<WebService(Namespace:="http://tempuri.org/")> _
< WebServiceBinding(ConformsTo:=WsiProfile
s.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Script.Services.ScriptService()> _
"barry" wrote:

> I have created a web service on my local machine and left if alone
> (HelloWorld) (vb.net)
> Below is the code for the declarative portion:
> <form id="form1" runat="server">
> <asp:ScriptManager ID="ScriptManager1" runat="server">
> <Services>
> <asp:ServiceReference Path="WebService.asmx
"
> />
> </Services>
> </asp:ScriptManager>
> <div>
> <input id="Button1" onclick="GetMe()" type="button"
> value="button" />
> </div>
> </form>
> Following is the code for the javascript and the onclick
> <script type="text/javascript">
> function GetMe()
> {
> alert(WebService.HelloWorld());
> }
> </script>
> When I run this program it aborts with the message WebService is undefined
.
> Would like some advice as to what is missing.
> thanks
>
>

web services and ajax

I have created a web service on my local machine and left if alone
(HelloWorld) (vb.net)
Below is the code for the declarative portion:

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx"
/>
</Services>
</asp:ScriptManager>
<div>
<input id="Button1" onclick="GetMe()" type="button"
value="button" />
</div>
</form>

Following is the code for the javascript and the onclick

<script type="text/javascript">
function GetMe()
{
alert(WebService.HelloWorld());
}
</script>

When I run this program it aborts with the message WebService is undefined.
Would like some advice as to what is missing.

thanksHave found the answer you must have the following to describe your web service

<WebService(Namespace:="http://tempuri.org/")_
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicPro file1_1)_
<Global.Microsoft.VisualBasic.CompilerServices.Desi gnerGenerated()_
<Script.Services.ScriptService()_

"barry" wrote:

Quote:

Originally Posted by

I have created a web service on my local machine and left if alone
(HelloWorld) (vb.net)
Below is the code for the declarative portion:
>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx"
/>
</Services>
</asp:ScriptManager>
<div>
<input id="Button1" onclick="GetMe()" type="button"
value="button" />
</div>
</form>
>
Following is the code for the javascript and the onclick
>
<script type="text/javascript">
function GetMe()
{
alert(WebService.HelloWorld());
}
</script>
>
When I run this program it aborts with the message WebService is undefined.
Would like some advice as to what is missing.
>
thanks
>
>
>

Web Services From Other Langs

Hi Guys,
I've created a webservice using ASP.Net and .Net framework,
I built the web service code, and then a proxy class to produce a .dll file , then I copied this file to the /bin directory...and it should be available to ASP.Net pages..
But my question is, How could I use this DLL in other languages, like php or perl...how could I call a web service method through
the dll proxy class from Non-.Net languages? ??

thanks.:) :confused:you dont.
so, Should I just expose my WSDL file to others, and they should take care of how to call my webservice ?? as they know the actual webservice url and methods from the wsdl ?
Sorry ..misread your post a bit. If the other language supports SOAP then you can reference and use the web service...but you cant use the same wrapper dll that is created when you ref a web service in .NET. Im sure other SOAP implementation have there way of creating 'wrappers' or whatever. You need to refer to whomever makes a SOAP implementatino for other platforms for any more help.
thanks Cander for help,
I installed the SOAP SDK , and I will play with it...