none
How to disable validation response from SOAP web service JAVA RRS feed

  • Question

  • Hi all,

    I have use soap web service (JAVA) from .NET client.

    I use SSL connection and use X509 certifiacte to send request. But I have this error when I try to call this web service.

    The error is this:

    Can not Solve KeyInfo for VERIFICATION Signature : KeyInfo ' 
    SecurityKeyIdentifier \ r \ n ( \ r \ n IsReadOnly = False , \ r \ n 
    Count = 1 , r \ \ n clause [ 0 ] = X509IssuerSerialKeyIdentifierClause (
     Issuer = ' CN = testedoca , C = US ' , standard = ' 1342448880 ' ) \ r \
     n ) \ r \ n ' , AVAILABLE token ' SecurityTokenResolver \ r \ n ( \ r \
     n TokenCount = 1 , \ r \ n TokenEntry [ 0 ] = ( AllowedReferenceStyle =
     External, token = System.IdentityModel.Tokens.X509SecurityToken , 
    parameters = 
    System.ServiceModel.Security.Tokens.X509SecurityTokenParameters : \ r \ 
    nInclusionMode : Never \ r \ nReferenceStyle : Internal \ r \ 
    nRequireDerivedKeys : False \ r \ nX509ReferenceStyle : any ) \ r \ n ) \
     r \ n ' .

    I have read that the problem is because, from JAVA and .NET there isn't compatibility.

    How can I disable validation response from .NET?

    best regards

    Monday, July 6, 2015 8:27 AM

Answers

  • You can try to use  

    java.property.com.tibco.plugin.soap.SOAPSendReceiveActi vity.NoOutputValidation=true 
    This all happens in the .TRA file.

    Also another way is:

    Add the following property in the file bwengine.xml: 
    <property> 
    <name>no validate wsdl</name> 
    <option>java.property.com.tibco.plugin.soap.SOAPSend ReceiveActivity.N oOutputValidation</option> 
    <default>true</default> 
    <description>No Output Validation in SOAPSendReceiveActivity</description> 
    </property> 

    Still, disabling the SOAP validation is never a solution.

    what if your server is responding with incorrect format in response? 
    how can you guarantee that you are recieving a valid soap response message? 
      
    if you are using rpc encoded style of wsdl's then there could be a problem as this is not a supported style. 
      
    else i am sure you are missing some xsd's where the definition for the elements referenced in your response message can be found.

    I hope this info helps you 

    Tuesday, July 7, 2015 2:29 PM
    Moderator

All replies

  • Hi Michele Castriotta,
    According this issue,as far as I know,May be the root cause of this problem is the web service certificate format does not match with .net Client.If you want disable validation response from .NET.Please check if you have implement client or service message validation, you can try remove the validation schemas in your code or in config. Read a document below on how the client- and/or server-side schema-based validation are implemented in webservice.
    #Message Inspectors
    http://msdn.microsoft.com/en-us/library/aa717047.aspx

    I hope that wil be helpful to you.


    Best Regards,

    Tracy Dj



    Tuesday, July 7, 2015 7:11 AM
    Moderator
  • Hi Tracy, thanks you for your reply. I have see your linlk, but I'm not able to apply the change at my code.

    So I have this code:

    string pathCertificato = @"C:\Users\michele.castriotta\Desktop\Certificati\keystore_healthnetbr.pfx";
                    X509Certificate2 certificatoLocale = new X509Certificate2(File.ReadAllBytes(pathCertificato), "changeit");
                    
                  //  AsymmetricAlgorithm chiavePrivta = certificatoLocale.PrivateKey;
                  //  PublicKey chiavePubblica = certificatoLocale.PublicKey;
                    
    
    
                    PianoAssistenzialeResidenzialeClient ws_Client = new PianoAssistenzialeResidenzialeClient("PianoAssistenzialeResidenzialePort", "https://edottotest.sanita.regione.rsr.rupar.puglia.it/nsisr/PianoAssistenzialeResidenzialeService");
                    ws_Client.ClientCredentials.ClientCertificate.Certificate=certificatoLocale;
                    ws_Client.ClientCredentials.ServiceCertificate.DefaultCertificate = certificatoLocale;
    
                    EndpointIdentity identity = EndpointIdentity.CreateDnsIdentity("HEALTHNETBR");
                    EndpointAddress address = new EndpointAddress(new Uri("https://edottotest.sanita.regione.rsr.rupar.puglia.it/nsisr/PianoAssistenzialeResidenzialeService"), identity);
                    ws_Client.Endpoint.Address = address;
    
                    ws_Client.ClientCredentials.UserName.UserName = "HEALT";
                    ws_Client.ClientCredentials.UserName.Password = "changeit";
    
                    PianoAssistenzialeResidenzialeService.attributiAutorizzativi attributi = new PianoAssistenzialeResidenzialeService.attributiAutorizzativi();
                    attributi.identificativoServizio="getElencoPAIDomiciliare";
                    attributi.identificativoUtente="HEALTHNE";
                    attributi.ruoloIstituzionale="RIS000";
    
                    PianoAssistenzialeResidenzialeService.getElencoPAIDomiciliare request = new PianoAssistenzialeResidenzialeService.getElencoPAIDomiciliare();
    
                    elencoPAIDomiciliareRequest criteriRicerca = new elencoPAIDomiciliareRequest();
                    criteriRicerca.codiceNazionale = "160";
                    criteriRicerca.distretto = "5";
                    criteriRicerca.tipologiaAssistenzaAutorizzata = 1;
                    criteriRicerca.dataInizioRiferimento = "01/12/2000";
                    criteriRicerca.dataFineRiferimento = "01/07/2015";
    
                    request.criteriRicerca = criteriRicerca;
                    
                    
                    getElencoPAIDomiciliareResponse response = ws_Client.getElencoPAIDomiciliare(attributi, request);

    The method "

    getElencoPAIDomiciliare

    generate the exception.

    Now How can I apply the procedure to disable this ceck?

    Tuesday, July 7, 2015 8:06 AM
  • I have apply these change.

    I have create this class

    • SchemaValidationBehavior
    • SchemaValidationBehaviorExtensionElement
    • SchemaValidationMessageInspector

    And I have change my app.config like this:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    
        <startup>
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
        </startup>
    
        <system.serviceModel>
          
          <extensions>
            <behaviorExtensions>
              <add name="schemaValidator" type="Microsoft.ServiceModel.Samples.SchemaValidationBehaviorExtensionElement, MessageInspectors, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
            </behaviorExtensions>
          </extensions>
          
            <bindings>
                <customBinding>
                    <binding name="MyNewService">
                      <security defaultAlgorithmSuite="Basic128" authenticationMode="MutualCertificate" requireDerivedKeys="false" securityHeaderLayout="Lax" includeTimestamp="true" messageProtectionOrder="SignBeforeEncrypt" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" requireSignatureConfirmation="false">
                        <localClientSettings detectReplays="true"/>
                        <localServiceSettings detectReplays="true"/>
                        
                      </security>
                        <textMessageEncoding messageVersion="Soap11WSAddressing10"/>
                        
                        <httpsTransport/>
                    </binding>
                </customBinding>
            </bindings>
            <client>
              <endpoint address="https://edottotest.sanita.regione.rsr.rupar.puglia.it/nsisr/PianoAssistenzialeResidenzialeService" binding="customBinding" bindingConfiguration="MyNewService" contract="PianoAssistenzialeResidenzialeService.PianoAssistenzialeResidenziale" name="PianoAssistenzialeResidenzialePort" >
                <identity>
                  <dns value="HEALTHNETBR"/>
                              
                </identity>
              </endpoint>
            </client>
        
        <behaviors>
         
         
         
        </behaviors>
        </system.serviceModel>
    </configuration>

    But if I try to run the application, I have the same error message


    Tuesday, July 7, 2015 8:49 AM
  • You can try to use  

    java.property.com.tibco.plugin.soap.SOAPSendReceiveActi vity.NoOutputValidation=true 
    This all happens in the .TRA file.

    Also another way is:

    Add the following property in the file bwengine.xml: 
    <property> 
    <name>no validate wsdl</name> 
    <option>java.property.com.tibco.plugin.soap.SOAPSend ReceiveActivity.N oOutputValidation</option> 
    <default>true</default> 
    <description>No Output Validation in SOAPSendReceiveActivity</description> 
    </property> 

    Still, disabling the SOAP validation is never a solution.

    what if your server is responding with incorrect format in response? 
    how can you guarantee that you are recieving a valid soap response message? 
      
    if you are using rpc encoded style of wsdl's then there could be a problem as this is not a supported style. 
      
    else i am sure you are missing some xsd's where the definition for the elements referenced in your response message can be found.

    I hope this info helps you 

    Tuesday, July 7, 2015 2:29 PM
    Moderator