0

我有以下 wsdl 文件:-

<?xml version="1.0" encoding="UTF-8"?>

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://schema.intersec.com/igloo/push/v1.2"
    targetNamespace="http://schema.intersec.com/igloo/push/v1.2">

    <!-- WSDL types -->
    <types>
        <schema targetNamespace="http://schema.intersec.com/igloo/push/v1.2"
            xmlns="http://www.w3.org/2001/XMLSchema">
            <complexType name="push.EventV2">
                <sequence>
                    <element name="cgi" minOccurs="0" type="string" />
                </sequence>
            </complexType>

            <!-- RPC arguments types -->
            <!-- Fails if i have this -->
            <!-- <element name="events.eventV2Req" type="tns:push.EventV2" /> -->
            <!-- Works if i have this -->
            <element name="events.eventV2Req" type="string"/>
        </schema>
    </types>

    <!-- WSDL Messages -->
    <message name="events.eventV2Req">
        <part name="parameters" element="tns:events.eventV2Req" />
    </message>

    <!-- WSDL Ports -->
    <portType name="push.PushPortType">
    <operation name="events.eventV2">
      <input message="tns:events.eventV2Req" />
    </operation>
  </portType>

  <!-- WSDL Bindings -->
  <binding name="push.PushBinding" type="tns:push.PushPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="events.eventV2">
      <soap:operation soapAction="" />
      <input>
        <soap:body use="literal" />
      </input>
    </operation>
  </binding>

  <!-- WSDL Services -->
  <service name="push.Push">
    <port name="push.PushEndPoint" binding="tns:push.PushBinding">
      <soap:address location="http://localhost:10700/Igloo/push.Push" />
    </port>
  </service>
</definitions>

这工作使用以下 ant 任务生成(即生成的代码成功(尽管我必须传入正确的 wsdlURL)): -

    <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
        <arg value="-client" />
        <arg value="-server" />
        <arg value="-impl" />
        <arg value="-frontend" />
        <arg value="jaxws21" />
        <arg value="-d" />
        <arg value="src/generated" />
        <arg value="src/wsdl/Dummy.wsdl" />
        <classpath>
            <path refid="cxf.classpath" />
        </classpath>
    </java>

但是,如果我对以下内容进行相应的评论和取消评论

        <!-- Fails if i have this -->
        <element name="events.eventV2Req" type="tns:push.EventV2" />
        <!-- Works if i have this -->
        <!-- <element name="events.eventV2Req" type="string"/> -->

当我启动服务器并运行客户端代码时,我得到以下信息: -

19-Feb-2013 16:44:06 org.apache.cxf.service.invoker.AbstractInvoker invoke
SEVERE: Invocation without a binding operation.
19-Feb-2013 16:44:06 org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://schema.intersec.com/igloo/push/v1.2}push.Push has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: No binding operation info while invoking unknown method with params unknown.
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:60)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:319)
    at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:287)
    at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:939)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
    at org.eclipse.jetty.server.Server.handle(Server.java:346)
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:589)
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1065)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:823)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)
    at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
    at java.lang.Thread.run(Unknown Source)

有人知道 wsdl 或 jaxws 有什么问题吗?

我在用: -

  • java 1.6.0_31-b05
  • CXF 2.4.6
  • 码头 7.4.5

有任何想法吗?

4

1 回答 1

0

在客户端代码中,有以下行:-

com.intersec.schema.igloo.push.v1.PushEventV2 _eventsEventV2_parameters = null;

如果我将其更改为: -

com.intersec.schema.igloo.push.v1.PushEventV2 _eventsEventV2_parameters 
    = new ObjectFactory().createPushEventV2();

有用。

如果参数为空,我猜它找不到要调用的方法。

我想知道这是jaxws中的错误吗?

于 2013-02-20T08:30:30.133 回答