Building dts/ssis from client system
Hi All,
Is there any way, we can build a dts/ssis package with custom tasks at client system and place the package to package files under datamanager folder on server, so that we can associate with a data manager package.
Any Help will be greatly appreciated,
kranthi
Hi,
look at this Guide this may help you.
There is also a small executable (
%Servername%%Volume$%BPCWebsrvrWebInstallation) to register the Tasks on a client machine (with BI Dev Studio installed) but i don't recommend to build the Package on an other machine than the Server.
On a client machine we had problems to use the debug functionality of SSIS Dev-Studio.
Regards
Jörg
Similar Messages
-
I NEED TO GET LOGIN AND LOGOUT TIMING DETAILS FROM CLIENT SYSTEMS
HI,
CAN ANYONE PLEASE HELP ME ON HOW TO GET LOGIN AND LOGOUT , CLIENT EVENT DETAILS FROM CLIENT SYSTEMS ON SERVER 2008 R2.
THANKS,
KUMAR.You may need to enable active directory Logon/Logoff Audit event.
The Audit logon events policy records all attempts to log on to the local computer, whether by using a domain account or a local account.
On Domain Controller, this policy records attempts to access the DC only.
By using these events we can track user's logon duration by mapping logon and logoff events with user's Logon ID which is unique between user's logon and logoff.
Please refer to this blog to understand the complete process to audit the successful or failed logon and logoff attempts in the network using the audit policies :
http://www.lepide.com/blog/audit-successful-logon-logoff-and-failed-logons-in-activedirectory/
Lepide - Simplifying IT Management -
Without using webutil how to read an image from client or own system
Hi,
I am trying to read image from my own system.
(if I click on button (browse) then it should open an dialog box then i can select image from it. then I press another button(save) it should be store in the database.)
So, i want read image without using webutil package how to do it.
If i want read image from client system please tell me how to do it.
I am getting with webutil package but there is any other chance to get the image.Please keep in mind that Forms 10g is a release not a version. Also, since you are running on Windows 7 64 bit - you should be using Forms 10g Release 2 (version 10.1.2.0.2) and a patchset to upgrade this to version 10.1.2.3.0.
Now, to answer your question - I happen to agree with MarkReichman, WebUtil would be my preferred method, but since you don't want to use WebUtil then the only other way would be to use a 3rd party Java Bean. I prefer WebUtil because it is supported by Oracle and I can contact them with any issues.
Craig... -
Pages not displaying images when accessed from remote system-error on page.
Urgent pls help...
Hi,
We installed 10G database and installed application express.
we installed apex using the command @apexins SYSAUX SYSAUX TEMP /i/
then changed password using @apxchpwd
then @apxldimg.sql D:\oraclexe
we installed databse in D:
in D:/oraclexe we copied apex folder and done the above operations.
we run the listener using command
java -Dapex.home=D:/oraclexe/apex -Dapex.images=D:/oraclexe/apex/apex/images -Dapex.port=8585 -jar D:/oraclexe/apex/apex.war
then for four days it was working fine,
our team can access pages from client system and we were working on our project.
But for the last two days it is not working properly. I mean apex is loading with errors(without images).
the page is showing without images and links are not working
just data's in pages is only seen.
But when i connect through localhost it is working properly.
we installed it on server then there also localhost:8080 is working
but from client system has the above said problem
Give us a solution...
Thanks in advance...
Edited by: 874343 on Jul 22, 2011 5:26 AMListenerAdmin is showing blank screen
this is my command prompt when running listener
D:\oraclexe>cd apex
D:\oraclexe\apex>java -Dapex.home=D:/oraclexe/apex -Dapex.images=D:/oraclexe/ape
x/apex/images -Dapex.port=8585 -jar D:/oraclexe/apex/apex.war
INFO: Starting: D:\oraclexe\apex\apex.war
See: 'java -jar apex.war --help' for full range of configuration options
INFO: Extracting to: D:\oraclexe\apex
INFO: Using classpath: file:/D:/oraclexe/apex/apex/____embedded/start.jar:file:/
D:/oraclexe/apex/apex/WEB-INF/lib/apex.jar:file:/D:/oraclexe/apex/apex/WEB-INF/l
ib/commons-fileupload-1.2.1.jar:file:/D:/oraclexe/apex/apex/WEB-INF/lib/je-4.0.1
03.jar:file:/D:/oraclexe/apex/apex/WEB-INF/lib/ojdbc6.jar:file:/D:/oraclexe/apex
/apex/WEB-INF/lib/ojmisc.jar:file:/D:/oraclexe/apex/apex/WEB-INF/lib/poi-3.6-200
91214.jar:file:/D:/oraclexe/apex/apex/WEB-INF/lib/ucp.jar:file:/D:/oraclexe/apex
/apex/WEB-INF/lib/xdb-11.2.0.jar:file:/D:/oraclexe/apex/apex/WEB-INF/lib/xmlpars
erv2-11.2.0.jar:
INFO: Starting Embedded Web Container in: D:\oraclexe\apex
Jul 22, 2011 6:48:19 PM ____bootstrap.Deployer deploy
INFO: Will deploy application path=D:\oraclexe\apex\apex\WEB-INF\web.xml
Jul 22, 2011 6:48:19 PM ____bootstrap.Deployer deploy
INFO: deployed application path=D:\oraclexe\apex\apex\WEB-INF\web.xml
Using config file: D:\oraclexe\apex\apex-config.xml
-- listing properties --
PropertyCheckInterval=60
ValidateConnection=true
MinLimit=1
MaxLimit=10
InitialLimit=3
AbandonedConnectionTimeout=900
MaxStatementsLimit=10
InactivityTimeout=1800
MaxConnectionReuseCount=1000
APEX Listener version : 1.1.2.131.15.23
APEX Listener server info: Grizzly/1.9.18-o
Jul 22, 2011 6:48:44 PM com.sun.grizzly.Controller logVersion
INFO: Starting Grizzly Framework 1.9.18-o - Fri Jul 22 18:48:44 IST 2011
INFO: http://localhost:8585/apex started.
Using JDBC driver: Oracle JDBC driver version: 11.2.0.2.0
Edited by: 874343 on Jul 22, 2011 6:42 AM
Edited by: 874343 on Jul 22, 2011 6:51 AM -
Transfer data by idoc between different client system
Hi
i want exemple to transfer any data from client system (800) to another 810.
havve anyone exemple to do this.
thinkshello friend,
we have 5 diff ways ok sending data from one sys to another which method the reqmnet is ...
but any method we need do some confrigaration for that
we need create idoc segments(WE31)),idoc types(WE30),messages types(WE81),
if u want clear on this go for tcode WEDI->Deveplopmwent-> u fill find the tcodes and process in that tcode.
5 diff types
sending data 1) using tcode,
2) using FM
3) using messages types
remining im not remember correctly check it...
thk u
santhosh -
File Transfer From Unix server to Windows Client System Using WebUtil
Hi all,
I want to Transfer a File from Unix Server to Window Client System using Webutil. But below mention code is not working.
DECLARE
V_Server_Path VARCHAR2(500) := Null;
V_Client_Path VARCHAR2(500) := Null;
BEGIN
V_Server_Path := '/proj/oraapps/viper/dev/reports/cache/Saveauftr.txt';
V_Client_Path := 'C:\Migration\EU_Applications\Lima\OAS_WorkArea\Client\Saveauftr.txt';
IF WebUtil_File_Transfer.Is_AS_Readable(V_Server_Path) THEN
IF WebUtil_File_Transfer.AS_To_Client(V_Client_Path,V_Server_Path) THEN
Message('Downloading the File ..... .... ... .. .');
Message('Downloading Was Successfull ...');
Message('File Transfer from Server Was Successfull ...');
END IF;
END IF;
END;
Can anyone suggest me,Why the above code is not working and what to do for solve the Problem.
Regards
GanyHello,
You have more chances to get an answer in the Oracle Forms OTN Forum :
Forms
Regards -
Is it posssible to lunch one application from the client system using JSP
Is it possible to Lunch one application from the client system using JSP or Servlet .If it is possible then how can we do that ?
Thanks in advance
SilIf its a java application - yes. You can use jnlp and web start.
ram. -
How to get the system property - user.name from a client system
Hi All,
I have an application which would enable active users from the domain of the company. I want to get the name of the client from the system. I tried to run it on the local machine from Jdeveloper, it returned me the correct user name. But when the application is deployed on the Oracle Application server, and i hit the URL of the application, it returns the server URL.
I understand that the JSP works on the server side here but help me out to get a solution. I want to read the user name from the client side.
Thanks in advance!
AkhilAkhil,
I hope this will never work. Think about your requirement for a second....
This would mean an application is able to see my user credentials without my knowledge. It's bad enough the know my IP if I'm not using TOR.
To get your requirement to work you have to redefine it a bit. The user have to log in to your application. The application holds the name together with an ID of the session to know the user in further requests.
Thats a basic security theme, described in the dos [Adding Security to a Fusion Web Application|http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/adding_security.htm] .
Timo -
Unable to connect to SMC Client system from SMC Server System
hi,
i have installed SMC 3.6.1. on Solaris 10 OS . The SMC agents are installed are all system but SMC Server is unable to communicate with Client systems. SMC Server System can Ping and Telnet all the SMC Client systems , but unable to connect from SMC .
Please guide how can resolve this problem
best regards,
Adeel MehmoodHi Adeel,
i have installed SMC 3.6.1. on Solaris 10 OS . The
SMC agents are installed are all system but SMC
Server is unable to communicate with Client systems.
SMC Server System can Ping and Telnet all the SMC
Client systems , but unable to connect from SMC .
Please guide how can resolve this problemSo, you can login to SunMC, but you're unable to make an icon for any of your Agents? Or you have icons you made bofre but when you click on them now you get errors?
If these are new Agents, do they have more than one netowrk interface? If so, they may have security information for the "other" network (the one the SunMC Server's not on). You can try manully specifying the correct network for one Agent and see if it helps:
http://forums.halcyoninc.com/showthread.php?t=2
Regards,
[email protected]
http://www.HalcyonInc.com
!! New !! : http://forums.HalcyonInc.com -
How to create a SSIS package to delete word documents from local system
Hi All,
How to create a small SSIS package to delete word documents from local system. Word documents might be one or two weeks ago.
Thanks in advance for your help.Dim filename As System.IO.FileSystemInfo
filename = My.Computer.FileSystem.GetFileInfo("c:\temp.doc")
If (Now.DayOfYear - filename.CreationTime.DayOfYear) > 3 Then
'filename.Delete()
End If
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Access to Oracle Database by a specific user from a client system.
Hi All,
I need to restrict a particular client system to access the database only by a specific user credentials. I mean system A(hostname) can only connect the database PQR only and only by user U123. Any help is sincerely appreciated.
Regards
SwapanHi,
I solved it by a trigger at logon on V$SESSION which validates MACHINE like [HOSTNAME] and username not like [the_user_I_would_allow].
It works now.
Thanks for your reply.
Regards
Swapan -
Error while deleting DC from client
In NetWeaver Developer Studio, while i try to remove a Development Component from Client using Delete option, I get the following error. I have synched the DC, built it and deployed + ran it once. However, there are no open activities. This happens for some DCs sometimes, but not always. Any help/inputs/suggestions will be appreciated.
Thanks in advance.
Here are the error details
<i><i>Error: Action failed.
Problems encountered while deleting resources.
org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources.
at org.eclipse.core.internal.resources.Resource.delete(Resource.java:656)
at org.eclipse.core.internal.resources.Project.delete(Project.java:288)
at com.sap.ide.eclipse.component.provider.actions.dcproject.DeleteProjectActionImpl.run(DeleteProjectActionImpl.java:80)
at com.sap.ide.eclipse.component.provider.actions.dc.AbstractDcMultiAction$1.run(AbstractDcMultiAction.java:127)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
at com.sap.ide.eclipse.component.provider.actions.dc.AbstractDcMultiAction.run(AbstractDcMultiAction.java:93)
at com.tssap.selena.model.extension.action.SelenaActionCollector$GenericElementActionWrapper.run(SelenaActionCollector.java:229)
at com.tssap.util.ui.menu.MenuFactory$MuSiAction.saveRunAction(MenuFactory.java:1425)
at com.tssap.util.ui.menu.MenuFactory$MuSiAction.run(MenuFactory.java:1391)
at com.tssap.util.ui.menu.MenuFactory$DelegateAction.processInternal(MenuFactory.java:616)
at com.tssap.util.ui.menu.MenuFactory$DelegateAction.access$100(MenuFactory.java:586)
at com.tssap.util.ui.menu.MenuFactory$DelegateAction$BusyProcessWorker.run(MenuFactory.java:716)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
at com.tssap.util.ui.menu.MenuFactory$DelegateAction.process(MenuFactory.java:610)
at com.tssap.util.ui.menu.internal.MenuListenerFactory$ProcessAdapter.widgetSelected(MenuListenerFactory.java:172)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at com.tssap.util.startup.WBLauncher.run(WBLauncher.java:79)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.ide.eclipse.startup.Main.basicRun(Main.java:286)
at com.sap.ide.eclipse.startup.Main.run(Main.java:795)</i></i>Do you really mean "Delete DC" or do you mean "Remove from client"?
A Remove from client just removes the DC from your local system, while a Delete DC removes the DC from the DTR!
In case you really want to delete the DC from the DTR, try just syncing the sources <b>without</b> performing a build. -
How to list IP address from client on the Server (TCP/IP CLIENT SERVER COMMUNICATION)
Excuse me,
In this project I want to ask how to add list IP from client that connect to server.
I have edited slightly the project.
'SERVER
Imports System.Net
Imports System.Net.Sockets
Imports System.Threading
Imports System.Threading.Tasks
Imports System.Reflection
Public Class ServerForm
Private _Listener As TcpListener
Private _Connections As New List(Of ConnectionInfo)
Private _ConnectionMonitor As Task
Private Sub Button_Checked(sender As System.Object, e As System.EventArgs) Handles StartStopButton.CheckedChanged
If StartStopButton.Checked Then
StartStopButton.Text = "Stop"
StartStopButton.Image = My.Resources.StopServer
_Listener = New TcpListener(IPAddress.Any, CInt(PortTextBox.Text))
_Listener.Start()
Dim monitor As New MonitorInfo(_Listener, _Connections)
ListenForClient(monitor)
_ConnectionMonitor = Task.Factory.StartNew(AddressOf DoMonitorConnections, monitor, TaskContinuationOptions.LongRunning)
Else
StartStopButton.Text = "Start:"
StartStopButton.Image = My.Resources.StartServer
CType(_ConnectionMonitor.AsyncState, MonitorInfo).Cancel = True
_Listener.Stop()
_Listener = Nothing
End If
End Sub
Private Sub PortTextBox_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles PortTextBox.Validating
Dim deltaPort As Integer
If Not Integer.TryParse(PortTextBox.Text, deltaPort) OrElse deltaPort < 1 OrElse deltaPort > 65535 Then
MessageBox.Show("Port number between 1 and 65535", "Invalid Port Number", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
PortTextBox.SelectAll()
e.Cancel = True
End If
End Sub
Private Sub ListenForClient(monitor As MonitorInfo)
Dim info As New ConnectionInfo(monitor)
_Listener.BeginAcceptTcpClient(AddressOf DoAcceptClient, info)
End Sub
Private Sub DoAcceptClient(result As IAsyncResult)
Dim monitorinfo As MonitorInfo = CType(_ConnectionMonitor.AsyncState, MonitorInfo)
If monitorinfo.Listener IsNot Nothing AndAlso Not monitorinfo.Cancel Then
Dim info As ConnectionInfo = CType(result.AsyncState, ConnectionInfo)
monitorinfo.Connections.Add(info)
info.AcceptClient(result)
ListenForClient(monitorinfo)
info.AwaitData()
Dim doUpdateConnectionCountLabel As New Action(AddressOf UpdateConnectionCountLabel)
Invoke(doUpdateConnectionCountLabel)
End If
End Sub
Private Sub DoMonitorConnections()
Dim doAppendOutput As New Action(Of String)(AddressOf AppendOutput)
Dim doUpdateConnectionCountLabel As New Action(AddressOf UpdateConnectionCountLabel)
Dim monitorInfo As MonitorInfo = CType(_ConnectionMonitor.AsyncState, MonitorInfo)
Me.Invoke(doAppendOutput, "Server Started")
Do
Dim lostCount As Integer = 0
For index As Integer = monitorInfo.Connections.Count - 1 To 0 Step -1
Dim info As ConnectionInfo = monitorInfo.Connections(index)
If info.Client.Connected Then
If info.DataQueue.Count > 0 Then
Dim messageBytes As New List(Of Byte)
While info.DataQueue.Count > 0
Dim value As Byte
If info.DataQueue.TryDequeue(value) Then
messageBytes.Add(value)
End If
End While
Me.Invoke(doAppendOutput, "Message from IP: " + System.Text.Encoding.ASCII.GetString(messageBytes.ToArray))
End If
Else
monitorInfo.Connections.Remove(info)
lostCount += 1
End If
Next
If lostCount > 0 Then
Invoke(doUpdateConnectionCountLabel)
End If
_ConnectionMonitor.Wait(1)
Loop While Not monitorInfo.Cancel
For Each info As ConnectionInfo In monitorInfo.Connections
info.Client.Close()
Next
monitorInfo.Connections.Clear()
Invoke(doUpdateConnectionCountLabel)
Me.Invoke(doAppendOutput, "Server Stoped")
End Sub
Private Sub UpdateConnectionCountLabel()
ConnectionCountLabel.Text = String.Format("{0} Connections", _Connections.Count)
End Sub
Private Sub AppendOutput(message As String)
If RichTextBox1.TextLength > 0 Then
RichTextBox1.AppendText(ControlChars.NewLine)
End If
RichTextBox1.AppendText(message)
RichTextBox1.ScrollToCaret()
End Sub
Private Sub ClearButton_Checked(sender As Object, e As EventArgs) Handles ClearButton.CheckedChanged
If ClearButton.Checked Then
RichTextBox1.Clear()
End If
End Sub
End Class
Public Class MonitorInfo
Private _listener As TcpListener
Public ReadOnly Property Listener As TcpListener
Get
Return _listener
End Get
End Property
Private _connections As List(Of ConnectionInfo)
Public ReadOnly Property Connections As List(Of ConnectionInfo)
Get
Return _connections
End Get
End Property
Public Property Cancel As Boolean
Public Sub New(tcpListener As TcpListener, connectionInfoList As List(Of ConnectionInfo))
_listener = tcpListener
_connections = connectionInfoList
End Sub
End Class
Public Class ConnectionInfo
Private _monitor As MonitorInfo
Public ReadOnly Property Monitor As MonitorInfo
Get
Return _monitor
End Get
End Property
Private _Client As TcpClient
Public ReadOnly Property Client As TcpClient
Get
Return _Client
End Get
End Property
Private _DataQueue As System.Collections.Concurrent.ConcurrentQueue(Of Byte)
Public ReadOnly Property DataQueue As System.Collections.Concurrent.ConcurrentQueue(Of Byte)
Get
Return _DataQueue
End Get
End Property
Private _Stream As NetworkStream
Public ReadOnly Property Stream As NetworkStream
Get
Return _Stream
End Get
End Property
Public Sub New(monitor As MonitorInfo)
_monitor = monitor
_DataQueue = New System.Collections.Concurrent.ConcurrentQueue(Of Byte)
End Sub
Private _LastReadLength As Integer
Public ReadOnly Property LastReadLength As Integer
Get
Return _LastReadLength
End Get
End Property
Private _Buffer(63) As Byte
Public Sub AcceptClient(result As IAsyncResult)
_Client = _monitor.Listener.EndAcceptTcpClient(result)
If _Client IsNot Nothing AndAlso _Client.Connected Then
_Stream = _Client.GetStream
End If
End Sub
Public Sub AwaitData()
_Stream.BeginRead(_Buffer, 0, _Buffer.Length, AddressOf DoReadData, Me)
End Sub
Private Sub DoReadData(result As IAsyncResult)
Dim info As ConnectionInfo = CType(result.AsyncState, ConnectionInfo)
Try
If info.Stream IsNot Nothing AndAlso info.Stream.CanRead Then
info._LastReadLength = info.Stream.EndRead(result)
For Index As Integer = 0 To _LastReadLength - 1
info._DataQueue.Enqueue(info._Buffer(Index))
Next
'info.SendMessage("Data Diterima " & info._LastReadLength & " Bytes")
info.SendMessage("reply form server: " & info._LastReadLength & " Bytes")
For Each otherInfo As ConnectionInfo In info.Monitor.Connections
If Not otherInfo Is info Then
otherInfo.SendMessage(System.Text.Encoding.ASCII.GetString(info._Buffer))
End If
Next
info.AwaitData()
Else
info.Client.Close()
End If
Catch ex As Exception
info._LastReadLength = -1
End Try
End Sub
Private Sub SendMessage(message As String)
If _Stream IsNot Nothing Then
Dim messageData() As Byte = System.Text.Encoding.ASCII.GetBytes(message)
Stream.Write(messageData, 0, messageData.Length)
End If
End Sub
End Class
'CLIENT
Imports System.Net
Imports System.Net.Sockets
Public Class ClientForm
Private _Connection As ConnectionInfo
Private _ServerAddress As IPAddress
Private Sub ClientForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
ValidateChildren()
End Sub
Private Sub ConnectButton_Checked(sender As Object, e As System.EventArgs) Handles ConnectButton.CheckedChanged
If ConnectButton.Checked Then
If _ServerAddress IsNot Nothing Then
ConnectButton.Text = "Disconnect"
ConnectButton.Image = My.Resources.StopServer
Try
_Connection = New ConnectionInfo(_ServerAddress, CInt(PortTextBox.Text), AddressOf InvokeAppendOutput)
_Connection.AwaitData()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error Connecting to Server", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
ConnectButton.Checked = False
End Try
Else
MessageBox.Show("Invlid IP Server", "Cannt Connect to Server", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
ConnectButton.Checked = False
End If
Else
ConnectButton.Text = "Connect"
ConnectButton.Image = My.Resources.StartServer
If _Connection IsNot Nothing Then _Connection.Close()
_Connection = Nothing
End If
End Sub
Private Sub SendButton_Click(sender As System.Object, e As System.EventArgs) Handles SendButton.Click
If _Connection IsNot Nothing AndAlso _Connection.Client.Connected AndAlso _Connection.Stream IsNot Nothing Then
Dim buffer() As Byte = System.Text.Encoding.ASCII.GetBytes(InputTextBox.Text)
_Connection.Stream.Write(buffer, 0, buffer.Length)
End If
End Sub
Private Sub ServerTextBox_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles IPTextBox.Validating
_ServerAddress = Nothing
Dim remoteHost As IPHostEntry = Dns.GetHostEntry(IPTextBox.Text)
If remoteHost IsNot Nothing AndAlso remoteHost.AddressList.Length > 0 Then
For Each deltaAddress As IPAddress In remoteHost.AddressList
If deltaAddress.AddressFamily = AddressFamily.InterNetwork Then
_ServerAddress = deltaAddress
Exit For
End If
Next
End If
If _ServerAddress Is Nothing Then
MessageBox.Show("Cannot resolve Server Address", "invalid Server", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
IPTextBox.SelectAll()
e.Cancel = True
End If
End Sub
Private Sub PortTextBox_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles PortTextBox.Validating
Dim deltaPort As Integer
If Not Integer.TryParse(PortTextBox.Text, deltaPort) OrElse deltaPort < 1 OrElse deltaPort > 65535 Then
MessageBox.Show("Port number between 1 and 65535", "invalid Port number", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
PortTextBox.SelectAll()
e.Cancel = True
End If
End Sub
Private Sub InvokeAppendOutput(message As String)
Dim doAppendOutput As New Action(Of String)(AddressOf AppendOutput)
Me.Invoke(doAppendOutput, message)
End Sub
Private Sub AppendOutput(message As String)
If RichTextBox1.TextLength > 0 Then
RichTextBox1.AppendText(ControlChars.NewLine)
End If
RichTextBox1.AppendText(message)
RichTextBox1.ScrollToCaret()
End Sub
Private Sub ButtonClear_Click(sender As Object, e As EventArgs) Handles ButtonClear.Click
RichTextBox1.Clear()
InputTextBox.Clear()
End Sub
End Class
Public Class ConnectionInfo
Private _AppendMethod As Action(Of String)
Public ReadOnly Property AppendMethod As Action(Of String)
Get
Return _AppendMethod
End Get
End Property
Private _Client As TcpClient
Public ReadOnly Property Client As TcpClient
Get
Return _Client
End Get
End Property
Private _Stream As NetworkStream
Public ReadOnly Property Stream As NetworkStream
Get
Return _Stream
End Get
End Property
Private _LastReadLength As Integer
Public ReadOnly Property LastReadLength As Integer
Get
Return _LastReadLength
End Get
End Property
Private _Buffer(63) As Byte
Public Sub New(address As IPAddress, port As Integer, append As Action(Of String))
_AppendMethod = append
_Client = New TcpClient
_Client.Connect(address, port)
_Stream = _Client.GetStream
End Sub
Public Sub AwaitData()
_Stream.BeginRead(_Buffer, 0, _Buffer.Length, AddressOf DoreadData, Me)
End Sub
Public Sub Close()
If _Client IsNot Nothing Then _Client.Close()
_Client = Nothing
_Stream = Nothing
End Sub
Private Sub DoreadData(result As IAsyncResult)
Dim info As ConnectionInfo = CType(result.AsyncState, ConnectionInfo)
Try
If info._Stream IsNot Nothing AndAlso info._Stream.CanRead Then
info._LastReadLength = info._Stream.EndRead(result)
If info._LastReadLength > 0 Then
Dim message As String = System.Text.Encoding.ASCII.GetString(info._Buffer)
info._AppendMethod(message)
End If
info.AwaitData()
End If
Catch ex As Exception
info._LastReadLength = -1
info._AppendMethod(ex.Message)
End Try
End Sub
End Class
//ScreenShot server
http://prntscr[dot]com/5t1ol3
//Screenshot client
http://prntscr[dot]com/5t1odj
source: code[dot]msdn[dot]microsoft[dot]com/windowsdesktop/Simple-Multi-User-TCPIP-43cc3b44I have a similar chat application. When the user attempts to connect, instead of sending a simple string, the client sends a serialized object(xml string) with all relevant login and session information, this includes the user's IP address. Once the server
receives said information, depending on the type of TCP broadcast (a custom enumerated type) information from one user may be passed to a single user, or distributed to many users.
If it helps, here is the TCPBroadcast object I use. But in order for your server to understand it, you kind of have to build your server and client somewhat around it.
Option Strict On
Option Explicit On
Option Infer Off
Namespace TCPChat
Public Class TCPBroadcast
Public Property Message As String
Public Property BroadCastTime As DateTime
Public Property DestUser As String
Public Property OriginUser As String
Public Property PasswordHash As String
Public Property BroadcastSourceIP As String
Public Property BroadCastType As TCPBroadcastType
Public Property LoginUserName As String
Public Property FailureReason As String
Public Function XmlEncoding() As String
Dim serializer As New Xml.Serialization.XmlSerializer(GetType(TCPBroadcast))
Dim XML As String = String.Empty
Using memStream As New IO.MemoryStream
Using xmlWriter As New Xml.XmlTextWriter(memStream, System.Text.Encoding.UTF8) With _
{.Indentation = 4, .Formatting = System.Xml.Formatting.Indented}
serializer.Serialize(xmlWriter, Me)
End Using
XML = System.Text.Encoding.UTF8.GetString(memStream.ToArray)
End Using
Return XML
End Function
Public Function ToBinary() As Byte()
Return System.Text.Encoding.UTF8.GetBytes(Me.XmlEncoding)
End Function
Public Shared Function FromBinary(binary As Byte()) As DeserializationResult
Dim xml As String = System.Text.Encoding.UTF8.GetString(binary)
Return FromXML(xml)
End Function
Public Shared Function FromXML(xml As String) As DeserializationResult
Dim DeserializationResult As New DeserializationResult
DeserializationResult.Error = False
Try
Dim deserializer As New Xml.Serialization.XmlSerializer(GetType(TCPBroadcast))
Dim buffer As Byte() = System.Text.Encoding.UTF8.GetBytes(xml)
Using memStream As New IO.MemoryStream(buffer)
DeserializationResult.tcpBroadCast = CType(deserializer.Deserialize(memStream), TCPBroadcast)
End Using
Catch ex As Exception
DeserializationResult.Error = True
DeserializationResult.ErrorMessage = ex.ToString
DeserializationResult.AttemptedXML = xml
End Try
Return DeserializationResult
End Function
Public Class DeserializationResult
Public [Error] As Boolean
Public ErrorMessage As String
Public tcpBroadCast As TCPBroadcast
Public AttemptedXML As String
Sub New()
End Sub
End Class
Public Enum TCPBroadcastType
AdministrativeMessage
AuthenticationFailure
AuthenticationSuccess
ChatBroadcast
CredentialsRequest
Credentials
DisconnectedByServer
KeepAlive
PrivateMessage
ServerMessage
SystemMessage
UnableToProcessRequest
End Enum
End Class
End Namespace
“If you want something you've never had, you need to do something you've never done.”
Don't forget to mark
helpful posts and answers
! Answer an interesting question? Write a
new article
about it! My Articles
*This post does not reflect the opinion of Microsoft, or its employees. -
How to capture the message recived to the soap server from client -onMessag
Hi,
I want to send JAXM message from client to server
and In server print the message to a text file.
My client
SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
SOAPConnection con = scf.createConnection();
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage msg = mf.createMessage();
SOAPPart part = msg.getSOAPPart();
SOAPEnvelope envelope = part.getEnvelope();
SOAPBody body = envelope.getBody();
javax.xml.soap.Name name = envelope.createName("Text");
javax.xml.soap.SOAPBodyElement bodyElement = body.addBodyElement (name);
bodyElement.addTextNode ("Some Body text");
This is the way i'm accessing now in theserver
public SOAPMessage onMessage(SOAPMessage msg) {
try {
FileOutputStream out; // declare a file output object
PrintStream p;
out = new FileOutputStream("E:/Accepter.txt");
p = new PrintStream(out);
int count = msg.countAttachments();
p.println("write");
msg.writeTo(out);
This creates the text file and write unwanted characters
1)How do i access the message content and store in a text file or
String variable??
2)How do i access the message content in name wise in he case of many messages recived to the server
Thanks for your time .
suda* To save a message to a file.
File file = new File("file.xml");
msg.writeTo(new FileOutputStream(file));
* To recreate a message (without attachments) from a file.
MessageFactory mfactory = MessageFactory.newInstance();
SOAPMessage msg = mfactory.createMessage();
SOAPPart part = msg.getSOAPPart();
StreamSource streamSource =
new StreamSource(
new FileInputStream("file.xml"));
part.setContent(streamSource);
// to view the recreated message
msg.writeTo(System.out);
* You should also be able to use DOMSource to recreate the message as:
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document domDoc =
builder.parse(
new File("file.xml"));
Source domSource = new
javax.xml.transform.dom.DOMSource(domDoc);
MessageFactory mfactory = MessageFactory.newInstance();
SOAPMessage msg = mfactory.createMessage();
SOAPPart part = msg.getSOAPPart();
part.setContent(domSource);
Hope this helps. -
Reg :File upload and download from client machine
hi..
anyone help me the way that how to upload and download word
document file from client machine.. i am using j2eeserver1.4 in linux..
i want upload file from client machine(windows) to server(linux.) please
help me . tell me idea regarding..
i have tried this coding.. but i can transfer txt file. only. when i upload mirosoft word file.. it will open with some ascii values with actual content.
<!-- upload.jsp -->
<%@ page import="java.io.*" %>
<%String contentType = request.getContentType();
String file = "";
String saveFile = "";
FileOutputStream fileOut = null;
if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
DataInputStream in = new DataInputStream(request.getInputStream());
int formDataLength = request.getContentLength();
byte dataBytes[] = new byte[formDataLength];
int byteRead = 0;
int totalBytesRead = 0;
while (totalBytesRead < formDataLength)
byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
totalBytesRead += byteRead;
try {
file = new String(dataBytes);
saveFile = file.substring(file.indexOf("filename=\"") + 10);
saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
saveFile = saveFile.substring(saveFile.lastIndexOf("/") + 1,saveFile.indexOf("\""));
int lastIndex = contentType.lastIndexOf("=");
String boundary = contentType.substring(lastIndex + 1,contentType.length());
int pos;
pos = file.indexOf("filename=/" + 1);
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
int boundaryLocation = file.indexOf(boundary, pos) - 4;
int startPos = ((file.substring(0, pos)).getBytes()).length;
int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
String folder = "/tmp/uploads/";
fileOut = new FileOutputStream(folder + saveFile);
fileOut.write(dataBytes);
fileOut.write(dataBytes, startPos, (endPos - startPos));
fileOut.flush(); } catch(Exception e) { out.print(e);
} finally
{ try
{fileOut.close();
}catch(Exception err)
%>
please which package will help me to upload word document file with no errror. send me how can use in ftp.. send me some sample program..
Regards..
New User M.Senthil..Hi,
Well,i don't know whether if this helps people here are not.
It is always a good practise to do it via Servlet and then download content.
The adavantage of doing this is
1). You may not need to pack the downloadable with the .war which you ultimately genrate which ceratinly help us in terms of faster deployment.
3). You may update the new content just by moving a file to the backup folder.
2).One may definately download the content irrespective to the content/file.
Hope example below helps..
Configurations:
In the above example we are assuming that we placing all downlodable file in D:/webapp/downlodables/ and you have configured the same path as a init param with the name "filePath" in your web.xml.
something like the one below.
<servlet>
<servlet-name>DownloadServlet</servlet-name>
<servlet-class>com.DownloadServlet</servlet-class>
<init-param>
<param-name>filePath</param-name>
<param-value>D:/webapp/downlodables/</param-name>
<!--Could use any backup folder Available on your Server-->
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DownloadServlet</servlet-name>
<url-pattern>/downloadFile</url-pattern>
</servlet-mapping>DownloadServlet.java:
==================
package com;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import javax.activation.MimetypesFileTypeMap;
*@Author RaHuL
/**Download Servlet
* which could be accessed downloadFile?fid=fileName
* or
* http://HOST_NAME:APPLN_PORT/ApplnContext/downloadFile?fid=fileName
public class DownloadServlet extends HttpServlet{
private static String filePath = new String();
private static boolean dirExists = false;
public void init(ServletConfig config){
// Acquiring Backup Folder Part
filePath = config.getInitParameter("filePath");
dirExists = new File(filePath).exists();
private void processAction(HttpServletRequest request,HttpServletResponse response) throws Exception{
// Some Authentication Checks depending upon requirements.
// getting fileName which user is requesting for
String fileName = request.getParameter("fid");
//Building the filePath
StringBuffer tFile = new StringBuffer();
tFile.append(filePath);
tFile.append("fileName");
boolean exists = new File(tFile.toString()).exists();
// Checking whether the file Exists or not
if(exists){
FileInputStream input = null;
BufferedOutputStream output = null;
int contentLength = 0;
try{
// Getting the Mime-Type
String contentType = new MimetypesFileTypeMap().getContentType(tFile.toString());
input = new FileInputStream(tFile.toString());
contentLength = input.available();
response.setContentType(contentType);
response.setContentLength(contentLength);
response.setHeader("Content-Disposition","attachment;filename="+fileName);
output = new BufferedOutputStream(response.getOutputStream());
while ( contentLength-- > 0 ) {
output.write(input.read());
output.flush();
}catch(IOException e) {
System.err.println("Exception Occured:"+e.getMessage());
System.err.println("Exception Localized Message:"+e.getLocalizedMessage());
} finally {
if (output != null) {
try {
output.close();
} catch (IOException ie) {
System.err.println("Exception Occured:"+e.getMessage());
System.err.println("Exception Localized Message:"+e.getLocalizedMessage());
}else{
response.sendRedirect("/errorPage.html");
public void doPost(HttpServletRequest request,HttpServletResponse response) throws Exception{
processAction(request,response);
public void doGet(HttpServletRequest request,HttpServletResponse response) throws Exception{
processAction(request,response);
NOTE: Make sure You include activations.jar in your CLASSPATH b4 trying the code.
therefore,if you have something like above set as your application enviroment in the above disccussed
can be done by just giving a simple hyper link like
<a href="downloadFile?fid=fileName.qxd" target="_blank">Download File</a>REGARDS,
RaHuL
Maybe you are looking for
-
AppleScript speed difference between 10.4 & 10.5
This post is related to a question I posed in March 2009 (https://discussions.apple.com/message/9226100) regarding the speed difference between AppleScript text handling in OS X 10.5 compared with 10.4.11. I have recently written a script to search t
-
PO created with wrong Company code
Hi Gurus, I have Plant XXXX assigned to Company code 1111 and Plant YYYY assigned to Company code 2222 One of the user has created PO with Plant XXXX and company code wrong as 2222. (we have warning message setup & not error message. So, it
-
I had to take my iTouch to the Apple store today for a restore. My Macbook Pro was unable to restore after multiple attempts. I brought it home, plugged it in and it was still there - had expected all new factory settings, starting over from scratch.
-
Problem description: My Mac is running slow so wanted to get advice on what I should do based on my EtreCheck report. I run a virtual machine in VMWare for business purposes and I had been having no problems but here lately the mac has slowed down.
-
How do I ensure a Map key maps to the correct data type?
Hi, I have a simple event processing interface, where an Action class processes an event, and optionally generates a response event. I want to store a map of all registered actions, and then select the one matching an incoming event at run time: // t