Uploading problem with my servlet..

Hi All,
I have spent almost several hours yesterday trying to figure this out.
Here is the issue.
I have written a servlet that uploads the files, not it works flawlessly with text files but when I upload binary data then there is a 2 bytes difference beetween the actual file and the file I upload. Hence corrupting the binary files.
Can some one who might have come accross this shed some light...?
thanks again

Show us your code. Remember to use
[code]...[/code] tags or the "code"
button on the forum posting form.I have attached my core, I am just trying to make this work at this point so please forgive my lack of docs coding ...
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
public class TestUpload extends HttpServlet {
    private URL contextPath;
    private String FILE_SEPARATOR;
    private static final String FILE_SEPARATOR_PROPERTY = "file.separator";
    private static final String MULTIPART_BEGIN_STRING = "Content-Disposition";
    private static final String MULTIPART_CONTENT_TYPE = "Content-Type";
    private static final String MULTIPART_BOUNDARY_FLAG = "-----------------------------";
    public void init(ServletConfig servletConfig) throws ServletException {
        super.init(servletConfig);
        try {
            contextPath = servletConfig.getServletContext().getResource("/uploads");
            FILE_SEPARATOR = System.getProperty(FILE_SEPARATOR_PROPERTY);
        } catch (MalformedURLException mfe) {
            mfe.printStackTrace();
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doWork(request, response);
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doWork(request, response);
    public void doWork(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        processRequest(request);
        //sendResponse(request,response);
    public synchronized void processRequest(HttpServletRequest request) throws ServletException, IOException {
        ServletInputStream servletInputStream = request.getInputStream();
        FileOutputStream fileOutputStream = null;
        int buffLen = 1024;
        int lineCtr = 0;
        String boundaryStart = "", boundaryEnd = "";
        boolean isOK = true, isData = false;
        String fileName = "";
        String previousLine = "";
        byte[] prevBytes = new byte[buffLen];
        int preRead = 0;
        int pre = 0;
        byte[] inputBytes = new byte[buffLen];
        int readLen = 0;
        while ((readLen = servletInputStream.readLine(inputBytes, 0, buffLen)) > -1) {
            String line = new String(inputBytes, 0, readLen).trim();
            //System.out.println(lineCtr+" LINE - "+line);
            if (line != null && line.indexOf(MULTIPART_BOUNDARY_FLAG) > -1 && boundaryStart.equals("")) {//parse multipart data
                boundaryStart = line.trim();
                boundaryEnd = boundaryStart + "--".trim();
                System.out.println("Start Parsing:" + boundaryStart);
            } else if (line != null && line.indexOf(boundaryEnd) > -1) {//end parsing multipart data for one file
                System.out.println("End Parsing:" + boundaryEnd/*+"\nPrevious Line was = ["+previousLine.trim()+"]"*/);
                if (isData && prevBytes != null) {
                    String tline = getLine(previousLine.getBytes());
                    System.out.println(lineCtr + " WRITING LAST LINE - " + tline);
                    updateFile(tline.getBytes(), tline.getBytes().length, fileOutputStream);
                    //updateFile(prevBytes, preRead, fileOutputStream);
                closeFile(fileOutputStream, fileName);
                boundaryStart = "";
                boundaryEnd = "";
                fileName = "";
                fileOutputStream = null;
                preRead = 0;
                isData = false;
            } else {
                if (fileName.equals("") && line != null && line.indexOf(MULTIPART_BEGIN_STRING) > -1) {
                    fileName = getFileName(line);
                    fileOutputStream = createWriteFile(fileName);
                    System.out.println("fileName = " + fileName);
                } else if (!fileName.equals("") && line != null && line.indexOf(MULTIPART_CONTENT_TYPE) > -1) {
                    continue;
                } else if (isOK && line != null && line.length() == 0) {
                    continue;
                } else {
                    if (isData) {
                        //System.out.println(lineCtr+" WRITING LINE - "+ previousLine+"\nXX prevBytes="+new String(prevBytes,0,preRead));
                        updateFile(previousLine.getBytes(), preRead, fileOutputStream);
                    isOK = false;
                    isData = true;
                    previousLine = new String(inputBytes, 0, readLen);
                    preRead = previousLine.getBytes().length;//readLen;
                    //System.out.println("prevBytes = "+new String(prevBytes,0,preRead));
            lineCtr++;
        }//end of while loop
    public String getFileName(String line) {
        String fileName = "";
        if (line != null && line.indexOf("filename") > -1) {
            if (line.indexOf("\"") > -1) {
                line = line.replaceAll("\"", "");
            if (line.indexOf("\n") > -1) {
                line = line.replaceAll("\n", "");
            if (line.indexOf("\r") > -1) {
                line = line.replaceAll("\r", "");
            String[] arr = line.split(" ");
            String strA = arr[arr.length - 1];
            if (strA != null && strA.indexOf("=") > -1) {
                String[] strB = strA.split("=");
                if (strB != null && strB.length > 1) {
                    fileName = strB[strB.length - 1];
                    if (fileName.indexOf("\\") > -1) {
                        fileName = fileName.substring(fileName.lastIndexOf("\\") + 1);
                    if (fileName.indexOf("/") > -1) {
                        fileName = fileName.substring(fileName.lastIndexOf("/"));
        return fileName;
    public FileOutputStream createWriteFile(final String fileName) {
        FileOutputStream fos = null;
        if (fileName != null && !fileName.equals("")) {
            File file = new File(contextPath.getPath());
            file.mkdirs();
            //System.out.println("contextpath = "+contextPath+"\nfileName = "+fileName+"\nabsolute path = "+file.getAbsolutePath());
            try {
                String strFileName = file.getAbsolutePath() + FILE_SEPARATOR + fileName.trim();
                System.out.println("Begin: FILE Create:" + strFileName);
                fos = new FileOutputStream(new File(strFileName));
            } catch (IOException ioe) {
                ioe.printStackTrace();
        return fos;
    public void closeFile(FileOutputStream fileOutputStream, String fileName) {
        try {
            if (fileOutputStream != null) {
                fileOutputStream.flush();
                fileOutputStream.close();
                File file = new File(contextPath.getPath());
                String strFileName = file.getAbsolutePath() + FILE_SEPARATOR + fileName.trim();
                System.out.println("End: FILE Close:" + strFileName);
            } else {
                System.out.println("File objet is NULL");
        } catch (IOException ioe) {
            ioe.printStackTrace();
    public void updateFile(byte[] readData, final int readLength, FileOutputStream fileOutputStream) {
        if (fileOutputStream != null) {
            try {
                //System.out.println("LINE:"+line);
                fileOutputStream.write(readData, 0, readLength);
                //System.out.println("fileOutputStream= "+((null==fileOutputStream)?"NULL":"NOT NULL"));
            } catch (IOException ioe) {
                ioe.printStackTrace();
    private synchronized String getLine(byte[] bytes) throws IOException {
        int read = bytes.length, index;
        String line = null;
        if (read != -1) {
            line = new String(bytes, 0, read);
            if ((index = line.indexOf('\n')) >= 0) line = line.substring(0, index - 1);
            line.trim();
        return line;
}Please I hope some one can shed some light.
Its clear to me that there is a logical error thats because of my lack of understanding of the input/output stream the way its being transferred to servlet and then being parsed before written. But I have not been able to put my head around.
Thanks for any one who tries to help

Similar Messages

  • Uploading problem with Ebay and Dreamweaver MX

    I am unable to sync websites with Dreamweaver MX 6.01. When I connect to the remote server, it shuts down the program. I have reinstalled the program, but it still does it. Also, when I use Safari, Opera, and Firefox to upload photos on Ebay, the upload process fails completely, and blows me directly into My Ebay, as if I was not on the selling page at all. I have to go to my PC to do the photo uploads. Seems like it may be a related issue, some kind of uploading problem with Rosetta, or something. I am using a Macbook Pro with the 2.0Ghz processor, connected with ethernet cable, and firewall is set to off. Any ideas?

    For E-Bay you might try the following:
    Type the following command in Terminal (while Safari is NOT running):
    defaults write com.apple.Safari IncludeDebugMenu 1
    Then launch Safari, and you will be able to use the new Debug menu.
    If you ever wish to disable it again, just repeat the command with a "0" instead of a "1".
    Under the Debug menu, you'll see the User Agent sub-menu; select Windows MSIE 6.0 from the list and then try connecting to your web site
    Dreamweaver you might need to update your version.
    To Dreamweaver 8.01
    http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=f56452a8

  • Upload problems with Facebook and Vimeo from Premiere Elements 10

    I have created a project in HD and am trying to upload to Vimeo.  Premiere Elements 10 does not have a preset so I followed some instructions from the Vimeo website.  Project is "blurry" when viewed.  I checked with Vimeo and they said what they converted matches what I sent so the problem must be in the export - bit rate may be incorrect.  Can anyone give me the correct presets for Vimeo from Premiere Elements 10.  I can view other people's video in HD and they look fine so I don't think it's my computer monitor.   I'm sure you will need more information about my project so please give me a list of specific things you need to know.  Thank you.
    My Facebook problem is as follows.  If I use the preset from Premiere Elements 10 to upload to Facebook it looks fine, HD quality as expected.  Problem is, I would like to upload to my business page.  Since the personal page and the business page (managed by my personal account) share a login, the preset always loads to my personal page.  Does anyone know the values of the preset so I can upload the video to my business page.  My business is event and wedding videography so I would like the posts to be as clear as possible.
    If the problem with the Vimeo uploads is solved then I suppose I can just share the Vimeo file on Facebook.  Thank you.

    VDRAVES
    I think that you are overlooking what you already have with regard to a Vimeo HD preset for export to file for upload of the saved file at the Vimeo website.
    Please see
    Share/Computer/AVCHD with Presets = Vimeo HD
    Under the Advanced Button/Video Tab, you can customize the preset further from 1280 x 720 to 1920 x 1080 and increase the bitrate, if necessary, to a level that does not give you a prohibitive file size. With Profile = Main and Level = 3.1, the bitrate range is 0.19 to 14 Mbps (megabits per second).
    I would start with the default bitrates of Target = 8 Mbps and Maximium = 9 Mbps and explore and experiment from there.
    If you customize the preset to 1920 x 1080 in the Export Settings customization area, then change the Profile to High and the Level to 5.1
    When you do that the bitrate range will be 0.19 to 300 Mbps instead of 0.19 to 14 Mbps.
    In all cases, watch for file size versus bitrate versus quality of end product.
    Please give that a look and then let us know if the above resolves your Vimeo and Facebook question.
    Please review and let us know the outcome.
    Thank you.
    ATR

  • Problem with SOAP Servlet

    Hi,
    I have a SOAP servlet, but It is the fist SOAPServlet as I use.
    I think that the vsd that developper of SOAP servlet provide is ok.
    But, I do not understand which is the XML that I could provide to it.
    It is posible that I have a problem with XML, SCHEMA and SOAP.
    Could you help me , I attach the VSD, but I need a tool or a sample file in order to call my SOAP servlet.
    <xsd:schema xmlns:xsd="http://schemas.xmlsoap.org/soap/encoding">
        <xsd:complexType name="STD_TRN1_I_PARM_V_TYPE">
          <xsd:sequence>
            <xsd:element name="COD_TX_DI">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00004"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="ID_INTERNO_TERM_TN">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00008"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="ID_EMPL_AUT">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00008"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="NUM_SEC">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00007"/>
                    <fractionDigits value="00"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="COD_TX">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00008"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="TR_CONS_SALDOS_VISTA_EVT_Y_TYPE">
          <xsd:sequence>
            <xsd:element name="COD_CENT_UO">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00004"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="NUM_SEC_AC">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00010"/>
                    <fractionDigits value="00"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="COD_NRBE_EN">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00004"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="STD_TRN1_O_PARM_V_TYPE">
          <xsd:sequence>
            <xsd:element name="HORA_OPRCN" type="xsd:time"/>
            <xsd:element name="FECHA_OPRCN" type="xsd:date"/>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_DISPO_V_TYPE">
          <xsd:sequence>
            <xsd:element name="STD_DEC_15Y2">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_SDO_CONTABLE_V_TYPE">
          <xsd:sequence>
            <xsd:element name="IMP_SDO">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_SDO_RETEN_V_TYPE">
          <xsd:sequence>
            <xsd:element name="IMP_SDO">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_SDO_AUT_V_TYPE">
          <xsd:sequence>
            <xsd:element name="IMP_SDO">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_SDO_INCID_V_TYPE">
          <xsd:sequence>
            <xsd:element name="IMP_SDO">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_BLOQUEOS_V_TYPE">
          <xsd:sequence>
            <xsd:element name="STD_CHAR_01">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00001"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_SDO_CONECT_V_TYPE">
          <xsd:sequence>
            <xsd:element name="IMP_SDO">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="COD_IDIOMA_V_TYPE">
          <xsd:sequence>
            <xsd:element name="COD_IDIOMA">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00002"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_ANOTACIONES_V_TYPE">
          <xsd:sequence>
            <xsd:element name="STD_CHAR_01">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00001"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="TR_CONS_SALDOS_VISTA_EVT_Z_TYPE">
          <xsd:sequence>
            <xsd:element name="COD_NUMRCO_MONEDA">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00003"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="PSV_DISPO_V" type="PSV_DISPO_V_TYPE"/>
            <xsd:element name="PSV_SDO_CONTABLE_V" type="PSV_SDO_CONTABLE_V_TYPE"/>
            <xsd:element name="PSV_SDO_RETEN_V" type="PSV_SDO_RETEN_V_TYPE"/>
            <xsd:element name="PSV_SDO_AUT_V" type="PSV_SDO_AUT_V_TYPE"/>
            <xsd:element name="PSV_SDO_INCID_V" type="PSV_SDO_INCID_V_TYPE"/>
            <xsd:element name="PSV_BLOQUEOS_V" type="PSV_BLOQUEOS_V_TYPE"/>
            <xsd:element name="PSV_SDO_CONECT_V" type="PSV_SDO_CONECT_V_TYPE"/>
            <xsd:element name="COD_CSB_OF">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00004"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="NOMB_50">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00050"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="COD_INTERNO_UO">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00004"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="COD_IDIOMA_V" type="COD_IDIOMA_V_TYPE"/>
            <xsd:element name="PSV_ANOTACIONES_V" type="PSV_ANOTACIONES_V_TYPE"/>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="STD_TRN1_MSJ_PARM_V_TYPE">
          <xsd:sequence>
            <xsd:element name="TEXT_ARG1">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00018"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="TEXT_CODE" type="xsd:int"/>
          </xsd:sequence>
        </xsd:complexType>
    <xsd:complexType name="TR_CONS_SALDOS_VISTA_TRN1">
        <xsd:complexType name="TR_CONS_SALDOS_VISTA_TRN1_O_TYPE">
          <xsd:sequence>
            <xsd:element name="RTRN_CD" type="xsd:int"/>
            <xsd:element name="STD_TRN1_O_PARM_V" type="STD_TRN1_O_PARM_V_TYPE"/>
            <xsd:element name="TR_CONS_SALDOS_VISTA_EVT_Z" type="TR_CONS_SALDOS_VISTA_EVT_Z_TYPE"/>
            <xsd:complexType name="STD_TRN1_MSJ_PARM_V_OCCURS">
                <xsd:element name="STD_TRN1_MSJ_PARM_V" type="STD_TRN1_MSJ_PARM_V_TYPE" maxOccurs="000005"/>
            </xsd:complexType>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="TR_CONS_SALDOS_VISTA_TRN1_I_TYPE">
          <xsd:sequence>
            <xsd:element name="STD_TRN1_I_PARM_V" type="STD_TRN1_I_PARM_V_TYPE"/>
            <xsd:element name="TR_CONS_SALDOS_VISTA_EVT_Y" type="TR_CONS_SALDOS_VISTA_EVT_Y_TYPE"/>
          </xsd:sequence>
        </xsd:complexType>
    </xsd:complexType>
    </xsd:schema>Thanks you

    Hi,
    I have a SOAP servlet, but It is the fist SOAPServlet as I use.
    I think that the vsd that developper of SOAP servlet provide is ok.
    But, I do not understand which is the XML that I could provide to it.
    It is posible that I have a problem with XML, SCHEMA and SOAP.
    Could you help me , I attach the VSD, but I need a tool or a sample file in order to call my SOAP servlet.
    <xsd:schema xmlns:xsd="http://schemas.xmlsoap.org/soap/encoding">
        <xsd:complexType name="STD_TRN1_I_PARM_V_TYPE">
          <xsd:sequence>
            <xsd:element name="COD_TX_DI">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00004"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="ID_INTERNO_TERM_TN">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00008"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="ID_EMPL_AUT">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00008"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="NUM_SEC">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00007"/>
                    <fractionDigits value="00"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="COD_TX">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00008"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="TR_CONS_SALDOS_VISTA_EVT_Y_TYPE">
          <xsd:sequence>
            <xsd:element name="COD_CENT_UO">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00004"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="NUM_SEC_AC">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00010"/>
                    <fractionDigits value="00"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="COD_NRBE_EN">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00004"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="STD_TRN1_O_PARM_V_TYPE">
          <xsd:sequence>
            <xsd:element name="HORA_OPRCN" type="xsd:time"/>
            <xsd:element name="FECHA_OPRCN" type="xsd:date"/>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_DISPO_V_TYPE">
          <xsd:sequence>
            <xsd:element name="STD_DEC_15Y2">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_SDO_CONTABLE_V_TYPE">
          <xsd:sequence>
            <xsd:element name="IMP_SDO">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_SDO_RETEN_V_TYPE">
          <xsd:sequence>
            <xsd:element name="IMP_SDO">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_SDO_AUT_V_TYPE">
          <xsd:sequence>
            <xsd:element name="IMP_SDO">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_SDO_INCID_V_TYPE">
          <xsd:sequence>
            <xsd:element name="IMP_SDO">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_BLOQUEOS_V_TYPE">
          <xsd:sequence>
            <xsd:element name="STD_CHAR_01">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00001"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_SDO_CONECT_V_TYPE">
          <xsd:sequence>
            <xsd:element name="IMP_SDO">
                <xsd:simpleType base="xsd:decimal">
                    <totalDigits value="00015"/>
                    <fractionDigits value="02"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="COD_IDIOMA_V_TYPE">
          <xsd:sequence>
            <xsd:element name="COD_IDIOMA">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00002"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="PSV_ANOTACIONES_V_TYPE">
          <xsd:sequence>
            <xsd:element name="STD_CHAR_01">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00001"/>
                </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="TR_CONS_SALDOS_VISTA_EVT_Z_TYPE">
          <xsd:sequence>
            <xsd:element name="COD_NUMRCO_MONEDA">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00003"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="PSV_DISPO_V" type="PSV_DISPO_V_TYPE"/>
            <xsd:element name="PSV_SDO_CONTABLE_V" type="PSV_SDO_CONTABLE_V_TYPE"/>
            <xsd:element name="PSV_SDO_RETEN_V" type="PSV_SDO_RETEN_V_TYPE"/>
            <xsd:element name="PSV_SDO_AUT_V" type="PSV_SDO_AUT_V_TYPE"/>
            <xsd:element name="PSV_SDO_INCID_V" type="PSV_SDO_INCID_V_TYPE"/>
            <xsd:element name="PSV_BLOQUEOS_V" type="PSV_BLOQUEOS_V_TYPE"/>
            <xsd:element name="PSV_SDO_CONECT_V" type="PSV_SDO_CONECT_V_TYPE"/>
            <xsd:element name="COD_CSB_OF">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00004"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="NOMB_50">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00050"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="COD_INTERNO_UO">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00004"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="COD_IDIOMA_V" type="COD_IDIOMA_V_TYPE"/>
            <xsd:element name="PSV_ANOTACIONES_V" type="PSV_ANOTACIONES_V_TYPE"/>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="STD_TRN1_MSJ_PARM_V_TYPE">
          <xsd:sequence>
            <xsd:element name="TEXT_ARG1">
                <xsd:simpleType base="xsd:string">
                    <maxLength value="00018"/>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="TEXT_CODE" type="xsd:int"/>
          </xsd:sequence>
        </xsd:complexType>
    <xsd:complexType name="TR_CONS_SALDOS_VISTA_TRN1">
        <xsd:complexType name="TR_CONS_SALDOS_VISTA_TRN1_O_TYPE">
          <xsd:sequence>
            <xsd:element name="RTRN_CD" type="xsd:int"/>
            <xsd:element name="STD_TRN1_O_PARM_V" type="STD_TRN1_O_PARM_V_TYPE"/>
            <xsd:element name="TR_CONS_SALDOS_VISTA_EVT_Z" type="TR_CONS_SALDOS_VISTA_EVT_Z_TYPE"/>
            <xsd:complexType name="STD_TRN1_MSJ_PARM_V_OCCURS">
                <xsd:element name="STD_TRN1_MSJ_PARM_V" type="STD_TRN1_MSJ_PARM_V_TYPE" maxOccurs="000005"/>
            </xsd:complexType>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="TR_CONS_SALDOS_VISTA_TRN1_I_TYPE">
          <xsd:sequence>
            <xsd:element name="STD_TRN1_I_PARM_V" type="STD_TRN1_I_PARM_V_TYPE"/>
            <xsd:element name="TR_CONS_SALDOS_VISTA_EVT_Y" type="TR_CONS_SALDOS_VISTA_EVT_Y_TYPE"/>
          </xsd:sequence>
        </xsd:complexType>
    </xsd:complexType>
    </xsd:schema>Thanks you

  • RMDATIND uploading problem with external material numbers

    Hi,
    I'm using LSMW direct input program RMDATIND (Object:0020 Method:0000) for creating materials.
    I have a problem with uploading materials which have two types of external material numbers.
    For example one material number is 1111-333 and then we have 10000000. The problem is that direct input won't create materials with number 1111-333 though it's possible to create them manually. It works fine with material 10000000.
    Does anyone know how fix this issue?

    Sweth123 wrote:
    Hi Guys:
    >
    > Clicked check box External number assignment without Check., When I am creating a material (mm01) with only numeric characters it is giving me an eror message saying for this material type Numeric characters are not allowed.
    >
    > i should be able to create a material with external number range and it can be numeric or alpha numeric?
    >
    >
    > Thanks
    > Sweth
    Hi,
    go to the path Define Number Ranges for Each Material Type click on maintain groups & select the materila type & select the mouse on material type & click on maintain after that maintain the number ranges.
    for ex: from 300000000 to 399999999 internal no.range
                from A                to ZZZZZZ     external no.range
    from this u can able to create a material with external number range and it can be numeric or alpha numeric
    Regards
    Raj.

  • Vendor Master Upload Problem with Check Box

    Hi All,
    I have a problem with Vendor Master Upload program. In one of the screen of XK01 transaction depending upon the PO Box, Postal Code, Other City and Other Region i have to check the PO Box w/o no check Box. So in my program after i check the PO Box, Postal Code, Other City and Other Region values how to write a code that i can check the PO Box w/o no. Or other wise how can i send value to the Po Box w/o no check box. field
    Thanks in advance.

    The call to the first screen should look something like:
        perform dynpro
          tables bdcdata
          using:
         'X' 'SAPMF02K'     '0105',         "Create Vendor: Initial Screen
          ' ' 'RF02K-BUKRS'             'COCO',
          ' ' 'RF02K-KTOKK'             'YYYY',
          ' ' 'USE_ZAV'                 'X'.
    I'm using screen 105, not 100 here.
    Rob

  • Dreamweaver CS5.5 file upload problems with javascript

    Hi,
    Maybe someone can help me. I have both CS4 and CS5.5 and Lion installed.
    When I upload files to the remote server, formatting for all source code (including javascript) is lost. And then any javascript functions on the website do not work. I have the same problem when uploading files with Filezilla.
    Another problem - probably related - is that under Firefox javascript of my local website does not work (it works on a fresh start, but only for the first link), while the remote site under Firefox works fine. Safari works both remotely and local.
    Now, when I boot the Mac from the Snow Leopard partition, everything works just fine. So it must have to do with Lion.
    Does anyone know how to fix this, please?

    Hi, thank you for helping.
    Line Break is set to CR (Macintosh). I don't know what OS our host server is running. I would assume it is either  Linux or Windows.
    On the other user account Line Break was set to LF (Unix), so I switched it on my account as well.
    After that the file transferred with the code intact. Just out of curiosity I switched the setting back, and it still works, but only for new files. Also, old files can no longer be deleted.
    Firefox hasn't changed. Under the other user the local site works, under my user, the scripts still don't work.
    So, I am very confused. I will give Apple a call to see, how I can reset the user preferences and report back.

  • Problem with Controller Servlet in WAS 4.0

    Hello guys,
              I am working on WPS over WAS 4.0. I have an Enterprise application
              with a servlet which acts as a Traffic Controller. Its job is to
              intercept every http request to the Portal Server and make some
              changes to the URL and redirect/forward the changed URL to the Portal
              server. I plan to map the servlet to "/" so as all the requests are
              handled by this servlet. I hope it will work this way.
              So, the user clicks on a URL like http://server_name/meeting, the
              servlet sees a mapping table for /meetinf, constructs a new URL and
              redirects it. I read the /meeting as "pathInfo" variable from the
              request object. Please note that "/" is mapped to the servlet. This
              works fine. But if I give a JSP file instead
              (http://server_name/meeting/m.jsp), it starts looking for the JSP file
              in the Servlet WAR file. So the question is if there's any any other
              way of achieving this effect or is there any way to make all the .jsp
              file requests to go to this servlet instead of being searched in the
              WAR file?
              I would be grateful if someone can put their thoughts over this
              problem.
              Thanks
              Kapil.
              ([email protected])
              

    Sorry to hear that.
    As far as I know the campus topology is based on CDP info. And since you see all the links in the CDP tables, so should campus.
    I've seen campus getting it wrong a few times, especially when there was some repatching done, but until now, when I delete the devices and re-add these devices, the next data collection gets the links correct.
    Cheers,
    Michel

  • Problems with Http-servlet : UTF-8

    I am having some difficulty with UTF-8 encoded
    chracaters in a Java servlet.
    My servlet accepts an XML file conteining a question and returns an HTM page. The XML has cyrillic characters encoded as utf-8.. The rendering
    servelt copes with this fine, and the HTML produced
    displays OK in the browser (the response type on the
    Java servelet has to be set to "text/html;
    charset=UTF-8" for this to work).
    I have to send cyrillic characters back in the
    response to the question in a text field in the HTML form.The browser is
    correctly sending back the byte stream (which I am
    printing here as hex): d0b3d0bed180d0bed0b4 (this is a
    cyrillic word correctly coded as utf-8).
    However, on collecting the response (using
    request.getParameterValues(fieldname)) the servlet
    returns the byte stream: d0b3d0bed13fd0bed0b4.
    A mistake in the fifth byte.
    Can anyone help with this problem? Is there a known problem with the JAVA UTF-8 converter?
    Regards
    Graham

    I now know the answer to this problem thanks to Bruno Van Haetsdaele .
    Before calling request.getParameterValues(fieldname));
    one should call request.setCharacterEncoding("UTF-8");
    Hope that helps somebody else!

  • Fios upload problem with firefox

    just got 25Mb/25Mb Fios along with the Extreme HD tv service installed today and was having upload speed problems while running Firefox.  Had speed of 25Mb download but 4-7Mb upload.  Tested with IE8 and got download of 24-25Mb and upload of 21Mb.  Did another test with Google Chrome and got better result same 24Mb-25Mb download and 23-24Mb of upload.  What is the problem here with Firefox?   Currently running Window Vista Ultimate 64-bit version all updated to latest version, Intel i920 OC to 3.8Ghz, 6GB of Corsair Dominator DDR3 triple channel ram, Asus Deluxe P6T motherboard, ATI Raedon 4870 X2 (yea i know its a little old, but was waiting for the new videocards to get a little cheaper before upgrading to either the ATI 5870 or nVidia 470), harddrives are 300GB Velicoraptor and 1TB Seagate 7200rpm and 2TB WD Green drive.  Use this PC mainly for online gaming MMO's and FPS's games.  This PC was built around 2 years ago so parts are a little old, but was having no problem at my old home with Fios 15Mb/5Mb plan, got what i paid for there with the Firefox.  15Mb download and 5Mb upload everytime i tested the speed out for 3-5 months since it was installed. 
    Ran both Speedtest.net and Speaskeasy.net tests.  Fios guys even ran the optimizers and that didn't help at all, they said since this was an issue with Firefox and not IE or Chrome that was not really Verizon problem since i was able to get ~25Mb upload speed on the other 2 broswer.  Is anyone else having problem with their Firefox Upload Speed?
    Solved!
    Go to Solution.

    Be sure you have the latest version of Firefox/3.6.6. Some of the older versions may have had issues. I did a google search and only found the postings for upload speed issues from 2009 and back.
    My speed test with Firefox/3.6.6 Windows Vista Business 64 bit with service pack 2.
    http://www2.verizon.net/micro/speedtest/java/
    Checking for Middleboxes . . . . . . . . . . . . . . . . . . Done
    SendBufferSize set to [522720]
    running 10s outbound test (client to server) . . . . . 35.14Mb/s
    running 10s inbound test (server to client) . . . . . . 35.78Mb/s

  • Uploading problems with Safari 4.1.3 -

    Hello, I just thought this was a funny question to ask -
    On my PowerPC G5 tower, running OS 10.4.11, and my question is in regards to Safari version 4.1.3 uploading problems for facebook and youtube... I always have to use FireFox version 3.6.13... and not without trouble either.
    I get it.  I need a new computer, but I just thought it fascinating why one works 90% of the time and the other never works.

    Firefox is way more upto date than Safari in 10.4.11, but TenFourFox is the most up to date browser for our PPCs, they even have G4 & G5 optimized versions...
    http://www.floodgap.com/software/tenfourfox/
    Also I think they Require Flash &/or Java, which may be a problem in 10.4

  • Problem with a Servlet - URGENT help

    Hello
    i really need your help. here i uploaded my web project: http://www.2shared.com/file/4450238/aaa4d9cd/JMSTest.html
    it's about 2 servlets, one Test servlet sending a message, and another one, Receiver, to receive the message sent via JMS (i use ActiveMQ)
    i didn't know what's wrong, if i call http://localhost:8080/JMSTest , then i enter something into that textfield, then i press the button(form action is http://localhost:8080/test ). it writes that "Mesaj trimis" (message sent - written by me in Romanian), and when i call http://localhost:8080/receiver i did not receive the message. Why?
    I use queue, so i think the send message is stored in a queue until a receiver receives it.
    Please download the project, isn't complicated.
    I did not know what's the problem.
    here is the server.xml file from Tomcat conf folder:
    <?xml version="1.0" encoding="UTF-8"?>
    <Server port="8005" shutdown="SHUTDOWN">
      <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
      <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
      <!-- Global JNDI resources
           Documentation at /docs/jndi-resources-howto.html
      -->
      <GlobalNamingResources>
        <!-- Editable user database that can also be used by
             UserDatabaseRealm to authenticate users
        -->
        <Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
      </GlobalNamingResources>
      <Service name="Catalina">
        <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>      
        <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
        <Engine defaultHost="localhost" name="Catalina"> 
          <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
          <!-- Define the default virtual host
               Note: XML Schema validation will not work with Xerces 2.2.
           -->
          <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
            <!-- SingleSignOn valve, share authentication between web applications
                 Documentation at: /docs/config/valve.html -->
            <!--
            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
            -->
            <!-- Access log processes all example.
                 Documentation at: /docs/config/valve.html -->
            <!--
            <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
                   prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
            -->
           <Context path="/JMSTest" docBase="JMSTest"
            debug="5" reloadable="true" crossContext="true">
        <Resource name="jms/ConnectionFactory" auth="Container"
                     type="org.apache.activemq.ActiveMQConnectionFactory"
                     description="JMS Connection Factory"
                     factory="org.apache.activemq.jndi.JNDIReferenceFactory"
                     brokerURL="vm://localhost"
                     brokerName="LocalActiveMQBroker"
                     userName="activemq" password="activemq"
                     useEmbeddedBroker="false"
                     clientID="TomcatClientID" />
        <Resource name="jms/myQueue" auth="Container"
                     type="org.apache.activemq.command.ActiveMQQueue"
                     description="JMS Queue"
                     factory="org.apache.activemq.jndi.JNDIReferenceFactory"
                     physicalName="TEST.FOO" />
        <Resource name="jms/myTopic" auth="Container"
                     type="org.apache.activemq.command.ActiveMQTopic"
                     description="JMS Topic"
                     factory="org.apache.activemq.jndi.JNDIReferenceFactory"
                     physicalName="TEST.BAR"/>
    </Context>
           </Host>
        </Engine>
      </Service>
    </Server>or, how should i do this, but using Sun Message Queue? my way is using Apache MQ
    Thanks
    Edited by: Talkabout on Dec 13, 2008 7:15 AM

    I didn't go all through your code, but I'd say you should make sure that the Receiver servlet is up and running BEFORE your access the Sender servlet.

  • File upload problem in java servlets

    hello,
    I want to upload my files.i have used Multipartrequest object.In my form i had included enctype="multipart/form-data".
    I want to upload one or more files .
    So, I made a file input box and then a select option box. With the help of java script i stored the values of the file input box to the select option drop down box.In this way i stored the name and path of the file in the select option drop down box also. Now when i tried to upload all the file in the select option box it is uploading only one file which is the last one selected from the file input box.
    I hope that file name is also getting from the file input box, and that is the reason why it is uploading that file only.I write this code to execute it.
    MultipartRequest multi=new MultipartRequest(request,".",5*1024*1024);
    I want to upload all the files, so what should i do,
    Please help me to solve this problem
    puneet

    Hi,
    First go through the Multipart code and try to study what it does.it does not upload all the fields u submit in a form.it will first parse the servletInputStream which seperates the normal form fields and the "File" field.when u say ENC-TYPE="multipart/form-data" the way in which it is sent is different for normal fields and the "File" field.there'll be boundaries for each field.also for "File" field the filename will be passed in the Content-disposition info(which contains the values of form fields,their names and filename(only for File input)in specific format) .so if u want to upload more files in the same submit use two or more "File" fields.
    If any one else has a better option let me know

  • PathInfo Problem with unregisterd servlets!

    Hi!
              When accessing unregistered servlets (with the ServletServlet), the
              pathinfo is not correct in WL 5.1.
              With BETA 2 this problem didn't exist.
              The falling call is made:
              registered:
              http://server/com.servlet.TestServlet/0/frame/test
              -> PathInfo: /0/frame/test
              ServletServlet:
              http://server/servlet/com.servlet.TestServlet/0/frame/test
              -> PathInfo: /com.servlet.TestServlet/0/frame/test
              When will this bug be fixed?
              Dipl. Ing. Alexander Sommer
              Software Development Manager
              http://www.TIScover.com
              TIS
              Tourismus Informations Systeme GmbH
              Softwarepark Hagenberg, Hauptstr. 99
              A-4232 Hagenberg, Austria
              Tel: +43(7236)3343-777
              Fax: +43(7236)3343-782
              e-mail: [email protected]
              

    There is a 'major' difference in the Web server provided in Jdev 3.2.3 and Jdev 9i. The Jdev 3.2.3 web server is a simple 'tes server' ( a light version of WebToGo) to allow for running servlets and JSP pages. In Jdev 9i, we use OC4J which is a J2EE application server for WEB and EJB applications. The Jdev 9i server configuration information cannot be used in Jdev 3.2.3. I dont recommend developing under JDev 9i and running inde Jdev 3.2.3. Since Jdev 9i is now released, I highly recommend that you move up to this release.

  • Problem with debug servlet Eclipse 3 tomcat 5

    I have configured Eclipse 3 with Tomcat 5.0.28 and tomcatPulginV3
    but, I have problem to debug my servlet
    I have error message
    help me it is urgent
    Failed to connect to remote VM. Connection refused.
    java.net.ConnectException: Connection refused: connect
    java.net.PlainSocketImpl.socketConnect(Native Method)
    java.net.PlainSocketImpl.doConnect(Unknown Source)
    java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    java.net.PlainSocketImpl.connect(Unknown Source)
    java.net.Socket.connect(Unknown Source)
    java.net.Socket.connect(Unknown Source)
    java.net.Socket.<init>(Unknown Source)
    java.net.Socket.<init>(Unknown Source)
    org.eclipse.jdi.internal.connect.SocketTransportImpl.attach(SocketTransportImpl.java:47)
    org.eclipse.jdi.internal.connect.SocketAttachingConnectorImpl.attach(SocketAttachingConnectorImpl.java:103)
    org.eclipse.jdt.internal.launching.SocketAttachConnector.connect(SocketAttachConnector.java:131)
    org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaunchConfigurationDelegate.launch(JavaRemoteApplicationLaunchConfigurationDelegate.java:75)
    org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:569)
    org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:788)
    org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:955)
    org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)Thanks

    Check your packages which you are importing....

Maybe you are looking for