3

I'm a C# developer and working on a project where I need to make a call out to a Java webservice that is expecting a Long value as a property on an object that I am passing to a method. It looks like this:

public long routeDocument(long sDocID, string sRoutee)
{
    DREService.QueueDocument newQDoc = new DREService.QueueDocument();

    newQDoc.documentId = sDocID;
    newQDoc.routee = "tracyr";

    DREService.dre oSoapClient = new DREService.dre  { Url = _URI };

    try
    {
            oSoapClient.createQueueDocument(ref newQDoc, null);
    }
    catch (Exception ex)
    {
            //return "ERROR: " + ex.Message;
    }

    return newQDoc.id;
}

With that said, when I step through the code and I look at the object property "newQDoc.documentId" it is being set properly, but in Fiddler the property is not showing up at all on the post and the Java service never receives it. We wrote a small test harness and we have the same problem. I'm guessing that .net doesn't know what to do with the complex type Long, and the xsd for the service is defining it as long so it is trying to send the long data type to a Long complex type. My question is is there a trick to be able to send a long from .net to a Long in Java? (Keeping in mind both developers are in house, so if something needs to change on the Java end we can do that as well).

We already changed the test harness set to a long and it does box it to a Long properly but the Java person thinks that change would cause problems in his application for other calling clients.

Any help on this is appreciated!

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Ryan
  • 31
  • 1

0 Answers0