6 Replies Latest reply on Mar 2, 2005 9:08 PM by 437680

    WS-Eventing In JDeveloper 10.1.3

    437680
      Hi Folks..

      I've been looking into trying to get WS-Eventing to work within JDeveloper and the OC4J container. There are two areas that I have come across that are making it difficult and I am hoping that some of you might have some insight into this... (It may very well be that its not possible in the current version of JDeveloper)

      1) There are two schema definitions that WS-Eventing requires to work correctly.. http://schemas.xmlsoap.org/ws/2004/08/eventing
      http://schemas.xmlsoap.org/ws/2004/08/addressing
      Is there anyway to get JDeveloper to generate the appropriate java classes for from these schemas to use when I am creating the web service?? I tried creating a simple WSDL that imported these schemas then used the create Web Service Proxy to generate the service skeletons.. but when it was finished it hadnt generated the complete set of classes that it should have. IE One of the complex types in the Schema is called _Subscribe.. this class was not generated when running the wizard.

      2) I was able to eventually generate the necessary java classes with an axis tool.. WSDL2Java.. and from there to create my implementation. The problem I have from there was creating the web service from the implementation. When trying to create the J2EE 1.4 Web service.. I am able to fill out the first page of the wizard... indicating what implementation file to expose.. but when I click to go to the next page.. the Next button becomes disabled and I remain on the first wirard page. No error message is indicated. Im assuming that the wizard is choking on the WS-Eventing types that are declared in the implementation file, although Im not sure.

      Anyways.. not sure I will get any feedback on this.. as WS-Eventing is fairly new... but I thought I would put it out there.

      Thanks for any help

      Dave
        • 1. Re: WS-Eventing In JDeveloper 10.1.3
          Eric Rajkovic-Oracle
          Hi Dave,

          If you can share the WSDL you have, we may be able to help you figure out why some of the code you were expecting to see was not generated by JDeveloper.

          Also, take a look at WSA - our equivalent to WSDL2Java, which may have more options.

          Eric
          • 2. Re: WS-Eventing In JDeveloper 10.1.3
            437680
            Thanks Eric..

            I will look into the WSA route. Ive included my WSDL below with the hope that someone might see where I've gone wrong. As you can see I am importing the Eventing Schema... http://schemas.xmlsoap.org/ws/2004/08/eventing this schema in turn references the Addressing Schema.. http://schemas.xmlsoap.org/ws/2004/08/addressing.. When I use JDeveloper to create the skeleton classes... it seems to generate all the Addressing classes correctly.. but it only generates one of the types from the Eventing Schema.

            Thanks again for your help..

            Dave

            <?xml version="1.0" encoding="UTF-8" ?>
            <definitions name="Notify" targetNamespace="http://tempuri.org"
            xmlns="http://schemas.xmlsoap.org/wsdl/"
            xmlns:tns="http://tempuri.org"
            xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
            xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
            xmlns:ns7="http://schemas.xmlsoap.org/ws/2004/08/eventing">
            <types>
            <schema xmlns="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://tempuri.org"
            elementFormDefault="qualified" xmlns:tns="http://tempuri.org"
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/">
            <xsd:import namespace="http://schemas.xmlsoap.org/ws/2004/08/eventing"
            schemaLocation="http://schemas.xmlsoap.org/ws/2004/08/eventing"/>
            <complexType name="getMessage">
            <sequence/>
            </complexType>
            <complexType name="getMessageResponse">
            <sequence>
            <element name="result" type="string" nillable="true"/>
            </sequence>
            </complexType>
            <complexType name="setMessage">
            <sequence>
            <element name="String_1" type="string" nillable="true"/>
            </sequence>
            </complexType>
            <complexType name="setMessageResponse">
            <sequence/>
            </complexType>
            <element name="getMessageElement" type="tns:getMessage"/>
            <element name="getMessageResponseElement"
            type="tns:getMessageResponse"/>
            <element name="setMessageElement" type="tns:setMessage"/>
            <element name="setMessageResponseElement"
            type="tns:setMessageResponse"/>
            </schema>
            </types>
            <message name="NotifyServer_getMessage">
            <part name="parameters" element="tns:getMessageElement"/>
            </message>
            <message name="NotifyServer_setMessageResponse">
            <part name="parameters" element="tns:setMessageResponseElement"/>
            </message>
            <message name="NotifyServer_getMessageResponse">
            <part name="parameters" element="tns:getMessageResponseElement"/>
            </message>
            <message name="NotifyServer_setMessage">
            <part name="parameters" element="tns:setMessageElement"/>
            </message>
            <message name="subscribePushMessageResp">
            <part element="ns7:SubscribeResponse" name="parameters"/>
            </message>
            <message name="subscribePushMessage">
            <part element="ns7:Subscribe" name="parameters"/>
            </message>
            <message name="unsubscribePushMessage">
            <part element="ns7:Unsubscribe" name="parameters"/>
            </message>
            <message name="pushMessageResponse"/>
            <message name="pushMessageRequest">
            <part element="tns:in1" name="in0"/>
            </message>
            <portType name="Notify">
            <operation name="getMessage">
            <input message="tns:NotifyServer_getMessage"/>
            <output message="tns:NotifyServer_getMessageResponse"/>
            </operation>
            <operation name="setMessage">
            <input message="tns:NotifyServer_setMessage"/>
            <output message="tns:NotifyServer_setMessageResponse"/>
            </operation>
            </portType>
            <portType name="pushMessagePort">
            <operation name="subscribePushMessage">
            <input message="tns:subscribePushMessage"/>
            <output message="tns:subscribePushMessageResp"/>
            </operation>
            <operation name="unsubscribePushMessage">
            <input message="tns:unsubscribePushMessage"/>
            </operation>
            <operation name="pushMessage" parameterOrder="in0">
            <input message="tns:pushMessageRequest" name="pushMessageRequest"/>
            <output message="tns:pushMessageResponse"
            name="pushMessageResponse"/>
            </operation>
            </portType>
            <binding name="NotifyServerSoapHttp" type="tns:Notify">
            <soap:binding style="document"
            transport="http://schemas.xmlsoap.org/soap/http"/>
            <operation name="getMessage">
            <soap:operation soapAction="http://tempuri.org:getMessage"/>
            <input>
            <soap:body use="literal" parts="parameters"/>
            </input>
            <output>
            <soap:body use="literal" parts="parameters"/>
            </output>
            </operation>
            <operation name="setMessage">
            <soap:operation soapAction="http://tempuri.org:setMessage"/>
            <input>
            <soap:body use="literal" parts="parameters"/>
            </input>
            <output>
            <soap:body use="literal" parts="parameters"/>
            </output>
            </operation>
            </binding>
            <binding name="pushMessageSoapBinding" type="tns:pushMessagePort">
            <binding style="document"
            transport="http://schemas.xmlsoap.org/soap/http"/>
            <operation name="subscribePushMessage">
            <input>
            <body use="literal" parts="parameters"/>
            </input>
            <output>
            <body use="literal" parts="parameters"/>
            </output>
            </operation>
            <operation name="unsubscribePushMessage">
            <input>
            <body use="literal" parts="parameters"/>
            </input>
            </operation>
            <operation name="pushMessage">
            <operation soapAction=""/>
            <input name="pushMessageRequest">
            <body use="literal" parts="parameters"/>
            </input>
            <output name="pushMessageResponse">
            <body use="literal" parts="parameters"/>
            </output>
            </operation>
            </binding>
            <service name="Notify">
            <port name="NotifyServerPort" binding="tns:NotifyServerSoapHttp">
            <soap:address location="http://dburgess-xp:8888/Apps-EventServer-context-root/Notify"/>
            </port>
            <port binding="tns:pushMessageSoapBinding" name="pushMessageIF">
            <soap:address location="http://dburgess-xp:8888/Apps-EventServer-context-root/pushMessageIF"/>
            </port>
            </service>
            </definitions>
            • 3. Re: WS-Eventing In JDeveloper 10.1.3
              Eric Rajkovic-Oracle
              Hi David,

              Using JDeveloper 10.1.3 from OTN and the WSDL you provided, I was able to find the XML construct which give you trouble; it’s the xs:union simpleType, as in

              <xs:simpleType name="ExpirationType">
              <xs:union memberTypes="xs:dateTime tns:NonNegativeDurationType" />
              </xs:simpleType>

              To work around this current limitation, you can use a local version off the schema and use another XML Schema construct, for example:
              <xs:simpleType name="ExpirationType">
              <xs:restriction base="xs:dateTime" />
              </xs:simpleType>

              There are two occurrences of this construct in the WSDL.

              The other problem you have is that there are occurrences of the soap: namespace prefix missing in your WSDL. If you open the WSDL in JDeveloper, you will see the error highlighted in red (like a spell check).

              Last is the definition of your operations. You are mixing two different styles of WSDLs and you may have not finished getting it consistently – It will explain why JDeveloper creates only one portType.

              After making all those modifications to your WSDL, I was able to get code generated for all the artifacts from within JDeveloper. However, it will requires more work to implement the server-side, as you should be using handler to process the WS-* headers. Those headers should be independent from the business logic you are trying to deliver, and you should not tru to use the "map headers to parameters" in the wizard.

              Another way to work this scenario will be a two steps approach:
              a) Build and deploy the Web Service business logic without any Quality of Service. You can do this from the IDE, or using WSA ant tasks.
              b) Add the handler processing for your Quality of Service as a second step, using the advanced features of WSA.

              To get more inside on the error, you can start the IDE with a console window: uses <install_deirectory>\jdev\bin\jdev.exe instead of <install_deirectory>\jdev\bin\jdevw.exe

              Hope this helps,
              Eric
              • 4. Re: WS-Eventing In JDeveloper 10.1.3
                437680
                Hi Eric..

                Thanks for the information concerning the xs:union issue. I was able to make those changes which got me a bit further down the road. More of the complex types were generated... but still not all of them.

                I've been looking further into using WSA commands to build my service. Trying to do a "XML Schema-Driven Web Service Generation" as its called from Web Services Guide. When I use the WSA task genValueType using the eventing schema I get all the complex types generated except for two of them.

                <xs:complexType name="DeliveryType" mixed="true">
                <xs:sequence>
                <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
                </xs:sequence>
                <xs:attribute name="Mode" type="xs:anyURI" use="optional" />
                <xs:anyAttribute namespace="##other" processContents="lax" />
                </xs:complexType>

                The above example is one of them. Im wondering if the reason they weren't generated is because of the mixed="true" content type. Does the WSA tools understand this concept?? The other complex type that was not generated also has this flag set to true. It this is the case... is there a work around for this??

                Another question. When I am using the genValueType command only the class types are created none of the runtime code with the serialization is generated. Im not sure that code is supposed to be generated when using the genValueType or not. If its not... could someone point me in the right direction on the command to use to generate this code??

                Thanks again..

                Dave
                • 5. Re: WS-Eventing In JDeveloper 10.1.3
                  Eric Rajkovic-Oracle
                  Hi David,

                  You are right on your analysis. We have identify problem in the area of mixed content and namespace qualification for the xs:any element.

                  Try to use a simpler complex type, something like:
                  <xs:complexType name="DeliveryType">
                    <xs:sequence>
                      <xs:any/>
                    </xs:sequence>
                  </xs:complexType>

                  This will create a java bean
                  public class DeliveryType implements java.io.Serializable {
                    protected javax.xml.soap.SOAPElement _any;
                  ...

                  If you use the mixed content, it will map the parameter or member directly to javax.xml.soap.SOAPElement, so that the Text nodes can be preserved.

                  Using your schema snipet in a simple WSDL did not return any error, without mixed=true, it produces the following code:
                  public class DeliveryType implements java.io.Serializable {
                    protected oracle.j2ee.ws.common.encoding.literal.AttributeMap anyAttribute;
                    protected java.net.URI mode;
                    protected javax.xml.soap.SOAPElement[] _any;
                  ...

                  Once you use mixed=true, it default back to SOAPElement.

                  Hope this helps,
                  Eric
                  • 6. Re: WS-Eventing In JDeveloper 10.1.3
                    437680
                    Thanks again Eric..

                    Continuing on with the XML Schema-Driven Service generation... my next step would be to create my service implimentation and interface then use the bottom-up method to assemble my web service. I did this and tried to use the create Jave Web Service wizard in JDeveloper to create my new web service. It ends up erroring out with an SEIValidationError when gererating the WSDL and mapping file. (Not much details as to why)

                    So my next step was to use the assemble command from the WSA tool to try the same thing. This errors out as well.. but I get a bit more information back.

                    Sei ws.eventing.EventSource Invalid Method
                    Method subscribePushMessage Invalid return type
                    Return type oracle.j2ee.ws.common.encoding.literal.AttributeMap Not a java bean

                    Looking at the subscribePushMessage function the return type is a Java Bean... that has an oracle.j2ee.ws.common.encoding.literal.AttributeMap as one of the attributes. Everything seems to be correct in the get/set methods within the subscribeResponse java bean. I was wondering could the AttributeMap datatype be the issue??

                    Thanks again for whatever help you can provide.

                    Dave