Solved

how to use a webservice which created on c#t at java platform

Posted on 2010-08-30
12
367 Views
Last Modified: 2013-12-14
Hello


Previous developers created a webproject which consumes a webservice in .net platform and they wanted me to use this webservice on jsp. I read netbeans tutorials and find out that  webservice is irrelevant to platform. However the problem is at .net project I could not find a file whose extension is .wsdl or a werbservice.amsx. You can find service.cs which was implemented has webservice commands a lot. Could you please look at the Service.cs file and tell me how i can consume or use this service on a jsp file? I would be appreciated if you can help me. Because it takes my hours to read this documentation.


Best Regards
Altaico
Service.cs
0
Comment
Question by:elaltaico
  • 6
  • 6
12 Comments
 
LVL 16

Expert Comment

by:Stephan
ID: 33564571
If you want the wsdl, you can do: werbservice.amsx?WSDL
0
 

Author Comment

by:elaltaico
ID: 33564863
you meant during binding it to java i need to write it like that werbservice.amsx?WSDL ??
0
 

Author Comment

by:elaltaico
ID: 33564992
NETBEANS does not recognize ../../../Desktop/haberturkService/Service.asmx?WSDL  ... it says valid schema name
0
 
LVL 16

Expert Comment

by:Stephan
ID: 33565005
No, you need to use it as an application via web e.g. IIS. like: http://localhost/Service.asmx?WSDL

Then you can see the schema.
0
 

Author Comment

by:elaltaico
ID: 33565062
hello stephanonline yea i tried it after binding i get following error :

Compiling file:/C:/Users/Okansys/Documents/NetBeansProjects/JavaApplication1/xml-resources/jaxb/haberturk/77.92.154.132_8080/WebApplication5/web/haberturkService/Service.asmx
[ERROR] The markup in the document preceding the root element must be well-formed.
  line 1 of file:/C:/Users/Okansys/Documents/NetBeansProjects/JavaApplication1/xml-resources/jaxb/haberturk/77.92.154.132_8080/WebApplication5/web/haberturkService/Service.asmx

failure in the XJC task. Use the Ant -verbose switch for more details
C:\Users\Okansys\Documents\NetBeansProjects\JavaApplication1\nbproject\xml_binding_build.xml:17: unable to parse the schema. Error messages should have been provided
BUILD FAILED (total time: 0 seconds)


Here is my  Service.asmx file :

[code]
<%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="Service" %>
[/code]

I am looking forward for your helps..very close to answer.regards.
0
 
LVL 16

Expert Comment

by:Stephan
ID: 33565073
Can you see the wsdl self via the url or do you get an error?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:elaltaico
ID: 33565080
i used wsdl self via the url as you told me after that i got the error which i posted above.cheers
0
 
LVL 16

Expert Comment

by:Stephan
ID: 33565110
What I mean is, can you browse the wsdl through browser without errors? Not within the application.

If that's not possible, you cannot bind it.

Like so:

open browser (e.g. Firefox, IE, Chrome)
go to url of your WSDL like: http://localhost/Service.asmx?WSDL

If this is working. Could you post the code you have created in order to call a webmethod (where the error is) (the full code, not just a line where it breaks, but all the code you need to call the method)
0
 

Author Comment

by:elaltaico
ID: 33565157
After I write the link which is http://77.92.154.132:8080/WebApplication5/web/haberturkService/Service.asmx I see the codes which are : <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="Service" %>.

It means I can directly see Service.asmx.  Service.asmx calls service.cs as you see in the example. I am posting service.cs as an attachment. Thank you again. Service asmx has only one line which is:

 <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="Service" %>

Cheers



Service.cs
0
 
LVL 16

Expert Comment

by:Stephan
ID: 33565248
Well, If I see it this way. You have not compiled and published the webservice because we can read it, you need to see something like this when you open de webservice:


service.jpg
0
 

Author Comment

by:elaltaico
ID: 33565274
it means I have to compile it in c# as it was written in c# and after that i need to write http://77.92.154.132:8080/WebApplication5/web/haberturkService/Service.asmx . If I complete it successfully, I will see the service.jpg when I type http://77.92.154.132:8080/WebApplication5/web/haberturkService/Service.asmx??
0
 
LVL 16

Accepted Solution

by:
Stephan earned 500 total points
ID: 33565305
Not exactly thesame, but simular, the styling and your own methods are listed.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

1 Experts available now in Live!

Get 1:1 Help Now