Delphi 2007不能正常使用JAX-WS Web服务 [英] Delphi 2007 not consuming JAX-WS web service properly

查看:160
本文介绍了Delphi 2007不能正常使用JAX-WS Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用JAVA-WS在Java中设置的Web服务时,我在Delphi 2007中遇到了一个问题。 Web服务可以从另一个Java程序和C#/ ASP.NET 2.0网站获取。但是,当我尝试使用Delphi 2007(17-DEc-2007补丁)中的WSDL Importer访问相同的服务时,JAX-WS Web服务不会识别我传递的任何参数,并将它们置空。 / p>

我已经检查了由Delphi传递的SOAP消息,并将其与其他对象进行了比较,并且它们几乎完全相同(除了一些可忽略的命名空间decs和整体之外我也一直在网络上(最有帮助的链接是Bob博士的 http://www.bobswart.nl/Weblog/Blog.aspx?RootId=5:798 )但没有喜悦。



有没有人遇到过?



TIA。






传奇继续!



在使用HTTPRIO对象进行破坏后,尝试获取它的工作我终于放弃了,并尝试通过HTTP直接的XML传输。失败。



好的,所以我在C#中构建了一个简单的测试程序,并尝试这样做。没有任何问题。



使用Fiddler查看正在向前和向后发送的内容,似乎唯一的区别是在命名空间中。我更改了Delphi中XML发送的命名空间,...它的工作原理!



这是由WSDLImporter生成的原始XML的示例:

 <?xml version =1.0?> 
< SOAP-ENV:Envelope xmlns:SOAP-ENV =http://schemas.xmlsoap.org/soap/envelope/>
< SOAP-ENV:Body>
< version xmlns =http://path.to.service.com/>
< input> test< / input>
< / version>
< / SOAP-ENV:Body>
< / SOAP-ENV:Envelope>

这里是实际工作原理:

 <?xml version =1.0?> 
< S:Envelope xmlns:S =http://schemas.xmlsoap.org/soap/envelope/>
< S:Body>
< ns2:version xmlns:ns2 =http://path.to.service.com/>
< input> test< / input>
< / ns2:version>
< / S:Body>
< / S:信封>

所以,现在我知道这一点,我要改变WSDLImporter代码的命名空间值?我在HTTPRIO属性上看不到任何明显的东西。



TIA

解决方案

HA HA IT LIVES !!!



基本上我不得不拿出推荐的

  InvRegistry.RegisterInvokeOptions(TypeInfo(ActivityService),ioDocument); 

并强制使用Sec。 5编码。命名空间根据需要生成,参数传递给Java Web服务。



对,需要啤酒,大量啤酒:)


I'm having an issue with Delphi 2007 when trying to consume a web service I've set up in Java using JAX-WS. The web service can be consumed fine from another Java program and from a C# / ASP.NET 2.0 website. However, when I try to access the same service using the WSDL Importer in Delphi 2007 (17-DEc-2007 patch), the JAX-WS web service doesn't recognise any of the parameters I'm passing it and nulls them.

I've checked the SOAP message that's being passed by Delphi and compared it to the others and they are pretty much identical (with the exception of some negligable namespace decs and a whole lot of view state from the .NET one!)

I've also been around the web (most helpful link was Dr Bob's http://www.bobswart.nl/Weblog/Blog.aspx?RootId=5:798) but no joy.

Has anybody come across this before?

TIA.


The saga continues!

After buggering about with the HTTPRIO object to try and get it working I eventually gave up and tried a straight XML transfer over HTTP. Fail.

OK, so I built a simple tester in C# and tried that. Works no problem.

Using Fiddler to see what was being sent backwards and forwards it seemed that the only difference was in the namespaces. I changed the namespaces in the XML send in Delphi and ... it works!

This was a sample of the original XML being generated by the WSDLImporter:

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <version xmlns="http://path.to.service.com/">
            <input>test</input>
        </version>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

and here is what actually works:

<?xml version="1.0"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <ns2:version xmlns:ns2="http://path.to.service.com/">
            <input>test</input>
        </ns2:version>
    </S:Body>
</S:Envelope>

So, now that I know this, I do I go about changing the namespace values for the WSDLImporter code? I can't see anything obvious on the HTTPRIO properties.

TIA

解决方案

HA HA IT LIVES!!!

Basically I had to take out the recommended

InvRegistry.RegisterInvokeOptions(TypeInfo(ActivityService), ioDocument);

and force it to use Sec. 5 encoding. Namespaces are generated as required and parameters are passed to the Java web service.

Right, need beer, lots of beer :)

这篇关于Delphi 2007不能正常使用JAX-WS Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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