|
David
I am Java guy. So dont know how to handle
in C#
But do refer this
In that set the property to DIME instaed
of MIME .. at the client side
Cheers
Dhanush
----- Original Message -----
Sent: Friday, June 18, 2004 8:36 PM
Subject: Problem with DIME to C#
Hello,
I've developped a webservice with
c#, i need to call it from weblogic, therefore i've installed axis. My
webservice uses WSE 2.0 to handle Dime attachments.
I've used WSDL2Java
to create proxy stub classes, but i don't manage to add the attachments on
the call. Here is the client code :
package
dotnetservice;
public class client
{
public static void main(String[] args)
{
try
{
WorkflowLauncherLocator loc =
new WorkflowLauncherLocator();
WorkflowLauncherSoap port
= loc.getWorkflowLauncherSoap();
System.out.println(port.sayHi());
System.out.println(port.insertProduct());
}
catch(Exception
e)
{System.out.println(e.getMessage());}
} }
I've also modified the proxy due to posts i saw on internet
:
public java.lang.String
insertProduct() throws java.rmi.RemoteException
{ if
(super.cachedEndpoint == null)
{
throw new
org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call =
createCall();
_call.setOperation(_operations[1]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI(
"http://srvpariwe1/IWEWebServices/InsertProduct");
_call.setEncodingStyle(null);
_call.setProperty(
org.apache.axis.client.Call.ATTACHMENT_ENCAPSULATION_FORMAT,
org.apache.axis.client.Call.ATTACHMENT_ENCAPSULATION_FORMAT_DIME);
_call.setProperty(
org.apache.axis.client.Call.SEND_TYPE_ATTR,
Boolean.FALSE);
_call.setProperty(
org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
Boolean.FALSE);
_call.setSOAPVersion(
org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(
new
javax.xml.namespace.QName(
"http://srvpariwe1/IWEWebServices/",
"InsertProduct"));
//javax.activation.DataHandler dhSource =
new javax.activation.DataHandler(new
FileDataSource(filename));
org.apache.axis.attachments.AttachmentPart ap
=new org.apache.axis.attachments.AttachmentPart(new
javax.activation.DataHandler ("C:\\main\\Templates\\ReverseConvertible.xls","application/vnd.ms-excel" ));
//ap.setContentLocation("C: \\main\\Templates\\ReverseConvertible.xls");
ap.setContentId("Termsheet");
//_call.addAttachmentPart(ap);
setRequestHeaders(_call);
setAttachments(_call);
java.lang.Object _resp = _call.invoke(new java.lang.Object[]
{
});
if (_resp instanceof java.rmi.RemoteException)
{
throw (java.rmi.RemoteException)
_resp; }
else
{
extractAttachments(_call);
try
{
return (java.lang.String)
_resp;
} catch (java.lang.Exception _exception)
{
return
(
java.lang.String) org.apache.axis.utils.JavaUtils.convert(
_resp,
java.lang.String.class);
}
}
SayHi method is used to see if server is alive (and it works),
but insertProduct() doesn't work =(
In fact i don't know how too add
the two attachments needed by the webservice...
Thanks for help
=)
Regards David
****************************************************************** The
sender's email address has changed to firstname.lastname@ sgcib.com. You
may want to update your personal address book. Please see http://www.sgcib.com for more
information.
** This message and any attachments (the "message") are confidential and
intended solely for the addressee(s). Any unauthorised use or dissemination
is prohibited. E-mails are susceptible to alteration. Neither SOCIETE
GENERALE nor any of its subsidiaries or affiliates shall be liable for the
message if altered, changed or
falsified.
*************** L'adresse mail de votre correspondant a change en
prenom.nom@ sgcib.com. Il est recommande de mettre a jour votre carnet
d'addresse personnel.Pour plus d'informations, aller sur http://www.sgcib.com
** Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite. Tout message
electronique est susceptible d'alteration. La SOCIETE GENERALE et ses
filiales declinent toute responsabilite au titre de ce message s'il a ete
altere, modifie ou
falsifie. ******************************************************************
*********************************************************
Disclaimer:
This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.
*********************************************************
Visit us at http://www.mahindrabt.com
|
|