Return String array in server side
i wrote a bean which contains a function return String array (
String[] ). It shows no error on compile time, and also in
generate jar file. However, when i generate it to an ear file,
the syntax of the wsdl file is not correct so the client can't
call this function becuase the xml can't parse the wsdl.
When i change the return type to String, everything is ok. Does
anybody know what's happen? I really have no idea on it, thx.
This is why I wanted to see some code. I wanted to see how you are trying to move the array from one class to another.
This should work... provided that the array is initialised correctly in ClassA. If you are doing it like this, please post some code and I'll help you fix it.
class ClassA{
public String[] getMyArray(){
return myArray;
class ClassB{
public void myMethod(){
ClassA myA = new ClassA();
String[] newArray = myA.getMyArray();
}
Similar Messages
-
External java function that should return String array
Hi everyone,
I have a split function in plsql that takes 10 times longer a java tokenizer function that i was written. So, i want to use java external function to split my plsql strings into pieces.
I can write a java external procedure that returns types like int, float and String types. I have no problem about it.
My problem is returning an array of strings. I found a book that has an example about how can we get directory list in plsql with java external procedure.
(code)
import java.io.File;
import java.sql.*;
import oracle.sql.*;
import oracle.jdbc.*;
public class JFile {
public static oracle.sql.ARRAY dirlist (String dir)
throws java.sql.SQLException
Connection conn = new OracleDriver().defaultConnection( );
ArrayDescriptor arraydesc =
ArrayDescriptor.createDescriptor ("DIRLIST_T", conn);
File myDir = new File (dir);
String[] filesList = myDir.list( );
ARRAY dirArray = new ARRAY(arraydesc, conn, filesList);
return dirArray;
CREATE OR REPLACE FUNCTION dirlist (dir IN VARCHAR2)
RETURN dirlist_t
AS
LANGUAGE JAVA
NAME 'myFile.dirlist(java.lang.String) return oracle.sql.ARRARY';
(code)
I could compile this source file in localhost but not remotehost. There are jar files ( import oracle.sql.*; import oracle.jdbc.*; ) that should be added to remote classpath. ( others have already added java classpath ). But, which classpath i should add? Oracle has own JVM and Classpath, probably i should upload these jar files to oracle classpath. Am i wrong? How can i do? Can you explain in detail? How can i return string array from java external function in Oracle ?
I am using Oracle 11.1.0.7 on Solaris Sparc Machine.Hi,
What do you mean "compile in remote host"
Aren't you using the loadjava tool? - that should be enough, the RDBMS already "has" the jars needed.
[A must read|http://download.oracle.com/docs/cd/B28359_01/java.111/b31225/chone.htm#BABCFIIF]
Regards
Peter -
Create image from byte[]array on server side
Hello everyone..
I'm developing an application which will take snapshots from a mobile device, and send it to my pc via bluetooth. I have my own midlet which uses the phone camera to take the snapshot, i want to transfer that snapshot to my pc.
The snapshot is taken is stored in an array byte.
The image can be created on the phone itself with no problem using : image.createImage(byte[])
my problem is that when i send the array byte via bluetooth, and receive it on the server, i cannot create the image using the :image.createImage() code
The connection is good since i have tested by writing the content of the array in a text file.
Piece of midlet code:
try{
stream = (StreamConnection)Connector.open(url);
OutputStream ggt = stream.openOutputStream();
ggt.write(str);
ggt.close();
}catch(Exception e){
err1 = e.getMessage();
}where str is my array byte containing the snapshot
And on my server side:
Thread th = new Thread(){
public void run(){
try{
while(true){
byte[] b = new byte[in.read()];
int x=0;
System.out.println("reading");
r = in.read(b,0,b.length);
if (r!=0){
System.out.println(r);
img = Image.createImage(b, 0, r);
//other codes
i get this error message:
Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: javax.microedition.lcdui.ImmutableImage.decodeImage([BII)V
at javax.microedition.lcdui.ImmutableImage.decodeImage(Native Method)
at javax.microedition.lcdui.ImmutableImage.<init>(Image.java:906)
at javax.microedition.lcdui.Image.createImage(Image.java:367)
at picserv2$1.run(picserv2.java:70)
Please anyone can help me here? is this the way to create the image on the server side? thx a lothere is exactly how i did it :
while(true){
byte[] b = new byte[in.read()];
System.out.println("reading");
r = in.read(b, 0, b.length);
if (r!=0){
Toolkit toolkit = Toolkit.getDefaultToolkit();
Image img = toolkit.createImage(b, 0, b.length);
JLabel label = new JLabel(new ImageIcon(img) );
BufferedImage bImage = new BufferedImage(img.getWidth(label),img.getHeight(label),BufferedImage.TYPE_INT_RGB);
bImage.createGraphics().drawImage(img, 0,0,null);
File xd = new File("D:/file.jpg");
ImageIO.write(bImage, "jpg", xd);
System.out.println("image sent");
}Edited by: jin_a on Mar 22, 2008 9:58 AM -
How Do I Call PL/SQL Stored Procedure That Returns String Array??
I Have Problem Calling An Oracle(8i) Stored Procedure That Returns Array Type (Multi Rows)
(As Good As String Array Type..)
In This Fourm, I Can't Find Out Example Source.
(Question is Exist.. But No Answer..)
I Want An Example,, Because I'm A Beginner...
(I Wonder...)
If It Is Impossible, Please Told Me.. "Impossible"
Then, I'll Give Up to Resolve This Way.....
Please Help Me !!!
Thanks in advance,// Try the following, I appologize that I have not compiled and run this ... but it is headed in the right direction
import java.sql.*;
class RunStoredProc
public static void main(String args[])
throws SQLException
try
Class.forName("oracle.jdbc.driver.OracleDriver");
catch(Exception ex)
ex.printStackTrace();
java.util.Properties props = new java.util.Properties();
props.put("user", "********"); // you need to replace stars with db userid
props.put("password", "********"); // you need to replace stars with userid db password
// below replace machine.domain.com and DBNAME, and port address if different than 1521
Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@machine.domain.com:1521:DBNAME", props);
// replace "Your Stored Procedure" with your stored procedure
CallableStatement stmt = conn.prepareCall("Your Stored Procedure");
ResultSet rset = stmt.execute();
while(rset.next())
System.out.println(rset.getString(1)); -
I'm trying to create a function (method?) for parsing some log files. The first index of the string array I want returned will contain a 'key' on what I'm doing with the log files (since they'll be formatted in several different ways depending on what's happening) and the rest will just return tokens from the logs. Here's what I have so far:
public static String[] parseLog(String inString){
StringTokenizer st = new StringTokenizer(inString, "\"<>");
int stNum = st.countTokens();
String[] parsedOut = new String[stNum + 1];
if (inString.contains("disconnected")) {
parsedOut[0] = "read";
for (int x = 1; st.hasMoreTokens() ; x++){
parsedOut[x] = st.nextToken().trim();
return parsedOut;
public static void main(String[] args) {
String line = "????log L 08/15/2008 - 20:28:37: \"underTHEinfluence johnRAMBO<16><STEAM_0:0:204495><>\" disconnected";
System.out.println("Parsed: " + parseLog(line));
}{code}
It compiles with no errors, but I'm getting this: Parsed: [Ljava.lang.String;@e09713
Edited by: mr0ldie on Aug 16, 2008 1:37 PMprometheuzz wrote:
A String representation of the array is given, while you want to display the individual items from the array.
Try this:
System.out.println(java.util.Arrays.toString(yourArray));
Need closures - want to do mapchar(yourarray, System.out.println);
:) -
Server side buffering settings for video
I pump my video (both live streaming and VOD) through a popular CDN. They control the server side (FMS) settings. I can request that they change things and they do so and let me know when I can test.
I'm wondering about server side buffering settings. Is there supposed to be some sort of coordination between the buffering settings there and the client side buffering settings I implement in my video player?
The reason I ask is I get wierd buffering behaviors in my client side player under certain conditions and there doesn't seem to be much to adjust there other than the NetStream.bufferTime property.
For instance, if I set the bufferTime property in my client viewer to 10 seconds, the player just seems to ignore it and starts playing the stream right away or within a second or two. Other times I see crazy values in the bufferTime property, like 400 seconds (I check the property's value about every second).
I'm wondering if there are some FMS settings that are overriding or are not working well with my client side buffer settings. Is this possible?Not sure how to get this code to you. There is no option here to attach a file. Trying to post inline here. Hope it comes out ok.
This is a simple player. The simplest. No frills. Just insert your RTMP url to your FMS and your stream name in the string variables "rtmpURL" and "streamName" at the top, compile and run.
Here is a deployment of this player connected to my CDN where the file is currently playing:
http://dcast.dyventive.com/cast/simple_player/player.html
Also, attached is an image I took when I ran the program and hit the refresh button in the browser. Note the giant bufferLength numbers in the debug panel.
Again note, I do not get this problem linking directly to a recorded file. I see this problem when playing a file on a server or with a live stream.
Can you see anything obviously wrong?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
backgroundColor="#333333"
initialize="init()">
<mx:Script>
<![CDATA[
//Note: the method "connect()" on line #49 starts the area with the important connection code
import mx.containers.Canvas;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
private var vid:Video;
private var nc:NetConnection;
//Path to your FMS live streaming application
private var rtmpURL:String = "Insert your URL"; //Will be used to connect to your FMS
private var buffer:Number = 5; //NetStream.bufferTime property will be set with this.
private var streamName:String = "Insert your server side stream name here"; //This determines the channel you're watching on the server.
private var ns:NetStream;
private var msg:Boolean;
[Bindable]
private var canvas_video:Canvas;//Will display some live playback stats
private var intervalMonitorBufferLengthEverySecond:uint;
private function init():void
vid=new Video();
vid.width=720;
vid.height=480;
vid.smoothing = true;
uic.addChild(vid);
connect();
public function onSecurityError(e:SecurityError):void
trace("Security error: ");
public function connect():void
nc = new NetConnection();
nc.client = this;
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
nc.connect(rtmpURL);
public function netStatusHandler(e:NetStatusEvent):void
switch (e.info.code) {
case "NetConnection.Connect.Success":
netconnectionStatus.text = e.info.code;
reconnectStatus.text = "N/A";
trace("Connected successfully");
createNS();
break;
public function createNS():void
trace("Creating NetStream");
ns=new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStreamStatusHandler);
vid.attachNetStream(ns);
//Handle onMetaData and onCuePoint event callbacks: solution at http://tinyurl.com/mkadas
//See another solution at http://www.adobe.com/devnet/flash/quickstart/metadata_cue_points/
var infoClient:Object = new Object();
infoClient.onMetaData = function oMD():void {};
infoClient.onCuePoint = function oCP():void {};
ns.client = infoClient;
ns.play(streamName);
ns.bufferTime = buffer;
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
function asyncErrorHandler(event:AsyncErrorEvent):void {
trace(event.text);
//Set up the interval that will be used to monitor the bufferLength property.
//monPlayback() will be the funciton that will do the work.
intervalMonitorBufferLengthEverySecond = setInterval(monPlayback, 1000);
public function netStreamStatusHandler(e:NetStatusEvent):void
switch (e.info.code) {
case "NetStream.Buffer.Empty":
netstreamStatus.text = e.info.code;
textAreaDebugPanel.text += "Buffer empty:\n";
trace("Buffer empty: ");
break;
case "NetStream.Buffer.Full":
netstreamStatus.text = e.info.code;
textAreaDebugPanel.text += "Buffer full:\n";
trace("Buffer full:");
break;
case "NetStream.Play.Start":
netstreamStatus.text = e.info.code;
textAreaDebugPanel.text += "Buffer empty:\n";
trace("Play start:");
break;
//Get the current ns.bufferLength value, format it, and display it to the screen.
//"bufferLen" is the key var here.
public function monPlayback():void {
var currentBuffer:Number = Math.round((ns.bufferLength/ns.bufferTime)*100);
var bufferLen:String = String(ns.bufferLength);//Here is the actual bufferLength reading.
//Use it to show the user what's going on.
pb.value = currentBuffer;//updates the little buffer slider on the screen
bufferPct.text = String(currentBuffer) + "%";
bufferTime.text = String(ns.bufferTime);
bufferLength.text = String(ns.bufferLength);
//Dump the bufferLen value to the debug panel.
textAreaDebugPanel.text += bufferLen + "\n";
trace("Buffer length: " + bufferLen);
public function onBWDone():void
//dispatchComplete(obj);
]]>
</mx:Script>
<mx:Canvas id="monitor"
y="10" right="50">
<mx:Text x="0" y="25" text="Buffer:" color="#FFFFFF"/>
<mx:Text x="0" y="50" text="Buffer Time:" color="#FFFFFF"/>
<mx:Text x="0" y="75" text="Buffer Length:" color="#FFFFFF"/>
<mx:Text x="0" y="100" text="NetConnection netStatus:" color="#FFFFFF"/>
<mx:Text x="0" y="125" text="NetStream netStatus:" color="#FFFFFF"/>
<mx:Text x="0" y="150" text="Reconnect:" color="#FFFFFF"/>
<mx:HSlider x="145" y="25" id="pb" minimum="0" maximum="100" snapInterval="1" enabled="true"/>
<mx:Text x="100" y="25" height="20" id="bufferPct" color="#FFFFFF"/>
<mx:Text x="145" y="50" height="20" id="bufferTime" color="#FFFFFF"/>
<mx:Text x="145" y="75" height="20" id="bufferLength" color="#FFFFFF"/>
<mx:Text x="145" y="100" height="20" id="netconnectionStatus" color="#FFFFFF"/>
<mx:Text x="145" y="125" height="20" id="netstreamStatus" color="#FFFFFF"/>
<mx:Text x="145" y="150" height="20" id="reconnectStatus" color="#FFFFFF" text="N/A"/>
</mx:Canvas>
<mx:UIComponent id="uic"
x="50" y="10"/>
<mx:TextArea id="textAreaDebugPanel"
width="300" height="300"
right="50" top="300"
valueCommit="textAreaDebugPanel.verticalScrollPosition=textAreaDebugPanel.maxVerticalScro llPosition"/>
</mx:Application> -
WebService problem: only the first element of a string array is returned
Hello,
i did the J2EE QuickCarRental tutorial and extended it by some features: I created another entity bean and implemented four new methods in the QuickOrderProcessor. Then i deployed it as a WebService and accessed it using the Visual Composer.
Everything works fine except the return value of one WebService method. I created a method with the return value String[]. But the Visual Composer reads it as String. Only the first element of the resulting string array is displayed. Although the test at the web-page http://<server>:<port>/QuickCarRentalService/Config1 displays the whole string array with all its elements. What did i wrong?
Another problem is that after deploying the J2EE-Application with new WebService methods the changes are not visible inside the visual composer. Although the test at the web-page http://<server>:<port>/QuickCarRentalService/Config1 displays the changes. Do i have to restart the WebService system in the portal content? If yes how can i do that?Here are details about setting up and using web services and some examples:
/people/prakash.darji/blog/2006/10/10/external-web-service-proxy-configuration-for-visual-composer -
Check string length server-side
Hi guys,
how do i check the string length server-side?
I am using the date object to gather the current date.
quote:
var d = new Date();
var mm = d.getMonth()+1;
var yy = d.getFullYear();
var dd = d.getDate();
month is returned as "2" which is correct
but i need to be able to check for a single char so that i
can add a leading zero before it is submitted to the database. This
is also required for day.
thanks
PaulUnfortunately, it's not possible to evaluate an environment variable within an SHTML tag.
-
Problem when using object array as parameter of server-side event
Hi Friends,
I had defined an event in component interface of Component A, with object array as its parameter. but when I define event-handler for this event in Component B, the type of parameter in generated event-handler method is just the class itself instead of an array.
It's a bug or array parameter is not support by server-side event in WD4J?
Thanks in advanced.I think you are trying to do the editing of parameter from the java editor.
Do it via the controller editer. Go the methods tab. Select the actionhandler.
In the parameter section edit the paramter. Change the dimensions here.
Regards,
Ashwani Kr Sharma -
Error returning large String arrays from web service
Hi,
I currently have an EJB that returns a String[] array that I have implemented as
a Web Service. When I execute a Java client (JSP) from Weblogic, I don't have a problem
as long as the returned array is relatively small, but when the array starts to get
a little larger (say 20 elements, about 30 chars each), I consistently get:
SAXException: java.lang.IllegalArgumentException:array element type mismatch.
Strangely enough, when my web service client is a .asp page running under MS IIS
(using the MS SOAP Toolkit), it works fine. I have returned as many as 15000 - 20000
array elements in one call. And since I am calling the same Weblogic EJB with the
MS client, I know it's a problem with the Java client, not the EJB.
Anybody know of a bug or had this experience before? Or know what I might be doing
wrong? FYI, I am using Weblogic 6.1 SP2.
Thanks,
SteveHi Steve,
Sure we're interested...I'll pass this along to the XML folks.
Thanks for the feedback,
Bruce
Steve Alexander wrote:
In case anyone is interested, I solved my problem. I was mis-diagnosing the problem
- thinking it was a size issue when it actually was a data issue. On the calls where
I was returning a large array, some of the array members were null. When I made them
enpty strings "", it worked. Apparently the default SAX parser BEA uses doesn't like
the nulls, whereas the MS parser doesn't care.
"Steve Alexander" <[email protected]> wrote:
Thanks Bruce,
FYI - I have reproduced the problem on WL7.0. I have turned it in to support
as you
suggested.
Steve
Bruce Stephens <[email protected]> wrote:
Hi Steve,
This does not ring any bells, however I would suggest that you file a support
case. If it
is an option you might try a later release (7.0).
Bruce
Steve Alexander wrote:
Hi,
I currently have an EJB that returns a String[] array that I have implementedas
a Web Service. When I execute a Java client (JSP) from Weblogic, I don'thave a problem
as long as the returned array is relatively small, but when the arraystarts to get
a little larger (say 20 elements, about 30 chars each), I consistentlyget:
SAXException: java.lang.IllegalArgumentException:array element type mismatch.
Strangely enough, when my web service client is a .asp page running underMS IIS
(using the MS SOAP Toolkit), it works fine. I have returned as many as15000 - 20000
array elements in one call. And since I am calling the same Weblogic
EJB
with the
MS client, I know it's a problem with the Java client, not the EJB.
Anybody know of a bug or had this experience before? Or know what I mightbe doing
wrong? FYI, I am using Weblogic 6.1 SP2.
Thanks,
Steve -
NX-OS snmp-trap strdata does not return string sent from device to object server
NX-OS snmp-trap strdata does not return string sent from device to object server
Applet was created:
event manage applet TEST_VPC
description "%ETHPORT-5-IF_DOWN_ADMIN_DOWN"
event syslog occurs 1 priority 4 pattern "%ETHPORT-5-IF_DOWN_ADMIN_DOWN"
action 1.0 snmp-trap strdata "Loopback0 is admin down"
after event is generated (link admin down), trap is sent to snmp server, but string does not appear in received messages:
2014-03-17T04:29:26: Debug: D-P_M-105-000: 1 trap in queue
2014-03-17T04:29:26: Debug: D-P_M-105-000: V2/V3 trap/inform received
2014-03-17T04:29:26: Information: I-P_M-104-000: Number of items in the trap queue is 0
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] ReqId: 1427018637
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] community: xxxx
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] IPaddress: x.x.x.x
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] PeerIPaddress: x.x.x.x
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] ReceivedPort: 162
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] ReceivedTime: 1395044966
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] Protocol: UDP
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] SNMP_Version: 2
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] UpTime: 1166940388
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] Uptime: 1:30:03.88
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] .1.3.6.1.2.1.1.3.0: (1166940388) 135 days, 1:30:03.88
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] notify: .1.3.6.1.4.1.9.9.43.2.0.2
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] .1.3.6.1.6.3.1.1.4.1.0: .1.3.6.1.4.1.9.9.43.2.0.2
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] OID1: .1.3.6.1.4.1.9.9.43.1.1.1.0
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] 1: (1166939868) 135 days, 1:29:58.68
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] 1_raw: (1166939868) 135 days, 1:29:58.68
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] 1_text: (1166939868) 135 days, 1:29:58.68
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] 1_hex: (1166939868) 135 days, 1:29:58.68
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] .1.3.6.1.4.1.9.9.43.1.1.1.0: (1166939868) 135 days, 1:29:58.68
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] OID2: .1.3.6.1.4.1.9.9.43.1.1.6.1.6.36
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] 2: 4
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] 2_raw: 4
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] 2_text: 4
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] 2_hex: 4
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] .1.3.6.1.4.1.9.9.43.1.1.6.1.6.36: 4
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] Node: xxx
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] PeerAddress: xxxx
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] EventCount: 360
2014-03-17T04:29:26: Debug: D-UNK-000-000: [Event Processor] Processing alert {0 remaining}
please help figure this outThis is a CISCO-CONFIG-MAN-MIB trap, not an EEM trap. I don't think your EEM applet is being triggered since you have that priority argument in there. Try removing that and leave the syslog pattern alone. You will see the string as a varbind in the trap.
-
PHP Server-side typing of returned object
My PHP service returns an object. Is server-side typing of it's properties possible?
I know I'm late to the party, but in case it helps anyone else:
Despite being a PHP developer, I use iweb occasionally when I need something that looks good, fast!
however, not being able to use simple php scripts was a pain until I discovered that it's possible to make apache parse php within files with a .html extension.
This means that you don't have to change all your filenames to .php and you don't have to mess around every time you change something in iweb and republish.
You need to add a couple of lines as a directive to your apache config file. (You can also use a .htaccess file if you prefer, but I'd rather have a bunch of directives in the config file).
<Directory "/var/www/html/youriwebdirectory/">
AddType application/x-httpd-php .html
php_value shortopentag 0
</Directory>
The "addtype" directive tells php to parse html files for php code. You probably wouldn't want this for your whole server, so it's good to be able to do it only for the required directory where you have your iweb site.
The line "php_value shortopentag 0" may or may not be needed for you. If you have php set up to use short opening tags ( <? instead of <?php ) then this will cause a problem when you tell php to parse all the .html files made by iweb, as they have an XML declaration as the first line, which begins <?xml...
When you've done this, restart apache and you can then place php in your pages as an html snippet.
Of course, this only applies to apache on Linux, I have no clue what you'd do on a Windows box, or using a different webserver, but it worked for me, so it may help someone else :o) -
Power View with dynamic connection string, but server-side
We'd like to evaluate using Power View to provide exploratory BI over data output from HDInsight, onto Azure Storage. We need to let users select which segments of data to load but through a web-ui (not Excel on the desktop). We expect to have a standard
data model, it's just the segments of data that will be dynamically selected by the user. Basically the Power Query will need to be updated dynamically, but on the server-side. Is this scenario currently possible?Any suggestions for SFiorito?
Thanks!
Ed Price, Power BI & SQL Server Customer Program Manager (Blog,
Small Basic,
Wiki Ninjas,
Wiki)
Answer an interesting question?
Create a wiki article about it! -
PageMethod response returning whole page, unable to debug the server side method
Hello Guys,
I am unable to debug my method written on server side when a call is send to it through jquery using page method.
In response , I get the whole page.
code:
ASPX page:
PageMethods.MyMethod(p1, p2, function(response){
ASPX.CS
[System.Web.Services.WebMethod()]
[System.Web.Script.Services.ScriptMethod()]
publicstaticstringMyMethod(stringp1,
stringp2){
//Updating database
I did ScriptModule entry in web.config, enabled tracing,have ScriptManager and EnablePageMethods is set to true.
Still the server side method is not getting called.
please help.
Ng_TechFreakHi Ng_TechFreak,
For ASP.NET questions please post in
ASP.NET forum where you'll get better help.
Thanks for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Client-Server side GUI programming
I want to create a client-server side gui programming with java
i read this web adress
http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
for information but there are some parts that i didnt understand and wait for your help
i m trying to build an online-help(live chat) system so when people press the start chat button a java page will appear but i wonder how this will connect to the person who is on server side
i mean is it possible to 2 users connect the same port and chat with each other
I mean when user press the chat button the online help supporter will be informed somebody wants to speak with him and they will start a chat
how can i do something like that
any help would be usefull thanksBelow is an example of a client/server program.
It shows how the server listens for multiple clients.
* TriviaServerMulti.java
* Created on May 12, 2005
package server;
* @author johnz
import java.io.*;
import java.net.*;
import java.util.Random;
* This TriviaServer can handle multiple clientSockets simultaneously
* This is accomplished by:
* - listening for incoming clientSocket request in endless loop
* - spawning a new TriviaServer for each incoming request
* Client connects to server with:
* telnet <ip_address> <port>
* <ip_address> = IP address of server
* <port> = port of server
* In this case the port is 4413 , but server can listen on any port
* If server runs on the same PC as client use IP_addess = localhost
* The server reads file
* Note: a production server needs to handle start, stop and status commands
public class TriviaServerMulti implements Runnable {
// Class variables
private static final int WAIT_FOR_CLIENT = 0;
private static final int WAIT_FOR_ANSWER = 1;
private static final int WAIT_FOR_CONFIRM = 2;
private static String[] questions;
private static String[] answers;
private static int numQuestions;
// Instance variables
private int num = 0;
private int state = WAIT_FOR_CLIENT;
private Random rand = new Random();
private Socket clientSocket = null;
public TriviaServerMulti(Socket clientSocket) {
//super("TriviaServer");
this.clientSocket = clientSocket;
public void run() {
// Ask trivia questions until client replies "N"
while (true) {
// Process questions and answers
try {
InputStreamReader isr = new InputStreamReader(clientSocket.getInputStream());
BufferedReader is = new BufferedReader(isr);
// PrintWriter os = new PrintWriter(new
// BufferedOutputStream(clientSocket.getOutputStream()), false);
PrintWriter os = new PrintWriter(clientSocket.getOutputStream());
String outLine;
// Output server request
outLine = processInput(null);
os.println(outLine);
os.flush();
// Process and output user input
while (true) {
String inLine = is.readLine();
if (inLine.length() > 0)
outLine = processInput(inLine);
else
outLine = processInput("");
os.println(outLine);
os.flush();
if (outLine.equals("Bye."))
break;
// Clean up
os.close();
is.close();
clientSocket.close();
return;
} catch (Exception e) {
System.err.println("Error: " + e);
e.printStackTrace();
private String processInput(String inStr) {
String outStr = null;
switch (state) {
case WAIT_FOR_CLIENT:
// Ask a question
outStr = questions[num];
state = WAIT_FOR_ANSWER;
break;
case WAIT_FOR_ANSWER:
// Check the answer
if (inStr.equalsIgnoreCase(answers[num]))
outStr="\015\012That's correct! Want another (y/n)?";
else
outStr="\015\012Wrong, the correct answer is "
+ answers[num] +". Want another (y/n)?";
state = WAIT_FOR_CONFIRM;
break;
case WAIT_FOR_CONFIRM:
// See if they want another question
if (!inStr.equalsIgnoreCase("N")) {
num = Math.abs(rand.nextInt()) % questions.length;
outStr = questions[num];
state = WAIT_FOR_ANSWER;
} else {
outStr = "Bye.";
state = WAIT_FOR_CLIENT;
break;
return outStr;
private static boolean loadData() {
try {
//File inFile = new File("qna.txt");
File inFile = new File("data/qna.txt");
FileInputStream inStream = new FileInputStream(inFile);
byte[] data = new byte[(int)inFile.length()];
// Read questions and answers into a byte array
if (inStream.read(data) <= 0) {
System.err.println("Error: couldn't read q&a.");
return false;
// See how many question/answer pairs there are
for (int i = 0; i < data.length; i++)
if (data[i] == (byte)'#')
numQuestions++;
numQuestions /= 2;
questions = new String[numQuestions];
answers = new String[numQuestions];
// Parse questions and answers into String arrays
int start = 0, index = 0;
String LineDelimiter = System.getProperty("line.separator");
int len = 1 + LineDelimiter.length(); // # + line delimiter
boolean isQuestion = true;
for (int i = 0; i < data.length; i++)
if (data[i] == (byte)'#') {
if (isQuestion) {
questions[index] = new String(data, start, i - start);
isQuestion = false;
} else {
answers[index] = new String(data, start, i - start);
isQuestion = true;
index++;
start = i + len;
} catch (FileNotFoundException e) {
System.err.println("Exception: couldn't find the Q&A file.");
return false;
} catch (IOException e) {
System.err.println("Exception: couldn't read the Q&A file.");
return false;
return true;
public static void main(String[] arguments) {
// Initialize the question and answer data
if (!loadData()) {
System.err.println("Error: couldn't initialize Q&A data.");
return;
ServerSocket serverSocket = null;
try {
serverSocket = new ServerSocket(4413);
System.out.println("TriviaServer up and running ...");
} catch (IOException e) {
System.err.println("Error: couldn't create ServerSocket.");
System.exit(1);
Socket clientSocket = null;
// Endless loop: waiting for incoming client request
while (true) {
// Wait for a clientSocket
try {
clientSocket = serverSocket.accept(); // ServerSocket returns a client socket when client connects
} catch (IOException e) {
System.err.println("Error: couldn't connect to clientSocket.");
System.exit(1);
// Create a thread for each incoming request
TriviaServerMulti server = new TriviaServerMulti(clientSocket);
Thread thread = new Thread(server);
thread.start(); // Starts new thread. Thread invokes run() method of server.
}This is the text file:
Which one of the Smothers Brothers did Bill Cosby once punch out?
(a) Dick
(b) Tommy
(c) both#
b#
What's the nickname of Dallas Cowboys fullback Daryl Johnston?
(a) caribou
(b) moose
(c) elk#
b#
What is triskaidekaphobia?
(a) fear of tricycles
(b) fear of the number 13
(c) fear of kaleidoscopes#
b#
What southern state is most likely to have an earthquake?
(a) Florida
(b) Arkansas
(c) South Carolina#
c#
Which person at Sun Microsystems came up with the name Java in early 1995?
(a) James Gosling
(b) Kim Polese
(c) Alan Baratz#
b#
Which figure skater is the sister of Growing Pains star Joanna Kerns?
(a) Dorothy Hamill
(b) Katarina Witt
(c) Donna De Varona#
c#
When this Old Man plays four, what does he play knick-knack on?
(a) His shoe
(b) His door
(c) His knee#
b#
What National Hockey League team once played as the Winnipeg Jets?
(a) The Phoenix Coyotes
(b) The Florida Panthers
(c) The Colorado Avalanche#
a#
David Letterman uses the stage name "Earl Hofert" when he appears in movies. Who is Earl?
(a) A crew member on his show
(b) His grandfather
(c) A character on Green Acres#
b#
Who created Superman?
(a) Bob Kane
(b) Jerome Siegel and Joe Shuster
(c) Stan Lee and Jack Kirby#
b#
Maybe you are looking for
-
How to open an Oracle 6i Form from a button
Hi, I have a button on an order form that im trying to open the customer form from i am using the code: begin call_form('Customer',no_hide,do_replace); end; i get the following error msg: FRM-40010: cannot read form Customer. Any help would be greatl
-
Dump on screen when configuring Process controlled workflow
Hi Experts, I am facing 1 problem in SAP SRM 7 ehp1. I am configuring Process controlled workflow. Previous workflow settings was Application controlled workflow as its been upgraded from SRM 5. If i run a RFX (BUS2200) cycle in application controll
-
PSE 6 and PREL 4 in Win 7, 64-bit?
I'm currently running Adobe Photoshop Elements 6 and Premier Elements 4 under Windows Vista, 32-bit. I just ordered a new PC that will run Windows 7, 64-bit. Will the two programs run under the new system, or do I have to purchase newer versions?
-
Boris Title 3D Loads extremely slowly
My Boris Title 3D plug takes about 20 seconds to load...literally. I'm running FCP 5.1.4 on a Quad G5 with 3GB RAM. I haven't seen this behavior on other computers. Is anyone else having this problem, and do you know of a solution? Thanks. Macbook Pr
-
Lens Profile Data : Biogon_T_2.8_21_ZM ; Biogon_T_2.8_25_ZM ; Biogon_T_2.8_25_ZM ; Biogon_T_2_35_ZM ; CBiogon_T_2.8_35_ZM ; CSonnar_1.5_50_ZM ; CZ_Distagon_T_2_8_15_ZM ; LEICA_APO-SUMMICRON-M_50_mm_f2_ASPH ; Planar_T_2_50_ZM ; Sonnar_T_2_85_ZM ; Tele