1 2 Previous Next 20 Replies Latest reply on Dec 11, 2008 10:48 PM by oichris

    Webservice wise

      I tried to use the wise SOAPClient to invoke a HTTP Authenticated webservices with SSL. I would like to ask if the username and password there means the same as the username and password in the stub client generated by Axis framework? As I could successfully invoke that webservices using the stub client but I got "Authenticated error" when I use the wise SOAPClient. Any suggestion?

        • 1. Re: Webservice wise
          maeste

          I don't know very well axis, but user and password are supposed to be standard user and password pairs for HTTP basic authentication.

          Could you give me some more infos? Stack trace?

          thanks for the interest

          • 2. Re: Webservice wise

            Thanks for your reply, here is the log that I got but no clues :

            17:09:26,712 INFO [STDOUT] parsing WSDL...
            17:09:27,165 INFO [STDOUT] generating code...
            17:09:27,165 INFO [STDOUT] it\javalinux\wise\DelMsgRequestT.java
            17:09:27,181 INFO [STDOUT] it\javalinux\wise\DelMsgResponseT.java
            17:09:27,181 INFO [STDOUT] it\javalinux\wise\DownloadCntRequestT.java
            17:09:27,400 INFO [STDOUT] it\javalinux\wise\DownloadCntResponseT.java
            17:09:27,400 INFO [STDOUT] it\javalinux\wise\DownloadContentRequestT.java
            17:09:27,416 INFO [STDOUT] it\javalinux\wise\DownloadContentResponseT.java
            17:09:27,416 INFO [STDOUT] it\javalinux\wise\FileEntryType.java
            17:09:27,431 INFO [STDOUT] it\javalinux\wise\ObjectFactory.java
            17:09:27,447 INFO [STDOUT] it\javalinux\wise\TdsClientXchg.java
            17:09:27,463 INFO [STDOUT] it\javalinux\wise\TdsClientXchg_Service.java
            17:09:27,463 INFO [STDOUT] it\javalinux\wise\UploadRequestT.java
            17:09:27,478 INFO [STDOUT] it\javalinux\wise\UploadResponseT.java
            17:09:27,478 INFO [STDOUT] it\javalinux\wise\package-info.java
            17:09:29,214 WARN [ActionProcessingPipeline] Unexpected exception caught while
            processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Addr
            ess jms://127.0.0.1:1099/queue/qInternalGatewayUnconfirmed/>, <wsa:ReferenceProp
            erties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFa
            ctory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 127.0.0.1:
            1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp
            .interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <ws
            a:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProp
            erties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperti
            es jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-m
            ode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>
            , <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] Mess
            ageID: 6324f110-e9e4-412e-84e4-0ee64913450b RelatesTo: jms:correlationID#6324f11
            0-e9e4-412e-84e4-0ee64913450b ]
            java.lang.NullPointerException
            at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.jav
            a:280)
            at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(
            ActionProcessingPipeline.java:316)
            at org.jboss.soa.esb.listeners.message.MessageAwareListener$Transactiona
            lRunner.run(MessageAwareListener.java:530)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
            utor.java:650)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
            .java:675)
            at java.lang.Thread.run(Thread.java:595)
            17:09:29,245 WARN [ActionProcessingPipeline] No fault address defined for fault
            message! To: JMSEpr [ PortReference < <wsa:Address jms://127.0.0.1:1099/queue/q
            InternalGatewayUnconfirmed/>, <wsa:ReferenceProperties jbossesb:java.naming.fact
            ory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferencePropertie
            s jbossesb:java.naming.provider.url : 127.0.0.1:1099/>, <wsa:ReferenceProperties
            jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferencePro
            perties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:s
            pecification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-facto
            ry : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>,
            <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:R
            eferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jboss
            esb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 6324f110-e9e4-412e-84e4-0
            ee64913450b RelatesTo: jms:correlationID#6324f110-e9e4-412e-84e4-0ee64913450b


            From the first part, it seems perfectly downloaded the wsdl and parsed it and generated java classes correspondingly. But I just have no idea what have I missed.

            I also tried simply with the bundled SOAPClient (not-wise one), which returned an even more readable exception that "Authentication Failed".

            • 3. Re: Webservice wise
              maeste

              Please could you post also a snippet of your jboss-esb.xml for the wise related action and the wise-core.properties used?
              thanks

              • 4. Re: Webservice wise

                Right... Sorry about that

                jboss-esb.xml :












                The RequestAction simply put one required parameter into the message.

                HashMap requestMap = new HashMap();
                requestMap.put("parameters", "06600202001B.CETS.HK");
                message.getBody().add(requestMap);

                wise-core.properties

                wise.tmpDir=D:/wise
                wise.forceImportObject=true
                wise.keepGeneratedSources=true
                wise.wsImporter.verbose=true

                • 5. Re: Webservice wise

                  Don't know why the xml could not be displayed. I added extra space between the tag so that it could be shown.

                  "oichris" wrote:
                  Right... Sorry about that

                  jboss-esb.xml :

                  < action name="request-mapper"
                  class="MyRequestAction"
                  process="option1" >
                  < /action >
                  < action name="soapuiclientaction"
                  class="org.jboss.soa.esb.actions.soap.wise.SOAPClient" >
                  < property name="wsdl" value="https://tds2.tradelinksig.com/tds/services/tds_client_xchgSOAP?wsdl"/>
                  < property name="SOAPAction" value="DownloadCnt"/>
                  < property name="EndPointName" value="tds_client_xchgSOAP"/>
                  < property name="responseAsOgnlMap" value="true" />
                  < property name="username" value="xxx"/>
                  < property name="password" value="xxxxxx"/ >
                  < /action >

                  The RequestAction simply put one required parameter into the message.

                  HashMap requestMap = new HashMap();
                  requestMap.put("parameters", "parametervalue");
                  message.getBody().add(requestMap);

                  wise-core.properties

                  wise.tmpDir=D:/wise
                  wise.forceImportObject=true
                  wise.keepGeneratedSources=true
                  wise.wsImporter.verbose=true


                  • 6. Re: Webservice wise

                    By the way, is the class

                    it.javalinux.wise.core.client.builder.impl.reflection.ReflectionBasedWSDynamicClientBuilder
                    missing from the repository?

                    I am missing this class, I get the src from :
                    https://jax-wise.svn.sourceforge.net/svnroot/jax-wise/projects/wise-core/branches/jimma/trunk

                    thanks.

                    • 7. Re: Webservice wise
                      maeste

                       

                      "oichris" wrote:

                      < property name="SOAPAction" value="DownloadCnt"/>


                      The problem should be there. I take a look to your wsdl and SOAPAction value is "downloadCnt" without capital letter.


                      • 8. Re: Webservice wise
                        maeste

                         

                        "oichris" wrote:
                        By the way, is the class

                        it.javalinux.wise.core.client.builder.impl.reflection.ReflectionBasedWSDynamicClientBuilder
                        missing from the repository?

                        I am missing this class, I get the src from :
                        https://jax-wise.svn.sourceforge.net/svnroot/jax-wise/projects/wise-core/branches/jimma/trunk

                        thanks.

                        Not sure to understand why you would need it. Wise is included in JBossWSB in binary format, and BTW it's a version before code donation, sightly different from the one in JBoss.org svn

                        • 9. Re: Webservice wise

                           

                          "maeste" wrote:
                          "oichris" wrote:

                          < property name="SOAPAction" value="DownloadCnt"/>


                          The problem should be there. I take a look to your wsdl and SOAPAction value is "downloadCnt" without capital letter.


                          Sorry about that. Actually I noticed this before but I just forgot to change it back after testing with the SOAPClient (from JBoss). The JBoss SOAPClient interprets the same wsdl differently that they ask for a Capital letter instead. (That's weird) , here will be the new exception, thought it states the authentication failed, I am pretty sure about the username and password as I have been using it in another client application in the same location, is there any method to check the outgoing SOAP message in plain text ? so that I could see actually what's passed to invoke the method :

                          17:14:16,717 INFO [STDOUT] parsing WSDL...
                          17:14:17,154 INFO [STDOUT] generating code...
                          17:14:17,170 INFO [STDOUT] it\javalinux\wise\DelMsgRequestT.java
                          17:14:17,185 INFO [STDOUT] it\javalinux\wise\DelMsgResponseT.java
                          17:14:17,201 INFO [STDOUT] it\javalinux\wise\DownloadCntRequestT.java
                          17:14:17,201 INFO [STDOUT] it\javalinux\wise\DownloadCntResponseT.java
                          17:14:17,217 INFO [STDOUT] it\javalinux\wise\DownloadContentRequestT.java
                          17:14:17,248 INFO [STDOUT] it\javalinux\wise\DownloadContentResponseT.java
                          17:14:17,248 INFO [STDOUT] it\javalinux\wise\FileEntryType.java
                          17:14:17,263 INFO [STDOUT] it\javalinux\wise\ObjectFactory.java
                          17:14:17,279 INFO [STDOUT] it\javalinux\wise\TdsClientXchg.java
                          17:14:17,295 INFO [STDOUT] it\javalinux\wise\TdsClientXchg_Service.java
                          17:14:17,295 INFO [STDOUT] it\javalinux\wise\UploadRequestT.java
                          17:14:17,310 INFO [STDOUT] it\javalinux\wise\UploadResponseT.java
                          17:14:17,326 INFO [STDOUT] it\javalinux\wise\package-info.java
                          17:14:19,310 INFO [STDOUT] error invoking:public abstract it.javalinux.wise.Dow
                          nloadCntResponseT it.javalinux.wise.TdsClientXchg.downloadCnt(it.javalinux.wise.
                          DownloadCntRequestT)
                          17:14:19,310 INFO [STDOUT] error invoking:[Ljava.lang.Object;@1a84bc3
                          17:14:19,310 WARN [ActionProcessingPipeline] Unexpected exception caught while
                          processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Addr
                          ess jms://127.0.0.1:1099/queue/qInternalGatewayUnconfirmed/>, <wsa:ReferenceProp
                          erties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFa
                          ctory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 127.0.0.1:
                          1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp
                          .interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <ws
                          a:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProp
                          erties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperti
                          es jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-m
                          ode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>
                          , <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] Mess
                          ageID: 462929a4-b4aa-440c-a53a-ad93c1586eee RelatesTo: jms:correlationID#462929a
                          4-b4aa-440c-a53a-ad93c1586eee ]
                          org.jboss.soa.esb.actions.ActionProcessingException: Could not call methoddownlo
                          adCnt
                          at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.jav
                          a:282)
                          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(
                          ActionProcessingPipeline.java:316)
                          at org.jboss.soa.esb.listeners.message.MessageAwareListener$Transactiona
                          lRunner.run(MessageAwareListener.java:530)
                          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
                          utor.java:650)
                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
                          .java:675)
                          at java.lang.Thread.run(Thread.java:595)
                          Caused by: it.javalinux.wise.core.exceptions.WiseException: Unknown exception re
                          ceived: null
                          at it.javalinux.wise.core.exceptions.WiseException.rethrow(WiseException
                          .java:44)
                          at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:87)
                          at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:108)
                          at org.jboss.soa.esb.actions.soap.wise.SOAPClient.process(SOAPClient.jav
                          a:280)
                          ... 5 more
                          Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                          java:39)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                          sorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:585)
                          at it.javalinux.wise.core.client.WSMethod.invoke(WSMethod.java:75)
                          ... 7 more
                          Caused by: javax.xml.ws.soap.SOAPFaultException: java.rmi.RemoteException: Authe
                          ntication failed.
                          at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SO
                          APFaultHelperJAXWS.java:69)
                          at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultExceptio
                          n(SOAP11BindingJAXWS.java:109)
                          at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPB
                          inding.java:553)
                          at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:371)
                          at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:243)

                          at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:16
                          4)
                          at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:15
                          0)
                          at $Proxy108.downloadCnt(Unknown Source)
                          ... 12 more

                          • 10. Re: Webservice wise

                             

                            "maeste" wrote:
                            "oichris" wrote:
                            By the way, is the class

                            it.javalinux.wise.core.client.builder.impl.reflection.ReflectionBasedWSDynamicClientBuilder
                            missing from the repository?

                            I am missing this class, I get the src from :
                            https://jax-wise.svn.sourceforge.net/svnroot/jax-wise/projects/wise-core/branches/jimma/trunk

                            thanks.

                            Not sure to understand why you would need it. Wise is included in JBossWSB in binary format, and BTW it's a version before code donation, sightly different from the one in JBoss.org svn


                            I was simply trying to figure out if I have missed out some configuration. And found the source have that class missing.
                            But I could not find the wise package (it.javalinux.wise.core) at all. Is the source code available in any SVN after donation?

                            Thanks for your information.

                            • 11. Re: Webservice wise
                              maeste

                               

                              "oichris" wrote:


                              Caused by: javax.xml.ws.soap.SOAPFaultException: java.rmi.RemoteException: Authe
                              ntication failed.
                              at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SO
                              APFaultHelperJAXWS.java:69)
                              at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultExceptio
                              n(SOAP11BindingJAXWS.java:109)
                              at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPB
                              inding.java:553)
                              at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:371)
                              at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:243)

                              at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:16
                              4)
                              at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:15
                              0)
                              at $Proxy108.downloadCnt(Unknown Source)
                              ... 12 more


                              That is an exception thrown by underlying JAX-WS implementation. Wise support authentication as HTTP basic, in other world the only thing it does is to invoke
                              (BindingProvider)underlyingObjectInstance).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
                              ((BindingProvider)underlyingObjectInstance).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
                              


                              Is your ws provider expecting some different authentication?
                              Anyway you can enable logging of soap request/reposnse setting to tru logging parameter in jboss-esb.xml


                              • 12. Re: Webservice wise
                                maeste

                                 

                                "oichris" wrote:


                                I was simply trying to figure out if I have missed out some configuration. And found the source have that class missing.
                                But I could not find the wise package (it.javalinux.wise.core) at all. Is the source code available in any SVN after donation?

                                Thanks for your information.


                                The code included in esb is from Wise pre-donation. Fot the svn of this version please refer to www.javalinuxlabs.org

                                The donated code is a complete refatoring/redesign of it, doing same things, but more pluggable, and maybe readable. For this one please refer to www.jboss.org/Wise

                                • 13. Re: Webservice wise

                                  Thanks maeste, I activated the logging property and surprisingly, the invoke message is like this :

                                  < env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
                                  < env:Header>
                                  < /env:Header>
                                  < env:Body>
                                  < ns1:DownloadCntRequest xmlns:ns1='urn:xml-tds' xsi:nil='1' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'/>
                                  < /env:Body>
                                  < /env:Envelope>

                                  Is it normal? As I couldn't see the parameter (the web service require one parameter) and the username/password in the SoapMessage.

                                  • 14. Re: Webservice wise
                                    maeste

                                     

                                    "oichris" wrote:
                                    Thanks maeste, I activated the logging property and surprisingly, the invoke message is like this :

                                    < env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
                                    < env:Header>
                                    < /env:Header>
                                    < env:Body>
                                    < ns1:DownloadCntRequest xmlns:ns1='urn:xml-tds' xsi:nil='1' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'/>
                                    < /env:Body>
                                    < /env:Envelope>

                                    Is it normal? As I couldn't see the parameter (the web service require one parameter) and the username/password in the SoapMessage.


                                    For user and password is normal: it's what I tryied to explain in one of my last post. Wise support HTTP basic authorization, not SOAP Header level, but only HTTP Header. You could capture the whole HTTP packet with a sniffer and you will find user/pwd in HTTP Header.
                                    About the content, maybe you have to write a simple smooks mapper to map your parameters to Wrapper object for a literal/bare document like yours. IOW you have to map your parameter to DownloadCntRequestT object that wise generate starting from your wsdl.
                                    For more information take a look to webservice_consumer_wise2 quickstart.



                                    1 2 Previous Next