Skip to main content

Hi,

I have created a webservice and hosted in Enterprise server.

Example like this:

IP: 172.20.111.###:3001

Implementation package: http://tempuri.org/wmapserv

I am to use the service using the Client generation in Net express.

Please guide, how to expose this service to other Applications.


#netexpress

Hi,

I have created a webservice and hosted in Enterprise server.

Example like this:

IP: 172.20.111.###:3001

Implementation package: http://tempuri.org/wmapserv

I am to use the service using the Client generation in Net express.

Please guide, how to expose this service to other Applications.


#netexpress

You have this question posted in the Visual COBOL forum of the community site although it appears to be related to Net Express.

Are you using Net Express to create the service or Visual COBOL SOA?

When you create a web service and host it under Enterprise Server a .WSDL file will automatically be created for the web service.

For example, I created a new service in a Net Express project which resides in the C:\\testservice folder.

By default, the WSDL file will be generated in the following location given that I have named the actual web service "nxwebservice".

    C:\\testservice\\testservice\\REPOS\\nxwebservice.deploy\\nxwebservice.WSDL

This WSDL file can be used as input to programs written in other languages which are capable of calling Web Services via SOAP. It contains all of the information for the location of the web service and the parameters that are required.

One example is to call this service from within a .NET application, you can add a web reference to the project which points to this .WSDL file. This will automatically generate the class and methods for you that will allow you to instantiate the service and call its methods.

This can be done from a COBOL client, a C# client, VB client etc.

When you are generating a client in Net Express then this is meant to be used within COBOL only. You can modify the generated client so that it is callable from another COBOL program that will supply the required parameters instead of using the console input method used by the generated source.

Thanks.


Hi,

I have created a webservice and hosted in Enterprise server.

Example like this:

IP: 172.20.111.###:3001

Implementation package: http://tempuri.org/wmapserv

I am to use the service using the Client generation in Net express.

Please guide, how to expose this service to other Applications.


#netexpress

Hi Chris, Thanks.  

I hosted my webservice in enterprise server using NEt express in my development machine. I want to access that service from another machine in the same network. I am trying the below example of using xmlhttprequest. It is not working. Can you help me with a code snipped to access the webservice.

pavanarya.wordpress.com/.../calling-a-web-service-from-javascript-using-xmlhttprequest


Hi,

I have created a webservice and hosted in Enterprise server.

Example like this:

IP: 172.20.111.###:3001

Implementation package: http://tempuri.org/wmapserv

I am to use the service using the Client generation in Net express.

Please guide, how to expose this service to other Applications.


#netexpress

What does "It is not working" mean? You have to describe the symptoms for anyone to be able to offer any advice.

The blog post you cite shows an example of calling a particular SOAP web service. It won't work for any other web service without changes. The URL, SOAPAction header, and request body will all need to be correct for the service you've defined.

Creating a well-formed SOAP request by hand, as the author of that blog post does, is not trivial. This is really not a good way to create a web service client.

We could probably be more helpful if you explained what it is you're trying to accomplish.


Hi,

I have created a webservice and hosted in Enterprise server.

Example like this:

IP: 172.20.111.###:3001

Implementation package: http://tempuri.org/wmapserv

I am to use the service using the Client generation in Net express.

Please guide, how to expose this service to other Applications.


#netexpress

Hi Michael,

I am trying to access the web service using the below code.

<%

Set oXmlHTTP = CreateObject("MSXML2.ServerXMLHTTP")

oXmlHTTP.setOption(2) = 13056

oXmlHTTP.Open "POST", "http://WSDL_URL_ADDRESS", False

oXmlHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"

oXmlHTTP.setRequestHeader "Content-Length", "length"

SOAPRequest = _

 "<soapenv:Envelope xmlns:soapenv=""schemas.xmlsoap.org/.../"" >" &_

   "<soapenv:Header/>" &_

     "<soapenv:Body>" &_

      "<wsin:LegalEntityList/>" &_

       "</soapenv:Body>" &_

       "</soapenv:Envelope>"

oXmlHTTP.send SOAPRequest

response.write oXmlHTTP.responseText

%>

 

I am trying to create a web service which can be accessed from other applications. I tried the sample code which is already there.

http://supportline.microfocus.com/documentation/books/nx40/gsdmap.htm

I created only Read operation and hosted the service in Enterprise server. Now i am trying to access this web service using some client code.

Please suggest me the proper method to do this.

 


Hi,

I have created a webservice and hosted in Enterprise server.

Example like this:

IP: 172.20.111.###:3001

Implementation package: http://tempuri.org/wmapserv

I am to use the service using the Client generation in Net express.

Please guide, how to expose this service to other Applications.


#netexpress

Well, for one thing, you don't have a SOAPAction header. So that's not a valid SOAP request. I don't think the value of the SOAPAction header matters for ES, but I believe it needs to appear. So you need oXmlHTTP.setRequestHeader "SOAPAction", "" or similar.

I can't tell from your post whether "http://WSDL_URL_ADDRESS" is just a placeholder you used in the post in place of the real URL, or if that's what's actually in your code. And the code you posted sets the Content-Length header value to "length", which is not valid; it has to be the length, in bytes, of your actual request message. Probably you want something like this, after setting the SOAPRequest variable:

oXmlHTTP.setRequestHeader "Content-Length", Len(SOAPRequest)

as well as fixing the other problems.


I also don't know what this line of code is supposed to be doing:

oXmlHTTP.setOption(2) = 13056

That doesn't even appear to be the correct syntax for the setOption method (though I admit I am happy to know as little as possible about Visual BASIC); setting an option to a hard-coded magic number is rarely a good idea; and option 2 appears to control server certificate checks, so this is both a bad idea and should be completely unnecessary.

All that said: a much better idea is to use a SOAP client API of some sort to build and make the request. Creating valid SOAP requests by hand is not trivial. That's the proper way to invoke a SOAP web service. I don't know what environments you need to support, so I can't suggest a specific API to use, but you might start with this MSDN article.


Hi,

I have created a webservice and hosted in Enterprise server.

Example like this:

IP: 172.20.111.###:3001

Implementation package: http://tempuri.org/wmapserv

I am to use the service using the Client generation in Net express.

Please guide, how to expose this service to other Applications.


#netexpress

Hi Michael,

Thanks for your help. I have modified the web service.

<%

Set oXmlHTTP = CreateObject("MSXML2.ServerXMLHTTP")

oXmlHTTP.Open "POST", "localhost/.../service.wsdl", False

oXmlHTTP.setRequestHeader "SOAPAction", "localhost/.../service.wsdl"

oXmlHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"

oXmlHTTP.setRequestHeader "Content-Length", "length"

SOAPRequest = _

 "<soapenv:Envelope xmlns:soapenv=""schemas.xmlsoap.org/.../"" xmlns:wsin=""tempuri.org/wmapserv"">" &_

   "<soapenv:Header/>" &_

     "<soapenv:Body>" &_

      "<wsin:Read/>" &_

       "</soapenv:Body>" &_

       "</soapenv:Envelope>"

oXmlHTTP.send SOAPRequest

response.write oXmlHTTP.responseText

%>

localhost/.../service.wsdl - The location where i kept my WSDL file.

http://172.20.111.155:86/ - I have hosted the service in an instance named TEST in enterprise server

http://tempuri.org/wmapserv - Namespace given while hosting service in enterprise server

Please let me know if this is correct or what i need to change now.

Regards,

Senthil


Hi,

I have created a webservice and hosted in Enterprise server.

Example like this:

IP: 172.20.111.###:3001

Implementation package: http://tempuri.org/wmapserv

I am to use the service using the Client generation in Net express.

Please guide, how to expose this service to other Applications.


#netexpress

The value of the Content-length header has to be the length of the message-body, not the string "length", which doesn't mean anything.

Look, I'll say this once more: Trying to create a SOAP request by hand is a bad idea. It's an especially bad idea if you don't understand the HTML and SOAP specifications.


Hi,

I have created a webservice and hosted in Enterprise server.

Example like this:

IP: 172.20.111.###:3001

Implementation package: http://tempuri.org/wmapserv

I am to use the service using the Client generation in Net express.

Please guide, how to expose this service to other Applications.


#netexpress

Senthil, please take another look at my original response to this question.

You can use the WSDL file generated by Net Express during deployment as input to create a .NET client automatically, which will shield you from the underlying details of the SOAP request itself.

You can do this by adding a Web Reference to the project and then intantiating and calling the methods directly on the class that is generated for you...

Thanks.