天道酬勤,学无止境

java-metro-framework

Problem consuming Exchange Web Service 2010 with jax-ws metro

问题 我正在尝试使用 JAX-WS 使用 Exchange 2010 Web 服务接口。 我正在使用 JAX-WS 2.2 RI (Metro 2.0)。 2.1 出现了同样的问题。 我遇到了 Exchange 的问题,它返回“HTTP/1.1 415 无法处理消息,因为内容类型 'text/xml;charset=utf-8' 不是预期的类型 'text/xml;charset=utf-8' 。” 作为响应(2.1 引用了字符集值,否则响应相同)。 显然,我需要指定确切的 Content-type 标头才能让 Exchange 满意。 有没有办法让我在不强迫我手动重建依赖项的情况下做到这一点? 我目前依赖于已发布的 Maven 工件,如果可能的话,我希望继续这样做。 消费进程是一个常规的 J2SE 应用程序,看不到容器。 我可以控制应用程序,并且可以向应用程序范围添加几乎所有需要的东西,但不能添加像代理服务器这样的进程外项目。 客户端类是从本地 WSDL 生成的,但字符集规范派生自 jaxws RI 实现中声明的常量,而不是生成的代码。 因此,生成的 HTTP 传输由 Sun JRE5 或 JRE6 的标准 http/https 客户端处理。 回答1 从这个线程(给出一个缓存的链接,因为当前 java.net 论坛已关闭),看来问题最终是您的 Exchange Web

2022-05-06 13:25:29    分类:技术分享    java   web-services   jax-ws   java-metro-framework

WSDL Requests with Metro/JAX-WS/WSIT During Runtime

问题 在运行时,JAX-WS 会获取 SOAP 端点的 WSDL,即使它已经在 IDE 中运行了 wsimport。 此处说明了此行为:http://jax-ws.java.net/faq/index.html#wsdl_at_runtime 客户端在运行时可以检索的元数据数量是否有限制? 如果是这样,有没有办法增加这个限制? 请注意,我不是指在 IDE 中运行 wsimport。 效果很好。 我专门讨论的是在运行时获取 WSDL 元数据。 回答1 回答2 Metro/JAX-WS-ri 在运行时需要 WSDL。 有关说明,请参见 http://jax-ws.java.net/faq/index.html#wsdl_at_runtime。 为了防止在运行时获取 WSDL,您应该将其打包为资源并在实例化代理工厂时提供它: new XYZ_Service( XYZ_Service.class.getResource( "/path/to/your/XYZ.wsdl" ), new QName( "NameSpace", "ServiceName" ) ); 回答3 基于您参考 Metro FAQ 的事实,您显然已经阅读了关于为什么在运行时仍需要 WSDL 副本的原因。 重申一下常见问题解答,原因是能够支持没有相应 Java 注释的 WS-* 扩展。 Metro

2022-05-01 07:08:09    分类:技术分享    java   glassfish   jax-ws   java-metro-framework   wsit

Problem consuming Exchange Web Service 2010 with jax-ws metro

I am trying to consume the Exchange 2010 Web Service interface using JAX-WS. I'm using JAX-WS 2.2 RI (Metro 2.0). 2.1 exhibited the same problem. I am running into trouble with Exchange, which returns "HTTP/1.1 415 Cannot process the message because the content type 'text/xml;charset=utf-8' was not the expected type 'text/xml; charset=utf-8'." as a reponse (2.1 quoted the charset value, otherwise same response). Apparently I need to dictate the exact Content-type header for Exchange to be happy. Is there a way for me to do this without forcing me to manually rebuild the dependency? I currently

2022-04-28 06:57:14    分类:问答    java   web-services   jax-ws   java-metro-framework

SOAP Service: Missing WS-Addressing header

I have a Netbeans SOAP service I can deploy with no issues and a Silverlight client. When I call the service from Silverlight, I get (in silverlight): new DiscourseParserWSClient created; event handler added; service called; Service State is: Open http://localhost:8080/DiscourseParserWS/DiscourseParserWSService An exception occurred during the operation, making the result invalid. The remote server returned an error: NotFound. After the client calls the service, GlassFish v3 Domain responds with the following problem I fail to decipher: WARNING: A required header representing a Message

2022-03-26 02:03:48    分类:问答    soap   netbeans   service   glassfish   java-metro-framework

Is it possible to get the raw XML payload using Metro web services framework?

I'm writing a web service client that runs in Apache Tomcat. I need to get the XML payload for the request/response so that I can log it. Dumping the bytes to stdOut is not what I want. I want to get it as bytes in my Java code, so that I can log it the way that I want. Is there any way to do this?

2022-03-24 20:35:10    分类:问答    xml   tomcat   logging   java-metro-framework

Consuming a WCF service in a Java Client using wsHttpBinding

I'm trying to get a Java Client to communicate with a WCF wshttpbinding WebService. But I've been unsucesful so far. The call either hangs, or I get: “SOAPFaultException: The message could not be processed. This is most likely because the action 'http://tempuri.org/ISampleService/GetServiceName' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely

2022-03-19 07:56:27    分类:问答    java   wcf   web-services   java-metro-framework   wshttpbinding

WSDL Requests with Metro/JAX-WS/WSIT During Runtime

During runtime, JAX-WS fetches the WSDL of a SOAP endpoint even though it already ran wsimport in the IDE. This behavior is illustrated here: http://jax-ws.java.net/faq/index.html#wsdl_at_runtime Is there a limit to amount of metadata that a client can retrieve during runtime? If so, is there a way to increase this limit? Please note that I am not referring to running wsimport inside the IDE; that works fine. I'm specifically talking about fetching the WSDL metadata during runtime.

2022-03-15 01:31:28    分类:问答    java   glassfish   jax-ws   java-metro-framework   wsit

IntelliJ Web Client Errors

I'm trying to create a Java web service client with IntelliJ IDEA, but am getting errors. My web service "MagicEightBall" is a minimalistic service that has one method: "GetAdvice", which takes no arguments and returns a string. When I use IntelliJ to create a WebServices client (using GlashFish / JAXWS 2.X RI / Metro 1.X / JWSDP 2.0 ), I get the following code: public class HelloWorldClient { public static void main(String[] argv) { pakeightball.IMagicEightBallService service = new MagicEightBallService().(); //invoke business method service.getAdvice(); } } I tried this with a WCF

2022-03-14 22:38:57    分类:问答    wcf   web-services   java-metro-framework   wshttpbinding