Avatar billede fredand Forsker
03. april 2008 - 20:58 Der er 4 kommentarer

Problems playing around with webservice between Java and .NET

Hello Guys!

I sitting at home and play around with webservices.
We have deployed an webservice in a IIS 7 at our LAN.

We can without any problem reach the wsdl from a web browser from any computer at:
http://dator1:800/myservice.svc?wsdl

We can also reach a page at:
http://dator1:800/myservice.svc

I can then create a client package with:
    <target name="gen_client_stub" depends="taskdef">
        <property name="wsdlUrl" value="http://dator1:800/myservice.svc?wsdl" />

          <clientgen wsdl="${wsdlUrl}"
              packageName="myservice.client"
            clientJar="/home/fredrik/eclipse_workspace/webservicecaller/myservice_client.jar" >
            <classpath>
                <pathelement path="/home/fredrik/Applications/bea/weblogic81/server/lib/weblogic.jar"/>
                <pathelement path="/home/fredrik/Applications/bea/weblogic81/server/lib/webservices.jar"/>
            </classpath>
        </clientgen>
</target>

I can also set up a project with soapUi and get a request:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
  <soap:Header/>
  <soap:Body>
      <tem:GetCat>
        <!--Optional:-->
        <tem:catID>?</tem:catID>
      </tem:GetCat>
  </soap:Body>
</soap:Envelope>

But when I try to use the myservice_client.jar from a java app I just get:
<detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">java.io.IOException: The server at http://dator1:800/myservice.svc returned a 500 error code (Internal Server Error).  Please ensure that your URL is correct, and the web service has deployed.

And from soapUI I just get a TimeOut:
Thu Apr 03 20:29:13 CEST 2008:ERROR:java.net.SocketTimeoutException: Read timed out
  java.net.SocketTimeoutException: Read timed out

But if we try to call it from a client inside the .Net environment on the same machine as the webservice resides, then it answers as it should.

If any one got any idea please let us know.

Best regards
Fredrik
Avatar billede lborupj Nybegynder
04. april 2008 - 19:38 #1
Do you perhaps use a proxy which is already configured in your browser?
Avatar billede fredand Forsker
05. april 2008 - 08:57 #2
Hello Iborupj!

Thanks for your reply
(Btw I'm looking at your other comment regarding the BMT-MDB, really interesting! I will get back to you asap!)

No, we are not using any proxy. (I hope)
We have a small LAN with 3 computers.
Dator1 host the webservice at a IIS7.
From Dator1 we can run a webservice client (developed in .NET) to the webservice.

From Dator2 (win2000) we reach the following urls through a browser:
http://dator1:800/myservice.svc
http://dator1:800/myservice.svc?wsdl

From Dator3 (linux) we also can reach the urls.
We can also generate the client pack with wsdl2java.
We can also setup the soapUI, (I guess it also generates some client pack).
But we can not call the webservice from either soapUI or using the client pack.

I guess next step is install soapui on Dator1 and se if that works.
I also guess my friend quickly bundled the webservice client bundled in .NET into a .exe. So we will try that one out asap.

But if you have any idea just let us know!

Best reagrds
Fredrik
Avatar billede lborupj Nybegynder
05. april 2008 - 09:43 #3
Its a tough nut to crack based on your information - Given the fact that you received a Fault containing a HTTP 500 (Internal Server Error) I'd say you probably send an invalid request (wrong format or not formatted correctly (missing headers, wrong input-types etc) but a look in the server log should give you a Hint as to why it responded with a 500 error. Also, since you call from Java to .Net you have to make sure you use document/literal style webservices and try to follow the WS-I Basic Profile.

Cheers, Lars Borup Jensen
http://www.it-arbejde.dk
Avatar billede fredand Forsker
29. december 2010 - 21:29 #4
Hola amigo!

I never solved this but your answers was most interesting, pleas leave a svar so I can reward you mate!

Best regards
Fredrik
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester