how to remove xsi:type information from gSoap message?

别等时光非礼了梦想. 提交于 2019-12-06 07:34:41

If you are using proxy generated by gSOAP tools, then you need to set output mode of the proxy with SOAP_XML_NOTYPE flag.

It can be done in two ways:

  1. In one place in the init function of the proxy itself, but then every time proxy is generated it will be overwritten.

    void nsTestBindingProxy::nsTestBindingProxy_init(soap_mode imode, soap_mode omode) 
    {
        omode |= SOAP_XML_NOTYPE; //removes xsi:type
        soap_imode(this->soap, imode);
        soap_omode(this->soap, omode);
        soap_endpoint = NULL;
        ...
    }
    
  2. After every initialization of the proxy in code by calling soap_omode function

    nsTestBindingProxy proxy();
    soap_omode(proxy.soap, proxy.soap->omode | SOAP_XML_NOTYPE);
    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!