com.sun.xml.internal.ws.fault.ServerSOAPFaultException

问题描述

如果提供邮政编码作为输入,则将返回相应的城市温度作为输出。这是我的代码:

public class IPLocationFinder {
    public static void main(String[] args) {
        String zipCode = args[0];
        Weather service = new Weather();
        WeatherSoap weatherSoap = service.getWeatherSoap();
        WeatherReturn weatherSoap2 = weatherSoap.getCityWeatherByZIP(zipCode);
        System.out.println("The Temperature is" + weatherSoap2.getTemperature());
    }
}

执行上面的代码时出现以下错误。

Exception in thread "main" com.sun.xml.internal.ws.fault.ServerSOAPFaultException: 
Client received SOAP Fault from server: Server was unable to process request. ---> A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider,error: 40 - Could not open a connection to SQL Server) Please see the server log to find more detail regarding exact cause of the failure.
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(Unknown Source)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(Unknown Source)
at com.sun.xml.internal.ws.client.sei.StubHandler.readResponse(Unknown Source)
at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(Unknown Source)
at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at com.sun.proxy.$Proxy31.getCityWeatherByZIP(Unknown Source)
at com.kaushik.javabrains.IPLocationFinder.main(IPLocationFinder.java:19)

该错误发生在下一行。请提出建议。

WeatherReturn weatherSoap2 = weatherSoap.getCityWeatherByZIP(zipCode);

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...