Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Java WebService
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..
Posted 3-May-13 6:29am
Edited 3-May-13 10:35am
(no name)499K
v2

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

  Print Answers RSS
0 OriginalGriff 400
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 3 May 2013
Copyright © CodeProject, 1999-2014
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