Using complex objects in SOAP requests

I am looking to use a SOAP web service that requires an object to be passed as a parameter, for example.

<cfset someVariable = createObject("webservice", "http://www.example.com/webservice")>

Who has a method

someMethod(org.example.schemas._2004._07.example_api_objects.Example)

Example- a complex object with a number of properties, methods, etc. I can access the corresponding stub file related to Examplein ColdFusion10\cfusion\stubs\WS403970439_1\org\example\schemas._2004._07.example_api_objectsand find that if it is added to the class path, I can use the following:

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

I am sure that I need to create someExample object directly through ColdFusion without adding the corresponding stub files to the class path, but I couldn’t do this - does anyone know how this is possible

+4
source share
1 answer
<cfset someExample = someVariable.getClass().getClassLoader().loadClass('org.example.schemas._2004._07.example_api_objects.Example').newInstance() />

someExample, ...

- . , wsdl ?

+1

Source: https://habr.com/ru/post/1539896/


All Articles