Here is the original post
--------------------------------------Start Original
post---------------------------------------------------------------------------
My soap client recives the error
Attachment tag "item" refers to a Mime attachment with label "cid:12568800.1054615058828.apache-soap.%B1%E8%C8%F1%C1%A4102179" which could not be found.
The SOAP Client is sending a Vector that consists of 3 elements
File Name
Checksum for the file
DataHandler for the file
Here is the relevant code:
String encodingStyleURI = Constants.NS_URI_SOAP_ENC;
URL url;
SOAPMappingRegistry smr = new SOAPMappingRegistry();
Vector params;
Response resp = null;
Parameter ret = null;
XferResponse myResp = new XferResponse();
try {
url = new URL(targetURL);
}
catch (Exception e) {
/*
System.err.println ("Caught exception " + e);
System.err.print ("while connecting to " +
targetURL);
System.err.print (" remoteURI = " + remoteURI);
System.err.println (" remoteMethod = " +
methodName);
*/
myResp.errorCode = 1;
myResp.errorMessage = e.getMessage();
return (myResp);
}
if (parmVector.size() > 0) {
params = new Vector();
params.addElement(new Parameter("test",
java.util.Vector.class,
parmVector,
encodingStyleURI));
Call call = new Call();
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI(remoteURI);
call.setMethodName(methodName);
call.setEncodingStyleURI(encodingStyleURI);
call.setParams(params);
try {
resp = call.invoke(url, "");
} catch (SOAPException e) {
System.err.println("Caught SOAPException
(" +
e.getFaultCode() + "): " +
e.getMessage());
e.printStackTrace();
myResp.errorCode = 32;
myResp.errorMessage = e.getMessage();
return (myResp);
}
// Check the response.
if (!resp.generatedFault()) {
ret = resp.getReturnValue();
if(ret == null){
myResp.errorCode = 33;
myResp.errorMessage = "No return
value from call.";
}
else {
//System.err.println("Response: "
+ resp);
// printObject(ret.getValue());
myResp.errorCode = 0;
}
myResp.retParm = ret;
} else {
Fault fault = resp.getFault();
System.err.println("Generated fault: ");
System.err.println (" Fault Code = " +
fault.getFaultCode());
System.err.println (" Fault String = " +
fault.getFaultString());
myResp.errorCode = 1;
myResp.errorMessage =
fault.getFaultString();
}
}
return (myResp);
}
---------------------------------------------------------------------------------------
Since then, I have tried to force the character encoding to UTF 8 on the
client using:
(and replacing the Call initializer)
ctx = new SOAPContext();
try {
ctx.setRootPart ("X", "text/xml;
charset=utf-8");
}
catch (Exception xxx) {
xxx.printStackTrace();
myResp.errorCode = 99;
myResp.errorMessage = "Unable to set
charset to utf-8";
return (myResp);
}
/*
Call call = new Call();
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI(remoteURI);
call.setMethodName(methodName);
call.setEncodingStyleURI(encodingStyleURI);
call.setParams(params);
*/
Call call = new Call (remoteURI, methodName,
params, null, encodingStyleURI, ctx);
This code (either form) works in the US. Problem occurs in Korea
OS Is Windows XP for SOAP Client
SOAP/Tomcat runs as a service on Windows XP
Any and all help greatly appreciated.
Thanks
Komal
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.