After Java creates the webservice, you can access the wsdl, but cannot access the service.

problem description

refer to the online code ( https://www.cnblogs.com/xdp-g.). After opening the service, the browser cannot access the service directly, but can access its wsdl.

https://bbs.csdn.net/topics/3...jdk1.81.7

related codes

package com.junzhang.webservice;

import javax.xml.ws.Endpoint;

/**
 * Endpoint()webservice
 * @author oiu
 *
 */
public class WebServicePublish {

     public static void main(String[] args) {
            //WebServiceWeberviceURLURL:http://ip:/xxxx            
            String address = "http://127.0.0.1:8002/Webservice";
            //EndpointpublishWebService
            Endpoint.publish(address , new WebServiceImpl());
            System.out.println("webservice!");
        }
}

package com.junzhang.webservice;

import javax.jws.WebService;

@WebService
public class WebServiceImpl implements WebServiceI{

     @Override
        public String sayHello(String name) {
            System.out.println("WebService sayHello "+name);
            return "sayHello "+name;
        }

        @Override
        public String save(String name, String pwd) {
            System.out.println("WebService save "+name+" "+pwd);
            return "save Success";
        }
        
}

package com.junzhang.webservice;

import javax.jws.WebMethod;
import javax.jws.WebService;

/**
 * interface@WebService@WebMethod
 * @author oiu
 *
 */

@WebService
public interface WebServiceI {

     //@WebMethodWebServiceI
    @WebMethod
    String sayHello(String name);
    
    @WebMethod
    String save(String name,String pwd);
    
}

what result do you expect? What is the error message actually seen?

May.23,2021

* * Hello, have you solved this problem? have you encountered the same

? < hr >

like questions bold text *

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c141a2-32eae.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c141a2-32eae.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?