faultString: No endpoint

在使用Axis工具生成客户端代码并尝试调用服务时遇到错误:AxisFault,faultString: No endpoint。错误发生在com.wasu.WmgwSoap12Stub的mongateCsSpSendSmsNew方法中。问题可能与缺失的服务端点有关,导致无法定位到正确的服务地址。检查并确保正确配置了服务端点。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用axis生成客户端代码调用时报错如下:
[color=red]AxisFault
faultCode: {http://xml.apache.org/axis/}Server.NoEndpoint
faultSubcode:
faultString: No endpoint
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}exceptionName:org.apache.axis.NoEndPointException
{http://xml.apache.org/axis/}stackTrace:No endpoint
at com.wasu.WmgwSoap12Stub.mongateCsSpSendSmsNew(WmgwSoap12Stub.java:275)
at com.wasu.Test.mongateCsSpSendSmsNew01(Test.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

{http://xml.apache.org/axis/}hostname:2012-20131023HT

No endpoint
at com.wasu.WmgwSoap12Stub.mongateCsSpSendSmsNew(WmgwSoap12Stub.java:275)
at com.wasu.Test.mongateCsSpSendSmsNew01(Test.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
[/color]

客户端调用代码:

package com.wasu;

import java.rmi.RemoteException;
import java.util.Date;

import javax.xml.rpc.ServiceException;

import junit.framework.TestCase;

public class Test extends TestCase {

private String userId = "BG2059";
private String password = "070033";
private String pszMobis = "13857552768";
private String pszMsg = "测试" + new Date().getTime();

public void mongateCsSpSendSmsNew01() {// 错误调用代码
try {
WmgwSoap12Stub wmgwSoap12Stub = new WmgwSoap12Stub();
System.out.println(wmgwSoap12Stub.mongateCsSpSendSmsNew(userId,
password, pszMobis, pszMsg, 1, "*"));

} catch (RemoteException e) {
e.printStackTrace();
}
}

public void mongateCsSpSendSmsNew02() {// 正确调用代码
try {
WmgwLocator wmgwLocator = new WmgwLocator();
WmgwSoap_PortType wmgwSoap_PortType = wmgwLocator.getwmgwSoap12();
System.out.println(wmgwSoap_PortType.mongateCsSpSendSmsNew(userId,
password, pszMobis, pszMsg, 1, "*"));
} catch (RemoteException e) {
e.printStackTrace();
} catch (ServiceException e) {
e.printStackTrace();
}
}
}

生成的代码结构如下:
[img]http://dl2.iteye.com/upload/attachment/0095/4670/97d37ae4-4ad3-37c6-9540-7a9b54122f2f.png[/img]
WmgwLocator.java部分代码如下:
/**
* WmgwLocator.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/

package com.wasu;

public class WmgwLocator extends org.apache.axis.client.Service implements com.wasu.Wmgw {

......

public com.wasu.WmgwSoap_PortType getwmgwSoap12() throws javax.xml.rpc.ServiceException {
java.net.URL endpoint;
try {
endpoint = new java.net.URL(wmgwSoap12_address);
}
catch (java.net.MalformedURLException e) {
throw new javax.xml.rpc.ServiceException(e);
}
return getwmgwSoap12(endpoint);
}

....

}

WmgwSoap_PortType.java部分代码如下:

package com.wasu;

public interface WmgwSoap_PortType extends java.rmi.Remote {

public java.lang.String mongateCsSpSendSmsNew(java.lang.String userId, java.lang.String password, java.lang.String pszMobis, java.lang.String pszMsg, int iMobiCount, java.lang.String pszSubPort) throws java.rmi.RemoteException;

....}

WmgwSoap12Stub.java部分代码如下:
/**
* WmgwSoap12Stub.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/

package com.wasu;

public class WmgwSoap12Stub extends org.apache.axis.client.Stub implements com.wasu.WmgwSoap_PortType {
.......

public java.lang.String mongateCsSpSendSmsNew(java.lang.String userId, java.lang.String password, java.lang.String pszMobis, java.lang.String pszMsg, int iMobiCount, java.lang.String pszSubPort) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("http://tempuri.org/MongateCsSpSendSmsNew");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP12_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://tempuri.org/", "MongateCsSpSendSmsNew"));

setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {userId, password, pszMobis, pszMsg, new java.lang.Integer(iMobiCount), pszSubPort});

if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (java.lang.String) _resp;
} catch (java.lang.Exception _exception) {
return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
}
}

......

}


[url=http://zoroeye.iteye.com/blog/2048099]wsdl详细介绍[/url]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值