Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
4.00/5 (1 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:
C#
@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:
C++
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:
CSS
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..
Posted
Updated 3-May-13 9:35am
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900