Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Monday, March 26, 2012

Access not running webservice methods with only wsdl file

Hello!

I'm new to web services. I'm using Visual Studio 2005, I'm developing a web app (c#). This application will use a java web service (hosted by tomcat) on the local machine. This webservice need some config to run, but on my developer machine i cannot make this configs.
My question: I cannot run the webservice, so I cannot add it to my "Web references", so I cannot insert the function calls into my code. BUT I have a wsdl file. So, is there any way to add a web reference to my code with this wsdl? (It will not work, but i can build my project)

Many thx

Hi,

Thank you for you post!

Here:

#Web Services Integrationhttp://msdn2.microsoft.com/en-us/library/aa478995.aspx

<quote>

In order to add a Web Reference to a .NET Framework-based Web service client, the target Web service must have a WSDL document available. Apache SOAP 2.2oes not contain any support for WSDL.

</quote>

Apache AXIS, also known as Apache SOAP 3.0, supported generating WSDL files.

We have just tested and VS can add web reference using a local WSDL file.

BTW,Wsdl.exe accepts the path to the wsdl file to generate a proxy.http://msdn2.microsoft.com/en-us/library/7h3ystb6(VS.80).aspx

If you have further questions,let me know.

Best Regards,


Hy!

Thanks for your answer. I solve it strange way: I put the wsdl file to my localhost, so i can add it to my web reference list. It did not work, but i could build my project.


Hi,

I told you in my last reply:

We have just tested and VS can add web reference using a local WSDL file.

So that is the answer:)

Happy coding.

Saturday, March 24, 2012

A Simple Atlas Work,but Still have Unknown Error BUG

Simply, i Place a Textbox and a button,when i click the button, it response.write(textbox1.text)
but, when i click the button, it show a java script pop-up and show me Unknown error..

below is the code:

1Default.aspx2<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="true" ValidateRequest="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>34<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">5<html xmlns="http://www.w3.org/1999/xhtml">6<head runat="server">7 <title>ASPNET_Atlas_Testing</title>8</head>9<body>10<form id="form1" runat="server">11<div>12 <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True"/>13<!-- This section of the page is wrapped by an UpdatePanel. -->14 <atlas:updatepanel id="up" runat="server" mode="Conditional" rendermode="Inline">15 <triggers>16 <atlas:controleventtrigger controlid="TextBox1" eventname="TextChanged" />17 </triggers>18 <contenttemplate>19 <asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"></asp:TextBox><br/>20 </contenttemplate>21 </atlas:updatepanel>2223<!-- This section is also wrapped by an UpdatePanel. -->24 <atlas:updatepanel runat="server" id="up1" mode="Conditional" rendermode="Inline">25 <triggers>26 <atlas:controleventtrigger controlid="Button1" eventname="Click" />27 </triggers>28 <contenttemplate>29 <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click"/>30 </contenttemplate>31 </atlas:updatepanel>32</div>33</form>34</body>35</html>3637
1Default.vb23PartialClass _Default4Inherits System.Web.UI.Page56Protected Sub Button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Button1.Click7 Response.Write(TextBox1.Text)8End Sub910 Protected Sub TextBox1_TextChanged(ByVal senderAs Object,ByVal eAs System.EventArgs)11 Response.Write(TextBox1.Text)12End Sub13End Class1415
Check to make sure your web.config file is setup right and that your dll is in place (/bin) and not corrupt, as I'm not getting a javascript error when I try your code. It also doesn't work as you wrote it, though, and so I tried adding a label to one of the update panels and having the button change its value based on the text prop of the textbox1, and that worked fine. So I suspect that with update panels (this is just a guess) that you can't use Response.Write; whcih would make sense if you conceive of the Response object as passing a whole page rather than just the partial page the update panel is looking for.

Hi,

Remove all response.write statements & replace them with this.page.registerclientscriptblock(script);

Amit Lohogaonkar

mcp,mcad

lohogaonkaramit@.yahoo.com

Wednesday, March 21, 2012

A quesiton regarding soapheader

Dear all,

I am making a webservice client program and need to consume the service which is devleoped by java. The requirement is I need to send a soapheader which contains user and password. Is anybody can help me to do that?Thank you !!

localhost.IWSMessageService mservice = new localhost.IWSMessageService();
AuthenticationToken AuthenticationToken = new AuthenticationToken(); //this is class extended by Soapheader.

// I need pass AuthenticationToken to mservice

Response.write(mservice.getmessage());

Since you are using Java WebService you will not be able to use the builtin WebServiceProxy of Asp.net Ajax. Instead you have to use Sys.Net.WebRequest object directly to call the web methods the following link may help you to learn how to invoke the WebRequest object of Asp.net Ajax.

http://geekswithblogs.net/rashid/archive/2007/07/21/Asp.net-Ajax-and-VS2003.aspx

A namespace collision when using Java applets and ASP.NET AJAX

I use ASP.NET AJAX to get some data from a service, and a Java applet to draw the data. That works like a charm in IE. Unfortunately in Firefox I get a

Java class java.lang.String has no public field or method named "__iterator__"

error message when invloking the service from the client side. My guess is that the AtlascreateCallback script tries to call Sys.String.__iterator__, but instead Firefox gives it a reference to the Java's String class. Any ideas how to avoid that collision will be greatly appreciated.

Many thanks

I've found out what happens. The service call parameter is a string. I pass a Java String returned by the applet to the service call; that works fine in IE but breaks Firefox. If I use toString() to converto the Java String to JavaScript string, the call works fine in firefox too:

MyService.getStuff(toString(myApplet.getTheString()))

while

MyService.getStuff(myApplet.getTheString())

works only in IE.