Jump to content

Import Web Service function and WS on Java LV 8.5


Recommended Posts

Hello.

I have a strange problem with "Import Web Service" function in LabView 8.5. When I try call WSDL file from WS written in .NET then everything is ok. I skip the autentication, push Next and I can create Project Library. But when I want call WSDL file from WS written in JAVA I get error message "Validation Failed". I checked both WS in "StrikeIron Web Service Analizer" and in this application both WS work well.

Mayby I do something wrong. Or mayby LabView don't like WS from JAVA.

I need a hint certainly.

Thanks.

Link to comment

QUOTE (poiu77 @ Jul 10 2008, 11:50 PM)

I have a strange problem with "Import Web Service" function in LabView 8.5

I ran into a similar problem a few months back. I ended up having to use a separate service to build my WSDL into a dll that I could then call from LabVIEW. We never could figure out why LabVIEW didn't like our WSDL (it worked in every other validator) but the dll solution worked for us so we didn't spend too much time on it.

Link to comment

QUOTE (TobyD @ Jul 11 2008, 10:11 AM)

I ran into a similar problem a few months back. I ended up having to use a separate service to build my WSDL into a dll that I could then call from LabVIEW. We never could figure out why LabVIEW didn't like our WSDL (it worked in every other validator) but the dll solution worked for us so we didn't spend too much time on it.

I can't give you a certain answer on this, but I do a bit of PHP development on the side, and I know that there are some issue cross-communicating between PHP's SOAP client and a .NET web service...I seem to remember that it has something to do with Microsoft's implementation of the WSDL format. You might want to see what you can look up regarding how to access a .NET service from Java (there may be a few tricks to make it work).

LabView handles it just fine since it uses built-in .NET functions to generate code libraries to access the web service...

Link to comment
  • 3 months later...

QUOTE (TobyD @ Jul 11 2008, 03:11 PM)

I ran into a similar problem a few months back. I ended up having to use a separate service to build my WSDL into a dll that I could then call from LabVIEW. We never could figure out why LabVIEW didn't like our WSDL (it worked in every other validator) but the dll solution worked for us so we didn't spend too much time on it.

Hi!

How did you generate the dll? I only need to generate a dll for a web service made using Java and hosted using glassfish. I've tried using LabView 8.0 and 8.6 but I was unsuccessful for both.

Thanks.

Link to comment

QUOTE (ianalis @ Nov 4 2008, 01:41 AM)

Hi!

How did you generate the dll? I only need to generate a dll for a web service made using Java and hosted using glassfish. I've tried using LabView 8.0 and 8.6 but I was unsuccessful for both.

Thanks.

It's a multi-step process. You will need wsdl.exe. It comes with visual studio.net. If you don't have it, you can download and install the trial version (or I think VS2008 express will work too - it's free).

If you already have wsdl.exe on your system (found in C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin on my machine) then you are ready. Do a search for wsdl.exe to get more information, but the usage is essentially wsdl {parameters} {path}. For example, if my wsdl is called sample.wsdl and it is in my c:/temp directory I would use the following command: wsdl /language:CS /out:C:/Temp C:/Temp/Sample.wsdl

This should create a C# file (with .cs extension) from your wsdl. Then you can use Visual C# (from the command line or the IDE) to compile your file into a class library that is callable from LabVIEW.

I know it took me a while to figure it out the first time - hopefully this helps.

Note: If you are more comfortable with visual basic you can use the /language:VB parameter and compile from there.

Toby

Link to comment

QUOTE (TobyD @ Nov 4 2008, 04:05 PM)

It's a multi-step process. You will need wsdl.exe. It comes with visual studio.net. If you don't have it, you can download and install the trial version (or I think VS2008 express will work too - it's free).

If you already have wsdl.exe on your system (found in C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin on my machine) then you are ready. Do a search for wsdl.exe to get more information, but the usage is essentially wsdl {parameters} {path}. For example, if my wsdl is called sample.wsdl and it is in my c:/temp directory I would use the following command: wsdl /language:CS /out:C:/Temp C:/Temp/Sample.wsdl

This should create a C# file (with .cs extension) from your wsdl. Then you can use Visual C# (from the command line or the IDE) to compile your file into a class library that is callable from LabVIEW.

I know it took me a while to figure it out the first time - hopefully this helps.

Note: If you are more comfortable with visual basic you can use the /language:VB parameter and compile from there.

Toby

I'm still having problems generating the dll. I've installed .NET Framework 2.0 SDK and ran the following command:

wsdl /l:cpp /out:c:\instru helloservice.wsdl

The result is the following error:

WSDL: error WSDL1: Unable to import binding 'HelloPortBinding' from namespace 'http://endpoint/'.
      Unable to import operation 'getHello'.
      The element 'http://endpoint/:getHello' is missing.

The wsdl file is the Hello web service sample code for Java EE (glassfish). I've attached http://lavag.org/old_files/post-13821-1225885992.txt'>Download File:post-13821-1225885992.txt the wsdl file for reference. I've renamed it to .txt since I can't upload .wsdl.

Any ideas?

Link to comment

QUOTE (ianalis @ Nov 5 2008, 03:57 AM)

I'm still having problems generating the dll...
_______________________________________________________________

It looks like there is a problem with your wsdl file. I don't know much about the formatting of these files. I was only tasked with getting the services to work from an existing file. Is the schemaLocation a valid address on one of your internal servers? I can't access it and if you can't either then I think that is why it's failing. When I try to validate your wsdl in Eclipse I get the following error message...

Failed to read schema document 'http://10.32.148.253:81/Hello/HelloService?xsd=1', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

-Toby

Link to comment

QUOTE (TobyD @ Nov 5 2008, 03:58 PM)

It seems that .Net has problems with <import/> or <include/>. What I did instead was to insert the contents of the schema. So instead of

&lt;xsd:schema&gt; &lt;xsd:import namespace="http://endpoint/" schemaLocation="http://202.92.128.162:81/Hello/HelloService?xsd=1"/&gt; &lt;/xsd:schema&gt;

it becomes

&lt;xs:schema version="1.0" targetNamespace="http://endpoint/" xmlns:tns="http://endpoint/" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;    &lt;xs:element name="getHello" type="tns:getHello"/&gt;    &lt;xs:element name="getHelloResponse" type="tns:getHelloResponse"/&gt;    &lt;xs:complexType name="getHello"&gt;	 &lt;xs:sequence&gt;	   &lt;xs:element name="arg0" type="xs:string" minOccurs="0"/&gt;	 &lt;/xs:sequence&gt;   &lt;/xs:complexType&gt;    &lt;xs:complexType name="getHelloResponse"&gt;	 &lt;xs:sequence&gt;	   &lt;xs:element name="return" type="xs:string" minOccurs="0"/&gt;	 &lt;/xs:sequence&gt;   &lt;/xs:complexType&gt; &lt;/xs:schema&gt;

For more info, see this http://support.microsoft.com/kb/820122' rel='nofollow' target="_blank">article. The .Net web service browser also works with this workaround.

Thanks for all the help!

Link to comment
  • 12 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.