InsufficientMemoryException while sending large byte array in WCF Service callback

Hi
I have a datacontract with a large byte array that is passed by the WCF Service back to the client using a callback contract.
Until the byte array size remains below 25-30 MB, it is passed OK, but as soon as it exceeds that, an InsufficientMemoryException is thrown on the service side. I have set the max message sizes at 100 MB and using MTOM Encoder.
I am using WSDualHTTPBinding with sessions and message security - hence streaming is not an option. I know chunking channels are an option, but I want to try to tune the service and client to maximize the byte array size which can be sent over a normal channel.
Kindly advise how to tune settings to get to around 100 MB byte array size.
Binding section of web.config is given below. Same settings for sizes are used on client.
Thanks
Abhishek
 <wsDualHttpBinding>
        <binding name="WSHttpBinding_IService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="100000000" maxReceivedMessageSize="100000000" messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true">
          <readerQuotas maxArrayLength="100000000"  />
          <security mode="Message">
            <message clientCredentialType="Certificate" algorithmSuite="Default"  />
          </security>
        </binding>
      </wsDualHttpBinding>

Hi abhisinghal21,
>>InsufficientMemoryException while sending large byte array in WCF Service callback
First please try to increase the timeout value in the both client and service side to see if it works:
closeTimeout="00:10:00" openTimeout="00:10:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00"
Then since you do not want to the use the Chunking option to help you, maybe you try to change the wsDualHttpBinding to use the binding which supports the streaming mode and supports callback.
In streaming transfer mode, the receiver can begin to process the message before it is completely delivered. And the streaming mode is useful when the information that is passed is lengthy and can be processed serially. Streaming mode is also useful when the
message is too large to be entirely buffered. So it will be better for you to use the streamed mode.
For more information, please try to check:
#How to: Enable Streaming:
http://msdn.microsoft.com/en-us/library/ms789010(v=vs.110).aspx .
Best Regards,
Amy Peng
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Need to send and receive larger byte array

    I have a small WCF service, self hosted in a console app. On the same computer I have a client application. Both are running in the debugger in VS2008. The proxy code and the config file were generatred from the running service using svcutil.
    In one of the service calls, the service reads a pdf file and sends the contents as a byte array. The client receives the byte array, saves it as a pdf file, and displays it.
    Everything is fine for all other kinds of calls, and this one works fine also as long as the file is small (say 14K). But if the file is larger (say 84K), the client crashes (VHOST has stopped working).
    Is there some kind of setting that will allow me to send and receive larger byte arrays (> 100 K)?
    Thanks,
    Jon Jacobs
    In transmission, subatomic particles managed by professionals.
    No innocent electrons were harmed.

    Hi Jon,
    You'll want something like this to increase the message size quotas:
    <bindings>
    <basicHttpBinding>
    <binding name="basicHttp" allowCookies="true"
    maxReceivedMessageSize="20000000"
    maxBufferSize="20000000"
    maxBufferPoolSize="20000000">
    <readerQuotas maxDepth="32"
    maxArrayLength="200000000"
    maxStringContentLength="200000000"/>
    </binding>
    </basicHttpBinding>
    </bindings>
    The justification for the values is simple, they are sufficiently large to accommodate most messages. You can tune that number to fit your needs. The low default value is basically there to prevent DOS type attacks. Making it 20000000 would allow for a distributed
    DOS attack to be effective, the default size of 64k would require a very large number of clients to overpower most servers these days.
    If you're still getting this error message while using the WCF Test Client, it's because the client has a separate MaxBufferSize setting.
    To correct the issue:
    Right-Click on the Config File node at the bottom of the tree
    Select Edit with SvcConfigEditor
    A list of editable settings will appear, including MaxBufferSize.
    Note: Auto-generated proxy clients also set MaxBufferSize to 65536 by default.
    Let me know if this helped.
    Regards,
    Raghu

  • Sending a byte array of greater length than the APDU data buffer

    Hello again, I am now trying to send a byte array of length 480 from the smart card. I've tried setting the outgoing length to 480 first but as i had expected, this threw an exception. Then i tried setting it to 240 and then copying from the array into the apdu buffer in two halves and calling sendBytes() twice, but this only worked the first time - it send the first 240 bytes and then threw an error. Is it possible to do what i am trying to accomplish? If so, what am I missing?

    the applet:
    H:\java_card_kit-2_2_1-win-dom\java_card_kit-2_2_1\samples\src\com\sun\javacard\samples\photocard
    the client:
    H:\java_card_kit-2_2_1-win-dom\java_card_kit-2_2_1\samples\src_client\com\sun\javacard\clientsamples\photocardclient
    here is the code i have used to store large data on card. maybe it will help you.
    i send a series of apdu, where each contains 128 bytes of data (all apdu must have the same length - except the last).
    public void writeAPDU(APDU apdu)
         byte[] buffer = apdu.getBuffer();
         short lc = (short)(buffer[ISO7816.OFFSET_LC]&0xFF);          
         short p1 = (short)(buffer[ISO7816.OFFSET_P1]&0xFF); // counter
         short p2 = (short)(buffer[ISO7816.OFFSET_P2]&0xFF); // length of send data
         short offset = (short)(p1 * p2); // calculate the offset
         apdu.setIncomingAndReceive();
         // check for first apdu (contains the total size of data)
         if(p1 == 0 && p2 == 0)
              short l = Util.getShort(buffer,ISO7816.OFFSET_CDATA);
              data = new byte[l];
         else
              // store bytes in array
              Util.arrayCopy(buffer, ISO7816.OFFSET_CDATA, data, offset, lc);
    }

  • Sending a Byte array through a socket

    Can someone please tell me how i can send a Byte array from a client to a sever using sockets?
    Thanks
    Mark

    This tutorial should do the trick:
    http://java.sun.com/docs/books/tutorial/networking/sockets/index.html

  • JVM error while reserving big byte array

    Hi all, I've encountered a strange problem while trying to unzip a big file (~100MB):
    I have to work with it in memory so I load it into byte array - this never caused any troubles until I tried to unpack a file of such big size - more detailed investigation showed that just a line like that:
    byte[] bb = new byte[100000000] - ruins a service thread WITHOUT giving an exception (so that, try-catch around it don't react on it)!
    The system config is here:
    P4 1.4GHz, 512 RAM, JDK1.5.u6
    Anyone saw such trouble?

    What was the specific error message or symptom you saw?
    Also please include which version of java you are using (the output
    from java -version).

  • UnmarshalException for large byte array :: Weblogic 8.1 SP2

    Hi,
    1) We have a application running on Weblogic 8.1SP2.
    2) Our scenario consist of Client code which reads a input file via Stream and converts it to a byte array before sending it to the Server.
    When the server side code calls the Remote Bean (with byte array as an argument) it throws this exception :
    "java.rmi.UnmarshalException: Software caused connection abort: socket write error"
    Intermittently also got this error :: "weblogic.rjvm.PeerGoneException: ; nested exception is: java.io.EOFException"
    3) This scenario works absolutely fine if the said Input File is of a smaller size.
    4) I have also set the following params in config.xml <server .../> tag, but all in vain:
         CompleteMessageTimeout="480" also tried with "0"
         MaxMessageSize="2000000000"
         NativeIOEnabled="true"
    Also tried with :
         MaxHTTPMessageSize="2000000000" & MaxT3MessageSize="2000000000"
    Below is the exception trace:
    java.rmi.UnmarshalException: Software caused connection abort: socket write error; nested exception is: java.net.SocketException: Software caused connection abort: socket write error
    java.rmi.UnmarshalException: Software caused connection abort: socket write error; nested exception is: java.net.SocketException: Software caused connection abort: socket write error at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:297)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
    Caused by: java.net.SocketException: Software caused connection abort: socket write error
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
         ... 6 more
    Caused by: java.net.SocketException: Software caused connection abort: socket write error
         at java.net.SocketOutputStream.socketWrite0(Native Method)
         at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
         at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
         at weblogic.socket.SocketMuxer.write(SocketMuxer.java:721)
         at weblogic.rjvm.t3.T3JVMConnection.sendMsg(T3JVMConnection.java:723)
         at weblogic.rjvm.MsgAbbrevJVMConnection.sendOutMsg(MsgAbbrevJVMConnection.java:276)
         at weblogic.rjvm.MsgAbbrevJVMConnection.sendMsg(MsgAbbrevJVMConnection.java:164)
         at weblogic.rjvm.ConnectionManager.sendMsg(ConnectionManager.java:549)
         at weblogic.rjvm.RJVMImpl.send(RJVMImpl.java:722)
         at weblogic.rjvm.MsgAbbrevOutputStream.flushAndSendRaw(MsgAbbrevOutputStream.java:292)
         at weblogic.rjvm.MsgAbbrevOutputStream.flushAndSend(MsgAbbrevOutputStream.java:300)
         at weblogic.rjvm.MsgAbbrevOutputStream.sendRecv(MsgAbbrevOutputStream.java:322)
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:103)
         ... 7 more
    Any thoughts would be helpful?
    Thanks,
    Khyati

    Hi,
    1) We have a application running on Weblogic 8.1SP2.
    2) Our scenario consist of Client code which reads a input file via Stream and converts it to a byte array before sending it to the Server.
    When the server side code calls the Remote Bean (with byte array as an argument) it throws this exception :
    "java.rmi.UnmarshalException: Software caused connection abort: socket write error"
    Intermittently also got this error :: "weblogic.rjvm.PeerGoneException: ; nested exception is: java.io.EOFException"
    3) This scenario works absolutely fine if the said Input File is of a smaller size.
    4) I have also set the following params in config.xml <server .../> tag, but all in vain:
         CompleteMessageTimeout="480" also tried with "0"
         MaxMessageSize="2000000000"
         NativeIOEnabled="true"
    Also tried with :
         MaxHTTPMessageSize="2000000000" & MaxT3MessageSize="2000000000"
    Below is the exception trace:
    java.rmi.UnmarshalException: Software caused connection abort: socket write error; nested exception is: java.net.SocketException: Software caused connection abort: socket write error
    java.rmi.UnmarshalException: Software caused connection abort: socket write error; nested exception is: java.net.SocketException: Software caused connection abort: socket write error at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:297)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
    Caused by: java.net.SocketException: Software caused connection abort: socket write error
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
         ... 6 more
    Caused by: java.net.SocketException: Software caused connection abort: socket write error
         at java.net.SocketOutputStream.socketWrite0(Native Method)
         at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
         at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
         at weblogic.socket.SocketMuxer.write(SocketMuxer.java:721)
         at weblogic.rjvm.t3.T3JVMConnection.sendMsg(T3JVMConnection.java:723)
         at weblogic.rjvm.MsgAbbrevJVMConnection.sendOutMsg(MsgAbbrevJVMConnection.java:276)
         at weblogic.rjvm.MsgAbbrevJVMConnection.sendMsg(MsgAbbrevJVMConnection.java:164)
         at weblogic.rjvm.ConnectionManager.sendMsg(ConnectionManager.java:549)
         at weblogic.rjvm.RJVMImpl.send(RJVMImpl.java:722)
         at weblogic.rjvm.MsgAbbrevOutputStream.flushAndSendRaw(MsgAbbrevOutputStream.java:292)
         at weblogic.rjvm.MsgAbbrevOutputStream.flushAndSend(MsgAbbrevOutputStream.java:300)
         at weblogic.rjvm.MsgAbbrevOutputStream.sendRecv(MsgAbbrevOutputStream.java:322)
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:103)
         ... 7 more
    Any thoughts would be helpful?
    Thanks,
    Khyati

  • Error when using byte array in web service model interface

    Hello everybody,
    I'm using a web service model in my web dynpro application. The web service requires a byte array as import parameter.
    When starting the web dynpro application the following error occurs:
    com.sap.tc.webdynpro.services.exceptions.WDTypeNotFoundException: type java:byte not found
    at com.sap.tc.webdynpro.services.datatypes.core.DataTypeBroker.getDataType(DataTypeBroker.java:216)
    I'm using byte arrays several times in my application --> no problem. So why does the error say "byte not found" when using the web service?
    Thanks for your help!
    regards
    Christian

    Hi,
    maybe this is the problem. The type is byte and not binary.
    But I have the same problem as mentioned in the other thread: I can't change the type.
    The type in the WSDL of my web service is "base64binary". Is there maybe a possibility to import a jar-file for this type?
    Christian

  • NetBeans MobilityPack 5 BUG?? how can I send a byte array?

    I�ve created a WebApp and a Simple servlet with one public method.
    public byte[] getStr(byte[] b) {       
    String s = "A string";
    return s.getBytes();
    Then I've used "Mobile To Web App" wizard to generate stubs to that getStr method. And when I�ve tried to call that getStr method:
    byte[] aByte = "st".getBytes();
    byte[] b = client.getStr(aByte);
    I've got an error at Server in Utility.java in generated ReadArray method.
    * Reads an array from the given data source and returns it.
    *@param source The source from which the data is extracted.
    *@return The array from the data source
    *@exception IOException If an error occured while reading the data.
    public static Object readArray(DataInput in) throws IOException {
    short type = in.readShort();
    int length = in.readInt();
    if (length == -1) {
    return null;
    } else {
    switch (type) {
    case BYTE_TYPE: {
    byte[] data = new byte[length];
    in.readFully(data);
    return data;
    default: {
    throw new IllegalArgumentException("Unsupported return type (" + type + ")");
    At this line "in.readFully(data);" I�ve got an EOFException.
    The the aByte = "st".getBytes(); was 2bytes long and at the server "int length = in.readInt();" it was 363273. Why?
    All code was generated by NetBeans Mobility pack 5 it's not mine so its a bug?
    How can I fix this?

    I found that bug. I've described it here
    http://www.netbeans.org/issues/show_bug.cgi?id=74109
    There's a solution how to fix the generated code.

  • JDBC Adapter: J2EE server crashes while sending large messages

    We want to use the following scenario to transfer data from a MS SQL Server to SAP BW via XI:
    JDBC Sender Adapter – XI – SAP ABAP Proxy.
    All works fine with a small amount of data. But if the select statement delivers too many record sets and the size of the transformed XML payload is greater then 50 MB the J2EE server crashes. A complete restart is necessary. It seems to be am memory problem.
    Here are the entries from our log files:
    dev_server0
    [Thr 6151] Mon Jul 24 12:46:57 2006
    [Thr 6151] JLaunchIExitJava: exit hook is called (rc=666)
    [Thr 6151] **********************************************************************
    ERROR => The Java VM terminated with a non-zero exit code.
    Please see SAP Note 940893 , section 'J2EE Engine exit codes'
    for additional information and trouble shooting.
    [Thr 6151] SigISetIgnoreAction : SIG_IGN for signal 17
    [Thr 6151] JLaunchCloseProgram: good bye (exitcode=666)
    std_server0.out
    FATAL: Caught OutOfMemoryError! Node will exit with exit code 666java.lang.OutOfMemoryError
    Is this a general problem of the XI or a specific one of our configuration? Is it possible to transfer such large messages via XI? If not, is there a workaround for such scenarios?
    (Memory heap size of the J2EE server is 1024 MB.)

    > Hi Gil,
    >
    > i had nearly the same problems some times in praxis
    > and the mapping was the reason. Just change your
    > interface determination temporary, delete the mapping
    > and test again to find out if the mapping is the
    > reason.
    >
    > Regards,
    > Udo
    I have changed my interface determination so that no message mapping is used. The J2EE server still crashes.
    > Hi Gil,
    > This does sounds like a memory problem especially
    > when it comes to 50M message with a minimum XI sys
    > requierments...
    > To be sure you can check on the RWB for the
    > componnent monitoring at the JDBC adapters and look
    > for your adapter
    > look at the status of the adapter and the trace
    > there...
    Hi Nimrod
    In case of such an error I have no entries in channel monitor. So I can't see anything there. I have also no entries in message monitor of the RWB in this case. So I don't get any information with standard XI tools.
    > My reccomendation to you is to set the poll intervall
    > to a shorter period,this way you'll make sure you get
    > less records...I hope you have remembered to add  a
    > status/flag column on the table to be set after
    > selection so no duplicate records will be taken on
    > the second pools.
    >
    The problem is that the source of my data is not a simple SQL statement but a stored procedure. So I don't know exactly how many records will be delivered. A update command is not possible.

  • OutofMemory Error while sending file to database using Web services

    I have a file of 30MB to be written to the MySQL database. I am doing this in Axis web services and it gives me the following error:
    (I am using Tomcat as the application server and Apache as the web server, Axis 1.3 and MySQL standard 5.0.21 version. I have set the minimum and maximum heap size and it works well without using the web service (just uploading and downloading from the database using a simple java program). Another thing to notice is that I can send a file of almost 10MB size to the database using web service without any problem. But it doesn't work with the 30 MB .)
    java.lang.OutOfMemoryError: Java heap space; nested exception is:
         java.lang.OutOfMemoryError: Java heap space
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
    faultSubcode:
    faultString: java.lang.OutOfMemoryError: Java heap space; nested exception is:
         java.lang.OutOfMemoryError: Java heap space
    faultActor:
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}hostname:dbr221d.dbr.louisville.edu
    java.lang.OutOfMemoryError: Java heap space; nested exception is:
         java.lang.OutOfMemoryError: Java heap space
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:2443)
         at org.apache.axis.client.Call.invoke(Call.java:2366)
         at org.apache.axis.client.Call.invoke(Call.java:1812)
         at edu.louisville.bcc_ma.ws.lab.LabServiceSoapBindingStub.storeGZIPFile(LabServiceSoapBindingStub.java:472)
         at edu.louisville.bcc_ma.lims.labclient.container.SendGZIPFile.sendFile(SendGZIPFile.java:69)
         at edu.louisville.bcc_ma.lims.labclient.container.LoginContainer.login(LoginContainer.java:58)
         at edu.louisville.bcc_ma.lims.labclient.container.LoginContainer.main(LoginContainer.java:44)

    Sorry for the delayed response here, forget to add it to my watchlist. I didn't catch if you were using Java 1.5 or not. Prior to 1.5 the default maximum heap space was 64MB which with the overhead of the appserver might be your problem.
    Take a look at http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html and the java -Xmx <size> command line option to change the default (I believe the size argument is in bytes, but don't hold me to that). I think you can pass that as a command line option to the startup script, but you should check the doco to see if it needs to be wrapped in some other arg etc.,
    I seem to recall running into this same problem a few years back when I had a servlet doing some intense graphics processing on the fly and setting this option fixed the problem.

  • Error returning large String arrays from web service

    Hi,
    I currently have an EJB that returns a String[] array that I have implemented as
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don't have a problem
    as long as the returned array is relatively small, but when the array starts to get
    a little larger (say 20 elements, about 30 chars each), I consistently get:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running under MS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as 15000 - 20000
    array elements in one call. And since I am calling the same Weblogic EJB with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I might be doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

    Hi Steve,
    Sure we're interested...I'll pass this along to the XML folks.
    Thanks for the feedback,
    Bruce
    Steve Alexander wrote:
    In case anyone is interested, I solved my problem. I was mis-diagnosing the problem
    - thinking it was a size issue when it actually was a data issue. On the calls where
    I was returning a large array, some of the array members were null. When I made them
    enpty strings "", it worked. Apparently the default SAX parser BEA uses doesn't like
    the nulls, whereas the MS parser doesn't care.
    "Steve Alexander" <[email protected]> wrote:
    Thanks Bruce,
    FYI - I have reproduced the problem on WL7.0. I have turned it in to support
    as you
    suggested.
    Steve
    Bruce Stephens <[email protected]> wrote:
    Hi Steve,
    This does not ring any bells, however I would suggest that you file a support
    case. If it
    is an option you might try a later release (7.0).
    Bruce
    Steve Alexander wrote:
    Hi,
    I currently have an EJB that returns a String[] array that I have implementedas
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don'thave a problem
    as long as the returned array is relatively small, but when the arraystarts to get
    a little larger (say 20 elements, about 30 chars each), I consistentlyget:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running underMS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as15000 - 20000
    array elements in one call. And since I am calling the same Weblogic
    EJB
    with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I mightbe doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

  • Trying to send multiple types in a byte array -- questions?

    Hi,
    I have a question which I would really appreciate any help on.
    I am trying to send a byte array, that contains multiple types using a UDP app. and then receive it on the other end.
    So far I have been able to do this using the following code. Please note that I create a new String, Float or Double object to be able to correctly send and receive. Here is the code:
    //this is on the client side...
    String mymessage ="Here is your stuff from your client" ;
    int nbr = 22; Double nbr2 = new Double(1232.11223);
    Float nbr3 = new Float(8098098.809808);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(baos);
    oos.writeObject(mymessage);
    oos.writeInt(nbr);
    oos.writeObject(nbr2);
    oos.writeObject(nbr3);
    oos.close();
    byte[] buffer = baos.toByteArray();
    socket.send(packet);
    //this is on the server side...
    byte [] buffer = new byte [5000];
    String mymessage = null; int nbr = 0; Double nbr2 = null;
    Float nbr3 = null;
    mymessage = (String)ois.readObject();
    nbr = ois.readInt();
    nbr2 = (Double) ois.readObject();
    nbr3 = (Float) ois.readObject();
    My main question here is that I have to create a new Float and Double object to be able to send and receive this byte array correctly. However, I would like to be able to have to only create 1object, stuff it with the String, int, Float and Double, send it and then correctly receive it on the other end.
    So I tried creating another class, and then creating an obj of this class and stuffing it with the 4 types:
    public class O_struct{
    //the indiv. objects to be sent...
    public String mymessage; public int nbr; public Double nbr2;
    public Float nbr3;
    //construct...
    public O_struct(String mymessage_c, int nbr_c, double nbr2_c, float nbr3_c){
    my_message = my_message_c;
    nbr = nbr_c;
    nbr2 = new Double(nbr2_c);
    nbr3 = new Float(nbr3_c);
    Then in main, using this new class:
    in main():
    O_struct some_obj_client = new O_struct("Here is your stuff from your client", 22, 1232.1234, 890980980.798);
    oos.writeObject(some_obj_client);
    oos.close();
    send code....according to UDP
    However on the receiving side, I am not sure how to be able to correctly retrieve the 4 types. Before I was explicitely creating those objects for sending, then I was casting them again on the receiving side to retrieve then and it does work.
    But if I create a O_struct object and cast it as I did before with the indiv objects on the receiving end, I can't get the correct retrievals.
    My code, on the server side:
    O_struct some_obj_server = new O_struct(null, null, null. null);
    some_obj_server = (O_struct)ois.readObject();
    My main goal is to be able to send 4 types in a byte array, but the way I have written this code, I have to create a Float and Double obj to be able to send and receive correctly. I would rather not have to directly create these objects, but instead be able to stuff all 4 types into a byte array and then send it and correctly be able to retrieve all the info on the receiver's side.
    I might be making this more complicated than needed, but this was the only way I could figure out how to do this and any help will be greatly appreciated.
    If there an easier way to do I certainly will appreciate that advise as well.
    Thanks.

    public class O_struct implements Serializable {
    // writing
    ObjectOutputStream oos = ...;
    O_struct struct = ...;
    oos.writeObject(struct);
    // reading
    ObjectInputStream ois = ...;
    O_struct struct = (O_struct)ois.readObject();
    I will be sending 1000s of these byte arrays, and I'm sure having to create a new Double or Float on both ends will hinder this.
    I am worried that having to create new objs every time it is sending a byte array will affect my application.
    That's the wrong way to approach this. You're talking about adding complexity to your code and fuglifying it because you think it might improve performance. But you don't know if it will, or by how much, or even if it needs to be improved.
    Personally, I'd guess that the I/O will have a much bigger affect on performance than object creation (which, contrary to popular belief, is generally quite fast now: http://www-128.ibm.com/developerworks/java/library/j-jtp01274.html)
    If you think object creation is going to be a problem, then before you go and cock up your real code to work around it, create some tests that measure how fast it is one way vs. the other. Then only use the cock-up if the normal, easier to write and maintain way is too slow AND the cock-up is significantly faster.

  • How to send byte array of image with 300dpi.

    Hello fiends
                       i am making an application in which i have to send the byte array of an image with 300dpi.
    so i am using image snapshot class for that and use that code.
                        var snapshot:ImageSnapshot = ImageSnapshot.captureImage(cnvParent,300);
                        var bdata:String = ImageSnapshot.encodeImageAsBase64(snapshot);
    but when i send that bdata to php end using httpService.The size at other end of image increases surprisingly.i means it will increase its actual height and actual width.so is there any way to overcome this increase in size when i bitmapped image at 300 dpi?
    if there any way then please tell me.waiting for your reply.
    Thanks and Regards
        Vineet Osho

    Thanks david for such a quick reply.the link is really helpful.So we have to calculate the screendpi thruogh our code and then set the height and width of image.is there any simple way to sort out my problem.i just want to print my image at 300dpi but i am using image snapshot class so its taking the snap of my container(image) and save the image at 96 dpi which is dpi of my screen(monitor).so is there any way or any class in flex through which i got the image at its original dpi.i am not stick on 300 dpi but i m getting image from backend through xml at 300dpi.thats why i want the byte array i am sending should be at 300dpi.i am totally confused now.so please help me.
    Thanks and regards
      Vineet osho

  • Sending byte array to server

    Does anyone know how to send a byte array to the server?

    What is contained in the byte array? Is it audio/video/image?
    If you can get a binary representation of it, you could probably
    convert it to Base64 and send it over as a string and reconvert to
    binary on the server.

  • Another question?? being able to send byte arrays containing multiple types

    Hi,
    I have a question which I would really appreciate any help on.
    I am trying to send a byte array, that contains multiple types using a UDP app. and then receive it on the other end.
    So far I have been able to do this using the following code. Please note that I create a new String, Float or Double object to be able to correctly send and receive. Here is the code:
    //this is on the client side...
    String mymessage ="Here is your stuff from your client" ;
    int nbr = 22; Double nbr2 = new Double(1232.11223);
    Float nbr3 = new Float(8098098.809808);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(baos);
    oos.writeObject(mymessage);
    oos.writeInt(nbr);
    oos.writeObject(nbr2);
    oos.writeObject(nbr3);
    oos.close();
    byte[] buffer = baos.toByteArray();
    socket.send(packet);
    //this is on the server side...
    byte [] buffer = new byte [5000];
    String mymessage = null; int nbr = 0; Double nbr2 = null;
    Float nbr3 = null;
    mymessage = (String)ois.readObject();
    nbr = ois.readInt();
    nbr2 = (Double) ois.readObject();
    nbr3 = (Float) ois.readObject();
    My main question here is that I have to create a new Float and Double object to be able to send and receive this byte array correctly. However, I would like to be able to have to only create 1object, stuff it with the String, int, Float and Double, send it and then correctly receive it on the other end.
    So I tried creating another class, and then creating an obj of this class and stuffing it with the 4 types:
    public class O_struct{ 
    //the indiv. objects to be sent...
    public String mymessage; public int nbr; public Double nbr2;
    public Float nbr3;
    //construct...
    public O_struct(String mymessage_c, int nbr_c, double nbr2_c, float nbr3_c){
    my_message = my_message_c;
    nbr = nbr_c;
    nbr2 = new Double(nbr2_c);
    nbr3 = new Float(nbr3_c);
    Then in main, using this new class:
    in main():
    O_struct some_obj_client = new O_struct("Here is your stuff from your client", 22, 1232.1234, 890980980.798);
    oos.writeObject(some_obj_client);
    oos.close();
    send code....according to UDP
    However on the receiving side, I am not sure how to be able to correctly retrieve the 4 types. Before I was explicitely creating those objects for sending, then I was casting them again on the receiving side to retrieve then and it does work.
    But if I create a O_struct object and cast it as I did before with the indiv objects on the receiving end, I can't get the correct retrievals.
    My code, on the server side:
    O_struct some_obj_server = new O_struct(null, null, null. null);
    some_obj_server = (O_struct)ois.readObject();
    My main goal is to be able to send 4 types in a byte array, but the way I have written this code, I have to create a Float and Double obj to be able to send and receive correctly. I would rather not have to directly create these objects, but rather just create one object and be able to send and receive the information on both ends
    I might be making this more complicated than needed, but this was the only way I could figure out how to do this and any help will be greatly appreciated.
    If there an easier way to do I certainly will appreciate that advise as well.
    Thanks.

    which forum should I be posting this on?Serialization.
    To get you started...
    public class O_struct implements Serializable {                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • X230 Win 8.1 Pro Fingerprint single swipe power on and login black screen

    When i try to log on using the single swipe power on and login feature sometimes the screen will go to the login screen, the finger print scanner will flash, and then i get a black screen. I can see the mouse cursor, but nothing else. If I swipe my f

  • Format of email body in bursting control file

    Hi, I am hoping this is a simple question for someone that is not as new as I am to bursting... What is the new line character I should be using to format the outgoing email body within the bursting control file. At present, the entire email body app

  • BorderLayout - how to make it unchangeable

    hello everyone, I have some problem with my BorderLayout, to put it more precisely with a CENTER region. I would like to make it fixed size. I setPrefferedSize(new Dimention(50,50)) for my NORTH and SOUTH regions and I setMinimumSize and setMaximumSi

  • Vprs not picking internal price

    Hi, Materila creation time the price controll was "S" We have changed it to "V" While uploading the closing Stock value.. We got a message that : post value as on today or change the price control to "S" to post on back date. We changed its Price con

  • When can we start recieving sms

    when can we start receiving sms on our skype numbers using our skype clients; i'm sick of using google voice for this feature only; i've spent thousands on skype for myself, employees, and clients to date. this feature is severely lacking at this poi