2

I create memory stream.

var memoryStream = new MemoryStream();
var binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(memoryStream, list.ToArray());

And I need to pass through the soap to java server and insert to database.

And how create webService method ?

@WebMethod(operationName = "CreateObject")
    public String CreateTopology(
            @WebParam(name = "session")int id_session, 
            @WebParam(name = "title") String title, 
            @WebParam(name = "content") Object content,
            @WebParam(name = "access") Integer access) {

EDIT: Problem. I have serialized object in C #. I need to pass it on to the server via SOAP Java, after that save it in MySQL database in field of type Blob (may not be the blob)

Dmitrii Dovgopolyi
  • 6,231
  • 2
  • 27
  • 44
Mediator
  • 14,951
  • 35
  • 113
  • 191

2 Answers2

0

Have a look here:

//build a Call object
   Call call = new Call();
   call.setTargetObjectURI("urn:greetingService");
   call.setMethodName("sayGreeting");
   call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

   //creating a parameter list
   Vector params = new Vector();
   params.addElement(new Parameter("name", String.class, name,null));

//adding the parameter(s) to the Call object
   call.setParams(params);

You are setting the method-name "sayGreeting" and in a vector params you specify the parameters which the method will be called with. This parameter-vector is what you need!

The code-sample is taken from page 2 of this tutorial which i very much recommend: http://javaboutique.internet.com/tutorials/SOAP/

Bernd Elkemann
  • 23,242
  • 4
  • 37
  • 66
  • I do not understand what this class Call? We would simply request itself – Mediator Jul 17 '11 at 17:23
  • one one computer you are creating this Call-object, then that call-object gets transmitted to another computer; That computer executes the Call-object. The Call-object contains the information 1) which method to call on the other computer and 2) with which parameters. `http://javaboutique.internet.com/tutorials/SOAP/` – Bernd Elkemann Jul 17 '11 at 17:54
0

base64String - to pass as string

var memoryStream = new MemoryStream();
var binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(memoryStream, m_workspace.ListPlatforms.ToArray());

String base64String = Convert.ToBase64String(memoryStream.ToArray());
Mediator
  • 14,951
  • 35
  • 113
  • 191