1 Reply Latest reply on Sep 13, 2008 2:03 AM by srini rengasamy

    org.jboss.ws.WSException: Cannot find port in wsdl:

    srini rengasamy Newbie

      I am using standard WSDL packaged with jaxws-ri AddNumbers.wsdl. I am following wsdl first approach to design my Java implementation. I followed the steps given in
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=104843
      I was able to make Echo service work fine, however I could not do AddNumbers which is as given below

      <?xml version="1.0" encoding="UTF-8"?>
      
      <definitions name="AddNumbers" targetNamespace="http://duke.example.org" xmlns:tns="http://duke.example.org"
       xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
       <types>
       <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://duke.example.org">
      
       <complexType name="addNumbersResponse">
       <sequence>
       <element name="return" type="xsd:int" />
       </sequence>
       </complexType>
       <element name="addNumbersResponse" type="tns:addNumbersResponse" />
      
       <complexType name="addNumbers">
       <sequence>
       <element name="arg0" type="xsd:int" />
       <element name="arg1" type="xsd:int" />
       </sequence>
       </complexType>
       <element name="addNumbers" type="tns:addNumbers" />
      
       <element name="AddNumbersFault" type="tns:AddNumbersFault" />
       <complexType name="AddNumbersFault">
       <sequence>
       <element name="faultInfo" type="xsd:string" />
       <element name="message" type="xsd:string" />
       </sequence>
       </complexType>
       </xsd:schema>
       </types>
       <message name="addNumbers">
       <part name="parameters" element="tns:addNumbers" />
       </message>
       <message name="addNumbersResponse">
       <part name="result" element="tns:addNumbersResponse" />
       </message>
       <message name="addNumbersFault">
       <part name="AddNumbersFault" element="tns:AddNumbersFault" />
       </message>
       <portType name="AddNumbersPortType">
       <operation name="addNumbers">
       <input message="tns:addNumbers" />
       <output message="tns:addNumbersResponse" />
       <fault name="addNumbersFault" message="tns:addNumbersFault"/>
       </operation>
       </portType>
       <binding name="AddNumbersBinding" type="tns:AddNumbersPortType">
       <soap:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
       <operation name="addNumbers">
       <soap:operation soapAction="" />
       <input>
       <soap:body use="literal" />
       </input>
       <output>
       <soap:body use="literal" />
       </output>
       <fault name="addNumbersFault">
       <soap:fault name="addNumbersFault" use="literal" />
       </fault>
       </operation>
       </binding>
       <service name="AddNumbersService">
       <port name="AddNumbersPort" binding="tns:AddNumbersBinding">
       <soap:address location="http://localhost:8080/AddNumbers" />
       </port>
       </service>
      </definitions>


      I ran wsconsume on this and wrote my impl class AddNumbersImp.java


      @javax.jws.WebService(endpointInterface="org.example.duke.AddNumbersPortType", portName="AddNumbersPort")

      public class AddNumbersImpl implements AddNumbersPortType {

      public int addNumbers(int arg0, int arg1)throws AddNumbersFault_Exception
      {
      return 10;
      }

      }

      After building AddNumbers.war file at deployment time I get the following error

      15:27:46,185 INFO [DefaultEndpointRegistry] register: jboss.ws:context=AddNumbers,endpoint=AddNumbers
      15:27:46,200 INFO [TomcatDeployer] deploy, ctxPath=/AddNumbers, warUrl=.../tmp/deploy/tmp53972AddNumbers-exp.war/
      15:27:46,482 WARN [PolicyMetaDataBuilder] Cannot get service '{http://duke.example.org/}AddNumbersImplService' from the given wsdl definitions! Eventual policies attached to this service won't be considered.
      15:27:46,560 ERROR [MainDeployer] Could not start deployment: file:/C:/Program Files/JBoss/server/default/deploy/AddNumbers.war
      org.jboss.ws.WSException: Cannot find port in wsdl: {http://duke.example.org/}AddNumbersPort
      at org.jboss.ws.metadata.builder.MetaDataBuilder.replaceAddressLocation(MetaDataBuilder.java:338)
      at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:192)
      at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:50)
      at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE.buildMetaData(JAXWSMetaDataBuilderJSE.java:63)
      at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.create(UnifiedMetaDataDeploymentAspect.java:66)
      at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(Unknown Source)
      at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:97)
      at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:90)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy45.start(Unknown Source)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)


      I tried several ways to tweak the PortName, but I don't have any success. Appreciate any help