3 Replies Latest reply on Jul 19, 2001 2:07 AM by 3004

    Message-style web service

    3004

      I am trying to implement the message stype web service and
      have followed the documentation. When I run my client, I get
      the error message. I double check my build.xml and wsdl file to
      make sure I had the correct url for the web service. Thanks
      in advance for the help.

      Client Error Message:

      Exception in thread "main" java.io.FileNotFoundException:
      http://localhost:7001/messaging/mdb at sun.net.www.protocol.http.HttpURLConnection.getInputStream
      (HttpURLConnection.java:545)at sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey
      (HttpURLConnection.java:810)
      at weblogic.soap.WebServiceProxy.getSessionCookie
      (WebServiceProxy.java:463)
      at weblogic.soap.WebServiceProxy.receive
      (WebServiceProxy.java:431)
      at weblogic.soap.WebServiceProxy.invoke(WebServiceProxy.java:400)
      at weblogic.soap.SoapMethod.invoke(SoapMethod.java:178)
      at samples.mdb.ProducerClient.main(ProducerClient.java:39)

      The following error message was displayed console:

      ces)] Root cause of ServletException
      org.xml.sax.SAXException: Could not find a codec that understood
      how to decode [weblogicx.xml.stream
      .StartElementEvent: message ()]
      [uri->http://www.w3.org/1999/XMLSchema-instance ln->type
      qn->xsi:type val->bean:LoanApplication]
      [uri-> ln->bean qn->xmlns:bean val->java:samples.loan] using http://schemas.xmlsoap.org/soap
      /encoding/: [ CodecFactory: http://xml.apache.org/xml-soap/literalxml=null, http://schemas.xmlsoap.o
      rg/soap/encoding/=null, =null]
      at weblogic.soap.codec.CodecFactory.decode(CodecFactory.java:49)
      at weblogic.soap.codec.SoapMessage.readOperation
      (SoapMessage.java:209)
      at weblogic.soap.codec.SoapMessage.read
      (SoapMessage.java:127)
      at weblogic.soap.server.servlet.DestinationSendAdapter.doPost
      (DestinationSendAdapter.java:109)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet
      (ServletStubImpl.java:245)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet
      (ServletStubImpl.java:200)
      at weblogic.servlet.internal.WebAppServletContext.invokeServlet
      (WebAppServletContext.java:2279)
      at weblogic.servlet.internal.ServletRequestImpl.execute
      (ServletRequestImpl.java:1923)
      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

      Build.xml file:

      <project name="webservices-message" default="all">
      <taskdef name="wsgen"
      classname="weblogic.ant.taskdefs.ejb.WSGen"/>
      <target name="all" depends="wsgen"/>
      <target name="wsgen">
      <wsgen
      destpath="ConsumerCredit.ear"
      context="/messaging"
      protocol="http"
      host="localhost"
      port="7001">
      <messageservices>
      <messageservice action="send"
      destination="weblogic.examples.jms.sendLoanMsg"
      destinationtype="topic"
      uri="/mdb"
      connectionfactory="examples.soap.msgService.MsgConnectionFactory"
      />
      </messageservices>
      </wsgen>
      </target>
      </project>
        • 1. Re: Message-style web service
          3004

          Hi An,

          You didn't provide your Client code, but I can tell you that the name attribute
          is missing from your <messageservice> element:
          <messageservice action="send"
          destination="weblogic.examples.jms.sendLoanMsg"
          destinationtype="topic"
          uri="/mdb"
          connectionfactory="examples.soap.msgService.MsgConnectionFactory"
          />
          It should be:

          <messageservice
          name="provide-name-here"
          action="send"
          destination="weblogic.examples.jms.sendLoanMsg"
          destinationtype="topic"
          uri="/mdb" connectionfactory="examples.soap.msgService.MsgConnectionFactory"
          >

          See the "Example of an Ant build.xml Build File" section at http://e-docs.bea.com/wls/docs61/webServices/develop.html#1034691

          The value assigned to the name attribute will be used for quite a few purposes
          (i.e. package name for auto-generated Java client code in client.jar, etc.), so
          make sure you put at least one dot (.) in it. The name following the last dot
          will be used as the namespace for the <soap:body> element.

          It this doesn't fix your problem, send a zip of Client source and WSDL.

          Regards,
          Michael Wooten

          "An" <an.bui@brokat.com> wrote:
          >
          I am trying to implement the message stype web service and
          have followed the documentation. When I run my client, I get
          the error message. I double check my build.xml and wsdl file to
          make sure I had the correct url for the web service. Thanks
          in advance for the help.

          Client Error Message:

          Exception in thread "main" java.io.FileNotFoundException:
          http://localhost:7001/messaging/mdb at sun.net.www.protocol.http.HttpURLConnection.getInputStream
          (HttpURLConnection.java:545)at sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey
          (HttpURLConnection.java:810)
          at weblogic.soap.WebServiceProxy.getSessionCookie
          (WebServiceProxy.java:463)
          at weblogic.soap.WebServiceProxy.receive
          (WebServiceProxy.java:431)
          at weblogic.soap.WebServiceProxy.invoke(WebServiceProxy.java:400)
          at weblogic.soap.SoapMethod.invoke(SoapMethod.java:178)
          at samples.mdb.ProducerClient.main(ProducerClient.java:39)

          The following error message was displayed console:

          ces)] Root cause of ServletException
          org.xml.sax.SAXException: Could not find a codec that understood
          how to decode [weblogicx.xml.stream
          .StartElementEvent: message ()]
          [uri->http://www.w3.org/1999/XMLSchema-instance ln->type
          qn->xsi:type val->bean:LoanApplication]
          [uri-> ln->bean qn->xmlns:bean val->java:samples.loan] using http://schemas.xmlsoap.org/soap
          /encoding/: [ CodecFactory: http://xml.apache.org/xml-soap/literalxml=null,
          http://schemas.xmlsoap.o
          rg/soap/encoding/=null, =null]
          at weblogic.soap.codec.CodecFactory.decode(CodecFactory.java:49)
          at weblogic.soap.codec.SoapMessage.readOperation
          (SoapMessage.java:209)
          at weblogic.soap.codec.SoapMessage.read
          (SoapMessage.java:127)
          at weblogic.soap.server.servlet.DestinationSendAdapter.doPost
          (DestinationSendAdapter.java:109)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
          at weblogic.servlet.internal.ServletStubImpl.invokeServlet
          (ServletStubImpl.java:245)
          at weblogic.servlet.internal.ServletStubImpl.invokeServlet
          (ServletStubImpl.java:200)
          at weblogic.servlet.internal.WebAppServletContext.invokeServlet
          (WebAppServletContext.java:2279)
          at weblogic.servlet.internal.ServletRequestImpl.execute
          (ServletRequestImpl.java:1923)
          at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
          at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

          Build.xml file:

          <project name="webservices-message" default="all">
          <taskdef name="wsgen"
          classname="weblogic.ant.taskdefs.ejb.WSGen"/>
          <target name="all" depends="wsgen"/>
          <target name="wsgen">
          <wsgen
          destpath="ConsumerCredit.ear"
          context="/messaging"
          protocol="http"
          host="localhost"
          port="7001">
          <messageservices>
          <messageservice action="send"
          destination="weblogic.examples.jms.sendLoanMsg"
          destinationtype="topic"
          uri="/mdb"
          connectionfactory="examples.soap.msgService.MsgConnectionFactory"
          />
          </messageservices>
          </wsgen>
          </target>
          </project>
          • 2. Re: Message-style web service
            3004

            Hello Michael,

            I regenerated the files and ran my program again, but I'm still
            getting the same error messages. The attached zip file contains
            my client,wsdl, and build.xml files. Could you take a look at
            them and let me know if I am doing something wrong?

            Thank you,
            An

            "Michael Wooten" <mwooten@msn.com> wrote:
            >
            Hi An,

            You didn't provide your Client code, but I can tell you that the name
            attribute
            is missing from your <messageservice> element:
            <messageservice action="send"
            destination="weblogic.examples.jms.sendLoanMsg"
            destinationtype="topic"
            uri="/mdb"
            connectionfactory="examples.soap.msgService.MsgConnectionFactory"
            />
            It should be:

            <messageservice
            name="provide-name-here"
            action="send"
            destination="weblogic.examples.jms.sendLoanMsg"
            destinationtype="topic"
            uri="/mdb" connectionfactory="examples.soap.msgService.MsgConnectionFactory"
            >

            See the "Example of an Ant build.xml Build File" section at http://e-docs.bea.com/wls/docs61/webServices/develop.html#1034691

            The value assigned to the name attribute will be used for quite a few
            purposes
            (i.e. package name for auto-generated Java client code in client.jar,
            etc.), so
            make sure you put at least one dot (.) in it. The name following the
            last dot
            will be used as the namespace for the <soap:body> element.

            It this doesn't fix your problem, send a zip of Client source and WSDL.

            Regards,
            Michael Wooten

            "An" <an.bui@brokat.com> wrote:
            I am trying to implement the message stype web service and
            have followed the documentation. When I run my client, I get
            the error message. I double check my build.xml and wsdl file to
            make sure I had the correct url for the web service. Thanks
            in advance for the help.

            Client Error Message:

            Exception in thread "main" java.io.FileNotFoundException:
            http://localhost:7001/messaging/mdb at sun.net.www.protocol.http.HttpURLConnection.getInputStream
            (HttpURLConnection.java:545)at sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey
            (HttpURLConnection.java:810)
            at weblogic.soap.WebServiceProxy.getSessionCookie
            (WebServiceProxy.java:463)
            at weblogic.soap.WebServiceProxy.receive
            (WebServiceProxy.java:431)
            at weblogic.soap.WebServiceProxy.invoke(WebServiceProxy.java:400)
            at weblogic.soap.SoapMethod.invoke(SoapMethod.java:178)
            at samples.mdb.ProducerClient.main(ProducerClient.java:39)

            The following error message was displayed console:

            ces)] Root cause of ServletException
            org.xml.sax.SAXException: Could not find a codec that understood
            how to decode [weblogicx.xml.stream
            .StartElementEvent: message ()]
            [uri->http://www.w3.org/1999/XMLSchema-instance ln->type
            qn->xsi:type val->bean:LoanApplication]
            [uri-> ln->bean qn->xmlns:bean val->java:samples.loan] using http://schemas.xmlsoap.org/soap
            /encoding/: [ CodecFactory: http://xml.apache.org/xml-soap/literalxml=null,
            http://schemas.xmlsoap.o
            rg/soap/encoding/=null, =null]
            at weblogic.soap.codec.CodecFactory.decode(CodecFactory.java:49)
            at weblogic.soap.codec.SoapMessage.readOperation
            (SoapMessage.java:209)
            at weblogic.soap.codec.SoapMessage.read
            (SoapMessage.java:127)
            at weblogic.soap.server.servlet.DestinationSendAdapter.doPost
            (DestinationSendAdapter.java:109)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet
            (ServletStubImpl.java:245)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet
            (ServletStubImpl.java:200)
            at weblogic.servlet.internal.WebAppServletContext.invokeServlet
            (WebAppServletContext.java:2279)
            at weblogic.servlet.internal.ServletRequestImpl.execute
            (ServletRequestImpl.java:1923)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

            Build.xml file:

            <project name="webservices-message" default="all">
            <taskdef name="wsgen"
            classname="weblogic.ant.taskdefs.ejb.WSGen"/>
            <target name="all" depends="wsgen"/>
            <target name="wsgen">
            <wsgen
            destpath="ConsumerCredit.ear"
            context="/messaging"
            protocol="http"
            host="localhost"
            port="7001">
            <messageservices>
            <messageservice action="send"
            destination="weblogic.examples.jms.sendLoanMsg"
            destinationtype="topic"
            uri="/mdb"
            connectionfactory="examples.soap.msgService.MsgConnectionFactory"
            />
            </messageservices>
            </wsgen>
            </target>
            </project>
            [msg.zip]
            • 3. Re: Message-style web service
              3004

              Hi An,

              Is samples.loan.LoanApplication one of the supported data types listed in the
              HTML table at the following URL?

              http://edocs.bea.com/wls/docs61/webServices/develop.html#1038901


              Does the JMS information in your config.xml look like this?

              <JMSServer Name="Message-style WebLogic Web Services" Targets="examplesServer">
              <JMSTopic JNDIName="weblogic.examples.jms.sendLoanMsg" Name="sendLoanWS.test"/>
              </JMSServer>
              <JMSConnectionFactory
              JNDIName="examples.soap.msgService.MsgConnectionFactory" Name="loanApplication.TopicConnectionFactory"/>

              According to your build.xml, that's what it should look like, with the exception
              of the Name="loanApplication.TopicConnectionFactory". You'll have to name that
              whatever you want. Running ant does not make these entries, you must do it manually.
              Check out the package-summary.html document under the $WL_HOME/samples/examples/webservices/message
              directory, which tells you how to use the Administration Console to create the
              JMS information, if neccessary.

              Hope this helps. If not, you might want to send a zip with the other missing classes
              (i.e. LoanApplication, etc.) so I can try to duplicate the situation.

              Regards,
              Mike Wooten

              "An" <an.bui@brokat.com> wrote:
              >
              >
              >
              Hello Michael,

              I regenerated the files and ran my program again, but I'm still
              getting the same error messages. The attached zip file contains
              my client,wsdl, and build.xml files. Could you take a look at
              them and let me know if I am doing something wrong?

              Thank you,
              An

              "Michael Wooten" <mwooten@msn.com> wrote:
              Hi An,

              You didn't provide your Client code, but I can tell you that the name
              attribute
              is missing from your <messageservice> element:
              <messageservice action="send"
              destination="weblogic.examples.jms.sendLoanMsg"
              destinationtype="topic"
              uri="/mdb"
              connectionfactory="examples.soap.msgService.MsgConnectionFactory"
              />
              It should be:

              <messageservice
              name="provide-name-here"
              action="send"
              destination="weblogic.examples.jms.sendLoanMsg"
              destinationtype="topic"
              uri="/mdb" connectionfactory="examples.soap.msgService.MsgConnectionFactory"
              >

              See the "Example of an Ant build.xml Build File" section at http://e-docs.bea.com/wls/docs61/webServices/develop.html#1034691

              The value assigned to the name attribute will be used for quite a few
              purposes
              (i.e. package name for auto-generated Java client code in client.jar,
              etc.), so
              make sure you put at least one dot (.) in it. The name following the
              last dot
              will be used as the namespace for the <soap:body> element.

              It this doesn't fix your problem, send a zip of Client source and WSDL.

              Regards,
              Michael Wooten

              "An" <an.bui@brokat.com> wrote:
              I am trying to implement the message stype web service and
              have followed the documentation. When I run my client, I get
              the error message. I double check my build.xml and wsdl file to
              make sure I had the correct url for the web service. Thanks
              in advance for the help.

              Client Error Message:

              Exception in thread "main" java.io.FileNotFoundException:
              http://localhost:7001/messaging/mdb at sun.net.www.protocol.http.HttpURLConnection.getInputStream
              (HttpURLConnection.java:545)at sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey
              (HttpURLConnection.java:810)
              at weblogic.soap.WebServiceProxy.getSessionCookie
              (WebServiceProxy.java:463)
              at weblogic.soap.WebServiceProxy.receive
              (WebServiceProxy.java:431)
              at weblogic.soap.WebServiceProxy.invoke(WebServiceProxy.java:400)
              at weblogic.soap.SoapMethod.invoke(SoapMethod.java:178)
              at samples.mdb.ProducerClient.main(ProducerClient.java:39)

              The following error message was displayed console:

              ces)] Root cause of ServletException
              org.xml.sax.SAXException: Could not find a codec that understood
              how to decode [weblogicx.xml.stream
              .StartElementEvent: message ()]
              [uri->http://www.w3.org/1999/XMLSchema-instance ln->type
              qn->xsi:type val->bean:LoanApplication]
              [uri-> ln->bean qn->xmlns:bean val->java:samples.loan] using http://schemas.xmlsoap.org/soap
              /encoding/: [ CodecFactory: http://xml.apache.org/xml-soap/literalxml=null,
              http://schemas.xmlsoap.o
              rg/soap/encoding/=null, =null]
              at weblogic.soap.codec.CodecFactory.decode(CodecFactory.java:49)
              at weblogic.soap.codec.SoapMessage.readOperation
              (SoapMessage.java:209)
              at weblogic.soap.codec.SoapMessage.read
              (SoapMessage.java:127)
              at weblogic.soap.server.servlet.DestinationSendAdapter.doPost
              (DestinationSendAdapter.java:109)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet
              (ServletStubImpl.java:245)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet
              (ServletStubImpl.java:200)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet
              (WebAppServletContext.java:2279)
              at weblogic.servlet.internal.ServletRequestImpl.execute
              (ServletRequestImpl.java:1923)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

              Build.xml file:

              <project name="webservices-message" default="all">
              <taskdef name="wsgen"
              classname="weblogic.ant.taskdefs.ejb.WSGen"/>
              <target name="all" depends="wsgen"/>
              <target name="wsgen">
              <wsgen
              destpath="ConsumerCredit.ear"
              context="/messaging"
              protocol="http"
              host="localhost"
              port="7001">
              <messageservices>
              <messageservice action="send"
              destination="weblogic.examples.jms.sendLoanMsg"
              destinationtype="topic"
              uri="/mdb"
              connectionfactory="examples.soap.msgService.MsgConnectionFactory"
              />
              </messageservices>
              </wsgen>
              </target>
              </project>