1 2 Previous Next 15 Replies Latest reply on Oct 10, 2007 12:49 PM by freak hagga

    wsdl based web-service (like a paypal simulator)?

    freak hagga Newbie

      Kind of confused, so I'll explain.

      I'm trying to simulate the paypal soap stack by using the paypal wsdl file.

      I generate the source from the wsdl and can use the @WebServiceClient against the paypal sandbox web service and works great.

      I can't seem to roll my own @WebService of that for a number of reasons.

      Here are my service annotations:

      @Stateless
      @WebService(endpointInterface="ebay.api.paypalapi.PayPalAPIAAInterface", name = "PayPalAPIAA", targetNamespace = "urn:ebay:api:PayPalAPI", wsdlLocation="http://localhost:8080/txs/wsdl/PayPalSvc.wsdl")
      @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
      public class PaypalSoapSimulator implements PayPalAPIAAInterface { ... }
      


      Here is a working (against the true paypal sandbox) paypal client service class (annotations):

      @WebServiceClient(name = "PayPalAPIInterfaceService", targetNamespace = "urn:ebay:api:PayPalAPI", wsdlLocation = "http://localhost:8080/txs/wsdl/PayPalSvc.wsdl")
      public class PayPalAPIInterfaceService extends Service { ... }
      


      Now I deploy an .ear with an embedded and working .war that does have the wsdl + xsd files in the web root (/txs). I have a .jar with ejb3 entity pkgs and my PaypalSoapSimulator class (this might be an issue).

      Note: a copy of the wsdl and xsd files is in the webroot under the /wsdl folder. I have hard-coded the xsd import(s) to use an absolute url but I've also tried using the default local filename.

      When jboss-4.0.5.GA (with jbossws 2.0.1.GA) starts up it hangs:

      2007-10-02 21:52:19,590 DEBUG [org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder] processSOAPBinding on: ebay.api.paypalapi.PayPalAPIAAInterface
      2007-10-02 21:52:19,590 DEBUG [org.jboss.ws.metadata.umdm.EndpointMetaData] setParameterStyle: BARE
      2007-10-02 21:52:19,606 DEBUG [org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory] parse: http://localhost:8080/txs/wsdl/PayPalSvc.wsdl
      2007-10-02 21:58:59,903 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
      2007-10-02 22:06:29,903 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
      

      It hangs forever and ever and nothing deploys .... can't see the wsdl file in the browser either (404).

      Can someone point me to a valid example of creating wsdl-based @WebService, and how to implement the service interface, and the proper annotations (esp. for specific wsdlLocation, even a file based location would be super cool as that seems like black magic b/c noone shows how its done).

      Also a layout of the deploy bundle for this: does my ejb3 .jar require specifics to roll the @WebService or are the annotations enough?

      Should my @WebService be in the .war with something special in the web.xml file for mapping?

      Is this a bug in the sense that jboss hangs forever?



        • 1. Re: wsdl based web-service (like a paypal simulator)?
          Oskar Carlstedt Novice

          Hello!

          Take a look at the samples in the JBossWS distribution. I'm using contract first based web services with jboss that are working fine. Are your xml schemas valid? Do they point to a url that is inaccessible? Such things can cause JBoss to hang until it gets a timeout.


          Best
          /Oskar


          • 2. Re: wsdl based web-service (like a paypal simulator)?
            freak hagga Newbie

            what distro, which example? I can't find it ...

            • 3. Re: wsdl based web-service (like a paypal simulator)?
              freak hagga Newbie

              Ok still confused, the docs just don't help.

              Again from the top with some changes.

              The ejb3 stateless bean as a webservice:

              @WebService(name = "PayPalAPIAAInterface", portName = "PayPalAPIAA", serviceName = "PayPalAPIInterfaceService", targetNamespace = "urn:ebay:api:PayPalAPI", wsdlLocation="META-INF/wsdl/PayPalSvc.wsdl")
              @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
              @WebContext(contextRoot = "/report")
              @Remote
              @Stateless
              public class PaypalSoapSimulator implements PayPalAPIAAInterface { .. }
              


              Here is the PayPalAPIAAInterface:

              @WebService(name = "PayPalAPIAAInterface", targetNamespace = "urn:ebay:api:PayPalAPI")
              @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
              public interface PayPalAPIAAInterface { ... }
              


              And here is a snippet from the wsdl:

              <wsdl:service name="PayPalAPIInterfaceService">
               <wsdl:port name="PayPalAPI" binding="ns:PayPalAPISoapBinding">
               <wsdlsoap:address location="https://api-3t.sandbox.paypal.com/2.0/"/>
               </wsdl:port>
               <wsdl:port name="PayPalAPIAA" binding="ns:PayPalAPIAASoapBinding">
               <wsdlsoap:address location="https://api-aa-3t.sandbox.paypal.com/2.0/"/>
               </wsdl:port>
               </wsdl:service>
              


              Now the PayPalSvc.wsdl imports valid official *.xsd files which are in the same folder and are straight from paypal (validated).

              Jboss-4.0.5.GA no longer hangs, it just blows with a java.lang.OutOfMemoryError.

              I have the heap space turned way up ( -Xmx1024m ) and it still blows?

              Here is the server log, and there are tons of the xmlschema import lines before the crash.

              2007-10-03 19:06:18,335 DEBUG [org.jboss.wsf.stack.jbws.WSDLFilePublisher] XMLSchema import published to: file:/C:/jboss-4.0.5.GA/server/default/data/wsdl/txs.ear/txs.jar/CoreComponentTypes.xsd
              2007-10-03 19:06:18,350 DEBUG [org.jboss.wsf.stack.jbws.WSDLFilePublisher] XMLSchema import published to: file:/C:/jboss-4.0.5.GA/server/default/data/wsdl/txs.ear/txs.jar/eBLBaseComponents.xsd
              2007-10-03 19:06:21,444 DEBUG [org.jboss.wsf.stack.jbws.WSDLFilePublisher] XMLSchema import published to: file:/C:/jboss-4.0.5.GA/server/default/data/wsdl/txs.ear/txs.jar/CoreComponentTypes.xsd
              2007-10-03 19:06:21,460 DEBUG [org.jboss.wsf.stack.jbws.WSDLFilePublisher] XMLSchema import published to: file:/C:/jboss-4.0.5.GA/server/default/data/wsdl/txs.ear/txs.jar/eBLBaseComponents.xsd
              2007-10-03 19:06:21,506 DEBUG [org.jboss.wsf.stack.jbws.WSDLFilePublisher] XMLSchema import published to: file:/C:/jboss-4.0.5.GA/server/default/data/wsdl/txs.ear/txs.jar/CoreComponentTypes.xsd
              2007-10-03 19:06:21,538 DEBUG [org.jboss.wsf.stack.jbws.WSDLFilePublisher] XMLSchema import published to: file:/C:/jboss-4.0.5.GA/server/default/data/wsdl/txs.ear/txs.jar/eBLBaseComponents.xsd
              2007-10-03 19:06:21,585 DEBUG [org.jboss.wsf.stack.jbws.WSDLFilePublisher] XMLSchema import published to: file:/C:/jboss-4.0.5.GA/server/default/data/wsdl/txs.ear/txs.jar/CoreComponentTypes.xsd
              20 07-10-03 19:06:21,600 DEBUG [org.jboss.wsf.stack.jbws.WSDLFilePublisher] XMLSchema import published to: file:/C:/jboss-4.0.5.GA/server/default/data/wsdl/txs.ear/txs.jar/eBLBaseComponents.xsd
              2007-10-03 19:07:17,102 ERROR [STDERR] Exception in thread "main-FastReceiver"
              2007-10-03 19:07:17,102 ERROR [STDERR] java.lang.OutOfMemoryError: Java heap space
              


              Any ideas what is going on?



              • 4. Re: wsdl based web-service (like a paypal simulator)?
                Oskar Carlstedt Novice

                Hi!

                I'm not sure if you are doing this, but I have had som troubles with JBossWS and nested schema imports. I tried to have relative urls between schemas using .. syntax for traversal of parent directory. JBossWS failed when doing this and told me to use something like getParent() instead of .. So now I put all my xsd files in the same folder under META-INF and now everything is working fine.

                Here is an example using the provider interface. This is almost the same as your implementation but you are using the @WebService annotation.

                @Local
                @Stateless
                @WebServiceProvider(
                 serviceName = "ServiceTest",
                 portName = "ServiceTestSoap11Port",
                 targetNamespace = "http://service.mydomain.com/service-test",
                 wsdlLocation = "META-INF/wsdl/service-test.wsdl")
                @ServiceMode(value = Service.Mode.MESSAGE)
                public class ServiceRegistrySEPBean implements Provider<SOAPMessage> {
                 public SOAPMessage invoke(SOAPMessage requestSoapMessage) {
                 ...
                 }
                }
                


                /Oskar

                • 5. Re: wsdl based web-service (like a paypal simulator)?
                  freak hagga Newbie

                  Yep same result, with -Xmx1024m I get a java.lang.OutOfMemory error: Java heap space .

                  Here is what I did (just to confirm):

                  @Local
                  @Stateless
                  @WebServiceProvider(
                   serviceName = "PayPalAPIInterfaceService",
                   portName = "PayPalAPIAA",
                   targetNamespace = "urn:ebay:api:PayPalAPI",
                   wsdlLocation="META-INF/wsdl/PayPalSvc.wsdl")
                  @ServiceMode(value=Service.Mode.MESSAGE)
                  @WebContext(contextRoot = "/report")
                  public class PaypalSoapSimulator implements Provider<SOAPMessage>
                  {
                   public SOAPMessage invoke(SOAPMessage requestSoapMessage)
                   {
                   ...
                   }
                  
                  }
                  


                  Is this a possible memory leak in JbossWS ?

                  Any other ideas? or is 1024m not enuf ...



                  • 6. Re: wsdl based web-service (like a paypal simulator)?
                    freak hagga Newbie

                    It fails exactly like the example before, with hundreds of the repeating XMLSchema import lines in the log, followed by a heap space error.

                    • 8. Re: wsdl based web-service (like a paypal simulator)?
                      Oskar Carlstedt Novice

                      Hi!

                      The WSDL file imports two XML-schemas that create a circular reference. A good point would be to ask them to change their design. The wsdl file at https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl imports two xml-schemas:

                      <import namespace="urn:ebay:apis:CoreComponentTypes" schemaLocation="CoreComponentTypes.xsd"/>
                      <import namespace="urn:ebay:apis:eBLBaseComponents" schemaLocation="eBLBaseComponents.xsd"/>
                      


                      The CoreComponentTypes.xsd contains an import of eBLBaseComponents.xsd
                      <xs:import namespace="urn:ebay:apis:eBLBaseComponents" schemaLocation="eBLBaseComponents.xsd"/>
                      


                      and the eBLBaseComponents.xsd contains an import of CoreComponentTypes.xsd
                      <import namespace="urn:ebay:apis:CoreComponentTypes" schemaLocation="CoreComponentTypes.xsd"/>
                      



                      And all this makes a circular reference between the two schema imports. Maybe one can file this as an extra feature/bug in JBoss. It shall not hang and it could be a good if JBoss was controlling if a schema already has been imported during the scan for schema imports.


                      Hope this helps!
                      Kind regards
                      /Oskar



                      • 9. Re: wsdl based web-service (like a paypal simulator)?
                        Richard Opalka Newbie

                         

                        "rocken7" wrote:
                        If anyone cares to check out the wsdl, here it is:

                        https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl


                        Hi,

                        I used JBossWS 2.0.1 and everything works fine for me. Here's my commandline:

                        ./wsconsume.sh -k -o classes -s sources https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl


                        Which JBossWS version are you using? You can see it e.g. when JBoss boots, there's a line like:

                        10:04:36,786 INFO [NativeServerConfig] JBoss Web Services - Native
                        10:04:36,786 INFO [NativeServerConfig] jbossws-native-2.1.0.DEV (build=200710090749)


                        Richard

                        • 10. Re: wsdl based web-service (like a paypal simulator)?
                          freak hagga Newbie

                          As mentioned above: jboss-4.0.5.GA (with jbossws 2.0.1.GA).

                          Well I have generated the sources from the wsdl with no trouble already and used the same calls as you, but try to roll and deploy a webservice which conforms to the same wsdl: a paypal simulator for example.

                          As I've said above, jboss chews all the jvm heap space and blows upon deploy.

                          It likely has to do with the style of paypal's wsdl and xsd files, but does point out an issue with jbossws (2.0.1.GA).

                          Try it please and let me know if you can find success.

                          • 11. Re: wsdl based web-service (like a paypal simulator)?
                            Oskar Carlstedt Novice

                            Hello!

                            As I said before, this is probably due to the circular schema imports. JBoss will try to load the first schema (CoreComponentTypes.xsd). While scanning this schema JBoss will find the schema import for the 2:nd schema (eBLBaseComponents.xsd). While scanning this 2:nd schema JBoss will find the import of the 1:st schema (CoreComponentTypes.xsd) and so on. This circular schema scan will continue until you get out of memory. I can't find any other reason for this out of memory error.

                            If you don't understand, just follow the xml schema import statements in both schemas and you'll understand what I'm saying.

                            Best regards
                            Oskar

                            • 12. Re: wsdl based web-service (like a paypal simulator)?
                              freak hagga Newbie

                              yep good one oskar, I should've noticed this with my log statements. maybe i'll just merge the two xml-schemas together into 1 xsd file, lots of work tho, and if jbossws was a bit better it wouldn't require this workaround.

                              case closed.

                              • 14. Re: wsdl based web-service (like a paypal simulator)?
                                Richard Opalka Newbie

                                 

                                "rocken7" wrote:
                                yep good one oskar, I should've noticed this with my log statements. maybe i'll just merge the two xml-schemas together into 1 xsd file, lots of work tho, and if jbossws was a bit better it wouldn't require this workaround.

                                case closed.


                                Sorry for that. We've fixed it already. See:

                                http://jira.jboss.org/jira/browse/JBWS-1843

                                This fix will be available in next JBossWS release.

                                Richard

                                1 2 Previous Next