10 Replies Latest reply on Jan 7, 2008 11:02 AM by Zeeshan Javeed

    Document Literal style

    Zeeshan Javeed Newbie

      I am wondering how i can use my own mapping for document literal type.
      I am comparatively new to JbossWs and I would love to know how we can enforce to use Document Literal style in order to generate WSDL file. WSDL file is automatically generated by the system and deployed. Where we can direct wstool to use a particular mapping file ?

      Any guidance ?

      Regards,
      Zeeshan

        • 1. Re: Document Literal style
          Ilya Romanenko Newbie

          Somewhere i've heard that you can use your own wsdl file (insted of generated) - maybe it helps?

          • 2. Re: Document Literal style
            Zeeshan Javeed Newbie

            Hi,
            Thx for your reply. Acutally, my problem is bit more wierd. I have to modify the current webservices developed using old version of Jbossws. Now I have complied the server side with new jbossws 2.0.2 and new wsdl file is generated and deployed. The new client created against this wsdl file using wsconsume works very fine but the old client, created with pervious version are not working.

            After my investigation, I am of the view that problme is due to mapping and document literal style. Earlier code generated a mapping.xml file and now this time no mapping.xml file is generated. So that is the main reason I asked how we can use the Document Literal in a right way.

            Secondly, my wsdl file is always generated and deployed in Jboss , default/data folder. I wanted to deploy it some other location and with different port , for example 8080 instead of 80, so that i can debug the out put using TCP MON. Can Any body, help me how to
            1) use Document Literal ( so that it generates mapping.xml file )
            2) change locatoin and port of wsdl file.

            Thanks & Regards,
            Zeeshan

            • 3. Re: Document Literal style
              Richard Opalka Master

              Hi,

              "zeeshan.javeed" wrote:

              1) use Document Literal ( so that it generates mapping.xml file )
              2) change locatoin and port of wsdl file.


              1) AFAIK mapping.xml file is not generated for JAX-WS based clients
              2) You can use javax.jws.Webservice.wsdlLocation to specify your custom WSDL location

              Richard

              • 4. Re: Document Literal style
                Zeeshan Javeed Newbie

                THx for the prompt reply.

                How we can forec the wsdl fiel to be generated using Doc /Literal.
                Do we only need to put @WebMethod before a method ?

                @WebMethod
                publicSession startSession(Session session)
                {
                log.debug("Start session with version: " + session.getVersion());
                handleInfo("startSession", session);
                return getVersion(session).startSession(session);
                }


                and can you eloborate more where we can write the code for the location of wsdl file and how to specify the port ?

                Thanks,
                Zeeshan

                • 5. Re: Document Literal style
                  Richard Opalka Master

                  Hi,

                  "zeeshan.javeed" wrote:
                  How we can forec the wsdl fiel to be generated using Doc /Lit ?


                  import javax.jws.soap.*;
                  
                  @SOAPBinding(
                   style=SOAPBinding.Style.DOCUMENT,
                   use=SOAPBinding.Use.LITERAL
                  )
                  public interface ServiceIface
                  {
                  ...
                  }
                  


                  Richard

                  • 6. Re: Document Literal style
                    Richard Opalka Master

                    Hi,

                    "zeeshan.javeed" wrote:

                    Where we can write the code for the location of wsdl file and how to specify the port ?


                    import javax.jws.*;
                    import javax.jws.soap.*;
                    
                    @SOAPBinding(
                     style=SOAPBinding.Style.DOCUMENT,
                     use=SOAPBinding.Use.LITERAL
                    )
                    @WebService(wsdlLocation="YOUR_WSDL_LOCATION_URL")
                    public interface ServiceIface
                    {
                    ...
                    }


                    Richard

                    • 7. Re: Document Literal style
                      Alessio Soldano Master

                       

                      "zeeshan.javeed" wrote:
                      Hi,
                      I have to modify the current webservices developed using old version of Jbossws. Now I have complied the server side with new jbossws 2.0.2 and new wsdl file is generated and deployed. The new client created against this wsdl file using wsconsume works very fine but the old client, created with pervious version are not working.

                      This is a quite common issue for users that have been using old JBossWS versions. If you need to expose a wsdl contract that is exactly the same of your previous one, you should try with the top-down approach. See this for further information: http://jbws.dyndns.org/mediawiki/index.php?title=JBossWS_JAX-WS_Tools#Top-Down_.28Using_wsconsume.29
                      This way your service clients should work without changes.

                      After my investigation, I am of the view that problme is due to mapping and document literal style. Earlier code generated a mapping.xml file and now this time no mapping.xml file is generated. So that is the main reason I asked how we can use the Document Literal in a right way.

                      As previously said, the jaxrpc-mapping.xml is not related to the wsdl style you use (Document/literal, rpc/literal, etc.). That mapping file is simply not generated by our jax-ws stack.

                      Secondly, my wsdl file is always generated and deployed in Jboss , default/data folder. I wanted to deploy it some other location and with different port , for example 8080 instead of 80, so that i can debug the out put using TCP MON. Can Any body, help me how to
                      1) use Document Literal ( so that it generates mapping.xml file )
                      2) change locatoin and port of wsdl file.


                      Is your concern about the wsdl address or the endpoint address?
                      Please take a look at the FAQ to understand how the endpoint address relates to the context configuration (i.e. how you can change that address): http://jbws.dyndns.org/mediawiki/index.php?title=FAQ#How_do_I_know_what_endpoint_address_is_being_used.3F
                      The port used for every endpoints depends on the jboss-web configuration of your application server.
                      You might also be interested in reading how you can configure JBossWS to rewrite the endpoint addresses in the wsdl files (once you download the wsdl, you get the endpoint address from it's contents... and that automatically generated address can be rewritten changing the host and port):
                      http://jbws.dyndns.org/mediawiki/index.php?title=FAQ#How_does_rewriting_of_the_soap_address_in_WSDL_work.3F

                      Finally, it seems to me there has been a little misunderstanding with Richard on what you need to do. The wsdlLocation attribute of @WebService should be used to point the stack to the wsdl location during the deployment phase. As a matter of fact jbossws needs to read the wsdl (if you decide to expose your own one instead of letting it generate it for you) and wsdlLocation specifies the relative URL to the wsdl.
                      Please give us some further information to better understand your usecase.

                      • 8. Re: Document Literal style
                        Zeeshan Javeed Newbie

                        Hi,

                        Thanks a lot for valuable information. I was away and will contine to test the client under the guidance provided.

                        Thanks indeed.

                        Zeeshan

                        • 9. Re: Document Literal style
                          Zeeshan Javeed Newbie

                          Hi,

                          I have generated the code using WSCONSUME and after modifying existing code, when I try to run the old client I got Null Pointer Exception. I generated the new client using the newly generated wsdl file and the new client works fine.
                          I debuged more and here is the request send by old client.

                          POST /wipe/service HTTP/1.1
                          
                          Content-Type: text/xml; charset=utf-8
                          
                          Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
                          
                          Content-Length: 655
                          
                          SOAPAction: ""
                          
                          User-Agent: Java/1.5.0_13
                          
                          Host: 127.0.0.1:8080
                          
                          Connection: keep-alive
                          
                          
                          
                          <?xml version="1.0" encoding="UTF-8"?>
                           <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://ips.iplabs.de/types">
                           <env:Body>
                           <ns0:startSession>
                           <TSession_1>
                           <clientLogInfo></clientLogInfo>
                           <clientName>testJavaClient</clientName>
                           <clientVersion>0.5</clientVersion>
                           <errorCode>0</errorCode>
                           <errorMessage></errorMessage>
                           <localeID>de_DE</localeID>
                           <opID>20000100</opID>
                           <sessionID></sessionID>
                           <wipeVersion>1.1</wipeVersion>
                           </TSession_1>
                           </ns0:startSession>
                           </env:Body>
                           </env:Envelope>
                          




                          The request generated by the new client is as

                          POST /wipe/service?datatype=JBossWSMessage HTTP/1.1
                          
                          SOAPAction: ""
                          
                          Content-Type: text/xml; charset=UTF-8
                          
                          User-Agent: Java/1.5.0_13
                          
                          Host: 127.0.0.1:8080
                          
                          Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
                          
                          Connection: keep-alive
                          
                          Content-Length: 475
                          
                          
                          
                          <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
                           <env:Header></env:Header>
                           <env:Body>
                           <ns1:startSession xmlns:ns1="http://ips.iplabs.de/types">
                           <arg0>
                           <clientLogInfo></clientLogInfo>
                           <clientName>testJavaClient</clientName>
                           <clientVersion>0.5</clientVersion>
                           <errorCode>0</errorCode>
                           <errorMessage></errorMessage>
                           <localeID>de_DE</localeID>
                           <opID>10000011</opID>
                           <sessionID></sessionID>
                           <wipeVersion>1.0</wipeVersion>
                           </arg0>
                           </ns1:startSession>
                           </env:Body></env:Envelope
                          
                          




                          Any information , what is going wrong here.

                          The interface file code related to startSession is :

                          
                          /**
                           * This class was generated by the JAX-WS RI.
                           * JAX-WS RI 2.1.1-b03-
                           * Generated source version: 2.0
                           *
                           */
                          @WebService(name = "Wipe", targetNamespace = "http://ips.iplabs.de/")
                          public interface Wipe {
                          
                          
                          /**
                           *
                           * @param tSession1
                           * @return
                           * returns de.iplabs.ips.types.TSession
                           */
                           @WebMethod
                           @WebResult(name = "result", targetNamespace = "")
                           @RequestWrapper(localName = "startSession", targetNamespace = "http://ips.iplabs.de/types", className = "de.iplabs.ips.types.StartSession")
                           @ResponseWrapper(localName = "startSessionResponse", targetNamespace = "http://ips.iplabs.de/types", className = "de.iplabs.ips.types.StartSessionResponse")
                           public TSession startSession(
                           @WebParam(name = "TSession_1", targetNamespace = "")
                           TSession tSession1);
                          }
                          
                          


                          and the respective implementation is as :

                          @WebService(name = "Wipe", targetNamespace = "http://ips.iplabs.de/types")
                          public class WipeImpl implements Wipe
                          {
                          
                          
                           /**
                           *
                           * @param tSession1
                           * @return
                           * returns de.iplabs.ips.types.TSession
                           */
                           @WebMethod
                           public TSession startSession(TSession session)
                           {
                           if(session != null)
                           {
                           log.debug("Start session with version: " +
                           return getVersion(session).startSession(session);
                           }
                           else
                           {
                           log.error("Session is null");
                           return null;
                           }
                           }
                          
                          }
                          
                          



                          Plz guide me, what is going wrong. I have to update server while mainting the compatibility between old client and server.

                          Regards,
                          Zeeshan

                          • 10. Re: Document Literal style
                            Zeeshan Javeed Newbie

                            Another issue:

                            When I try to put
                            @SOAPBinding(
                            style=SOAPBinding.Style.DOCUMENT,
                            use=SOAPBinding.Use.LITERAL
                            )

                            in the implementation class , it colored the whole page with Red lines.
                            The pop error sys:
                            'Unable to create superinterface QWipe; of'

                            this error comes over the above annotation. and every method has an error like : Unable to create method
                            and every attribue declaration has error
                            : Unable to create attribute ?

                            Plz help out.
                            Regards,
                            Zeeshan.