views:

95

answers:

1

Hello,

I have built .NET 1.1 Web Service which should accept files and save them.

Here is the code of the webmethod:

    [WebMethod]
  public bool SaveDocument(Byte[] docbinaryarray, string docname)
  {
   string dirPath = @"C:\Temp\WSTEST\";

   if(!Directory.Exists(dirPath))
   {
    Directory.CreateDirectory(dirPath);
   }
   string filePath = dirPath + docname;

   FileStream objfilestream = new FileStream(filePath, FileMode.Create, FileAccess.ReadWrite);
   objfilestream.Write(docbinaryarray, 0, docbinaryarray.Length);
   objfilestream.Close();

   return true;
  }

When I make a client in .NET with reference to this Web service everything goes great, but when a colleague of mine tries to send me a file from a JAVA client I don't get the actual file. All I get is byte array with only one element.

Definition of byte array for file, in WSDL looks like this:

<s:element minOccurs="0" maxOccurs="1" name="docbinaryarray" type="s:base64Binary" /> 

He sends me base64binary and fails every time. All I get is Byte array with only one element inside.

+1  A: 

Sounds like the bug is in the java -- or at least the java is not sending what the .net service expects. Can we see the java code?

Hogan
I agree ... itwould be useful to see the java code
Jhonny D. Cano -Leftware-