Expand my Community achievements bar.

SOLVED

webservice proxy with fds2

Avatar

Level 2
Hello all,



I am struggling with fds2 and currently fail to use a proxy
for my webservice.



Maybe I also misunderstand something, cause what I want to do
is I want to use the fds/webservice as proxy to gather the calls
and forward it to another webservice (who just accepts the
connections from the proxy pc)



So I configured the service_config.xml and put it into the
additional compiler arguments, but for somehow reason it even
didn´t connect to the webproxy.



Maybe I have to learn more about jrun, but from the
documentation I thought the webproxy configuration is easy to
setup.



Did someone has experience in setting up a similar scenacrio
? (maybe with other application servers)



best regards,

kcell
1 Accepted Solution

Avatar

Correct answer by
Former Community Member
That stream error means that the client still isn't
connecting to your FDS

endpoint... can you check that the endpoint is contactable
from a browser?

Did you look at the server console or server logs for any
configuration errors

during startup?





Pete





View solution in original post

7 Replies

Avatar

Former Community Member
What URL are you using to load your SWF and how does this
compare to the

URL used in the channel-definition endpoint to contact the
proxy service?





Avatar

Level 2
Hi Peter,



So my current installation looks like the follwing:

Server A:

- Apache server for SWF file

- JRun server for the webservice proxy

- (also my development machine)



Server B

- IIS with and ASP webservice



I have played around with the entries in service-config.xml
and proxy-config.xml files, so I here is the current state (which
is still not working):



service-config.xml:

...

<channel-definition id="myWS"
class="mx.messaging.channels.HTTPChannel">

<endpoint uri="
http://anhalt/OMTest/"
class="flex.messaging.endpoints.HTTPEndpoint"/>

</channel-definition>

...



proxy-config.xml:

..

<destination id="myWS" adapter="soap-proxy">

<adapter ref="soap-proxy" />

<properties>

<wsdl>
http://anhalt/OMTest/Service1.asmx?WSDL</wsdl>

<soap>
http://anhalt/OMTest/</soap>

</properties>

</destination>

...



One thing I have done (which might be wrong) was that I
removed the "{context.root}" from most service, cause otheriwse I
couldn´t compile the mxmml ( I used destination="myWS" and the
service-config.xml is the same as Jrun used. )



Would it help if I post the debug output (with mx:TraceTarget
on )?



Thank you,

kcell

Avatar

Level 2
Hi Peter,



I now found what the {context.root} is used for (and that
there is another compiler setting ( ... -context-root=/helloworld
..) , but the webproxy is still not running as expected.



best regards,

kcell

Avatar

Former Community Member
Ah, you've confused what a channel endpoint is, and what the
proxy service

will "proxy" for your when contacting your WebService.



Your channel-definition endpoint should NOT be pointed at
your WebService

- it should be pointed at the FDS server endpoint as it has
the proxy service

that you want to proxy through.



However, you may have complicated things by having an Apache
server and a

JRun server on Server A (unless you've successfully used a
connector so that

Apache redirects requests to JRun?). If you are using a
connector and Apache

and JRun receive web requests on the same port then you could
do this:



<channel-definition id="myWS"
class="mx.messaging.channels.HTTPChannel">

<endpoint uri="
http://{server.name}:{server.port}/helloworld/messagebroker/http"


class="flex.messaging.endpoints.HTTPEndpoint"/>

</channel-definition>



But, if you have different ports for calling your SWF from
apache and sending

data to FDS on JRun, then you can't rely on {server.name} and
{server.port}

tokens, so it would have to look something like this:



<channel-definition id="myWS"
class="mx.messaging.channels.HTTPChannel">

<endpoint uri="
http://yourjrunserver:8100/helloworld/messagebroker/http"


class="flex.messaging.endpoints.HTTPEndpoint"/>

</channel-definition>



But, in order for your SWF loaded from
http://yourapacheserver:8080/yourapp.swf


to contact
http://yourjrunserver:8100/...
you'd need to host a crossdomain.xml

file at
http://yourjrunserver:8100/crossdomain.xml
and setup a policy so

that at least SWFs from yourapacheserver can contact it (I
hope you see why

it's easier to host SWFs on the same web application server
as FDS so that

you can avoid these security sandbox considerations! ).



(...and note you can rely on the {context-root} token instead
of hard coding

"/helloworld" into the endpoint location now that you're
aware of the -context-root

compiler argument).





Then, your proxy-service destination should look something
like this:



<destination id="myWS" adapter="soap-proxy">

<adapter ref="soap-proxy" />

<properties>

<wsdl>
http://anhalt/OMTest/Service1.asmx?WSDL</wsdl>

<soap>
http://anhalt/OMTest/*</soap>

</properties>

</destination>





The reason is that you first need to get the Flash Player to
connect to FDS,

and then FDS's proxy service will end up contacting your web
service.



Another alternative is to just take FDS out of the picture
entirely if you

control the contents of the server hosting your .NET web
service. Simply

setup a /crossdomain.xml policy file on that IIS server and
you don't need

to use a proxy or FDS at all.





Avatar

Level 2
Hi Peter,



thanks for you detailed answer, but it still doesn´t
work. :(



I have the impression that the proxy service of jrun
doesn´t run (for somehow reason), cause the debug ouput shows

...

9BA8EE4D-EEFC-BC96-47F3-45E1BCAC235E' producer channel
faulted with Channel.Ping.Failed [IOErrorEvent type="ioError"
bubbles=false cancelable=false eventPhase=2 text="Error #2032:
Stream Error. ....





How can I test if the proxy runs under the expected URL like
("
http://yourjrunserver:8100/helloworld/messagebroker/http"
)?



Should the webbrowser show something? Should netstat -ano
show a listening service at the port?



The system structure is made cause the customer didn´t
want any IIS/MS pcs outside of the firewall (security). So our
first thought was to put the FDS/lifecycle as proxy outside the
firewall. We also know that FDS can more much more things .



Beside this problem I like to ask if you an recommend a book
to get more infos about the FDS/lifecycle or also Jrun?



best regards,

kcell











Avatar

Correct answer by
Former Community Member
That stream error means that the client still isn't
connecting to your FDS

endpoint... can you check that the endpoint is contactable
from a browser?

Did you look at the server console or server logs for any
configuration errors

during startup?





Pete





Avatar

Level 2
Hi Pete,



found it finally. As you mention the endpoint was not
contactable, tried with the default "/flex/messagebroker/http" and
it worked, so the fault was that I used a "context-root", which was
not valid.



I guess I have to build my own app/context and use this one.

Never worked with java appliaction servers before, so I think
I have to learn a lot.



Thank you very much for your help and patience ;)



best regards,

kcell

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----