zoukankan      html  css  js  c++  java
  • How to Log SOAP Message Content in Metro?(官方解答)

    FROM:https://jax-ws.dev.java.net/2.1.5/docs/ri-features.html#Propagation_of_Server_side_Stacktrace

    Contents

      This page contains information about JAX-WS RI 2.1.5 specific features and extensions:
    1. 1. Sending and Receiving SOAP Headers
      1. 1.1. Sending SOAP Headers
        1. 1.2. Receiving SOAP Headers
        2. 2. Message logging
          1. 2.1. On the client
            1. 2.2. On the server side
            2. 3. Propagation of Server-side Stacktrace
              1. 3.1. Disabling propagation of Server-side stacktrace

              This page contains information about JAX-WS RI 2.1.5 specific features and extensions: 1. Sending and Receiving SOAP Headers

              At times you need a way to send and receive SOAP headers in your message - these headers may not be defined in the WSDL binding but your application needs to do it anyway. One approach has been to write a SOAPHandler to do it, but its more work and is expensive as SOAPHandlers work on SOAPMesssage which is DOM based and JAX-WS runtime would need to do conversion from its abstract Message representation to SOAPMessage and vice versa.

              There is a way to do it on the client side by downcasting the proxy to WSBindingProvider and use methods on it. 1.1. Sending SOAP Headers

              You would downcasting the proxy to WSBindingProvider and set the Outbound headers.

              HelloService helloService = new HelloService();HelloPort port = helloService.getHelloPort();WSBindingProvider bp = (WSBindingProvider)port;bp.setOutboundHeaders(  // simple string value as a header, like stringValue  Headers.create(new QName("simpleHeader"),"stringValue"),  // create a header from JAXB object  Headers.create(jaxbContext,myJaxbObject));

              List
              inboundHeaders = bp.getInboundHeaders();

              Web Services developers generally need to see SOAP Messages that are transferred between client and service for debugging. There are SOAP Monitors for this job, but you need modify the client or server code to use those tools. JAX-WS RI provides logging of SOAP messages 2.1. On the client

              Set system property

              com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true

              Set system property

              com.sun.xml.ws.transport.http.HttpAdapter.dump=true

              This is a very useful feature while developing Web Services. Often the soap fault messages does n't convey enough information about the problem. JAX-WS RI relieves you from digging out the server logs to find out the stacktrace. Now the whole stacktrace (including nested exceptions) is propagated in the SOAP Fault and the complete exception stacktrace is visible to the client as cause of SOAPFaultException. 3.1. Disabling propagation of Server-side stacktrace

              Propagation of Stack trace is on by default. If you think its not safe for your Web Service Application to send the complete stack trace, you can turn off this functionality by setting the system property

              com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace=false

              3. Propagation of Server-side Stacktrace 2.2. On the server side 2. Message logging 1.2. Receiving SOAP Headers

            3. 相关阅读:
              机器视觉行业分析
              lua sample code analysis
              My GPU info from "GPU Caps Viewer"
              网页hack程序编写
              debug redmine send email
              如何下载web资源
              看国内网络电视解决方案2
              看国内网络电视解决方案
              babel-polyfill使用与性能优化
              升级NGINX支持HTTP/2服务端推送
            4. 原文地址:https://www.cnblogs.com/huqingyu/p/1693442.html
            Copyright © 2011-2022 走看看