1 Reply Latest reply on May 27, 2005 4:39 PM by Steve Michael

    Cannot find port with name in wsdl document

    Steve Michael Newbie

      Hello, I am trying to deploy a fairly simple web service and when I deploy the war file to JBOSS 4.0 I get the following error:

      java.lang.IllegalArgumentException: Cannot find port with name 'IGetPerson' in wsdl document

      Here is my WSDL

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

      <definitions name="GetCasPerson" targetNamespace="http://com.dusa.ws.cas/GetPerson" xmlns:tns="http://com.dusa.ws.cas/GetPerson" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://com.dusa.ws.cas/GetPerson/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

      <schema targetNamespace="http://com.dusa.ws.cas/GetPerson/types" xmlns:tns="http://com.dusa.ws.cas/GetPerson/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">








































































      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>

      <soap:operation soapAction=""/>

      <soap:body use="literal"/>

      <soap:body use="literal"/>


      <soap:address location="REPLACE_WITH_ACTUAL_URL"/>

      Here is my jaxrpc-mapping file

      <?xml version="1.0" encoding="UTF-8"?>
      <java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
      <package-mapping>
      <package-type>com.dusa.ws.cas</package-type>
      http://com.dusa.ws.cas/GetPerson/types
      </package-mapping>
      <package-mapping>
      <package-type>com.dusa.ws.cas</package-type>
      http://com.dusa.ws.cas/GetPerson
      </package-mapping>
      <java-xml-type-mapping>
      <java-type>com.dusa.ws.cas.Regions</java-type>
      <root-type-qname xmlns:typeNS="http://com.dusa.ws.cas/GetPerson/types">typeNS:Regions</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>id</java-variable-name>
      <xml-element-name>id</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>name</java-variable-name>
      <xml-element-name>name</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>com.dusa.ws.cas.IGetPerson_getPerson_RequestStruct</java-type>
      <root-type-qname xmlns:typeNS="http://com.dusa.ws.cas/GetPerson/types">typeNS:getPerson</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>Person_1</java-variable-name>
      <xml-element-name>Person_1</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>com.dusa.ws.cas.Groups</java-type>
      <root-type-qname xmlns:typeNS="http://com.dusa.ws.cas/GetPerson/types">typeNS:Groups</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>id</java-variable-name>
      <xml-element-name>id</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>name</java-variable-name>
      <xml-element-name>name</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>com.dusa.ws.cas.Person</java-type>
      <root-type-qname xmlns:typeNS="http://com.dusa.ws.cas/GetPerson/types">typeNS:Person</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>NPI</java-variable-name>
      <xml-element-name>NPI</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>UPIN</java-variable-name>
      <xml-element-name>UPIN</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>acceptedDisclaimer</java-variable-name>
      <xml-element-name>acceptedDisclaimer</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>active</java-variable-name>
      <xml-element-name>active</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>address1</java-variable-name>
      <xml-element-name>address1</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>address2</java-variable-name>
      <xml-element-name>address2</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>address3</java-variable-name>
      <xml-element-name>address3</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>cellPhone</java-variable-name>
      <xml-element-name>cellPhone</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>certifiedTrainerId</java-variable-name>
      <xml-element-name>certifiedTrainerId</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>city</java-variable-name>
      <xml-element-name>city</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>clinicId</java-variable-name>
      <xml-element-name>clinicId</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>companyName</java-variable-name>
      <xml-element-name>companyName</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>country</java-variable-name>
      <xml-element-name>country</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>dateOfBirth</java-variable-name>
      <xml-element-name>dateOfBirth</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>educatorTypeID</java-variable-name>
      <xml-element-name>educatorTypeID</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>email</java-variable-name>
      <xml-element-name>email</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>experationDate</java-variable-name>
      <xml-element-name>experationDate</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>faxPhone</java-variable-name>
      <xml-element-name>faxPhone</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>firstName</java-variable-name>
      <xml-element-name>firstName</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>groups</java-variable-name>
      <xml-element-name>groups</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>healthCareProviderId</java-variable-name>
      <xml-element-name>healthCareProviderId</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>homePhone</java-variable-name>
      <xml-element-name>homePhone</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>hourlyRate</java-variable-name>
      <xml-element-name>hourlyRate</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>id</java-variable-name>
      <xml-element-name>id</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>lastModifiedBy</java-variable-name>
      <xml-element-name>lastModifiedBy</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>lastName</java-variable-name>
      <xml-element-name>lastName</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>locked</java-variable-name>
      <xml-element-name>locked</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>login</java-variable-name>
      <xml-element-name>login</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>marketingOptIn</java-variable-name>
      <xml-element-name>marketingOptIn</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>middleName</java-variable-name>
      <xml-element-name>middleName</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>previousPumpUser</java-variable-name>
      <xml-element-name>previousPumpUser</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>regions</java-variable-name>
      <xml-element-name>regions</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>secretAnswer</java-variable-name>
      <xml-element-name>secretAnswer</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>secretQuestion</java-variable-name>
      <xml-element-name>secretQuestion</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>selfRegistered</java-variable-name>
      <xml-element-name>selfRegistered</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>startDate</java-variable-name>
      <xml-element-name>startDate</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>state</java-variable-name>
      <xml-element-name>state</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>timsId</java-variable-name>
      <xml-element-name>timsId</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>trainedByHCP</java-variable-name>
      <xml-element-name>trainedByHCP</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>trainingChosenId</java-variable-name>
      <xml-element-name>trainingChosenId</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>trainingCompletedId</java-variable-name>
      <xml-element-name>trainingCompletedId</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>trainingMaterialsId</java-variable-name>
      <xml-element-name>trainingMaterialsId</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>trainingStatusId</java-variable-name>
      <xml-element-name>trainingStatusId</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>workPhone</java-variable-name>
      <xml-element-name>workPhone</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>zipCode</java-variable-name>
      <xml-element-name>zipCode</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>com.dusa.ws.cas.IGetPerson_getPerson_ResponseStruct</java-type>
      <root-type-qname xmlns:typeNS="http://com.dusa.ws.cas/GetPerson/types">typeNS:getPersonResponse</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>result</java-variable-name>
      <xml-element-name>result</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <service-interface-mapping>
      <service-interface>com.dusa.ws.cas.GetCasPerson</service-interface>
      <wsdl-service-name xmlns:serviceNS="http://com.dusa.ws.cas/GetPerson">serviceNS:GetCasPerson</wsdl-service-name>
      <port-mapping>
      <port-name>IGetPerson</port-name>
      <java-port-name>IGetPerson</java-port-name>
      </port-mapping>
      </service-interface-mapping>
      <service-endpoint-interface-mapping>
      <service-endpoint-interface>com.dusa.ws.cas.IGetPerson</service-endpoint-interface>
      <wsdl-port-type xmlns:portTypeNS="http://com.dusa.ws.cas/GetPerson">portTypeNS:IGetPerson</wsdl-port-type>
      <wsdl-binding xmlns:bindingNS="http://com.dusa.ws.cas/GetPerson">bindingNS:IGetPersonBinding</wsdl-binding>
      <service-endpoint-method-mapping>
      <java-method-name>getPerson</java-method-name>
      <wsdl-operation>getPerson</wsdl-operation>
      <wrapped-element/>
      <method-param-parts-mapping>
      <param-position>0</param-position>
      <param-type>com.dusa.ws.cas.Person</param-type>
      <wsdl-message-mapping>
      <wsdl-message xmlns:wsdlMsgNS="http://com.dusa.ws.cas/GetPerson">wsdlMsgNS:IGetPerson_getPerson</wsdl-message>
      <wsdl-message-part-name>Person_1</wsdl-message-part-name>
      <parameter-mode>IN</parameter-mode>
      </wsdl-message-mapping>
      </method-param-parts-mapping>
      <wsdl-return-value-mapping>
      <method-return-value>com.dusa.ws.cas.Person</method-return-value>
      <wsdl-message xmlns:wsdlMsgNS="http://com.dusa.ws.cas/GetPerson">wsdlMsgNS:IGetPerson_getPersonResponse</wsdl-message>
      <wsdl-message-part-name>result</wsdl-message-part-name>
      </wsdl-return-value-mapping>
      </service-endpoint-method-mapping>
      </service-endpoint-interface-mapping>
      </java-wsdl-mapping>

      Here is my web.xml file

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4"
      xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">


      <servlet-name>casTest</servlet-name>
      <servlet-class>com.dusa.ws.cas.casws</servlet-class>


      <servlet-mapping>
      <servlet-name>casTest</servlet-name>
      <url-pattern>/casTest</url-pattern>
      </servlet-mapping>

      <service-ref>
      <service-ref-name>service/CasWsService</service-ref-name>
      <service-interface>com.dusa.ws.cas.client.ICasws</service-interface>
      <wsdl-file>WEB-INF/wsdl/GetCasPerson.wsdl</wsdl-file>
      <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
      </service-ref>


      </web-app>



      Here is my webservices.xml file

      <webservices
      xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
      version="1.1">

      <webservice-description>
      <webservice-description-name>casws</webservice-description-name>
      <wsdl-file>WEB-INF/wsdl/GetCasPerson.wsdl</wsdl-file>
      <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
      <port-component>
      <port-component-name>IGetPerson</port-component-name>
      <wsdl-port>IGetPerson</wsdl-port>
      <service-endpoint-interface>com.dusa.ws.cas.IGetPerson</service-endpoint-interface>
      <service-impl-bean>
      <servlet-link>casTest</servlet-link>
      </service-impl-bean>
      </port-component>
      </webservice-description>



      This was my wscompile command
      C:\jars\jwsdp-1.5\jaxrpc\bin\wscompile -cp WebRoot\WEB-INF\classes -d WebRoot\WEB-INF\classes -nd WebRoot\WEB-INF -s src -gen:server -f:documentliteral -f:wsi -mapping jaxrpc-mapping.xml -keep src\config.xml

      Here is my GetPerson class
      /*
      * Created on May 20, 2005
      *
      * TODO To change the template for this generated file go to
      * Window - Preferences - Java - Code Style - Code Templates
      */
      package com.dusa.ws.cas;

      import java.rmi.RemoteException;
      import java.util.ArrayList;
      import java.util.List;
      import java.util.Vector;
      /**
      * @author michaels
      *
      * TODO To change the template for this generated type comment go to
      * Window - Preferences - Java - Code Style - Code Templates
      */
      public class GetPerson implements IGetPerson {

      /* (non-Javadoc)
      * @see com.dusa.ws.cas.IGetPerson#getPerson(com.dusa.ws.cas.Person)
      */
      public Person getPerson(Person p) throws RemoteException {
      p.setAcceptedDisclaimer(true);
      p.setActive(true);
      p.setAddress1("1 address");
      p.setAddress2("2 address");
      p.setAddress3("3 address");
      p.setCellPhone("555-1212");
      p.setCertifiedTrainerId(1);
      p.setCity("indianapolis");
      p.setClinicId(1);
      p.setCompanyName("companyName");
      p.setCountry("USA");
      p.setEducatorTypeID(1);
      p.setEmail("email");
      p.setFaxPhone("555-1212");
      p.setFirstName("firstName");

      //Vector grps = new Vector();
      List grps = new ArrayList();
      Groups g = new Groups();

      g.setId(1);
      g.setName("group1");
      grps.add(g);
      g = new Groups();
      g.setId(2);
      g.setName("group2");
      grps.add(g);
      p.setGroups((Groups[])grps.toArray());
      p.setHealthCareProviderId(1);
      p.setHomePhone("555-1212");
      p.setHourlyRate("100");
      p.setId("1");
      p.setLastModifiedBy("lastModifiedBy");
      p.setLastName("lastName");
      p.setLocked(true);
      p.setLogin("login");
      p.setMarketingOptIn(true);
      p.setMiddleName("middleName");
      p.setNPI("npi");
      p.setPreviousPumpUser(true);


      //Vector reg = new Vector();
      List reg = new ArrayList();
      Regions r = new Regions();
      r.setId(1);
      r.setName("region1");
      reg.add(r);
      r = new Regions();
      r.setId(2);
      r.setName("region2");
      reg.add(r);
      p.setRegions((Regions[])reg.toArray());
      p.setSecretAnswer("secretAnswer");
      p.setSecretQuestion("secretQuestion");
      p.setSelfRegistered(true);
      p.setState("state");
      p.setTimsId("00001");
      p.setTrainedByHCP(true);
      p.setTrainingChosenId(1);
      p.setTrainingCompletedId(1);
      p.setTrainingMaterialsId(1);
      p.setTrainingStatusId(1);
      p.setUPIN("upin");


      return p;
      }

      public static void main(String[] args) {
      }
      }


      Here is my IGetPerson interface
      /*
      * Created on May 20, 2005
      *
      * TODO To change the template for this generated file go to
      * Window - Preferences - Java - Code Style - Code Templates
      */
      package com.dusa.ws.cas;

      import java.rmi.Remote;
      import java.rmi.RemoteException;

      /**
      * @author michaels
      *
      * TODO To change the template for this generated type comment go to
      * Window - Preferences - Java - Code Style - Code Templates
      */
      public interface IGetPerson extends Remote {
      public Person getPerson(Person p) throws RemoteException;
      }



      I am very new to web services so, if there is ANYTHING else I could do to help please let me know. It sure appears to me that there is a freaking port for IGetPerson .

      thanks to anyone for their help.