惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - Notus|南色的风

asp.net用url重写URLReWriter实现任意二级域名(续) selenium cant start a new browser(ie7):java.lang.StringIndexOutOfBoundsException: String index out of range: -1 修改sql server2005的系统时间 conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. java移动/复制文件 copy/move file eclipse输出jar的利器 java的Date.getTime()转换成C#的Datetime.ticks - Notus|南色的风 - 博客园 我的新博客 关于小凡 关于迷笛音乐节的重大通知-_- 给我一点自由...... 4月份的歌 都说了,一切都会过去 everything Will Flow Take It Away song2 【Ireland On-Line】霍利尔:裁判毁了枪手 【每日邮报】利物浦对阵阿森纳能走出牢狱要谢天谢地谢Peter Turn into
java调用c#写的webservice
Notus|南色的风 · 2008-07-17 · via 博客园 - Notus|南色的风

首先要明白,webservice都一个样,对使用者来说,他看不出来你这个webservice是用什么写的,因为都是soap和wsdl状的东西,那么为什么要起这么个名字,嗯...是为了方便广大熟悉c#后来又用java的兄弟姐妹们搜索.
使用c#的群众知道,用vs来生成一个webservice调用简单的让只用java的人们不敢相信(...),一个对话框,一个地址,一个finish按钮,一切都搞定了.很好,那现在你开始用java了,开始痛苦了...暂时先别痛苦了,我来告诉你一个和vs几乎差不多的eclipse插件,用这个来调用webservice也很简单.
这个东西叫XFire.点击下面的网址,你就会得到一切.
http://xfire.codehaus.org/Eclipse+Plugin
很好,于是你安装了,使用了.发现这个真的和vs一样容易,而且也和vs一样主动给你生成了好多类,用起来和自己写的一样,嗨,真不错.
那该怎么调用呢?
假设你要调用的webservice的名字是HelloWorld,这个有一个WebMethod叫SayHey(string name).那你找一下自动生产的那些类,里面应该有个叫HelloWorldClient的.下面的代码演示了如何使用:

HelloWorldClient serviceClient = new HelloWorldClient();
HelloWorldSoap soap= serviceClient.getHelloWorldSoap();
String result=soap.SayHey("notus");

总的来说,就是xfire会用你提供的wsdl地址生成类,而和vs不同的是,你需要两步才能调用到你的webmethod.

如果你安装上面的步骤一步一步来了,那很好,最后你注定没有办法运行成功-_- 因为,因为这个毕竟不是真的vs,在运行前,你需要做一个设置.
从你的项目的右键菜单里调出Properties配置窗口,选中左面一栏中的XFire项,右面会列出所有与XFire运行有关的类库,选中如图所示的类库,这样就万事大吉了。

恭喜你,第一步算是迈出来了!

下面有一个写的比较详细的文章,推荐给大家.在我为为什么不能运行而百般苦恼的时候,是这篇文章告诉我需要在配置里勾选某些类...从而把我从痛苦中拉了出来.
http://blog.csdn.net/igate/archive/2008/04/12/2286147.aspx
那我为什么要自己唠叨,而不是直接给出这个地址?我知道我的轮子造的没有人家的好,我这么做是为了备份一下,万一哪天csdn的博客崩溃了...
而且,我这个标题更容易让使用c#的你搜索到,而不用和我一样痛苦了...什么maven,什么ant,什么什么什么,都见鬼去吧