How Java prints the SOAP message Protocol sent by WebService

Source: Internet
Author: User
Tags soap

all know WebService the bottom is also used HTTP communication, but how to print out the bottom of the message is also our debugging interface is the most convenient and quickest way. These are only applicable to the proxy class generated by the worker. Pro-Test Java JDK generated proxy classes to make it. Also known as Jax-WS. The following codeImportJava.io.BufferedReader;Importjava.io.IOException;ImportJava.io.InputStream;ImportJava.io.InputStreamReader;ImportJava.io.OutputStream;ImportJava.net.ServerSocket;ImportJava.net.Socket; Public classServer {ServerSocket ss; Socket serversocket;inputstream instream;outputstream OutStream; PublicServer () {Try{System.out.println ("====================server=================="); SS=NewServerSocket (80); ServerSocket=ss.accept (); System.out.println ("--------------Some guest connected----------------"); Instream=Serversocket.getinputstream (); OutStream=Serversocket.getoutputstream ();} Catch(Exception e) {e.printstacktrace ();}} Public voidConn () {NewThread () { Public voidrun () {Try{InputStreamReader Ireader=NewInputStreamReader (instream); BufferedReader Ibufferstream=NewBufferedReader (Ireader); String Line=NULL; while(line = Ibufferstream.readline ())! =NULL) {System.out.println (line);}} Catch(IOException e) {e.printstacktrace ();}}}. Start ();} Public Static voidMain (String args[]) {Server server=NewServer (); Server.conn ();}} The above code is the listening port, for example, your webservice is sent to Port 9001, you will change 80 to 9001. The second is to change the WSDL address to WebService, first download it. Put it in an internal project. Then change the service class address in the proxy class. Remember Some WebService interface provider description must use the domain name, then you will change your host configuration, configure a map, such as.

How Java prints the SOAP message Protocol sent by WebService

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.