An MD5 implementation for my final project (look inside)

Hey, I'll just cut to the chase: I'm making an MD5 implementation, from the pseudo-code on the wikipedia page, which is located here. This is what I have so far:
import java.util.Random;
public class MD {
static int i = 0;
static int f,g;
public static String MD5(String df) {
//Note: All variables are unsigned 32 bits and wrap modulo 2^32 when calculating
//r specifies the per-round shift amounts
int[] k = new int[64];
int r[] = {7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,
4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21};
{color:#000000}
{color}
{color:#000000}//Use binary integer part of the sines of integers (Radians) as constants:
for (int i = 0; i <= 63; i++)
k[i] =
+*}{color}*+
Random gen = new Random();+
*//Initialize variables:*
int h0 = 0x67452301;+
int h1 = 0xEFCDAB89;+
int h2 = 0x98BADCFE;+
int h3 = 0x10325476;+
+*{color:#ff6600}//Pre-processing:*+
*df {color}*+{color:#ff6600}*= 0x1;*
*//TODO: append "0" bits until message length in bits = 448 (% 512);*
*//**append bit / bit, not byte / length of unpadded message as 64-bit little-endian integer to message*
+//Process the message in successive 512-bit chunks:+
for each 512-bit chunk of message*
+break chunk into sixteen 32-bit little-endian words w, 0 <= i <= 15+*
+/+
+//Initialize hash value for this chunk:+
int w[] = new int[16];
for (int i = 0; i < w.length; i+)
w[i] = 0;
//what do I do here?
}{color}
int a = h0;
int b = h1;
int c = h2;
int d = h3;
//Main loop:
//from 0 to 63
for (; i < 64; i++)
if (0 <= i && i <= 15)
f = (b & c) | ((~ b) & d);
g = i;
else if (16 <= i && i <= 31)
f = (d & b) | ((~ d) & c);
g = (5*i +1) % 16;+
+}+
else if (32 <= i && i <= 47)
+{+
f = b ^ c ^ d;
g = (3*i 5) % 16;
else if (48 <= i && i <= 63)
f = c ^ (b | (~ d));
g = (7*i) % 16;
int temp = d;
//can be declared earlier?
d = c;
c = b;
{color:#ff6600}b += leftrotate((a ++ f + +k[i] ++ w[g]) , r[i]);{color}
a = temp;
//Add this chunk's hash to result so far:
h0 += a;+
h1 = b;
h2 += c;+
h3 = d;
int digest = h0 h1 h2 + h3;
String valrtn = Integer.toHexString(digest);
return valrtn;
//leftrotate function definition
{color:#ff6600}private static int leftrotate (int x, int c)
return ((x << c) | (x >> (32-c)));
//for some reason, this usually gives an error...
}{color}private static String ToHex (String df)
//not used right now...
public static void main (String[]args)
System.out.println(MD5((("1234567891113111"))));
//add to hex later
// String df = "1278186781234567812345678";
//s.t(df.substring(0,15));
//-1 from both
(The above code is copyright me, Chris Blake, and cannot be used without my permission, except for the comments, they're not mine.)
I'm having a problem with the colored parts, the first part is the part that's supposed to break the plaintext into chunks. (ignore the bold please) I just haven't quite figured out how to do it yet, and it always returns 88888884. The other orange parts have explanations with them.
Thanks in advance to all that help. :D
Also, is this in the right forum? Thanks in advance.
Edited by: Zeroknight on May 26, 2009 5:04 PM
Edited by: Zeroknight on May 26, 2009 5:15 PM

Hi,
You're going to find that there's only a very small group of people that want to install a program with a known exploit, and the developers aren't going to be keen on allowing ongoing access to faulty code.
Best bet would be to look for the source code. On the [http://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle website] there's the source for JDK 6; have a look around there. You may have to drop back a version to get access.
Ian.

Similar Messages

  • I need jre 7u5 plugin for firefox for my final project

    Hello!
    I'm IT student and for my security class I require to find an exploit, exploit a system, and then learn how this exploit works.
    I picked JRE 7u5 exploit.
    I downloaded that version of java from oracle archives but the problem is that I require a browser plugin.
    I tried to search for plugin on Google for more than few hours but I can't find anything useful...
    I though I could post this question here since there was this version of java released on plugin page once.
    My question is, could you please release JRE 7u5 plugin for Firefox please? Or do you know where I could find it? I really hoped I could use this exploit but the difficulty lays with finding the right plugin.
    Please give me a feedback how I could get JRE plugin for Firefox or any other browser!
    I will be using Windows XP SP 2 VM.
    Thank you in advance!

    Hi,
    You're going to find that there's only a very small group of people that want to install a program with a known exploit, and the developers aren't going to be keen on allowing ongoing access to faulty code.
    Best bet would be to look for the source code. On the [http://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle website] there's the source for JDK 6; have a look around there. You may have to drop back a version to get access.
    Ian.

  • Best DVD quality for 136 minute project

    Hello!
    I am putting together DVD's for a show from a local theatre. The runtime is around 136 minutes HD video shot with a Sony HDR-HC3.
    I did a rough copy to give to the director and used the 120 minute DVD settings in compressor. The quality was terrible and definitely not what i want for the final project. The HD video looks really good, and i've seen HD to SD DVD's still look pretty darn good on a decent TV.
    So what is probably by best option for exporting into DVD Studio? If you need any other details please let me know.
    Thanks

    what frame rate is your original material and what is the frame rate of your sequence?  If your original material is 23.98 fps, make sure you maintain that frame rate thru your workflow.  Adding compression markers in fcp around sections that have a lot of movement or are particularly complex may help.  Just make sure you include compression markers when you export to compressor.
    Also, deleting all renders and sending to compressor from within fcp may give you a bit more quality.
    And using a dual layer dvd will allow you to compress at a higher quality.  Unfortunately burned dual layer dvd's may not be as compatible as replicated dvds.

  • For a school project what ideal apple hardware do I need to connect an office of 11 lawyers, 8 paralegals, 7 secretaries, 1 office manager and 1 receptionist?

    I have to suggest the hardware for a final project and I want to suggest everythin apple.

    R C-R wrote:
    If the office is already wired for Ethernet cabling, you don't need anything besides a wired router with enough ports.
    If you want to go with a wireless network, an Apple Airport Extreme Base Station would be a great choice, assuming all the computers on the network have WiFi (Airport) capabilities.
    Or then again, maybe I misunderstood that question

  • PPL i need an idea for my final year project

    Hello ppl
    I have posted this topic before and am posting it once again...... I m a student of B.Sc final Year in Software Development....... I m looking for an idea for my final year project......I m very good at programming in Java..... also have some hands on experince of XML... nowadys reading abt voice XML.....
    So i anybody of u can suggest me something i will be extremely grateful.... i will prefer doing something for mobile phones... i.e. my target wud be J2ME..... but any other idea can also work...... but plz keep in mind that the project shud be of such length that it can last for 1 year..... also it shud be challenging......
    Thanx in Advance....
    I need it ppl... plz reply

    www.jabber.org does stuff with XML and instant messaging, and occasionally hints at involving phones. you might get some ideas from what they're doing.

  • Looking for a "Super Project" feature

    First, you will have to excuse me if this is the wrong forum for this. I just couldn't find any specific forum for Java project-build/management.
    Now, I'm looking for some sort of a feature/ability/plug-in, especially for Eclipse, which resembles this:
    Super projects - a combination of several projects under the same organizational structure. It doesn't refer to a new technology, nor a new feature of Java. It only refer to a way of organizing your projects.
    A reason to have such thing, in case you were wondering, is to standardize the use of certain projects, all closely-related (technically and logically) to a certain system, but aren't related enough to exist in the same project.
    For an example, let's say we have a certain system. It has a main project, which is the core of the system. Then, we have another project, which allows monitoring our system. It isn't a project that could be under the core-project, as it has too many differences (both technical and logical), but it uses lots of the same libraries, abilities and external resources the core-project uses as well (for example, a jar which allows a more comfortable use of JDBC, or just a configuration file), and of course still logically related to the core-project.
    Therefore, those two projects, the core and the monitor, should be under the same super project - sharing libraries, abilities and external resources.
    So how should it look like? Well, here are several ideas:
    - First of all, a certain way to view those projects as being under the same super-project.
    - An option (and warning-display if possible) of sharing jars. Instead of linking a certain jar to each project separately, a jar will be defined as shared, and could be shared by some or all of the projects in the super-project.
    - Same thing with any other file (such as resource files).
    - A meta-data file, containing information of which projects are in the super-project, what jars (or any other file) are being used, and what's the version of each of those jars.
    - Comfortable save/load of those projects together, and their shared files (nothing more then a super directory with "Projects" directory for the projects in the super project, and a "Shared" directory for all the shared jars and other files).
    I'll repeat myself - I'm not talking about a new technology, but just a feature, or a plug-in.
    So, are you familiar of anything resembling that? or something at least in production stage?

    EyalR wrote:
    Well, I didn't figured how the idea of a super-project, or several combined projects works with Maven. I guess it's because this tool is filled with many options, and there's no good documentation that I've found which simply explains what's every thing is (or maybe I'm just dumb).Having just recently taken the dive into real development with Maven recently (I've been dabbling before), I too have the feeling that the documentation (especially for the rough overview and getting-into-it) is somehow lacking, in many areas. The documentation is much better suited for finding specific information when you already know what exactly you want it Maven to do.
    That being said: I strongly suggest you invest the time to get over that first hurdle, because in my opinion it's definitely worth it.
    Anyway, it seems I'm looking for something more simple and straightforward.Out of curiosity: If it should be simple and straightforward, what artifacts would you expect such a product/technology to produce? What would you use it for?
    Maven uses that big pile of metadata about your project for building your project from source, managing your dependencies, deploying your artifacts to a defined repository, running your tests and many other things as well.
    Having something "simple and straightforward" would almost seem like a waste of effort, because with that kind of meta-data you can do much bigger things.
    Edit: I just remembered [Apache Ivy|http://ant.apache.org/ivy/]: it's a dependency-management task for ant. This means that it handles the same task of a (very small) subset of Maven, but it a lot simpler to use (if you already know and use ant). It doesn't do any sub-projects or anything like that, but might be a more gentle introduction into the world of post-ant build/project/configuration management.

  • Final Cut Export DVCPRO HD720p uncompressed/hi-res for tape and projection

    Well I've been through the many suggestions found throughout the forum and have tried many combinations of exporting options, timeline options and codecs and still for the life of me can't find the one that works. Please offer any advice you can.
    Objective:
    Export a 30 minute film with a DVCPro HD 720p60 timeline shot in 720p 23.98fps as uncompressed and as high resolution as possible for transfer to a Beta-SP for big screen projection.
    In trying the Uncompressed 8 and 10 bit exports the film's video became jumpy and some color's over saturated to the point of pixelation (is that a word?). I've created new Uncompressed timelines and exported from there as well to the same over saturated/pixel effect.
    Is just an export of a Quicktime movie with current settings and then use compressor with "DVDPRO HD 720p60" my best options? I've tried that too but not happy with the softness of some of it and as we're projecting BIG, I want to have the best resolution possible.
    Oh - and this time - size does NOT matter.
    Thanks for any pointers.

    What I mean is - how to create then a Quicktime someone without Final Cut can play. Exporting as a self-contained Quicktime movie does not seem to creat the stand alone file I may need. Any tips?

  • Hello, I am editing my final project at university on Premier Pro CC on mac, but when I try to load my project in Premier Pro CC for windows on my home pc I get  "codec missing or unavailable".

    Hello, I am editing my final project at university on Premier Pro CC on mac, but when I try to load my project in Premier Pro CC for windows on my home pc i get  "codec missing or unavailable". Something to do with Apples' ProRes 422 LT codec. Is there a way round this problem?

    I just went to the Miraizon site, who has been the sole licensee of ProRes for PC, to see if their $150/license download was still at that price.
    This is what I found ...
    They only sell a few of their other products, and the ProRes/DNxHD codec package only generates an email form to "support".
    I'm afraid you'll have to transcode those files to something like DNxHD or an avi codec or something to work them via PC. And I'd thought about purchasing that codec pack from them but kept putting it off. Now, I wish I'd bought it. Ah well.
    Neil

  • Duration of project implementation for an orgn

    duration of project implementation for an orgn?

    Hi
    It purely depends on The size of Client and Its Business process and The SAP Solution (e.g. SAP B1, MySAP SAP ECC etc)
    Refer below link on sdn
    project duration as per implementation phases
    Typical Duration
    Project preparation- 2 Months
    Blue print - 3 months
    Realization- 4 months
    Fina preparation- 2 months
    Golive
    There is Hard & Fast rule that all project go exactly,This depends up on clients also and they should provide the information and depends up on them also
    Message was edited by:
            SHESAGIRI.G

  • Looking for a small project via internet (part time )

    Hello!
    I'm a beginer in labview with only one year experience in device programming (e.g.-power supply) and i search for some little project for develop my skills in labview.
    I am available maximum 15 hours/week.
    If someone is interested plese e-mail at [email protected]

    You posted in the wrong forum.  This one is for companies posting jobs.  You want the one next to this one..

  • I need a solution of this complicated problem to finalize my final project

    Introduction
    This project revolves around an important text processing task, text compression. In particular, you will be required to encode a sequence of words read from a source file into binary strings (using only the characters 0 and 1). It is important to note that text compression makes it possible to minimize the time needed to transmit text over a low-bandwidth channel, such as infrared connection. Moreover, text compression is helpful in storing large documents more efficiently. The coding scheme explored in this project is the Huffman Coding Scheme. While standard encoding schemes, such as Unicode and ASCII, use fixed-length binary strings to encode characters, Huffman coding assigns variable-length codes to characters. The length of a Huffman code depends on the relative frequency of its associated character. Specifically, Huffman coding capitalizes on the fact that some characters are used more frequently than others to use short codewords when encoding high-frequency characters and long codewords to encode low-frequency characters. Huffman coding saves space over state of the art fixed-length encoding and is therefore at the heart of file compression techniques in common use today. Figure 1 shows the relative frequencies of the letters of the alphabet as they appear in a representative sample of English documents.
    Letter     Frequency     Letter     Frequency
    A     77     N     67
    B     17     O     67
    C     32     P     20
    D     42     Q     5
    E     120     R     59
    F     24     S     67
    G     17     T     85
    H     50     U     37
    I     76     V     12
    J     4     W     22
    K     7     X     4
    L     42     Y     22
    M     24     Z     2
    Figure 1. Relative frequencies for the 26 letters of the alphabet.
    Huffman coding and decoding
    Huffman’s algorithm for producing optimal variable-length codes is based on the construction of a binary tree T that represents the code. In other words, the Huffman code for each character is derived from a full binary tree known as the Huffman coding tree, or simply the Huffman tree. Each edge in the Huffman tree represents a bit in a codeword, with each edge connecting a node with its left child representing a “0” and each edge connecting a node with its right child representing a “1”. Each external node in the tree is associated with a specific character, and the Huffman code for a character is defined by the sequence of bits in the path from the root to the leaf corresponding to that character. Given codes for the characters, it is a simple matter to use these codes to encode a text message. You will have simply to replace each letter in the string with its binary code (a lookup table can be used for this purpose).
    In this project, you are not going to use the table given in Figure 1 to determine the frequency of occurrence per character. Instead, you will derive the frequency corresponding to a character by counting the number of times that character appears in an input file. For example, if the input file contains the following line of text “a fast runner need never be afraid of the dark”, then the frequencies listed in the table given in Figure 2 should be used per character:
    Character          a     b     d     e     f     H     i     k     n     O     r     s     t     u     v
    Frequency     9     5     1     3     7     3     1     1     1     4     1     5     1     2     1     1
    Figure 2. The frequency of each character of the String X.
    Based on the frequencies shown in Figure 2, the Huffman tree depicted in Figure 3 can be constructed:
    Figure 3. Huffman tree for String X.
    The code for a character is thus obtained by tracing the path from the root of the Huffman tree to the external node where that character is stored, and associating a left edge with 0 and a right edge with 1. In the context of the considered example for instance, the code for “a” is 010, and the code for “f” is 1100.
    Once the Huffman tree is constructed and the message obtained from the input file has been encoded, decoding the message is done by looking at the bits in the coded string from left to right until all characters are decoded. This can be done by using the Huffman tree in a reverse process from that used to generate the codes. Decoding the bit string begins at the root of the tree. Branches are taken depending on the bit value – left for ‘0’ and right for ‘1’ – until reaching a leaf node. This leaf contains the first character in the message. The next bit in the code is then processed from the root again to start the next character. The process is repeated until all the remaining characters are decoded. For example, to decode the string “0101100” in the case of the example under study, you begin at the root of the tree and take a left branch for the first bit which is ‘0’. Since the next bit is a ‘1’, you take a right branch. Then, you take a left branch (for the third bit ‘1’), arriving at the leaf node corresponding to the letter a. Thus, the first letter of the coded word is a. You then begin again at the root of the tree to process the fourth bit, which is a ‘1’. Taking 2 right branches then two left branches, you reach the leaf node corresponding to the letter f.
    Problem statement
    You are required to implement the Huffman coding/decoding algorithms. After you complete the implementation of the coding/decoding processes, you are asked to use the resulting Java code to:
    1.     Read through a source file called “in1.dat” that contains the following paragraph:
    “the Huffman coding algorithm views each of the d distinct characters of the string X as being in separate Huffman trees initially with each tree composed of a single leaf node these separate trees will eventually be joined into a single Huffman tree in each round the algorithm takes the two binary trees with the smallest frequencies and merges them into a single binary tree it repeats this process until only one tree is left.”
    2.     Determine the actual frequencies for all the letters in the file.
    3.     Use the frequencies from the previous step to create a Huffman coding tree before you assign codes to individual letters. Use the LinkedBinaryTree class that we developed in class to realize your Huffman coding trees.
    4.     Produce an encoded version of the input file “in1.dat” and then store it in an output file called “out.dat”.
    5.     Finally, the decoding algorithm will come into play to decipher the codes contained in “out.dat”. The resulting decoded message should be written to an output file called “in2.dat”. If nothing goes wrong, the text stored in “in1.dat” and the one in “in2.dat” must match up correctly.

    jschell wrote:
    I need a solution of this complicated problem to finalize my final project The solution:
    1. Write code
    2. Test code3. If test fails, debug code, then go to step 2.

  • Help Needed - FINAL PROJECT - SAAJ MESSAGING

    Hi there!
    currently im doing my final project and it involves sending and receiving soap messages.
    im working with sun java studio creator for the first time.
    i have done this example (excuse me for possible dumb errors im just a noobie):
    * Page1.java
    * Created on 6 de Novembro de 2006, 12:40
    package webapplication1;
    import com.sun.rave.web.ui.appbase.AbstractPageBean;
    import com.sun.rave.web.ui.component.Body;
    import com.sun.rave.web.ui.component.Form;
    import com.sun.rave.web.ui.component.Head;
    import com.sun.rave.web.ui.component.Html;
    import com.sun.rave.web.ui.component.Link;
    import com.sun.rave.web.ui.component.Page;
    import javax.faces.FacesException;
    import com.sun.rave.web.ui.component.Button;
    import com.sun.rave.web.ui.component.TextArea;
    //soap saaj
    import javax.xml.*;
    import javax.xml.soap.*;
    import java.net.URL;
    import java.net.*;
    import java.util.*;
    import javax.xml.soap.SOAPConnectionFactory;
    import javax.xml.soap.SOAPConnection;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPPart;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPElement;
    // add this import if you need soapaction
    import javax.xml.soap.MimeHeaders;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamResult;
    import com.sun.xml.messaging.saaj.*;
    import java.net.URL;
    import javax.xml.soap.*;
    import java.util.Iterator;
    import javax.xml.soap.Name;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPPart;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPBodyElement;
    import javax.xml.messaging.ReqRespListener;
    import java.text.NumberFormat;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamResult;
    import com.sun.xml.messaging.saaj.*;
    * <p>Page bean that corresponds to a similarly named JSP page. This
    * class contains component definitions (and initialization code) for
    * all components that you have defined on this page, as well as
    * lifecycle methods and event handlers where you may add behavior
    * to respond to incoming events.</p>
    import javax.xml.messaging.JAXMServlet;
    //extends JAXMServlet
    public class Page1 extends AbstractPageBean implements ReqRespListener{
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
    private int __placeholder;
    * <p>Automatically managed component initialization. <strong>WARNING:</strong>
    * This method is automatically generated, so any user-specified code inserted
    * here is subject to being replaced.</p>
    private void _init() throws Exception {
    private Page page1 = new Page();
    public Page getPage1() {
    return page1;
    public void setPage1(Page p) {
    this.page1 = p;
    private Html html1 = new Html();
    public Html getHtml1() {
    return html1;
    public void setHtml1(Html h) {
    this.html1 = h;
    private Head head1 = new Head();
    public Head getHead1() {
    return head1;
    public void setHead1(Head h) {
    this.head1 = h;
    private Link link1 = new Link();
    public Link getLink1() {
    return link1;
    public void setLink1(Link l) {
    this.link1 = l;
    private Body body1 = new Body();
    public Body getBody1() {
    return body1;
    public void setBody1(Body b) {
    this.body1 = b;
    private Form form1 = new Form();
    public Form getForm1() {
    return form1;
    public void setForm1(Form f) {
    this.form1 = f;
    private Button button1 = new Button();
    public Button getButton1() {
    return button1;
    public void setButton1(Button b) {
    this.button1 = b;
    private TextArea textArea1 = new TextArea();
    public TextArea getTextArea1() {
    return textArea1;
    public void setTextArea1(TextArea ta) {
    this.textArea1 = ta;
    private TextArea textArea2 = new TextArea();
    public TextArea getTextArea2() {
    return textArea2;
    public void setTextArea2(TextArea ta) {
    this.textArea2 = ta;
    // </editor-fold>/*
    public MessageFactory messageFactSent= null;
    public MessageFactory messageFactReply=null;
    public MessageFactory messageFactReceiv= null;
    public SOAPConnectionFactory soapConnectionFact;
    public URL URLendpoint;
    public SOAPConnection connection ;
    public SOAPMessage messageSent;
    public SOAPPart soapPartSent;
    public SOAPEnvelope soapEnvelopeSent;
    public SOAPBody SoapBodySent;
    public SOAPMessage messageReceiv;
    public SOAPPart soapPartReceiv;
    public SOAPEnvelope soapEnvelopeReceiv;
    public SOAPBody SoapBodyReceiv;
    public SOAPMessage messageReply;
    public SOAPPart soapPartReply;
    public SOAPEnvelope soapEnvelopeReply;
    public SOAPBody SoapBodyReply;
    public SOAPMessage reply;
    public String StringAux="";
    public final String theURI = "http://172.16.5.223:8080/WebApplication1/";
    //public final String theURI = "http://172.16.5.223:8080/WebApplication1/";
    //public final String theURI = "http://172.16.5.193:8080/WebApplication1/";
    //http://localhost:8080/WebApplication1/faces/Page1.jsp
    public SOAPMessage onMessage(SOAPMessage message) {
    StringAux=StringAux+"On message called in receiving servlet\n";
    this.textArea1.setValue(StringAux);
    try {
    soapPartReceiv = message.getSOAPPart( );
    soapEnvelopeReceiv = soapPartReceiv.getEnvelope();
    SoapBodyReceiv = soapEnvelopeReceiv.getBody();
    //analise...if needed
    // Create the reply message
    messageReply = messageFactReply.createMessage();
    soapEnvelopeReply = messageReply.getSOAPPart().getEnvelope();
    SoapBodyReply= soapEnvelopeReply.getBody();
    // Remove empty header from the Envelope
    soapEnvelopeReply.getHeader().detachNode();
    Name bodyName = soapEnvelopeReply.createName("GetLastTradePrice",
    "m", "http://wombat.ztrade.com");
    SOAPBodyElement gltp = SoapBodyReply.addBodyElement(bodyName);
    Name name = soapEnvelopeReply.createName("symbol");
    SOAPElement symbol = gltp.addChildElement(name);
    symbol.addTextNode("SUNW");
    // Return a reply message back to the JAXM client
    StringAux=StringAux+"devolveu menssagem\n";
    this.textArea1.setValue(StringAux);
    return messageReply ;
    } catch(Exception e) {
    StringAux=StringAux+"Error in processi ng or replying to a message - e: " + e+"\n";
    this.textArea1.setValue(StringAux);
    return null;
    //this.getBean(name)
    public Page1() {
    // Service serve=new Service();
    // Client cli=new Client();
    // this.textArea1.setValue(serve.GetAux());
    // this.textArea2.setValue(cli.GetAux());
    // Create a MessageFactory
    try {
    URLendpoint=new URL(theURI);
    StringAux=StringAux+"depois de criar o endpoint \n";
    //Create SOAP connection
    soapConnectionFact = SOAPConnectionFactory.newInstance();
    connection = soapConnectionFact.createConnection();
    // Create a message from the message factory.
    messageFactSent = MessageFactory.newInstance();
    messageFactReply = MessageFactory.newInstance();
    messageFactReceiv = MessageFactory.newInstance();
    StringAux=StringAux+"depois de criar as message factory \n";
    this.textArea1.setValue(StringAux);
    } catch(Throwable e) {
    StringAux="erro2!\n"+StringAux+e.toString()+"\n";
    this.textArea1.setValue(StringAux);
    * <p>Return a reference to the scoped data bean.</p>
    protected ApplicationBean1 getApplicationBean1() {
    return (ApplicationBean1)getBean("ApplicationBean1");
    * <p>Return a reference to the scoped data bean.</p>
    protected RequestBean1 getRequestBean1() {
    return (RequestBean1)getBean("RequestBean1");
    * <p>Return a reference to the scoped data bean.</p>
    protected SessionBean1 getSessionBean1() {
    return (SessionBean1)getBean("SessionBean1");
    * <p>Callback method that is called whenever a page is navigated to,
    * either directly via a URL, or indirectly via page navigation.
    * Customize this method to acquire resources that will be needed
    * for event handlers and lifecycle methods, whether or not this
    * page is performing post back processing.</p>
    * <p>Note that, if the current request is a postback, the property
    * values of the components do <strong>not</strong> represent any
    * values submitted with this request. Instead, they represent the
    * property values that were saved for this view when it was rendered.</p>
    public void init() {
    // Perform initializations inherited from our superclass
    super.init();
    // Perform application initialization that must complete
    // before managed components are initialized
    // TODO - add your own initialiation code here
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
    // Initialize automatically managed components
    // Note - this logic should NOT be modified
    try {
    _init();
    } catch (Exception e) {
    log("Page1 Initialization Failure", e);
    throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
    // </editor-fold>
    // Perform application initialization that must complete
    // after managed components are initialized
    // TODO - add your own initialization code here
    * <p>Callback method that is called after the component tree has been
    * restored, but before any event processing takes place. This method
    * will <strong>only</strong> be called on a postback request that
    * is processing a form submit. Customize this method to allocate
    * resources that will be required in your event handlers.</p>
    public void preprocess() {
    * <p>Callback method that is called just before rendering takes place.
    * This method will <strong>only</strong> be called for the page that
    * will actually be rendered (and not, for example, on a page that
    * handled a postback and then navigated to a different page). Customize
    * this method to allocate resources that will be required for rendering
    * this page.</p>
    public void prerender() {
    * <p>Callback method that is called after rendering is completed for
    * this request, if <code>init()</code> was called (regardless of whether
    * or not this was the page that was actually rendered). Customize this
    * method to release resources acquired in the <code>init()</code>,
    * <code>preprocess()</code>, or <code>prerender()</code> methods (or
    * acquired during execution of an event handler).</p>
    public void destroy() {
    public String button1_action() {
    try {
    StringAux=StringAux+"antes de criar a messagem para enviar\n";
    messageSent = messageFactSent.createMessage();
    soapEnvelopeSent = messageSent.getSOAPPart().getEnvelope();
    //SoapBodySent = messageSent.getSOAPPart().getEnvelope().getBody();
    SoapBodySent = soapEnvelopeSent.getBody();
    Name bodyName = soapEnvelopeSent .createName("GetLastTradePrice",
    "m", "http://wombat.ztrade.com");
    SOAPBodyElement gltp = SoapBodySent.addBodyElement(bodyName);
    Name name = soapEnvelopeSent.createName("symbol");
    SOAPElement symbol = gltp.addChildElement(name);
    symbol.addTextNode("SUNW");
    StringAux=StringAux+"\nContent of the message: \n"+messageSent.toString()+"\n";
    // Send the SOAP message and get reply
    StringAux=StringAux+"Sending message to URL: \n"+ URLendpoint+"\n"+this.URLendpoint.getPath()+"\n";
    reply = connection.call(messageSent,URLendpoint);
    StringAux=StringAux+"\n\n Content of the reply message: \n"+reply.toString()+"\n";
    this.textArea1.setValue(StringAux);
    //tratamento da resposta
    connection.close();
    } catch(Throwable e) {
    StringAux="erro!\n"+StringAux+e.toString()+"\n";
    this.textArea1.setValue(StringAux);
    return null;
    Very simple , on a click of the button a message was supost to be sent. and receive on the other machine. i have launched the same war file on both pcs
    but now nothing happens just a exception message
    com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP
    ....could someone help me out here ,even share a wprking project with this goal
    thank you in advance
    DMS
    Message was edited by:
    DaniDaOne

    One time, after quitting IM and re-launching it later, my project disappeared from the project list.
    Apple Support told me to do this.
    1) quit IM
    2) with the finder, move the project out of the project directory
    3) launch IM
    4) quit IM
    5) with the finder, put the project back into the project directory
    6) launch IM
    My project re-appeared. He said these steps forces a project index to be rebuilt.
    Your symptoms are different but maybe the cure is the same --- good luck.

  • Configuring Log4j for a EJB Project.

    Hi,
    I have a weblogic EJB project as a Ear file. The project has no web components (so war file). I want to know which is the ideal way to initialize log4j in this situation.
    I can use listener class thro' weblogic-application.xml. But there is no neat way to passing the log4j.xml thro' parameter from weblogic-applicaiton.xml file.
    If we are using servlet we could use init-parm to passing xml file. I don't want to hard code the xml file location in the listener class.
    What is the best practice to initialize log4j for a EJB project?
    Thanks in advance.
    Anand

    Dan,
    I had a similar problem because I wanted to define my own log4j config regardless of what other portal apps were deployed in the BEA domain or what log4j was the default for the domain. This is what I do:
    1) Put your log4j config file in the WEB-INF classes dir (or I guess it could be in some other place that the CLASSPATH knows of)
    2) Create a servlet that looks like:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.apache.log4j.xml.*;
    public class Log4jInitServlet extends HttpServlet {
    private static final long serialVersionUID = 23456;
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    DOMConfigurator.configure(Thread.currentThread().getContextClassLoader().getResource("myLog4jConfigFile.xml"));
    public void doGet(HttpServletRequest req, HttpServletResponse resp) {
    3) Add the servlet definition in the web.xml and add a <load-on-startup>1</load-on-startup>
    That should do it.
    - Peter

  • Premiere Pro CS3 - How to Save a Final Project to Make Changes to Afterwards

    OK, I just registered to the forum and this is my first post/question.
    I'm fairly new to Premiere Pro editing
    , and I wondered if there was a way to save the whole edited project/sequence to an external drive in case the client wanted changes to the project after they had viewed it.
    I edit mostly weddings, so the projects are anywhere from 1hr 30m to 1hr 50m. I've watched all the lynda.com tutorials on Premiere, and I know about saving the final project as an ISO image file or as DVD folder, etc.
    Also, I thought I remembered hearing something about being able to 'delete' the footage that wasn't used in the project too, and just saving the edited project somehow? I just thought I'd ask before I go ahead and delete all the footage that pertains to this edit. I've made an ISO file, but it doesn't look like Premiere will load it; nor will it load the video_ts files/folder.
    Anyway, so my questions are:
    1. Is there a way to load an ISO file to make editing changes?
    2. If not, then how could I save the whole project/sequence in order to load it back into Premiere to make any changes to the original edit?
    3. Does anyone here use Premiere for wedding edits? And if so, how do you 'save' projects for the longterm, in case you wanted to make changes to it?
    4. Once you have an ISO image file saved, how do you burn it through Encore? Or am I forced to use the Roxio Creator program?
    I guess that's it for now. I'm sure there are many more questions that I need answered, but I'll save them for later. :-)
    Thanks in advance for any and all suggestions!

    I do a LOT of weddings. Here's the process I've come up with over the years.
    First, make a window dub of the whole thing. Sit down in front of a properly calibrated TV and home theater system and watch it from beginning to end. Make notes on what needs correction (here's where the visible timecode comes in handy) - music selections, audio levels, clips to be trimmed, color corrections, misspellings, etc.
    Then, make those changes.
    Next, author the final DVD for client review. Send that out with appropriate paperwork for a signed approval. Never delete/archive a project without client approval. Now, because some clients would take literally months to approve a project, I instituted a time limit of three weeks. After that, any project is considered approved and may be archived. I make this very clear, with the deadline in writing, when I send out the review sample.
    If the video comes back for changes, things are still in place and I just make the requested changes, sending out another review copy with a two week limit this time. When an approval comes back or if a time limit passes, I finish up the project.
    I make any remaining client copies, plus one copy of the DVD to go on a shelf. I also make an ISO for storage on an internal hard drive, to be moved later to an external hard drive at the end of every year. This gives me two master copies of the finished DVD.
    I then save the project file, music and other audio selections, pictures and graphics to a CD (DVD if more space is needed, but this is rare). I make two copies in case one goes bad, and file them by groom's last name in a small CD file case. The previews and conformed files can always be rebuilt, so there's no need to save them. The actual media can be recaptured from tape, so they just get put on a shelf.

  • Is Illustrator (or Photoshop) the best path for this design project?

    Hello,
    Forgive my ignorance on this issue.
    I am thinking about creating a number of large banners (8 feet high by 3 feet wide) for a display.
    I would like to take some scanned images of some historical mural paintings (out of copyright) and prepare them for large format printing.
    Now these images are small, and probably quite poor in resolution. I would like to prepare (enhance?) these images so that they show fairly well on the large banners.
    Furthermore, I will probably add some borders around them or at least some kind of neutral-colour field on the top and bottom of the image--so the actually printed image will probably be around 4 feet fight by 3 feet wide.
    I thought about hiring a designer, but I would like to pick up the skills to do this myself, as I anticipate more banners in the future, and it would be good to learn this skill.
    Willing to do take some courses in the appropriate software, and make this my first project perhaps.
    Is Illustrator or Photoshop better for this? Or is there something else?
    Thank you for any guidance you can offer.

    markerline,
    You may look at it this way (literally):
    The crucial aspect is the relation between viewing distance and size.
    The required number of actual pixels is proportional to the actual size and reversely proportional to the viewing distance.
    In other words: if you look at a poster (or whatever) twice the size at twice the distance, exactly the same number of pixels is required.
    In yet other words: if you view the artwork at a combination of size and distance that correspond to those intended for the final poster, you can see how it will appear.
    In yet other words: the same proportion between size and distance results in the same viewing angle, so if your viewing angle is the same, whatever the size, you see what the final viewer sees.
    This means that you may judge the artwork on screen or in small/moderate size print if you view it at the intended angle/relative distance.
    The required resolution in PPI/DPI will then be reversely proportional to the size of the artwork while you work on it (10 times greater for a 1:10 scale and so on).
    Obviosly, in addition, there are other concerns about required resolution (including which resolution is really effective in connexion with the kind of printing in question, and the desirability of smoothness versus roughness which depends on the artwork/effect/whatever in question). I believe you know all that.

Maybe you are looking for

  • How to provide hyperlink for a particular field in ALV

    Hi,   How to provide hyperlink for a particular field in alv report. Regards, Ramu.

  • Limiting rotation of Transform to one axis at a time.

    I have a situation where I want to force a transform returned from a picking tool to only rotate around or translate along a single axis. To do this, I'm using the transformChanged() function shown below. It works fine for the translation changes, bu

  • SYNCHRONIZING a MAPPING  in OWB 11.2.0.3

    Hello folks, I am running into a weird issue with my OWB Mappings and synchrinization. Here is what I am experiencing: 1). I update my staging table to add new columns within the design center 2). I go into my corresponding Mapping and try to synchro

  • Rmi load balancer

    hey, i've started writing a basic rmi dispatcher to distribute the work of a search engine and i was wondering what the best way to balance load among available machines on the network would be. does rmi have any built in methods to calculate the wor

  • Package org.relaxng.datatype does not exist

    I'm migrating my JAXB code from jwdsp1.1 to jwdsp1.2, and the xjc tool now yields code that doesn't compile! What gives?? The error I'm getting in my compiler is: edgar/jaxb/impl/runtime/UnmarshallingContext.java [21:1] package org.relaxng.datatype d