简体   繁体   English

从wsdl网址创建Webservice客户端

[英]Creating Webservice Client from wsdl url

I am new to Java(learning) and i'm trying to create web service client from the wsdl url in netbeans 6.8. 我是Java(学习)的新手,我正在尝试从netbeans 6.8中的wsdl url创建Web服务客户端。 I could import all the request by following a tutorial described in this url http://netbeans2.org/kb/docs/websvc/client.html . 我可以按照此URL http://netbeans2.org/kb/docs/websvc/client.html中介绍的教程导入所有请求。 But, when I run a main project I am getting the following exception: 但是,当我运行主项目时,出现以下异常:

com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 302: Moved Temporarily
        at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCode(HttpTransportPipe.java:196)
        at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:168)
        at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
        at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
        at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
        at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
        at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
        at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
        at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
        at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:124)
        at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)
        at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
        at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
        at $Proxy28.createSV(Unknown Source)

Can anyone tell me why i'm getting this exception.Your suggestion will help a lot. 谁能告诉我为什么我会收到这个例外。您的建议会有所帮助。

Thanks, shashi 谢谢,莎诗

A 302 error means the web server thinks the page has moved. 302错误表示Web服务器认为页面已移动。 http://www.checkupdown.com/status/E302.html http://www.checkupdown.com/status/E302.html

I bet either you typed in the page wrong, or whoever setup the url didn't update it's redirection when the page was setup. 我敢打赌,您在页面中键入的错误,或者无论谁设置的URL都没有更新,而是在页面设置时进行了重定向。

Btw, you should be able to see a wsdl resolve in a browser as XML if you want to test it. 顺便说一句,如果要测试,您应该能够在浏览器中看到wsdl解析为XML。

Are you using JBoss? 您在使用JBoss吗? This is a known issue in JBoss 5.1.x 这是JBoss 5.1.x中的一个已知问题

Either comment out the line 要么注释掉行

<property name="webServiceHost">${jboss.bind.address}</property>

in

APPSRV_HOME/server/default/deployers/jbossws.deployer/META-INF/jboss-beans.xml

or switch to a newer version of JBoss. 或切换到新版本的JBoss。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM