`

faultString: No endpoint

阅读更多
使用axis生成客户端代码调用时报错如下:
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)


客户端调用代码:
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();
		}
	}
}

生成的代码结构如下:

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;
}
    }

    ......

}


wsdl详细介绍
  • 大小: 3.5 KB
分享到:
评论

相关推荐

    axis2 InvocationTargetException

    标题 "axis2 InvocationTargetException" 描述的是一个与Apache Axis2框架相关的编程问题,该问题通常在执行服务调用时出现,提示"InvocationTargetException"。这可能是由于多种原因引起的,包括但不限于错误的服务...

    webservice启动没有问题,通过自动生成的客户端报错

    faultString: java.lang.reflect.InvocationTargetException faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: AxisFault faultCode: {...

    SOAP调用Axis服务的Client

    SOAP(Simple Object Access Protocol)是一种基于XML的网络通信协议,常用于Web服务的交互。Axis是Apache软件基金会开发的一个开源工具,它提供了SOAP服务的实现,包括服务端和客户端。本篇文章将深入探讨如何使用...

    调用WEB服务的错误 服务器无法处理请求 无法生成临时类 result 1 解决办法

    自己总结:调用WEB服务的错误 服务器无法处理请求 无法生成临时类 result 1 多种解决办法

    org.xml.sax.SAXException: Invalid element

    NULL 博文链接:https://wilian.iteye.com/blog/1992365

    flex的rpc错误整理

    2. **faultCode:Channel.Security.Error faultString:'Securityerror accessing url' faultDetail:'Destination: DefaultHTTP'** 出现安全错误访问URL,可能是因为跨域限制。需要在服务器端设置适当的跨域策略,...

    Flex_RPC错误大全

    错误信息:“faultCode:Channel.Security.Error faultString:'Security error accessing url' faultDetail:'Destination:DefaultHTTP'” - **问题分析**:不使用代理时遇到的安全沙箱冲突,这可能是因为Flash ...

    CVE-2020-9496 ofbiz反序列化漏洞分析1

    要检测该漏洞,可以发送恶意的XML-RPC请求,检查响应包中是否存在faultString, No such service [ProjectDiscovery], methodResponse关键词。如果存在这些关键词,证明漏洞存在。 在分析该漏洞时,我们可以查看/web...

    flex与 java 通信常见错误

    ### Flex与Java通信常见错误分析 ...RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: '...

    java利用webservice发布服务定义.pdf

    创建一个新的Java类,如`MainServer`,并使用`Endpoint`类的`publish`方法来发布你的服务。以下是一个简单的示例: ```java package lee; import javax.xml.ws.Endpoint; import ...

    QtSoap解决方案

    如果有错误,可以通过`faultString()`和`faultCode()`获取详细信息。 **7. 性能与优化** 虽然QtSoap简化了SOAP通信,但在处理大量请求或高并发场景时,可能需要考虑性能优化,如使用异步调用、缓存结果、批量处理...

    BlazeDS与java整合的最佳方案

    trace("Error: " + fault.faultString); } ``` 这段代码定义了一个简单的Flex客户端,通过调用`getHelloWorld`方法来获取远程服务器上的数据,并通过控制台输出结果。 #### 七、测试与调试 1. **启动Tomcat**:...

    PHP使用SOAP调用.net的WebService数据

    trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR); } else { $data = $result->GetArticleResult; print_r($data); } ``` 这里,`...

    flash+xml超酷欧美FLASH整站源码

    Alert.show(event.fault.faultString, event.fault.faultCode); } ]]> </mx:Script> <mx:HTTPService id="service" url="data/slideshow.xml" result="resultHandler(event)" fault=...

    Flex调用xml通过DataGrid遍历简单示例

    Alert.show(event.fault.faultString, event.fault.faultCode); } ]]> </mx:Script> <mx:HTTPService id="service" url="data/slideshow.xml" result="resultHandler(event)" fault=...

    Soap 消息.doc

    <faultstring>Invalid parameter</faultstring> <Error xmlns="http://example.com/"> <Code>1001 <Description>Invalid value for 'intA' </soap:Fault> </soap:Body> </soap:Envelope> ``` 通过以上...

    WSDL文件简介-本文介绍了如何编写一个简单的WSDL文件,并根据WSDL文件编写服务器端和客户端代码,并发布Web Service服务的过程

    <xsd:element name="faultString" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> ``` #### 接口定义 接口(或称为 PortType)定义了服务所支持的操作集。例如,下面的定义指定了一个...

    SOAP协议样列

    <faultstring>It is not allowed to send greetings on Tuesdays.</faultstring> <errorDetail>... </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ``` 这里的`SOAP-ENV:Fault`元素包含了关于...

    构建WCF面向服务的应用程序系列课程(4):异常与错误处理

    每个SOAP Fault包含了一系列的元素,如`faultcode`、`faultstring`、`faultactor`以及`detail`等,这些元素共同描述了错误的性质、来源及详细信息。 - **faultcode**:标识错误类型,可以是预定义的或自定义的。 - ...

Global site tag (gtag.js) - Google Analytics