I written my java webserver.i deployed in jboss.
and i used gsoap to generated the c++ code and i calling the webservice using c++.
but it failed to send the attachments
my java code:
@MTOM
@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL)
@WebService(serviceName = "DataHand")
public class DataHand
{
public static final Log logger = LogFactory.getLog("com.tkd.sapphirews");
@WebMethod(operationName = "Dharma")
public String Dharma(Try obj) throws SOAPException
{
return "Hello ";
}
}
public class Try
{
private DataHandler content;
private String id;
public DataHandler getContent() {
return content;
}
public void setContent(DataHandler content) {
this.content = content;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
MY C++ code:
ns1__Dharma obj1;
obj1.arg0 = new ns1__try();
obj1.arg0->content = new xsd__base64Binary ();
obj1.arg0->content->id = NULL;
obj1.arg0->content->options = NULL;
obj1.arg0->content->type = "text/html";
obj1.arg0->content->__ptr = (unsigned char *)"Dharmaraj is not able to do anything";
obj1.arg0->content->__size = 20;
obj1.arg0->id = new string();
obj1.arg0->id->assign("Welcome");
ns1__DharmaResponse objRes;
DataHandPortBindingProxy obj;
if(obj.Dharma(&obj1, &objRes) != SOAP_OK)
{
printf("%s\n", obj.soap_fault_string());
}
Error messag is:
javax.xml.bind.UnmarshalException
- with linked exception:
[com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "xop"
at [row,col {unknown-source}]: [2,336]]
Press any key to continue . . .
Note:
IF i comment
obj1.arg0->content->type = "text/html";
this line its soap call success but its not sending data as attachment..