# IndyHTTP-Post get only WDSL in WebBrowser

**URL:** https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553
**Category:** Remoting SDK
**Created:** [July 15, 2015, 9:43am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553 "2015-07-15T09:43:34Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Porsche\_Informatik\_G](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Porsche\_Informatik\_G](https://talk.remobjects.com/u/Porsche_Informatik_G)
#### Post date: [July 15, 2015, 9:43am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/1 "2015-07-15T09:43:34Z")

</div>

Hi, after yesterdays improvement most topic are clear for me.

We habe an AppServer for internal interfaces using TCP, which is working well now. Furthermore the same AppServer is using another WebService (using ROIndyHTTPServer). In the interface is a “Monitor”-function, which gets a HTML-page. Unfortunatly this interface is not usable in my WebBrowser (e.g. Firefox);instead the WSDL is shown instead (I’ve unchecked the “ServeRodl” already).

Any ideas?  
Thanks,  
Peter

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 16, 2015, 5:54am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/2 "2015-07-16T05:54:10Z")

</div>

what message you are using? TROSOAPMessage?  
how are you trying to call monitor function?

---

<div class="post-metadata">

### Author: ![Porsche\_Informatik\_G](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Porsche\_Informatik\_G](https://talk.remobjects.com/u/Porsche_Informatik_G)
#### Post date: [July 17, 2015, 5:19am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/3 "2015-07-17T05:19:31Z")

</div>

I’ve used in old version ROPostMessage, and I did not change it.  
I call the Monitor-function in my Browser.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 17, 2015, 6:18am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/4 "2015-07-17T06:18:32Z")

</div>

can you check that another WebService (using ROIndyHTTPServer) has TROPostMessage as dispatcher? if WSDL is shown it indicates that SOAP message is used…

---

<div class="post-metadata">

### Author: ![Porsche\_Informatik\_G](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Porsche\_Informatik\_G](https://talk.remobjects.com/u/Porsche_Informatik_G)
#### Post date: [July 17, 2015, 7:16am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/5 "2015-07-17T07:16:23Z")

</div>

I’ve created the ROIndyHTTPServer again and set the Dispatcher to ROPostMessage. In the project there is no TROSOAPMessage.

If I set ROIndyHTTPServer:ServeRodl, I get the WSDL; if I unset it, I get a “Invalid Path” in the Browser.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 17, 2015, 8:01am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/6 "2015-07-17T08:01:04Z")

</div>

I can’t reproduce problem with TROPostMessage in MegaDemo sample.

steps:

- update server-side as:

```auto
TMegaDemoServerMainForm.ROPostMessage.MultiLine := false

```

- test TROPostMessage with this file: [test.htm](https://talk.remobjects.com/uploads/default/original/2X/7/7dadbbccabe563235589bdb72a9b9790c84434c1.txt) (1.6 KB)

---

<div class="post-metadata">

### Author: ![Porsche\_Informatik\_G](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Porsche\_Informatik\_G](https://talk.remobjects.com/u/Porsche_Informatik_G)
#### Post date: [July 17, 2015, 8:23am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/7 "2015-07-17T08:23:13Z")

</div>

I’ve tried the MegaDemo, and it’s the same --\>  
when I open the Browser (Firefox) without function, I get the WDSL. If I try a function (e.g. GetServerTime), I get “Invalid Path” like in my project

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 17, 2015, 8:28am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/8 "2015-07-17T08:28:54Z")

</div>

have you tried to use my .htm?  
it sends

```auto
__MessageType=Message&__ InterfaceName=MegaDemoService& __MessageName=GetServerTime&__ ClientID=B51199FE-9E86-4AA1-8CB1-54B4E05AB130&Submit=Submit

```

to [http://localhost:8099/post](http://localhost:8099/post) and recieves response like

```auto
__MessageType=Message&__ InterfaceName=MegaDemoService& __MessageName=GetServerTimeResponse&__ ClientID=B51199FE-9E86-4AA1-8CB1-54B4E05AB130&"Result=2015-07-17
 10:53:48"

```

---

<div class="post-metadata">

### Author: ![Porsche\_Informatik\_G](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Porsche\_Informatik\_G](https://talk.remobjects.com/u/Porsche_Informatik_G)
#### Post date: [July 17, 2015, 8:36am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/9 "2015-07-17T08:36:37Z")

</div>

I don’t know, what I should try …

How to use the .htm-file?  
In the sample or my project?

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 17, 2015, 8:39am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/10 "2015-07-17T08:39:19Z")

</div>

from your post:

> [@Porsche\_Informatik\_G](#):
>
> Unfortunatly this interface is not usable in my WebBrowser (e.g. Firefox)

you wanted to receive results in browser so launch MegaDemo sample and open attached .htm in Firefox

---

<div class="post-metadata">

### Author: ![Porsche\_Informatik\_G](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Porsche\_Informatik\_G](https://talk.remobjects.com/u/Porsche_Informatik_G)
#### Post date: [July 17, 2015, 8:47am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/11 "2015-07-17T08:47:13Z")

</div>

I get an excpetion --\>

\_\_MessageType=Exception \_\_ExceptionClass=EROException \_\_ExceptionMessage=Unknown message type “Message&\_\_InterfaceName=MegaDemoService&\_\_MessageName=GetServerTime&\_\_ClientID=B51199FE-9E86-4AA1-8CB1-54B4E05AB130&Submit=Submit” \_\_Exception=EROException

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 17, 2015, 8:48am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/12 "2015-07-17T08:48:42Z")

</div>

have you updated server-side?

> [@EvgenyK](#):
>
> - update server-side as:
> 
> TMegaDemoServerMainForm.ROPostMessage.MultiLine := false

---

<div class="post-metadata">

### Author: ![Porsche\_Informatik\_G](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Porsche\_Informatik\_G](https://talk.remobjects.com/u/Porsche_Informatik_G)
#### Post date: [July 17, 2015, 8:54am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/13 "2015-07-17T08:54:56Z")

</div>

Ok, it’s working now …

This means, that I must change all interfaces to envlop in all detailled stuff (like \_\_MessageType, \_\_InterfaceName, …)?

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 17, 2015, 9:16am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/14 "2015-07-17T09:16:14Z")

</div>

you can

- change all interfaces to envlop in all detailled stuff (like \_\_MessageType, \_\_InterfaceName, …)  
or
- use [OnCustomResponseEvent](http://wiki.remobjects.com/wiki/TROIndyHTTPServer_Class#OnCustomResponseEvent), something like

```auto
TMegaDemoServerMainForm = class(TForm)
..
  procedure ROServerCustomResponseEvent(
    const aTransport: IROHTTPTransport; const aRequestStream,
    aResponseStream: TStream; const aResponse: IROHTTPResponse;
    var aHandled: Boolean);

....

procedure TMegaDemoServerMainForm.FormCreate(Sender: TObject);
...
  ROIndyHTTPServer := TROIndyHTTPServer.Create(Self);
  ROIndyHTTPServer.OnCustomResponseEvent := ROServerCustomResponseEvent; //added

...
procedure TMegaDemoServerMainForm.ROServerCustomResponseEvent(
  const aTransport: IROHTTPTransport; const aRequestStream,
  aResponseStream: TStream; const aResponse: IROHTTPResponse;
  var aHandled: Boolean);
var
  lMessage: IROMessage;
  op: TROResponseOptions;
  s: ansistring;
begin
  if pos('/xxxx',aTransport.PathInfo) = 1 then begin // "xxxx" shouldn't be defined in Server.Dispathers
    SetLength(s, aRequestStream.Size);
    aResponseStream.Position := 0;
    aRequestStream.Read(Pointer(s)^, Length(s));
    s := ' __MessageType=Message&__ InterfaceName=MegaDemoService&'+s;
    aRequestStream.Size := 0;
    aRequestStream.Write(Pointer(s)^, Length(s));

    lMessage:= (ROPOSTMessage as IROMessageCloneable).Clone;
    MainProcessMessage(lMessage,atransport,aRequestStream,aResponseStream,op);
    aHandled := True;
  end;
end;

```

in this case, .html can pass only \_\_MessageName:

```auto
<html><body><form method="POST" action="http://localhost:8099/xxxx">
__MessageName:<input type="text" name="__ MessageName" size="45" value="GetServerTime">
<input type="submit">
</form></body></html>

```

---

<div class="post-metadata">

### Author: ![Porsche\_Informatik\_G](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Porsche\_Informatik\_G](https://talk.remobjects.com/u/Porsche_Informatik_G)
#### Post date: [July 20, 2015, 8:09am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/15 "2015-07-20T08:09:37Z")

</div>

Evgeny,  
I’ve still problems …

How to start MegaDemo (GetServerTime) in the URL?

I’ve tried --\>  
[http://localhost:8099/post?\_\_MessageType=Message&\_\_InterfaceName=MegaDemoService&\_\_MessageName=GetServerTime&\_\_ClientId=b51199fe-9e86-4aa1-8cb1-54b4e05ab130](http://localhost:8099/post? __MessageType=Message&__ InterfaceName=MegaDemoService& __MessageName=GetServerTime&__ ClientId=b51199fe-9e86-4aa1-8cb1-54b4e05ab130)

… but I get the WSDL again.

And in our project, we mask (envelop) the messages in ROPostMessageReadFromStream; I think, that sure also work. But I’ll get only “Invalid Path” when I try the Monitor-function. (I’ve tried your solition, but the result is the same …)

Any ideas?

Bye,  
Peter

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [August 3, 2015, 7:33am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/16 "2015-08-03T07:33:09Z")

</div>

> [@Porsche\_Informatik\_G](#):
>
> How to start MegaDemo (GetServerTime) in the URL?

ROSDK supports only POST method instead of GET by default. however you can change this behavior with [OnCustomResponseEvent](http://wiki.remobjects.com/wiki/TROBaseHTTPServer_Class#OnCustomResponseEvent).

update MegaDemoServerMain.pas as

```auto
procedure TMegaDemoServerMainForm.ROServerCustomResponseEvent(
  const aTransport: IROHTTPTransport; const aRequestStream,
  aResponseStream: TStream; const aResponse: IROHTTPResponse;
  var aHandled: Boolean);
var
  lMessage: IROMessage;
  op: TROResponseOptions;
  s: ansistring;
begin
  if pos('/xxxx',aTransport.PathInfo) = 1 then begin // "xxxx" shouldn't be defined in Server.Dispathers
    s := aTransport.QueryString;
    aRequestStream.Size := 0;
    aRequestStream.Write(Pointer(s)^, Length(s));

    lMessage:= (ROPOSTMessage as IROMessageCloneable).Clone;
    MainProcessMessage(lMessage,atransport,aRequestStream,aResponseStream,op);
    aHandled := True;
  end;
end;

```

note: this update requires another changes from [my earlier post](http://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/14).

after this fix, you can use  
[http://localhost:8099/xxxx?\_\_MessageType=Message&\_\_InterfaceName=MegaDemoService&\_\_MessageName=GetServerTime&\_\_ClientId=b51199fe-9e86-4aa1-8cb1-54b4e05ab131](http://localhost:8099/xxxx? __MessageType=Message&__ InterfaceName=MegaDemoService& __MessageName=GetServerTime&__ ClientId=b51199fe-9e86-4aa1-8cb1-54b4e05ab131)

---

<div class="post-metadata">

### Author: ![Porsche\_Informatik\_G](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Porsche\_Informatik\_G](https://talk.remobjects.com/u/Porsche_Informatik_G)
#### Post date: [August 18, 2015, 10:39am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/17 "2015-08-18T10:39:09Z")

</div>

Mmmh,  
when I update the sample, I’ll get an error in Browser --\>

\_\_MessageType=Exception  
\_\_ExceptionClass=EROException  
\_\_ExceptionMessage=Unknown message type  
"Message&\_\_InterfaceName=MegaDemoService&\_\_MessageName=GetServerTime&\_\_ClientId=b51199fe-9e86-4aa1-8cb1-54b4e05ab131"  
\_\_Exception=EROException

Could you please post the final unit (MegaDemoServerMain.pas) ?

Bye,  
Peter

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [August 18, 2015, 10:45am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/18 "2015-08-18T10:45:04Z")

</div>

[MegaDemoServerMain.zip](https://talk.remobjects.com/uploads/default/original/2X/9/9e3da2a642d2e4ebca5bd4b28ebd5d1118627499.zip) (8.5 KB)

---

<div class="post-metadata">

### Author: ![Porsche\_Informatik\_G](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Porsche\_Informatik\_G](https://talk.remobjects.com/u/Porsche_Informatik_G)
#### Post date: [August 18, 2015, 10:58am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/19 "2015-08-18T10:58:48Z")

</div>

How to open/download the zip?

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [August 18, 2015, 11:00am UTC](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553/20 "2015-08-18T11:00:59Z")

</div>

try again

[Next page](https://talk.remobjects.com/t/indyhttp-post-get-only-wdsl-in-webbrowser/6553.md?page=2)
