sexta-feira, março 18, 2005

DataSet - Transformar XML vindo de um WebService em DATASET

Transformar XML vindo do WebService em DATASET:

Dim objmyDS As New DataSet
Dim myXml As New XmlDataDocument
myXml.LoadXml(objTransactionManagerRef.GetClientFavorites(idClient).OuterXml())
objmyDS.ReadXml(New XmlNodeReader(myXml.DocumentElement))

quinta-feira, março 17, 2005

Authentication for web services

"I recently put up a few web services for a client of mine, which returned some sensitive data. I needed to find a simple way to authenticate the users of these web services. This is the approach I took."

Aqui fica o Link para o documento integral:
http://www.codeproject.com/cs/webservices/
authforwebservices.asp


Outra possível solução:

Quando o WSE 2 ainda estava em versao beta eu construiu um esquema para um projecto que tinha em maos na altura. depois o projecto foi cancelado e acabei por nao utilizar a framework na pratica. Da uma olhadela ao codigo. A grande vantagem residia na facilidade configuracao e utilizacao se a comunicacao fosse de .Net para .Net. Pode ser que ajude.

Aqui fica o Link para o documento integral:
http://www.pontonetpt.com/Artigos/209.aspx

Overloading for WebMethods

MessageName
===========
This property useful when we want overloading the WebMethods.

For Example

< WebMethod() > _
Public Function SayHello(ByVal sName As String) As String
Return "Hi" & " " & sName
End Function

< WebMethod(MessageName:="SayHello") > _
Public Function SayHello()As String
Return "Hi Ragavan"
End Function


Restante artigo:
http://www.c-sharpcorner.com/
WebForms/WebServicesP3RSR.asp

quarta-feira, março 16, 2005

Sql Server 2005 - Tech Briefings

Are you planning new database development projects this year? Do you need to increase the scale, performance, security or continuous availability of your existing systems to meet the demands of the business? Microsoft SQL Server 2005 is on its way, bringing significant enhancements in performance, availability, security and the most powerful and flexible set of DBA productivity tools we have ever delivered. Using interactive presentations and live product demos, we will walk you through all the major features and enhancements built into SQL Server 2005 to give you a head start in your plans to bring these benefits to your organization. Topics covered will include SQL Server 2005 management tools, security enhancements, high availability features, replication, and scalability.

We will continue to add deeper and more comprehensive information as the product nears release, so please check back regularly for new and exciting SQL Server 2005 webcasts.


http://www.microsoft.com/events/series/
technetsqlserver2005.mspx

segunda-feira, março 14, 2005

Getting Directory Contents List

Dim strBaseXmlDIR = ConfigurationSettings.AppSettings("BaseXmlDIR")
Dim strXMLFileName As String

Dim objDirectoryInfo As New IO.DirectoryInfo(strBaseXmlDIR)
Dim objFileInfo As IO.FileInfo() = objDirectoryInfo.GetFiles()
Dim objFileInfoElement As IO.FileInfo

For Each objFileInfoElement In objFileInfo
strXMLFileName = strBaseXmlDIR + "\" + objFileInfoElement.ToString()
ListBox1.Items.Add(strXMLFileName)
Next

Best or possible way to return XML from WebServices

Para retornar XML num web service:

< WebMethod(Description:="This method Gets Data") > _
Public Function GetData(ByVal intParameter As Integer) As XmlDataDocument
Dim myXml As New XmlDataDocument
myXml.LoadXml("Data to Return")
return myXml
End Function

Como obter os valores desse XML:
Dim myXml As New XmlDataDocument
myXml.LoadXml(WebService.GetData(intParameter).OuterXml())

Como obter os valores desse XML num só ramo:
Dim myXml As New XmlDataDocument
Dim strRet As String = ""
If (myXml.Item("EquipmentDataList").HasChildNodes()) Then
strRet = myXml.LastChild("Father").Item("Child").InnerText
end if

Para dúvidas peçam ajuda
Paulo A. J. Pires

quarta-feira, março 09, 2005

WebServices: INFO: HTTP GET and HTTP POST Are Disabled by Default

INFO: HTTP GET and HTTP POST Are Disabled by Default

This article discusses changes in the .NET Framework 1.1 that affect the HTTP GET method and the HTTP POST method on a Web server. This article also describes workarounds for this new functionality.

The .NET-connected Web services support HTTP GET, HTTP POST and SOAP protocols. By default, in .NET Framework 1.0, all three protocols are enabled. By default, in .NET Framework 1.1, HTTP GET and HTTP POST are both disabled. This is for security reasons.

http://support.microsoft.com/default.aspx?scid=kb;en-us;819267

segunda-feira, março 07, 2005

How to Enable Remote Debugging on Windows XP Service Pack 2

Windows XP Service Pack 2 introduces a number of security enhancements that increase security in Microsoft Windows. This document outlines the steps that you need to take in order to enable remote debugging on a Windows XP Service Pack 2 machine. (10 printed pages)

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnwxp/html/xpsp2remotedebug.asp

MSDN Technical Briefing

No último evento MSDN do ano encontramos um conjunto de 4 novas sessões que nos ilustram como estender a plataforma e boas práticas no desenvolvimento de aplicações. A primeira sessão mostra-nos com é possível estender o modelo de processamento de páginas ASP.NET. Saiba como implementar segurança nos serviços Web com WS-Security, que faz parte da implementação de Web Services Enhancements 2.0. Para melhorar o desenvolvimento das soluções veja como tirar partido do debugger do Visual Studio.NET e saiba ainda como fazer deployment das suas aplicações a actualizá-las automaticamente.

http://www.microsoft.com/portugal/msdn/eventos/
TBNovembro/default.aspx

sexta-feira, março 04, 2005

Accessing OLAP using ASP.NET - Creating a .NET Web Application to Access OLAP

This sample web application uses the existing demonstration database named “Foodmart 2000”, which gets automatically installed by SQL Server 2000 Analysis Services (please refer to the previous topic).

http://www.aspfree.com

Accessing Sql Server Datawarehouses Over the Web.

Este documento pode ajudar e muito a fazer o acesso a Olaps via WEB.
Fica aqui o Link: Documento integral em PDF

quarta-feira, março 02, 2005

.NET Framework - TimeSpan

Pessoal, para jogar com datas aqui está uma hipotese

The value of an instance of TimeSpan represents a period of time. That value is the number of ticks contained in the instance and can range from Int64.MinValue to Int64.MaxValue. A tick is the smallest unit of time that can be specified, and is equal to 100 nanoseconds. Both the specification of a number of ticks and the value of a TimeSpan can be positive or negative.
A TimeSpan can be represented as a string in the format "[-]d.hh:mm:ss.ff" where "-" is an optional sign for negative TimeSpan values, the "d" component is days, "hh" is hours, "mm" is minutes, "ss" is seconds, and "ff" is fractions of a second. For example, a TimeSpan initialized to 1.0e+13 ticks represents "11.13:46:40", which is 11 days, 13 hours, 46 minutes, and 40 seconds.
Due to a varying number of days in months and years, the longest unit of time that is used by TimeSpan is the day.
This value type implements the IComparable interface.


http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/cpref/html/frlrfsystemtimespanclasstopic.asp

terça-feira, março 01, 2005

.NET Framework Tools - Installer Tool (Installutil.exe)

.NET Framework Tools - Installer Tool (Installutil.exe)

The Installer tool allows you to install and uninstall server resources by executing the installer components in a specified assembly. This tool works in conjunction with classes in the System.Configuration.Install Namespace.

URL: http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/cptools/html/cpconinstallerutilityinstallutilexe.asp

ASP.NET - PRB: Cannot Upload Large Files When You Use the HtmlInputFile Server Control

Pessoal, encontrei uma dificuldade no upload de ficheiros via .NET, que foi não passar ficheiros superiores a 4 Mb.
“PRB: Cannot Upload Large Files When You Use the HtmlInputFile Server Control”
Ao tentar fazer o upload dava um erro de “The Page Can Not Be Displayed”, ou seja, dava o erro do upload ser enorme e (erro 403), de seguida dava o erro de página não encontrada (404) pois eu não tinha definida a página para o erro 403.

Depois de pesquisar encontrei a solução: http://support.microsoft.com/default.aspx?
scid=kb;en-us;295626


SOLUÇÃO DO ERRO DO UPLOAD
=========================

c:\WINNT\Microsoft.NET\Framework\v1.1.4322\CONFIG
Filename: machine.config
< httpRuntime
executionTimeout="90"
maxRequestLength="819200"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
enableVersionHeader="true"
/>

Solução: Alterar o maxRequestLength para o valor necessário ou aceitável no meu caso passei o para 819200 (800 MB) e, testei com um ficheiro de 150 MB e passou, na tentativa de passar um ficheiro de 660 MB não passou, o que pode estar relacionado com a falta de memória no servidor, pois o maxRequestLength está limitado em 2 GB mas só aconselham usar 1 GB e esta memória é partilhada pelos processos de .NET a correr e a monitoria do serviço, por isso em determinados momentos pode ser bastante inferior a 1 GB.
Espero que possa ajudar no futuro a todos os que usem UPLOAD de ficheiros.

Directiva @Page em .NET

Dica sobre ASP.NET.
Como configurar a Directiva @Page. Podem ver por exemplo o AspCompact para aceder a DLLs em VB6 em .NET.

URL: http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/cpgenref/html/cpconPage.asp

ASP.NET - 10 Tips for Writing High-Performance Web Applications

Pessoal da Comunidade de Desenvolvimento para Backoffices,
No e-mail da Microsoft (newsletter) vinha este documento que pode ser interessante.
O URL:http://msdn.microsoft.com/msdnmag/issues/05/01/
ASPNETPerformance/default.aspx

ASP.NET 2.0 - Discovering the New Visual Basic 2005 Language Enhancements

Pessoal da Comunidade de Desenvolvimento para Backoffices,
No e-mail da Microsoft (newsletter) vinha este documento que pode ser interessante.

O URL é : http://msdn.microsoft.com/vstudio/default.aspx?pull=/library/en-us/dnhcvs04/html/vs04k1.asp

Acesso em Server Side a um outro ASPX que retorna valores

A solução para quem precisar no futuro:

Imports System.Net
Dim myRequest As HttpWebRequest
myRequest.Create(URL).GetResponse()

Uso da função RANDOM do SqlServer

Este é um exemplo de Store Procedure para criação de PIN/Password Aleatórios no SQL SERVER.
Experimentem:

- EXEC USP_CreateRandomPWD 0, 4 -> Exemplo para PIN 4 algarismos
- EXEC USP_CreateRandomPWD 1, 20 -> Exemplo para Password de 20 caracteres

A Store Procedure está no 1º Comentário...