Hi All, I'm having a problem retrieving a port from a service I've just
created, namely because there is no port entries in the property myPortsMap
in WSIFService. Below is the code for creating the service:

WSIFServiceFactory factory = WSIFServiceFactory.newInstance();

 WSIFService service =
factory.getService("file:///D:/sandbox/BAIT/docs/BaitEJBWsdlExample.wsdl",
null,
       null, "http://bait.testEJB/";,
       "DemoSession");

 // get the port
 WSIFPort port = service.getPort();

Here's also the WSDL file called, it's very basic, with only one method
demoSelect listed, it has no input parameters, it just returns a string.
I've modelled it on the EJB wsdl example given on the website, when I
debugged the  example ejb.client.dynamic.Run class up until WSIFPort port =
service.getPort(); , there is no problem and a port is present in the
myPortsMap Hashmap with the key EJBPort as in the WSDL file, so I'm assuming
that I have made a mistake somewhere in the WSDL file, but I can't see what
it is.

<?xml version="1.0" ?>

<definitions targetNamespace="http://bait.testEJB/";
             xmlns:tns="http://bait.testEJB/";
             xmlns:xsd="http://www.w3.org/2000/10/XMLSchema";
             xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/";
             xmlns:ejb="http://schemas.xmlsoap.org/wsdl/ejb/";
             xmlns="http://schemas.xmlsoap.org/wsdl/";>


  <!-- message declns -->

  <message name="DemoSelectRequestMessage">
  </message>

  <message name="DemoSelectResponseMessage">
    <part name="result" type="xsd:string"/>
  </message>

  <!-- port type declns -->
  <portType name="DemoSession">
    <operation name="demoSelect">
      <input name="DemoSelectRequest"
message="tns:DemoSelectRequestMessage"/>
      <output name="DemoSelectResponse"
message="tns:DemoSelectResponseMessage"/>
    </operation>
  </portType>

  <!-- binding declns -->
  <binding name="EJBBinding" type="tns:DemoSession">
    <ejb:binding/>

    <format:typeMapping encoding="Java" style="Java">
      <format:typeMap typeName="xsd:string" formatType="java.lang.String" />
    </format:typeMapping>

    <operation name="demoSelect">
      <ejb:operation
         methodName="demoSelect"
         interface="remote"
         returnPart="result"/>
      <input name="DemoSelectRequest"/>
      <output name="DemoSelectResponse"/>
    </operation>
  </binding>

  <!-- service decln -->
  <service name="DemoSessionService">
    <port name="EJBPort" binding="tns:EJBBinding">
      <ejb:address className="bait.DemoSessionHome"
                       jndiName="/bait/DemoSession"

initialContextFactory="org.jnp.interfaces.NamingContextFactory"
                       jndiProviderURL="localhost:1099"/>
    </port>
  </service>

</definitions>

If anyone has any ideas or tips as to why this is not creating a port I
would appreciate hearing them.

Thanks

Damien

Reply via email to