AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Fehlermeldung beim Zugriff auf C#-WCFService mit D2006
Thema durchsuchen
Ansicht
Themen-Optionen

Fehlermeldung beim Zugriff auf C#-WCFService mit D2006

Ein Thema von Zottel · begonnen am 8. Nov 2008 · letzter Beitrag vom 10. Nov 2008
 
Zottel
(Gast)

n/a Beiträge
 
#4

Re: Mit W32 Delphi auf C# WCF zugreifen? Erfahrungen?

  Alt 9. Nov 2008, 11:47
So. Nun habe ich das ganze Projekt nochmal aufgesetzt und diesmal so, das ich vernünftige Fehlermeldungen bekomme.

Der C# WCF-Service hat einen Server und einen Client, die einwandfrei zusammenarbeiten. Den Protokollverkehr habe ich rausgesucht:

Delphi-Quellcode:
POST /WCFMaster/ HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/IJNDemoService/echoString"
Host: 192.168.100.110:1973
Content-Length: 172
Expect: 100-continue

HTTP/1.1 100 Continue

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
 <s:Body>
  <echoString xmlns="http://tempuri.org/">
   <Value>TestString</Value>
  </echoString>
 </s:Body>
</s:Envelope>

HTTP/1.1 200 OK
Content-Length: 210
Content-Type: text/xml; charset=utf-8
Server: Microsoft-HTTPAPI/1.0
Date: Sun, 09 Nov 2008 10:44:23 GMT

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
 <s:Body>
  <echoStringResponse xmlns="http://tempuri.org/">
   <echoStringResult>TestString</echoStringResult>
  </echoStringResponse>
 </s:Body>
</s:Envelope>
Dieser Ausschnitt beinhaltet die Clientanfrage und die Serverantwort.

Wenn ich nun einen Delphi-Client mit D2006 aufsetze und mit eine Unit, zum zugreifen auf den WCF-Service, mit dem WSDL-Import erzeugen lasse,
Dann scheint er zumindest bei mit dem WCF-Service anzufrage. Aber der versteht nur bahnhof und gibt entsprechende Fehlermeldung raus:
Zitat:
---------------------------
Benachrichtigung über Debugger-Exception
---------------------------
Im Projekt WCFSniffer.exe ist eine Exception der Klasse ERemotableException mit der Meldung 'Error in deserializing body of request message for operation 'echoString'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'echoString' and namespace 'http://tempuri.org/'. Found node type 'Element' with name 'parameters' and namespace ''' aufgetreten.
---------------------------
Anhalten Fortsetzen Hilfe
---------------------------
Den Transportverkehr habe ich auch rausgesucht:
Delphi-Quellcode:
POST /WCFMaster/ HTTP/1.1
SOAPAction: "http://tempuri.org/IJNDemoService/echoString"
Content-Type: text/xml
User-Agent: Borland SOAP 1.2
Host: 192.168.100.110:1973
Content-Length: 379
Connection: Keep-Alive
Cache-Control: no-cache

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
  <SOAP-ENV:Body>
    <parameters xsi:type="xsd:string">test</parameters>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

HTTP/1.1 500 Internal Server Error
Content-Length: 2371
Content-Type: text/xml; charset=utf-8
Server: Microsoft-HTTPAPI/1.0
Date: Sun, 09 Nov 2008 11:24:44 GMT

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
 <s:Body>
  <s:Fault>
   <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>
   <faultstring xml:lang="de-DE">Error in deserializing body of request message for operation 'echoString'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Elementwith name 'echoStringand namespace 'http://tempuri.org/'. Found node type 'Elementwith name 'parametersand namespace ''</faultstring>
   <detail>
    <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
     <HelpLink i:nil="true"/>
     <InnerException>
      <HelpLink i:nil="true"/>
      <InnerException i:nil="true"/>
      <Message>OperationFormatter encountered an invalid Message body. Expected to find node type 'Elementwith name 'echoStringand namespace 'http://tempuri.org/'. Found node type 'Elementwith name 'parametersand namespace ''</Message>
      <StackTrace> at System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(XmlDictionaryReader reader, Object[] parameters)&#xD;
         at System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(Message message, Object[] parameters)</StackTrace>
      <Type>System.Runtime.Serialization.SerializationException</Type>
     </InnerException>
     <Message>Error in deserializing body of request message for operation 'echoString'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Elementwith name 'echoStringand namespace 'http://tempuri.org/'. Found node type 'Elementwith name 'parametersand namespace ''</Message>
     <StackTrace> at System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(Message message, Object[] parameters)&#xD;
        at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc)&#xD;
        at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)&#xD;
        at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)&#xD;
        at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
     <Type>System.ServiceModel.CommunicationException</Type>
   </ExceptionDetail>
  </detail>
  </s:Fault>
 </s:Body>
</s:Envelope>
Scheint so, als verstünde C# die Delphi-Anforderung nicht. Oder habe ich etwas verkehrt gemacht?
Angeblich soll WCF ja einen normalen SOAP-Dienst darstellen können.

Eine andere Alternative wäre auch noch, das ich das ganze per Hand Parse und die anfragen und Antworten selbst auseinanderpflücke. Aber das möchte ich mir gerne ersparen.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:19 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz