Web服务期望一个DataSet对象,我如何通过ColdFusion或在原始XML中提供? [英] Web service is expecting a DataSet object, how can I provide that via ColdFusion or in raw XML?

查看:134
本文介绍了Web服务期望一个DataSet对象,我如何通过ColdFusion或在原始XML中提供?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要调用使用.NET编写的Web服务。调用的应用程序是用ColdFusion编写的。 Web服务所期望的参数之一是DataSet对象。我不能在ColdFusion中实例化一个.NET DataSet对象,我如何通过它将接受的Web服务?我没有以原始XML编写SOAP请求的问题,我只是不知道DataSet对象的XML是什么样子。

I need to make a call to a web service written in .NET. The application making the call is written in ColdFusion. One of the parameters the web service expects is a DataSet object. I can't instantiate a .NET DataSet object in ColdFusion, how can I pass the web service something it will accept? I have no problem writing the SOAP request in raw XML, I just don't know what the XML for a DataSet object would look like.

推荐答案

.NET期望的所有对象都由Axis序列化,并且可供您使用。不幸的是ColdFusion不容易得到。

All objects that .NET expects are serialized by Axis and are available to you. Unfortunately ColdFusion does not make it easy to get to.

要访问存根,您必须:


  1. 访问任何

  2. 查看CF应用程序目录中的存根。他们在一个subs
    目录,由WSDL.like组织:
    c:\ColdFusion8\stubs\WS\WS-21028249\com\foo\bar\

  3. 将所有内容从com复制到CF类路径
    中的新目录中。或者您可以创建一个类似于:
    c:\ColdFusion8\MyStubs\com\foo\bar\

  4. 如果您创建了一个新目录,类路径。

  5. 使用它们与任何其他Java对象一样或使用CreateObject()
    MyObj = CreateObject(java,com.foo.bar.MyObject) ;

  1. Access the WSDL in any way with coldfusion.
  2. Look in the CF app directory for the stubs. They are in a "subs" directory, organized by WSDL.like: c:\ColdFusion8\stubs\WS\WS-21028249\com\foo\bar\
  3. Copy everything from "com" on down into a new directory that exists in the CF class path. or you can make one like: c:\ColdFusion8\MyStubs\com\foo\bar\
  4. If you created a new directory add it to the class path. and restart CF services.
  5. Use them like any other java object with or CreateObject() MyObj = CreateObject("java","com.foo.bar.MyObject");

您的数据集对象应该位于Axis决定应该使用的任何Java格式。很可能你需要在cfscript中完成所有这些操作。

Your dataset object should be in there somewhere in whatever java format Axis decided it should be. Most likely you're going to need to do almost all of this in cfscript

QUESTIONS

EDIT FOR QUESTIONS

SOAP对象将定义对象结构,Axis将创建操作它的方法。看看轴创建的Java对象。记住,您可以使用CFDUMP来查看方法和属性。

THe SOAP object will define the object structure and Axis will create methods for manipulating it. Take a look at the Java object that axis creates. Remember that you can use CFDUMP to look at the methods and properties.

现在我已经看到了Axis被混淆的.NET对象,像可怕的非泛型集合变成一个ArrayOfAnyType。 .NET开发人员在他们的服务中使用泛型非常重要,这样Axis就可以正确地定义数组....如果它们不能正常工作,你可能无法在soap中使用它。

Now I HAVE seen .NET objects that Axis gets confused by, like the dreaded non-generic collection that turns into a "ArrayOfAnyType". It's important for .NET developers to use Generics in their services so that Axis can define the arrays properly....if they don't then it sucks and you may not be able to work with it in soap.

但没有恐惧obi-won ...有另一种方式。您可以随时以XML / RPC样式的.NET Web服务进行交互。它不是自动的,它的很多手解析XML,它吸,但有时它是唯一的方法。你应该能够从.NET通过打开.asmx文件,而没有?wsdl在结束时获得一些帮助。如果你这样做.NET将生成一堆文档和示例调用和XML的样子。在这种情况下,您可以创建XML并通过使用cfhttp指定的线路传递它。祝你好运!

but have no fear obi-won...there is another way. You can always interact with .NET web services in a XML/RPC kind of style. It's not automatic, its a lot of hand parsing of XML, it sucks, but sometimes it's the only way to do it. You should be able to get some help from .NET by hitting up the .asmx file without the "?wsdl" on the end. If you do that .NET will generate a bunch of documentation and examples of what the calls and the XML look like. In that case, you can just create the XML and pass it over the wire as specified by using cfhttp. Good Luck!

我应该注意到,据我所知,没有办法混合手动滚动XML与ColdFusion / Apache Axis对象,也没有办法来建模自己的对象用于CF / Axis ...您必须使用存根或无任何

P.S. I should note also that as far as I know there is no way to mix hand rolled XML with the ColdFusion/Apache Axis objects, there is also no way to model your own object for use with CF/Axis...you must use the stubs or nothing

这篇关于Web服务期望一个DataSet对象,我如何通过ColdFusion或在原始XML中提供?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆