no, i'm still looking for a solution... i saw many other interop exemples, for simple types, but it's only code sample, i think that i may need an overall overview to see what's wrong...
for the moment, i make a hard coded SOAP message, into a string buffer, and send it to .NET and just parse the xml returned.
but it would be really cleaner and better if i could generate this SOAP with Mapping, marshall and so on...
Elise
"Scott Nichol" <[EMAIL PROTECTED]>
03/05/2002 05:23 AM
|
To: <[EMAIL PROTECTED]> cc: Subject: Re: java client for .NET : need SOAPMapping sample code |
Elise,
I have not seen anything posted from you in a while. Have you resolved
everything?
Scott Nichol
----- Original Message -----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 21, 2002 6:43 PM
Subject: java client for .NET : need SOAPMapping sample code
hi,
i had a code, in the past, to marshall a java object into SOAP before to
send it to a java webservice.
Now, my java client calls a .NET webservice.
and the way i connect to the .NET webservice is different (i don't use
Call() class, i do use URL() class, just because taht's the only code i know
to connectto a .NET webservice)
the problem is that my SOAP code doesn't fit any more
could you post me a sample code, with a connection to a .NETwebservice and
a SOAPMapping ?
regards,
Elise
=======================================================
Old java code
Call call = new Call ();
call.setTargetObjectURI ("urn:liox:Project");
call.setMethodName ("getProject");
call.setEncodingStyleURI(encodingStyleURI);
SOAPMappingRegistry smr = new SOAPMappingRegistry();
ProjectSerializer beanSer = new ProjectSerializer();
StringDeserializer sd = new StringDeserializer ();
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("urn:Projects",
"Project"), Project.class, beanSer, beanSer);
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"),
Project.class, null, beanSer);
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("",
"ProjectCode"), null, null, sd);
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("",
"CompanyName"), null, null, sd);
call.setSOAPMappingRegistry(smr);
Response resp = call.invoke (url, "" );
=====================================================
New java code
byte[] request = marshall();
URL endpoint = new
URL("http://val1nt10/PCS_Integration/SynchronizeProfiles.asmx");
URLConnection con = endpoint.openConnection ();
con.setDoInput (true);
con.setDoOutput (true);
con.setUseCaches (false);
con.setAllowUserInteraction(false);
con.setRequestProperty ("Content-Length",
Integer.toString (request.length));
con.setRequestProperty ("Content-Type", "text/xml;
charset=utf-8");
con.setRequestProperty ("SOAPAction",
"\"http://tempuri.org/WS_UpdateProfileAgency\"");
OutputStream out = con.getOutputStream ();
//HERE SOAPMAPPING ???? HOW ??? it's not urn anymore true
???
out.write (request);
out.flush ();
out.close();
--------------------------------------------
Elise Dupont
Software developer
Technology Development Group Europe
Lionbridge Technologies - France
Buropolis 1 - 1240 route des Dolines
06560 Sophia-Antipolis
www.lionbridge.com
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com