Skip to main content
Inspiring
March 17, 2016
Question

consuming Webservice CF11

  • March 17, 2016
  • 1 reply
  • 2014 views

I try to consume a webservice which lives on an iis-machine.

I get this error message:

-----------------------------------------------------------------------------------------------------------------------------------------------------error

Cannot perform web service invocation suche.

The fault returned when invoking the web service operation is:

org.apache.axis2.AxisFault: Fehler beim Überprüfen der Sicherheit für die Nachricht.

    at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)

    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)

    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)

    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)

    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

    at org.tempuri.BestandsabfrageServiceStub.suche(BestandsabfrageServiceStub.java:203)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

   at java.lang.reflect.Method.invoke(Method.java:483)

    at coldfusion.xml.rpc.Axis2ServiceProxy.getResult(Axis2ServiceProxy.java:111)

    at coldfusion.xml.r... ''

This is the code

--------------------------------------------------------------------------------------------------------------------------------------------------------------------code

<cfscript>

    wsdl="http://cmstest.gloggsche.de/Services/BestandsabfrageService.svc?wsdl";

    username="firstname.lastname@domain.de";

    password="passPhrase..";

    refresh=false;

</cfscript>

<cfobject name = "ws" wsversion="2"

webservice= "#wsdl#"

username = "#username#"

password = "#password#"

refreshWSDL = "#refresh#"

type = "webservice">

// this is das skeleton das den remote webservice representiert

// writedump(ws);

<cfscript>

// nun stellen wir das argument für den Aufruf bereit

// ich habe extra dies genau gleich gemacht wie ihr aufruf mit soapUI, sprich auch leere werte für optionale parameter

anfrage={};

anfrage.BeckId="";

anfrage.Entscheidungstyp="";

anfrage.NormalisiertesOriginalAktenzeichen="";

anfrage.DatumVon=createDate(2010,8,30);

anfrage.DatumBis=createDate(2010,8,30);

anfrage.GerichtSchluesselOderNummer="cr143837";

anfrage.Sprache="DE";

anfrage.VolltextVorhanden=true;

// nun suchen wir

writedump(ws.suche(anfrage));

//writeDump(ws.Suche(anfrage));

</cfscript>

------------------------------------------------------------------------------------------------------------------------------------------------------soapUI

with soapUI i can consume the webservice with success,

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "POST /Services/BestandsabfrageService.svc HTTP/1.1[\r][\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "Accept-Encoding: gzip,deflate[\r][\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "Content-Type: text/xml;charset=UTF-8[\r][\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "SOAPAction: "http://tempuri.org/IBestandsabfrageService/Suche"[\r][\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "Content-Length: 1788[\r][\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "Host: cmstest.gluggsche.de[\r][\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "Connection: Keep-Alive[\r][\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "[\r][\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "<soapenv:Envelope xmlns:glugg="http://schemas.datacontract.org/2004/07/Glugg.CMS.Definitions.Bestandsabfrage" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "   <soapenv:Header><wsse:Security 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:UsernameToken wsu:Id="UsernameToken-62F33C3C441C4F5CF814581640048155"><wsse:Username>firstname.lastname@glugg-domain.de</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">passphrase</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">s/oi9bCZrBYWb8QU7YtPvA==</wsse:Nonce><wsu:Created>2016-03-16T21:33:24.815Z</wsu:Created></wsse:UsernameToken></wsse:Security></soapenv:Header>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "   <soapenv:Body>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "      <tem:Suche>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "         <!--Optional:-->[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "         <tem:anfrage>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <!--Optional:-->[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <glugg:GluggId/>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <!--Optional:-->[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <glugg:DatumBis>2016-02-01</glugg:DatumBis>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <!--Optional:-->[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <glugg:DatumVon>2016-01-29</glugg:DatumVon>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <!--Optional:-->[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <glugg:Entscheidungstyp/>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <!--Optional:-->[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <glugg:GerichtSchluesselOderNummer>BGH</glugg:GerichtSchluesselOderNummer>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <!--Optional:-->[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <glugg:NormalisiertesOriginalAktenzeichen/>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <!--Optional:-->[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <glugg:Sprache>de</glugg:Sprache>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <!--Optional:-->[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "            <glugg:VolltextVorhanden>true</glugg:VolltextVorhanden>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "         </tem:anfrage>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "      </tem:Suche>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "   </soapenv:Body>[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "</soapenv:Envelope>"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "HTTP/1.1 200 OK[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "Cache-Control: private[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "Transfer-Encoding: chunked[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "Content-Type: text/xml; charset=utf-8[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "Server: Microsoft-IIS/7.0[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "Set-Cookie: CMSID=2blyrs2xk2xlrykmzwdupb1u; path=/; HttpOnly[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "X-AspNet-Version: 4.0.30319[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "X-Powered-By: ASP.NET[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "Date: Wed, 16 Mar 2016 21:33:27 GMT[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "557[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><s:Header><o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><u:Timestamp u:Id="_0"><u:Created>2016-03-16T21:33:27.202Z</u:Created><u:Expires>2016-03-16T21:38:27.202Z</u:Expires></u:Timestamp></o:Security></s:Header><s:Body><SucheResponse xmlns="http://tempuri.org/"><SucheResult xmlns:a="http://schemas.datacontract.org/2004/07/Glugg.CMS.Definitions.Bestandsabfrage" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><a:AnzahlErgebnisse>1</a:AnzahlErgebnisse><a:ErgebnisListe><a:Entscheidung><a:GluggId>EN2016004104</a:GluggId><a:Entscheidungsdatum>2016-01-29T00:00:00+01:00</a:Entscheidungsdatum><a:Entscheidungstyp>U</a:Entscheidungstyp><a:GerichtGluggId>cr143837</a:GerichtGluggId><a:GerichtSchluessel>BGH</a:GerichtSchluessel><a:IstMasterGesperrt>false</a:IstMasterGesperrt><a:NormalisiertesOriginalAktenzeichen>VZR28514</a:NormalisiertesOriginalAktenzeichen><a:Sprachen xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><b:string>de</b:string></a:Sprachen><a:VolltextVorhanden>true</a:VolltextVorhanden></a:Entscheidung></a:ErgebnisListe><a:Message i:nil="true"/></SucheResult></SucheResponse></s:Body></s:Envelope>"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "0[\r][\n]"

Wed Mar 16 22:33:25 CET 2016:DEBUG:<< "[\r][\n]"

So what do I the wrong way?

The cerificate was imported zu cacerts.

I tried it  with registering the webservice in the administrator as well.(same result as with cfobject)

What is wrong with my <cfobject>

Sorry for the long text,

best regards

Alec

This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
March 19, 2016

The error message says, Fehler beim Überprüfen der Sicherheit für die Nachricht [Failed to verify the security of the message]. This implies you should check and make sure you supply the correct username and password.

MalvinaAuthor
Inspiring
March 20, 2016

checked the username/pw again.

It is the same as in the successful call with soapUI (see lines below). When i see it,  i ask me wether Coldfusion can produce these tokens..

----------------------------snippet of successful call ------------------------

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "<soapenv:Envelope xmlns:glugg="http://schemas.datacontract.org/2004/07/Glugg.CMS.Definitions.Bestandsabfrage" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">[\n]"

Wed Mar 16 22:33:24 CET 2016:DEBUG:>> "   <soapenv:Header><wsse:Security 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:UsernameToken wsu:Id="UsernameToken-62F33C3C441C4F5CF814581640048155"><wsse:Username>firstname.lastname@glugg-domain.de</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#Passwor dText">passphrase</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Bi nary">s/oi9bCZrBYWb8QU7YtPvA==</wsse:Nonce><wsu:Created>2016-03-16T21:33:24.815Z</wsu:Created> </wsse:UsernameToken></wsse:Security></soapenv:Header>[\n]"

----------------------------/snippet

BKBK
Community Expert
Community Expert
March 20, 2016

Just to get one further issue out of the way, your code implies that the domain is gloggsche.de, whereas the SOAPUI example uses gluggsche.de.