1 Reply Latest reply on Apr 6, 2009 11:34 AM by Philippe Aubertin

    Jboss WS-security and Jboss ESB

    Philippe Aubertin Newbie

      Hi,
      I have a strange issue.
      I have 1 application which a simple webservice.

      This WebService is registered in my ESB.

      Another application try to communicate with my webService by my ESB.

      I have, for security reasons, enabled WS-Security.

      When I try to invoke my webservice I got this mistake:

      Caused by: java.io.IOException: Could not transmit message
       at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:255)
       at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:73)
       at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:339)
       at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
       ... 106 more
      Caused by: java.lang.ClassCastException: org.jboss.ws.core.soap.SOAPMessageImpl


      But if a try to do same with TCPMON between, it works perfectly!

      here is a part of my jboss-esb.xml
      <service category="CoucheMetier" name="AuthenticatorWS"
       description="Couche Metier">
      
       <listeners>
       <jms-listener name="JMS-Gateway" busidref="quickstartGwChannel"
       is-gateway="true" />
       <jbr-listener name="Http-Gateway" busidref="Http-1"
       is-gateway="true" />
       <jbr-listener name="Socket-Gateway" busidref="Socket-1"
       is-gateway="true" />
      
       <jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel" />
       </listeners>
       <actions>
      
       <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="message"
       value="[Quickstart_webservice_producer] BEFORE invoking jbossws endpoint" />
       </action>
       <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
       <property name="jbossws-endpoint" value="AuthenticatorWS" />
       </action>
       <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="message"
       value="[Quickstart_webservice_producer] AFTER invoking jbossws endpoint" />
       </action>
      
       </actions>
       </service>




      Here is the situation that does not work
      Client -> ESB -> WebService



      Here is the situation that does work
      Client->TCPMON->ESB->WebService


      Does anyone knows why? any helps will be appreciate.

      Here is one SOAP message captured with TCPMON:

      POST / HTTP/1.1
      SOAPAction: ""
      Content-Type: text/xml; charset=UTF-8
      JBoss-Remoting-Version: 22
      User-Agent: JBossRemoting - 2.2.2.SP8
      Cache-Control: no-cache
      Pragma: no-cache
      Host: 127.0.0.1:12345
      Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
      Connection: keep-alive
      Content-Length: 3558
      
      <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
       <env:Header>
       <wsse:Security env:mustUnderstand='1' xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'>
       <wsse:BinarySecurityToken EncodingType='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary' ValueType='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3' wsu:Id='token-99-1239029694976-18426017'>MIICUTCCAbqgAwIBAgIESdXPqTANBgkqhkiG9w0BAQUFADBtMQswCQYDVQQGEwJGUjEPMA0GA1UECBMGZnJhbmNlMQ0wCwYDVQQHEwRseW9uMQ8wDQYDVQQKEwZsb2dpY2ExETAPBgNVBAsTCGF1YmVydGluMRowGAYDVQQDExFQaGlsaXBwZSBhdWJlcnRpbjAeFw0wOTA0MDMwODU4MTdaFw0wOTA3MDIwODU4MTdaMG0xCzAJBgNVBAYTAkZSMQ8wDQYDVQQIEwZmcmFuY2UxDTALBgNVBAcTBGx5b24xDzANBgNVBAoTBmxvZ2ljYTERMA8GA1UECxMIYXViZXJ0aW4xGjAYBgNVBAMTEVBoaWxpcHBlIGF1YmVydGluMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC722NdElI5/KO9rS6GpuErBNfLPggH0l7s0/rwQz25/TIZKKWNROKwOdGkZn5zeEFq41+9q80+WJV5RibIHu7iH1otbN7T0bGia8Kq2ZEXk3HgQnn4aWCgRD5s1VKc0edieBPg19bayQ4ih3645Qiyoi2mqMWKNaQ/+kXLwXZazQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAKafZWydCO0535O+1i05hLvjIFzmDoKULZcvYtEsDMqi0VCAahi+BbZCn900V4toC1/bHQ2xZI4ppss2W09+0Su11qF9wssUdcydCW2tcckVwDTYbmWiF6a//f1cCkrTJQWNuTKomGqaIk8iYbPZl8XxlxtBcibwVsrjoqJahn7L</wsse:BinarySecurityToken>
       <xenc:EncryptedKey xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'>
       <xenc:EncryptionMethod Algorithm='http://www.w3.org/2001/04/xmlenc#rsa-1_5' xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'/>
       <ds:KeyInfo xmlns:ds='http://www.w3.org/2000/09/xmldsig#'>
       <wsse:SecurityTokenReference wsu:Id='reference-100-1239029694976-12215985'>
       <wsse:Reference URI='#token-99-1239029694976-18426017' ValueType='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3'/>
       </wsse:SecurityTokenReference>
       </ds:KeyInfo>
       <xenc:CipherData xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'>
       <xenc:CipherValue xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'>cvXix9UCXP7HndN6NSdwsvPHg5VDBUiH1Ca9hD/oU34E27UXf6fT58ofKjcPfq8WwK6kHrhVznh7Mv4hwXei45iH0GmXBB1rAcuO2XkWvQAQdvKX9zob/iUVmwrUmcuC5cyE0Llj1nsBx0fmkVk/UpNO4Qctz9wzwf2xM3Oag8g=</xenc:CipherValue>
       </xenc:CipherData>
       <xenc:ReferenceList xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'>
       <xenc:DataReference URI='#encrypted-98-1239029694976-23651111' xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'/>
       </xenc:ReferenceList>
       </xenc:EncryptedKey>
       </wsse:Security>
       </env:Header>
       <env:Body xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd' wsu:Id='element-97-1239029694976-6154483'>
       <xenc:EncryptedData Id='encrypted-98-1239029694976-23651111' Type='http://www.w3.org/2001/04/xmlenc#Content' xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'>
       <xenc:EncryptionMethod Algorithm='http://www.w3.org/2001/04/xmlenc#aes128-cbc' xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'/>
       <xenc:CipherData xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'>
       <xenc:CipherValue xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'>QS+0xsLpgKr3i31ypX/dvXKUkuJyfmssLG0NI2OHWi6Mc6uBtv/zVopKrAetKw/gEzP2q0c/n8ugksJjpDjYjfWGZSxAZNZGIJw+6OgDnKKwoul7bEt0nbAJOCcKBZ6Q2qy0bO1v3smYtWmv6IQ5TT6FIEKQin46dZi4WqoGXrEuAsxcovpxufJK6p1W3twz7old8N1dDSXgMuGSoQbnukVkLem+Jn/vKNg8ewrZX2uq1hSYsLpIC+HqvedYQ4RxQ4+XwNps7GZT0nqTdqHHHqdSc5pAU0lHmeKOWzmjS3rF51RyxR1XBrrRA/BR7lBJbkKLkhAgFJwy1mcFXVpmyH/HePG/nrRtuz9FFErj9r+DlX+uAKptV7I0Zw4ZcPoH</xenc:CipherValue>
       </xenc:CipherData>
       </xenc:EncryptedData>
       </env:Body></env:Envelope


        • 1. Re: Jboss WS-security and Jboss ESB
          Philippe Aubertin Newbie

          I find a "solution" but I guess there is bug in the generation of WSDL.

          The problem comes from my WSDL.

          <service name="AuthenticatorService">
           <port binding="tns:AuthenticatorWSBinding" name="AuthenticatorWSPort">
           <soap:address location="http://localhost:8765/"/>
           </port>
           </service>


          If the address location is http://localhost:8765. It doesn't work
          But if we replace localhost by 127.0.0.1 it works!

          <service name="AuthenticatorService">
           <port binding="tns:AuthenticatorWSBinding" name="AuthenticatorWSPort">
           <soap:address location="http://127.0.0.1:8765/"/>
           </port>
           </service>


          In fact, all my programs are working in the same Jboss ESB.

          My problem is that the WSDL is generated by Eclipse or Jboss ESB but not by me!

          Does anyone knows how to solve this issue?