Click here to Skip to main content
13,042,630 members (84,541 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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:
@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) { = 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();
	ns1__DharmaResponse objRes;
	DataHandPortBindingProxy obj;
	if(obj.Dharma(&obj1, &objRes) != SOAP_OK)
		printf("%s\n", obj.soap_fault_string());

Error messag is:
 - with linked exception:
[com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "xop"
 at [row,col {unknown-source}]: [2,336]]
Press any key to continue . . .

IF i comment
obj1.arg0->content->type = "text/html";

this line its soap call success but its not sending data as attachment..
Posted 3-May-13 5:29am
Updated 3-May-13 9:35am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 3 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100