English 中文(简体)
Wso2 cpp 代码生成, Wsdl2 cpp 客户端和 MTOM 附加附件
原标题:wso2 cpp code generation with wsdl2cpp client side with MTOM attachment

我有一个用轴2( Java) 曝光的肥皂网络服务, 它将 POJO 序列成序列, 例如个人名称等, 作为动作响应 。 此外, 我有一个动作, 使用数据显示器进行序列化, 以便使用 < code\\ lt; xop: include... > </ xop: Include> 在响应中插入一个二进制附件 。

我用 wso2 wsfcpp 提供的 wsdl2cpp 生成了 c++ 中的客户端代码 。 GetPerson( person( personId)) 动作效果良好, 结果也和预期一样。 然而, 获取File( someId) 动作是成功的, 尽管生成的代码似乎不起作用 。

在轴 2. xml 和客户端中设置的启用MTOM= true的服务。 我甚至添加了“ 选项” 。 setEnableMTOM( true) 以在客户端的主端确定 。

我认为问题在于来自 wsdl 的代码, 因为获取File( someId) 回应信封是有效的( 我用轴2c api 手动测试过, 我可以如期检索文件) 。

以下是Wsdl(由轴2 Java产生)中包含的响应计划:

<xs:element name="getFileResponse">
   <xs:complexType>
      <xs:sequence>
         <xs:element minOccurs="0" name="return" nillable="true" type="xs:base64Binary"/>
      </xs:sequence>
   </xs:complexType>
</xs:element>

以下是用于生成客户代码的命令行 :

WSDL2CPP -uri MyService.xml -g -d adb -u -f

以下是从服务处收到的答复:

<ns:getFileResponse xmlns:ns="http://services.myplace.com">
   <ns:return>
      <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:[email protected]"></xop:Include>
   </ns:return>
</ns:getFileResponse>

Wsdl 中是否遗漏了什么东西? 还是Wsfcpp没有执行该特性( MTOM 客户端代码生成的肥皂)?

提前感谢!

最佳回答

我用 gSoap 尝试过同样的事情, 我也有同样的问题。 我认为轴2 自动检测二进制是否优化。 另外, 我发现无论在哪种情况下, wsdl 所暴露的返回元素类型 = “xs: base64Binary ” 。

我发现的唯一工作是修补, 将 x: base64Binary 替换为 xop: cluud, WSDL 使用 python (或其它什么) 脚本, 然后生成代码 。

这解决了问题,但提出了可维护性问题。

问题回答

暂无回答




相关问题
Python SOAP server / client

I have a problem with Python and SOAP. I need to create a web service based on SOAP in Python. I read that I can use libraries like soaplib, suds and ZSI. I created a Hello World web service with ...

HTTP POST and complex structures

I m trying to send a complex HTTP POST request to a web service. The web service was created using VS2008, in which you can set VS to create HTTP POST and GET interfaces alongside the SOAP one. Now ...

XML-RPC Standard and XML Data Type

I was looking at XML-RPC for a project. And correct me if I m wrong, but it seems like XML-RPC has no XML datatype. Are you supposed to pass as a string? or something else? Am I missing something? ...

Most appropriate API for URL shortening service

I ve just finished an online service for shortening URLs (in php5 with Zend Framework); you can enter an URL and you get an short URL (like tinyurl and such sites). I m thinking about the API for ...

What is the best solution for creating a SOAP Server in PHP?

I need some advice on which library is the best choice when it comes to creating SOAP servers (and eventually SOAP clients) in PHP. I know there is built-in functions for this, but is that really the ...

Logging all Soap request and responses in PHP

Does anyone know how to log all request and responses with the builtin SoapClient in PHP? I could in fact manually log everything with SoapClient::__getLastRequest() and SoapClient::__getLastResponse()...

热门标签