Home Help Center

i have a problem when i use .net Client call java server

ren-weiren-wei Member wei renOrganization: Hainan AirlineProject: support external system connect ticketsalesystem
:(
Hi,I have some problems in my project.My project server point use java,and client point use .net(vs2008).when I call the server with java it is’t any question,but when I use .net there are some problems.
1: IceInternal.LocalExceptionWrapper
StackTrace
Ice.ConnectionI.sendRequest(Outgoing og, Boolean compress, Boolean response)
IceInternal.ConnectionRequestHandler.sendRequest(Outgoing out)
IceInternal.Outgoing.invoke()
mars.order.OrderManagerDelM_.placeOrder(DTOIceOrder value, Dictionary`2 context__) position C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebApplication1\TjTicketWeb\mobile.cs:lineNum 61500
mars.order.OrderManagerPrxHelper.placeOrder(DTOIceOrder value, Dictionary`2 context__, Boolean explicitContext__) position C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebApplication1\TjTicketWeb\mobile.cs: lineNum 41717
code:
private long placeOrder(mars.DTOIceOrder value, _System.Collections.Generic.Dictionary<string, string> context__, bool explicitContext__)
{
if(explicitContext__ && context__ == null)
{
context__ = emptyContext_;
}
int cnt__ = 0;
while(true)
{
Ice.ObjectDel_ delBase__ = null;
try
{
checkTwowayOnly__("placeOrder");
delBase__ = getDelegate__(false);
OrderManagerDel_ del__ = (OrderManagerDel_)delBase__;
return del__.placeOrder(value, context__);
}
catch(IceInternal.LocalExceptionWrapper ex__)
{
handleExceptionWrapper__(delBase__, ex__);
}
catch(Ice.LocalException ex__)
{
handleException__(delBase__, ex__, true, ref cnt__);
}
}
}

2: Ice.UnmarshalOutOfBoundsException
StackTrace:
IceInternal.BasicStream.startReadSlice()
Ice.ObjectImpl.read__(BasicStream is__, Boolean rid__)
mars.DTOIceOrder.read__(BasicStream is__, Boolean rid__) position C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebApplication1\TjTicketWeb\mobile.cs: lineNum 9686
IceInternal.BasicStream.readObject(IPatcher patcher)
IceInternal.BasicStream.readPendingObjects()
mars.order.OrderManagerDelM_.searchUserOrdersByUserId(String userId, Dictionary`2 context__) position C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebApplication1\TjTicketWeb\mobile.cs: lineNum 62073


code:
public mars.DTOIceOrder[] searchUserOrdersByUserId(string userId, _System.Collections.Generic.Dictionary<string, string> context__)
{
IceInternal.Outgoing og__ = handler__.getOutgoing("searchUserOrdersByUserId", Ice.OperationMode.Normal, context__);
try
{
try
{
IceInternal.BasicStream os__ = og__.ostr();
os__.writeString(userId);
}
catch(Ice.LocalException ex__)
{
og__.abort(ex__);
}
bool ok__ = og__.invoke();
try
{
if(!ok__)
{
try
{
og__.throwUserException();
}
catch(Ice.UserException ex__)
{
throw new Ice.UnknownUserException(ex__.ice_name(), ex__);
}
}
IceInternal.BasicStream is__ = og__.istr();
is__.startReadEncaps();
mars.DTOIceOrder[] ret__;
{
int szx__ = is__.readAndCheckSeqSize(4);
ret__ = new mars.DTOIceOrder[szx__];
for(int ix__ = 0; ix__ < szx__; ++ix__)
{
IceInternal.ArrayPatcher<mars.DTOIceOrder> spx = new IceInternal.ArrayPatcher<mars.DTOIceOrder>("::mars::DTOIceOrder", ret__, ix__);
is__.readObject(spx);
}
}
is__.readPendingObjects();//Ice.UnmarshalOutOfBoundsException
is__.endReadEncaps();
return ret__;
}
catch(Ice.LocalException ex__)
{
throw new IceInternal.LocalExceptionWrapper(ex__, false);
}
}
finally
{
handler__.reclaimOutgoing(og__);
}
}


thanks for your help

Comments

  • ren-weiren-wei Member wei renOrganization: Hainan AirlineProject: support external system connect ticketsalesystem
    :) i find the problem.
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Glad you figure out this issue.

    UnmarshalOutOfBoundsException are usually due to a mismatch between the Slice definitions used by your client and server: see Why do I get an UnmarshalOutOfBoundsException? for details.

    Best regards,
    Bernard
Sign In or Register to comment.