Web services 在SOAP请求中使用复杂对象

Web services 在SOAP请求中使用复杂对象,web-services,soap,coldfusion,Web Services,Soap,Coldfusion,我希望使用一个SOAPWeb服务,它需要将一个对象作为参数传递 <cfset someVariable = createObject("webservice", "http://www.example.com/webservice")> Example是一个具有许多属性、方法等的复杂对象。我可以访问ColdFusion10\cfusion\stubs\WS403970439\u 1\org\Example\schemas.\u 2004.\u 07.Example\u api\u对

我希望使用一个SOAPWeb服务,它需要将一个对象作为参数传递

<cfset someVariable = createObject("webservice", "http://www.example.com/webservice")>
Example
是一个具有许多属性、方法等的复杂对象。我可以访问
ColdFusion10\cfusion\stubs\WS403970439\u 1\org\Example\schemas.\u 2004.\u 07.Example\u api\u对象
中与
Example
相关的存根文件,如果将其添加到类路径中,我可以使用以下内容:

<cfset someExample = CreateObject("java", "org.example.schemas._2004._07.example_api_objects.Exampler").init()>
<cfset someVariable.someMethod(someExample)>

我确信我应该能够通过ColdFusion直接创建someExample对象,而无需将相关的存根文件添加到类路径中,但我还无法做到这一点-有人知道这是如何实现的吗?


<cfset someExample = someVariable.getClass().getClassLoader().loadClass('org.example.schemas._2004._07.example_api_objects.Example').newInstance() />
然后使用someExample对象上的setter和getter来设置值


用另一种方式做这件事不够稳健。如果wsdl发生变化怎么办

Web服务是用ColdFusion编写的吗?@DanBracuk-不是。您通常可以将复杂对象表示为结构。您是否可以发布一个指向该方法和复杂类型的wsdl描述的wsdl或净化版本的链接。(编辑)RE:我确信我应该能够直接创建someExample对象。。是和否。类必须位于类加载器(或父类)的类路径中。但是,它可以使用JavaLoader(或CF10的版本)。话虽如此,事情还是有点复杂,我甚至不相信你需要走这条路。。首先尝试使用cf结构来表示复杂对象。但同样,我们需要查看wsdl定义来帮助您实现这一点。
<cfset someExample = someVariable.getClass().getClassLoader().loadClass('org.example.schemas._2004._07.example_api_objects.Example').newInstance() />